commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
85e7433948785b233876bb0f85795adf49636712 | ca/views.py | ca/views.py | from flask import Flask, request, render_template, flash, url_for, abort
from itsdangerous import URLSafeSerializer
from ca import app, db
from ca.forms import RequestForm
from ca.models import Request
s = URLSafeSerializer(app.config['SECRET_KEY'])
@app.route('/', methods=['GET', 'POST'])
def index():
form = Re... | from flask import Flask, request, render_template, flash, url_for, abort
from itsdangerous import URLSafeSerializer
from ca import app, db
from ca.forms import RequestForm
from ca.models import Request
s = URLSafeSerializer(app.config['SECRET_KEY'])
@app.route('/', methods=['GET'])
def index():
return render_tem... | Split index route into get and post | Split index route into get and post
| Python | mit | freifunk-berlin/ca.berlin.freifunk.net,freifunk-berlin/ca.berlin.freifunk.net,freifunk-berlin/ca.berlin.freifunk.net |
fe1d8b2172aecf4f2f7cebe3c61eeb778f3db23a | src/cms/apps/historylinks/middleware.py | src/cms/apps/historylinks/middleware.py | """Middleware used by the history links service."""
from django.shortcuts import redirect
from cms.apps.historylinks.models import HistoryLink
class HistoryLinkFallbackMiddleware(object):
"""Middleware that attempts to rescue 404 responses with a redirect to it's new location."""
def process_respon... | """Middleware used by the history links service."""
from django.shortcuts import redirect
from cms.apps.historylinks.models import HistoryLink
class HistoryLinkFallbackMiddleware(object):
"""Middleware that attempts to rescue 404 responses with a redirect to it's new location."""
def process_respon... | Fix for historylinks connecting to missing objects | Fix for historylinks connecting to missing objects
| Python | bsd-3-clause | etianen/cms,etianen/cms,danielsamuels/cms,danielsamuels/cms,danielsamuels/cms,dan-gamble/cms,etianen/cms,lewiscollard/cms,lewiscollard/cms,jamesfoley/cms,dan-gamble/cms,jamesfoley/cms,jamesfoley/cms,dan-gamble/cms,lewiscollard/cms,jamesfoley/cms |
3b1c42b5001bf70fff47a53a1cf003538b619c53 | auth_mac/models.py | auth_mac/models.py | from django.db import models
# Create your models here.
| from django.db import models
from django.contrib.auth.models import User
class Credentials(models.Model):
"Keeps track of issued MAC credentials"
user = models.ForeignKey(User)
expiry = models.DateTimeField("Expires On")
identifier = models.CharField("MAC Key Identifier", max_length=16, null=True, blank=True)
... | Add a basic model for the identifications | Add a basic model for the identifications
| Python | mit | ndevenish/auth_mac |
83c7fb070d0d79036ce697835e69c5e0aa2e14b7 | app/core/info.py | app/core/info.py | import os
import pathlib
# RELEASE-UPDATE
APP_DIR = pathlib.Path(os.path.realpath(__file__)).parent.parent
ROOT_DIR = APP_DIR.parent
DEFAULT_DB_PATH = '/instance/storage/storage.db'
PROJECT_NAME = 'Zordon'
PROJECT_VERSION = '4.0.0'
PROJECT_FULL_NAME = '{} v{}'.format(PROJECT_NAME, PROJECT_VERSION)
| import os
import pathlib
# RELEASE-UPDATE
APP_DIR = pathlib.Path(os.path.realpath(__file__)).parent.parent
ROOT_DIR = APP_DIR.parent
DEFAULT_DB_PATH = '/instance/storage'
PROJECT_NAME = 'Zordon'
PROJECT_VERSION = '4.0.0'
PROJECT_FULL_NAME = '{} v{}'.format(PROJECT_NAME, PROJECT_VERSION)
| Fix storage path for Docker mode | Fix storage path for Docker mode
| Python | mit | KrusnikViers/Zordon,KrusnikViers/Zordon |
87f4bb8cdcb607cb4f15ecbda9a3cb50a3fd5319 | src/webargs/__init__.py | src/webargs/__init__.py | # -*- coding: utf-8 -*-
from distutils.version import LooseVersion
from marshmallow.utils import missing
# Make marshmallow's validation functions importable from webargs
from marshmallow import validate
from webargs.core import ValidationError
from webargs.dict2schema import dict2schema
from webargs import fields
_... | # -*- coding: utf-8 -*-
from distutils.version import LooseVersion
from marshmallow.utils import missing
# Make marshmallow's validation functions importable from webargs
from marshmallow import validate
from webargs.core import ValidationError
from webargs.dict2schema import dict2schema
from webargs import fields
_... | Remove unnnecessary __author__ and __license__ | Remove unnnecessary __author__ and __license__
| Python | mit | sloria/webargs |
24fd469296951fd8445e18d482a97ad5bb9108e7 | storm/tests/conftest.py | storm/tests/conftest.py | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import os
import pytest
from .common import INSTANCE, HOST
from datadog_checks.dev import docker_run, get_here, run_command
from datadog_checks.dev.conditions import CheckCommandOutput
@pytest.fixture(scope='se... | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import os
import socket
import pytest
from .common import INSTANCE, HOST
from datadog_checks.dev import docker_run, get_here, run_command
from datadog_checks.dev.conditions import WaitFor
def wait_for_thrift():... | Use socket instead of nc | Use socket instead of nc
| Python | bsd-3-clause | DataDog/integrations-extras,DataDog/integrations-extras,DataDog/integrations-extras,DataDog/integrations-extras,DataDog/integrations-extras |
33962b72cea77735732c31e6af6dac585ebe271e | charat2/tasks/__init__.py | charat2/tasks/__init__.py | from celery import Celery, Task
from redis import StrictRedis
from charat2.model import sm
from charat2.model.connections import redis_pool
celery = Celery("newparp", include=[
"charat2.tasks.background",
"charat2.tasks.matchmaker",
"charat2.tasks.reaper",
"charat2.tasks.roulette_matchmaker",
])
cele... | from celery import Celery, Task
from classtools import reify
from redis import StrictRedis
from charat2.model import sm
from charat2.model.connections import redis_pool
celery = Celery("newparp", include=[
"charat2.tasks.background",
"charat2.tasks.matchmaker",
"charat2.tasks.reaper",
"charat2.tasks.r... | Use reify instead of properties for the task backend connections. | Use reify instead of properties for the task backend connections.
| Python | agpl-3.0 | MSPARP/newparp,MSPARP/newparp,MSPARP/newparp |
b353441e33e8f272177b16505f12358f8a30fe6a | crowd_anki/main.py | crowd_anki/main.py | import os
import sys
from aqt import mw, QAction, QFileDialog
sys.path.append(os.path.join(os.path.dirname(__file__), "dist"))
from .anki.hook_vendor import HookVendor
from .anki.ui.action_vendor import ActionVendor
from .utils.log import setup_log
def anki_actions_init(window):
action_vendor = ActionVendor(wi... | import os
import sys
from aqt import mw, QAction, QFileDialog
sys.path.append(os.path.join(os.path.dirname(__file__), "dist"))
from .anki.hook_vendor import HookVendor
from .anki.ui.action_vendor import ActionVendor
def anki_actions_init(window):
action_vendor = ActionVendor(window, QAction, lambda caption: QF... | Remove reference to log, as it's not set up correctly yet. | Remove reference to log, as it's not set up correctly yet.
| Python | mit | Stvad/CrowdAnki,Stvad/CrowdAnki,Stvad/CrowdAnki |
ab59cf04530dbbcecf912b60dce181a0b24c6d29 | download.py | download.py | #!/usr/bin/python
import sys, os
import ads
from nameparser import HumanName
reload(sys)
sys.setdefaultencoding('utf8')
names_file = open(sys.argv[1])
#Default abstract storage
abstract_directory = "abstracts"
if len(sys.argv) > 2:
abstract_directory = sys.argv[2]
if not os.path.exists(abstract_directory):
os.ma... | #!/usr/bin/python
import sys, os
import ads
from nameparser import HumanName
reload(sys)
sys.setdefaultencoding('utf8')
names_file = open(sys.argv[1])
#Default abstract storage
abstract_directory = "abstracts"
if len(sys.argv) > 2:
abstract_directory = sys.argv[2]
if not os.path.exists(abstract_directory):
... | Fix tab/space issues and use automatic name wildcard | Fix tab/space issues and use automatic name wildcard
- Using a regular query search allows ADS to automatically adjust author
name to hit multiple abstracts
| Python | unlicense | MilesCranmer/research_match,MilesCranmer/research_match |
9717271fc02b3294b08b3989913c14da68285601 | service_control/urls.py | service_control/urls.py | """service_control URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
... | """service_control URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
... | Make user loggin as the homepage | Make user loggin as the homepage
| Python | mit | desenho-sw-g5/service_control,desenho-sw-g5/service_control |
93c914a0537ee0665e5139e8a8a8bc9508a25dd7 | test/strings/format2.py | test/strings/format2.py | "normal {{ normal }} normal {fo.__add__!s}"
" : source.python, string.quoted.double.python
normal : source.python, string.quoted.double.python
{{ : constant.character.format.python, source.python, string.quoted.double.python
normal : source.python, string.quoted.double.python
}} ... | "normal {{ normal }} normal {fo.__add__!s}".format(fo=1)
" : source.python, string.quoted.double.python
normal : source.python, string.quoted.double.python
{{ : constant.character.format.python, source.python, string.quoted.double.python
normal : source.python, string.quoted.doubl... | Add a test for .format() method | Add a test for .format() method
| Python | mit | MagicStack/MagicPython,MagicStack/MagicPython,MagicStack/MagicPython |
6612f0e3cd98a037f8b441cba1b3defc46977d66 | tests/test_structure_check.py | tests/test_structure_check.py | import pytest
from datatyping.datatyping import validate
def test_empty():
with pytest.raises(TypeError):
assert validate([], ()) is None
def test_empty_reversed():
with pytest.raises(TypeError):
assert validate((), []) is None
def test_plain():
with pytest.raises(TypeError):
a... | from collections import OrderedDict
import pytest
from hypothesis import given
from hypothesis.strategies import lists, tuples, integers, dictionaries, \
fixed_dictionaries
from datatyping.datatyping import validate
@given(lst=lists(integers()), tpl=tuples(integers()))
def test_different_sequences(lst, tpl):
... | Rewrite structure_check tests with hypothesis `OrderedDict` chosen instead of `SimpleNamespace` as the former supports the dictionary-like item access, unlike the latter. | Rewrite structure_check tests with hypothesis
`OrderedDict` chosen instead of `SimpleNamespace` as the former supports the dictionary-like item access, unlike the latter.
| Python | mit | Zaab1t/datatyping |
9f7bc70713dfc5864841b9f90fe2ec4bbd406b8d | kay/models.py | kay/models.py | # -*- coding: utf-8 -*-
"""
kay.models
:Copyright: (c) 2009 Takashi Matsuo <tmatsuo@candit.jp> All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from google.appengine.ext import db
from kay.utils import crypto
class NamedModel(db.Model):
""" This base model has a classmethod for automatically... | # -*- coding: utf-8 -*-
"""
kay.models
:Copyright: (c) 2009 Takashi Matsuo <tmatsuo@candit.jp> All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from google.appengine.ext import db
from kay.utils import crypto
class NamedModel(db.Model):
""" This base model has a classmethod for automatically... | Allow replacing get_key_generator class method in subclasses. | Allow replacing get_key_generator class method in subclasses.
| Python | bsd-3-clause | Letractively/kay-framework,Letractively/kay-framework,Letractively/kay-framework,Letractively/kay-framework |
4a7ca3439c9ad8368849accc25bbb554daae1940 | knights/dj.py | knights/dj.py | from collections import defaultdict
from django.template.base import TemplateDoesNotExist, TemplateSyntaxError # NOQA
from django.template.backends.base import BaseEngine
from django.template.backends.utils import csrf_input_lazy, csrf_token_lazy
from . import compiler
from . import loader
class KnightsTemplater(B... | from collections import defaultdict
from django.template.base import TemplateDoesNotExist, TemplateSyntaxError # NOQA
from django.template.backends.base import BaseEngine
from django.template.backends.utils import csrf_input_lazy, csrf_token_lazy
from . import compiler
from . import loader
class KnightsTemplater(B... | Add all the paths so includes/extends work | Add all the paths so includes/extends work
| Python | mit | funkybob/knights-templater,funkybob/knights-templater |
1baa04b3f47c92a14c61e7bbb6b32dc35dd51f5d | chatroom/views.py | chatroom/views.py | from django.shortcuts import render
from django.http import HttpResponse
from django.http import HttpResponseRedirect
def index(request):
return render(request, 'index.html')
def append(request):
# open("data", "a").write(str(request.args.get("msg")) + "\n\r")
open("data", "a").write(request.GET['msg'] + ... | from django.shortcuts import render
from django.http import HttpResponse
from django.http import HttpResponseRedirect
def index(request):
return render(request, 'index.html')
def append(request):
# open("data", "a").write(str(request.args.get("msg")) + "\n\r")
open("/tmp/data", "ab").write(request.GET['ms... | Fix encoding bugs on production server | Fix encoding bugs on production server
| Python | mit | sonicyang/chiphub,sonicyang/chiphub,sonicyang/chiphub |
1df25ada51d0be794f2d689161b1c93e81512d3b | students/psbriant/final_project/clean_data.py | students/psbriant/final_project/clean_data.py | """
Name: Paul Briant
Date: 12/11/16
Class: Introduction to Python
Assignment: Final Project
Description:
Code for Final Project
"""
import pandas
from datetime import datetime
def clean(data):
"""
Take in data and return cleaned version.
"""
# Remove Date Values column
data = data.drop(["Date V... | """
Name: Paul Briant
Date: 12/11/16
Class: Introduction to Python
Assignment: Final Project
Description:
Code for Final Project
"""
import pandas
from datetime import datetime
def clean(data):
"""
Take in data and return cleaned version.
"""
# Remove Date Values column
data = data.drop(["Date V... | Add filter for water use in downtown LA zipcodes. | Add filter for water use in downtown LA zipcodes.
| Python | unlicense | UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016 |
6451808c2dfb3d207bdd69c8aa138554f52cf5ba | python/common-child.py | python/common-child.py | #!/bin/python3
import math
import os
import random
import re
import sys
# See https://en.wikipedia.org/wiki/Longest_common_subsequence_problem
def commonChild(s1, s2):
matrix = [[0 for i in range(len(s2) + 1)] for j in range(len(s1)+ 1)]
for row_i in range(len(s1)):
for col_i in range(len(s2)):
... | #!/bin/python3
import math
import os
import random
import re
import sys
# See https://en.wikipedia.org/wiki/Longest_common_subsequence_problem
# This solution creates the matrix described in "Traceback approach"
def common_child(s1, s2):
matrix = [[0 for i in range(len(s2) + 1)] for j in range(len(s1)+ 1)]
f... | Include dev comment on solution | Include dev comment on solution
| Python | mit | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank |
90fe4c98b5e93058c6cfd090958922070351a04d | quicksort/quicksort.py | quicksort/quicksort.py | def sort(arr, length):
if length == 1:
return
pivot = choose_pivot(arr, length)
return (arr, length, pivot)
def choose_pivot(arr, length):
return arr[0]
if __name__ == '__main__':
unsorted = list(reversed(range(1000)))
initial_len = len(unsorted)
print sort(unsorted, initial_len) | from random import randint
def sort(arr, start, length):
if length <= 1:
return arr
pivot = choose_pivot(arr, length)
i = j = start + 1
while j < length:
if arr[j] < pivot:
swap(arr, j, i)
i += 1
j += 1
swap(arr, start, i-1)
return (arr, length, pivot)
def swap(arr, x, y):
temp = arr[x]
arr[... | Add partition step and swap helper function | Add partition step and swap helper function
The data is partitioned iterating over the array and moving any
element less than the pivot value to the left part of the array.
This is done using an additional variable i that represents the
index of the smallest value greater than the pivot - any value
less than the pivot... | Python | mit | timpel/stanford-algs,timpel/stanford-algs |
9d79893f119d696ead124d9e34b21acf34cd6f8f | pygotham/admin/schedule.py | pygotham/admin/schedule.py | """Admin for schedule-related models."""
from pygotham.admin.utils import model_view
from pygotham.schedule import models
# This line is really long because pep257 needs it to be on one line.
__all__ = ('DayModelView', 'RoomModelView', 'SlotModelView', 'PresentationModelView')
CATEGORY = 'Schedule'
DayModelView = ... | """Admin for schedule-related models."""
from pygotham.admin.utils import model_view
from pygotham.schedule import models
# This line is really long because pep257 needs it to be on one line.
__all__ = ('DayModelView', 'RoomModelView', 'SlotModelView', 'PresentationModelView')
CATEGORY = 'Schedule'
DayModelView = ... | Change admin sort for slots | Change admin sort for slots
| Python | bsd-3-clause | pathunstrom/pygotham,PyGotham/pygotham,djds23/pygotham-1,PyGotham/pygotham,djds23/pygotham-1,djds23/pygotham-1,PyGotham/pygotham,pathunstrom/pygotham,PyGotham/pygotham,djds23/pygotham-1,pathunstrom/pygotham,pathunstrom/pygotham,djds23/pygotham-1,pathunstrom/pygotham,PyGotham/pygotham |
8b076747c756bc4fe488f3b2f5a0265b7fd880f0 | matrix/matrix.py | matrix/matrix.py | class Matrix(object):
def __init__(self, s):
self.rows = [list(map(int, row.split()))
for row in s.split("\n")]
@property
def columns(self):
return [[row[i] for row in self.rows]
for i in range(len(self.rows[0]))]
| class Matrix(object):
def __init__(self, s):
self.rows = [list(map(int, row.split()))
for row in s.split("\n")]
@property
def columns(self):
return [list(col) for col in zip(*self.rows)]
| Use zip for a shorter solution | Use zip for a shorter solution
| Python | agpl-3.0 | CubicComet/exercism-python-solutions |
8d46db626298f2d21f4f1d8b6f75fdc08bd761dc | zinnia/models/author.py | zinnia/models/author.py | """Author model for Zinnia"""
from django.db import models
from django.contrib.auth import get_user_model
from django.utils.encoding import python_2_unicode_compatible
from zinnia.managers import entries_published
from zinnia.managers import EntryRelatedPublishedManager
@python_2_unicode_compatible
class Author(get_... | """Author model for Zinnia"""
from django.db import models
from django.contrib.auth import get_user_model
from django.utils.encoding import python_2_unicode_compatible
from zinnia.managers import entries_published
from zinnia.managers import EntryRelatedPublishedManager
class AuthorManagers(models.Model):
publish... | Move Author Managers into an abstract base class | Move Author Managers into an abstract base class
Copying of the default manager causes the source model to become poluted.
To supply additional managers without replacing the default manager,
the Django docs recommend inheriting from an abstract base class.
https://docs.djangoproject.com/en/dev/topics/db/models/#prox... | Python | bsd-3-clause | bywbilly/django-blog-zinnia,Zopieux/django-blog-zinnia,petecummings/django-blog-zinnia,ZuluPro/django-blog-zinnia,petecummings/django-blog-zinnia,marctc/django-blog-zinnia,Maplecroft/django-blog-zinnia,petecummings/django-blog-zinnia,Fantomas42/django-blog-zinnia,1844144/django-blog-zinnia,marctc/django-blog-zinnia,Fan... |
099ab577bf3d03bd5f2d579bbf82a8035690219e | tests/test_auth.py | tests/test_auth.py | """Unit test module for auth"""
import json
from flask.ext.login import login_user, logout_user
from tests import TestCase, LAST_NAME, FIRST_NAME, TEST_USER_ID
from portal.extensions import db
from portal.models.auth import Client
class TestAuth(TestCase):
def test_client_edit(self):
# Generate a minimal... | """Unit test module for auth"""
import json
from flask.ext.login import login_user, logout_user
from tests import TestCase, LAST_NAME, FIRST_NAME, TEST_USER_ID
from portal.extensions import db
from portal.models.auth import Client
class TestAuth(TestCase):
def test_client_edit(self):
# Generate a minimal... | Fix test - change in client redirection previously overlooked. | Fix test - change in client redirection previously overlooked.
| Python | bsd-3-clause | uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal |
78463a6ba34f1503f3c6fd5fdb287a0593f4be68 | website/addons/figshare/__init__.py | website/addons/figshare/__init__.py | import os
from . import routes, views, model # noqa
MODELS = [
model.AddonFigShareUserSettings,
model.AddonFigShareNodeSettings,
model.FigShareGuidFile
]
USER_SETTINGS_MODEL = model.AddonFigShareUserSettings
NODE_SETTINGS_MODEL = model.AddonFigShareNodeSettings
ROUTES = [routes.settings_routes, routes.a... | import os
from . import routes, views, model # noqa
MODELS = [
model.AddonFigShareUserSettings,
model.AddonFigShareNodeSettings,
model.FigShareGuidFile
]
USER_SETTINGS_MODEL = model.AddonFigShareUserSettings
NODE_SETTINGS_MODEL = model.AddonFigShareNodeSettings
ROUTES = [routes.settings_routes, routes.a... | Set figshare's MAX_FILE_SIZE to 50mb | Set figshare's MAX_FILE_SIZE to 50mb
| Python | apache-2.0 | chennan47/osf.io,baylee-d/osf.io,HarryRybacki/osf.io,mluo613/osf.io,jolene-esposito/osf.io,binoculars/osf.io,petermalcolm/osf.io,caneruguz/osf.io,haoyuchen1992/osf.io,zamattiac/osf.io,arpitar/osf.io,amyshi188/osf.io,jnayak1/osf.io,mluke93/osf.io,RomanZWang/osf.io,cldershem/osf.io,abought/osf.io,doublebits/osf.io,Halcyo... |
7ed3a8452de8d75a09d2ee2265d7fa32b4a25c7c | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Joao Moreira'
SITENAME = 'Joao Moreira'
SITEURL = ''
BIO = 'lorem ipsum doler umpalum paluuu'
PROFILE_IMAGE = "avatar.jpg"
PATH = 'content'
TIMEZONE = 'America/Chicago'
DEFAULT_LANG = 'en'
DEFAULT_DATE_FORMAT = '%B %-... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Joao Moreira'
SITENAME = 'Joao Moreira'
SITEURL = ''
BIO = 'PhD student. Data scientist. Iron Man fan.'
PROFILE_IMAGE = "avatar.jpg"
PATH = 'content'
STATIC_PATHS = ['images', 'extra/CNAME']
EXTRA_PATH_METADATA = {'extra... | Add publication date on github publish | Add publication date on github publish
| Python | mit | jagmoreira/jagmoreira.github.io,jagmoreira/jagmoreira.github.io |
a4135626721efada6a68dab6cb86ce2dfb687462 | factory/tools/cat_StarterLog.py | factory/tools/cat_StarterLog.py | #!/bin/env python
#
# cat_StarterLog.py
#
# Print out the StarterLog for a glidein output file
#
# Usage: cat_StarterLog.py logname
#
import os.path
import sys
STARTUP_DIR=sys.path[0]
sys.path.append(os.path.join(STARTUP_DIR,"lib"))
import gWftLogParser
USAGE="Usage: cat_StarterLog.py <logname>"
def main():
try:... | #!/bin/env python
#
# cat_StarterLog.py
#
# Print out the StarterLog for a glidein output file
#
# Usage: cat_StarterLog.py logname
#
import os.path
import sys
STARTUP_DIR=sys.path[0]
sys.path.append(os.path.join(STARTUP_DIR,"lib"))
import gWftLogParser
USAGE="Usage: cat_StarterLog.py <logname>"
def main():
try:... | Support both old and new format | Support both old and new format
| Python | bsd-3-clause | bbockelm/glideinWMS,holzman/glideinwms-old,bbockelm/glideinWMS,holzman/glideinwms-old,bbockelm/glideinWMS,bbockelm/glideinWMS,holzman/glideinwms-old |
9334d20adb15f3a6be393c57c797311e31fcd8fc | ConectorDriverComando.py | ConectorDriverComando.py | # -*- coding: iso-8859-1 -*-
from serial import SerialException
import importlib
import threading
import logging
class ConectorError(Exception):
pass
class ConectorDriverComando:
driver = None
def __init__(self, comando, driver, *args, **kwargs):
logging.getLogger().info("inicial... | # -*- coding: iso-8859-1 -*-
from serial import SerialException
import importlib
import threading
import logging
class ConectorError(Exception):
pass
class ConectorDriverComando:
driver = None
def __init__(self, comando, driver, *args, **kwargs):
# logging.getLogger().info("inici... | FIX Format String Error in Conector Driver Comando | FIX Format String Error in Conector Driver Comando
| Python | mit | ristorantino/fiscalberry,ristorantino/fiscalberry,ristorantino/fiscalberry,ristorantino/fiscalberry |
98dd8df628079357b26a663d24adcbc6ac4d3794 | indra/__init__.py | indra/__init__.py | from __future__ import print_function, unicode_literals
import logging
__version__ = '1.3.0'
logging.basicConfig(format='%(levelname)s: indra/%(name)s - %(message)s',
level=logging.INFO)
logging.getLogger('requests').setLevel(logging.ERROR)
logging.getLogger('urllib3').setLevel(logging.ERROR)
logg... | from __future__ import print_function, unicode_literals
import logging
__version__ = '1.3.0'
__all__ = ['bel', 'biopax', 'trips', 'reach', 'index_cards', 'sparser',
'databases', 'literature',
'preassembler', 'assemblers', 'mechlinker', 'belief',
'tools', 'util']
'''
#############
# For... | Add commented out top-level imports | Add commented out top-level imports
| Python | bsd-2-clause | pvtodorov/indra,sorgerlab/belpy,jmuhlich/indra,johnbachman/belpy,jmuhlich/indra,sorgerlab/indra,pvtodorov/indra,bgyori/indra,johnbachman/indra,jmuhlich/indra,sorgerlab/belpy,sorgerlab/indra,pvtodorov/indra,bgyori/indra,bgyori/indra,sorgerlab/indra,johnbachman/indra,pvtodorov/indra,johnbachman/belpy,johnbachman/belpy,so... |
3e8f45368b949cbd140a2a61fcba7afec563a7a1 | website/views.py | website/views.py |
import logging
logger = logging.getLogger(__name__)
from django.views.generic import TemplateView
from voting.models import Bill
from voting.models import Member
class HomeView(TemplateView):
template_name = "website/index.html"
context_object_name = "homepage"
def get_context_data(self, **kwargs):
... |
import logging
logger = logging.getLogger(__name__)
from django.views.generic import TemplateView
from voting.models import Bill
from voting.models import Member
class HomeView(TemplateView):
template_name = "website/index.html"
context_object_name = "homepage"
def get_context_data(self, **kwargs):
... | Use modern super() python class function | Use modern super() python class function
| Python | mit | openkamer/openkamer,openkamer/openkamer,openkamer/openkamer,openkamer/openkamer |
79c8ab721fd5d00bff3e96b52e6155e16ae255b2 | skan/test/test_pipe.py | skan/test/test_pipe.py | import os
import pytest
import tempfile
import pandas
from skan import pipe
@pytest.fixture
def image_filename():
rundir = os.path.abspath(os.path.dirname(__file__))
datadir = os.path.join(rundir, 'data')
return os.path.join(datadir, 'retic.tif')
def test_pipe(image_filename):
data = pipe.process_im... | import os
import pytest
import tempfile
import pandas
from skan import pipe
@pytest.fixture
def image_filename():
rundir = os.path.abspath(os.path.dirname(__file__))
datadir = os.path.join(rundir, 'data')
return os.path.join(datadir, 'retic.tif')
def test_pipe(image_filename):
data = pipe.process_im... | Add small test for crop parameter to pipe | Add small test for crop parameter to pipe
| Python | bsd-3-clause | jni/skan |
64cb1130811c5e0e1d547ff7a3a03139b831dea5 | openacademy/model/openacademy_session.py | openacademy/model/openacademy_session.py | # -*- coding: utf-8 -*_
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
i... | # -*- coding: utf-8 -*_
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
i... | Add domain or and ilike | [REF] openacademy: Add domain or and ilike
| Python | apache-2.0 | glizek/openacademy-project |
6b1ca442624ed1bc61bd816452af62033f975232 | categories/forms.py | categories/forms.py | # This file is part of e-Giełda.
# Copyright (C) 2014 Mateusz Maćkowski and Tomasz Zieliński
#
# e-Giełda 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 ... | # This file is part of e-Giełda.
# Copyright (C) 2014 Mateusz Maćkowski and Tomasz Zieliński
#
# e-Giełda 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 ... | Add required attribute to Category name input | Add required attribute to Category name input
| Python | agpl-3.0 | m4tx/egielda,m4tx/egielda,m4tx/egielda |
c99bf0a57a2e257259890df72e948d6030288aaf | couchdb/tests/testutil.py | couchdb/tests/testutil.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import uuid
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs = None
_d... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import random
import sys
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs ... | Use a random number instead of uuid for temp database name. | Use a random number instead of uuid for temp database name.
| Python | bsd-3-clause | erikdejonge/rabshakeh-couchdb-python-progress-attachments |
7420030ef8253580942412c479f2868ea7091eaa | config-example.py | config-example.py | """
Minimal config file for kahvibot. Just define values as normal Python code.
"""
# put your bot token here as a string
bot_token = ""
# the tg username of the bot's admin.
admin_username = ""
# if a message contains any of these words, the bot responds
trigger_words = [
"kahvi",
"\u2615", # coffee emoji
... | """
Minimal config file for kahvibot. Just define values as normal Python code.
"""
# put your bot token here as a string
bot_token = ""
# the tg username of the bot's admin.
admin_username = ""
# The size of the pictures the webcamera takes. As of 2022-03-06, the guild
# room has a Creative Live! Cam Sync HD USB w... | Add camera image dimensions to config | Add camera image dimensions to config
| Python | mit | mgunyho/kiltiskahvi |
456b72757cda81c8dd6634ae41b8a1008ff59087 | config-example.py | config-example.py | """
Minimal config file for kahvibot. Just define values as normal Python code.
"""
# put your bot token here as a string
bot_token = ""
# the tg username of the bot's admin.
admin_username = ""
# The size of the pictures the webcamera takes. As of 2022-03-06, the guild
# room has a Creative Live! Cam Sync HD USB w... | """
Minimal config file for kahvibot. Just define values as normal Python code.
"""
# put your bot token here as a string
bot_token = ""
# the tg username of the bot's admin.
admin_username = ""
# The size of the pictures the webcamera takes. As of 2022-03-06, the guild
# room has a Creative Live! Cam Sync HD USB w... | Add watermark path to example config | Add watermark path to example config
| Python | mit | mgunyho/kiltiskahvi |
bbe765d404ff756e5a8cc828e6aa744dd6228285 | djlint/analyzers/context_processors.py | djlint/analyzers/context_processors.py | import ast
from .base import BaseAnalyzer, ModuleVisitor, Result
class ContextProcessorsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
deprecated_items = {
'django.core.context_processors.auth':
'django.contrib.auth.context_processors.auth',
'django.core.c... | import ast
from .base import BaseAnalyzer, ModuleVisitor, Result
class ContextProcessorsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.core.context_processors.auth':
'django.contrib.auth.context_processors.auth',
'django.core.cont... | Update context processors analyzer to target Django 1.4 | Update context processors analyzer to target Django 1.4
| Python | isc | alfredhq/djlint |
0af76c93eab508ca93228ce902427df35ff34bca | microscopes/lda/runner.py | microscopes/lda/runner.py | """Implements the Runner interface fo LDA
"""
from microscopes.common import validator
from microscopes.common.rng import rng
from microscopes.lda.kernels import lda_crp_gibbs
from microscopes.lda.kernels import lda_sample_dispersion
class runner(object):
"""The LDA runner
Parameters
----------
defn... | """Implements the Runner interface fo LDA
"""
from microscopes.common import validator
from microscopes.common.rng import rng
from microscopes.lda.kernels import lda_crp_gibbs
from microscopes.lda.kernels import lda_sample_dispersion
class runner(object):
"""The LDA runner
Parameters
----------
defn... | Disable hyperparam inference for now | Disable hyperparam inference for now
| Python | bsd-3-clause | datamicroscopes/lda,datamicroscopes/lda,datamicroscopes/lda |
7ed78836d1389a9a3998d154b08c0f8e331d3e87 | inthe_am/taskmanager/viewsets/activity_log.py | inthe_am/taskmanager/viewsets/activity_log.py | from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from .. import models
from ..serializers.activity_log import ActivityLogSerializer
class ActivityLogViewSet(viewsets.ModelViewSet):
permission_classes = (IsAuthenticatedOrReadOnly, )
serializer_class = Activi... | from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from .. import models
from ..serializers.activity_log import ActivityLogSerializer
class ActivityLogViewSet(viewsets.ModelViewSet):
permission_classes = (IsAuthenticatedOrReadOnly, )
serializer_class = Activi... | Return an empty activity log list for unauthenticated users. | Return an empty activity log list for unauthenticated users.
| Python | agpl-3.0 | coddingtonbear/inthe.am,coddingtonbear/inthe.am,coddingtonbear/inthe.am,coddingtonbear/inthe.am,coddingtonbear/inthe.am |
63ad1bc8f237a90975c7fa883143021faa679efd | pkit/__init__.py | pkit/__init__.py | version = (0, 1, 0)
__title__ = "Process Kit"
__author__ = "Oleiade"
__license__ = "MIT"
__version__ = '.'.join(map(str, version))
from pkit.process import Process
| version = (0, 1, 0)
__title__ = "Process Kit"
__author__ = "Oleiade"
__license__ = "MIT"
__version__ = '.'.join(map(str, version))
| Add a wait option to Process.terminate | Add a wait option to Process.terminate
| Python | mit | botify-labs/process-kit |
4166bf21aa8ff9264724ef8101231557f40b80ef | production.py | production.py | from flask import Flask, render_template, jsonify, make_response, request, current_app
from gevent import monkey
from gevent import wsgi
import app
monkey.patch_all()
app = Flask(__name__)
server = wsgi.WSGIServer(('203.29.62.211', 5050), app)
server.serve_forever() | from flask import Flask, render_template, jsonify, make_response, request, current_app
from gevent import monkey
from gevent import wsgi
import app
monkey.patch_all()
app = Flask(__name__)
server = wsgi.WSGIServer(('203.29.62.211', 5050), app)
server.serve_forever()
@app.route('/')
def index():
return render_templ... | Add one route so that our monitoring system stops thinking this system is down | Add one route so that our monitoring system stops thinking this system is down
| Python | apache-2.0 | ishgroup/lightbook,ishgroup/lightbook,ishgroup/lightbook |
980b7f55968d76b6f9222b7c381e1c98e144ddeb | tests/database_tests.py | tests/database_tests.py | from .query_tests import QueryTestCase
from .sql_builder_tests import SqlBuilderTestCase
from .transaction_tests import TransactionTestCase
from rebel.database import Database
from rebel.exceptions import NotInsideTransaction, MixedPositionalAndNamedArguments
class DatabaseTestCase(QueryTestCase, SqlBuilderTestCase,... | from .query_tests import QueryTestCase
from .sql_builder_tests import SqlBuilderTestCase
from .transaction_tests import TransactionTestCase
from rebel.database import Database
class DatabaseTestCase(QueryTestCase, SqlBuilderTestCase, TransactionTestCase):
def setUp(self):
driver = self.get_driver()
... | Remove unused imports from database tests | Remove unused imports from database tests
| Python | mit | hugollm/rebel,hugollm/rebel |
943856b68531b54e0ec4b34a74c2408311760d23 | nova/tests/scheduler/__init__.py | nova/tests/scheduler/__init__.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | Fix and Gate on H303 (no wildcard imports) | Fix and Gate on H303 (no wildcard imports)
Wildcard imports make reading code unnecessarily confusing because they
make it harder to see where a functions comes from. We had two types of
wildcard imports in the code. Unneeded ones in test files that are just
removed, and some that we actually want which are kept usin... | Python | apache-2.0 | n0ano/ganttclient |
a08fff5946f5faa5d174cf7536bd4e71e6d299a0 | tests/test_blueprint.py | tests/test_blueprint.py | import pytest
import broadbean as bb
@pytest.fixture
def virgin_blueprint():
"""
Return an empty instance of BluePrint
"""
return bb.BluePrint()
##################################################
# TEST BARE INITIALISATION
def test_creation(virgin_blueprint):
assert isinstance(virgin_blueprint,... | import pytest
import broadbean as bb
@pytest.fixture
def virgin_blueprint():
"""
Return an empty instance of BluePrint
"""
return bb.BluePrint()
##################################################
# TEST BARE INITIALISATION
def test_creation(virgin_blueprint):
assert isinstance(virgin_blueprint,... | Make the test look fancy | refactor: Make the test look fancy
Use fancy decorators to make the simple test look fancy.
| Python | mit | WilliamHPNielsen/broadbean |
0ba5b555c4ccb559b5f666e800cc7102b5d9729f | rctkdemos/layouts_grid.py | rctkdemos/layouts_grid.py | from rctkdemos.demos import serve_demo
from rctk.widgets import StaticText
from rctk.layouts import GridLayout
class Demo(object):
title = "Grid"
description = "Demonstrates the Grid using padding and different col/rowspans"
def build(self, tk, parent):
parent.setLayout(GridLayout(columns=3, padx=... | from rctkdemos.demos import serve_demo, standalone
from rctk.widgets import StaticText
from rctk.layouts import GridLayout
class Demo(object):
title = "Grid"
description = "Demonstrates the Grid using padding and different col/rowspans"
def build(self, tk, parent):
parent.setLayout(GridLayout(colu... | Enable running layout demo standalone | Enable running layout demo standalone
git-svn-id: de585c8a1036fae0bde8438f23c67a99526c94d0@627 286bb87c-ec97-11de-a004-2f18c49ebcc3
| Python | bsd-2-clause | rctk/demos |
f0c45df83b5fabeefcef5d90fd6084c3ea743995 | arches/db/migration_operations/extras.py | arches/db/migration_operations/extras.py | from django.db.migrations.operations.base import Operation
class CreateExtension(Operation):
def __init__(self, name):
self.name = name
def state_forwards(self, app_label, state):
pass
def database_forwards(self, app_label, schema_editor, from_state, to_state):
schema_editor.exec... | from django.db.migrations.operations.base import Operation
class CreateExtension(Operation):
def __init__(self, name):
self.name = name
def state_forwards(self, app_label, state):
pass
def database_forwards(self, app_label, schema_editor, from_state, to_state):
schema_editor.exec... | Add double quotes to sql statement in CreateExtension module. | Add double quotes to sql statement in CreateExtension module.
| Python | agpl-3.0 | cvast/arches,cvast/arches,archesproject/arches,cvast/arches,archesproject/arches,archesproject/arches,cvast/arches,archesproject/arches |
e1e430f74902d653e9c46878a8f254f8feb478ca | example/article/models.py | example/article/models.py | from django.core.urlresolvers import reverse
from django.db import models
from fluent_comments.moderation import moderate_model, comments_are_open, comments_are_moderated
from fluent_comments.models import get_comments_for_model, CommentsRelation
class Article(models.Model):
title = models.CharField("Title", max_... | from django.core.urlresolvers import reverse
from django.db import models
from django.utils.six import python_2_unicode_compatible
from fluent_comments.moderation import moderate_model, comments_are_open, comments_are_moderated
from fluent_comments.models import get_comments_for_model, CommentsRelation
@python_2_uni... | Fix example Article.__str__ in Python 3 | Fix example Article.__str__ in Python 3
| Python | apache-2.0 | django-fluent/django-fluent-comments,django-fluent/django-fluent-comments,edoburu/django-fluent-comments,edoburu/django-fluent-comments,django-fluent/django-fluent-comments,django-fluent/django-fluent-comments,edoburu/django-fluent-comments |
2c7907c6516ded896000dec610bde09f7721915d | ckanext/datasetversions/logic/action/create.py | ckanext/datasetversions/logic/action/create.py | import ckan.logic as logic
from ckan.logic.action.get import package_show as ckan_package_show
from ckan.plugins import toolkit
from ckanext.datasetversions.helpers import get_context
def dataset_version_create(context, data_dict):
id = data_dict.get('id')
parent_name = data_dict.get('base_name')
owner_... | import ckan.logic as logic
from ckan.logic.action.get import package_show as ckan_package_show
from ckan.plugins import toolkit
from ckanext.datasetversions.helpers import get_context
def dataset_version_create(context, data_dict):
id = data_dict.get('id')
parent_name = data_dict.get('base_name')
owner_... | Create a parent with the same dataset type | Create a parent with the same dataset type
| Python | agpl-3.0 | aptivate/ckanext-datasetversions,aptivate/ckanext-datasetversions,aptivate/ckanext-datasetversions |
69853e5ef1ef297c776fd23a48b0ac0b2356f06f | examples/fantasy/tasks.py | examples/fantasy/tasks.py | import json
from pathlib import Path
import sys
import sqlalchemy as sa
from invoke import task
FANTASY_DB_SQL = Path.cwd() / 'fantasy-database' / 'schema.sql'
FANTASY_DB_DATA = Path.cwd() / 'fantasy-database' / 'data.json'
@task
def populate_db(ctx, data_file=FANTASY_DB_DATA):
from examples.fantasy import tabl... | import json
from pathlib import Path
import sys
import sqlalchemy as sa
from invoke import task
FANTASY_DATA_FOLDER = Path(__file__).parent / 'fantasy-database'
@task
def populate_db(ctx, data_folder=FANTASY_DATA_FOLDER, dsn=None):
from examples.fantasy import tables
data_file = data_folder / 'data.json'
... | Refactor populate_db pyinvoke task to use it in tests | Refactor populate_db pyinvoke task to use it in tests
| Python | mit | vovanbo/aiohttp_json_api |
47540d79fbf3009f1dff27d45f935859460349f9 | sevenbridges/models/compound/tasks/__init__.py | sevenbridges/models/compound/tasks/__init__.py | from sevenbridges.models.file import File
def map_input_output(item, api):
"""
Maps item to appropriate sevebridges object.
:param item: Input/Output value.
:param api: Api instance.
:return: Mapped object.
"""
if isinstance(item, list):
return [map_input_output(it, api) for it in ... | from sevenbridges.models.file import File
def map_input_output(item, api):
"""
Maps item to appropriate sevebridges object.
:param item: Input/Output value.
:param api: Api instance.
:return: Mapped object.
"""
if isinstance(item, list):
return [map_input_output(it, api) for it in ... | Set additional fields when mapping inputs and outputs | Set additional fields when mapping inputs and outputs
This will reduce the risk of unnecessary lazy fetching
| Python | apache-2.0 | sbg/sevenbridges-python |
fe771659b876bfe23e5b16b9648ab7ede5b314e9 | comics/crawler/crawlers/questionablecontent.py | comics/crawler/crawlers/questionablecontent.py | from comics.crawler.crawlers import BaseComicCrawler
class ComicCrawler(BaseComicCrawler):
def _get_url(self):
self.feed_url = 'http://www.questionablecontent.net/QCRSS.xml'
self.parse_feed()
for entry in self.feed['entries']:
if self.timestamp_to_date(entry['updated_parsed']) ... | from comics.crawler.crawlers import BaseComicCrawler
class ComicCrawler(BaseComicCrawler):
def _get_url(self):
self.feed_url = 'http://www.questionablecontent.net/QCRSS.xml'
self.parse_feed()
for entry in self.feed.entries:
if ('updated_parsed' in entry and
self... | Fix error in Questionable Content crawler when feed entry does not contain date | Fix error in Questionable Content crawler when feed entry does not contain date
| Python | agpl-3.0 | datagutten/comics,klette/comics,klette/comics,datagutten/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,klette/comics,jodal/comics,jodal/comics |
620bb416b0e44cc002679e001f1f0b8ab7792685 | bmi_tester/tests_pytest/test_grid.py | bmi_tester/tests_pytest/test_grid.py | from nose.tools import (assert_is_instance, assert_less_equal, assert_equal,
assert_greater, assert_in)
# from nose import with_setup
# from .utils import setup_func, teardown_func, all_names, all_grids, new_bmi
from .utils import all_names, all_grids
VALID_GRID_TYPES = (
"scalar",
"u... | from nose.tools import (assert_is_instance, assert_less_equal, assert_equal,
assert_greater, assert_in)
# from nose import with_setup
# from .utils import setup_func, teardown_func, all_names, all_grids, new_bmi
from .utils import all_names, all_grids
VALID_GRID_TYPES = (
"scalar",
"v... | Add vector as valid grid type. | Add vector as valid grid type.
| Python | mit | csdms/bmi-tester |
c7172405b835920d553aa3d5ac6d415da2253d0d | oneflow/core/social_pipeline.py | oneflow/core/social_pipeline.py | # -*- coding: utf-8 -*-
u"""
Copyright 2013-2014 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
It provides {python,django}-social-auth pipeline helpers.
1flow is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by th... | # -*- coding: utf-8 -*-
u"""
Copyright 2013-2014 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
It provides {python,django}-social-auth pipeline helpers.
1flow is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by th... | Remove useless/obsolete social pipeline function (it's done in social_auth post_save()+task to make pipeline independant and faster). | Remove useless/obsolete social pipeline function (it's done in social_auth post_save()+task to make pipeline independant and faster).
| Python | agpl-3.0 | 1flow/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,WillianPaiva/1flow |
44c174807d7362b5d7959f122f2a74ae9ccb7b38 | coney/request.py | coney/request.py | from .exceptions import MalformedRequestException
class Request(object):
def __init__(self, version, metadata, **kwargs):
self._version = version
self._metadata = metadata
self._arguments = kwargs
@property
def version(self):
return self._version
@property
def arg... | from .exceptions import MalformedRequestException
class Request(object):
def __init__(self, version, metadata, arguments):
self._version = version
self._metadata = metadata
self._arguments = arguments
@property
def version(self):
return self._version
@property
def... | Fix rpc argument handling when constructing a Request | Fix rpc argument handling when constructing a Request
| Python | mit | cbigler/jackrabbit |
b4399f3dfb8f15f1a811fbcc31453575ad83d277 | byceps/services/snippet/transfer/models.py | byceps/services/snippet/transfer/models.py | """
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from enum import Enum
from typing import NewType
from uuid import UUID
from attr import attrib, attrs
from ...site.transfer.models impor... | """
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from enum import Enum
from typing import NewType
from uuid import UUID
from attr import attrib, attrs
from ...site.transfer.models impor... | Add missing return types to scope factory methods | Add missing return types to scope factory methods
| Python | bsd-3-clause | homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps |
329fa135faca80bd9dee74989110aa6222e44e2b | landlab/io/vtk/vti.py | landlab/io/vtk/vti.py | #! /bin/env python
from landlab.io.vtk.writer import VtkWriter
from landlab.io.vtk.vtktypes import VtkUniformRectilinear
from landlab.io.vtk.vtkxml import (
VtkRootElement,
VtkGridElement,
VtkPieceElement,
VtkPointDataElement,
VtkCellDataElement,
VtkExtent,
VtkOrigin,
VtkSpacing,
)
cl... | #! /bin/env python
from landlab.io.vtk.writer import VtkWriter
from landlab.io.vtk.vtktypes import VtkUniformRectilinear
from landlab.io.vtk.vtkxml import (
VtkRootElement,
VtkGridElement,
VtkPieceElement,
VtkPointDataElement,
VtkCellDataElement,
VtkExtent,
VtkOrigin,
VtkSpacing,
)
cl... | Fix typos: encoding, data -> self.encoding, self.data | Fix typos: encoding, data -> self.encoding, self.data
| Python | mit | landlab/landlab,landlab/landlab,cmshobe/landlab,cmshobe/landlab,amandersillinois/landlab,cmshobe/landlab,amandersillinois/landlab,landlab/landlab |
1716d38b995638c6060faa0925861bd8ab4c0e2b | statsmodels/stats/tests/test_outliers_influence.py | statsmodels/stats/tests/test_outliers_influence.py | from numpy.testing import assert_almost_equal
from statsmodels.datasets import statecrime
from statsmodels.regression.linear_model import OLS
from statsmodels.stats.outliers_influence import reset_ramsey
from statsmodels.tools import add_constant
data = statecrime.load_pandas().data
def test_reset_stata():
mod ... | from numpy.testing import assert_almost_equal
from statsmodels.datasets import statecrime, get_rdataset
from statsmodels.regression.linear_model import OLS
from statsmodels.stats.outliers_influence import reset_ramsey
from statsmodels.stats.outliers_influence import variance_inflation_factor
from statsmodels.tools imp... | Add pandas dataframe capability in variance_inflation_factor | ENH: Add pandas dataframe capability in variance_inflation_factor
| Python | bsd-3-clause | josef-pkt/statsmodels,statsmodels/statsmodels,josef-pkt/statsmodels,statsmodels/statsmodels,bashtage/statsmodels,josef-pkt/statsmodels,josef-pkt/statsmodels,josef-pkt/statsmodels,bashtage/statsmodels,statsmodels/statsmodels,josef-pkt/statsmodels,bashtage/statsmodels,statsmodels/statsmodels,bashtage/statsmodels,bashtage... |
c7e4fc5038cb2069193aa888c4978e9aeff995f7 | source/segue/backend/processor/background.py | source/segue/backend/processor/background.py | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import subprocess
import pickle
import base64
try:
from shlex import quote
except ImportError:
from pipes import quote
from .base import Processor
from .. import pickle_support
class BackgroundProcessor(... | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import subprocess
import pickle
import base64
try:
from shlex import quote
except ImportError:
from pipes import quote
from .base import Processor
from .. import pickle_support
class BackgroundProcessor(... | Fix failing command on Linux. | Fix failing command on Linux.
| Python | apache-2.0 | 4degrees/segue |
15a792e38152e9c7aa6a10bbc251e9b5f0df1341 | aurora/optim/sgd.py | aurora/optim/sgd.py | import numpy as np
from .base import Base
class SGD(Base):
def __init__(self, cost, params, lr=0.1, momentum=0.9):
super().__init__(cost, params, lr)
self.momentum = momentum
self.velocity = self._init_velocity_vec(params)
def step(self, feed_dict):
exe_output = self.executor.... | import numpy as np
from .base import Base
class SGD(Base):
def __init__(self, cost, params, lr=0.1, momentum=0.9):
super().__init__(cost, params, lr)
self.momentum = momentum
self.velocity = [np.zeros_like(param.const)for param in params]
def step(self, feed_dict):
exe_output ... | Improve velocity list initialisation in SGD | Improve velocity list initialisation in SGD
| Python | apache-2.0 | upul/Aurora,upul/Aurora,upul/Aurora |
5351ad8324fa8388ea3b82425d03f43ac16d7313 | app.py | app.py | #!/usr/bin/env python
import os, requests, getSchedule
from flask import Flask, request, jsonify, render_template, abort
app = Flask(__name__)
@app.route('/')
def root():
return render_template('index.html')
@app.route('/m')
def mobileView():
stop = request.args.get('stop', 1, type=int)
route = requests.get('htt... | #!/usr/bin/env python
import os, requests, getSchedule
from flask import Flask, request, jsonify, render_template, abort
app = Flask(__name__)
@app.route('/')
def root():
return render_template('index.html')
@app.route('/m')
def mobileView():
stop = request.args.get('stop', 1, type=int)
payload = {'stop': stop}
... | Use Requests to encode stop as query param, verify API status code. | Use Requests to encode stop as query param, verify API status code.
| Python | mit | alykhank/NextRide,alykhank/NextRide |
36b37cc3439b1b99b2496c9a8037de9e412ad151 | account_payment_partner/models/account_move_line.py | account_payment_partner/models/account_move_line.py | # Copyright 2016 Akretion (http://www.akretion.com/)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
payment_mode_id = fields.Many2one(
'account.payment.mode',
string='Pay... | # Copyright 2016 Akretion (http://www.akretion.com/)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
payment_mode_id = fields.Many2one(
'account.payment.mode',
string='Pay... | Add indexes on account payment models | Add indexes on account payment models
The fields where the indexes are added are used in searches in
account_payment_order, which becomes really slow when a database have
many lines.
| Python | agpl-3.0 | OCA/bank-payment,OCA/bank-payment |
d0fe2fd4bc619a45d18c3e5ba911b15045366849 | api/tests/test_small_scripts.py | api/tests/test_small_scripts.py | """This module tests the small scripts - admin, model, and wsgi."""
import unittest
class SmallScriptsTest(unittest.TestCase):
def test_admin(self):
import api.admin
def test_models(self):
import api.models
def test_wsgi(self):
import apel_rest.wsgi
| """This module tests the small scripts - admin, model, and wsgi."""
# Using unittest and not django.test as no need for overhead of database
import unittest
class SmallScriptsTest(unittest.TestCase):
def test_admin(self):
"""Check that admin is importable."""
import api.admin
def test_models... | Add docstrings and comment to small scripts test | Add docstrings and comment to small scripts test
| Python | apache-2.0 | apel/rest,apel/rest |
01b17ee30889afe1eadf8ec98c187ca9b856d0f7 | connector/views.py | connector/views.py | from django.conf import settings
from django.template import RequestContext
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Template
from cancer_browser.core.http import HttpResponseSendFile
from django.core.urlresolvers import reverse
import os, re
def client_vars(request, bas... | from django.conf import settings
from django.template import RequestContext
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Template
from cancer_browser.core.http import HttpResponseSendFile
from django.core.urlresolvers import reverse
import os, re
def client_vars(request, bas... | Add mime type for sourcemaps. | Add mime type for sourcemaps.
| Python | apache-2.0 | ucscXena/ucsc-xena-client,ucscXena/ucsc-xena-client,acthp/ucsc-xena-client,ucscXena/ucsc-xena-client,ucscXena/ucsc-xena-client,ucscXena/ucsc-xena-client,acthp/ucsc-xena-client,acthp/ucsc-xena-client |
392f58abf7b163bb34e395f5818daa0a13d05342 | pyscriptic/tests/instructions_test.py | pyscriptic/tests/instructions_test.py |
from unittest import TestCase
from pyscriptic.instructions import PipetteOp, TransferGroup, PrePostMix
class PipetteOpTests(TestCase):
def setUp(self):
self.mix = PrePostMix(
volume="5:microliter",
speed="1:microliter/second",
repetitions=10,
)
def test_tr... |
from unittest import TestCase
from pyscriptic.instructions import PipetteOp, TransferGroup, PrePostMix
from pyscriptic.submit import pyobj_to_std_types
class PipetteOpTests(TestCase):
def setUp(self):
self.mix = PrePostMix(
volume="5:microliter",
speed="0.5:microliter/second",
... | Test conversion of Transfer to standard types works | Test conversion of Transfer to standard types works
| Python | bsd-2-clause | naderm/pytranscriptic,naderm/pytranscriptic |
5bb4a72f9541fa59fa3770a52da6edb619f5a897 | submodules-to-glockfile.py | submodules-to-glockfile.py | #!/usr/bin/python
import re
import subprocess
def main():
source = open(".gitmodules").read()
paths = re.findall(r"path = (.*)", source)
for path in paths:
print "{repo} {sha}".format(
repo = path[7:],
sha = path_sha1(path)
)
def path_sha1(path):
cmd = "cd {} ... | #!/usr/bin/python
import re
import subprocess
def main():
source = open(".gitmodules").read()
paths = re.findall(r"path = (.*)", source)
print "github.com/localhots/satan {}".format(path_sha1("."))
for path in paths:
print "{repo} {sha}".format(
repo = path[7:],
sha = ... | Add satan sha to glockfile script | Add satan sha to glockfile script
| Python | mit | localhots/satan,localhots/satan,localhots/satan,localhots/satan |
e72b6272469c382f14a6732514777aacbd457322 | rest_framework_json_api/exceptions.py | rest_framework_json_api/exceptions.py | from django.utils import encoding
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException
from rest_framework.views import exception_handler as drf_exception_handler
from rest_framework_json_api.utils import format_value
def excepti... | from django.utils import encoding
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException
from rest_framework.views import exception_handler as drf_exception_handler
from rest_framework_json_api.utils import format_value
def excepti... | Fix for some error messages that were split into several messages | Fix for some error messages that were split into several messages
The exception handler expects the error to be a list on line 33. In my
case they were a string, which lead to the split of the string into
multiple errors containing one character
| Python | bsd-2-clause | django-json-api/rest_framework_ember,Instawork/django-rest-framework-json-api,leifurhauks/django-rest-framework-json-api,hnakamur/django-rest-framework-json-api,martinmaillard/django-rest-framework-json-api,pombredanne/django-rest-framework-json-api,lukaslundgren/django-rest-framework-json-api,leo-naeka/rest_framework_... |
385e9c0b8af79de58efd3cf43b1981b7981d0a53 | sympy/geometry/__init__.py | sympy/geometry/__init__.py | """
A geometry module for the SymPy library. This module contains all of the
entities and functions needed to construct basic geometrical data and to
perform simple informational queries.
Usage:
======
Notes:
======
Currently the geometry module is restricted to the 2-dimensional
Euclidean space.
Examples
=... | """
A geometry module for the SymPy library. This module contains all of the
entities and functions needed to construct basic geometrical data and to
perform simple informational queries.
Usage:
======
Notes:
======
Currently the geometry module is restricted to the 2-dimensional
Euclidean space.
Examples
=... | Remove glob imports from sympy.geometry. | Remove glob imports from sympy.geometry.
| Python | bsd-3-clause | postvakje/sympy,Mitchkoens/sympy,farhaanbukhsh/sympy,sampadsaha5/sympy,kumarkrishna/sympy,MechCoder/sympy,lindsayad/sympy,maniteja123/sympy,yashsharan/sympy,sahilshekhawat/sympy,MechCoder/sympy,rahuldan/sympy,yashsharan/sympy,kevalds51/sympy,Designist/sympy,jaimahajan1997/sympy,emon10005/sympy,skidzo/sympy,mcdaniel67/s... |
697fcbd5135c9c3610c4131fe36b9a2723be1eeb | mappyfile/__init__.py | mappyfile/__init__.py | # allow high-level functions to be accessed directly from the mappyfile module
from mappyfile.utils import load, loads, find, findall, dumps, write | # allow high-level functions to be accessed directly from the mappyfile module
from mappyfile.utils import load, loads, find, findall, dumps, write
__version__ = "0.3.0" | Add version to module init | Add version to module init
| Python | mit | geographika/mappyfile,geographika/mappyfile |
683765c26e0c852d06fd06a491e3906369ae14cd | votes/urls.py | votes/urls.py | from django.conf.urls import include, url
from django.views.generic import TemplateView
from votes.views import VoteView
urlpatterns = [
url(r'^(?P<vote_name>[\w-]+)$', VoteView.as_view()),
]
| from django.conf.urls import include, url
from django.views.generic import TemplateView
from votes.views import VoteView
urlpatterns = [
url(r'^(?P<vote_name>[\w-]+)$', VoteView.as_view(), name="vote"),
]
| Add name to vote view URL | Add name to vote view URL
| Python | mit | kuboschek/jay,kuboschek/jay,OpenJUB/jay,kuboschek/jay,OpenJUB/jay,OpenJUB/jay |
0a60495fc2baef1c5115cd34e2c062c363dfedc8 | test/streamparse/cli/test_run.py | test/streamparse/cli/test_run.py | from __future__ import absolute_import, unicode_literals
import argparse
import unittest
from nose.tools import ok_
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from streamparse.cli.run import main, subparser_hook
class RunTestCase(unittest.TestCase):
def test_subpar... | from __future__ import absolute_import, unicode_literals
import argparse
import unittest
from nose.tools import ok_
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from streamparse.cli.run import main, subparser_hook
class RunTestCase(unittest.TestCase):
def test_subpar... | Fix mock needing config_file variable | Fix mock needing config_file variable
| Python | apache-2.0 | Parsely/streamparse,Parsely/streamparse |
b665da9bdebb6736eef08f782d7361a34dcd30c5 | bin/import_media.py | bin/import_media.py | #!/usr/bin/python
import sys
sys.path.append('.')
from vacker.importer import Importer
importer = Importer()
# Need to obtain from arguments
importer.import_directory('../sample_photos')
| #!/usr/bin/python
import sys
sys.path.append('.')
import argparse
from vacker.importer import Importer
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('--directory', '-d', type=str, dest='directory',
help='Directory to import', required=True)
args = pa... | Update imported to use arg parser | Update imported to use arg parser
| Python | apache-2.0 | MatthewJohn/vacker,MatthewJohn/vacker,MatthewJohn/vacker |
2d4310cab029269cd53c776a3da238fa375e2ee1 | DebianChangesBot/mailparsers/accepted_upload.py | DebianChangesBot/mailparsers/accepted_upload.py | # -*- coding: utf-8 -*-
from DebianChangesBot import MailParser
from DebianChangesBot.messages import AcceptedUploadMessage
class AcceptedUploadParser(MailParser):
@staticmethod
def parse(headers, body):
msg = AcceptedUploadMessage()
mapping = {
'Source': 'package',
'... | # -*- coding: utf-8 -*-
from DebianChangesBot import MailParser
from DebianChangesBot.messages import AcceptedUploadMessage
class AcceptedUploadParser(MailParser):
@staticmethod
def parse(headers, body):
if headers.get('List-Id', '') != '<debian-devel-changes.lists.debian.org>':
return
... | Check accepted uploads List-Id, otherwise we get false +ves from bugs-dist | Check accepted uploads List-Id, otherwise we get false +ves from bugs-dist
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk>
| Python | agpl-3.0 | xtaran/debian-devel-changes-bot,sebastinas/debian-devel-changes-bot,xtaran/debian-devel-changes-bot,lamby/debian-devel-changes-bot,lamby/debian-devel-changes-bot,lamby/debian-devel-changes-bot |
4180680c9964661d3edd9eafad23b8d90699170d | fuzzyfinder/main.py | fuzzyfinder/main.py | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(input, collection, accessor=lambda x: x):
"""
Args:
input (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
... | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(input, collection, accessor=lambda x: x):
"""
Args:
input (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
... | Use accessor to use in sort. | Use accessor to use in sort.
| Python | bsd-3-clause | amjith/fuzzyfinder |
e80d4b35472e692f05e986116a5910e1a9612f74 | build/android/pylib/gtest/gtest_config.py | build/android/pylib/gtest/gtest_config.py | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Configuration file for android gtest suites."""
# Add new suites here before upgrading them to the stable list below.
EXPERIMENTAL_TEST_SUITES = [
... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Configuration file for android gtest suites."""
# Add new suites here before upgrading them to the stable list below.
EXPERIMENTAL_TEST_SUITES = [
... | Move andorid webkit tests to main waterfall and CQ | Move andorid webkit tests to main waterfall and CQ
They have been stable and fast on FYI bots for a week.
TBR=yfriedman@chromium.org
Review URL: https://codereview.chromium.org/12093034
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@179266 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,dednal/chromium.src,markYoungH/chromium.src,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,TheTypoMaster... |
b39ea7848141037c7829a01d789591d91a81398e | ceph_medic/tests/test_main.py | ceph_medic/tests/test_main.py | import pytest
import ceph_medic.main
class TestMain(object):
def test_main(self):
assert ceph_medic.main
def test_invalid_ssh_config(self, capsys):
argv = ["ceph-medic", "--ssh-config", "/does/not/exist"]
with pytest.raises(SystemExit):
ceph_medic.main.Medic(argv)
... | import pytest
import ceph_medic.main
class TestMain(object):
def test_main(self):
assert ceph_medic.main
def test_invalid_ssh_config(self, capsys):
argv = ["ceph-medic", "--ssh-config", "/does/not/exist"]
with pytest.raises(SystemExit):
ceph_medic.main.Medic(argv)
... | Add test for valid ssh_config | tests/main: Add test for valid ssh_config
Signed-off-by: Zack Cerza <d7cdf09fc0f0426e98c9978ee42da5d61fa54986@redhat.com>
| Python | mit | alfredodeza/ceph-doctor |
36998345ef900286527a3896f70cf4a85414ccf8 | rohrpost/main.py | rohrpost/main.py | import json
from functools import partial
from . import handlers # noqa
from .message import send_error
from .registry import HANDLERS
REQUIRED_FIELDS = ['type', 'id']
try:
DECODE_ERRORS = (json.JSONDecodeError, TypeError)
except AttributeError:
# Python 3.3 and 3.4 raise a ValueError instead of json.JSOND... | import json
from functools import partial
from . import handlers # noqa
from .message import send_error
from .registry import HANDLERS
REQUIRED_FIELDS = ['type', 'id']
try:
DECODE_ERRORS = (json.JSONDecodeError, TypeError)
except AttributeError:
# Python 3.3 and 3.4 raise a ValueError instead of json.JSOND... | Use keyword arguments in code | Use keyword arguments in code
| Python | mit | axsemantics/rohrpost,axsemantics/rohrpost |
194557f236016ec0978e5cc465ba40e7b8dff714 | s3backup/main.py | s3backup/main.py | # -*- coding: utf-8 -*-
from s3backup.clients import compare, LocalSyncClient
def sync():
local_client = LocalSyncClient('/home/michael/Notebooks')
current = local_client.get_current_state()
index = local_client.get_index_state()
print(list(compare(current, index)))
local_client.update_index()
| # -*- coding: utf-8 -*-
import os
from s3backup.clients import compare, LocalSyncClient
def sync():
target_folder = os.path.expanduser('~/Notebooks')
local_client = LocalSyncClient(target_folder)
current = local_client.get_current_state()
index = local_client.get_index_state()
print(list(compar... | Use expanduser to prevent hardcoding username | Use expanduser to prevent hardcoding username
| Python | mit | MichaelAquilina/s3backup,MichaelAquilina/s3backup |
a4a37a783efcfd1cbb21acc29077c8096a0a0198 | spacy/lang/pl/__init__.py | spacy/lang/pl/__init__.py | # coding: utf8
from __future__ import unicode_literals
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .stop_words import STOP_WORDS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...language import Language
from ...attrs import LANG
from ...util import update_exc
class Polish(Language):
la... | # coding: utf8
from __future__ import unicode_literals
from .stop_words import STOP_WORDS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...language import Language
from ...attrs import LANG
from ...util import update_exc
class Polish(Language):
lang = 'pl'
class Defaults(Language.Defaults):
... | Remove import from non-existing module | Remove import from non-existing module
| Python | mit | honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,recognai/spaCy,spacy-io/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,aikramer2/spaCy,recognai/spaCy,spacy-io/spaCy,honnibal/spaCy,honnibal/spaCy,recognai/spaCy,aikramer2/spaCy,honnibal/spaCy,explosion/spaCy,aikramer2/spaCy,explosion/spaCy,aikramer2/s... |
530b1b09b7fd6215822283c22c126ce7c18ac9a9 | services/rdio.py | services/rdio.py | from werkzeug.urls import url_decode
from oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_BODY
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category = 'Music'
#... | from werkzeug.urls import url_decode
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category = 'Music'
# URLs to interact with the API
request_token_url = '... | Allow Rdio to use default signature handling | Allow Rdio to use default signature handling
| Python | bsd-3-clause | foauth/foauth.org,foauth/foauth.org,foauth/foauth.org |
7486f423d018aaf53af94bc8af8bde6d46e73e71 | class4/exercise6.py | class4/exercise6.py | from getpass import getpass
from netmiko import ConnectHandler
def main():
password = getpass()
pynet_rtr1 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'username': 'pyclass', 'password': password, 'port': 22}
pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'username': 'pyclass', 'pa... | # Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx.
from getpass import getpass
from netmiko import ConnectHandler
def main():
password = getpass()
pynet_rtr1 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'username': 'pyclass', 'password': password, 'port': 22}
pynet_rtr... | Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx. | Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx.
| Python | apache-2.0 | linkdebian/pynet_course |
3decbd1e235a6a43541bb8e9846ea1d08bec1ef8 | tools/linter_lib/pyflakes.py | tools/linter_lib/pyflakes.py | import argparse
from typing import List
from zulint.linters import run_pyflakes
def check_pyflakes(files: List[str], options: argparse.Namespace) -> bool:
suppress_patterns = [
("scripts/lib/pythonrc.py", "imported but unused"),
# Intentionally imported by zerver/lib/webhooks/common.py
(... | import argparse
from typing import List
from zulint.linters import run_pyflakes
def check_pyflakes(files: List[str], options: argparse.Namespace) -> bool:
suppress_patterns = [
("scripts/lib/pythonrc.py", "imported but unused"),
# Intentionally imported by zerver/lib/webhooks/common.py
(... | Remove settings exemption for possibly undefined star imports. | lint: Remove settings exemption for possibly undefined star imports.
Signed-off-by: Anders Kaseorg <dfdb7392591db597bc41cf266a9c3bc12a2706e5@zulip.com>
| Python | apache-2.0 | timabbott/zulip,eeshangarg/zulip,synicalsyntax/zulip,eeshangarg/zulip,showell/zulip,timabbott/zulip,synicalsyntax/zulip,kou/zulip,zulip/zulip,hackerkid/zulip,brainwane/zulip,punchagan/zulip,timabbott/zulip,showell/zulip,brainwane/zulip,brainwane/zulip,eeshangarg/zulip,kou/zulip,timabbott/zulip,hackerkid/zulip,zulip/zul... |
5231efb00409ffd0b1b0e1cf111d81782468cdd3 | wye/regions/forms.py | wye/regions/forms.py | from django import forms
from django.core.exceptions import ValidationError
from wye.profiles.models import UserType
from . import models
class RegionalLeadForm(forms.ModelForm):
class Meta:
model = models.RegionalLead
exclude = ()
def clean(self):
location = self.cleaned_data['loc... | from django import forms
from django.core.exceptions import ValidationError
from wye.profiles.models import UserType
from . import models
class RegionalLeadForm(forms.ModelForm):
class Meta:
model = models.RegionalLead
exclude = ()
def clean(self):
error_message = []
if (se... | Handle empty location and leads data | Handle empty location and leads data
| Python | mit | shankig/wye,harisibrahimkv/wye,shankisg/wye,shankisg/wye,shankisg/wye,harisibrahimkv/wye,pythonindia/wye,pythonindia/wye,shankig/wye,DESHRAJ/wye,harisibrahimkv/wye,pythonindia/wye,shankig/wye,shankig/wye,shankisg/wye,DESHRAJ/wye,harisibrahimkv/wye,DESHRAJ/wye,DESHRAJ/wye,pythonindia/wye |
e1514fa5bcc35df74295c254df65e8e99dc289a1 | speeches/util.py | speeches/util.py | from speeches.tasks import transcribe_speech
from django.forms.widgets import SplitDateTimeWidget
"""Common utility functions/classes
Things that are needed by multiple bits of code but are specific enough to
this project not to be in a separate python package"""
def start_transcribing_speech(speech):
"""Kick off... | from speeches.tasks import transcribe_speech
"""Common utility functions/classes
Things that are needed by multiple bits of code but are specific enough to
this project not to be in a separate python package"""
def start_transcribing_speech(speech):
"""Kick off a celery task to transcribe a speech"""
# We onl... | Remove BootstrapSplitDateTimeWidget as it's no longer needed | Remove BootstrapSplitDateTimeWidget as it's no longer needed
| Python | agpl-3.0 | opencorato/sayit,opencorato/sayit,opencorato/sayit,opencorato/sayit |
ab0fd99e1c2c336cd5ce68e5fdb8a58384bfa794 | elasticsearch.py | elasticsearch.py | #!/usr/bin/env python
import json
import requests
ES_HOST = 'localhost'
ES_PORT = '9200'
ELASTICSEARCH = 'http://{0}:{1}'.format(ES_HOST, ES_PORT)
def find_indices():
"""Find indices created by logstash."""
url = ELASTICSEARCH + '/_search'
r = requests.get(url, params={'_q': '_index like logstash%'})
... | #!/usr/bin/env python
import json
import requests
ES_HOST = 'localhost'
ES_PORT = '9200'
ELASTICSEARCH = 'http://{0}:{1}'.format(ES_HOST, ES_PORT)
def find_indices():
"""Find indices created by logstash."""
url = ELASTICSEARCH + '/_search'
r = requests.get(url, params={'_q': '_index like logstash%'})
... | Handle the case where there are no logs | Handle the case where there are no logs
| Python | apache-2.0 | mancdaz/rpc-openstack,busterswt/rpc-openstack,npawelek/rpc-maas,git-harry/rpc-openstack,sigmavirus24/rpc-openstack,jpmontez/rpc-openstack,mattt416/rpc-openstack,xeregin/rpc-openstack,busterswt/rpc-openstack,stevelle/rpc-openstack,xeregin/rpc-openstack,miguelgrinberg/rpc-openstack,cfarquhar/rpc-openstack,xeregin/rpc-ope... |
48cc6633a6020114f5b5eeaaf53ddb08085bfae5 | models/settings.py | models/settings.py | from openedoo_project import db
from openedoo_project import config
class Setting(db.Model):
__tablename__ = 'module_employee_site_setting'
__table_args__ = {'extend_existing': True}
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
name = db.Column(db.Text)
def serialize(self):
... | from openedoo_project import db
class Setting(db.Model):
__tablename__ = 'module_employee_site_setting'
__table_args__ = {'extend_existing': True}
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
name = db.Column(db.Text)
def serialize(self):
return {
'id': sel... | Remove Unused config imported from openedoo_project, pylint. | Remove Unused config imported from openedoo_project, pylint.
| Python | mit | openedoo/module_employee,openedoo/module_employee,openedoo/module_employee |
cb2746f60cd63019b41eebedb148bfc5a25c1ba0 | indra/preassembler/make_wm_ontmap.py | indra/preassembler/make_wm_ontmap.py | from indra.sources import eidos
from indra.sources.hume.make_hume_tsv import make_file
from indra.java_vm import autoclass
eidos_package = 'org.clulab.wm.eidos'
if __name__ == '__main__':
bbn_path = 'hume_examaples.tsv'
make_file(bbn_path)
sofia_path = 'sofia_examples.tsv'
om = autoclass(eidos_packag... | import sys
from indra.sources import eidos
from indra.sources.hume.make_hume_tsv import make_file as mht
from indra.sources.sofia.make_sofia_tsv import make_file as mst
from indra.java_vm import autoclass
eidos_package = 'org.clulab.wm.eidos'
if __name__ == '__main__':
sofia_ont_path = sys.argv[1]
hume_path =... | Update make WM ontmap with SOFIA | Update make WM ontmap with SOFIA
| Python | bsd-2-clause | pvtodorov/indra,johnbachman/indra,pvtodorov/indra,johnbachman/indra,sorgerlab/belpy,bgyori/indra,sorgerlab/indra,pvtodorov/indra,johnbachman/belpy,pvtodorov/indra,sorgerlab/indra,sorgerlab/belpy,johnbachman/belpy,johnbachman/indra,bgyori/indra,sorgerlab/belpy,sorgerlab/indra,bgyori/indra,johnbachman/belpy |
a3ec10088f379c25e0ab9c7b7e29abd2bf952806 | karld/iter_utils.py | karld/iter_utils.py | from functools import partial
from itertools import imap
from itertools import islice
from operator import itemgetter
def yield_getter_of(getter_maker, iterator):
"""
Iteratively map iterator over the result of getter_maker.
:param getter_maker: function that returns a getter function.
:param iterato... | from functools import partial
from itertools import imap
from itertools import islice
from operator import itemgetter
def yield_getter_of(getter_maker, iterator):
"""
Iteratively map iterator over the result of getter_maker.
:param getter_maker: function that returns a getter function.
:param iterato... | Use iter's sentinel arg instead of infinite loop | Use iter's sentinel arg instead of infinite loop
| Python | apache-2.0 | johnwlockwood/karl_data,johnwlockwood/stream_tap,johnwlockwood/stream_tap,johnwlockwood/iter_karld_tools |
d8a93f06cf6d78c543607d7046017cad3acc6c32 | tests/test_callback.py | tests/test_callback.py | import tests
class CallbackTests(tests.TestCase):
def test_hello_world(self):
result = []
def hello_world(loop):
result.append('Hello World')
loop.stop()
self.loop.call_soon(hello_world, self.loop)
self.loop.run_forever()
self.assertEqual(result, ['... | import tests
class CallbackTests(tests.TestCase):
def test_hello_world(self):
result = []
def hello_world(loop):
result.append('Hello World')
loop.stop()
self.loop.call_soon(hello_world, self.loop)
self.loop.run_forever()
self.assertEqual(result, ['... | Remove a test which behaves differently depending on the the version of asyncio/trollius | Remove a test which behaves differently depending on the the version of asyncio/trollius
| Python | apache-2.0 | overcastcloud/aioeventlet |
5b6ac8301908777a69dbbf74eb85af8b505fa76f | download_agents.py | download_agents.py | #!/usr/bin/env python3
from __future__ import print_function
from argparse import ArgumentParser
import json
import os
from urllib.request import urlopen
import subprocess
import sys
def main():
parser = ArgumentParser()
parser.add_argument('downloads_file', metavar='downloads-file')
args = parser.parse_... | #!/usr/bin/env python3
from __future__ import print_function
from argparse import ArgumentParser
import errno
import json
import os
from urllib.request import urlopen
import subprocess
import sys
def main():
parser = ArgumentParser()
parser.add_argument('downloads_file', metavar='downloads-file')
args = ... | Create parent directories as needed. | Create parent directories as needed. | Python | agpl-3.0 | mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju |
af0f42b86a1e3f916041eb78a4332daf0f22531a | OIPA/manage.py | OIPA/manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "OIPA.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| #!/usr/bin/env python
import os
import sys
from dotenv import find_dotenv, load_dotenv
load_dotenv(find_dotenv())
if __name__ == "__main__":
current_settings = os.getenv("DJANGO_SETTINGS_MODULE", None)
if not current_settings:
raise Exception(
"Please configure your .env file along-side ... | Load current settings from .env file | Load current settings from .env file
OIPA-645
| Python | agpl-3.0 | openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,openaid-IATI/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA |
c1b96a3ee94c25cfbe3d66eec76052badacfb38e | udata/tests/organization/test_notifications.py | udata/tests/organization/test_notifications.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from udata.models import MembershipRequest, Member
from udata.core.user.factories import UserFactory
from udata.core.organization.factories import OrganizationFactory
from udata.core.organization.notifications import (
membership_req... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import pytest
from udata.models import MembershipRequest, Member
from udata.core.user.factories import UserFactory
from udata.core.organization.factories import OrganizationFactory
from udata.core.organization.notifications import (
... | Migrate org notif tests to pytest | Migrate org notif tests to pytest
| Python | agpl-3.0 | opendatateam/udata,etalab/udata,etalab/udata,opendatateam/udata,opendatateam/udata,etalab/udata |
5a3935caab0bf720db6707bb7974eec2400f3701 | prompt_toolkit/key_binding/bindings/auto_suggest.py | prompt_toolkit/key_binding/bindings/auto_suggest.py | """
Key bindings for auto suggestion (for fish-style auto suggestion).
"""
from __future__ import unicode_literals
from prompt_toolkit.application.current import get_app
from prompt_toolkit.key_binding.key_bindings import KeyBindings
from prompt_toolkit.filters import Condition
__all__ = [
'load_auto_suggest_bindi... | """
Key bindings for auto suggestion (for fish-style auto suggestion).
"""
from __future__ import unicode_literals
import re
from prompt_toolkit.application.current import get_app
from prompt_toolkit.key_binding.key_bindings import KeyBindings
from prompt_toolkit.filters import Condition, emacs_mode
__all__ = [
'l... | Add alt-f binding for auto-suggestion. | Add alt-f binding for auto-suggestion.
| Python | bsd-3-clause | jonathanslenders/python-prompt-toolkit |
ea3deb560aaddab4d66a84e840e10854cfad581d | nass/__init__.py | nass/__init__.py | # -*- coding: utf-8 -*-
"""
USDA National Agricultural Statistics Service API wrapper
This Python wrapper implements the public API for the USDA National
Agricultural Statistics Service. It is a very thin layer over the Requests
package.
This product uses the NASS API but is not endorsed or certified by NASS.
:copyr... | # -*- coding: utf-8 -*-
"""
USDA National Agricultural Statistics Service API wrapper
This Python wrapper implements the public API for the USDA National
Agricultural Statistics Service. It is a very thin layer over the Requests
package.
This product uses the NASS API but is not endorsed or certified by NASS.
:copyr... | Make package-level import at the top (pep8) | Make package-level import at the top (pep8)
| Python | mit | nickfrostatx/nass |
5344c97e7486229f9fae40bef2b73488d5aa2ffd | uchicagohvz/users/tasks.py | uchicagohvz/users/tasks.py | from celery import task
from django.conf import settings
from django.core import mail
import smtplib
@task(rate_limit=0.2)
def do_sympa_update(user, listname, subscribe):
if subscribe:
body = "QUIET ADD %s %s %s" % (listname, user.email, user.get_full_name())
else:
body = "QUIET DELETE %s %s" % (listname, user... | from celery import task
from django.conf import settings
from django.core import mail
import smtplib
@task
def do_sympa_update(user, listname, subscribe):
if subscribe:
body = "QUIET ADD %s %s %s" % (listname, user.email, user.get_full_name())
else:
body = "QUIET DELETE %s %s" % (listname, user.email)
email =... | Remove rate limit from do_sympa_update | Remove rate limit from do_sympa_update | Python | mit | kz26/uchicago-hvz,kz26/uchicago-hvz,kz26/uchicago-hvz |
5c9bc019ea1461a82b9dbdd4b3df5c55be2a8274 | unihan_db/__about__.py | unihan_db/__about__.py | __title__ = 'unihan-db'
__package_name__ = 'unihan_db'
__description__ = 'SQLAlchemy models for UNIHAN database'
__version__ = '0.1.0'
__author__ = 'Tony Narlock'
__email__ = 'cihai@git-pull.com'
__license__ = 'MIT'
__copyright__ = 'Copyright 2017 Tony Narlock'
| __title__ = 'unihan-db'
__package_name__ = 'unihan_db'
__description__ = 'SQLAlchemy models for UNIHAN database'
__version__ = '0.1.0'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/cihai/unihan-db'
__pypi__ = 'https://pypi.org/project/unihan-db/'
__email__ = 'cihai@git-pull.com'
__license__ = 'MIT'
__cop... | Update to cihai software foundation, add github and pypi | Metadata: Update to cihai software foundation, add github and pypi
| Python | mit | cihai/unihan-db |
68fe680266f705bea2b33e614d7aac2ae13b46a2 | url_shortener/forms.py | url_shortener/forms.py | # -*- coding: utf-8 -*-
from flask_wtf import Form
from wtforms import StringField, validators
from .validation import not_spam
class ShortenedUrlForm(Form):
url = StringField(
'Url to be shortened',
[
validators.DataRequired(),
validators.URL(message="A valid url is requi... | # -*- coding: utf-8 -*-
from flask_wtf import Form
from wtforms import StringField, validators
from .validation import not_blacklisted_nor_spam
class ShortenedUrlForm(Form):
url = StringField(
'Url to be shortened',
[
validators.DataRequired(),
validators.URL(message="A va... | Replace not_spam validator with not_blacklisted_nor_spam in form class | Replace not_spam validator with not_blacklisted_nor_spam in form class
| Python | mit | piotr-rusin/url-shortener,piotr-rusin/url-shortener |
1cf354d834fbb81260c88718c57533a546fc9dfa | src/robots/actions/attitudes.py | src/robots/actions/attitudes.py | import logging; logger = logging.getLogger("robot." + __name__)
from robots.exception import RobotError
from robots.actions.look_at import sweep
from robots.action import *
###############################################################################
@action
def sorry(robot, speed = 0.5):
return sweep(robot,... | import logging; logger = logging.getLogger("robot." + __name__)
import random
from robots.exception import RobotError
from robots.lowlevel import *
from robots.actions.look_at import sweep
from robots.action import *
###############################################################################
@action
@workswit... | Update the knowledge base according to the emotion | [actions/attitude] Update the knowledge base according to the emotion
| Python | isc | chili-epfl/pyrobots,chili-epfl/pyrobots-nao |
8c51722bff4460b33a33d0380b75047649119175 | pyhpeimc/__init__.py | pyhpeimc/__init__.py | #!/usr/bin/env python
# -*- coding: <encoding-name> -*-
'''
Copyright 2015 Hewlett Packard Enterprise Development LP
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/... | #!/usr/bin/env python
# -*- coding: ascii -*-
'''
Copyright 2015 Hewlett Packard Enterprise Development LP
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.... | Fix in groups.py for get_custom_views function. | Fix in groups.py for get_custom_views function.
| Python | apache-2.0 | HPNetworking/HP-Intelligent-Management-Center,HPENetworking/PYHPEIMC,netmanchris/PYHPEIMC |
cf03026a27f8f7d35430807d2295bf062c4e0ca9 | master/skia_master_scripts/android_factory.py | master/skia_master_scripts/android_factory.py | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility class to build the Skia master BuildFactory's for Android buildbots.
Overrides SkiaFactory with any Android-specific steps."""
from skia_mas... | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility class to build the Skia master BuildFactory's for Android buildbots.
Overrides SkiaFactory with any Android-specific steps."""
from skia_mas... | Add RunTests step for Android buildbots | Add RunTests step for Android buildbots
Requires https://codereview.appspot.com/5966078 ('Add AddRunCommandList(), a cleaner way of running multiple shell commands as a single buildbot step') to work.
Review URL: https://codereview.appspot.com/5975072
git-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@3594 2bbb7eff... | Python | bsd-3-clause | google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Ti... |
b3a9027940f854f84cbf8f05af79c1f98a56d349 | pretix/settings.py | pretix/settings.py | from pretix.settings import * # noqa
SECRET_KEY = "{{secret_key}}"
LOGGING["handlers"]["mail_admins"]["include_html"] = True # noqa
STATICFILES_STORAGE = (
"django.contrib.staticfiles.storage.ManifestStaticFilesStorage" # noqa
)
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",... | from pretix.settings import * # noqa
SECRET_KEY = "{{secret_key}}"
LOGGING["handlers"]["mail_admins"]["include_html"] = True # noqa
STATICFILES_STORAGE = (
"django.contrib.staticfiles.storage.ManifestStaticFilesStorage" # noqa
)
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",... | Allow all languages on pretix | Allow all languages on pretix
| Python | mit | patrick91/pycon,patrick91/pycon |
639824dfa86b2aa98b1ae2ca3d4a5cec6ca329ea | nbgrader/preprocessors/__init__.py | nbgrader/preprocessors/__init__.py | from .headerfooter import IncludeHeaderFooter
from .lockcells import LockCells
from .clearsolutions import ClearSolutions
from .findstudentid import FindStudentID
from .saveautogrades import SaveAutoGrades
from .displayautogrades import DisplayAutoGrades
from .computechecksums import ComputeChecksums
from .savecells im... | from .headerfooter import IncludeHeaderFooter
from .lockcells import LockCells
from .clearsolutions import ClearSolutions
from .saveautogrades import SaveAutoGrades
from .displayautogrades import DisplayAutoGrades
from .computechecksums import ComputeChecksums
from .savecells import SaveCells
from .overwritecells impor... | Remove FindStudentID from preprocessors init | Remove FindStudentID from preprocessors init
| Python | bsd-3-clause | EdwardJKim/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,ellisonbg/nbgrader,alope107/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,dementrock/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jdfreder/nbgrader,jdfreder/nbgrader,ellisonbg/nbgrader,alope107/nbgrader,jupyter/nbgrader,module... |
83080df101aca13b9b044996a013794c94ab82ed | pronto/parsers/obo.py | pronto/parsers/obo.py | import os
import fastobo
from .base import BaseParser
from ._fastobo import FastoboParser
class OboParser(FastoboParser, BaseParser):
@classmethod
def can_parse(cls, path, buffer):
return buffer.lstrip().startswith((b"format-version:", b"[Term", b"[Typedef"))
def parse_from(self, handle):
... | import os
import fastobo
from .base import BaseParser
from ._fastobo import FastoboParser
class OboParser(FastoboParser, BaseParser):
@classmethod
def can_parse(cls, path, buffer):
return buffer.lstrip().startswith((b"format-version:", b"[Term", b"[Typedef"))
def parse_from(self, handle):
... | Make sure to parse OBO documents in order | Make sure to parse OBO documents in order
| Python | mit | althonos/pronto |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.