commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
4e72db45afe0fc85c7e306eb056f19fca5e72bd4 | Bump to v0.4.0. | memmett/PyWENO,memmett/PyWENO,memmett/PyWENO | version.py | version.py | version = '0.4.0'
release = True
if not release:
version += '.dev'
| version = '0.3'
release = False
if not release:
version += '.a2.dev'
| bsd-3-clause | Python |
4fcd2fdb43ab331be1e15742756a4b142c436ab4 | Add docstring for lzip() | Suor/funcy | funcy/py2.py | funcy/py2.py | import sys
from .calc import *
from .colls import *
from .tree import *
from .decorators import *
from .funcolls import *
from .funcs import *
from .seqs import *
from .types import *
from .strings import *
from .flow import *
from .objects import *
from .debug import *
from .primitives import *
# Setup __all__
modu... | import sys
from .calc import *
from .colls import *
from .tree import *
from .decorators import *
from .funcolls import *
from .funcs import *
from .seqs import *
from .types import *
from .strings import *
from .flow import *
from .objects import *
from .debug import *
from .primitives import *
# Setup __all__
modu... | bsd-3-clause | Python |
739e1b169af8b1abded51eb0cd225d95d33e40f9 | Update runtests.py for compatibility with Django 1.7. | yeago/django-model-utils,nemesisdesign/django-model-utils,timmygee/django-model-utils,patrys/django-model-utils,carljm/django-model-utils,yeago/django-model-utils,timmygee/django-model-utils,carljm/django-model-utils,nemesisdesign/django-model-utils,patrys/django-model-utils | runtests.py | runtests.py | #!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlit... | #!/usr/bin/env python
import os, sys
from django.conf import settings
if not settings.configured:
settings_dict = dict(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
... | bsd-3-clause | Python |
d3a0d7e2cf1685ce6c69d182faa309f228aa84c0 | use fixture to mock application | pkulev/xoinvader,pankshok/xoinvader | xoinvader/tests/conftest.py | xoinvader/tests/conftest.py | """Pytest configuration."""
import pytest
from xoinvader import application
from xoinvader import state
@pytest.fixture
def mock_application(request):
def inner():
return MockedApplication()
request.addfinalizer(MockedApplication._finalize)
return inner
@pytest.fixture
def mock_state(request... | """Pytest configuration."""
import pytest
from xoinvader import application
from xoinvader import state
@pytest.fixture
def mock_application(request):
def inner():
return MockedApplication()
request.addfinalizer(MockedApplication._finalize)
return inner
@pytest.fixture
def mock_state(request... | mit | Python |
cca0355da80a2c136b8bf02eb43d55ff9da8e1ff | change youtube video folder and add log out | eric-huo/youtube_video_crawler | youtube_video_downloader.py | youtube_video_downloader.py | # Eric 2016/11/09
from __future__ import unicode_literals
import youtube_dl
import mysql.connector
conn = mysql.connector.connect(user='taloscar', password='taloscar', database='taloscar', host='10.161.23.57')
cursor = conn.cursor()
def get_to_download_video_urls():
urls_with_ids = query_from_mysql()
for url... | # Eric 2016/11/09
from __future__ import unicode_literals
import youtube_dl
import mysql.connector
conn = mysql.connector.connect(user='taloscar', password='taloscar', database='taloscar', host='10.161.23.57')
cursor = conn.cursor()
def get_to_download_video_urls():
urls_with_ids = query_from_mysql()
for url... | mit | Python |
b3d00273e414913357da8e71decf04df59060281 | return login result | DBuildService/atomic-reactor,projectatomic/atomic-reactor,projectatomic/atomic-reactor,vrutkovs/atomic-reactor,jarodwilson/atomic-reactor,jarodwilson/atomic-reactor,DBuildService/atomic-reactor,jpopelka/atomic-reactor,jpopelka/atomic-reactor,fr34k8/atomic-reactor,maxamillion/atomic-reactor,vrutkovs/atomic-reactor,maxam... | atomic_reactor/koji_util.py | atomic_reactor/koji_util.py | """
Copyright (c) 2016 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import print_function, unicode_literals
import koji
import logging
import os
import time
logger = logging.getLogger(__nam... | """
Copyright (c) 2016 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import print_function, unicode_literals
import koji
import logging
import os
import time
logger = logging.getLogger(__nam... | bsd-3-clause | Python |
56efe455c0f7163704302d7732a1da61fcb76136 | Update kissfft to fix stdint.h issue on Windows | DavidNorman/tensorflow,frreiss/tensorflow-fred,yongtang/tensorflow,arborh/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,xzturn/tensorflow,tensorflow/tensorflow,freedomtan/tensorflow,frreiss/tensorflow-fred,aam-at/tensorflow,adit-ch... | third_party/kissfft/workspace.bzl | third_party/kissfft/workspace.bzl | """Loads the kissfft library, used by TF Lite."""
load("//third_party:repo.bzl", "third_party_http_archive")
def repo():
third_party_http_archive(
name = "kissfft",
strip_prefix = "kissfft-36dbc057604f00aacfc0288ddad57e3b21cfc1b8",
sha256 = "42b7ef406d5aa2d57a7b3b56fc44e8ad3011581692458a69... | """Loads the kissfft library, used by TF Lite."""
load("//third_party:repo.bzl", "third_party_http_archive")
def repo():
third_party_http_archive(
name = "kissfft",
strip_prefix = "kissfft-cddf3833fdf24fa84b79be37efdcd348cae0e39c",
sha256 = "7ba83a3da1636350472e501e3e6c3418df72466990530ea2... | apache-2.0 | Python |
1b1534967c6494d89d76d03c7487f5b02808bb4c | Fix mac build for XCode v6.0 | dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lan... | tools/gyp/find_mac_gcc_version.py | tools/gyp/find_mac_gcc_version.py | #!/usr/bin/env python
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import re
import subprocess
import sys
def main():
job = subprocess.Popen(['xcode... | #!/usr/bin/env python
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import re
import subprocess
import sys
def main():
job = subprocess.Popen(['xcode... | bsd-3-clause | Python |
172768dacc224f3c14e85f8e732209efe9ce075a | Set the default prefix for ProjectSurveys to gsoc_program. | SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange | app/soc/models/project_survey.py | app/soc/models/project_survey.py | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 | Python |
f0b8f05da951cc49eb53809e12e6287fd4ab3436 | Update urls.py | knagra/farnsworth,knagra/farnsworth,knagra/farnsworth,knagra/farnsworth | farnswiki/urls.py | farnswiki/urls.py | """
XXX:
This module is deprecated and marked for replacement.
"""
from django.conf.urls import url, patterns
from django.conf import settings
urlpatterns = patterns(
"farnswiki.views",
)
for binder in settings.WIKI_BINDERS:
urlpatterns += patterns(
"farnswiki.views",
url(binder.root + r"/p... |
from django.conf.urls import url, patterns
from django.conf import settings
urlpatterns = patterns(
"farnswiki.views",
)
for binder in settings.WIKI_BINDERS:
urlpatterns += patterns(
"farnswiki.views",
url(binder.root + r"/page/(?P<slug>[^/]+)/$", "page", {"binder": binder}, name=binder.page... | bsd-2-clause | Python |
be1d4f0f4f0b98e14ce181a1bedd93a293a93400 | Fix test with django2 | mixcloud/django-experiments,mixcloud/django-experiments,mixcloud/django-experiments | experiments/tests/urls.py | experiments/tests/urls.py | from experiments.urls import urlpatterns
from django.conf.urls import url
from django.contrib import admin
urlpatterns += [
url(r'^admin/', admin.site.urls),
]
| from experiments.urls import urlpatterns
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns += [
url(r'^admin/', include(admin.site.urls)),
]
| mit | Python |
c2fd5b8f461f48dc00fb29db538775170d1c7abd | Correct models, allow null dates | alykhank/populate | articles/models.py | articles/models.py | from django.db import models
class Bookmark(models.Model):
user_id = models.PositiveIntegerField(default=0)
read_percent = models.FloatField(default=0.0)
date_updated = models.DateTimeField(null=True)
favorite = models.BooleanField()
bk_id = models.PositiveIntegerField(default=0)
date_archived = models.DateTimeF... | from django.db import models
class Bookmark(models.Model):
user_id = models.PositiveIntegerField(default=0)
read_percent = models.FloatField(default=0.0)
date_updated = models.DateTimeField()
favorite = models.BooleanField()
bookmark_id = models.PositiveIntegerField(default=0)
date_archived = models.DateTimeFiel... | mit | Python |
09d3c9aa557a3d9a144b5a566f75526ceb9bf3b6 | Use the new #left stuff (with help link) in browse as well. | drougge/wwwwellpapp,drougge/wwwwellpapp,drougge/wwwwellpapp | cgi/browse.py | cgi/browse.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import environ, listdir, stat
from sys import exit
from common import *
from os.path import normpath, exists, join as joinpath, isfile, isdir
from hashlib import md5
def forbidden():
global outdata
print "Status: 403 Forbidden"
outdata = []
prt_head()
prt(u'<... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import environ, listdir, stat
from sys import exit
from common import *
from os.path import normpath, exists, join as joinpath, isfile, isdir
from hashlib import md5
def forbidden():
global outdata
print "Status: 403 Forbidden"
outdata = []
prt_head()
prt(u'<... | mit | Python |
d31cbad208ed3b7ac29a5e4957d008f768462ee0 | use correct variable name | proversity-org/edx-app-ios,proversity-org/edx-app-ios,proversity-org/edx-app-ios,proversity-org/edx-app-ios,proversity-org/edx-app-ios,proversity-org/edx-app-ios | fastlane_match.py | fastlane_match.py |
# -*- coding: utf-8 -*-
#!/usr/bin/python
import subprocess
import sys
import requests
def not_in(x):
not_in_filters = ['ProfileUUID', 'development', 'sigh_org']
is_in = False
for not_in_filter in not_in_filters:
is_in = not_in_filter in x
if is_in:
break
return not is_in... |
# -*- coding: utf-8 -*-
#!/usr/bin/python
import subprocess
import sys
import requests
def not_in(x):
not_in_filters = ['ProfileUUID', 'development', 'sigh_org']
is_in = False
for not_in_filter in not_in_filters:
is_in = not_in_filter in x
if is_in:
break
return not is_in... | apache-2.0 | Python |
da484c074400d2d37fa8357babbf747603b10760 | fix for keyError | s-ludwig/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,Jesterovskiy/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,nbrady-... | toolset/setup/linux/setup_util.py | toolset/setup/linux/setup_util.py | import re
import os
import sys
import subprocess
import platform
from threading import Thread
from Queue import Queue, Empty
class NonBlockingStreamReader:
'''
Enables calling readline in a non-blocking manner with a blocking stream,
such as the ones returned from subprocess.Popen
Originally written by Eyal... | import re
import os
import sys
import subprocess
import platform
from threading import Thread
from Queue import Queue, Empty
class NonBlockingStreamReader:
'''
Enables calling readline in a non-blocking manner with a blocking stream,
such as the ones returned from subprocess.Popen
Originally written by Eyal... | bsd-3-clause | Python |
7f2ed7a8f8d8599d945cbf00cd614bdcbda96e6d | Change rpc default to false for dump command in client | ooici/eeagent | eeagent/client.py | eeagent/client.py | import logging
import socket
from threading import Thread
import simplejson as json
from dashi.bootstrap import dashi_connect
import uuid
from eeagent.types import EEAgentLaunchType
class EEAgentClient(object):
def __init__(self, incoming=None, CFG=None, dashi=None, ee_name=None,
pd_name=None, handle... | import logging
import socket
from threading import Thread
import simplejson as json
from dashi.bootstrap import dashi_connect
import uuid
from eeagent.types import EEAgentLaunchType
class EEAgentClient(object):
def __init__(self, incoming=None, CFG=None, dashi=None, ee_name=None,
pd_name=None, handle... | apache-2.0 | Python |
b8934c8854ebac38adaad2487b2b5549ad50fea7 | add pop and snp options to eigenstrat2vcf.py | mathii/gdc | eigenstrat2vcf.py | eigenstrat2vcf.py | #eigenstrat (packed or unpacked) to vcf
#Writes to stdout, unlike many of these scripts.
#Usage: python eigenstrat2vcf.py -r root [options]
#Data files are root.snp, root.ind and root.geno
from __future__ import division, print_function
import argparse, gdc, pyEigenstrat
#Remember, in eigenstrat, 2 means "2 ref cop... | #eigenstrat (packed or unpacked) to vcf
#Writes to stdout, unlike many of these scripts.
#Usage: python eigenstrat2vcf.py -i root
#Data files are root.snp, root.ind and root.geno
from __future__ import division, print_function
import argparse, gdc, pyEigenstrat
#Remember, in eigenstrat, 2 means "2 ref copies"
GT_DI... | apache-2.0 | Python |
48e15b8f99bb0714b7ec465a0131e452c67004e5 | Fix index to list when there is no 2nd element | chengwliu/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers,ultinomics/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers,Fillll/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers,ifduyue/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers,jrmontag/Probabilistic-Programming-and-Bayesian-... | Chapter4_TheGreatestTheoremNeverTold/top_pic_comments.py | Chapter4_TheGreatestTheoremNeverTold/top_pic_comments.py | import sys
import numpy as np
from IPython.core.display import Image
import praw
reddit = praw.Reddit("BayesianMethodsForHackers")
subreddit = reddit.get_subreddit( "pics" )
top_submissions = subreddit.get_top()
n_pic = int( sys.argv[1] ) if len(sys.argv) > 1 else 1
i = 0
while i < n_pic:
top_submission = ... | import sys
import numpy as np
from IPython.core.display import Image
import praw
reddit = praw.Reddit("BayesianMethodsForHackers")
subreddit = reddit.get_subreddit( "pics" )
top_submissions = subreddit.get_top()
n_pic = int( sys.argv[1] ) if sys.argv[1] else 1
i = 0
while i < n_pic:
top_submission = top_su... | mit | Python |
61b363de6ac007f8109e6dd7dc960d9dda4b226e | Bump version to 0.9pbs.47 | pbs/django-filer,pbs/django-filer,pbs/django-filer,pbs/django-filer,pbs/django-filer | filer/__init__.py | filer/__init__.py | #-*- coding: utf-8 -*-
# version string following pep-0396 and pep-0386
__version__ = '0.9pbs.47' # pragma: nocover
| #-*- coding: utf-8 -*-
# version string following pep-0396 and pep-0386
__version__ = '0.9pbs.46' # pragma: nocover
| bsd-3-clause | Python |
8b8fa041d293cd092783f4b3f1870859f8f3ac25 | Bump develop to 1.1.1.post1 | divio/django-filer,jakob-o/django-filer,DylannCordel/django-filer,jakob-o/django-filer,stefanfoulis/django-filer,webu/django-filer,webu/django-filer,skirsdeda/django-filer,skirsdeda/django-filer,stefanfoulis/django-filer,DylannCordel/django-filer,jakob-o/django-filer,divio/django-filer,stefanfoulis/django-filer,webu/dj... | filer/__init__.py | filer/__init__.py | # -*- coding: utf-8 -*-
# version string following pep-0396 and pep-0386
__version__ = '1.1.1.post1' # pragma: nocover
default_app_config = 'filer.apps.FilerConfig'
| # -*- coding: utf-8 -*-
# version string following pep-0396 and pep-0386
__version__ = '1.1.1' # pragma: nocover
default_app_config = 'filer.apps.FilerConfig'
| bsd-3-clause | Python |
a7abc13bd41e5c0a0aa80370d1f2ffdc28b11f36 | Update version.py | ambitioninc/django-entity,wesleykendall/django-entity,robdmc/django-entity,wesokes/django-entity,Wilduck/django-entity | entity/version.py | entity/version.py | __version__ = '1.8.0'
| __version__ = '1.7.5'
| mit | Python |
f31389fc6dcec7ba9c2d619729d8168ac3919439 | update included SMS | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/accounting/bootstrap/config/user_buckets_jan_2017.py | corehq/apps/accounting/bootstrap/config/user_buckets_jan_2017.py | from decimal import Decimal
from corehq.apps.accounting.models import (
FeatureType,
SoftwarePlanEdition,
)
BOOTSTRAP_CONFIG = {
(SoftwarePlanEdition.COMMUNITY, False): {
'role': 'community_plan_v1',
'product_rate': dict(),
'feature_rates': {
FeatureType.USER: dict(mont... | from decimal import Decimal
from corehq.apps.accounting.models import (
FeatureType,
SoftwarePlanEdition,
)
BOOTSTRAP_CONFIG = {
(SoftwarePlanEdition.COMMUNITY, False): {
'role': 'community_plan_v1',
'product_rate': dict(),
'feature_rates': {
FeatureType.USER: dict(mont... | bsd-3-clause | Python |
30fb19ed837e063ac28a0afb0104a93accb511c7 | Move location data to line start | Suor/flaws | flaws/__init__.py | flaws/__init__.py | #!/usr/bin/env python
import sys
import ast
from funcy import all
import astor
from .asttools import is_write, is_use, is_constant, name_class, node_str, to_source
from .scopes import TreeLinker, ScopeBuilder
from .infer import Inferer
def slurp(filename):
with open(filename) as f:
return f.read()
def... | #!/usr/bin/env python
import sys
import ast
from funcy import all
import astor
from .asttools import is_write, is_use, is_constant, name_class, node_str, to_source
from .scopes import TreeLinker, ScopeBuilder
from .infer import Inferer
def slurp(filename):
with open(filename) as f:
return f.read()
def... | bsd-2-clause | Python |
86bff7d5b1d8f25a5160c0ae4705096e391e435f | add a fuzzy option to giant bit | dit/dit,dit/dit,Autoplectic/dit,dit/dit,Autoplectic/dit,dit/dit,Autoplectic/dit,dit/dit,Autoplectic/dit,Autoplectic/dit | dit/example_dists/giant_bit.py | dit/example_dists/giant_bit.py | """
Giant bit type distributions.
"""
from __future__ import division
from itertools import product
from .. import Distribution
from ..distconst import uniform
def giant_bit(n, k, fuzzy=False):
"""
Return a 'giant bit' distribution of size `n` and alphabet size `k`.
Parameters
----------
n : int... | """
Giant bit type distributions.
"""
from ..distconst import uniform
def giant_bit(n, k):
"""
Return a 'giant bit' distribution of size `n` and alphabet size `k`.
Parameters
----------
n : int
The number of identical bits.
k : int
The number of states for each bit.
Retur... | bsd-3-clause | Python |
afd27c62049e87eaefbfb5f38c6b61b461656384 | Add hash and eq methods to Token | bambinos/formulae | formulae/token.py | formulae/token.py | class Token:
"""Representation of a single Token"""
def __init__(self, _type, lexeme, literal=None):
self.type = _type
self.lexeme = lexeme
self.literal = literal
def __hash__(self):
return hash((self.type, self.lexeme, self.literal))
def __eq__(self, other):
i... | class Token:
"""Representation of a single Token"""
def __init__(self, _type, lexeme, literal=None):
self.type = _type
self.lexeme = lexeme
self.literal = literal
def __repr__(self):
string_list = [
"'type': " + str(self.type),
"'lexeme': " + str(sel... | mit | Python |
d5466fc0b1520ccf8a2dcd1f7b5bd8c6471e3343 | Fix object as a variable name shadows internal python object, so we don't use object as a variable name | HelloLily/hellolily,HelloLily/hellolily,HelloLily/hellolily,HelloLily/hellolily | lily/tags/forms.py | lily/tags/forms.py | from django import forms
from django.contrib.contenttypes.models import ContentType
from django.db.models.query_utils import Q
from lily.tags.models import Tag
from lily.utils.fields import MultipleInputAndChoiceField
from lily.utils.widgets import InputAndSelectMultiple
class TagsFormMixin(forms.ModelForm)... | from django import forms
from django.contrib.contenttypes.models import ContentType
from django.db.models.query_utils import Q
from lily.tags.models import Tag
from lily.utils.fields import MultipleInputAndChoiceField
from lily.utils.widgets import InputAndSelectMultiple
class TagsFormMixin(forms.ModelForm)... | agpl-3.0 | Python |
6514e7ab874fe18f7587aecea8ad35c1767eb7db | Add pep8 fixes | lbragstad/keystone-performance,lbragstad/keystone-performance,lbragstad/keystone-performance | listener/listen.py | listener/listen.py | import argparse
import json
import time
from pygerrit import client
from pygerrit import events
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Process event stream from Gerrit.')
parser.add_argument('-u', '--username', dest='username',
help='username... | import argparse
import json
import time
from pygerrit import client
from pygerrit import events
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Process event stream from Gerrit.')
parser.add_argument('-u', '--username', dest='username',
help='username... | apache-2.0 | Python |
949eca8726c5c221f8e83e2c31ed1156d920915e | fix tables with indices starting with 1 | NightNord/ljd,jjdredd/ljd,mrexodia/ljd | ljd/ast/helpers.py | ljd/ast/helpers.py | import ljd.ast.nodes as nodes
def insert_table_record(constructor, key, value):
array = constructor.array.contents
records = constructor.records.contents
if isinstance(key, nodes.MULTRES):
assert len(records) == 0 \
or isinstance(records[-1], nodes.TableRecord)
records.append(value)
return
while isins... | import ljd.ast.nodes as nodes
def insert_table_record(constructor, key, value):
array = constructor.array.contents
records = constructor.records.contents
if isinstance(key, nodes.MULTRES):
assert len(records) == 0 \
or isinstance(records[-1], nodes.TableRecord)
records.append(value)
return
while isins... | mit | Python |
1f6811843b4e5b7d4afb2af84805f2d8dbeac639 | fix pool | fr0der1c/EveryClass-server,fr0der1c/EveryClass-server,fr0der1c/EveryClass-server,fr0der1c/EveryClass-server | everyclass/server/db/postgres.py | everyclass/server/db/postgres.py | from contextlib import contextmanager
import psycopg2
from DBUtils.PooledDB import PooledDB
from flask import current_app, has_app_context
from psycopg2.extras import register_hstore, register_uuid
from everyclass.server.config import get_config
_config = get_config()
_options = f'-c search_path={_config.POSTGRES_SC... | from contextlib import contextmanager
import psycopg2
from DBUtils.PooledDB import PooledDB
from flask import current_app, has_app_context
from psycopg2.extras import register_hstore, register_uuid
from everyclass.server.config import get_config
_config = get_config()
_options = f'-c search_path={_config.POSTGRES_SC... | mpl-2.0 | Python |
1c1acbf252406d366089e9296643ae674342e43a | bump version | google/evojax | evojax/version.py | evojax/version.py | __version__ = "0.2.14"
| __version__ = "0.2.13"
| apache-2.0 | Python |
dc162d6d99b645af5d2b9aca7eae7f3b4080bfde | Update mergeSort.py | xala3pa/my-way-to-algorithms,xala3pa/my-way-to-algorithms | mergeSort/python/mergeSort.py | mergeSort/python/mergeSort.py | ######################################################
# #
# Sort algorithms - MergeSort #
# #
######################################################
import operator
def merge_sort(lst, compare = operator.lt):
if len(lst) < 2:
return lst[:]
middle = len(lst)/2
left = me... | ######################################################
# #
# Sort algorithms - MergeSort #
# #
######################################################
import operator
def merge_sort(lst, compare = operator.lt):
if len(lst) < 2:
return lst[:]
middle = len(lst)/2
lef... | mit | Python |
76878dbbeeb6fcff9b8d8c9b2798ee9df21923c9 | add version 0.8-81 to r-foreign (#20975) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/r-foreign/package.py | var/spack/repos/builtin/packages/r-foreign/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RForeign(RPackage):
"""Read Data Stored by 'Minitab', 'S', 'SAS', 'SPSS', 'Stata', 'Systat... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RForeign(RPackage):
"""Functions for reading and writing data stored by some versions of E... | lgpl-2.1 | Python |
6c0ea77d1d5e349329ad36aecaadff13c0ccf6c4 | Add list_url for older versions. | matthiasdiener/spack,LLNL/spack,TheTimmy/spack,iulian787/spack,tmerrick1/spack,EmreAtes/spack,iulian787/spack,mfherbst/spack,EmreAtes/spack,LLNL/spack,lgarren/spack,iulian787/spack,skosukhin/spack,iulian787/spack,lgarren/spack,lgarren/spack,matthiasdiener/spack,mfherbst/spack,LLNL/spack,matthiasdiener/spack,tmerrick1/s... | var/spack/repos/builtin/packages/r-packrat/package.py | var/spack/repos/builtin/packages/r-packrat/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
d54bf5feb2ef832993ed4f5f75d073a531c357ea | Adjust title in module admin page | pvital/patchew,pvital/patchew,pvital/patchew,pvital/patchew | api/admin.py | api/admin.py | from django.contrib import admin
from .models import *
from mod import get_module
from django.contrib.auth.models import User, Group
class MessagePropertyInline(admin.TabularInline):
model = MessageProperty
extra = 0
class MessageAdmin(admin.ModelAdmin):
inlines = [
MessagePropertyInline
... | from django.contrib import admin
from .models import *
from mod import get_module
from django.contrib.auth.models import User, Group
class MessagePropertyInline(admin.TabularInline):
model = MessageProperty
extra = 0
class MessageAdmin(admin.ModelAdmin):
inlines = [
MessagePropertyInline
... | mit | Python |
44aa2bb7924c3d18e576f165c79c6422ffedfc9a | allow listing of images not assigned to content | stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten | api/views.py | api/views.py | from . import serializers
from content import models as content_models
from rest_framework import viewsets, mixins
from django.db.models import Q
class ImageSet(mixins.CreateModelMixin, mixins.UpdateModelMixin, viewsets.ReadOnlyModelViewSet):
serializer_class = serializers.Image
filter_fields = ('content', 'c... | from . import serializers
from content import models as content_models
from rest_framework import viewsets, mixins
from django.db.models import Q
class ImageSet(mixins.CreateModelMixin, mixins.UpdateModelMixin, viewsets.ReadOnlyModelViewSet):
serializer_class = serializers.Image
filter_fields = ('content', 'c... | agpl-3.0 | Python |
75a28cc836c7eed2017ff0b2fab0392def3e0ce2 | fix InvalidCryptoBackendError trigering a TypeError thanks dz fixes #13 | lann/python-beaker | beaker/exceptions.py | beaker/exceptions.py | """Beaker exception classes"""
class BeakerException(Exception):
pass
class CreationAbortedError(Exception):
"""Deprecated."""
class InvalidCacheBackendError(BeakerException, ImportError):
pass
class MissingCacheParameter(BeakerException):
pass
class LockError(BeakerException):
pass
class... | """Beaker exception classes"""
class BeakerException(Exception):
pass
class CreationAbortedError(Exception):
"""deprecated."""
class InvalidCacheBackendError(BeakerException, ImportError):
pass
class MissingCacheParameter(BeakerException):
pass
class LockError(BeakerException):
pass
class I... | bsd-3-clause | Python |
034bbf1f3a3f3155583cc44d55be282ac6612746 | Index http transport | napalm-automation/napalm-logs,napalm-automation/napalm-logs | napalm_logs/transport/__init__.py | napalm_logs/transport/__init__.py | # -*- coding: utf-8 -*-
'''
napalm-logs pluggable publisher.
'''
from __future__ import absolute_import
from __future__ import unicode_literals
# Import python std lib
import logging
# Import napalm-logs pkgs
# Exceptions
from napalm_logs.exceptions import InvalidTransportException
# Transport classes
from napalm_log... | # -*- coding: utf-8 -*-
'''
napalm-logs pluggable publisher.
'''
from __future__ import absolute_import
from __future__ import unicode_literals
# Import python std lib
import logging
# Import napalm-logs pkgs
# Exceptions
from napalm_logs.exceptions import InvalidTransportException
# Transport classes
from napalm_log... | apache-2.0 | Python |
d012763c57450555d45385ed9b254f500388618e | Use the same normlization for whole gif | stevearm/automata | automata/render.py | automata/render.py | import matplotlib
matplotlib.use('Agg')
import matplotlib.colors
import matplotlib.pyplot as plt
import matplotlib.animation as animation
class AnimatedGif:
""" Setup various rendering things
"""
def __init__(self, dpi=100, colors="Purples"):
self.frames = []
self.fig = plt.figure(dpi=dpi... | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.animation as animation
class AnimatedGif:
""" Setup various rendering things
"""
def __init__(self, dpi=100, colors="Purples"):
self.frames = []
self.fig = plt.figure(dpi=dpi)
plt.axis("off")... | apache-2.0 | Python |
5fdb39f158fea385c25cae93e47fc91683222724 | Fix person_by_id call. | fedora-infra/python-fedora | fedora/django/__init__.py | fedora/django/__init__.py | # -*- coding: utf-8 -*-
#
# Copyright © 2009 Ignacio Vazquez-Abrams All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope tha... | # -*- coding: utf-8 -*-
#
# Copyright © 2009 Ignacio Vazquez-Abrams All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope tha... | lgpl-2.1 | Python |
174d037435f8f2f86778099472eb77c9899308e8 | add author to image admin | DylannCordel/django-filer,jakob-o/django-filer,skirsdeda/django-filer,mkoistinen/django-filer,lory87/django-filer,stefanfoulis/django-filer,o-zander/django-filer,mkoistinen/django-filer,nimbis/django-filer,nephila/django-filer,DylannCordel/django-filer,kriwil/django-filer,lory87/django-filer,lory87/django-filer,nephila... | filer/admin/imageadmin.py | filer/admin/imageadmin.py | #-*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext as _
from filer import settings as filer_settings
from filer.admin.fileadmin import FileAdmin
from filer.models import Image
class ImageAdminForm(forms.ModelForm):
subject_location = forms.CharField(
max_length=6... | #-*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext as _
from filer import settings as filer_settings
from filer.admin.fileadmin import FileAdmin
from filer.models import Image
class ImageAdminForm(forms.ModelForm):
subject_location = forms.CharField(
max_length=6... | bsd-3-clause | Python |
1d4d6862429d472ae4269004d1e6fe57aa428cc1 | Bump to version 0.15.2 | nerevu/prometheus-api,nerevu/prometheus-api,nerevu/prometheus-api | app/setup.py | app/setup.py | try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
with open('../requirements.txt') as file:
requirements = file.read()
config = {
'name': 'prometheus',
'description': 'a global asset allocation tool',
'long_description': open('README.rst', 'rt... | try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
with open('../requirements.txt') as file:
requirements = file.read()
config = {
'name': 'prometheus',
'description': 'a global asset allocation tool',
'long_description': open('README.rst', 'rt... | mit | Python |
eb31c9db7e2bf083b42141e6149fc65fd26ebf17 | Use Flask 0.11.1 | macbre/wbc.macbre.net,macbre/wbc.macbre.net,macbre/wbc.macbre.net,macbre/wbc.macbre.net | app/setup.py | app/setup.py | from setuptools import setup, find_packages
# @see https://github.com/pypa/sampleproject/blob/master/setup.py
setup(
name='wbc',
version='0.0.0',
author='Maciej Brencz',
author_email='maciej.brencz@gmail.com',
description='Flask app providing WBC archives API',
url='https://github.com/macbre/wb... | from setuptools import setup, find_packages
# @see https://github.com/pypa/sampleproject/blob/master/setup.py
setup(
name='wbc',
version='0.0.0',
author='Maciej Brencz',
author_email='maciej.brencz@gmail.com',
description='Flask app providing WBC archives API',
url='https://github.com/macbre/wb... | mit | Python |
8536e100fd734d7293f559c890a73b527f5ab03c | fix typo | louridas/djbr,louridas/djbr | manage.py | manage.py | #!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_site.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure tha... | #!/usr/bin/env python333
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_site.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure t... | bsd-2-clause | Python |
30275d0677414220409e5d9fc1c9b5a8e1138955 | update info to db | hack4impact/clean-air-council,hack4impact/clean-air-council,hack4impact/clean-air-council | app/utils.py | app/utils.py | from flask import url_for
from app.models import IdlingIncident
def register_template_utils(app):
"""Register Jinja 2 helpers (called from __init__.py)."""
@app.template_test()
def equalto(value, other):
return value == other
@app.template_global()
def is_hidden_field(field):
fro... | from flask import url_for
from app.models import IdlingIncident
def register_template_utils(app):
"""Register Jinja 2 helpers (called from __init__.py)."""
@app.template_test()
def equalto(value, other):
return value == other
@app.template_global()
def is_hidden_field(field):
fro... | mit | Python |
005ebdf83d2ad23d6dc7c3326da4ad72f101f8db | test debug=true on new project tree | if1live/importd-boilerplate,if1live/importd-boilerplate | manage.py | manage.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from importd import d
import os
import sys
def get_sentry_apps():
if 'SENTRY_DSN' in os.environ:
return ('raven.contrib.django.raven_compat',)
else:
return ()
if 'gunicorn' in sys.argv[0]:
DEBUG = False
else:
DEBUG = True
DEBUG=True
d(
... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from importd import d
import os
import sys
def get_sentry_apps():
if 'SENTRY_DSN' in os.environ:
return ('raven.contrib.django.raven_compat',)
else:
return ()
if 'gunicorn' in sys.argv[0]:
DEBUG = False
else:
DEBUG = True
d(
DEBUG=DEBUG... | mit | Python |
ce7c31f3dd97716051b72951c7c745dd2c63efcd | Include timestamp in audit logs | RafaelPalomar/girder,data-exp-lab/girder,RafaelPalomar/girder,data-exp-lab/girder,girder/girder,kotfic/girder,RafaelPalomar/girder,Kitware/girder,manthey/girder,jbeezley/girder,manthey/girder,girder/girder,data-exp-lab/girder,kotfic/girder,RafaelPalomar/girder,Kitware/girder,Kitware/girder,data-exp-lab/girder,kotfic/gi... | plugins/audit_logs/server/__init__.py | plugins/audit_logs/server/__init__.py | import cherrypy
import datetime
import logging
from girder import auditLogger
from girder.models.model_base import Model
from girder.api.rest import getCurrentUser
class Record(Model):
def initialize(self):
self.name = 'audit_log_record'
def validate(self, doc):
return doc
class AuditLogHan... | import cherrypy
import logging
from girder import auditLogger
from girder.models.model_base import Model
from girder.api.rest import getCurrentUser
class Record(Model):
def initialize(self):
self.name = 'audit_log_record'
def validate(self, doc):
return doc
class AuditLogHandler(logging.Han... | apache-2.0 | Python |
fc4d76fc60cbb929665449b461bb99fcc470acd2 | Remove second create_admin function | dylanshine/streamschool,dylanshine/streamschool | manage.py | manage.py | import datetime
from project import app, db
from project import models
from project.models import User
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
@manager.command
def create_d... | import datetime
from project import app, db
from project import models
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
@manager.command
def create_db():
"""Creates the db table... | mit | Python |
f334a9c008eb7fada006ea1a2471c3ba97cfafb3 | fix python2 syntax | lanpa/tensorboardX,lanpa/tensorboardX | tensorboardX/graph.py | tensorboardX/graph.py | from .src.graph_pb2 import GraphDef
from .src.node_def_pb2 import NodeDef
from .src.versions_pb2 import VersionDef
from .src.attr_value_pb2 import AttrValue
from .src.tensor_shape_pb2 import TensorShapeProto
import torch
def replace(name, scope):
print(type(name), name)
return '/'.join([scope[name], name])
... | from .src.graph_pb2 import GraphDef
from .src.node_def_pb2 import NodeDef
from .src.versions_pb2 import VersionDef
from .src.attr_value_pb2 import AttrValue
from .src.tensor_shape_pb2 import TensorShapeProto
import torch
def replace(name, scope):
print(type(name), name)
return '/'.join([scope[name], name])
... | mit | Python |
3453b7961fae365f833199c88c7395428fcdf788 | Set default max threads for multithreading to 3 | TensorPy/TensorPy,TensorPy/TensorPy | tensorpy/constants.py | tensorpy/constants.py | """ Defining constants for tensorpy use """
DOWNLOADS_FOLDER = "downloads_folder" # Folder created for downloaded files
MIN_W_H = 50 # Minimum width/height for classifying images on a page
MAX_THREADS = 3 # Total threads to spin up for classifying images on a page
MAX_IMAGES_PER_PAGE = 15 # Limit of image classifi... | """ Defining constants for tensorpy use """
DOWNLOADS_FOLDER = "downloads_folder" # Folder created for downloaded files
MIN_W_H = 50 # Minimum width/height for classifying images on a page
MAX_THREADS = 4 # Total threads to spin up for classifying images on a page
MAX_IMAGES_PER_PAGE = 15 # Limit of image classifi... | mit | Python |
749f5159eb14be492dc76624f03c3a3c863b4582 | add comment matching to sb regex | kirichoi/tellurium,kirichoi/tellurium,sys-bio/tellurium,sys-bio/tellurium | tellurium/teconverters/antimony_regex.py | tellurium/teconverters/antimony_regex.py | from __future__ import print_function, division, absolute_import
def getModelStartRegex():
""" Return the regex string for Antimony model start. Matches whole line. """
return r'^\s*\*?\s*model\s*[^()\s]+\s*(\([^)]*\))?\s*(//.*)?$'
def getFunctionStartRegex():
""" Return the regex string for Antimony mode... | from __future__ import print_function, division, absolute_import
def getModelStartRegex():
""" Return the regex string for Antimony model start. Matches whole line. """
return r'^\s*\*?\s*model\s*[^()\s]+\s*(\([^)]*\))?\s*$'
def getFunctionStartRegex():
""" Return the regex string for Antimony model start... | apache-2.0 | Python |
12afaf5e52d640379dd26e659ed20b488803a3aa | Bump version | impactlab/oeem-energy-datastore,impactlab/oeem-energy-datastore,impactlab/oeem-energy-datastore | oeem_energy_datastore/__init__.py | oeem_energy_datastore/__init__.py | from __future__ import absolute_import
from .celery import app as celery_app
__title__ = 'Open Energy Efficiency Meter Datastore'
__version__ = '0.1.2'
__author__ = 'Phil Ngo'
__license__ = 'MIT'
__copyright__ = 'Copyright 2011-2016 Open Energy Efficiency'
# Version synonym
VERSION = __version__
| from __future__ import absolute_import
from .celery import app as celery_app
__title__ = 'Open Energy Efficiency Meter Datastore'
__version__ = '0.1.1'
__author__ = 'Phil Ngo'
__license__ = 'MIT'
__copyright__ = 'Copyright 2011-2016 Open Energy Efficiency'
# Version synonym
VERSION = __version__
| mit | Python |
b2069b2b4a07d82cc6831dde0e396d7dae79d23e | Set an initial size and disallow resizing | fkmclane/AutoPidact | autopidact/view.py | autopidact/view.py | from gi.repository import Gtk, GdkPixbuf, GLib
import cv2
class View(Gtk.Window):
def __init__(self, title, camera, interval=200):
Gtk.Window.__init__(self)
self.set_title(title)
self.set_size_request(640, 480)
self.set_resizable(False)
self.cam = camera
self.img = Gtk.Image()
self.add(self.img)
GLib.... | from gi.repository import Gtk, GdkPixbuf, GLib
import cv2
class View(Gtk.Window):
def __init__(self, title, camera, interval=200):
Gtk.Window.__init__(self)
self.set_title(title)
self.cam = camera
self.img = Gtk.Image()
self.add(self.img)
GLib.timeout_add(interval, self.update)
def update(self):
if se... | mit | Python |
c259d806eaff2a3c806192ea522e970408613cce | Update B.py | Pouf/CodingCompetition,Pouf/CodingCompetition | Google-Code-Jam/2016-1B/B.py | Google-Code-Jam/2016-1B/B.py | import os
import sys
script = __file__
script_path = os.path.dirname(script)
script_file = os.path.basename(script)[0]
files = [f for f in os.listdir(script_path) if script_file in f and '.in' in f]
if '{}-large'.format(script_file) in str(files):
size = 'large'
elif '{}-small'.format(script_file) in st... | import os
import sys
script = __file__
scriptPath = os.path.dirname(script)
scriptFile = os.path.basename(script)[0]
files = [f for f in os.listdir(scriptPath) if scriptFile in f and '.in' in f]
if '{}-large'.format(scriptFile) in str(files):
size = 'large'
elif '{}-small'.format(scriptFile) in str(files)... | mit | Python |
79a88b1866227542731ff555925557fb22a900d4 | bump version to 0.2.10 | dcoker/awsmfa,dcoker/awsmfa | awsmfa/_version.py | awsmfa/_version.py | """0.2.10"""
VERSION = __doc__
| """0.2.9"""
VERSION = __doc__
| apache-2.0 | Python |
499ff491a6f2d6448ff8b5238c1182cdadea2876 | Fix logging | alphagov/performanceplatform-collector,gds-attic/backdrop-collector,alphagov/performanceplatform-collector,gds-attic/backdrop-collector,alphagov/performanceplatform-collector | backdrop/collector/write.py | backdrop/collector/write.py | import datetime
import logging
import pytz
import requests
import json
class JsonEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
if obj.tzinfo is None:
obj = obj.replace(tzinfo=pytz.UTC)
return obj.isoformat()
return... | import datetime
import logging
import pytz
import requests
import json
class JsonEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
if obj.tzinfo is None:
obj = obj.replace(tzinfo=pytz.UTC)
return obj.isoformat()
return... | mit | Python |
63a0e47e27c33027e0ba02b2a553853c12790321 | Add the key parameter when getting entries | yeasy/CSIT_Test | base/modules/arp_handler.py | base/modules/arp_handler.py | """
CSIT test tools.
Authors: Baohua Yang@IBM, Denghui Huang@IBM
Updated: 2013-11-01
"""
import sys
sys.path.append('..')
from restlib import *
from testmodule import TestModule
sys.path.remove('..')
class ArpHandler(TestModule):
"""
Test for the arp handler.
Start 2-layer tree topology network. e.g., ... | """
CSIT test tools.
Authors: Baohua Yang@IBM, Denghui Huang@IBM
Updated: 2013-11-01
"""
import sys
sys.path.append('..')
from restlib import *
from testmodule import TestModule
sys.path.remove('..')
class ArpHandler(TestModule):
"""
Test for the arp handler.
Start 2-layer tree topology network. e.g., ... | epl-1.0 | Python |
fb01aa54032b7ab73dcd5a3e73d4ece5f36517e2 | Add comment to explain pagination handling | praekelt/familyconnect-registration,praekelt/familyconnect-registration | locations/tasks.py | locations/tasks.py | from future.standard_library import install_aliases
install_aliases() # noqa
from urllib.parse import urlparse
from celery.task import Task
from django.conf import settings
from seed_services_client import IdentityStoreApiClient
from .models import Parish
class SyncLocations(Task):
"""
Has a look at all th... | from future.standard_library import install_aliases
install_aliases() # noqa
from urllib.parse import urlparse
from celery.task import Task
from django.conf import settings
from seed_services_client import IdentityStoreApiClient
from .models import Parish
class SyncLocations(Task):
"""
Has a look at all th... | bsd-3-clause | Python |
a9c8741e07e2eadfd0cdebcb51922e15209c740c | add LoadTestShape to __all__ in order to fix warning "'LoadTestShape' is not declared in __all__" raised by pycharm code->inspect | locustio/locust,mbeacom/locust,locustio/locust,mbeacom/locust,locustio/locust,mbeacom/locust,locustio/locust,mbeacom/locust | locust/__init__.py | locust/__init__.py | from gevent import monkey
monkey.patch_all()
from .user.sequential_taskset import SequentialTaskSet
from .user import wait_time
from .user.task import task, tag, TaskSet
from .user.users import HttpUser, User
from .user.wait_time import between, constant, constant_pacing
from .shape import LoadTestShape
from .event ... | from gevent import monkey
monkey.patch_all()
from .user.sequential_taskset import SequentialTaskSet
from .user import wait_time
from .user.task import task, tag, TaskSet
from .user.users import HttpUser, User
from .user.wait_time import between, constant, constant_pacing
from .shape import LoadTestShape
from .event ... | mit | Python |
c8fbf939d3a2d3d11eb54fc3b89eef1b546551a8 | add new program urls | OKThess/website,OKThess/website,OKThess/website | main/urls.py | main/urls.py | from django.conf.urls import url
from django.contrib import admin
from . import views
app_name = 'main'
admin.site.site_header = 'OK!Thess administration'
urlpatterns = [
# /
url(r'^$', views.get_index, name='index'),
# /about/
url(r'^about/$', views.get_about, name='about'),
# /program/
ur... | from django.conf.urls import url
from django.contrib import admin
from . import views
app_name = 'main'
admin.site.site_header = 'OK!Thess administration'
urlpatterns = [
# /
url(r'^$', views.get_index, name='index'),
# /about/
url(r'^about/$', views.get_about, name='about'),
# /program/
ur... | mit | Python |
89206879c447613d1c780de0be089b00eb187ed3 | Remove debugging code inadvertently left in place | arista-eosplus/ansible-eos-acl,arista-eosplus/ansible-eos-acl | filter_plugins/netaddr.py | filter_plugins/netaddr.py | # Copyright (c) 2017, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditio... | # Copyright (c) 2017, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditio... | bsd-3-clause | Python |
6c3c03b4f9f1cd0f3fd23ebaddc007b162fdb1c2 | Update P2_phoneAndEmail.py changed pyperclip import to ATBS Ch8 | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | pythontutorials/books/AutomateTheBoringStuff/Ch07/P2_phoneAndEmail.py | pythontutorials/books/AutomateTheBoringStuff/Ch07/P2_phoneAndEmail.py | #! python3
"""Phone and email
Finds phone numbers and email addresses in the clipboard using :py:mod:`re` and
:py:mod:`pythontutorials.books.CrackingCodesWithPython.pyperclip`.
Attributes:
phoneRegex (re.compile): Regular expression object representing a phone number pattern.
emailRegex (re.compile): Regular ... | #! python3
"""Phone and email
Finds phone numbers and email addresses in the clipboard using :py:mod:`re` and
:py:mod:`pythontutorials.books.CrackingCodesWithPython.pyperclip`.
Attributes:
phoneRegex (re.compile): Regular expression object representing a phone number pattern.
emailRegex (re.compile): Regular ... | mit | Python |
5123cf157375da497397a3a411edf0a2e0aaa161 | remove unused import statement | istb-mia/miapy | miapy/data/indexexpression.py | miapy/data/indexexpression.py | import typing as t
# could maybe be replaced or wrapper with numpy.s_
class IndexExpression:
def __init__(self, indexing: t.Union[int, tuple, t.List[int], t.List[tuple]]=None,
axis: t.Union[int, tuple]=None) -> None:
self.expression = None
self.set_indexing(indexing, axis)
d... | import typing as t
import pickle
# could maybe be replaced or wrapper with numpy.s_
class IndexExpression:
def __init__(self, indexing: t.Union[int, tuple, t.List[int], t.List[tuple]]=None,
axis: t.Union[int, tuple]=None) -> None:
self.expression = None
self.set_indexing(indexing... | apache-2.0 | Python |
e0665dd33ee3953e1e20a9115c86210e5b6fcd32 | Update __init__.py | PaesslerAG/PythonMiniProbe,PaesslerAG/PythonMiniProbe | miniprobe/sensors/__init__.py | miniprobe/sensors/__init__.py | __all__ = ['Ping', 'HTTP', 'Port', 'SNMPCustom', 'CPULoad', 'Memory', 'Diskspace', 'SNMPTraffic', 'CPUTemp', 'Probehealth', 'ExternalIP', 'ADNS', 'APT', 'NMAP', 'MDADM']
| __all__ = ['Ping', 'HTTP', 'Port', 'SNMPCustom', 'CPULoad', 'Memory', 'Diskspace', 'SNMPTraffic', 'CPUTemp', 'Probehealth', 'ExternalIP', 'ADNS', 'APT', 'NMAP']
| bsd-3-clause | Python |
9f9bf9b9cccd2e39c3d567d4768d03c1a4a2c4b1 | Remove description key as it's already on README.rst | jbq/account-payment,Vauxoo/account-payment,incaser/account-payment,VitalPet/account-payment,Antiun/account-payment,alanljj/account-payment,abstract-open-solutions/account-payment,jesusVMayor/account-payment,Eficent/account-payment,open-synergy/account-payment,Endika/account-payment | account_due_list/__openerp__.py | account_due_list/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# Copyright (C) 2011-2013 Agile Business Group sagl
# (<http://www.agilebg.com>)
# @author Jordi Esteve <jesteve@zikzakmedia.com>
# @autho... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# Copyright (C) 2011-2013 Agile Business Group sagl
# (<http://www.agilebg.com>)
# @author Jordi Esteve <jesteve@zikzakmedia.com>
# @autho... | agpl-3.0 | Python |
2696e71ac88276a2291732d98caade883ea8963e | clean up | chintak/image-captioning | external/score.py | external/score.py | # see https://github.com/tylin/coco-caption/
# standard evaluation code
#
import cPickle as pickle
import os
import sys
sys.path.append('../../coco-caption')
sys.path.append('../coco-caption')
from pycocoevalcap.bleu.bleu import Bleu
from pycocoevalcap.rouge.rouge import Rouge
from pycocoevalcap.cider.cider import Cide... | import cPickle as pickle
import os
import sys
sys.path.append('../../coco-caption')
sys.path.append('../coco-caption')
from pycocoevalcap.bleu.bleu import Bleu
from pycocoevalcap.rouge.rouge import Rouge
from pycocoevalcap.cider.cider import Cider
from pycocoevalcap.meteor.meteor import Meteor
def get_score(ref, hypo)... | mit | Python |
cf2fa1ef4c2f7b4677cbd17202d6703cdcc8cc0d | Use optparse style argument parsing. Implement a 'wait-for-pid' option on xsend, to delay sending a message until after the specified process id exits | detrout/benderjab | benderjab/xsend.py | benderjab/xsend.py | #!/usr/bin/env python
#
# Copyright 2007 Diane Trout
# This software is covered by the GNU Lesser Public License 2.1
#
import optparse
import os
import random
import sys
import time
import xmpp
from xmpp import simplexml
from benderjab.util import get_config, toJID
def connect(profile=None):
"""
Connect to the s... | #!/usr/bin/env python
#
# Copyright 2007 Diane Trout
# This software is covered by the GNU Lesser Public License 2.1
#
import os
import random
import sys
import time
import xmpp
from xmpp import simplexml
from benderjab.util import get_config, toJID
def connect(profile=None):
"""
Connect to the server for our ja... | lgpl-2.1 | Python |
e9fc291faca8af35398b958d046e951aa8471cbf | Fix broken test since models new default ordering | Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel | apps/core/tests/test_factories.py | apps/core/tests/test_factories.py | from .. import factories, models
from . import CoreFixturesTestCase
class AnalysisFactoryTestCase(CoreFixturesTestCase):
def test_new_factory_with_Experiments(self):
experiments = factories.ExperimentFactory.create_batch(3)
# build
analysis = factories.AnalysisFactory.build(experiments=... | from .. import factories
from . import CoreFixturesTestCase
class AnalysisFactoryTestCase(CoreFixturesTestCase):
def test_new_factory_with_Experiments(self):
experiments = factories.ExperimentFactory.create_batch(3)
# build
analysis = factories.AnalysisFactory.build(experiments=experime... | bsd-3-clause | Python |
bd0f94b8a1af1f4232c7dbc09aa0bb32bf431d80 | check that multiline string literals don't expand as magic | ipython/ipython,ipython/ipython | IPython/core/tests/test_prefilter.py | IPython/core/tests/test_prefilter.py | """Tests for input manipulation machinery."""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import nose.tools as nt
from IPython.testing import tools as tt, decorators as dec
from IPython.testing.... | """Tests for input manipulation machinery."""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import nose.tools as nt
from IPython.testing import tools as tt, decorators as dec
#-------------------... | bsd-3-clause | Python |
ae99f3b3e2dae482292492ae1ddab512549f2e7b | Improve formatting (attempt 2) | DavisNT/mopidy-alarmclock,DavisNT/mopidy-alarmclock,DavisNT/mopidy-alarmclock | mopidy_alarmclock/__init__.py | mopidy_alarmclock/__init__.py | import os
from mopidy import config, ext
from .alarm_manager import AlarmManager
from .http import MessageStore, factory_decorator
__version__ = '0.1.7'
class Extension(ext.Extension):
dist_name = 'Mopidy-AlarmClock'
ext_name = 'alarmclock'
version = __version__
def get_default_config(self):
... | import os
from mopidy import config, ext
from .alarm_manager import AlarmManager
from .http import MessageStore, factory_decorator
__version__ = '0.1.7'
class Extension(ext.Extension):
dist_name = 'Mopidy-AlarmClock'
ext_name = 'alarmclock'
version = __version__
def get_default_config(self):
... | apache-2.0 | Python |
e91c634c654addef2f306f756373d474f60c9910 | Fix division by zero in ProgressBar | PermutaTriangle/Permuta | permuta/misc/progressbar.py | permuta/misc/progressbar.py | import time
import sys
import math
class ProgressBar(object):
@staticmethod
def create(mx, mn=0):
ProgressBar.mn = mn
ProgressBar.mx = mx
ProgressBar.at = mn
ProgressBar.start = time.time()
ProgressBar.last = 0
sys.stderr.write('\n')
ProgressBar.progress... | import time
import sys
import math
class ProgressBar(object):
@staticmethod
def create(mx, mn=0):
ProgressBar.mn = mn
ProgressBar.mx = mx
ProgressBar.at = mn
ProgressBar.start = time.time()
ProgressBar.last = 0
sys.stderr.write('\n')
ProgressBar.progress... | bsd-3-clause | Python |
1726295eab3de3759729d18d17fdbe0baba77c40 | Enable easier import | david-zwicker/video-analysis,david-zwicker/cv-mouse-burrows,david-zwicker/cv-mouse-burrows | mousetracking/hpc/__init__.py | mousetracking/hpc/__init__.py | from slurm import SlurmProject | bsd-3-clause | Python | |
96f9d8828934f61c4f1a623b7feecb9712dc83ea | Add id of Antorus raid. | PuckCh/battlenet | battlenet/enums.py | battlenet/enums.py | RACE = {
1: 'Human',
2: 'Orc',
3: 'Dwarf',
4: 'Night Elf',
5: 'Undead',
6: 'Tauren',
7: 'Gnome',
8: 'Troll',
9: 'Goblin',
10: 'Blood Elf',
11: 'Draenei',
22: 'Worgen',
24: 'Pandaren',
25: 'Pandaren',
26: 'Pandaren',
}
CLASS = {
1: 'Warrior',
2: 'Palad... | RACE = {
1: 'Human',
2: 'Orc',
3: 'Dwarf',
4: 'Night Elf',
5: 'Undead',
6: 'Tauren',
7: 'Gnome',
8: 'Troll',
9: 'Goblin',
10: 'Blood Elf',
11: 'Draenei',
22: 'Worgen',
24: 'Pandaren',
25: 'Pandaren',
26: 'Pandaren',
}
CLASS = {
1: 'Warrior',
2: 'Palad... | mit | Python |
50c91595f47b323081dfc44d9fdf16fbc4ba6f59 | add comment | jaebradley/nba_data | nba_data/data/season_range.py | nba_data/data/season_range.py | from nba_data.data.season import Season
# TODO: @jbradley add assertions to compare start and end
class SeasonRange:
def __init__(self, start, end):
assert isinstance(start, Season)
assert isinstance(end, Season)
self.start = start
self.end = end
| from nba_data.data.season import Season
class SeasonRange:
def __init__(self, start, end):
assert isinstance(start, Season)
assert isinstance(end, Season)
self.start = start
self.end = end
| mit | Python |
fcf8fa3368386dee3ede4575f58aa9cb57cb0649 | bump to 0.8.3 | tsuru/varnishapi,tsuru/varnishapi | feaas/__init__.py | feaas/__init__.py | # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "0.8.3"
| # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "0.8.2"
| bsd-3-clause | Python |
bab3bfb70a1da30134a0e020be31257f08a2e709 | Remove a vestige of the old zeromq implementation where we specified a callback port as a decorated parameter to the overall test case | wwitzel3/awx,wwitzel3/awx,snahelou/awx,snahelou/awx,snahelou/awx,snahelou/awx,wwitzel3/awx,wwitzel3/awx | awx/api/tests/job_tasks.py | awx/api/tests/job_tasks.py | # Copyright (c) 2014 Ansible, Inc.
# All Rights Reserved.
from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
from django.test.utils import override_settings
from rest_framew... | # Copyright (c) 2014 Ansible, Inc.
# All Rights Reserved.
from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
from django.test.utils import override_settings
from rest_framew... | apache-2.0 | Python |
9a470f41174c617787a8f06e003709f1f7ba6310 | Update file.py | jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi | apps/bigdata/file_download/file.py | apps/bigdata/file_download/file.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Author : https://github.com/jeonghoonkang
import numpy as np
import json
import time
import datetime
import os.path
import sys
def inputfile_chck(fname):
if os.path.isfile('./'+_internet_file_name_):
with open("./"+_internet_file_name_) as data_file:
... | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import numpy as np
import json
import time
import datetime
import os.path
import sys
def inputfile_chck(fname):
if os.path.isfile('./'+_internet_file_name_):
with open("./"+_internet_file_name_) as data_file:
data = json.load(data_file)
... | bsd-2-clause | Python |
28749b35e5e4241c744256a7d64fc696bf4eac97 | Remove debug print. | nanuxbe/djangopackages,QLGu/djangopackages,audreyr/opencomparison,QLGu/djangopackages,benracine/opencomparison,miketheman/opencomparison,pydanny/djangopackages,pydanny/djangopackages,audreyr/opencomparison,nanuxbe/djangopackages,cartwheelweb/packaginator,benracine/opencomparison,pydanny/djangopackages,nanuxbe/djangopac... | apps/package/handlers/launchpad.py | apps/package/handlers/launchpad.py | import os
from django.conf import settings
from launchpadlib.launchpad import Launchpad
from package.handlers.base_handler import BaseHandler
class LaunchpadHandler(BaseHandler):
title = 'Launchpad'
url = 'https://code.launchpad.net'
user_url = 'https://launchpad.net/~%s'
repo_regex = r'https://code... | import os
from django.conf import settings
from launchpadlib.launchpad import Launchpad
from package.handlers.base_handler import BaseHandler
class LaunchpadHandler(BaseHandler):
title = 'Launchpad'
url = 'https://code.launchpad.net'
user_url = 'https://launchpad.net/~%s'
repo_regex = r'https://code... | mit | Python |
17e8ead8cc1950779dca5614d24fc89f6606de9c | Remove unnecessary print from get_tlds | jeffknupp/domain-parser,jeffknupp/domain-parser | domain_parser/domain_parser.py | domain_parser/domain_parser.py | """Parses a URL using the publicsuffix.org TLD list."""
try:
import cPickle as pickle
except:
import pickle
import urllib2
from urlparse import urlparse
TLD_URL = 'https://publicsuffix.org/list/effective_tld_names.dat'
def get_tlds():
"""Return a list of top-level domains as maintained by Mozilla and
... | """Parses a URL using the publicsuffix.org TLD list."""
try:
import cPickle as pickle
except:
import pickle
import urllib2
from urlparse import urlparse
TLD_URL = 'https://publicsuffix.org/list/effective_tld_names.dat'
def get_tlds():
"""Return a list of top-level domains as maintained by Mozilla and
... | apache-2.0 | Python |
04eb362b245103f7c65bfb22a3b7bb64d0f87b59 | Fix get_image_name for light chutes. | ParadropLabs/Paradrop,ParadropLabs/Paradrop,ParadropLabs/Paradrop | paradrop/daemon/paradrop/core/chute/service.py | paradrop/daemon/paradrop/core/chute/service.py | class Service(object):
"""
A service is a long-running process that provides chute functionality.
"""
def __init__(self,
chute=None,
name=None,
type="normal",
image=None,
command=None,
dockerfile=None,... | class Service(object):
"""
A service is a long-running process that provides chute functionality.
"""
def __init__(self,
chute=None,
name=None,
type="normal",
image=None,
command=None,
dockerfile=None,... | apache-2.0 | Python |
c4753b200359774aff966c4e47ba67b176f80dc3 | add missing sys import | haridsv/pip,tdsmith/pip,nthall/pip,KarelJakubec/pip,davidovich/pip,mujiansu/pip,qbdsoft/pip,chaoallsome/pip,dstufft/pip,squidsoup/pip,nthall/pip,minrk/pip,sigmavirus24/pip,caosmo/pip,natefoo/pip,supriyantomaftuh/pip,blarghmatey/pip,benesch/pip,dstufft/pip,zenlambda/pip,fiber-space/pip,caosmo/pip,benesch/pip,Gabriel439/... | pip/backwardcompat/socket_create_connection.py | pip/backwardcompat/socket_create_connection.py | """
patch for py25 socket to work with http://pypi.python.org/pypi/ssl/
copy-paste from py2.6 stdlib socket.py
https://gist.github.com/zed/1347055
"""
import socket
import sys
_GLOBAL_DEFAULT_TIMEOUT = getattr(socket, '_GLOBAL_DEFAULT_TIMEOUT', object())
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
... | """
patch for py25 socket to work with http://pypi.python.org/pypi/ssl/
copy-paste from py2.6 stdlib socket.py
https://gist.github.com/zed/1347055
"""
import socket
_GLOBAL_DEFAULT_TIMEOUT = getattr(socket, '_GLOBAL_DEFAULT_TIMEOUT', object())
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
... | mit | Python |
8d3ffefe6c72f5d143d6b5a1bba6177f03bfc4f2 | clean up, do ties | msullivan/advent-of-code,msullivan/advent-of-code,msullivan/advent-of-code | 2018/23b.py | 2018/23b.py | #!/usr/bin/env python2
# z3 might have python 3 bindings but they weren't on my laptop from
# the install of z3 left over from grad school so back to python 2 it
# is!
from __future__ import print_function
from z3 import *
import sys
sys.setrecursionlimit(3000)
from collections import defaultdict, deque
import sy... | #!/usr/bin/env python2
# z3 might have python 3 bindings but they weren't on my laptop from
# the install of z3 left over from grad school so back to python 2 it
# is!
from __future__ import print_function
from z3 import *
import sys
sys.setrecursionlimit(3000)
from collections import defaultdict, deque
import sy... | mit | Python |
11e6879d5f6d35687dd2b3d8053c406dc49f1d75 | update version | gbrammer/grizli | grizli/version.py | grizli/version.py | # git describe --tags
__version__ = "0.6.0-52-gdb6bc8c"
| # git describe --tags
__version__ = "0.6.0-46-g0580c1c"
| mit | Python |
5abf5b657cd5ae7cfa94f3085fbe1121f7ea49c1 | Improve cli | tim-sueberkrueb/grout | grout/cli.py | grout/cli.py | # -*- coding: utf-8 -*-
import os
import click
from typing import Tuple
import grout.core
import grout.core.backend
@click.command()
@click.option('--project', type=click.Path(dir_okay=False, exists=True), help='Path to project file')
@click.option('--skip', default=None, multiple=True, help='Skip a job by its nam... | # -*- coding: utf-8 -*-
import os
import click
from typing import Tuple
import grout.core
import grout.core.backend
@click.command()
@click.option('--path', default=None, help='Path to project')
@click.option('--project-file', default='project.yaml', help='Project declaration file')
@click.option('--skip', 'skip_j... | mit | Python |
131cdaf337e3bfa6524443668e67835c3ecd9e80 | Bump version to 0.3.0 | eddieantonio/paperpal,eddieantonio/paperpal | paperpal/__init__.py | paperpal/__init__.py | #!/usr/bin/env python
# -*- encoding: UTF-8 -*-
# Copyright 2016 Eddie Antonio Santos <easantos@ualberta.ca>
#
# 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/licen... | #!/usr/bin/env python
# -*- encoding: UTF-8 -*-
# Copyright 2016 Eddie Antonio Santos <easantos@ualberta.ca>
#
# 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/licen... | apache-2.0 | Python |
0db6ccd51ed354ea1bca8f7bbb71436e5984ecd4 | fix bug with exception handling in config | mitin123/PyVPN | src/config.py | src/config.py | import yaml
from vpnexcept import VPNException
class InvalidConfigException(VPNException):
pass
class VPNConfig(object):
def __init__(self, path_to_config=None):
self.__path = path_to_config or self.__class__.__default_config_file
self.read_config()
#self.validate()
def read_con... | import yaml
from vpnexcept import VPNException
class InvalidConfigException(VPNException):
pass
class VPNConfig(object):
def __init__(self, path_to_config=None):
self.__path = path_to_config or self.__class__.__default_config_file
self.read_config()
#self.validate()
def read_con... | apache-2.0 | Python |
4c34fb65d757e2dcfabf4f8b532a712f59eb0663 | Support JSON encoding of a Link object | thisissoon/Flask-HAL,thisissoon/Flask-HAL | flask_hal/link.py | flask_hal/link.py | #!/usr/bin/env python
# encoding: utf-8
"""
flask_hal.link
==============
Implements the ``HAL`` Link specification.
"""
# Standard Libs
import json
VALID_LINK_ATTRS = [
'name',
'title',
'type',
'deprecation',
'profile',
'templated',
'hreflang'
]
class Link(object):
"""Build ``HAL... | #!/usr/bin/env python
# encoding: utf-8
"""
flask_hal.link
==============
Implements the ``HAL`` Link specification.
"""
VALID_LINK_ATTRS = [
'name',
'title',
'type',
'deprecation',
'profile',
'templated',
'hreflang'
]
class Link(object):
"""Build ``HAL`` specification ``_links`` o... | unlicense | Python |
49b0b7e3b00672d17167d1cfcf974414709bb647 | Fix NullLogger | thombashi/pytablewriter | pytablewriter/_logger/_null_logger.py | pytablewriter/_logger/_null_logger.py | class NullLogger:
level_name = None
def remove(self, handler_id=None): # pragma: no cover
pass
def add(self, sink, **kwargs): # pragma: no cover
pass
def disable(self, name): # pragma: no cover
pass
def enable(self, name): # pragma: no cover
pass
def crit... | class NullLogger:
level_name = None
def remove(self, handler_id=None): # pragma: no cover
pass
def add(self, **kwargs): # pragma: no cover
pass
def disable(self, name): # pragma: no cover
pass
def enable(self, name): # pragma: no cover
pass
def critical(s... | mit | Python |
39813f2b63f9015393636ef91460fddd57e17558 | fix website url in manifest | acsone/server-tools,jobiols/server-tools,open-synergy/server-tools,initOS/server-tools,acsone/server-tools,acsone/server-tools,ddico/server-tools,algiopensource/server-tools,ddico/server-tools,open-synergy/server-tools,jobiols/server-tools,osiell/server-tools,initOS/server-tools,sergiocorato/server-tools,ddico/server-t... | attachment_metadata/__openerp__.py | attachment_metadata/__openerp__.py | # coding: utf-8
# @ 2015 Valentin CHEMIERE @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Attachment Metadata',
'version': '8.0.1.0.0',
'author': 'Akretion,Odoo Community Association (OCA)',
'website': 'http://www.akretion.com/',
'license': 'AGPL-3',
... | # coding: utf-8
# @ 2015 Valentin CHEMIERE @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Attachment Metadata',
'version': '8.0.1.0.0',
'author': 'Akretion,Odoo Community Association (OCA)',
'website': 'www.akretion.com',
'license': 'AGPL-3',
'categor... | agpl-3.0 | Python |
2faaea457761063246d05d2e0cd03e172dec4369 | rephrase 408 | ufjfeng/leetcode-jf-soln,ufjfeng/leetcode-jf-soln | python/408_valid_word_abbreviation.py | python/408_valid_word_abbreviation.py | """
Given a non-empty string s and an abbreviation abbr, return whether the string
matches with the given abbreviation.
A string such as "word" contains only the following valid abbreviations:
["word", "1ord", "w1rd", "wo1d", "wor1", "2rd", "w2d", "wo2", "1o1d", "1or1",
"w1r1", "1o2", "2r1", "3d", "w3", "4"]
Notice... | """
Given a non-empty string s and an abbreviation abbr, return whether the string
matches with the given abbreviation.
A string such as "word" contains only the following valid abbreviations:
["word", "1ord", "w1rd", "wo1d", "wor1", "2rd", "w2d", "wo2", "1o1d", "1or1",
"w1r1", "1o2", "2r1", "3d", "w3", "4"]
Notice... | mit | Python |
200f3897f0b040775a5abc5c1f6a74276f6aea7a | Update local_settings.py | andymboyle/gdocs_importer | gdocs_importer/local_settings.py | gdocs_importer/local_settings.py | SECRET_KEY = 'secret_key_goes_here'
| SECRET_KEY = 'o1v*eup$vkkldvomosh(#p87x)l)vin--$nfut!5z^6dksiwi6'
| mit | Python |
f4e36132448a4a55bff5660b3f5a669e0095ecc5 | Fix up some issues with supporting schema migration | wwitzel3/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx,snahelou/awx,snahelou/awx,snahelou/awx,wwitzel3/awx | awx/main/models/activity_stream.py | awx/main/models/activity_stream.py | # Copyright (c) 2013 AnsibleWorks, Inc.
# All Rights Reserved.
from django.db import models
from django.utils.translation import ugettext_lazy as _
class ActivityStream(models.Model):
'''
Model used to describe activity stream (audit) events
'''
class Meta:
app_label = 'main'
OPERATION_... | # Copyright (c) 2013 AnsibleWorks, Inc.
# All Rights Reserved.
from django.db import models
class ActivityStream(models.Model):
'''
Model used to describe activity stream (audit) events
'''
OPERATION_CHOICES = [
('create', _('Entity Created')),
('update', _("Entity Updated")),
... | apache-2.0 | Python |
052ec48b74dc25750db055ea5ebf677c3217572a | set bill amount | ioO/billjobs | billjobs/tests/factories.py | billjobs/tests/factories.py | import factory
import factory.fuzzy
import factory.django
from django.contrib.auth.models import User
from django.db.models.signals import post_save
@factory.django.mute_signals(post_save)
class UserProfileFactory(factory.django.DjangoModelFactory):
class Meta:
model = 'billjobs.UserProfile'
billing_... | import factory
import factory.fuzzy
import factory.django
from django.contrib.auth.models import User
from django.db.models.signals import post_save
@factory.django.mute_signals(post_save)
class UserProfileFactory(factory.django.DjangoModelFactory):
class Meta:
model = 'billjobs.UserProfile'
billing_... | mit | Python |
681fa43db08194fae4973c300c82c3c74ac26406 | remove excess code | jpbottaro/anna | anna/main.py | anna/main.py | """Main entry point for any experiments."""
import os
import sys
import dataset.reuters21578.parser as data
import nlp.utils as nlp
from evaluation.mlc import evaluate
from model.binary_classifier import BinaryClassifierLearner as Learner
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: mai... | """Main entry point for any experiments."""
import os
import sys
import dataset.reuters21578.parser as data
import nlp.utils as nlp
from evaluation.mlc import evaluate
from model.binary_classifier import BinaryClassifierLearner as Learner
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: mai... | mit | Python |
0c4163a4847b2de08bbce8c29d036a8f5a6ea12b | increase lengths of username field | avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf | src/python/expedient/clearinghouse/users/models.py | src/python/expedient/clearinghouse/users/models.py | '''
Created on Dec 3, 2009
@author: jnaous
'''
from django.db import models
from django.contrib import auth
auth.models.User._meta.get_field_by_name('username')[0].max_length=255
class UserProfile(models.Model):
'''
Additional information about a user.
@ivar user: the user to whom this UserProfile ... | '''
Created on Dec 3, 2009
@author: jnaous
'''
from django.db import models
from django.contrib import auth
class UserProfile(models.Model):
'''
Additional information about a user.
@ivar user: the user to whom this UserProfile belongs
@type user: L{auth.models.User}
@ivar affiliation: The o... | bsd-3-clause | Python |
78a02036df6d9472564cf7ffbed7cd002ccc573c | Add new features | jmstaley/sb_blog | models.py | models.py | import datetime
from django.db import models
from django.contrib.auth.models import User
from tagging.fields import TagField
class Category(models.Model):
title = models.CharField(max_length=255,
help_text='Maximum 250 characters')
slug = models.SlugField(unique=True,
... | import datetime
from django.db import models
class Category(models.Model):
title = models.CharField(max_length=255,
help_text='Maximum 250 characters')
slug = models.SlugField(unique=True,
help_text='Automatically generated from title')
description ... | mit | Python |
b8c5dc2d6db40ea6c3a0baee6dc67b66006ad76f | Fix node_count default | reactiveops/pentagon,reactiveops/pentagon,reactiveops/pentagon | pentagon/defaults.py | pentagon/defaults.py | from datetime import datetime
class AWSPentagonDefaults(object):
ssh = {
'admin_vpn_key': 'admin-vpn',
'production_kube_key': 'production-kube',
'production_private_key': 'production-private',
'working_kube_key': 'working-kube',
'working_private_key': 'working-private',
... | from datetime import datetime
class AWSPentagonDefaults(object):
ssh = {
'admin_vpn_key': 'admin-vpn',
'production_kube_key': 'production-kube',
'production_private_key': 'production-private',
'working_kube_key': 'working-kube',
'working_private_key': 'working-private',
... | apache-2.0 | Python |
20604001e280a445d7c25bac6eb31b1f0512c20f | Fix argv handling in Python transitive closure example | lyogavin/spark,caneGuy/spark,esi-mineset/spark,cloud-fan/spark,jrshust/spark,ddna1021/spark,WeichenXu123/spark,WindCanDie/spark,ron8hu/spark,pronix/spark,kevinyu98/spark,actuaryzhang/spark,facaiy/spark,stanzhai/spark,wzhfy/spark,tejasapatil/spark,jrshust/spark,metamx/spark,eyalfa/spark,akopich/spark,jrshust/spark,andre... | python/examples/transitive_closure.py | python/examples/transitive_closure.py | import sys
from random import Random
from pyspark import SparkContext
numEdges = 200
numVertices = 100
rand = Random(42)
def generateGraph():
edges = set()
while len(edges) < numEdges:
src = rand.randrange(0, numEdges)
dst = rand.randrange(0, numEdges)
if src != dst:
edge... | import sys
from random import Random
from pyspark import SparkContext
numEdges = 200
numVertices = 100
rand = Random(42)
def generateGraph():
edges = set()
while len(edges) < numEdges:
src = rand.randrange(0, numEdges)
dst = rand.randrange(0, numEdges)
if src != dst:
edge... | apache-2.0 | Python |
8eb5cc80f003c5802b9bc3e87d77c1deee220610 | update admin | blueicepl/django-permissions | permissions/admin.py | permissions/admin.py | from django.contrib import admin
from permissions.models import ObjectPermission, PrincipalRoleRelation, Role, Permission
class ObjectPermissionAdmin(admin.ModelAdmin):
list_display = ('pk', 'role', 'permission', 'content')
list_filter = ('role', 'permission')
admin.site.register(ObjectPermission, ObjectPerm... | from django.contrib import admin
from permissions.models import ObjectPermission, PrincipalRoleRelation, Role, Permission
class ObjectPermissionAdmin(admin.ModelAdmin):
list_display = ('pk', 'role', 'permission', 'content')
list_filter = ('role', 'permission')
admin.site.register(ObjectPermission, ObjectPerm... | bsd-3-clause | Python |
1bcf8cba05749a83f86c1cd930d3c08c237f3b52 | add INSTALLED_APPS comment | bungoume/django-template | project_name/project_name/settings/__init__.py | project_name/project_name/settings/__init__.py | """
Django settings for {{ project_name }} project.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
"""
# Build paths inside the project ... | """
Django settings for {{ project_name }} project.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
"""
# Build paths inside the project ... | mit | Python |
69ba02dafebe0c6e2e6e32b1926d53ddb3188707 | fix spelling in log message | genome/flow-core,genome/flow-core,genome/flow-core | flow/util/exit.py | flow/util/exit.py | import logging
import os
import psutil
import signal
import time
LOG = logging.getLogger(__name__)
_SIGNAL_TIMEOUT = 10
def exit_process(exit_code, child_signals=[signal.SIGINT, signal.SIGTERM]):
LOG.info('Exitting process: signalling children.')
for signum in child_signals:
_signal_child_process... | import logging
import os
import psutil
import signal
import time
LOG = logging.getLogger(__name__)
_SIGNAL_TIMEOUT = 10
def exit_process(exit_code, child_signals=[signal.SIGINT, signal.SIGTERM]):
LOG.info('Exitting process: signalling children.')
for signum in child_signals:
_signal_child_process... | agpl-3.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.