commit
stringlengths
40
40
subject
stringlengths
1
1.49k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
new_contents
stringlengths
1
29.8k
old_contents
stringlengths
0
9.9k
lang
stringclasses
3 values
proba
float64
0
1
7bccd20523f96728db7a6b5fd23cb339787ecd3a
Bump to 1.1.4
jnius/__init__.py
jnius/__init__.py
''' Pyjnius ======= Accessing Java classes from Python. All the documentation is available at: http://pyjnius.readthedocs.org ''' __version__ = '1.1.4' from .jnius import * # noqa from .reflect import * # noqa from six import with_metaclass # XXX monkey patch methods that cannot be in cython. # Cython doesn't al...
''' Pyjnius ======= Accessing Java classes from Python. All the documentation is available at: http://pyjnius.readthedocs.org ''' __version__ = '1.1.4.dev0' from .jnius import * # noqa from .reflect import * # noqa from six import with_metaclass # XXX monkey patch methods that cannot be in cython. # Cython doesn...
Python
0.000084
6a27bd99352e4dc7f38c6f819a8a45b37c1a094c
Remove TODO to add requirements.txt
start-active-players.py
start-active-players.py
""" Start active players for the week Ideas: - Include the names of players who cannot be started - And maybe the full roster on those dates """ import requests from bs4 import BeautifulSoup # TODO: Configure this somewhere better (as a direct argument to the script, probably TEAM_URL = 'http://basketball.fantas...
""" Start active players for the week Ideas: - Include the names of players who cannot be started - And maybe the full roster on those dates TODO: - Add required packages in requirements.txt """ import requests from bs4 import BeautifulSoup # TODO: Configure this somewhere better (as a direct argument to the sc...
Python
0
a6390df0f4fb9c9402b1c795d4bf65765b793412
Bump dallinger version
dallinger/version.py
dallinger/version.py
"""Dallinger version number.""" __version__ = "5.0.6"
"""Dallinger version number.""" __version__ = "5.0.5"
Python
0
75d2f1aad9aa88926fce27d49c4e452eb571fc14
Update the lexer
cycli/lexer.py
cycli/lexer.py
import re from pygments.lexer import RegexLexer from pygments.token import Text, Comment, Operator, Keyword, Name, String, Number, Token __all__ = ["CypherLexer"] class CypherLexer(RegexLexer): name = 'Cypher' aliases = ['cypher'] filenames = ['*.cyp', '*.cypher'] flags = re.IGNORECASE tokens = {...
import re from pygments.lexer import RegexLexer from pygments.token import Text, Comment, Operator, Keyword, Name, String, Number, Token __all__ = ["CypherLexer"] class CypherLexer(RegexLexer): name = 'Cypher' aliases = ['cypher'] filenames = ['*.cyp', '*.cypher'] flags = re.IGNORECASE tokens = {...
Python
0
a98096f129165be003294eaa5ad3596931c58ae7
Use per-request database connections.
nmhive.py
nmhive.py
#!/usr/bin/env python import json import mailbox import os import tempfile import urllib.request import flask import flask_cors import notmuch app = flask.Flask(__name__) app.config['CORS_HEADERS'] = 'Content-Type' flask_cors.CORS(app) TAG_PREFIX = os.getenv('NMBPREFIX', 'notmuch::') NOTMUCH_PATH = None @app.rou...
#!/usr/bin/env python import json import mailbox import os import tempfile import urllib.request import flask import flask_cors import notmuch app = flask.Flask(__name__) app.config['CORS_HEADERS'] = 'Content-Type' flask_cors.CORS(app) TAG_PREFIX = os.getenv('NMBPREFIX', 'notmuch::') NOTMUCH = None _TAGS = {} @a...
Python
0
0983331773982b2bae6b92a0350a91aefbe6481e
Use the `note` style box. Refs #11725.
contrib/help_guide_version_notice.py
contrib/help_guide_version_notice.py
# -*- coding: utf-8 -*- # # Copyright (C) 2014 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/license.html. # # This software consists of vo...
# -*- coding: utf-8 -*- # # Copyright (C) 2014 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/license.html. # # This software consists of vo...
Python
0.000001
43b0201573a7bef18347c47f0434444a30edc5b1
Use global parameters for port & fork_server
rosserial_python/nodes/serial_node.py
rosserial_python/nodes/serial_node.py
#!/usr/bin/env python ##################################################################### # Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that th...
#!/usr/bin/env python ##################################################################### # Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that th...
Python
0
33d1e3f1d94c7af29742619df42983507e067568
Add VotableModelMixin
board/models.py
board/models.py
import datetime from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import models class UserProfile(models.Model): user = models.OneToOneField(User, related_name='profile') nick = models.CharField(max_length=16) def __str__(self): return str(se...
import datetime from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import models class UserProfile(models.Model): user = models.OneToOneField(User, related_name='profile') nick = models.CharField(max_length=16) def __str__(self): return str(se...
Python
0
56fee8518b9022b854f0bb300e8e44ec84539a29
Fix callback to send a bogus message which will close the connection
bokeh/client.py
bokeh/client.py
''' ''' from __future__ import absolute_import, print_function import logging import random log = logging.getLogger(__name__) from tornado import gen from tornado.httpclient import HTTPRequest from tornado.ioloop import IOLoop, PeriodicCallback from tornado.websocket import websocket_connect from bokeh.server.exce...
''' ''' from __future__ import absolute_import, print_function import logging import random log = logging.getLogger(__name__) from tornado import gen from tornado.httpclient import HTTPRequest from tornado.ioloop import IOLoop, PeriodicCallback from tornado.websocket import websocket_connect from bokeh.server.exce...
Python
0
7ed8de3d15941c683ae70c15a6ce50bbe29a6580
remove unused field from books
books/models.py
books/models.py
from django.db import models from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailadmin.edit_handlers import (FieldPanel, InlinePanel) from wagtail.wagtailimages.edit_handlers import ImageChooserP...
from django.db import models from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailadmin.edit_handlers import (FieldPanel, InlinePanel) from wagtail.wagtailimages.edit_handlers import ImageChooserP...
Python
0.000001
1a40dd2724a4a6364f0786fc5ac5f93d37daeaa0
add NoTestDataError
judgesite/task.py
judgesite/task.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import io import json import shutil import subprocess import os from config import conf from models import save_result class NoTestDataException(Exception): def __init__(self, value=None): self.value = value def __str__(self): re...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import io import json import shutil import subprocess import os from config import conf from models import save_result class JudgeTask(object): def __init__(self, message): task = json.loads(message) self.submit_type = task["submit_ty...
Python
0.000001
e0b3e23d4890a10f8bca4c699e5a9cd6294fee29
add xpub
keepkey-for-mn.py
keepkey-for-mn.py
#!/usr/bin/env python3 import sys, os sys.path.append( os.path.join( os.path.dirname(__file__), '.' ) ) sys.path.append( os.path.join( os.path.dirname(__file__), '.', 'dashlib' ) ) from config import * from keepkeylib.client import KeepKeyClient from keepkeylib.transport_hid import HidTransport import keepkeylib.ckd...
#!/usr/bin/env python3 import sys, os sys.path.append( os.path.join( os.path.dirname(__file__), '.' ) ) sys.path.append( os.path.join( os.path.dirname(__file__), '.', 'dashlib' ) ) from config import * from keepkeylib.client import KeepKeyClient from keepkeylib.transport_hid import HidTransport import keepkeylib.ckd...
Python
0
658de49626b6ef8b199bee6502bc62abebaa0803
Use an assert for an error that is concerning developers
sale_condition_template/sale_order.py
sale_condition_template/sale_order.py
# -*- coding: utf-8 -*- # # # Author: Nicolas Bessi # Copyright 2013-2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # Licen...
# -*- coding: utf-8 -*- # # # Author: Nicolas Bessi # Copyright 2013-2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # Licen...
Python
0.000002
6fc68abdb48134f4e647f0a1d69becd374d1147f
add missing Python file encoding
brasilcomvc/accounts/admin.py
brasilcomvc/accounts/admin.py
# coding: utf8 from __future__ import unicode_literals from django.contrib import admin from .models import User, UserAddress class UserAdmin(admin.ModelAdmin): class UserAddressInline(admin.StackedInline): model = UserAddress list_display = ('email', 'full_name', 'username',) fieldsets = ( ...
from django.contrib import admin from .models import User, UserAddress class UserAdmin(admin.ModelAdmin): class UserAddressInline(admin.StackedInline): model = UserAddress list_display = ('email', 'full_name', 'username',) fieldsets = ( ('Informações Pessoais', { 'fields': (...
Python
0.000014
ddb3f3cb33bab10113dbf290c65b9919339fdd72
Update artman version
synthtool/gcp/gapic_generator.py
synthtool/gcp/gapic_generator.py
from pathlib import Path import tempfile import platform from synthtool import _tracked_paths from synthtool import log from synthtool import shell from synthtool.sources import git ARTMAN_VERSION = '0.12.0' GOOGLEAPIS_URL: str = 'git@github.com:googleapis/googleapis.git' GOOGLEAPIS_PRIVATE_URL: str = ( 'git@gith...
from pathlib import Path import tempfile import platform from synthtool import _tracked_paths from synthtool import log from synthtool import shell from synthtool.sources import git GOOGLEAPIS_URL: str = 'git@github.com:googleapis/googleapis.git' GOOGLEAPIS_PRIVATE_URL: str = ( 'git@github.com:googleapis/googlea...
Python
0.000002
56cbbef7b8bbfa31445dad1561c4014804250fd5
fix test
kyototycoon/test/test_kyototycoon.py
kyototycoon/test/test_kyototycoon.py
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib from nose.plugins.attrib import attr # 3p import requests # project from checks import AgentCheck from tests.checks.common import AgentCheckTest config = { 'instances': [{ 'report_url': 'ht...
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib from nose.plugins.attrib import attr # 3p import requests # project from checks import AgentCheck from tests.checks.common import AgentCheckTest config = { 'instances': [{ 'report_url': 'ht...
Python
0.000002
fab3936bacbb961f2214ea5d1dce913c1635ab2c
Commit inicial de una rama para la versión 7.0. Todos los módulos fueron marcados como no instalables mientras no se compruebe que funcionan o migren, para poder usarlos o probarlos se debería poner el atributo installable de los ficheros __openerp__.py de cada módulo a True
l10n_es_account_asset/__openerp__.py
l10n_es_account_asset/__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
Python
0.999886
b94bfcbc579af9e08c4ac42466cd0c33a6d8a529
add textCNN model to __init__.py (#1421)
tensor2tensor/models/__init__.py
tensor2tensor/models/__init__.py
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
Python
0.000139
251a91c1bf245b3674c2612149382a0f1e18dc98
Add tests for getrpcinfo
test/functional/interface_rpc.py
test/functional/interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" from test_framework.test_framework import BitcoinTestFr...
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" from test_framework.test_framework import BitcoinTestFr...
Python
0
46c09fd75c6f45d68cd722cd3a12b88d04257083
Add tests for getrpcinfo
test/functional/interface_rpc.py
test/functional/interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" from test_framework.test_framework import BitcoinTestFr...
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" from test_framework.test_framework import BitcoinTestFr...
Python
0
35cf00b5f05f4b1df8b40b7edc3aac76534c8903
enable some reduction tests
test/python/tests/test_reduce.py
test/python/tests/test_reduce.py
import util class test_reduce_views: """ Test reduction of all kind of views""" def init(self): for cmd, ndim in util.gen_random_arrays("R", 4, dtype="np.float32"): cmd = "R = bh.random.RandomState(42); a = %s; " % cmd for i in range(ndim): yield (cmd, i) ...
import util class tes1t_reduce_views: """ Test reduction of all kind of views""" def init(self): for cmd, ndim in util.gen_random_arrays("R", 4, dtype="np.float32"): cmd = "R = bh.random.RandomState(42); a = %s; " % cmd for i in range(ndim): yield (cmd, i) ...
Python
0.000036
b2266a2640d542fa6f9734fa9565a7521d06f1b0
Bump again
bulbs/__init__.py
bulbs/__init__.py
__version__ = "0.11.4"
__version__ = "0.11.3"
Python
0
aee41bac296eece9c30565c5824db9a019833ee0
Add decorator docs
calm/decorator.py
calm/decorator.py
""" This module defines general decorators to define the Calm Application. """ from calm.resource import Resource from calm.ex import DefinitionError def produces(resource_type): """Decorator to specify what kind of Resource the handler produces.""" if not isinstance(resource_type, Resource): raise De...
def produces(resource_type): def decor(func): if getattr(func, 'handler_def', None): func.handler_def.produces = resource_type else: func.produces = resource_type return func return decor def consumes(resource_type): def decor(func): if getattr(f...
Python
0.000001
6f0b75f0561563926afc37dca8451f886e2e2d4f
Handle unicode data like cdbdump
cdblib/cdbdump.py
cdblib/cdbdump.py
from __future__ import print_function import argparse import sys import six import cdblib def cdbdump(parsed_args, **kwargs): # Read binary data from stdin by default stdin = kwargs.get('stdin') if stdin is None: stdin = sys.stdin if six.PY2 else sys.stdin.buffer # Print text data to stdou...
from __future__ import print_function import argparse import sys import six import cdblib def cdbdump(parsed_args, **kwargs): # Read binary data from stdin by default stdin = kwargs.get('stdin') if stdin is None: stdin = sys.stdin if six.PY2 else sys.stdin.buffer # Print text data to stdou...
Python
0.999719
9e22b82b9f5848ae3bfc8def66fe7b3d23c8f5b8
Change Alfred date of posting to be iso8601 compatible.
jobs/spiders/alfred.py
jobs/spiders/alfred.py
import json import urlparse import dateutil.parser import scrapy from jobs.items import JobsItem class AlfredSpider(scrapy.Spider): name = "alfred" start_urls = ['https://api.alfred.is/api/v3/web/open/jobs?cat=0&limit=100&page=0'] def parse(self, response): # we're using an api rather than scra...
import json import urlparse import scrapy from jobs.items import JobsItem from jobs.spiders.visir import decode_date_string class AlfredSpider(scrapy.Spider): name = "alfred" start_urls = ['https://api.alfred.is/api/v3/web/open/jobs?cat=0&limit=100&page=0'] def parse(self, response): # we're us...
Python
0
4b1ba931091448b4e5d980cb0695b4a8aa85b459
Use markets.ft.com instead of fixer.io
bumblebee/modules/currency.py
bumblebee/modules/currency.py
# -*- coding: UTF-8 -*- # pylint: disable=C0111,R0903 """Displays currency exchange rates. Currently, displays currency between GBP and USD/EUR only. Requires the following python packages: * requests Parameters: * currency.interval: Interval in minutes between updates, default is 1. * currency.source: S...
# -*- coding: UTF-8 -*- # pylint: disable=C0111,R0903 """Displays currency exchange rates. Currently, displays currency between GBP and USD/EUR only. Requires the following python packages: * requests Parameters: * currency.interval: Interval in minutes between updates, default is 1. * currency.source: S...
Python
0
210c2cf58c246c3733542b8fee7c3eb9fe5d860d
bump version
callisto/delivery/__init__.py
callisto/delivery/__init__.py
__version__ = '0.4.1'
__version__ = '0.4.0'
Python
0
623ce2d8624a1a04156a35ae762d29a19fbc7b52
fix broken docstring
ceph_deploy/util/templates.py
ceph_deploy/util/templates.py
ceph_repo = """ [ceph] name=Ceph packages for $basearch baseurl={repo_url}/$basearch enabled=1 gpgcheck=1 type=rpm-md gpgkey={gpg_url} [ceph-noarch] name=Ceph noarch packages baseurl={repo_url}/noarch enabled=1 gpgcheck=1 type=rpm-md gpgkey={gpg_url} [ceph-source] name=Ceph source packages baseurl={repo_url}/SRPMS ...
ceph_repo = """ [ceph] name=Ceph packages for $basearch baseurl={repo_url}/$basearch enabled=1 gpgcheck=1 type=rpm-md gpgkey={gpg_url} [ceph-noarch] name=Ceph noarch packages baseurl={repo_url}/noarch enabled=1 gpgcheck=1 type=rpm-md gpgkey={gpg_url} [ceph-source] name=Ceph source packages baseurl={repo_url}/SRPMS ...
Python
0
f4b8246aead0657e0f997773efed5fbc2147cce7
add '# noqa' to imports to make flake8 happy
ceph_medic/remote/__init__.py
ceph_medic/remote/__init__.py
import mon # noqa import osd # noqa import common # noqa import functions # noqa import commands # noqa
import mon import osd import common import functions import commands
Python
0
20e8ef6bd68100a70b9d50013630ff71d8b7ec94
Support wildcard matches on coverage/junit results
changes/artifacts/__init__.py
changes/artifacts/__init__.py
from __future__ import absolute_import, print_function from .manager import Manager from .coverage import CoverageHandler from .xunit import XunitHandler manager = Manager() manager.register(CoverageHandler, ['coverage.xml', '*.coverage.xml']) manager.register(XunitHandler, ['xunit.xml', 'junit.xml', '*.xunit.xml', ...
from __future__ import absolute_import, print_function from .manager import Manager from .coverage import CoverageHandler from .xunit import XunitHandler manager = Manager() manager.register(CoverageHandler, ['coverage.xml']) manager.register(XunitHandler, ['xunit.xml', 'junit.xml'])
Python
0
3109b98d8f8befdb927828908bd213000cf9ae51
Handle empty result for previous runs/test failures in origin finder
changes/utils/originfinder.py
changes/utils/originfinder.py
from __future__ import absolute_import from collections import defaultdict from changes.constants import Result, Status from changes.models import Job, TestGroup def first(key, iterable): for x in iterable: if key(x): return x return None def find_failure_origins(job, test_failures): ...
from __future__ import absolute_import from collections import defaultdict from changes.constants import Result, Status from changes.models import Job, TestGroup def first(key, iterable): for x in iterable: if key(x): return x return None def find_failure_origins(job, test_failures): ...
Python
0
0bf6441863433575aebcbd0b238d27d95830c015
Fix .iob converter (closes #3620)
spacy/cli/converters/iob2json.py
spacy/cli/converters/iob2json.py
# coding: utf8 from __future__ import unicode_literals import re from cytoolz import partition_all from ...gold import iob_to_biluo def iob2json(input_data, n_sents=10, *args, **kwargs): """ Convert IOB files into JSON format for use with train cli. """ sentences = read_iob(input_data.split("\n")) ...
# coding: utf8 from __future__ import unicode_literals import re from ...gold import iob_to_biluo from ...util import minibatch def iob2json(input_data, n_sents=10, *args, **kwargs): """ Convert IOB files into JSON format for use with train cli. """ docs = [] for group in minibatch(docs, n_sents...
Python
0
f190916a828ab4b8ecf16cc6a82ebf3cf8f821e1
Add a test for executing specs with tags
spec/execution_with_tags_spec.py
spec/execution_with_tags_spec.py
from mamba import description, before, context, it from doublex import Spy from expects import expect, be_true, be_false from mamba import reporter, runnable from mamba.example import Example from mamba.example_group import ExampleGroup from spec.object_mother import an_example_group TAGS = ['any_tag'] with descri...
from mamba import description, before, context, it from doublex import Spy from expects import expect, be_true, be_false from mamba import reporter, runnable from mamba.example import Example from mamba.example_group import ExampleGroup from spec.object_mother import an_example_group TAGS = ['any_tag'] with descri...
Python
0
cb1912234a058dd95c20cd765771552e76224c7a
fix c3 settings
chipyprj/chipyprj/settings.py
chipyprj/chipyprj/settings.py
""" Django settings for chipyprj project. Generated by 'django-admin startproject' using Django 1.8.5. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
""" Django settings for chipyprj project. Generated by 'django-admin startproject' using Django 1.8.5. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
Python
0.000002
887bba729cd4f4f7391ac6f08ab7601976bcd1ca
Update __init__.py
templated_email/__init__.py
templated_email/__init__.py
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from templated_email.backends.vanilla_django import TemplateBackend import six import warnings warnings.filterwarnings('error', 'django.utils.importlib') try: # Django <= 1.7 from django.utils.importlib import import_modu...
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from templated_email.backends.vanilla_django import TemplateBackend import warnings warnings.filterwarnings('error', 'django.utils.importlib') try: # Django <= 1.7 from django.utils.importlib import import_module except: ...
Python
0.000072
d57fb3ca8c1f4329c8ac90cb785b27123d98aee5
Bump the version to 0.3.1
backlog/__init__.py
backlog/__init__.py
"""A Simple Note Manager""" from __future__ import absolute_import from backlog.backlog import Backlog __version__ = '0.3.1'
"""A Simple Note Manager""" from __future__ import absolute_import from backlog.backlog import Backlog __version__ = '0.3.0'
Python
0.999999
eef0663675b741d32f399bdbca1a95b943a1fb68
Create a script that uses an autoencoder to extract bow
bag-of-words/bow.py
bag-of-words/bow.py
#!/usr/bin/env python """This module contains function and classes relevant with the computation of a bag of words model. At start we suppose that suitable descriptors for our dataset are already extracted. Subsequently we procceed to the second step of quantization, in this step we use a clustering algorithm such as K...
#!/usr/bin/env python """This module contains function and classes relevant with the computation of a bag of words model. At start we suppose that suitable descriptors for our dataset are already extracted. Subsequently we procceed to the second step of quantization, in this step we use a clustering algorithm such as K...
Python
0.000001
0f782215e58eba53b72667bffde667f4d03a0d4a
Update version.
client/version.py
client/version.py
__version__ = '0.2.0'
__version__ = '0.1.9'
Python
0
6749060a7546b7dee3c6e643c7dfad4db7934061
package for release
cliez/__init__.py
cliez/__init__.py
# -*- coding: utf-8 -*- version = "1.6.10" version_info = (1, 6, 10)
# -*- coding: utf-8 -*- version = "1.6.9" version_info = (1, 6, 9)
Python
0
27c7270a170a8eb3c2720390ab6e95d6bf16f8e3
fix option name to driver (#24)
cligj/__init__.py
cligj/__init__.py
# cligj # Shared arguments and options. import click from .features import normalize_feature_inputs # Arguments. # Multiple input files. files_in_arg = click.argument( 'files', nargs=-1, type=click.Path(resolve_path=True), required=True, metavar="INPUTS...") # Multiple files, last of which is...
# cligj # Shared arguments and options. import click from .features import normalize_feature_inputs # Arguments. # Multiple input files. files_in_arg = click.argument( 'files', nargs=-1, type=click.Path(resolve_path=True), required=True, metavar="INPUTS...") # Multiple files, last of which is...
Python
0
05f45992e871dc0d98613fb31269c43e21869414
Add envy help command
cloudenvy/main.py
cloudenvy/main.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 import argparse import logging from cloudenvy.config import EnvyConfig from cloudenvy.commands.envy_up import EnvyUp from cloudenvy.commands.envy_list import EnvyList from cloudenvy.commands.envy_provision import EnvyProvision from cloudenvy.commands.envy_snapshot import E...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 import argparse import logging from cloudenvy.config import EnvyConfig from cloudenvy.commands.envy_up import EnvyUp from cloudenvy.commands.envy_list import EnvyList from cloudenvy.commands.envy_provision import EnvyProvision from cloudenvy.commands.envy_snapshot import E...
Python
0.999924
fabcd790578e904b3bff34fdf6e91edb4906a4e2
Add missing comma in compat.gyp
compat/compat.gyp
compat/compat.gyp
# Copyright 2014 The Crashpad Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
# Copyright 2014 The Crashpad Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
Python
0.000001
79cd3dc227ff1d13faa9581b6f22caa176db2360
Mark Document.to_archive as abstract
c2corg_api/models/document.py
c2corg_api/models/document.py
from sqlalchemy import ( Column, Integer, Boolean, String, ForeignKey, Enum ) from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import relationship import abc from c2corg_api.models import Base, schema from utils import copy_attributes quality_types = [ 'stub', ...
from sqlalchemy import ( Column, Integer, Boolean, String, ForeignKey, Enum ) from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import relationship from c2corg_api.models import Base, schema from utils import copy_attributes quality_types = [ 'stub', 'medium'...
Python
0.001214
41bb51f7f0aa1fda927af51498ec1acbf9eeddcc
fix history links
leaguebot/services/alerters/slack.py
leaguebot/services/alerters/slack.py
from leaguebot import app import leaguebot.models.map as screepmap import leaguebot.services.screeps as screeps import leaguebot.services.slack as slack import re def sendBattleMessage(battleinfo): message = getBattleMessageText(battleinfo) sendToSlack(message) def getBattleMessageText(battleinfo): room...
from leaguebot import app import leaguebot.models.map as screepmap import leaguebot.services.screeps as screeps import leaguebot.services.slack as slack import re def sendBattleMessage(battleinfo): message = getBattleMessageText(battleinfo) sendToSlack(message) def getBattleMessageText(battleinfo): room...
Python
0
2c9a0f9783c72af122d7c728a7760c8a2027d45f
Fix remove debug print
tests/resolver_test.py
tests/resolver_test.py
from gnr.core.gnrbag import Bag, BagCbResolver def hello(x=''): return 'i say : %s ' % x b = Bag() b.setCallBackItem('say_hello', hello, x='hello') b.setCallBackItem('say_muu', hello, x='muu') b.setCallBackItem('say_buzbuz', hello, x='buzbuz') resolver = BagCbResolver(hello, x='fatto da resolver e non da setCallB...
from gnr.core.gnrbag import Bag, BagCbResolver def hello(x=''): return 'i say : %s ' % x b = Bag() b.setCallBackItem('say_hello', hello, x='hello') b.setCallBackItem('say_muu', hello, x='muu') b.setCallBackItem('say_buzbuz', hello, x='buzbuz') resolver = BagCbResolver(hello, x='fatto da resolver e non da setCallB...
Python
0.000019
539c11706d91db92e36f49694603f2ed668d8cbb
Add a __unicode__ method to the Book model. Will show book title in admin instead of "Book object".
test_environment/books/models.py
test_environment/books/models.py
from dockit.schema import Document, Schema, ModelReferenceField, \ TextField, DictField, SchemaField, FileField, IntegerField, \ ReferenceField, ListField, GenericSchemaField, CharField, DateField from django.contrib.auth.models import User class Author(Document): user = ModelReferenceField(User) inte...
from dockit.schema import Document, Schema, ModelReferenceField, \ TextField, DictField, SchemaField, FileField, IntegerField, \ ReferenceField, ListField, GenericSchemaField, CharField, DateField from django.contrib.auth.models import User class Author(Document): user = ModelReferenceField(User) inte...
Python
0
925c6a53eea4b8ca4e3243a5a651873efb72ef4d
use jinja2 templating for olog message
bluesky/callbacks/olog.py
bluesky/callbacks/olog.py
from io import StringIO TEMPLATES = {} TEMPLATES['long'] = """ {{- start.plan_type }} ['{{ start.uid[:6] }}'] (scan num: {{ start.scan_id }}) Scan Plan --------- {{ start.plan_type }} {%- for k, v in start.plan_args.items() %} {{ k }}: {{ v }} {%- endfor %} {% if 'signature' in start -%} Call: {{ start.signa...
def log(name, doc): # This only applies to 'start' Documents. if doc != 'start': return input_message, = msg.args output = """ Header uid: {{uid!r}} Scan Plan --------- {input_message} Metadata -------- {{metadata!r}} """.format(input_message=t d = doc self.logbook(log_message, d) d...
Python
0
d88013450d5e3ec62a3cb8b4fcfa2afbc173338b
remove from there as well
tests/safety/common.py
tests/safety/common.py
from panda.tests.safety import libpandasafety_py MAX_WRONG_COUNTERS = 5 class UNSAFE_MODE: DEFAULT = 0 DISABLE_DISENGAGE_ON_GAS = 1 DISABLE_STOCK_AEB = 2 RAISE_LONGITUDINAL_LIMITS_TO_ISO_MAX = 8 def make_msg(bus, addr, length=8): to_send = libpandasafety_py.ffi.new('CAN_FIFOMailBox_TypeDef *') if addr >=...
from panda.tests.safety import libpandasafety_py MAX_WRONG_COUNTERS = 5 class UNSAFE_MODE: DEFAULT = 0 DISABLE_DISENGAGE_ON_GAS = 1 DISABLE_STOCK_AEB = 2 ENABLE_WEAK_STEERING_WHILE_NOT_ENGAGED = 4 RAISE_LONGITUDINAL_LIMITS_TO_ISO_MAX = 8 def make_msg(bus, addr, length=8): to_send = libpandasafety_py.ffi....
Python
0
bfb048d9a1ac34cd07e0fc8d94c0e97d901ee096
fix simple_parser
tests/simple_parser.py
tests/simple_parser.py
from test_parser import * import sys, os os.chdir(os.path.split(os.path.abspath(__file__))[0]) sys.path.insert(0, os.path.abspath(os.pardir)) import parser if __name__ == "__main__": x = "" if len(sys.argv) > 1: x = sys.argv[1] else: x = "x" p = parser.HTMLParser() documen...
from test_parser import * import sys os.chdir("..") import parser if __name__ == "__main__": x = "" if len(sys.argv) > 1: x = sys.argv[1] else: x = "x" p = parser.HTMLParser() document = p.parse(StringIO.StringIO(x)) print convertTreeDump(document.printTree())
Python
0
24b02f5added52ac572ba24a90ef0c74c3fb7cd7
use api.craft.ai for runtime url
local_demo.py
local_demo.py
#!/usr/bin/python import os import requests import json import subprocess import time def userInput(config): def defaultValue(config, key): return config[key] if key in config else "" res = {} invalid = {} res['user_name'] = raw_input("your GitHub username (default = " + defaultValue(config, 'user_name') + "): "...
#!/usr/bin/python import os import requests import json import subprocess import time def userInput(config): def defaultValue(config, key): return config[key] if key in config else "" res = {} invalid = {} res['user_name'] = raw_input("your GitHub username (default = " + defaultValue(config, 'user_name') + "): "...
Python
0
a80646e0891dc5345caffd0acd12a073a0b47187
add missing test
tests/testLimitator.py
tests/testLimitator.py
# -*- coding: utf-8 -*- from tools.limitator import * import unittest import time class TestLimitator(unittest.TestCase): USER1 = {"id":1} USER2 = {"id":2} def test_1(self): l = Limitator(5, 2) for i in range(5): l.next(self.USER1) try: l.next(self.USER1) ...
# -*- coding: utf-8 -*- from tools.limitator import * import unittest import time class TestLimitator(unittest.TestCase): USER1 = {"id":1} USER2 = {"id":2} def test_1(self): l = Limitator(5, 2) for i in range(5): l.next(self.USER1) try: l.next(self.USER1) ...
Python
0.000288
88c9facf33771ecfccf9c3b8f6d3e37b3a2b648c
Revert the first 'speedup'
chainerrl/misc/collections.py
chainerrl/misc/collections.py
import itertools import random import six class RandomAccessQueue(object): """FIFO queue with fast indexing Operations getitem, setitem, append, popleft, and len are amortized O(1)-time, if this data structure is used ephemerally. """ def __init__(self, *args, **kwargs): self.maxlen = kw...
import itertools import numpy as np class RandomAccessQueue(object): """FIFO queue with fast indexing Operations getitem, setitem, append, popleft, and len are amortized O(1)-time, if this data structure is used ephemerally. """ def __init__(self, *args, **kwargs): self.maxlen = kwargs.p...
Python
0.000002
ae8f9c39cd75d837a4cb5a4cea4d3d11fd1cabed
Add additional test case for comments
tests/test_comments.py
tests/test_comments.py
from hypothesis_auto import auto_pytest_magic from isort import comments auto_pytest_magic(comments.parse) auto_pytest_magic(comments.add_to_line) def test_add_to_line(): assert comments.add_to_line([], "import os # comment", removed=True).strip() == "import os"
from hypothesis_auto import auto_pytest_magic from isort import comments auto_pytest_magic(comments.parse) auto_pytest_magic(comments.add_to_line)
Python
0
aa1008691e3433f8350d3f3a5e5d03d9c629a45c
Test for getting parameters back from ideal observer
tests/test_idealobs.py
tests/test_idealobs.py
import pytest import scipy.io as sio from pambox import idealobs import numpy as np @pytest.fixture def data(): return np.array([0.28032187, 1.07108181, 3.35513227, 8.66774961, 18.61914334, 33.63172026, 51.87228063, 69.72236134, 83.79127082, 92.72205919, 97.287...
import pytest import scipy.io as sio from pambox import idealobs import numpy as np @pytest.fixture def data(): return np.array([0.28032187, 1.07108181, 3.35513227, 8.66774961, 18.61914334, 33.63172026, 51.87228063, 69.72236134, 83.79127082, 92.72205919, 97.287...
Python
0
28e049dfc0a784c9c47ef671286e39e13825c6c5
Remove useless import
tests/test_multival.py
tests/test_multival.py
# test_multival.py """Test suite for MultiValue class""" # Copyright (c) 2012 Darcy Mason # This file is part of pydicom, relased under an MIT-style license. # See the file license.txt included with this distribution, also # available at https://github.com/darcymason/pydicom import unittest from datetime import ...
# test_multival.py """Test suite for MultiValue class""" # Copyright (c) 2012 Darcy Mason # This file is part of pydicom, relased under an MIT-style license. # See the file license.txt included with this distribution, also # available at https://github.com/darcymason/pydicom import unittest from datetime import ...
Python
0.000004
2fdb9d17b2c033370d663b4e72d71c1c7e105a84
fix test for python 3
tests/test_pipeline.py
tests/test_pipeline.py
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest from nose.tools import eq_ from redis_shard.shard import RedisShardAPI from redis_shard._compat import b from .config import settings class TestShard(unittest.TestCase): def setUp(self): self.client = RedisShardAPI(**settings) self.clear_d...
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest from nose.tools import eq_ from redis_shard.shard import RedisShardAPI from redis_shard._compat import b from .config import settings class TestShard(unittest.TestCase): def setUp(self): self.client = RedisShardAPI(**settings) self.clear_d...
Python
0.000105
ab4c02c1f5f5cf3ba46b4924c48693d028dc23db
Split pipeline tests
tests/test_pipeline.py
tests/test_pipeline.py
from valohai_yaml.objs import Config, DeploymentNode def test_pipeline_valid(pipeline_config: Config): assert pipeline_config.lint().is_valid() def test_little_pipeline(pipeline_config: Config): assert any( ( edge.source_node == "batch1" and edge.source_type == "parameter" ...
from valohai_yaml.objs import Config, DeploymentNode def test_pipeline(pipeline_config: Config): lr = pipeline_config.lint() assert lr.is_valid() assert any( ( edge.source_node == "batch1" and edge.source_type == "parameter" and edge.source_key == "aspect-ratio"...
Python
0.000001
9e57e467ab508cd0e5fab2862a2c9b651eaa7838
rename tag basisofRecords to BASISOFRECORDS
bin/aggregate_metrics.py
bin/aggregate_metrics.py
import sys import os import json SRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '/src' sys.path.append(SRC_DIR) from aggregator import ReportAggregator, CartoDBWriter def check_arguments(): if len(sys.argv) != 3: print 'usage: aggregate_metrics.py <data directory> <settings.json>\...
import sys import os import json SRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '/src' sys.path.append(SRC_DIR) from aggregator import ReportAggregator, CartoDBWriter def check_arguments(): if len(sys.argv) != 3: print 'usage: aggregate_metrics.py <data directory> <settings.json>\...
Python
0.000001
77c0ad615c7f0270c0425866f06edde8856892b9
Add Augur Unit Tests For parseIntelXML()
build/tests/test_augur.py
build/tests/test_augur.py
#!/usr/bin/python3 """ test_augur.py APP: Inquisition DESC: Unit test for Augur library CREATION_DATE: 2017-11-25 """ # MODULES # | Native import configparser import unittest # | Third-Party from bs4 import BeautifulSoup as BSoup # | Custom from lib.destiny.Augur import Augur # METADATA __author__ = 'Joshua Carl...
#!/usr/bin/python3 """ test_augur.py APP: Inquisition DESC: Unit test for Augur library CREATION_DATE: 2017-11-25 """ # MODULES # | Native import configparser import unittest # | Third-Party from bs4 import BeautifulSoup as BSoup # | Custom from lib.destiny.Augur import Augur # METADATA __author__ = 'Joshua Carl...
Python
0
5c2141610c40c1879400a88c82ac055081bb7451
Let the final table have any number of periods per day
main/views.py
main/views.py
import sys from string import ascii_uppercase import itertools from typing import Dict, List from openpyxl import Workbook from terminaltables import AsciiTable from main import models from main import solver Timetable = Dict[models.Subject, List[int]] def timetable_to_workbook(timetable: Timetable, sheet_name: st...
import sys from string import ascii_uppercase import itertools from typing import Dict, List from openpyxl import Workbook from terminaltables import AsciiTable from main import models from main import solver Timetable = Dict[models.Subject, List[int]] def timetable_to_workbook(timetable: Timetable, sheet_name: st...
Python
0.997706
b6572ec32295365862947845a8c916eae428700f
Clean up temporary files on 'nt'.
makemodule.py
makemodule.py
#!/bin/env python """ makemodule Module generation tool Copyright (c) 2015 Sam Saint-Pettersen. Released under the MIT/X11 License. """ import sys import os import xml.dom.minidom as xml class makemodule: def __init__(self, args): if len(args) == 1: self.displayUsage() else: ...
#!/bin/env python """ makemodule Module generation tool Copyright (c) 2015 Sam Saint-Pettersen. Released under the MIT/X11 License. """ import sys import os import xml.dom.minidom as xml class makemodule: def __init__(self, args): if len(args) == 1: self.displayUsage() else: ...
Python
0
9aae92fb0e22c97f559b6e3ee895d9959e010e05
Add missing import
tests_tf/test_model.py
tests_tf/test_model.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest from cleverhans.model import Model, CallableModelWrapper class TestModelClass(unittest.TestCase): def test_get_layer(self): # Define empty ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest from cleverhans.model import Model class TestModelClass(unittest.TestCase): def test_get_layer(self): # Define empty model model = ...
Python
0.000466
4646e7c682ba9a0291815a5d0de98674a9de3410
Fix RemoteCapture definition
src/pyshark/capture/remote_capture.py
src/pyshark/capture/remote_capture.py
from pyshark import LiveCapture class RemoteCapture(LiveCapture): """ A capture which is performed on a remote machine which has an rpcapd service running. """ def __init__(self, remote_host, remote_interface, remote_port=2002, bpf_filter=None): """ Creates a new remote capture which ...
from pyshark import LiveCapture class RemoteCapture(LiveCapture): """ A capture which is performed on a remote machine which has an rpcapd service running. """ def __init__(self, remote_host, remote_interface, remote_port=2002, bpf_filter=None): """ Creates a new remote capture which ...
Python
0.000001
1a9f0320b3a8aecc50cfee6335c3b6e8dc81c233
Make this tool less hacky.
tools/commit-impact.py
tools/commit-impact.py
#!/usr/bin/env python # # See the impact of a Futhark commit compared to the previous one we # have benchmarking for. import sys import subprocess from urllib.request import urlopen from urllib.error import HTTPError import json import tempfile import os def url_for(backend, system, commit): return 'https://futha...
#!/usr/bin/env python # # See the impact of a Futhark commit compared to the previous one we # have benchmarking for. import sys import subprocess from urllib.request import urlopen from urllib.error import HTTPError import json def url_for(backend, system, commit): return 'https://futhark-lang.org/benchmark-resu...
Python
0
0fa1e147fc7d2522a4352c0bbc60e4da67380257
add a missing statement
landlab/utils/tests/test_stream_length.py
landlab/utils/tests/test_stream_length.py
from landlab import RasterModelGrid, FieldError from landlab.components import FlowAccumulator, FastscapeEroder, FlowDirectorSteepest import numpy as np from landlab.utils.stream_length import calculate_stream_length from nose.tools import assert_equal, assert_true, assert_false, assert_raises def test_no_flow_reciev...
from landlab import RasterModelGrid, FieldError from landlab.components import FlowAccumulator, FastscapeEroder, FlowDirectorSteepest import numpy as np from landlab.utils.stream_length import calculate_stream_length from nose.tools import assert_equal, assert_true, assert_false, assert_raises def test_no_flow_reciev...
Python
1
85ee5f5e6d7a5937b67c9d11ae127709749f7490
Bump to version 0.4.1
cmsplugin_cascade/__init__.py
cmsplugin_cascade/__init__.py
__version__ = "0.4.1"
__version__ = "0.4.0"
Python
0
59b8ae5f17e556c09ef8592723f9c684843c7dcc
update function and comment
code/utils/outlierfunction.py
code/utils/outlierfunction.py
# find outliers based on DVARS and FD def outlier(data, bound): ''' Input: data: array of values bound: threshold for outliers Output: indices of outliers ''' outlier = [] # set nonoutlier values to 0, outliers to nonzero for i in data: if i <= bound: ...
# find outliers based on DVARS and FD def outlier(data, bound): ''' Input: data: array of values bound: threshold for outliers Output: indices of outliers ''' outlier = [] # set outlier values to 0 for i in data: if i <= bound: outlier.appen...
Python
0
b0f7e70e29783de6980006be92bc105287b3b5c3
Remove dependency on not-yet-added [] library Change on 2014/01/24 by mgainer <mgainer@google.com> ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=60226626
coursebuilder/main.py
coursebuilder/main.py
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Python
0
270c8ca68357f92999474fbf110fed7b01cdfdf2
Use proper way to access package resources.
cqlengine/__init__.py
cqlengine/__init__.py
import os import pkg_resources from cqlengine.columns import * from cqlengine.functions import * from cqlengine.models import Model from cqlengine.query import BatchQuery __cqlengine_version_path__ = pkg_resources.resource_filename('cqlengine', 'VERSION') ...
import os from cqlengine.columns import * from cqlengine.functions import * from cqlengine.models import Model from cqlengine.query import BatchQuery __cqlengine_version_path__ = os.path.realpath(__file__ + '/../VERSION') __version__ = open(__cqlengine_version_path__, 'r').readline().strip() # compaction SizeTieredC...
Python
0
5584ec8c6aa8e6567b3ddd286c1c7305fad070a3
fix init
cryptotik/__init__.py
cryptotik/__init__.py
from cryptotik.poloniex import Poloniex from cryptotik.bittrex import Bittrex from cryptotik.btce import Btce from cryptotik.therock import TheRock from cryptotik.livecoin import Livecoin from cryptotik.okcoin import OKcoin from cryptotik.hitbtc import Hitbtc
from cryptotik.poloniex import Poloniex from cryptotik.bittrex import Bittrex from cryptotik.btce import Btce from cryptotik.therock import TheRock from cryptotik.livecoin import Livecoin <<<<<<< HEAD from cryptotik.okcoin import OKcoin ======= from cryptotik.hitbtc import Hitbtc >>>>>>> 7e948ea7ab42a9ad57d9ec12595399...
Python
0.024288
35cc2bce4e5fb62083ec1a44bda85c2da064d119
Remove debug print statements
cs251tk/specs/load.py
cs251tk/specs/load.py
from logging import warning from glob import iglob import json import os import shutil from .cache import cache_specs from .dirs import get_specs_dir def load_all_specs(*, basedir=get_specs_dir()): os.makedirs(basedir, exist_ok=True) # the repo has a /specs folder basedir = os.path.join(basedir, 'specs'...
from logging import warning from glob import iglob import json import os import shutil import sys from .cache import cache_specs from .dirs import get_specs_dir def load_all_specs(*, basedir=get_specs_dir()): os.makedirs(basedir, exist_ok=True) # the repo has a /specs folder basedir = os.path.join(based...
Python
0.000003
096d3c44a60c83820410a85cd6a56f20b13b9ccd
更新 API Infor, 使用新格式改寫 users_total_count API 的回應
commonrepo/infor_api/views.py
commonrepo/infor_api/views.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from rest_framework import permissions from rest_framework import renderers from rest_framework import status from rest_framework import viewsets f...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from rest_framework import permissions from rest_framework import renderers from rest_framework import status from rest_framework import viewsets f...
Python
0
98e52a8c603346a03b2e5a6197ce2cb49af86f2c
Cut uselessness codes
complexism/multimodel/mmrt.py
complexism/multimodel/mmrt.py
import networkx as nx from complexism.misc.counter import count from complexism.mcore import * from .entries import RelationEntry __author__ = 'TimeWz667' __all__ = ['ObsMultiModel', 'MultiModel'] class ObsMultiModel(Observer): def __init__(self): Observer.__init__(self) self.ObservingModels = l...
import networkx as nx from complexism.misc.counter import count from complexism.mcore import * from .entries import RelationEntry __author__ = 'TimeWz667' __all__ = ['ObsMultiModel', 'MultiModel'] class ObsMultiModel(Observer): def __init__(self): Observer.__init__(self) self.ObservingModels = l...
Python
0
6e35e4f5af341bbcda050434d86fd7e4712ebd0f
Update JGit to get PackInserter fix
lib/jgit/jgit.bzl
lib/jgit/jgit.bzl
load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "MAVEN_CENTRAL", "maven_jar") _JGIT_VERS = "4.9.2.201712150930-r.3-g43ef5dabf" _DOC_VERS = "4.9.2.201712150930-r" # Set to _JGIT_VERS unless using a snapshot JGIT_DOC_URL = "http://download.eclipse.org/jgit/site/" + _DOC_VERS + "/apidocs" _JGIT_REPO = GERR...
load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "MAVEN_CENTRAL", "maven_jar") _JGIT_VERS = "4.9.2.201712150930-r" _DOC_VERS = _JGIT_VERS # Set to _JGIT_VERS unless using a snapshot JGIT_DOC_URL = "http://download.eclipse.org/jgit/site/" + _DOC_VERS + "/apidocs" _JGIT_REPO = MAVEN_CENTRAL # Leave here e...
Python
0
6a5729d566a6e75c97b67a544dd7aed9c857e6de
update attachment attributes
data_center/models.py
data_center/models.py
# -*- coding: utf-8 -*- from datetime import datetime from django.db import models from django.utils.http import urlquote attachment_url_format = 'https://www.ccxp.nthu.edu.tw/ccxp/INQUIRE/JH/output/6_6.1_6.1.12/%s.pdf' # noqa class Course(models.Model): """Course database schema""" no = models.CharField(m...
# -*- coding: utf-8 -*- from datetime import datetime from django.db import models class Course(models.Model): """Course database schema""" no = models.CharField(max_length=20, blank=True) code = models.CharField(max_length=20, blank=True) eng_title = models.CharField(max_length=200, blank=True) ...
Python
0.000001
00dec661c39437e2fd031328431ab59ca428aaf3
Fix deprecation warning regarding BaseException.message
linkedin/utils.py
linkedin/utils.py
# -*- coding: utf-8 -*- import requests from .exceptions import LinkedInError, get_exception_for_error_code try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: import simplejson as json except ImportError: try: from django.utils import simplejson as json ...
# -*- coding: utf-8 -*- import requests from .exceptions import LinkedInError, get_exception_for_error_code try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: import simplejson as json except ImportError: try: from django.utils import simplejson as json ...
Python
0.000013
7210d1d7840fb9190d616e1a59af6e9619f93835
Add VoiceCloseReasons
litecord/enums.py
litecord/enums.py
""" enums.py - Various Enums used by litecord """ class OP: """Gateway OP codes.""" DISPATCH = 0 HEARTBEAT = 1 IDENTIFY = 2 STATUS_UPDATE = 3 VOICE_STATE_UPDATE = 4 VOICE_SERVER_PING = 5 RESUME = 6 RECONNECT = 7 REQUEST_GUILD_MEMBERS = 8 INVALID_SESSION = 9 HELLO = 10 ...
""" enums.py - Various Enums used by litecord """ class OP: """Gateway OP codes.""" DISPATCH = 0 HEARTBEAT = 1 IDENTIFY = 2 STATUS_UPDATE = 3 VOICE_STATE_UPDATE = 4 VOICE_SERVER_PING = 5 RESUME = 6 RECONNECT = 7 REQUEST_GUILD_MEMBERS = 8 INVALID_SESSION = 9 HELLO = 10 ...
Python
0.000001
17028a6ae567e9d67dbaa99b86a956fefdd3e792
fix pynotify
livereload/app.py
livereload/app.py
import os import logging import tornado.web import tornado.options import tornado.ioloop from tornado import escape from tornado import websocket from tornado.util import ObjectDict from livereload.task import Task ROOT = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.join(ROOT, 'static') NOTIFIER ...
import os import logging import tornado.web import tornado.options import tornado.ioloop from tornado import escape from tornado import websocket from tornado.util import ObjectDict from livereload.task import Task ROOT = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.join(ROOT, 'static') NOTIFIER ...
Python
0.000031
004c9c11441f59590121a5428fce29ccde3f7694
Fix error with keyword argument
mesh_utils.py
mesh_utils.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # Booltron super add-on for super fast booleans. # Copyright (C) 2014-2019 Mikhail Rachinskiy # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eith...
# ##### BEGIN GPL LICENSE BLOCK ##### # # Booltron super add-on for super fast booleans. # Copyright (C) 2014-2019 Mikhail Rachinskiy # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eith...
Python
0.000017
36e8335bc146e4eda6801b2c148410c3ea620ae5
Update scipy.py
wigs/scipy.py
wigs/scipy.py
class scipy(PythonWig): tarball_uri = 'https://github.com/scipy/scipy/releases/download/v$RELEASE_VERSION$/scipy-$RELEASE_VERSION$.tar.gz' last_release_version = 'v0.18.1' git_uri = 'https://github.com/scipy/scipy' dependencies = ['numpy'] optional_dependencies = ['openblas'] supported_features = ['openblas'] d...
class scipy(PythonWig): tarball_uri = 'https://github.com/scipy/scipy/releases/download/v$RELEASE_VERSION$/scipy-$RELEASE_VERSION$.tar.gz' last_release_version = 'v0.18.1' git_uri = 'https://github.com/scipy/scipy' dependencies = ['numpy']
Python
0.000002
374c386a6b2dd1ad1ba75ba70009de6c7ee3c3fc
Add process_request method to Application
restalchemy/api/applications.py
restalchemy/api/applications.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2014 Eugene Frolov <eugene@frolov.net.ru> # # 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 # # ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2014 Eugene Frolov <eugene@frolov.net.ru> # # 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 # # ...
Python
0.000002
b7e8af6ef92c0244bd5121c528e3e85441b0d835
Disable test/mac/gyptest-objc-gc.py when using Xcode 5.1
test/mac/gyptest-objc-gc.py
test/mac/gyptest-objc-gc.py
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that GC objc settings are handled correctly. """ import TestGyp import TestMac import sys if sys.platform == 'darwin': # s...
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that GC objc settings are handled correctly. """ import TestGyp import sys if sys.platform == 'darwin': # set |match| to i...
Python
0.00004
da557b0b26d144095988a8809a97b83791077f20
fix number
biblioteca/views.py
biblioteca/views.py
from django.shortcuts import render from .models import Temas, Biblioteca from django.shortcuts import get_object_or_404 from django.db.models import Q # Create your views here. def index(request,template='biblioteca/index.html',slug=None): temas = Temas.objects.all() ultimas_guias = Biblioteca.objects.filter(tipo_d...
from django.shortcuts import render from .models import Temas, Biblioteca from django.shortcuts import get_object_or_404 from django.db.models import Q # Create your views here. def index(request,template='biblioteca/index.html',slug=None): temas = Temas.objects.all() ultimas_guias = Biblioteca.objects.filter(tipo_d...
Python
0.000047
1412c1a15f4b8b09beb4b7eb4b3245eaeb343a14
Bump sleep time for Github API reader
src/api_readers/github_daemon.py
src/api_readers/github_daemon.py
from api_reader_daemon import APIReaderDaemon import datetime import time from models import GithubRepo from models import GithubRepoEvent from github import Github class GithubReaderDaemon(APIReaderDaemon): def __init__(self, **kwargs): # neh. don't need it. pass def start(self): whi...
from api_reader_daemon import APIReaderDaemon import datetime import time from models import GithubRepo from models import GithubRepoEvent from github import Github class GithubReaderDaemon(APIReaderDaemon): def __init__(self, **kwargs): # neh. don't need it. pass def start(self): whi...
Python
0
d01430e40d923fdced0d753822a1f62fe69a916e
add analytics folder to path
bigbang/__init__.py
bigbang/__init__.py
from . import analysis
Python
0.000001
17147f02abdb50f6df6398c8c3c750d858c1c758
fix docs
doc/ext/nova_autodoc.py
doc/ext/nova_autodoc.py
import gettext import os gettext.install('nova') from nova import utils def setup(app): rootdir = os.path.abspath(app.srcdir + '/..') print "**Autodocumenting from %s" % rootdir os.chdir(rootdir) rv = utils.execute('./generate_autodoc_index.sh') print rv[0]
import gettext import os gettext.install('nova') from nova import utils def setup(app): rootdir = os.path.abspath(app.srcdir + '/..') print "**Autodocumenting from %s" % rootdir rv = utils.execute('cd %s && ./generate_autodoc_index.sh' % rootdir) print rv[0]
Python
0.000008
d72a1dde759e4993f7c75764fd36668192b387e5
Clean up middleware code
middleware.py
middleware.py
from mixcloud.speedbar.modules.base import RequestTrace from django.utils.encoding import smart_unicode, smart_str from django.utils.html import escapejs from django.core.urlresolvers import reverse from gargoyle import gargoyle import re HTML_TYPES = ('text/html', 'application/xhtml+xml') METRIC_PLACEHOLDER_RE = ...
from mixcloud.speedbar.modules.base import RequestTrace from django.utils.encoding import smart_unicode, smart_str from django.utils.html import escapejs from django.core.urlresolvers import reverse from gargoyle import gargoyle import re HTML_TYPES = ('text/html', 'application/xhtml+xml') METRIC_PLACEHOLDER_RE = ...
Python
0.001611
14a0293224e78875e74bfc6491017d6059aa07f5
Enhance PEP8
bin/tftpy_server.py
bin/tftpy_server.py
#!/usr/bin/env python # vim: ts=4 sw=4 et ai: # -*- coding: utf8 -*- import logging import sys from optparse import OptionParser import tftpy log = logging.getLogger('tftpy') log.setLevel(logging.INFO) # console handler handler = logging.StreamHandler() handler.setLevel(logging.DEBUG) default_formatter = logging.Fo...
#!/usr/bin/env python # vim: ts=4 sw=4 et ai: # -*- coding: utf8 -*- import logging import sys from optparse import OptionParser import tftpy log = logging.getLogger('tftpy') log.setLevel(logging.INFO) # console handler handler = logging.StreamHandler() handler.setLevel(logging.DEBUG) default_formatter = logging.Fo...
Python
0
dabbf0b5796a4d16bdd588e9d8c541c1f3c8559b
Support for building multiple images at once
src/ddocker/app/build.py
src/ddocker/app/build.py
""" """ import logging import pesos.scheduler import os import threading import time from pesos.vendor.mesos import mesos_pb2 from ddocker.app import subcommand from ddocker.app.scheduler import Scheduler from Queue import Queue logger = logging.getLogger("ddocker.build") def args(parser): parser.add_argument(...
""" """ import logging import pesos.scheduler import os import threading import time from pesos.vendor.mesos import mesos_pb2 from ddocker.app import subcommand from ddocker.app.scheduler import Scheduler from Queue import Queue logger = logging.getLogger("ddocker.build") def args(parser): parser.add_argument(...
Python
0
70445bd32ba08b9bd88726a7551345f71ae4e630
Improve logging, refactoring
executor/opensubmit/executor/execution.py
executor/opensubmit/executor/execution.py
''' Functions related to command execution on the local host. ''' from .result import Result, PassResult, FailResult import logging logger = logging.getLogger('opensubmit.executor') import os, sys, platform, subprocess, signal from threading import Timer def kill_longrunning(config): ''' Terminate ...
''' Functions related to command execution on the local host. ''' from .submission import Submission from .result import Result, PassResult, FailResult import logging logger = logging.getLogger('opensubmit.executor') import os, sys, platform, subprocess, signal from threading import Timer def kill_longrunning(...
Python
0.000002
f2eb527e7602472856f981726b91bb23bbf22a9e
Add URL decorator to dashboard app
stores/dashboard/app.py
stores/dashboard/app.py
from django.conf.urls.defaults import patterns, url from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.nav import register, Node from oscar.views.decorators import staff_member_required from stores.dashboard import views node = Node(_('St...
from django.conf.urls.defaults import patterns, url from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.nav import register, Node from stores.dashboard import views node = Node(_('Store Manager')) node.add_child(Node(_('Stores'), 'stores-d...
Python
0
fd2b4f1d536aec9e92a8b793eb2294c0a935bc35
add cb and co for pusher
btspusher/pusher.py
btspusher/pusher.py
# -*- coding: utf-8 -*- import asyncio from autobahn.asyncio.wamp import ApplicationSession from autobahn.wamp import auth from btspusher.wamp import ApplicationRunner class PusherComponent(ApplicationSession): future = None # a future from asyncio instance = None login_info = None cb = None co =...
# -*- coding: utf-8 -*- import asyncio from autobahn.asyncio.wamp import ApplicationSession from autobahn.wamp import auth from btspusher.wamp import ApplicationRunner class PusherComponent(ApplicationSession): future = None # a future from asyncio instance = None login_info = None @staticmethod ...
Python
0
4fe36d96d3810b39fcd15dee87318763d0d277a9
remove time
streamteam/io/nbody6.py
streamteam/io/nbody6.py
# coding: utf-8 """ Class for reading data from NBODY6 simulations """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os, sys import logging import re # Third-party import numpy as np import astropy.units as u from astropy.constants import G ...
# coding: utf-8 """ Class for reading data from NBODY6 simulations """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os, sys import logging import re # Third-party import numpy as np import astropy.units as u from astropy.constants import G ...
Python
0.99805
73fbfd435c849c0690121b0a3fc8545057247c8a
Fix command options issues
mistral_actions/client/shell.py
mistral_actions/client/shell.py
import sys from mistral_actions.client import actions as actions_cli import mistral_actions.utils as utils def do_clear(args): """Unregister all actions from Mistral.""" actions_cli.unregister_all() print("All actions are removed from Mistral successfully.") @utils.arg( '--override', dest='over...
import sys from mistral_actions.client import actions as actions_cli import mistral_actions.utils as utils def do_clear(args): """Unregister all actions from Mistral.""" actions_cli.unregister_all() print("All actions are removed from Mistral successfully.") @utils.arg( '--override', dest='over...
Python
0.000017
f846f58891e1389941f008e3f53c95ffd1b6558d
Update to add email functionality based on threshold checking.
dbtracker/__init__.py
dbtracker/__init__.py
import logging from dbtracker.cli import Cli import argparse def main(argv=None): parser = argparse.ArgumentParser( description="Queries MySQL and PostgreSQL for stats") parser.add_argument( "-S", "--save", action="store_true", help="generate and save database stats") parse...
import logging from dbtracker.cli import Cli import argparse def main(argv=None): parser = argparse.ArgumentParser( description="Queries MySQL and PostgreSQL for stats") parser.add_argument( "-S", "--save", action="store_true", help="generate and save database stats") parse...
Python
0
516844b2d34da22a4ad567ba25f900e1f747327c
exclude unversioned protos (#2672)
Logging/synth.py
Logging/synth.py
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
Python
0
838d8c8952f63464dfafaaeba3b16b681317c15e
add plot
tests/test_annotate.py
tests/test_annotate.py
import matplotlib.pyplot as plt import numpy as np def plot(): fig = plt.figure(1, figsize=(8, 5)) ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-4, 3)) t = np.arange(0.0, 5.0, 0.2) s = np.cos(2 * np.pi * t) ax.plot(t, s, color="blue") ax.annotate( "text", x...
import matplotlib.pyplot as plt import numpy as np def plot(): fig = plt.figure(1, figsize=(8, 5)) ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-4, 3)) t = np.arange(0.0, 5.0, 0.2) s = np.cos(2 * np.pi * t) ax.plot(t, s, color="blue") ax.annotate( "text", x...
Python
0.000094
8e10a62052f252c21c3898f70fc10d23c7261af0
Update urls.py
submify/submify/urls.py
submify/submify/urls.py
"""submify 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') Class-b...
"""submify 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') Class-ba...
Python
0.000002
cfb68d7e1146241b9783d82d09f7f813e658d4aa
fix doctests
tests/test_doctests.py
tests/test_doctests.py
# encoding: utf8 from quantiphy import Quantity import pytest import doctest import glob import sys def test_README(): if sys.version_info < (3, 6): # code used in doctests assumes python3.6 return Quantity.reset_prefs() rv = doctest.testfile('../README.rst', optionflags=doctest.ELLIPSIS)...
# encoding: utf8 from quantiphy import Quantity import pytest import doctest import glob import sys def test_README(): if sys.version_info < (3, 6): # code used in doctests assumes python3.6 return Quantity.reset_prefs() rv = doctest.testfile('../README.rst', optionflags=doctest.ELLIPSIS)...
Python
0.000001
72f7162b2a307297798dbeb866d54de5acfdeffb
correct input dimension comment
models/alexnet_14/alexNet_14.py
models/alexnet_14/alexNet_14.py
# The Model of DeepVO from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape from keras.layers.convolutional import Convolution2D, MaxPooling2D from keras.layers.normalization import BatchNormalization from keras import backend as K #enable tensorflow functions ...
# The Model of DeepVO from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape from keras.layers.convolutional import Convolution2D, MaxPooling2D from keras.layers.normalization import BatchNormalization from keras import backend as K #enable tensorflow functions ...
Python
0.000004