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 |
|---|---|---|---|---|---|---|---|---|
9135514c016c0d5d022cbd96cab7d7842c199cb7 | Prepare v1.2.268.dev | xfouloux/Flexget,sean797/Flexget,ZefQ/Flexget,cvium/Flexget,Flexget/Flexget,vfrc2/Flexget,drwyrm/Flexget,tsnoam/Flexget,sean797/Flexget,ibrahimkarahan/Flexget,lildadou/Flexget,v17al/Flexget,jacobmetrick/Flexget,oxc/Flexget,xfouloux/Flexget,dsemi/Flexget,ratoaq2/Flexget,spencerjanssen/Flexget,vfrc2/Flexget,grrr2/Flexget... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
c6188489a00a1e853a7f5acffc0588bc33bad6b7 | Prepare v1.2.280.dev | offbyone/Flexget,grrr2/Flexget,vfrc2/Flexget,Danfocus/Flexget,cvium/Flexget,grrr2/Flexget,JorisDeRieck/Flexget,tarzasai/Flexget,offbyone/Flexget,tobinjt/Flexget,lildadou/Flexget,ianstalk/Flexget,spencerjanssen/Flexget,dsemi/Flexget,ratoaq2/Flexget,Pretagonist/Flexget,ianstalk/Flexget,JorisDeRieck/Flexget,offbyone/Flexg... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
6b044a8f10125ece1049879605354865329bcc6b | Prepare v2.21.19.dev | ianstalk/Flexget,malkavi/Flexget,Flexget/Flexget,malkavi/Flexget,gazpachoking/Flexget,ianstalk/Flexget,crawln45/Flexget,crawln45/Flexget,gazpachoking/Flexget,Flexget/Flexget,Flexget/Flexget,crawln45/Flexget,Flexget/Flexget,ianstalk/Flexget,malkavi/Flexget,crawln45/Flexget,malkavi/Flexget | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
076f1dc0d9f9e2a64b4575c419aef945756d4b0c | Prepare v2.20.28.dev | crawln45/Flexget,malkavi/Flexget,crawln45/Flexget,malkavi/Flexget,Flexget/Flexget,crawln45/Flexget,JorisDeRieck/Flexget,gazpachoking/Flexget,crawln45/Flexget,ianstalk/Flexget,malkavi/Flexget,ianstalk/Flexget,Flexget/Flexget,JorisDeRieck/Flexget,gazpachoking/Flexget,Flexget/Flexget,ianstalk/Flexget,malkavi/Flexget,Joris... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
c77e51ec5a9efb54d41e20797da2e68433bf64aa | test commit | svimanet/IRC-Bob | modules/reminders.py | modules/reminders.py | import time
import json
import os
# Returns the list of reminders as dict.
# @return reminders - Python Dictionary
def get_reminders():
file = "{}/reminders.json".format(os.path.dirname(os.path.realpath(__file__)))
with open(file, "r") as data_file:
reminders = json.load(data_file)
return reminders... | import time
import json
import os
# Returns the list of reminders as dict.
# @return reminders - Python Dictionary
def get_reminders():
file = "{}/reminders.json".format(os.path.dirname(os.path.realpath(__file__)))
with open(file, "r") as data_file:
reminders = json.load(data_file)
return reminders... | unlicense | Python |
cbe047024409f07dce7fba4c4a0ab094813fd388 | Remove unnecessary attrs from __init__. | foliant-docs/foliant | foliant/__init__.py | foliant/__init__.py | """
**Foliant** is a documentation generator that builds PDF, Docx, and TeX output
from a single Markdown source. It also uploads Docx files to Google Drive
as Google Documents.
"""
__version__ = "0.4.5"
| """
**Foliant** is a documentation generator that builds PDF, Docx, and TeX output
from a single Markdown source. It also uploads Docx files to Google Drive
as Google Documents.
"""
__name__ = "foliant"
__description__ = "Documentation generator that builds PDF, Docx, and TeX from\
a single Markdown source."
__aut... | mit | Python |
a4a783d4478efe6345d9d2b27efd6d95dd6acc93 | Bump version to 0.3.3. | foliant-docs/foliant | foliant/__init__.py | foliant/__init__.py | """
**Foliant** is a documentation generator that builds PDF, Docx, and TeX output
from a single Markdown source. It also uploads Docx files to Google Drive
as Google Documents.
"""
__name__ = "foliant"
__description__ = "Documentation generator that builds PDF, Docx, and TeX from\
a single Markdown source."
__aut... | """
**Foliant** is a documentation generator that builds PDF, Docx, and TeX output
from a single Markdown source. It also uploads Docx files to Google Drive
as Google Documents.
"""
__name__ = "foliant"
__description__ = "Documentation generator that builds PDF, Docx, and TeX from\
a single Markdown source."
__aut... | mit | Python |
690a1bba1b1a36ca71fdfd6f81d61bdc8e130d25 | Update to use dev version again. | arokem/sklearn-forest-ci,scikit-learn-contrib/forest-confidence-interval,uwescience/sklearn-forest-ci,scikit-learn-contrib/forest-confidence-interval,uwescience/sklearn-forest-ci,arokem/sklearn-forest-ci | forestci/version.py | forestci/version.py | # Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
_version_major = 0
_version_minor = 6
_version_micro = '' # use '' for first of series, number for 1 and above
_version_extra = 'dev'
# _version_extra = '' # Uncomment this for full releases
# Construct full version string from these.
_ver... | # Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
_version_major = 0
_version_minor = 5
_version_micro = 1 # use '' for first of series, number for 1 and above
# _version_extra = 'dev'
_version_extra = '' # Uncomment this for full releases
# Construct full version string from these.
_ver ... | mit | Python |
5630a96b77d578570ca946367e75f85586c44a92 | Use isinstance() instead of callable() | kkampardi/Plinth,harry-7/Plinth,harry-7/Plinth,kkampardi/Plinth,kkampardi/Plinth,harry-7/Plinth,kkampardi/Plinth,vignanl/Plinth,vignanl/Plinth,vignanl/Plinth,freedomboxtwh/Plinth,freedomboxtwh/Plinth,vignanl/Plinth,jvalleroy/plinth-debian,freedomboxtwh/Plinth,jvalleroy/plinth-debian,jvalleroy/plinth-debian,harry-7/Plin... | plinth/service.py | plinth/service.py | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | agpl-3.0 | Python |
45085f626e028ab33e14025612903e69132675ca | make .scancookie command active, check admin | rascul/botwot | plugins/cookie.py | plugins/cookie.py | import random
import requests
from bs4 import BeautifulSoup
from pyaib.plugins import keyword, plugin_class
from pyaib.db import db_driver
@plugin_class
@plugin_class.requires('db')
class Cookie(object):
def __init__(self, context, config):
self.db = context.db.get('cookies')
self.cookies = list(self.db.getAll(... | import random
import requests
from bs4 import BeautifulSoup
from pyaib.plugins import keyword, plugin_class
from pyaib.db import db_driver
@plugin_class
@plugin_class.requires('db')
class Cookie(object):
def __init__(self, context, config):
self.db = context.db.get('cookies')
self.cookies = list(self.db.getAll(... | apache-2.0 | Python |
b7761ec147bec892971e5947b071f768dbee74ba | Fix lookup of products by name | project-ncl/pnc-cli,janinko/pnc-cli,thauser/pnc-cli,thauser/pnc-cli,janinko/pnc-cli,project-ncl/pnc-cli,project-ncl/pnc-cli,janinko/pnc-cli,thauser/pnc-cli | pnc_cli/common.py | pnc_cli/common.py | import argh.exceptions
import pnc_cli.utils as utils
"""
Utility module that contains generalized API calls for use in other modules.
"""
def id_exists(api, search_id):
"""
Test if an ID exists within any arbitrary API
:param api: api to search for search_id
:param search_id: id to test for
:ret... | import argh.exceptions
import pnc_cli.utils as utils
"""
Utility module that contains generalized API calls for use in other modules.
"""
def id_exists(api, search_id):
"""
Test if an ID exists within any arbitrary API
:param api: api to search for search_id
:param search_id: id to test for
:ret... | apache-2.0 | Python |
b13b55bdeee77a5e09873aa3487c1a07ee019229 | bump version number to 0.0.2 | kamarkiewicz/django-polls,kamarkiewicz/django-polls,miraculixx/django-polls,miraculixx/django-polls,byteweaver/django-polls,byteweaver/django-polls | polls/__init__.py | polls/__init__.py | __version__ = '0.0.2'
| __version__ = '0.0.1'
| bsd-3-clause | Python |
32708e1e8ac74d849dd58d6a6d9b28e827d8c4c0 | fix little happy error | tech-teach/microservice-topology,tech-teach/microservice-topology,tech-teach/microservice-topology,tech-teach/microservice-topology | htop/app.py | htop/app.py | import multiprocessing
from psutil import cpu_percent, cpu_freq, virtual_memory
from sanic.response import json
from sanic import Sanic
from sanic_cors import CORS
app = Sanic(__name__)
CORS(app)
core_count = multiprocessing.cpu_count()
def get_cpu_info():
cpu_percents = list(cpu_percent(interval=0.5, percpu... | import multiprocessing
from psutil import cpu_percent, cpu_freq, virtual_memory
from sanic.response import json
from sanic import Sanic
from sanic_cors import CORS
app = Sanic(__name__)
CORS(app)
core_count = multiprocessing.cpu_count()
def get_cpu_info():
cpu_percents = list(cpu_percent(interval=0.5, percpu... | mit | Python |
1e1ea3fc552131e7216d4a4ca09c5f57c1861b60 | remove outdated comments | fabianrost84/cython,mcanthony/cython,ABcDexter/cython,achernet/cython,cython/cython,mcanthony/cython,larsmans/cython,scoder/cython,roxyboy/cython,roxyboy/cython,fperez/cython,achernet/cython,JelleZijlstra/cython,ChristopherHogan/cython,madjar/cython,andreasvc/cython,encukou/cython,dahebolangkuan/cython,marscher/cython,... | Cython/Distutils/__init__.py | Cython/Distutils/__init__.py | from Cython.Distutils.build_ext import build_ext
from Cython.Distutils.extension import Extension
| # July 2002, Graham Fawcett
#
# this hack was inspired by the way Thomas Heller got py2exe
# to appear as a distutil command
#
# we replace distutils.command.build_ext with our own version
# and keep the old one under the module name _build_ext,
# so that *our* build_ext can make use of it.
from Cython.Distutils.build... | apache-2.0 | Python |
c13a98e2067200f7df9c3f6dfeea6d11f9221e0d | fix checking live status | back-to/streamlink,chhe/streamlink,streamlink/streamlink,back-to/streamlink,streamlink/streamlink,bastimeyer/streamlink,wlerin/streamlink,bastimeyer/streamlink,beardypig/streamlink,melmorabity/streamlink,gravyboat/streamlink,chhe/streamlink,melmorabity/streamlink,javiercantero/streamlink,beardypig/streamlink,gravyboat/... | src/streamlink/plugins/bilibili.py | src/streamlink/plugins/bilibili.py | import hashlib
import re
import time
from requests.adapters import HTTPAdapter
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, validate, useragents
from streamlink.stream import HTTPStream
API_URL = "http://live.bilibili.com/api/playurl?cid={0}&player=1&quality=0&sign={1}&otype=json"
ROOM... | import hashlib
import re
import time
from requests.adapters import HTTPAdapter
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, validate, useragents
from streamlink.stream import HTTPStream
API_URL = "http://live.bilibili.com/api/playurl?cid={0}&player=1&quality=0&sign={1}&otype=json"
ROOM... | bsd-2-clause | Python |
b36f1e110a7f9a635457ac72bb9e28793483c6d6 | update init file with docstring | dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy | disaggregator/__init__.py | disaggregator/__init__.py | """
.. module:: disaggregator
:platform: Unix
:synopsis: A package for performing disaggregation on smart meter data.
.. moduleauthor:: Phil Ngo <ngo.phil@gmail.com>
.. moduleauthor:: Miguel Perez <miguel@invalid.com>
.. moduleauthor:: Stephen Suffian <steve@invalid.com>
.. moduleauthor:: Sabina Tomkins <sabina@... | from appliance import *
from utils import *
import evaluation_metrics
import PecanStreetDatasetAdapter
from TracebaseDatasetAdapter import TracebaseDatasetAdapter
import utils
import appliance
| mit | Python |
a4dea774f24c7c127f7ae8b41e0f7b11288e921a | Mark current version as 0.7.4-alpha | Farama-Foundation/Gymnasium,dianchen96/gym,Farama-Foundation/Gymnasium,dianchen96/gym | gym/version.py | gym/version.py | VERSION = '0.7.4-alpha'
| VERSION = '0.7.3'
| mit | Python |
3d1aeea4d25e4dc9cc0a02ab569c065161819244 | change api request | learning/hacker-news | hacker-news.py | hacker-news.py | import sublime
import sublime_plugin
from .api import API
TITLE = 'Hacker News'
LIMIT = 30
loaded = 0
api = API()
class HackerNewsCommand(sublime_plugin.WindowCommand):
def run(self):
news_view = None
window = sublime.active_window()
for view in window.views():
if view.settin... | import sublime
import sublime_plugin
from .api import API
TITLE = 'Hacker News'
api = API()
class HackerNewsCommand(sublime_plugin.WindowCommand):
def run(self):
news_view = None
window = sublime.active_window()
for view in window.views():
if view.settings().get("hacker_news"... | mit | Python |
180afc641bb51f6b8136d53f52950bafd58d9bb0 | Increase FTPArticle activity timeout from 15 minutes to 30 minutes. | jhroot/elife-bot,gnott/elife-bot,jhroot/elife-bot,gnott/elife-bot,gnott/elife-bot,jhroot/elife-bot | workflow/workflow_FTPArticle.py | workflow/workflow_FTPArticle.py | import boto.swf
from boto.swf.layer1_decisions import Layer1Decisions
import json
import random
import datetime
import workflow
"""
FTPArticle workflow
"""
class workflow_FTPArticle(workflow.workflow):
def __init__(self, settings, logger, conn = None, token = None, decision = None, maximum_page_size = 100):
wor... | import boto.swf
from boto.swf.layer1_decisions import Layer1Decisions
import json
import random
import datetime
import workflow
"""
FTPArticle workflow
"""
class workflow_FTPArticle(workflow.workflow):
def __init__(self, settings, logger, conn = None, token = None, decision = None, maximum_page_size = 100):
wor... | mit | Python |
90d16229da275c94fe46ff2f1c4bf701d8d96f83 | bump to 0.6.3 | tsuru/hm | hm/__init__.py | hm/__init__.py | # Copyright 2016 hm authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = '0.6.3'
| # Copyright 2016 hm authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = '0.6.2'
| bsd-3-clause | Python |
b382c57e84d239f3f239f9e2587a3559e704f071 | Exclude uri fields from EventResource | yvan-sraka/wprevents,yvan-sraka/wprevents,yvan-sraka/wprevents,ppapadeas/wprevents,ppapadeas/wprevents,ppapadeas/wprevents,yvan-sraka/wprevents | mozcal/events/api.py | mozcal/events/api.py | from tastypie.resources import ModelResource
from models import Event
from mozcal.base.serializers import MozcalSerializer
class EventResource(ModelResource):
class Meta:
queryset = Event.objects.all()
filtering = {
"title": ('startswith',),
}
allowed_methods = ['get']
include_resource_ur... | from tastypie.resources import ModelResource
from models import Event
from mozcal.base.serializers import MozcalSerializer
class EventResource(ModelResource):
class Meta:
queryset = Event.objects.all()
filtering = {
"title": ('startswith',),
}
allowed_methods = ['get']
serializer = Mozca... | bsd-3-clause | Python |
0c259d625206c90a3cada5fdafae908beae7a954 | Update connection | sartim/MySql-Python-Import-Script | mysql_/connection.py | mysql_/connection.py | # Interface for MySQL Database
import mysql.connector
# For connection error handling
from mysql.connector import errorcode
def connect():
# Establish a MySQl connection
db = None
try:
db = mysql.connector.connect(user='username', password='password', host='host', database='database')
retu... | # Interface for MySQL Database
import mysql.connector
# For connection error handling
from mysql.connector import errorcode
def connect():
# Establish a MySQl connection
db = None
try:
db = mysql.connector.connect(user='root', password='MySqlAcn', host='127.0.0.1', database='test')
return ... | mit | Python |
f638f78b7ef8832e79161fb12820d1730040eda7 | Use training_limit properly in get_samples | lrvick/synt | utils/db.py | utils/db.py | """Functions that interact with or initial the database."""
import os
import sqlite3
import synt.settings as settings
def db_init():
"""Initializes the sqlite3 database."""
if not os.path.exists(settings.DB_FILE):
conn = sqlite3.connect(settings.DB_FILE)
cursor = conn.cursor()
cur... | """Functions that interact with or initial the database."""
import os
import sqlite3
import synt.settings as settings
def db_init():
"""Initializes the sqlite3 database."""
if not os.path.exists(settings.DB_FILE):
conn = sqlite3.connect(settings.DB_FILE)
cursor = conn.cursor()
cur... | agpl-3.0 | Python |
f75ab770f47e6b690130827968540e93cdbcaa0e | Change th environment variable | JulienBalestra/enjoliver,JulienBalestra/enjoliver,nyodas/enjoliver,kirek007/enjoliver,nyodas/enjoliver,kirek007/enjoliver,kirek007/enjoliver,nyodas/enjoliver,kirek007/enjoliver,JulienBalestra/enjoliver,JulienBalestra/enjoliver,nyodas/enjoliver,nyodas/enjoliver,JulienBalestra/enjoliver,kirek007/enjoliver | validate.py | validate.py | #! /usr/bin/env python
import os
import unittest
class TestValidateBootcfgAssets(unittest.TestCase):
cwd = os.path.dirname(os.path.abspath(__file__))
bootcfg = os.getenv("CHECK_BOOTCFG_PATH", "%s/bootcfg" % cwd)
assets = "%s/assets" % bootcfg
def test_cni(self):
rule = "%s/%s/serve" % (self.a... | #! /usr/bin/env python
import os
import unittest
class TestValidateBootcfgAssets(unittest.TestCase):
cwd = os.path.dirname(os.path.abspath(__file__))
bootcfg = os.getenv("BOOTCFG_PATH", "%s/bootcfg" % cwd)
assets = "%s/assets" % bootcfg
def test_cni(self):
rule = "%s/%s/serve" % (self.assets,... | mit | Python |
f8d4de7eac9cb7eb26b58c018df15e32bde9c13a | Remove duplicate FieldPanel (#345) | JamesRamm/longclaw,JamesRamm/longclaw,JamesRamm/longclaw,JamesRamm/longclaw | longclaw/configuration/models.py | longclaw/configuration/models.py | """
Admin confiurable settings for longclaw apps
"""
from wagtail.contrib.settings.models import BaseSetting, register_setting
from wagtail.admin.edit_handlers import FieldPanel
from wagtail.snippets.edit_handlers import SnippetChooserPanel
from django.db import models
from longclaw.shipping.models import Address
@r... | """
Admin confiurable settings for longclaw apps
"""
from wagtail.contrib.settings.models import BaseSetting, register_setting
from wagtail.admin.edit_handlers import FieldPanel
from wagtail.snippets.edit_handlers import SnippetChooserPanel
from django.db import models
from longclaw.shipping.models import Address
@r... | mit | Python |
d7acee88c6e43bc72de74810a9e8257eed96067b | remove intermediary var | PySchwaben/rosettacode | price_fraction.py | price_fraction.py | """
http://rosettacode.org/wiki/Price_fraction
A friend of mine runs a pharmacy.
He has a specialised function in his Dispensary application which
receives a decimal value of currency and replaces it to a standard value.
This value is regulated by a government department.
Task: Given a floating point value between 0.... | """
http://rosettacode.org/wiki/Price_fraction
A friend of mine runs a pharmacy.
He has a specialised function in his Dispensary application which
receives a decimal value of currency and replaces it to a standard value.
This value is regulated by a government department.
Task: Given a floating point value between 0.... | mit | Python |
e77774f8ece9e806a44774f7dff1817357e4d4ed | change get_query_set to get_queryset | pegler/django-mailer-2 | django_mailer/managers.py | django_mailer/managers.py | import datetime
from django.db import models
from django_mailer import constants
class QueueMethods(object):
"""
A mixin which provides extra methods to a QuerySet/Manager subclass.
"""
def exclude_future(self):
"""
Exclude future time-delayed messages.
"""
return se... | import datetime
from django.db import models
from django_mailer import constants
class QueueMethods(object):
"""
A mixin which provides extra methods to a QuerySet/Manager subclass.
"""
def exclude_future(self):
"""
Exclude future time-delayed messages.
"""
return se... | mit | Python |
80b9ca3309be0a9788ddc09225e523de06417099 | Bump version to 0.2.2 | xrmx/django-skebby | django_skebby/__init__.py | django_skebby/__init__.py | __version__ = '0.2.2'
| __version__ = '0.2.1'
| bsd-3-clause | Python |
fed1fec2e113756082934a54862541b95436bc5b | Update __init__.py | KerkhoffTechnologies/django-connectwise,KerkhoffTechnologies/django-connectwise | djconnectwise/__init__.py | djconnectwise/__init__.py | # -*- coding: utf-8 -*-
VERSION = (0, 3, 156, 'final')
# pragma: no cover
if VERSION[-1] != "final":
__version__ = '.'.join(map(str, VERSION))
else:
# pragma: no cover
__version__ = '.'.join(map(str, VERSION[:-1]))
default_app_config = 'djconnectwise.apps.DjangoConnectwiseConfig'
| # -*- coding: utf-8 -*-
VERSION = (0, 3, 155, 'final')
# pragma: no cover
if VERSION[-1] != "final":
__version__ = '.'.join(map(str, VERSION))
else:
# pragma: no cover
__version__ = '.'.join(map(str, VERSION[:-1]))
default_app_config = 'djconnectwise.apps.DjangoConnectwiseConfig'
| mit | Python |
25637ae268f334eeb2d7aafafddec9ae9f89a186 | Remove put from zipdb | dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/blobs/zipdb.py | corehq/blobs/zipdb.py | from __future__ import absolute_import
from os.path import commonprefix, join, sep
import zipfile
from corehq.blobs import DEFAULT_BUCKET
from corehq.blobs.exceptions import BadName
from corehq.blobs.interface import AbstractBlobDB, SAFENAME
class ZipBlobDB(AbstractBlobDB):
"""Blobs stored in zip file. Used for ... | from __future__ import absolute_import
import base64
from hashlib import md5
from os.path import commonprefix, join, sep
import zipfile
from corehq.blobs import BlobInfo, DEFAULT_BUCKET
from corehq.blobs.exceptions import BadName
from corehq.blobs.interface import AbstractBlobDB, SAFENAME
class ZipBlobDB(AbstractBlo... | bsd-3-clause | Python |
9f7e295742ce651344255f4cbb9dcc7dda8ba5e1 | Bump version to 0.3.2 | codeinthehole/csvfilter | csvfilter/__init__.py | csvfilter/__init__.py | import csv
import sys
# Avoid issue with fields larger than max size
csv.field_size_limit(sys.maxsize)
VERSION = '0.3.2'
class Processor(object):
def __init__(self, fields=None, invert=False, delimiter=',',
quotechar='"', skip=0):
self.fields = fields
self.invert = invert
se... | import csv
import sys
# Avoid issue with fields larger than max size
csv.field_size_limit(sys.maxsize)
VERSION = '0.3.1'
class Processor(object):
def __init__(self, fields=None, invert=False, delimiter=',',
quotechar='"', skip=0):
self.fields = fields
self.invert = invert
se... | mit | Python |
7fd97530496bf035405d3ca5e60514870af1669d | update typos for last commit. | eXcomm/gateway,CryptArc/gateway,jorik041/gateway,eXcomm/gateway,CryptArc/gateway,eXcomm/gateway,CryptArc/gateway,darkwallet/gateway,darkwallet/gateway,darkwallet/gateway,jorik041/gateway,jorik041/gateway | daemon/txrad/txrad.py | daemon/txrad/txrad.py | import sys
import threading
import tx_sentinel
class TxRadar:
radar_hosts = 20
display_output = False
number_threads = 1
def __init__(self):
self._monitor_tx = {}
self._monitor_lock = threading.Lock()
self._sentinel = tx_sentinel.TxSentinel()
self._sentinel.start(
... | import sys
import threading
import tx_sentinel
class TxRadar:
radar_hosts = 20
display_output = False
number_threads = 1
def __init__(self):
self._monitor_tx = {}
self._monitor_lock = threading.Lock()
self._sentinel = tx_sentinel.TxSentinel()
self._sentinel.start(displ... | agpl-3.0 | Python |
28381a0ee043431d3a281bf2bb6c1114f78433e5 | add rxvt-unicode to i3 module | mard/dotfiles,mard/dotfiles | i3/__main__.py | i3/__main__.py | #!/bin/python
import os
import socket
from libinstall import FileInstaller, PackageInstaller
dir = os.path.dirname(__file__)
PackageInstaller.try_install('i3-wm')
PackageInstaller.try_install('i3lock')
PackageInstaller.try_install('i3status')
PackageInstaller.try_install('feh')
PackageInstaller.try_install('rxvt-unico... | #!/bin/python
import os
import socket
from libinstall import FileInstaller, PackageInstaller
dir = os.path.dirname(__file__)
PackageInstaller.try_install('i3-wm')
PackageInstaller.try_install('i3lock')
PackageInstaller.try_install('i3status')
PackageInstaller.try_install('feh')
sources = [os.path.join(dir, 'i3-config... | mit | Python |
c736942c60ae64f5837df7d5f71a572a2b895cef | Fix issue if display is not end with .x | fujiwarat/ibus,ibus/ibus,Keruspe/ibus,ueno/ibus,ibus/ibus,phuang/ibus,ueno/ibus,ibus/ibus-cros,Keruspe/ibus,ibus/ibus,ueno/ibus,j717273419/ibus,phuang/ibus,ibus/ibus,j717273419/ibus,luoxsbupt/ibus,ibus/ibus-cros,ueno/ibus,luoxsbupt/ibus,ueno/ibus,ibus/ibus-cros,luoxsbupt/ibus,fujiwarat/ibus,phuang/ibus,luoxsbupt/ibus,K... | ibus/common.py | ibus/common.py | # vim:set noet ts=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
#
# 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 Foundation; either
# version 2 of the ... | # vim:set noet ts=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
#
# 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 Foundation; either
# version 2 of the ... | lgpl-2.1 | Python |
c6dc097bef81c7751e0de72276a22282954784ce | add mcache to the list of checks in Gitlab (#1332) | DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core | tasks/constants.py | tasks/constants.py | # (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from __future__ import print_function, unicode_literals
import os
# the root of the repo
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Note: these are the names of the folder containing th... | # (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from __future__ import print_function, unicode_literals
import os
# the root of the repo
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Note: these are the names of the folder containing th... | bsd-3-clause | Python |
044b86c274c728961f4d10c87b1a9d18e80ddcc5 | Bump version to 0.16.0 | thombashi/tcconfig,thombashi/tcconfig | tcconfig/_const.py | tcconfig/_const.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
VERSION = "0.16.0"
KILO_SIZE = 1000
LIST_MANGLE_TABLE_COMMAND = "iptables -t mangle --line-numbers -L"
IPV6_OPTION_ERROR_MSG_FORMAT = "{}. --ipv6 ... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
VERSION = "0.15.0"
KILO_SIZE = 1000
LIST_MANGLE_TABLE_COMMAND = "iptables -t mangle --line-numbers -L"
IPV6_OPTION_ERROR_MSG_FORMAT = "{}. --ipv6 ... | mit | Python |
2f4401a578c5b2175ecb301033bff7b7736fdc37 | include NS in bxml init | BlackEarth/bxml,BlackEarth/bxml,BlackEarth/bxml | bxml/__init__.py | bxml/__init__.py |
import os
from bl.dict import Dict
from .xml import XML
NS = Dict(**{
"bl": "http:blackearth.us/xml",
})
JARS = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'jars') | import os
JARS = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'jars') | mpl-2.0 | Python |
f0da988a3e761c77093c5ff22277c9165e7391fb | Fix startup artifact | westernx/mayatools,westernx/mayatools | importer.py | importer.py | from __future__ import absolute_import
import os
import re
from PyQt4 import QtCore, QtGui
Qt = QtCore.Qt
from maya import cmds, mel
import ks.core.scene_name.widget as scene_name
from ks.core import product_select
class CameraSelector(product_select.Layout):
def _setup_sections(self):
super(Came... | from __future__ import absolute_import
import os
import re
from PyQt4 import QtCore, QtGui
Qt = QtCore.Qt
from maya import cmds, mel
import ks.core.scene_name.widget as scene_name
from ks.core import product_select
class CameraSelector(product_select.Layout):
def _setup_sections(self):
super(Came... | bsd-3-clause | Python |
407b64239abe42e85a405412a5f8273874027578 | complete function sample | r569594043/PythonBeginner | 05.Function.py | 05.Function.py | #-*- encoding: utf-8 -*-
# Error
#def func():
def func():
pass
def func(num, num1=1, num2=2):
print(num, num1, num2)
func(1, 3, 4) # 1 3 4
func(5) # 5 1 2
# Error
#func()
def func(**args):
for k, v in args.items():
print('key: ' + k, 'value: ' + v)
for k in args.keys():
print('key... | #-*- encoding: utf-8 -*-
var = 4
if var % 2 == 1:
print("It's a odd number")
else:
print("It's a even number")
for i in range(0, 10):
print("hello world") | apache-2.0 | Python |
63d8d5c7f219dc6b3050cf48b303ee536ae5db22 | update to the packets | wkerzendorf/tardis,kaushik94/tardis,wkerzendorf/tardis,kaushik94/tardis,Minhmo/tardis,Minhmo/tardis,kaushik94/tardis,orbitfold/tardis,utkbansal/tardis,Tobychev/tardis,orbitfold/tardis,orbitfold/tardis,Tobychev/tardis,utkbansal/tardis,Tobychev/tardis,kaushik94/tardis,Minhmo/tardis,utkbansal/tardis,wkerzendorf/tardis,orb... | tardis/montecarlo/packet_source.py | tardis/montecarlo/packet_source.py | import numpy as np
import numexpr as ne
from astropy import constants as const
class BlackBodySimpleSource(object):
"""
Simple packet source that generates packets for the Montecarlo part.
This uses the algorithm described in Bjorkman & Wood 2001 (page 4) which
references Carter & Cashwell 1975:
... | import numpy as np
import numexpr as ne
from astropy import constants as const
class BlackBodySimpleSource(object):
"""
Simple packet source that generates packets for the Montecarlo part.
This uses the algorithm described in Bjorkman & Wood 2001 (page 4) which
references Carter & Cashwell 1975:
... | bsd-3-clause | Python |
657f2faf1f7bcd1cdc6be972ac780fad0bff1252 | update notes | parrt/msan692,parrt/msan692,parrt/msan692 | hw/code/pipeline/htmlcompare.py | hw/code/pipeline/htmlcompare.py | import sys
from bs4 import BeautifulSoup
f1 = sys.argv[1]
f2 = sys.argv[2]
s1 = open(f1).read()
s2 = open(f2).read()
soup1 = BeautifulSoup(s1, 'html.parser')
soup2 = BeautifulSoup(s2, 'html.parser')
s1 = soup1.prettify()
s2 = soup2.prettify()
if s1 != s2:
sys.stderr.write("%s and %s differ\n" % (f1,f2))
else:
... | import sys
from bs4 import BeautifulSoup
f1 = sys.argv[1]
f2 = sys.argv[2]
s1 = open(f1).read()
s2 = open(f2).read()
soup1 = BeautifulSoup(s1, 'html.parser')
soup2 = BeautifulSoup(s2, 'html.parser')
s1 = soup1.prettify()
s2 = soup2.prettify()
s1 = s1.replace(' ', '').replace('\t', '').replace('\n', '').replace('\r... | mit | Python |
6fa8202dbb8031177f2b5328e8b301fd9a533ea6 | simplify for condition | hchiam/please | interpreter.py | interpreter.py | from sys import *
# functions:
def interpret():
text = open_file(argv[1]) # to use this Terminal command: python interpreter.py text.txt
text.lower() # lowercase
sentences = get_sentences(text)
# print(sentences)
words_grouped = get_words_grouped_by_sentence(sentences)
# print(words_grouped)
... | from sys import *
# functions:
def interpret():
text = open_file(argv[1]) # to use this Terminal command: python interpreter.py text.txt
text.lower() # lowercase
sentences = get_sentences(text)
# print(sentences)
words_grouped = get_words_grouped_by_sentence(sentences)
# print(words_grouped)
... | mit | Python |
c17790b202fee97b6f5637ebff4a8ac1fb814973 | Migrate data from cap_port_filter to vif_details | yamahata/tacker,waltBB/neutron_read,eayunstack/neutron,igor-toga/local-snat,suneeth51/neutron,openstack/neutron,silenci/neutron,bigswitch/neutron,virtualopensystems/neutron,blueboxgroup/neutron,openstack/neutron,cloudbase/neutron,pnavarro/neutron,jacknjzhou/neutron,blueboxgroup/neutron,dhanunjaya/neutron,igor-toga/loca... | neutron/db/migration/alembic_migrations/versions/50d5ba354c23_ml2_binding_vif_details.py | neutron/db/migration/alembic_migrations/versions/50d5ba354c23_ml2_binding_vif_details.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2014 OpenStack Foundation
#
# 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... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2014 OpenStack Foundation
#
# 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... | apache-2.0 | Python |
88be80698ff8d04282e84c56e4a3a49cb103972d | Include license in manifest | acsone/partner-contact,open-synergy/partner-contact | partner_contact_in_several_companies/__openerp__.py | partner_contact_in_several_companies/__openerp__.py | # -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version ... | # -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version ... | agpl-3.0 | Python |
a8dd886c14f3e953c9b6fcbcb0f8cb6a03a18cd9 | combine field & location functions | ipapi-co/ipapi-python | ipapi/ipapi.py | ipapi/ipapi.py |
# ipapi Python bindings (https://ipapi.co)
# API docs at https://ipapi.co/api
import sys
import argparse
from requests import get
API_KEY = ''
headers = {'user-agent': 'ipapi/ipapi-python/0.5.1'}
field_list = ['ip', 'city', 'region', 'country', 'postal',
'latitude', 'longitude', 'timezone', 'latl... |
# ipapi Python bindings (https://ipapi.co)
# API docs at https://ipapi.co/api
import sys
import argparse
from requests import get
headers = {'user-agent': 'ipapi/ipapi-python/0.4'}
API_KEY = ''
def location(ip=None, key=None):
''' Get complete geolocation data (as JSON) for given IP address '''
if ip:
... | mit | Python |
fd15716db24199dc19199783c7d84df5da29ae43 | bump version number for pypi | google/jax,tensorflow/probability,google/jax,google/jax,google/jax,tensorflow/probability | jax/version.py | jax/version.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
b0e527ea6a487bf531f37611447a139fc492afe9 | Fix sampler test | open-forcefield-group/smarty,open-forcefield-group/smarty,open-forcefield-group/smarty | smarty/tests/test_sampler.py | smarty/tests/test_sampler.py | from functools import partial
from smarty import AtomTyper, AtomTypeSampler
import smarty
from smarty.utils import get_data_filename
from unittest import TestCase
class TestAtomTypeSampler(TestCase):
def test_atomtyper(self):
basetypes_filename = get_data_filename('atomtypes/basetypes.smarts')
init... | from functools import partial
from smarty import AtomTyper, AtomTypeSampler
import smarty
from smarty.utils import get_data_filename
from unittest import TestCase
class TestAtomTypeSampler(TestCase):
def test_atomtyper(self):
basetypes_filename = get_data_filename('atomtypes/basetypes.smarts')
deco... | mit | Python |
6c922f593dba7f3604763bbb489a910dee4c915a | Add typed positional argument examples | SnoopJeDi/dotfiles,SnoopJeDi/dotfiles,SnoopJeDi/dotfiles | .vim/templates/argparse.py | .vim/templates/argparse.py | import argparse
parser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('strarg', type=str, help='A string argument')
parser.add_argument('numarg', type=float, help='A numerical a... | import argparse
parser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-x', metavar='nameofx', nargs='+', type=float, default=32*32*32, help='Helpful message about this argument... | mit | Python |
8941798daf23df1fe3ad6dd6cd652619ae3724d8 | emphasize annotation in histogram. | bsipocz/scikit-image,pratapvardhan/scikit-image,vighneshbirodkar/scikit-image,Britefury/scikit-image,youprofit/scikit-image,michaelaye/scikit-image,WarrenWeckesser/scikits-image,ofgulban/scikit-image,ofgulban/scikit-image,chintak/scikit-image,ajaybhat/scikit-image,chintak/scikit-image,Midafi/scikit-image,michaelaye/sci... | doc/examples/plot_otsu.py | doc/examples/plot_otsu.py | """
============
Thresholding
============
Thresholding is used to create a binary image. This example uses Otsu's method
to calculate the threshold value.
Otsu's method calculates an "optimal" threshold (marked by a red line in the
histogram below) by maximizing the variance between two classes of pixels,
which are ... | """
============
Thresholding
============
Thresholding is used to create a binary image. This example uses Otsu's method
to calculate the threshold value.
Otsu's method calculates an "optimal" threshold by maximizing the variance
between the two classes of pixels, which are separated by the threshold.
Equivalently, ... | bsd-3-clause | Python |
b30dbb2021dcb90c84aae2a77e811c67aa490d21 | Fix the multiscope test | google/dpy | ioc_test.py | ioc_test.py | #!/usr/bin/python
import ioc
from jazz.jazz import *
from jazz import mock
class IocTest(Describe):
def before_each(self):
reload(ioc)
def it_should_inject(self):
@ioc.Injectable
def foo():
return 'foo'
@ioc.Inject
def bar(foo=ioc.IN):
return foo
expect(bar()).toEqual('foo... | #!/usr/bin/python
import ioc
from jazz.jazz import *
from jazz import mock
class IocTest(Describe):
def before_each(self):
reload(ioc)
def it_should_inject(self):
@ioc.Injectable
def foo():
return 'foo'
@ioc.Inject
def bar(foo=ioc.IN):
return foo
expect(bar()).toEqual('foo... | mit | Python |
c79e2e91a0b75dd501eab2f9a3bd9267e93f9b28 | Update regression to load data from CSVs. | lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment | modeling/posture-to-jacobian.py | modeling/posture-to-jacobian.py | import climate
import fnmatch
import numpy as np
import os
import pandas as pd
import theanets
def matching(root, pattern):
for root, dirs, files in os.walk(root):
for fn in fnmatch.filter(files, pattern):
yield os.path.join(root, fn)
def load_markers(fn):
df = pd.read_csv(fn, index_col=... | import climate
import glob
import lmj.cubes
import numpy as np
import os
import theanets
def main(root):
files = glob.glob(os.path.join(root, '*_body.npy'))
batch = 256
nbody = np.load(files[0]).shape[1]
njacobian = np.load(files[0].replace('_body', '_fjac_400')).shape[1]
net = theanets.Regresso... | mit | Python |
c0cd878405a9dbd668288ff5bccce9a28ac19d02 | Remove dead code. | LearningRegistry/LearningRegistry,jimklo/LearningRegistry,LearningRegistry/LearningRegistry,jimklo/LearningRegistry,LearningRegistry/LearningRegistry,jimklo/LearningRegistry,jimklo/LearningRegistry,jimklo/LearningRegistry,LearningRegistry/LearningRegistry,jimklo/LearningRegistry,LearningRegistry/LearningRegistry,Learni... | LR/lr/model/resource_data.py | LR/lr/model/resource_data.py | #!/usr/bin/pyton
# Copyright 2011 Lockheed Martin
'''
Created on Mar 8, 2011
Base model class for learning registry data model
@author: jpoyau
'''
from base_model import uuid4, createBaseModel, ModelParser, defaultCouchServer, \
appConfig, couchdb
from pylons import *
from lr.lib import helpers as h
import date... | #!/usr/bin/pyton
# Copyright 2011 Lockheed Martin
'''
Created on Mar 8, 2011
Base model class for learning registry data model
@author: jpoyau
'''
from base_model import uuid4, createBaseModel, ModelParser, defaultCouchServer, \
appConfig, couchdb
from pylons import *
from lr.lib import helpers as h
import date... | apache-2.0 | Python |
116419129e4855adc7eca5346ddd821297b8a081 | Handle supergroups. Fixes #123 | healthchecks/healthchecks,iphoting/healthchecks,iphoting/healthchecks,iphoting/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,healthchecks/healthchecks,healthchecks/healthchecks | hc/front/schemas.py | hc/front/schemas.py | telegram_callback = {
"type": "object",
"properties": {
"message": {
"type": "object",
"properties": {
"chat": {
"type": "object",
"properties": {
"id": {"type": "number"},
"ty... | telegram_callback = {
"type": "object",
"properties": {
"message": {
"type": "object",
"properties": {
"chat": {
"type": "object",
"properties": {
"id": {"type": "number"},
"ty... | bsd-3-clause | Python |
02fb01cba2f1c976eeb4f8f172c8460267e1894f | Make server respect hoomd commandline arguments. | csadorf/signac,csadorf/signac | src/compdb/contrib/server.py | src/compdb/contrib/server.py | import logging
logger = logging.getLogger(__name__)
DESCR_SERVER = "Start a compDB job queue execution server."
def start_with_args(args):
return start(
timeout = args.timeout,
reload = not args.no_reload,
combine = args.combine,
logtodb = not args.no_logging)
def start(timeout = ... | import logging
logger = logging.getLogger(__name__)
DESCR_SERVER = "Start a compDB job queue execution server."
def start_with_args(args):
return start(
timeout = args.timeout,
reload = not args.no_reload,
combine = args.combine,
logtodb = not args.no_logging)
def start(timeout = ... | bsd-3-clause | Python |
07c403d8527ee43a505facda1decb13ccee75df9 | Bump version to 1.2.dev | mkdocs/mkdocs,waylan/mkdocs,mkdocs/mkdocs,mkdocs/mkdocs,waylan/mkdocs,waylan/mkdocs | mkdocs/__init__.py | mkdocs/__init__.py | #!/usr/bin/env python
# For acceptable version formats, see https://www.python.org/dev/peps/pep-0440/
__version__ = '1.2.dev1'
| #!/usr/bin/env python
# For acceptable version formats, see https://www.python.org/dev/peps/pep-0440/
__version__ = '1.1.2'
| bsd-2-clause | Python |
90b55dc6a4d5130d241a978d6a05a2a6717348d1 | fix comments | pfnet/chainer,hvy/chainer,keisuke-umezawa/chainer,keisuke-umezawa/chainer,niboshi/chainer,wkentaro/chainer,wkentaro/chainer,okuta/chainer,niboshi/chainer,hvy/chainer,wkentaro/chainer,chainer/chainer,okuta/chainer,chainer/chainer,okuta/chainer,niboshi/chainer,tkerola/chainer,chainer/chainer,niboshi/chainer,keisuke-umeza... | chainer/types.py | chainer/types.py | from typing import Any # NOQA
from typing import Optional # NOQA
from typing import Sequence # NOQA
from typing import Tuple # NOQA
from typing import Union # NOQA
from typing_extensions import Protocol # NOQA
import numbers
try:
from typing import TYPE_CHECKING # NOQA
except ImportError:
# typing.TYPE... | from typing import Any # NOQA
from typing import Optional # NOQA
from typing import Sequence # NOQA
from typing import Tuple # NOQA
from typing import Union # NOQA
from typing_extensions import Protocol # NOQA
import numbers
try:
from typing import TYPE_CHECKING # NOQA
except ImportError:
# typing.TYPE... | mit | Python |
40674ae0527c117e3f64ad3a3dc46b307fd178b7 | Bump version to 0.16.0 | kingosticks/mopidy,mokieyue/mopidy,ZenithDK/mopidy,bacontext/mopidy,swak/mopidy,quartz55/mopidy,mokieyue/mopidy,rawdlite/mopidy,vrs01/mopidy,woutervanwijk/mopidy,bacontext/mopidy,tkem/mopidy,kingosticks/mopidy,quartz55/mopidy,jcass77/mopidy,SuperStarPL/mopidy,abarisain/mopidy,bencevans/mopidy,bencevans/mopidy,jcass77/m... | mopidy/__init__.py | mopidy/__init__.py | from __future__ import unicode_literals
from distutils.version import StrictVersion as SV
import sys
import warnings
import pykka
if not (2, 7) <= sys.version_info < (3,):
sys.exit(
'Mopidy requires Python >= 2.7, < 3, but found %s' %
'.'.join(map(str, sys.version_info[:3])))
if (isinstance(pyk... | from __future__ import unicode_literals
from distutils.version import StrictVersion as SV
import sys
import warnings
import pykka
if not (2, 7) <= sys.version_info < (3,):
sys.exit(
'Mopidy requires Python >= 2.7, < 3, but found %s' %
'.'.join(map(str, sys.version_info[:3])))
if (isinstance(pyk... | apache-2.0 | Python |
de1bba8b273da4bed63ed9ac39601d38851f1b63 | Add some pyramid code to make scan() more friendly. | faassen/morepath,taschini/morepath,morepath/morepath | morepath/config.py | morepath/config.py | from copy import copy
import venusian
import sys
class Action(object):
def discriminator(self):
"""Returns an immutable that uniquely identifies this config.
Used for configuration conflict detection.
"""
raise NotImplementedError()
# XXX needs docs
def clone(self):
... | from copy import copy
import venusian
class Action(object):
def discriminator(self):
"""Returns an immutable that uniquely identifies this config.
Used for configuration conflict detection.
"""
raise NotImplementedError()
# XXX needs docs
def clone(self):
return c... | bsd-3-clause | Python |
5f4b42b42ba80a9ac4533d39a917cff223b1435c | change urls | dresl/django_choice_and_question,dresl/django_choice_and_question | mysite/settings.py | mysite/settings.py | """
Django settings for mysite project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | """
Django settings for mysite project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | apache-2.0 | Python |
f9b86237eab90bdf360a3e1be079b88cd8e94d79 | fix bug with url query generator for edge interfaces | DOAJ/doaj,DOAJ/doaj,DOAJ/doaj,DOAJ/doaj | portality/lib/edges.py | portality/lib/edges.py | # ~~EdgesIntegration:Library~~
# ~~-> Edges:Technology~~
# ~~-> Elasticsearch:Technology~~
from urllib import parse
import json
def make_url_query(**params):
query = make_query(**params)
return parse.quote_plus(json.dumps(query))
def make_query(**params):
gsq = GeneralSearchQuery(**params)
return g... | # ~~EdgesIntegration:Library~~
# ~~-> Edges:Technology~~
# ~~-> Elasticsearch:Technology~~
from urllib import parse
import json
def make_url_query(**params):
query = make_query(**params)
return parse.quote_plus(json.dumps(query))
def make_query(**params):
gsq = GeneralSearchQuery(**params)
return g... | apache-2.0 | Python |
dd7a2e07018a874f78098e8f1f0a34b4fe7935e9 | remove api key | warenix/renthse | hkhouse/opencage.py | hkhouse/opencage.py | import json
import urllib2
__author__ = 'warenix'
class OpenCage(object):
__key = None
def reverse_geocoding(self, q):
if self.__key is None:
raise ValueError('No api key. Please obtain one at https://developer.opencagedata.com/')
url = '''https://api.opencagedata.com/geocode/v1/... | import json
import urllib2
__author__ = 'warenix'
class OpenCage(object):
__key = '38ed6d20475f7bc09c88b52458d83d3c'
def reverse_geocoding(self, q):
url = '''https://api.opencagedata.com/geocode/v1/json?q={q}&key={key}&pretty=1'''.format(
q=q,
key=self.__key)
print ur... | mit | Python |
637bd7c621797d4bbc92aa23a3b8819e5b8c4b06 | Modify "ubuntu_sso_saml" to "saml2sso" | miing/mci_migo,miing/mci_migo,miing/mci_migo | identityprovider/views/utils.py | identityprovider/views/utils.py | # Copyright 2010, 2012 Canonical Ltd. This software is licensed under
# the GNU Affero General Public License version 3 (see the file
# LICENSE).
from functools import wraps
from django.conf import settings
from django.core import urlresolvers
from django.http import Http404
from identityprovider import signed
from... | # Copyright 2010, 2012 Canonical Ltd. This software is licensed under
# the GNU Affero General Public License version 3 (see the file
# LICENSE).
from functools import wraps
from django.conf import settings
from django.core import urlresolvers
from django.http import Http404
from identityprovider import signed
from... | agpl-3.0 | Python |
17620ee55533e45961167d6f4a1d016e518615e4 | Update for vim plugin changes | wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build | test/test_files.py | test/test_files.py | import pytest
@pytest.mark.parametrize("name, user, group, mode, contains", [
("/etc/apt/sources.list.d/docker.list", "root", "root", "0644", "https://download.docker.com/linux/ubuntu"),
("/git", "wicksy", "wicksy", "0755", "null"),
("/git/wicksy", "wicksy", "wicksy", "0755", "null"),
("/git/wicksy/configfiles... | import pytest
@pytest.mark.parametrize("name, user, group, mode, contains", [
("/etc/apt/sources.list.d/docker.list", "root", "root", "0644", "https://download.docker.com/linux/ubuntu"),
("/git", "wicksy", "wicksy", "0755", "null"),
("/git/wicksy", "wicksy", "wicksy", "0755", "null"),
("/git/wicksy/configfiles... | mit | Python |
55472d4d825b051da0212144732b711f23321d71 | add more tests | sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana | test/test_tools.py | test/test_tools.py | from sequana.tools import bam_to_mapped_unmapped_fastq, reverse_complement, StatsBAM2Mapped
from sequana import sequana_data
from sequana.tools import bam_get_paired_distance, GZLineCounter, PairedFastQ
from sequana.tools import genbank_features_parser
def test_StatsBAM2Mapped():
data = sequana_data("test.bam", "t... | from sequana.tools import bam_to_mapped_unmapped_fastq, reverse_complement, StatsBAM2Mapped
from sequana import sequana_data
from sequana.tools import bam_get_paired_distance, GZLineCounter, PairedFastQ
def test_StatsBAM2Mapped():
data = sequana_data("test.bam", "testing")
res = StatsBAM2Mapped(data)
def te... | bsd-3-clause | Python |
df893187f2a69ad3f00cc3c15d6fdc3fd4171df5 | fix test and tidy up load test | eEcoLiDAR/eEcoLiDAR | laserchicken/test_load.py | laserchicken/test_load.py | import os
import sys
import unittest
from laserchicken.load import load
if sys.version_info.major == 2:
import mock
else:
from unittest import mock
class TestLoad(unittest.TestCase):
_test_dir = 'TestLoad_dir'
_test_file_name = '5points.las'
_test_data_source = 'testdata'
test_file_path = os... | import os
import sys
import unittest
from laserchicken.load import load
if sys.version_info.major == 2:
import mock
else:
from unittest import mock
class TestLoad(unittest.TestCase):
_test_dir = 'TestLoad_dir'
_test_file_name = '5points.las'
_test_data_source = 'testdata'
test_file_path = os... | apache-2.0 | Python |
7265695f08e6c89ef8b5775cfaaf445028505f40 | Update swarming server CIPD ref validation regex. | luci/luci-py,luci/luci-py,luci/luci-py,luci/luci-py | appengine/swarming/cipd.py | appengine/swarming/cipd.py | # Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""CIPD-specific code is concentrated here."""
import re
# Regular expressions below are copied from
# https://chromium.googlesource.com/infra/l... | # Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""CIPD-specific code is concentrated here."""
import re
# Regular expressions below are copied from
# https://chromium.googlesource.com/infra/i... | apache-2.0 | Python |
f7b82722f39ab5bcddd4421aebb278f54e192bc7 | reorder id fields | mplewis/AppRemoteSettings | appremotesettings/admin.py | appremotesettings/admin.py | from django.contrib import admin
from django.contrib.admin import TabularInline, ModelAdmin
from .models import App, Identifier, Key
class IdentifierInline(TabularInline):
model = Identifier
extra = 1
fields = ('value', 'desc')
class KeyInline(TabularInline):
model = Key
extra = 1
fields = ... | from django.contrib import admin
from django.contrib.admin import TabularInline, ModelAdmin
from .models import App, Identifier, Key
class IdentifierInline(TabularInline):
model = Identifier
extra = 1
fields = ('desc', 'value')
class KeyInline(TabularInline):
model = Key
extra = 1
fields = ... | mit | Python |
569df46294a4bcbbfc564b119f2f10a1609cf5e4 | Complete dict sol | bowen0701/algorithms_data_structures | lc0732_my_calendar_iii.py | lc0732_my_calendar_iii.py | """Leetcode 732. My Calendar III
Hard
URL: https://leetcode.com/problems/my-calendar-iii/
Implement a MyCalendarThree class to store your events. A new event can always be added.
Your class will have one method, book(int start, int end). Formally, this represents a
booking on the half open interval [start, end), the... | """Leetcode 732. My Calendar III
Hard
URL: https://leetcode.com/problems/my-calendar-iii/
Implement a MyCalendarThree class to store your events. A new event can always be added.
Your class will have one method, book(int start, int end). Formally, this represents a
booking on the half open interval [start, end), the... | bsd-2-clause | Python |
7b3e527459ca64331370596d91c7893ab8b7ae16 | Update docstring, getting json | sorgerlab/indra,sorgerlab/belpy,johnbachman/belpy,bgyori/indra,johnbachman/belpy,sorgerlab/indra,bgyori/indra,johnbachman/belpy,bgyori/indra,johnbachman/indra,johnbachman/indra,sorgerlab/belpy,johnbachman/indra,sorgerlab/indra,sorgerlab/belpy | indra/sources/phosphoelm/api.py | indra/sources/phosphoelm/api.py | import csv
import logging
from indra.util.aws import get_s3_client
from .processor import PhosphoElmProcessor
logger = logging.getLogger(__name__)
s3_bucket = 'bigmech'
ppelm_s3_key = 'indra-db/external_databases/phosphoELM_all_2015-04.dump'
kinases_list_web = 'http://phospho.elm.eu.org/kinases.html'
def process_f... | import csv
import logging
from indra.util.aws import get_s3_client
from .processor import PhosphoElmProcessor
logger = logging.getLogger(__name__)
s3_bucket = 'bigmech'
ppelm_s3_key = 'indra-db/external_databases/phosphoELM_all_2015-04.dump'
kinases_list_web = 'http://phospho.elm.eu.org/kinases.html'
def process_f... | bsd-2-clause | Python |
53017c3bd4eff002e836d7d428a1975f53183a3a | add function writing which writes counting function results to results.txt file and covert counter object to string | Rutaju/turbo | vienas.py | vienas.py | from collections import Counter
import re
import sys
import os
def reading(x):
f = open(x, 'r+')
text = f.read()
f.close()
return text
def counting(x):
data_string = str(Counter(x))
words = re.findall(r'\w+', x)
data_words = str(Counter(words))
return "symbols " + data_string + "word... | from collections import Counter
import re
import sys
import os
def reading(x):
f = open(x, 'r+')
text = f.read()
f.close()
return text
def counting(x):
data_string = Counter(x)
words = re.findall(r'\w+', x)
data_words = Counter(words)
return data_string, data_words
#print('please sp... | mit | Python |
fa4309d1e140edf0dcd2940bf5bed1742a49af94 | Fix the viewer frame rate to be 20 FPS | MaddAddaM/LightRender,godlygeek/LightRender | viewer.py | viewer.py | import sys
import pygame
import pygame.locals
import pygame.time
pygame.init()
size = width, height = 575, 575
screen = pygame.display.set_mode(size)
label_lights = False
def up_row(x_offset):
for i in range(20):
x = x_offset + (i % 2) * 0.5
y = i * 0.5
yield x, y
def down_row(x_offset)... | import sys
import pygame
import pygame.locals
pygame.init()
size = width, height = 575, 575
screen = pygame.display.set_mode(size)
label_lights = False
def up_row(x_offset):
for i in range(20):
x = x_offset + (i % 2) * 0.5
y = i * 0.5
yield x, y
def down_row(x_offset):
for i in rang... | mit | Python |
0377db272c5535b478732fbf045a73b30a5eac00 | Update down-revision of queue migration script | privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea | migrations/versions/849170064430_.py | migrations/versions/849170064430_.py | """add enqueue_job column to smtpserver table
Revision ID: 849170064430
Revises: a63df077051a
Create Date: 2018-11-22 10:04:00.330101
"""
# revision identifiers, used by Alembic.
revision = '849170064430'
down_revision = '48ee74b8a7c8'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
... | """add enqueue_job column to smtpserver table
Revision ID: 849170064430
Revises: a63df077051a
Create Date: 2018-11-22 10:04:00.330101
"""
# revision identifiers, used by Alembic.
revision = '849170064430'
down_revision = 'a63df077051a'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
... | agpl-3.0 | Python |
53bf22497ac8db4c3533589906c87740763d9168 | Add missing version information | privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea | migrations/versions/d415d490eb05_.py | migrations/versions/d415d490eb05_.py | """v3.6: Add auth_count column to authcache table
Revision ID: d415d490eb05
Revises: 9155f0d3d028
Create Date: 2021-04-06 21:19:25.931603
privacyIDEA Version: 3.6
"""
# revision identifiers, used by Alembic.
revision = 'd415d490eb05'
down_revision = '9155f0d3d028'
from alembic import op
import sqlalchemy as sa
from... | """Add auth_count column to authcache table
Revision ID: d415d490eb05
Revises: 9155f0d3d028
Create Date: 2021-04-06 21:19:25.931603
privacyIDEA Version: 3.6
"""
# revision identifiers, used by Alembic.
revision = 'd415d490eb05'
down_revision = '9155f0d3d028'
from alembic import op
import sqlalchemy as sa
from sqlal... | agpl-3.0 | Python |
3ad640e7881903caaa9faee12aaedf9990881513 | Make batch less, because sqlite cannot handle big batches | dimka2014/weather-api,dimka2014/weather-api | weather_api/weather/management/commands/save_locations_to_database.py | weather_api/weather/management/commands/save_locations_to_database.py | from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, *args, **option... | from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, *args, **option... | mit | Python |
0ce70b6705494b6df8d234fafd5ffa8686e9e16a | use right url | DHTC-Tools/logstash-confs,DHTC-Tools/logstash-confs,DHTC-Tools/logstash-confs | job-logs/python/process_logs.py | job-logs/python/process_logs.py | #!/usr/bin/env python
import sys
import urllib2
import argparse
JOB_LOG_URL = "http://atlas-panda-jobsarchived.s3.amazonaws.com"
def download_log(date_string, save_raw=False):
"""
Download job log files from Amazon EC2 machines
parameters:
start_date - beginning date to start downloading from
e... | #!/usr/bin/env python
import sys
import urllib2
import argparse
JOB_LOG_URL = "http://atlas-panda-jobsarchived.s3.amazonaws.com"
def download_log(date_string, save_raw=False):
"""
Download job log files from Amazon EC2 machines
parameters:
start_date - beginning date to start downloading from
e... | apache-2.0 | Python |
eb67fd808851511b7359ae3006d6f553a3a63445 | Update examples/crackme_xor_obfu.py | JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton | examples/crackme_xor_obfu.py | examples/crackme_xor_obfu.py |
import smt2lib
from triton import *
# $ triton ./examples/crackme_xor_obfu.py ./samples/crackmes/crackme_xor_obfu A
def csym(instruction):
if instruction.address == 0x400891:
concretizeAllReg()
concretizeAllMem()
return
def cafter(instruction):
# [R:1] 0x400798: movsx eax, byte ptr [... |
import smt2lib
from triton import *
# $ triton ./examples/crackme_xor_obfu.py ./samples/crackmes/crackme_xor_obfu A
def csym(instruction):
if instruction.address == 0x400891:
concretizeAllReg()
concretizeAllMem()
return
def cafter(instruction):
print '%#x: %s' %(instruction.address, i... | apache-2.0 | Python |
39687c71e98904fb261908cefd357bef3d2f642f | Update maint.py | cyberkitsune/PSO2Proxy,alama/PSO2Proxy,cyberkitsune/PSO2Proxy,alama/PSO2Proxy,alama/PSO2Proxy,cyberkitsune/PSO2Proxy | proxy/plugins/maint.py | proxy/plugins/maint.py | import commands
import packetFactory
from packetFactory import SystemMessagePacket
import plugins
maintmode = False
@plugins.CommandHook("maint", "[Admin Only] Toggle maintenance mode", True)
class maintmode(commands.Command):
def call_from_client(self, client):
global maintmode
maintmode = not ma... | import commands
import packetFactory
from packetFactory import SystemMessagePacket
import plugins
maintmode = False
@plugins.CommandHook("maint", "[Admin Only] Toggle maint mode", True)
class maintmode(commands.Command):
def call_from_client(self, client):
global maintmode
maintmode = not maintmod... | agpl-3.0 | Python |
30c2463fbe5c14273bd23d05ac2d97450285132e | Reset caching variable to False | SAAVY/magpie,SAAVY/magpie | client/config.py | client/config.py | # set debug to False on non prod env
IS_DEV = True
# profile speed of methods and output it to terminal
PROFILE_METHODS = False
# set to false if you want to disable accessing redis
CACHE_DATA = False
| # set debug to False on non prod env
IS_DEV = True
# profile speed of methods and output it to terminal
PROFILE_METHODS = False
# set to false if you want to disable accessing redis
CACHE_DATA = True
| mit | Python |
7f0f756a3a9ea63d4da64273db90d23e48bf543c | Clean up and comments | eliben/deep-learning-samples,eliben/deep-learning-samples | logistic-regression/mnist_dataset.py | logistic-regression/mnist_dataset.py | # Helper code for downloading and unpickling MNIST data.
#
# Eli Bendersky (http://eli.thegreenplace.net)
# This code is in the public domain
from __future__ import print_function
import cPickle as pickle
import gzip
import os
from shutil import copyfileobj
from urllib2 import urlopen
from urlparse import urljoin
def... | from __future__ import print_function
import cPickle as pickle
import gzip
import os
from shutil import copyfileobj
from urllib2 import urlopen
from urlparse import urljoin
def maybe_download(base_url, filename, expected_size, force=False):
"""Download a file if not present, and make sure it's the right size."""
... | unlicense | Python |
b40363ee24d79d2506b47cc1dd8569d1af00ff78 | Refactor the i18n message extract command | wger-project/wger,rolandgeider/wger,wger-project/wger,DeveloperMal/wger,petervanderdoes/wger,kjagoo/wger_stark,kjagoo/wger_stark,kjagoo/wger_stark,wger-project/wger,wger-project/wger,DeveloperMal/wger,rolandgeider/wger,kjagoo/wger_stark,petervanderdoes/wger,petervanderdoes/wger,rolandgeider/wger,petervanderdoes/wger,De... | wger/core/management/commands/extract-i18n.py | wger/core/management/commands/extract-i18n.py | # -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | # -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | agpl-3.0 | Python |
dfbae8fd2f2346ecf7bb1e04c9c43c18e4da234d | Simplify the groupfinder a little. In general we should try to use session.query(...).get() rather than .filter(). | kidaa/encoded,philiptzou/clincoded,ENCODE-DCC/snovault,T2DREAM/t2dream-portal,hms-dbmi/fourfront,hms-dbmi/fourfront,ClinGen/clincoded,ENCODE-DCC/snovault,ClinGen/clincoded,ENCODE-DCC/encoded,T2DREAM/t2dream-portal,philiptzou/clincoded,T2DREAM/t2dream-portal,4dn-dcic/fourfront,kidaa/encoded,kidaa/encoded,T2DREAM/t2dream... | src/encoded/authorization.py | src/encoded/authorization.py | from sqlalchemy.orm.exc import NoResultFound
from .storage import (
DBSession,
UserMap,
)
def groupfinder(login, request):
if ':' not in login:
return None
namespace, localname = login.split(':', 1)
if namespace == 'mailto':
session = DBSession()
model = session.query(... | from sqlalchemy.orm.exc import NoResultFound
from .storage import (
DBSession,
UserMap,
)
def groupfinder(login, request):
if ':' not in login:
return None
namespace, localname = login.split(':', 1)
if namespace == 'mailto':
session = DBSession()
query = session.query(... | mit | Python |
c3323c082a31082a7c0856f8d64de11e1cf31a44 | change id to neoid because full incompatibility with id in sqlalchemy | guangxingli/python-neo,mschmidt87/python-neo,theunissenlab/python-neo,NeuralEnsemble/python-neo,INM-6/python-neo,tclose/python-neo,mgr0dzicki/python-neo,JuliaSprenger/python-neo,SummitKwan/python-neo,Blackfynn/python-neo,rgerkin/python-neo,apdavison/python-neo,npyoung/python-neo,CINPLA/python-neo,samuelgarcia/python-ne... | neo/core/neuron.py | neo/core/neuron.py | # -*- coding: utf-8 -*-
global neoid
neoid = 0
class Neuron(object):
"""
Stores properties that define a neuron
**Definition**
A :class:`Neuron` regroups all the :class:`SpikeTrain` objects within a common
:class:`Block`, gathered accross several :class:`Segment`, that has been emitted
... | # -*- coding: utf-8 -*-
global id
id = 0
class Neuron(object):
"""
Stores properties that define a neuron
**Definition**
A :class:`Neuron` regroups all the :class:`SpikeTrain` objects within a common
:class:`Block`, gathered accross several :class:`Segment`, that has been emitted
by the... | bsd-3-clause | Python |
02459b90d005592c54ebbe5711854bb714d0c7da | Remove from_ids wrapper method from manager | educreations/django-ormcache | ormcache/managers.py | ormcache/managers.py | from django.db.models.signals import class_prepared, post_delete, post_save
from django.utils.functional import cached_property
from ormcache.queryset import CachedQuerySet
class CachedManagerMixin(object):
@cached_property
def __cache_enabled(self):
return getattr(self.model, "cache_enabled", False... | from django.db.models.signals import class_prepared, post_delete, post_save
from django.utils.functional import cached_property
from ormcache.queryset import CachedQuerySet
class CachedManagerMixin(object):
@cached_property
def __cache_enabled(self):
return getattr(self.model, "cache_enabled", False... | mit | Python |
c062bf0dca4153c71343716f0f8185fa761304b8 | enable `status` filter in admin | geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend | osmaxx/excerptexport/admin.py | osmaxx/excerptexport/admin.py | from django.contrib import admin
from django.contrib.admin import widgets
from django.contrib.gis.db import models
from osmaxx.excerptexport.models import Excerpt, ExtractionOrder, OutputFile, Export
@admin.register(Excerpt)
class ExcerptAdmin(admin.ModelAdmin):
formfield_overrides = {
models.GeometryFie... | from django.contrib import admin
from django.contrib.admin import widgets
from django.contrib.gis.db import models
from osmaxx.excerptexport.models import Excerpt, ExtractionOrder, OutputFile, Export
@admin.register(Excerpt)
class ExcerptAdmin(admin.ModelAdmin):
formfield_overrides = {
models.GeometryFie... | mit | Python |
4242bf62627f90d895f32889da43dda62775a1fa | use unknown to specify unknown versions | Akasurde/pytest,The-Compiler/pytest,The-Compiler/pytest,tomviner/pytest,ddboline/pytest,txomon/pytest,flub/pytest,markshao/pytest,nicoddemus/pytest,pytest-dev/pytest,davidszotten/pytest,tomviner/pytest,pfctdayelise/pytest,nicoddemus/pytest,hackebrot/pytest,RonnyPfannschmidt/pytest,tareqalayan/pytest,MichaelAquilina/pyt... | _pytest/__init__.py | _pytest/__init__.py | import pkg_resources
__all__ = ['__version__']
try:
__version__ = pkg_resources.get_distribution('pytest').version
except Exception:
# broken installation, we don't even try
# unknown only works because we do poor mans version compare
__version__ = 'unknown'
| __all__ = ['__version__']
import pkg_resources
try:
__version__ = pkg_resources.get_distribution('pytest').version
except Exception:
__version__ = None # broken installation, we don't even try
| mit | Python |
c044e5181d52fc777d167b144c2e5b9276197ca4 | exclude verbs with {{(nie)dokonany od}} and {{zob} | alkamid/wiktionary,alkamid/wiktionary | empty_section.py | empty_section.py | # -*- coding: utf-8 -*-
from klasa import *
import re
def empty_section(section):
re_numbers = re.compile(r'\: \(([0-9]\.[0-9])\)\s*(.*)')
empty_content = ['']
if section == 'przykłady':
empty_content += ['\n: (1.1)', '\n: (1.1) ']
excluded_pos = ['rzeczownik', '{{forma']
wordlist = g... | # -*- coding: utf-8 -*-
from klasa import *
def empty_section(section):
empty_content = ['']
if section == 'przykłady':
empty_content += ['\n: (1.1)', '\n: (1.1) ']
excluded_pos = ['rzeczownik', '{{forma']
wordlist = getListFromXML('xx', findLatest=True)
with open('output/empty_sectio... | mit | Python |
c54132db5279d9f22cdca0f1379e251053970ec4 | Fix #62 | jlopezcur/GodotAdmob,jlopezcur/GodotAdmob | admob/config.py | admob/config.py | def can_build(plat):
return plat=="android" or plat=="iphone"
def configure(env):
if (env['platform'] == 'android'):
env.android_add_dependency("compile ('com.google.android.gms:play-services-ads:16.0.0') { exclude group: 'com.android.support' }")
env.android_add_java_dir("android")
env.android_add_to_manifest... | def can_build(plat):
return plat=="android" or plat=="iphone"
def configure(env):
if (env['platform'] == 'android'):
env.android_add_dependency("compile 'com.google.android.gms:play-services-ads:16.0.0'")
env.android_add_java_dir("android")
env.android_add_to_manifest("android/AndroidManifestChunk.xml")
env.... | mit | Python |
6806521032d88745e249a9f84c53a98c8131686b | Clean up acls | gmr/consulate,gmr/consulate | tests/base.py | tests/base.py | import functools
import json
import os
import unittest
import uuid
import consulate
from consulate import exceptions
with open('testing/consul.json', 'r') as handle:
CONSUL_CONFIG = json.load(handle)
def generate_key(func):
@functools.wraps(func)
def _decorator(self, *args, **kwargs):
key = str(... | import functools
import json
import os
import unittest
import uuid
import consulate
with open('testing/consul.json', 'r') as handle:
CONSUL_CONFIG = json.load(handle)
def generate_key(func):
@functools.wraps(func)
def _decorator(self, *args, **kwargs):
key = str(uuid.uuid4())[0:8]
self.u... | bsd-3-clause | Python |
fa86c244d65dadf5d5fd1cf533a0dd22865e0080 | Update denorm command | barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore-django,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api,barberscore/barberscore-api | project/apps/api/management/commands/denormalize.py | project/apps/api/management/commands/denormalize.py | from django.core.management.base import (
BaseCommand,
)
from apps.api.models import (
Convention,
Contest,
Contestant,
Performance,
Group,
Person,
Singer,
Director,
)
class Command(BaseCommand):
help = "Command to denormailze data."
def handle(self, *args, **options):
... | from django.core.management.base import (
BaseCommand,
)
from apps.api.models import (
Convention,
Contest,
Contestant,
Group,
)
class Command(BaseCommand):
help = "Command to denormailze data."
def handle(self, *args, **options):
cs = Contestant.objects.all()
for c in cs... | bsd-2-clause | Python |
369f5858d688cb51464add139b85176787aa0f4b | Update denormalization command | barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore-django,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api | project/apps/api/management/commands/denormalize.py | project/apps/api/management/commands/denormalize.py | from django.core.management.base import (
BaseCommand,
)
from apps.api.models import (
Convention,
Contest,
Contestant,
Performance,
)
class Command(BaseCommand):
help = "Command to denormailze data."
def handle(self, *args, **options):
ps = Performance.objects.all()
for ... | from django.core.management.base import (
BaseCommand,
)
from apps.api.models import (
Convention,
Contest,
Contestant,
Performance,
)
class Command(BaseCommand):
help = "Command to denormailze data."
def handle(self, *args, **options):
vs = Convention.objects.all()
for v... | bsd-2-clause | Python |
0de4bdf227a63b04fa0006aae983e68839a1caf7 | use relative imports | hoover/search,hoover/search,hoover/search | hoover/site/urls.py | hoover/site/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from ..search.admin import admin_site
from ..search import views, uploads
urlpatterns = [
url(r'^_ping$', views.ping, name='ping'),
url(r'^admin/', include(admin_site.urls)),
url(r'^$', views.home, name='home'),
url(r'^search$',... | from django.conf.urls import include, url
from django.contrib import admin
from hoover.search.admin import admin_site
from hoover.search import views, uploads
urlpatterns = [
url(r'^_ping$', views.ping, name='ping'),
url(r'^admin/', include(admin_site.urls)),
url(r'^$', views.home, name='home'),
url(r'... | mit | Python |
9aada8824f817dce1fe1b5f6bf2496dc99ef4a48 | fix ina when there is no result | nojhan/weboob-devel,eirmag/weboob,Konubinix/weboob,Boussadia/weboob,frankrousseau/weboob,yannrouillard/weboob,sputnick-dev/weboob,frankrousseau/weboob,Konubinix/weboob,yannrouillard/weboob,eirmag/weboob,willprice/weboob,Boussadia/weboob,RouxRC/weboob,Boussadia/weboob,franek/weboob,willprice/weboob,willprice/weboob,yann... | weboob/backends/ina/pages/search.py | weboob/backends/ina/pages/search.py | # -*- coding: utf-8 -*-
# Copyright(C) 2010 Romain Bignon
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will b... | # -*- coding: utf-8 -*-
# Copyright(C) 2010 Romain Bignon
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will b... | agpl-3.0 | Python |
6cb4b1cd92864a54d8335853650269c2459388c7 | use _main_ as module name for app example | jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab | examples/app/main.py | examples/app/main.py | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from jupyterlab_server import LabServerApp
from jupyter_server.utils import url_path_join as ujoin
import json
import os
from traitlets import Unicode
HERE = os.path.dirname(__file__)
# Turn off the Jupyter configura... | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from jupyterlab_server import LabServerApp
from jupyter_server.utils import url_path_join as ujoin
import json
import os
from traitlets import Unicode
HERE = os.path.dirname(__file__)
# Turn off the Jupyter configura... | bsd-3-clause | Python |
c215b0608dafe23dd8b6be3139a9d411838d3f48 | Convert url to ascii before generating uuid | kopf/ahye,kopf/ahye,kopf/ahye | ahye/views.py | ahye/views.py | import os
import json
import uuid
from flask import (abort, redirect, request, jsonify,
send_from_directory, url_for)
import requests
from ahye import app
from ahye.flaskext.mako import render_template as render
from ahye.lib import generate_filename
from ahye.settings import VDIR, LOCAL_UPLOADS_DI... | import os
import json
import uuid
from flask import (abort, redirect, request, jsonify,
send_from_directory, url_for)
import requests
from ahye import app
from ahye.flaskext.mako import render_template as render
from ahye.lib import generate_filename
from ahye.settings import VDIR, LOCAL_UPLOADS_DI... | apache-2.0 | Python |
a0788699888ca58e15842e6c1a5709e55e6f784f | Add `__site__` meta-data | lillian-lemmer/hypatia,Applemann/hypatia,hypatia-software-org/hypatia-engine,Applemann/hypatia,hypatia-software-org/hypatia-engine,brechin/hypatia,lillian-lemmer/hypatia,brechin/hypatia | hypatia/__init__.py | hypatia/__init__.py | """This module contains all of the important meta-information for
Hypatia such as the author's name, the copyright and license, status,
and so on.
"""
__author__ = "Lillian Lemmer"
__copyright__ = "Copyright 2015 Lillian Lemmer"
__credits__ = ["Lillian Lemmer"]
__license__ = "MIT"
__maintainer__ = __author... | """This module contains all of the important meta-information for
Hypatia such as the author's name, the copyright and license, status,
and so on.
"""
__author__ = "Lillian Lemmer"
__copyright__ = "Copyright 2015 Lillian Lemmer"
__credits__ = ["Lillian Lemmer"]
__license__ = "MIT"
__maintainer__ = __author... | mit | Python |
070674c3a32ef51401e958d6ed46003fda009679 | fix forgotten string to number conversion | congma/base8x | example_wpskg.py | example_wpskg.py | #!/usr/bin/python
"""Generate random secret keys for WordPress's wp-config.php file."""
# See also: https://api.wordpress.org/secret-key/1.1/salt/
import os
import base8x
w92codec = base8x.Base8xCodec("0123456789abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
... | #!/usr/bin/python
"""Generate random secret keys for WordPress's wp-config.php file."""
# See also: https://api.wordpress.org/secret-key/1.1/salt/
import os
import base8x
w92codec = base8x.Base8xCodec("0123456789abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
... | bsd-3-clause | Python |
e557d595acaf4c32b6679655f190b4f9db94b321 | Document that this script is using ISAPISimpleHandler | Coder-666/isapi-wsgi,hexdump42/isapi-wsgi | examples/demo.py | examples/demo.py | # An example of how to publish a simple wsgi app under isapi_wsgi using
# the ISAPISimpleHandler which will create a new instance for each incoming
# request.
#
# Executing this script (or any server config script) will install the extension
# into your web server and will create a "loader" DLL _demo.dll in the
... | # An example of how to publish a simple wsgi app under isapi_wsgi
#
# Executing this script (or any server config script) will install the extension
# into your web server and will create a "loader" DLL _demo.dll in the
# current directory. As the server executes, the PyISAPI framework will load
# this module and... | mit | Python |
e7cf69165642c2cfeda5dd71d5d7cb43b79e40cb | Add comments. | masasin/latexipy | examples/examples.py | examples/examples.py | #!/usr/bin/env python
from functools import partial
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import latexipy as lp
DIRECTORY = Path(__file__).parent/'img'
_x = np.linspace(-np.pi, np.pi)
def plot_sin(x=_x):
plt.plot(x, np.sin(x))
plt.title('Sine')
plt.xlabel(r'$\the... | #!/usr/bin/env python
from functools import partial
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import latexipy as lp
DIRECTORY = Path(__file__).parent/'img'
_x = np.linspace(-np.pi, np.pi)
def plot_sin(x=_x):
plt.plot(x, np.sin(x))
plt.title('Sine')
plt.xlabel(r'$\the... | mit | Python |
56da55430c4c6918f5625fe1efb4d16a3b325c18 | add ( | greedo/python-xbrl | examples/gaap.py | examples/gaap.py | #! /usr/bin/env python
# encoding: utf-8
from __future__ import print_function
from xbrl import XBRLParser, GAAP, GAAPSerializer, DEISerializer
xbrl_parser = XBRLParser(precision=0)
# Parse an incoming XBRL file
xbrl = xbrl_parser.parse("../tests/sam-20130629.xml")
# Parse just the GAAP data from the xbrl object
g... | #! /usr/bin/env python
# encoding: utf-8
from __future__ import print_function
from xbrl import XBRLParser, GAAP, GAAPSerializer, DEISerializer
xbrl_parser = XBRLParser(precision=0)
# Parse an incoming XBRL file
xbrl = xbrl_parser.parse("../tests/sam-20130629.xml")
# Parse just the GAAP data from the xbrl object
g... | apache-2.0 | Python |
82b63d886491fb1ce95dc1bef3a2e1acc848f177 | Fix the trigger_upload script to include push_notifications arg | fedora-infra/fedimg,fedora-infra/fedimg | bin/trigger_upload.py | bin/trigger_upload.py | #!/bin/env python
# -*- coding: utf8 -*-
""" Triggers an upload process with the specified raw.xz URL. """
import argparse
import logging
import logging.config
import multiprocessing.pool
import fedmsg.config
import fedimg.uploader
logging.config.dictConfig(fedmsg.config.load_config()['logging'])
log = logging.getLo... | #!/bin/env python
# -*- coding: utf8 -*-
""" Triggers an upload process with the specified raw.xz URL. """
import logging
import logging.config
import multiprocessing.pool
import sys
import fedmsg.config
import fedimg.uploader
if len(sys.argv) != 3:
print 'Usage: trigger_upload.py <rawxz_image_url> <compose_id>'... | agpl-3.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.