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
fca6289f6fe1e0e5605a7ea12a54395fe98d0425
Define rio tasks.
rio/tasks.py
rio/tasks.py
# -*- coding: utf-8 -*- """ rio.tasks ~~~~~~~~~~ Implement of rio tasks based on celery. """ from os import environ from celery import task from celery.task.http import URL from .core import celery def get_webhook(url, payload): return URL(url, app=celery, dispatcher=None).get_async(**payload) def post_webh...
# -*- coding: utf-8 -*- """ rio.tasks ~~~~~~~~~~ Implement of rio tasks based on celery. """ from os import environ from celery import Celery from .conf import configure_app def register_tasks(app): """Register tasks to application. """ pass def create_app(): """Celery application factory functio...
Python
0.000449
e5ef3e3899a7af05551c6d18b0c52adf5c067236
replace cleandir by shutil.rmtree
pp/samples/mask_pack/test_mask.py
pp/samples/mask_pack/test_mask.py
""" This is a sample on how to define custom components. You can make a repo out of this file, having one custom component per file """ import shutil from pathlib import Path import numpy as np import pp from pp.add_termination import add_gratings_and_loop_back from pp.component import Component from pp.components.sp...
""" This is a sample on how to define custom components. You can make a repo out of this file, having one custom component per file """ import os import shutil from pathlib import Path import numpy as np import pytest import pp from pp.add_termination import add_gratings_and_loop_back from pp.component import Compone...
Python
0.000491
2b995c68c980f1f38e1e6c6bb69ab88b78353cce
Update version.
pyhmsa/__init__.py
pyhmsa/__init__.py
#!/usr/bin/env python __author__ = "Philippe T. Pinard" __email__ = "philippe.pinard@gmail.com" __version__ = "0.1.6" __copyright__ = "Copyright (c) 2013-2014 Philippe T. Pinard" __license__ = "MIT" # This is required to create a namespace package. # A namespace package allows programs to be located in different dire...
#!/usr/bin/env python __author__ = "Philippe T. Pinard" __email__ = "philippe.pinard@gmail.com" __version__ = "0.1.5" __copyright__ = "Copyright (c) 2013-2014 Philippe T. Pinard" __license__ = "MIT" # This is required to create a namespace package. # A namespace package allows programs to be located in different dire...
Python
0
c46f46197589a89e98c8d5960d5c587a7c3dd6b0
delete load data part
train.py
train.py
import keras import cv2 from load import load_args from load import load_img if __name__ == '__main__': args = load_args() print args img = load_img(args.PATH)
import keras import cv2 from load import load_args if __name__ == '__main__': args = load_args() print args
Python
0
4c025819cb34939c7b97b145155ee89c8f0b2e93
add concept of entity in the askomics abstraction
askomics/libaskomics/integration/AbstractedEntity.py
askomics/libaskomics/integration/AbstractedEntity.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import logging import json from askomics.libaskomics.ParamManager import ParamManager from askomics.libaskomics.utils import pformat_generic_object class AbstractedEntity(object): """ An AbstractedEntity represents the classes of the database. It is defined...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import logging import json from askomics.libaskomics.ParamManager import ParamManager from askomics.libaskomics.utils import pformat_generic_object class AbstractedEntity(object): """ An AbstractedEntity represents the classes of the database. It is defined...
Python
0.998542
2b9d8dba5f421ad854574e9d1b7004578dd78346
Bump version to 4.1.1b2
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
Python
0
89a4d4dcf5533e2045d32282c3ad43c42d745a34
fix problem with wrong datatype
train.py
train.py
#!/usr/bin/env python # # (c) 2016 -- onwards Georgios Gousios <gousiosg@gmail.com> # import argparse import pickle import json from keras.models import Sequential from keras.layers import LSTM, Dense, Activation, Embedding, Bidirectional from keras.callbacks import CSVLogger, EarlyStopping, ModelCheckpoint, ReduceL...
#!/usr/bin/env python # # (c) 2016 -- onwards Georgios Gousios <gousiosg@gmail.com> # import argparse import pickle import json from keras.models import Sequential from keras.layers import LSTM, Dense, Activation, Embedding, Bidirectional from keras.callbacks import CSVLogger, EarlyStopping, ModelCheckpoint, ReduceL...
Python
0.000344
94756c1e7e6a164546b4808c8b8fb9db78e1990a
Update cluster_info.py
examples/cluster_info.py
examples/cluster_info.py
#! /usr/bin/env python from pythonlsf import lsf if lsf.lsb_init("test") > 0: exit(1) print '\n Hosts in cluster: ', lsf.get_host_names() print '\n Clustername: ', lsf.ls_getclustername(), '\n' print '{0:15s} {1:20s} {2:20s} {3:5s} {4:4s}'.format('Hostname', 'Type', ...
#!/usr/local/bin/python2.7 from pythonlsf import lsf print '\n Hosts in cluster: ', lsf.get_host_names() print '\n Clustername: ', lsf.ls_getclustername(), '\n' print '{0:15s} {1:20s} {2:20s} {3:5s} {4:4s}'.format('Hostname', 'Type', 'Model', 'Cores', 'Load') fo...
Python
0.000001
e187ab0f5285378a891552b7cecba0bad47395ab
upgrade plenum version to 1.6
plenum/__metadata__.py
plenum/__metadata__.py
""" plenum package metadata """ __title__ = 'indy-plenum' __version_info__ = (1, 6) __version__ = '.'.join(map(str, __version_info__)) __author__ = "Hyperledger" __author_email__ = 'hyperledger-indy@lists.hyperledger.org' __maintainer__ = 'Hyperledger' __maintainer_email__ = 'hyperledger-indy@lists.hyperledger.org' __...
""" plenum package metadata """ __title__ = 'indy-plenum' __version_info__ = (1, 5) __version__ = '.'.join(map(str, __version_info__)) __author__ = "Hyperledger" __author_email__ = 'hyperledger-indy@lists.hyperledger.org' __maintainer__ = 'Hyperledger' __maintainer_email__ = 'hyperledger-indy@lists.hyperledger.org' __...
Python
0
1a18445482c67b38810e330065e5ff04e772af4a
Fix from_email in IncomingLetter migrations
foundation/letters/migrations/0009_auto_20151216_0656.py
foundation/letters/migrations/0009_auto_20151216_0656.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def split_models(apps, schema_editor): # We can't import the Person model directly as it may be a newer # version than this migration expects. We use the historical version. L = apps.get_model("letter...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def split_models(apps, schema_editor): # We can't import the Person model directly as it may be a newer # version than this migration expects. We use the historical version. L = apps.get_model("letter...
Python
0
269b511d113b5b2029fe3cc18872cfa7fc4009fd
Add a feature: mortality rate
problem/covid/lag/lag.py
problem/covid/lag/lag.py
#! /usr/bin/env python # Copyright 2022 John Hanley. MIT licensed. from pathlib import Path from sklearn.ensemble import RandomForestRegressor import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import typer from problem.covid.us_cases_deaths import get_cases_and_deaths def ...
#! /usr/bin/env python # Copyright 2022 John Hanley. MIT licensed. from pathlib import Path from sklearn.ensemble import RandomForestRegressor from sklearn.linear_model import LinearRegression, SGDRegressor from sklearn.svm import LinearSVR from sklearn.tree import DecisionTreeRegressor import matplotlib.pyplot as plt...
Python
0.999998
11b293afd11b6d568644a559dff9299ec9dc916f
Add comments on current Timer abstraction
plenum/common/timer.py
plenum/common/timer.py
from abc import ABC, abstractmethod from functools import wraps from typing import Callable, NamedTuple import time from sortedcontainers import SortedListWithKey # TODO: Consider renaming this into Scheduler? class TimerService(ABC): @abstractmethod def get_current_time(self) -> float: pass @a...
from abc import ABC, abstractmethod from functools import wraps from typing import Callable, NamedTuple import time from sortedcontainers import SortedListWithKey class TimerService(ABC): @abstractmethod def get_current_time(self) -> float: pass @abstractmethod def schedule(self, delay: int...
Python
0
317c19b2d2767276a426a4d058191dbaaf8f4c6f
Extend the duration of the tough_filters_cases page set.
tools/perf/page_sets/tough_filters_cases.py
tools/perf/page_sets/tough_filters_cases.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class ToughFiltersCasesPage(page_module.Page): def ...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class ToughFiltersCasesPage(page_module.Page): def ...
Python
0.000035
bdddee22a4e710e580e105cf187ce77c59f09d31
enable auto parallel and non-uniform k-points
silicon-crystal/silicon-crystal.py
silicon-crystal/silicon-crystal.py
### ### GPAW benchmark: Silicon Crystal ### from __future__ import print_function from ase.lattice import bulk from gpaw import GPAW, Mixer, ConvergenceError from gpaw.eigensolvers.rmm_diis import RMM_DIIS from gpaw.mpi import size, rank try: from gpaw import use_mic except ImportError: use_mic = False # no. ...
### ### GPAW benchmark: Silicon Crystal ### from __future__ import print_function from ase.lattice import bulk from gpaw import GPAW, Mixer, ConvergenceError from gpaw.eigensolvers.rmm_diis import RMM_DIIS from gpaw.mpi import size, rank try: from gpaw import use_mic except ImportError: use_mic = False # no. ...
Python
0.000001
130d966f933983dc366a3023ac78a2ba24bf064c
add flag for data set binarization
train.py
train.py
""" Andrin Jenal, 2017 ETH Zurich """ import tensorflow as tf from dcgan import DCGAN import hdf5_dataset from checkpoint_saver import CheckpointSaver from visualizer import ImageVisualizer flags = tf.app.flags flags.DEFINE_string("dataset", "datasets/celeb_dataset_3k_colored.h5", "sample results dir") flags.DEFINE...
""" Andrin Jenal, 2017 ETH Zurich """ import tensorflow as tf from dcgan import DCGAN import hdf5_dataset from checkpoint_saver import CheckpointSaver from visualizer import ImageVisualizer flags = tf.app.flags flags.DEFINE_string("dataset", "datasets/celeb_dataset_3k_colored.h5", "sample results dir") flags.DEFINE...
Python
0
9933920ebc49b4e275ff93bd6d918945ee77e9a4
Make keepalive tests under macOS less stressful
cheroot/test/test_wsgi.py
cheroot/test/test_wsgi.py
"""Test wsgi.""" from concurrent.futures.thread import ThreadPoolExecutor import pytest import portend import requests from requests_toolbelt.sessions import BaseUrlSession as Session from jaraco.context import ExceptionTrap from cheroot import wsgi from cheroot._compat import IS_MACOS, IS_WINDOWS IS_SLOW_ENV = IS...
"""Test wsgi.""" from concurrent.futures.thread import ThreadPoolExecutor import pytest import portend import requests from requests_toolbelt.sessions import BaseUrlSession as Session from jaraco.context import ExceptionTrap from cheroot import wsgi @pytest.fixture def simple_wsgi_server(): """Fucking simple w...
Python
0.000013
32528fb029ec97cc0b195b80363556f69315f164
Condense code in Bishop
chess_py/pieces/bishop.py
chess_py/pieces/bishop.py
# -*- coding: utf-8 -*- """ Class stores Bishop on the board | rank | 7 8 ║♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜ | 6 7 ║♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟ | 5 6 ║… … … … … … … … | 4 5 ║… … … … … … … … | 3 4 ║… … … … … … … … | 2 3 ║… … … … … … … … | 1 2 ║♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙ | 0 1 ║♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖ | ----╚═══════════════ | ——---a b c d e f g h | -----0 1 2 3 4 5 6...
# -*- coding: utf-8 -*- """ Class stores Bishop on the board | rank | 7 8 ║♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜ | 6 7 ║♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟ | 5 6 ║… … … … … … … … | 4 5 ║… … … … … … … … | 3 4 ║… … … … … … … … | 2 3 ║… … … … … … … … | 1 2 ║♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙ | 0 1 ║♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖ | ----╚═══════════════ | ——---a b c d e f g h | -----0 1 2 3 4 5 6...
Python
0.999999
88327c5e0a7ba7af086ad461e20395a33215b96c
Update api.py
chris_backend/core/api.py
chris_backend/core/api.py
from django.conf.urls import url, include from rest_framework.urlpatterns import format_suffix_patterns from feeds import views # API v1 endpoints urlpatterns = format_suffix_patterns([ url(r'^v1/$', views.api_root), url(r'^v1/feeds/$', views.FeedList.as_view(), name='feed-list'), url(r'^v1/feeds/(?P<pk...
from django.conf.urls import url, include from rest_framework.urlpatterns import format_suffix_patterns from feeds import views # API v1 endpoints urlpatterns = format_suffix_patterns([ url(r'^v1/$', views.api_root), url(r'^v1/feeds/$', views.FeedList.as_view(), name='feed-list'), url(r'^v1/feeds/(?P<pk...
Python
0.000001
51fb4cc79ecba178b811a1a0bb403c91317a116e
allow kwargs in ASE atoms converter
pymatgen/io/ase.py
pymatgen/io/ase.py
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals, absolute_import """ This module provides conversion between the Atomic Simulation Environment Atoms object and pymatgen Structure objects. """ __author__ = ...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals, absolute_import """ This module provides conversion between the Atomic Simulation Environment Atoms object and pymatgen Structure objects. """ __author__ = ...
Python
0
8f17ee334a27917187d16b1416af505971909585
Enhance kernel PLS example
examples/kpls_example.py
examples/kpls_example.py
#!/usr/bin/python3 """An example of the use of non-linear kernel PLS regression on the output of a function z(x) = 4.26(exp (−x) − 4 exp (−2x) + 3 exp (−3x)) Reproduces figure 3 from "Overview and Recent Advances in Partial Least Squares" Roman Rosipal and Nicole Krämer SLSFS 2005, LNCS 3940, pp. 34–51, 2006 and figu...
#!/usr/bin/python3 """An example of the use of non-linear kernel PLS regression on the output of a function z(x) = 4.26(exp (−x) − 4 exp (−2x) + 3 exp (−3x)) Reproduces figure 3 from "Overview and Recent Advances in Partial Least Squares" Roman Rosipal and Nicole Krämer SLSFS 2005, LNCS 3940, pp. 34–51, 2006. """ # ...
Python
0
a775da72446d057af61503fed6bf85896a7a490d
Add missing quote
scripts/fixtures/radar_fixtures/cohorts.py
scripts/fixtures/radar_fixtures/cohorts.py
from radar.models.groups import Group, GROUP_TYPE from radar.pages import PAGE from radar_fixtures.utils import add COHORTS = [ { 'code': 'BONEITIS', 'name': 'Bone-itis', 'short_name': 'Bone-itis', 'pages': [ PAGE.PRIMARY_DIAGNOSIS, PAGE.DIAGNOSES, ...
from radar.models.groups import Group, GROUP_TYPE from radar.pages import PAGE from radar_fixtures.utils import add COHORTS = [ { 'code': 'BONEITIS', 'name': 'Bone-itis', 'short_name': 'Bone-itis', 'pages': [ PAGE.PRIMARY_DIAGNOSIS, PAGE.DIAGNOSES, ...
Python
0.000283
aad71ec87196381e66e801f62d7b7566c279f16a
Make sure that this view is named appropriately
project_template/urls/defaults.py
project_template/urls/defaults.py
from django.conf.urls.defaults import patterns, include, url from armstrong.core.arm_wells.views import QuerySetBackedWellView from armstrong.core.arm_sections.views import SimpleSectionView, SectionFeed from armstrong.apps.articles.models import Article from armstrong.apps.articles.views import ArticleFeed from django...
from django.conf.urls.defaults import patterns, include, url from armstrong.core.arm_wells.views import QuerySetBackedWellView from armstrong.core.arm_sections.views import SimpleSectionView, SectionFeed from armstrong.apps.articles.models import Article from armstrong.apps.articles.views import ArticleFeed from django...
Python
0.00001
6db9a65c7b734c7c421075cbae11b5b1df35980e
Remove RingBuffer TODO from midi_monitor example
examples/midi_monitor.py
examples/midi_monitor.py
#!/usr/bin/env python3 """JACK client that prints all received MIDI events.""" import jack import binascii client = jack.Client("MIDI-Monitor") port = client.midi_inports.register("input") @client.set_process_callback def process(frames): for offset, data in port.incoming_midi_events(): print("{0}: 0x{...
#!/usr/bin/env python3 """JACK client that prints all received MIDI events.""" import jack import binascii client = jack.Client("MIDI-Monitor") port = client.midi_inports.register("input") @client.set_process_callback def process(frames): for offset, data in port.incoming_midi_events(): # TODO: use rin...
Python
0
e47b7e5952d4001459aee5ba570a7cc6d4c10d43
Add import of the InvalidDirectoryValueError to the directory package's test file
tests/unit/directory/test_directory.py
tests/unit/directory/test_directory.py
"""Contains the unit tests for the inner directory package""" import unittest import os from classyfd import Directory, InvalidDirectoryValueError class TestDirectory(unittest.TestCase): def setUp(self): self.fake_path = os.path.abspath("hello-world-dir") return def test_create_directory...
"""Contains the unit tests for the inner directory package""" import unittest import os from classyfd import Directory class TestDirectory(unittest.TestCase): def setUp(self): self.fake_path = os.path.abspath("hello-world-dir") return def test_create_directory_object(self): d = D...
Python
0
f1ceb45a0b332db80c2a963195e81f4dc5a822dd
Remove before_build and after_build hook
pypaas/checkout.py
pypaas/checkout.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import copy import datetime import os import os.path import shutil import subprocess from configparser import ConfigParser from . import options class Checkout(object): def __init__(self, branch, commit, name): self.branch, self.commit, self.name = branch, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import copy import datetime import os import os.path import shutil import subprocess from configparser import ConfigParser from . import options class Checkout(object): def __init__(self, branch, commit, name): self.branch, self.commit, self.name = branch, ...
Python
0
91eddb82671842cfd1dd7aa58dc42d7ffd1d1550
call passed functions in get_function
tensorforce/util/config_util.py
tensorforce/util/config_util.py
# Copyright 2016 reinforce.io. 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 2016 reinforce.io. 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.000003
d6532c24675956c6dc093dd330be1b78d691994f
Build Test
rppy/rppy.py
rppy/rppy.py
# rppy - a geophysical library for Python # Copyright (C) 2015 Sean Matthew Contenti # # 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; either version 2 of the License, or # (a...
# rppy - a geophysical library for Python # Copyright (C) 2015 Sean Matthew Contenti # # 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; either version 2 of the License, or # (a...
Python
0.000001
7ab671fea7fda45be5994d85378bfb326eddd7fb
Fix invalid use of F() when creating user story
taiga/projects/occ/mixins.py
taiga/projects/occ/mixins.py
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
Python
0.000211
4b7b2727a35cfcb0117b0ba4571da9a0ea81824a
Remove old reimplementation of routes.
greenmine/base/routers.py
greenmine/base/routers.py
# -*- coding: utf-8 -*- from rest_framework import routers class DefaultRouter(routers.DefaultRouter): pass __all__ = ["DefaultRouter"]
# -*- coding: utf-8 -*- from rest_framework import routers # Special router for actions. actions_router = routers.Route(url=r'^{prefix}/{methodname}{trailing_slash}$', mapping={'{httpmethod}': '{methodname}'}, name='{basename}-{methodnamehyphen}', ...
Python
0
0e2c092ce3472bf26db7d3b836eb230cfb002656
fix method naming conflict
examples/sanic_peewee.py
examples/sanic_peewee.py
## You need the following additional packages for this example # aiopg # peewee_async # peewee ## sanic imports from sanic import Sanic from sanic.response import json ## peewee_async related imports import uvloop import peewee from peewee_async import Manager, PostgresqlDatabase # we instantiate a custom loop so ...
## You need the following additional packages for this example # aiopg # peewee_async # peewee ## sanic imports from sanic import Sanic from sanic.response import json ## peewee_async related imports import uvloop import peewee from peewee_async import Manager, PostgresqlDatabase # we instantiate a custom loop so ...
Python
0.000042
53e4a8a00d4b1c0bed0ae93bb48831b04f1fc12d
Exclude msaa on Mac bots Review URL: https://codereview.appspot.com/7055043
slave/skia_slave_scripts/run_gm.py
slave/skia_slave_scripts/run_gm.py
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Run the Skia GM executable. """ from utils import shell_utils from build_step import BuildStep import errno import os import s...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Run the Skia GM executable. """ from utils import shell_utils from build_step import BuildStep import errno import os import s...
Python
0.000023
ff68546c69b68c4f83eb843f3ecb5789358d2f32
enable category select plugin by default
searx/plugins/search_on_category_select.py
searx/plugins/search_on_category_select.py
''' searx is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. searx is distributed in the hope that it will be useful, but WITHOUT ANY WA...
''' searx is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. searx is distributed in the hope that it will be useful, but WITHOUT ANY WA...
Python
0
cf983ed1832699a85cacb2d33d8dcb2735df01cf
fix build for FilteredModelIteratorBuilder
corehq/apps/dump_reload/sql/filters.py
corehq/apps/dump_reload/sql/filters.py
from abc import ABCMeta, abstractmethod import six from django.db.models import Q from dimagi.utils.chunked import chunked class DomainFilter(six.with_metaclass(ABCMeta)): @abstractmethod def get_filters(self, domain_name): """Return a list of filters. Each filter will be applied to a queryset indep...
from abc import ABCMeta, abstractmethod import six from django.db.models import Q from dimagi.utils.chunked import chunked class DomainFilter(six.with_metaclass(ABCMeta)): @abstractmethod def get_filters(self, domain_name): """Return a list of filters. Each filter will be applied to a queryset indep...
Python
0
a55822e8a9e6b1433118d139358bf72efd073b13
Remove ambiguous funcs
bqx/abstract.py
bqx/abstract.py
class Comparable: """Abstract class of 'comparable' clauses. Please mind that 'comparable' is not about Python, but is about SQL. Inherit this to clarify that sub-classes can't be 'calculated' without explicit implementation. See implementations in parts.py. """ def __init__(self): pass...
class Comparable: """Abstract class of 'comparable' clauses. Please mind that 'comparable' is not about Python, but is about SQL. Inherit this to clarify that sub-classes can't be 'calculated' without explicit implementation. See implementations in parts.py. """ def __init__(self): pass...
Python
0.999999
e6a72c4987246e5c56863a7b98cdbe8be729a688
fix syntax errors
slider/templatetags/slider_tags.py
slider/templatetags/slider_tags.py
# -*- coding: utf-8 -*- from django import template from slider.models import SliderImage import random register = template.Library() def get_random_item(l,max=None): res= [] size = len(l) indexs = range(0,size) if max == None: max = size for i in range(0, max): index = random.cho...
# -*- coding: utf-8 -*- from django import template from slider.models import SliderImage import random register = template.Library() def get_random_item(l,max=None): res= [] size = len(l) indexs = range(0,size) if max = None: max = size for i in range(0: max): index = random.choi...
Python
0.000009
3bd59973df4a14c575e24c73e0629524daae6cad
Handle in feed_tools when language isn't specified
podcasts/feed_tools.py
podcasts/feed_tools.py
from bs4 import BeautifulSoup from dateutil import parser import feedparser from urllib.error import HTTPError from urllib.request import urlopen def get_podcast_data(feed_url): try: feed_request = urlopen(feed_url) except HTTPError as e: raise e feed_xml = feed_request.read() feed =...
from bs4 import BeautifulSoup from dateutil import parser import feedparser from urllib.error import HTTPError from urllib.request import urlopen def get_podcast_data(feed_url): try: feed_request = urlopen(feed_url) except HTTPError as e: raise e feed_xml = feed_request.read() feed =...
Python
0.000001
82b4ea673aefd73384eb442c1769211d55c74c14
Update test infrastructure
project/settings/test.py
project/settings/test.py
# Local from .base import * # Heroku ALLOWED_HOSTS = [ 'testserver', ] # Redis RQ_QUEUES['default']['ASYNC'] = False # Email EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # Cloudinary CLOUDINARY_URL = None MEDIA_URL = '/media/' DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStora...
# Local from .base import * # Heroku ALLOWED_HOSTS = [ 'testserver', ] # Redis RQ_QUEUES['default']['ASYNC'] = False # Email EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
Python
0.000001
e2ef73097ae220be4e52563e4e098aea228f82fa
rename polls hook
polls/wagtail_hooks.py
polls/wagtail_hooks.py
from django.conf.urls import url from polls.admin import QuestionsModelAdmin from polls.admin_views import QuestionResultsAdminView from polls.models import PollsIndexPage from wagtail.wagtailcore import hooks from wagtail.contrib.modeladmin.options import modeladmin_register from django.contrib.auth.models import User...
from django.conf.urls import url from polls.admin import QuestionsModelAdmin from polls.admin_views import QuestionResultsAdminView from polls.models import PollsIndexPage from wagtail.wagtailcore import hooks from wagtail.contrib.modeladmin.options import modeladmin_register from django.contrib.auth.models import User...
Python
0.000014
5fc16267239890acbf6c4d7ab4685c4a2f420360
allow empty domain in tests
corehq/form_processor/utils/general.py
corehq/form_processor/utils/general.py
from django.conf import settings from corehq.toggles import USE_SQL_BACKEND, NAMESPACE_DOMAIN, NEW_EXPORTS, TF_USES_SQLITE_BACKEND from dimagi.utils.logging import notify_exception def should_use_sql_backend(domain_name): from corehq.apps.domain.models import Domain if settings.UNIT_TESTING: return _...
from django.conf import settings from corehq.toggles import USE_SQL_BACKEND, NAMESPACE_DOMAIN, NEW_EXPORTS, TF_USES_SQLITE_BACKEND from dimagi.utils.logging import notify_exception def should_use_sql_backend(domain_name): from corehq.apps.domain.models import Domain if settings.UNIT_TESTING: return _...
Python
0.000001
ad73d9f8960eea834d1ff9fa73e3b79aa3445b8d
return errno to travis
run_tests.py
run_tests.py
#!/usr/bin/env python def interact(line, stdin, process): # print line pass import unittest import sys import os import subprocess import argparse import tmuxp.testsuite from tmuxp.util import tmux from tmuxp import t tmux_path = sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) if tmux_path not...
#!/usr/bin/env python def interact(line, stdin, process): # print line pass import unittest import sys import os import subprocess import argparse import tmuxp.testsuite from tmuxp.util import tmux from tmuxp import t tmux_path = sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) if tmux_path not...
Python
0.999999
a486d9bb6f498391997639b549b51b691490f4fa
Update settings.py
project_name/settings.py
project_name/settings.py
# -*- coding: utf-8 -*- import os from cartoview.settings import * PROJECT_NAME = "{{project_name}}" PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(PROJECT_DIR) # static settings section STATICFILES_DIRS += [os.path.join(PROJECT_DIR, "static"), ] MEDIA_ROOT = os.path.join(BASE_DIR,...
# -*- coding: utf-8 -*- import os from cartoview.settings import * PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(PROJECT_DIR) # static settings section STATICFILES_DIRS += [os.path.join(PROJECT_DIR, "static"), ] MEDIA_ROOT = os.path.join(BASE_DIR, "uploaded") MEDIA_URL = "/upload...
Python
0.000001
7deae8b534e3a0ce8a05804661ba2270ba549b61
Generate no_custom outputs in tests
run_tests.py
run_tests.py
import os import unittest from JSOV import generator class Run_Tests(unittest.TestCase): INPUT_JSON = "tests/input/sample.json" INPUT_TEMPLATE = "tests/input/template.jsov" OUTPUT_HTML = "tests/output/output.html" OUTPUT_CSS = "tests/output/style.css" GENERATED_DIR = "tests/generated/" GENERATED_HTML = "tests/...
import os import unittest from JSOV import generator class Run_Tests(unittest.TestCase): INPUT_JSON = "tests/input/sample.json" INPUT_TEMPLATE = "tests/input/template.jsov" OUTPUT_HTML = "tests/output/output.html" OUTPUT_CSS = "tests/output/style.css" GENERATED_DIR = "tests/generated/" GENERATED_HTML = "tests/...
Python
0.998531
01bb58dfe82c69763d699b4ad5c637eee9bb7d36
remove commit title
solvebio/resource/datasetcommit.py
solvebio/resource/datasetcommit.py
import time from .apiresource import ListableAPIResource from .apiresource import CreateableAPIResource from .apiresource import UpdateableAPIResource from .solveobject import convert_to_solve_object from .task import Task def follow_commits(task, sleep_seconds): """Utility used to wait for commits""" while ...
import time from .apiresource import ListableAPIResource from .apiresource import CreateableAPIResource from .apiresource import UpdateableAPIResource from .solveobject import convert_to_solve_object from .task import Task def follow_commits(task, sleep_seconds): """Utility used to wait for commits""" while ...
Python
0.012209
0a6e2be8c67265e37ff9600522ded4a861d165a2
Fix #54
cleverhans/utils_mnist.py
cleverhans/utils_mnist.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D f...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D f...
Python
0.000001
70b61dd599529009f9cf9631c9ae505dd210c23b
Fix flake8 issues with OtsuMultipleThreshold.py
tomviz/python/OtsuMultipleThreshold.py
tomviz/python/OtsuMultipleThreshold.py
def transform_scalars(dataset): """This filter performs semi-automatic multithresholding of a data set. Voxels are automatically classified into a chosen number of classes such that inter-class variance of the voxel values is minimized. The output is a label map with one label per voxel class. """ ...
def transform_scalars(dataset): """This filter performs semi-automatic multithresholding of a data set. Voxels are automatically classified into a chosen number of classes such that inter-class variance of the voxel values is minimized. The output is a label map with one label per voxel class. """ ...
Python
0
3e1f330236fdb0af692099f91ee3435d273a7bad
Fix import error "No module named six.moves" for plugin sanity job
tools/generate-tempest-plugins-list.py
tools/generate-tempest-plugins-list.py
#! /usr/bin/env python # Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. # # 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...
#! /usr/bin/env python # Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. # # 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...
Python
0.000005
9507516da333a42e0ab0def6741bbd8755a5b19f
Fix submodule imports before running tests.
run_tests.py
run_tests.py
#!/usr/bin/env python # Copyright 2011 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 ...
#!/usr/bin/env python # Copyright 2011 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 ...
Python
0
e065515362281039f459e5fa79292957f0435aa7
Fix copyright year
opentracing_instrumentation/client_hooks/_singleton.py
opentracing_instrumentation/client_hooks/_singleton.py
# Copyright (c) 2015,2018 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge,...
# Copyright (c) 2018 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
Python
0.999997
d896082b282d17616573de2bcca4b383420d1e7a
Fix a bad import (get_version)
python/__init__.py
python/__init__.py
# -*- coding: UTF-8 -*- # Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend # Import from itools from itools.core import get_version __version__ = get_version()
# -*- coding: UTF-8 -*- # Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend # Import from itools from itools.pkg import get_version __version__ = get_version()
Python
0.001665
b78ce84f2a36789fc0fbb6b184b5c8d8ebb23234
Clarify py.test arguments in run_test.py
run_tests.py
run_tests.py
#!/usr/bin/env python import sys import pytest if __name__ == '__main__': # show output results from every test function args = ['-v'] # show the message output for skipped and expected failure tests args.append('-rxs') # compute coverage stats for bluesky args.extend(['--cov', 'bluesky']) ...
#!/usr/bin/env python import sys import pytest if __name__ == '__main__': sys.exit(pytest.main())
Python
0.000015
b42112d6286b22db65cf71885d92f77a6fa91e06
update scribbler and table configs
twirl.py
twirl.py
#!/usr/bin/env python # Tai Sakuma <sakuma@cern.ch> import os, sys import argparse import ROOT import AlphaTwirl import Framework import Scribbler ROOT.gROOT.SetBatch(1) ##__________________________________________________________________|| parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", hel...
#!/usr/bin/env python # Tai Sakuma <sakuma@cern.ch> import os, sys import argparse import ROOT import AlphaTwirl import Framework import Scribbler ROOT.gROOT.SetBatch(1) ##__________________________________________________________________|| parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", hel...
Python
0
6b89fab7d7ac30a04bcac063a247b1e2a03b4ac7
Use get_rpc_transport instead of get_transport
barbican/queue/__init__.py
barbican/queue/__init__.py
# Copyright (c) 2013-2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
# Copyright (c) 2013-2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
Python
0.00005
d134e9c461af2c9b67673aa97fc15a302dcbc58c
Add comments
beetsplug/smartplaylist.py
beetsplug/smartplaylist.py
# This file is part of beets. # Copyright 2013, Dang Mai <contact@dangmai.net>. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the right...
from __future__ import print_function from beets.plugins import BeetsPlugin from beets import config, ui from beets.util import normpath, syspath import os database_changed = False library = None def update_playlists(lib): print("Updating smart playlists...") playlists = config['smartplaylist']['playlists']...
Python
0
d043eef098be68690b9d6cd5790b667cdb2d825b
Add comments about security issue
runserver.py
runserver.py
from wKRApp import app # 2 security flaws, need to sort out # 1. the key should be randomy generated # 2. the key should be set in a config file that is then imported in. app.secret_key = "my precious" app.run(debug=True)
from wKRApp import app app.secret_key = "my precious" # 2 security flaws, need to sort out app.run(debug=True)
Python
0
db4b77ee5be099cf0ac751956d010777e1ff6640
Add DefinitionNotFoundError
UM/Settings/SettingsError.py
UM/Settings/SettingsError.py
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. class SettingsError(Exception): pass class InvalidFileError(SettingsError): def __init__(self, path): super().__init__("File {0} is an invalid settings file".format(path)) class InvalidVersionError(Sett...
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. class SettingsError(Exception): pass class InvalidFileError(SettingsError): def __init__(self, path): super().__init__("File {0} is an invalid settings file".format(path)) class InvalidVersionError(Sett...
Python
0.000078
d1568f2420322a19041dbdde734964ea39e66943
content-length should be a string.
VMBackup/main/snapshotter.py
VMBackup/main/snapshotter.py
#!/usr/bin/env python # # VM Backup extension # # Copyright 2014 Microsoft Corporation # # 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/LICENS...
#!/usr/bin/env python # # VM Backup extension # # Copyright 2014 Microsoft Corporation # # 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...
Python
0.999987
cf439125f2350597f66796c89a088cd443ed77cd
Fix search results disappearing after they are viewed
igd_exporter/exporter.py
igd_exporter/exporter.py
import cgi import socket import urllib import wsgiref.util import prometheus_client from . import igd def wsgi_app(environ, start_response): ''' Base WSGI application that routes requests to other applications. ''' name = wsgiref.util.shift_path_info(environ) if name == '': return front(e...
import cgi import socket import urllib import wsgiref.util import prometheus_client from . import igd def wsgi_app(environ, start_response): ''' Base WSGI application that routes requests to other applications. ''' name = wsgiref.util.shift_path_info(environ) if name == '': return front(e...
Python
0
50d2bb0908ea3b45d1ab6da494953a88362a67d4
add value summary
save_func.py
save_func.py
import tensorflow as tf import time def add_train_var(): """ add all trainable variable to summary""" for var in tf.trainable_variables(): tf.histogram_summary(var.op.name, var) def add_loss(loss_scope = 'losses'): """ add all losses to summary """ for l in tf.get_collection(loss_scope): tf.scalar_summary(l.o...
import tensorflow as tf import time def add_train_var(): """ add all trainable variable to summary""" for var in tf.trainable_variables(): tf.histogram_summary(var.op.name, var) def add_loss(loss_scope = 'losses'): """ add all losses to summary """ for l in tf.get_collection(loss_scope): tf.scalar_summary(l.o...
Python
0.000001
191cd180e74b6854cddd64348b96dc20cbc8cbba
add dataset to base validator
jobrunner/validators.py
jobrunner/validators.py
import bmds import json import jsonschema base_schema = { 'type': 'object', 'properties': { 'bmds_version': { 'enum': list(bmds.VERSIONS.keys()) }, 'dataset_type': { 'enum': list(bmds.constants.DTYPES), }, 'datasets': { 'minItems': 1, ...
import bmds import json import jsonschema base_schema = { 'type': 'object', 'properties': { 'bmds_version': { 'enum': list(bmds.VERSIONS.keys()) }, 'dataset_type': { 'enum': list(bmds.constants.DTYPES), }, }, 'required': ['bmds_version', 'dataset...
Python
0.000001
1279b1c087e98717a6c0802c6a7aceca4a27a0b2
fix copyright header on test file
app/tests/base/tests_exception_handling.py
app/tests/base/tests_exception_handling.py
# Copyright 2014 rehabstudio. 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...
# Copyright 2014 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 ...
Python
0
d67249d0efb074ebcf5e5b20c5f21d92ffe81dae
Bump version to 0.1.7
openkongqi/__init__.py
openkongqi/__init__.py
# -*- coding: utf-8 -*- __version__ = '0.1.7' __author__ = "Stefan Berder" __contact__ = 'stefan@measureofqualty.com'
# -*- coding: utf-8 -*- __version__ = '0.1.6' __author__ = "Stefan Berder" __contact__ = 'stefan@measureofqualty.com'
Python
0.000001
e8cae50b026f9136b9b5afc35a92a74f33937205
Update 1482-maritime_boundary-buffered_land.py
integration-test/1482-maritime_boundary-buffered_land.py
integration-test/1482-maritime_boundary-buffered_land.py
from . import FixtureTest # Adds tests for OSM features (but not NE features) class MaritimeBoundary(FixtureTest): def test_usa_canada_country_boundary(self): # country boundary of USA and Canada self.load_fixtures([ 'https://www.openstreetmap.org/relation/148838', 'https:...
from . import FixtureTest # Adds tests for OSM features (but not NE features) class MaritimeBoundary(FixtureTest): def test_usa_canada_country_boundary(self): # country boundary of USA and Canada self.load_fixtures([ 'https://www.openstreetmap.org/relation/148838', 'https:...
Python
0
37b8ee356968efbc9d78d65ba7b31352b2b01ee2
Fix parameter file writing
workflows/common/python/runner_utils.py
workflows/common/python/runner_utils.py
import numpy as np import json, os try: basestring except NameError: basestring = str DATA_TYPES = {type(np.float16): 'f16', type(np.float32): 'f32', type(np.float64): 'f64'} def write_output(result, instance_directory): with open('{}/result.txt'.format(instance_directory), 'w') as f_out: f_out.write...
import numpy as np import json, os try: basestring except NameError: basestring = str DATA_TYPES = {type(np.float16): 'f16', type(np.float32): 'f32', type(np.float64): 'f64'} def write_output(result, instance_directory): with open('{}/result.txt'.format(instance_directory), 'w') as f_out: f_out.write...
Python
0.000004
c4aff416299f91b53f5dca1a76ed16c8a0d51a8f
fix some error by handle TypeError
unzip.py
unzip.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Last modified: 2011 Oct 21 10:49:20 AM CST # # LICENSE: # Copyright (c) 2010 Tzeng, Yi-Feng # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the So...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Last modified: 2010 Dec 15 06:43:11 PM CST # # LICENSE: # Copyright (c) 2010 Tzeng, Yi-Feng # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the...
Python
0
5cf2e157da810dfe9e0436f9e76f5f339444031a
Add doxygen to the linux bootstrap
cerbero/bootstrap/linux.py
cerbero/bootstrap/linux.py
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
Python
0.000001
92ce590174265c4ac6701a2d11fe65465ececcc6
Add deploy key uploading to the command line
doctr/__main__.py
doctr/__main__.py
""" doctr A tool to automatically deploy docs to GitHub pages from Travis CI. The doctr command is two commands in one. To use, first run doctr on your local machine. This will prompt for your GitHub credentials and the name of the repo you want to deploy docs for. This will generate a secure key, which you should ...
""" doctr A tool to automatically deploy docs to GitHub pages from Travis CI. The doctr command is two commands in one. To use, first run doctr on your local machine. This will prompt for your GitHub credentials and the name of the repo you want to deploy docs for. This will generate a secure key, which you should ...
Python
0.000001
0543774cffde0ad6eafe4bebc77df04c03027cf7
Remove container specific import from __init__.py (#14)
testcontainers/__init__.py
testcontainers/__init__.py
from testcontainers.core.generic import GenericContainer from testcontainers.core.waiting_utils import wait_container_is_ready, wait_for
from testcontainers.selenium import BrowserWebDriverContainer from testcontainers.mysql import MySqlContainer from testcontainers.postgres import PostgresContainer from testcontainers.oracle import OracleDbContainer from testcontainers.core.generic import GenericContainer from testcontainers.core.waiting_utils import w...
Python
0.000001
fef8eb920ccd24cade6430361f638eb46f609151
Replace deprecated get_all_field_names reference
organizations/utils.py
organizations/utils.py
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Ben Lopatin and contributors # 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 ...
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Ben Lopatin and contributors # 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 ...
Python
0.00001
05f782b7544c6639049e6c83d5f26d28189924a7
I think it time to 0.1.0
blog/__init__.py
blog/__init__.py
VERSION = (0, 1, 0) __version__ = ".".join(map(str, VERSION))
VERSION = (0, 1, 'pre') __version__ = ".".join(map(str, VERSION))
Python
0.999978
3c54116f4c31a7e7392bdd7fd8fdc6773621d9f6
fix bad fix of sync contrib-base branch :-P (#9088)
Utils/contribution_sync/sync_contrib_base.py
Utils/contribution_sync/sync_contrib_base.py
#!/usr/bin/env python3 import os import sys import urllib3 from github import Github, enable_console_debug_logging from github.Repository import Repository from typing import List urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) def get_master_commit_sha(repo: Repository) -> str: # noqa: E999 ...
#!/usr/bin/env python3 import os import sys import urllib3 from github import Github, enable_console_debug_logging from github.Repository import Repository from typing import List urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) def get_master_commit_sha(repo: Repository) -> str: # noqa: E999 ...
Python
0
48e4abf450b63eb61bef72fa9dcd0217641f3777
fix for review comments
acos_client/v30/nat.py
acos_client/v30/nat.py
# Copyright 2015, A10 Networks # # 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 agre...
# Copyright 2015, A10 Networks # # 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 agre...
Python
0
315c3bc1e2961dc9de5d77fed5d232f106e59968
improve a couple of comments
users.py
users.py
''' working with gitlab's users ''' from crud import Crud from utils import filter_dict import random class Users (Crud): def __init__(self): Crud.__init__(self, 'users', lambda x: x['username']) # generate random password rand_pass = lambda s, l = 10: ''.join(chr(random.randint(64, 122)) for x in xrange(l)) ...
''' working with gitlab's users ''' from crud import Crud from utils import filter_dict import random class Users (Crud): def __init__(self): Crud.__init__(self, 'users', lambda x: x['username']) # generate random password rand_pass = lambda s, l = 10: ''.join(chr(random.randint(64, 122)) for x in xrange(l)) ...
Python
0.001666
c63681e6fc3d5e336a13698a473f4aaf61fdb9b1
Remove width and x arguments until fixed positioning.
center_dmenu.py
center_dmenu.py
#!/usr/bin/env python2 # Copyright 2013 Ryan McGowan # # 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...
#!/usr/bin/env python2 # Copyright 2013 Ryan McGowan # # 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
999ae0c40a7a101672c735a552a7e79fcc6e9f96
Add desk_update url to admin urls
admin/common_auth/urls.py
admin/common_auth/urls.py
from __future__ import absolute_import from django.conf.urls import url from django.core.urlresolvers import reverse_lazy from django.contrib.auth.views import password_change, password_change_done from admin.common_auth import views urlpatterns = [ url(r'^login/?$', views.LoginView.as_view(), name='login'), ...
from __future__ import absolute_import from django.conf.urls import url from django.core.urlresolvers import reverse_lazy from django.contrib.auth.views import password_change, password_change_done from admin.common_auth import views urlpatterns = [ url(r'^login/?$', views.LoginView.as_view(), name='login'), ...
Python
0.000001
bce0c2853e6c7901280c9989893e6230ec29dbe4
Allow util.retry to return result of task coroutine
aiorchestra/core/utils.py
aiorchestra/core/utils.py
# Author: Denys Makogon # # 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 t...
# Author: Denys Makogon # # 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 t...
Python
0.000499
be812bc91fed48f679900732f5ee4cc3c9dc97a7
Use the default login for superuser.
devilry/project/common/default_urls.py
devilry/project/common/default_urls.py
from django.conf.urls import include from django.conf.urls import url from django.contrib import admin from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import HttpResponseBadRequest, HttpResponsePermanentRedirect from devilry.devilry_frontpage.views...
from django.conf.urls import include from django.conf.urls import url from django.contrib import admin from django.core.urlresolvers import reverse from django.http import HttpResponseBadRequest, HttpResponsePermanentRedirect from devilry.devilry_frontpage.views import frontpage admin.autodiscover() def redirecto_to...
Python
0
54c18ae0c6372922fbf108e4ad659fa81ec66284
Fix test on Win
tests/commands/pkg/test_exec.py
tests/commands/pkg/test_exec.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
Python
0.000001
ab13d8157090e452c1cffec2b917800cd9c5ed56
Fix whitespace problem and always replace window['title'] None, with empty string
py3status/modules/window_title.py
py3status/modules/window_title.py
# -*- coding: utf-8 -*- """ Display the current window title. Configuration parameters: cache_timeout: How often we refresh this module in seconds (default 0.5) format: display format for window_title (default '{title}') max_width: If width of title is greater, shrink it and add '...' (default 120)...
# -*- coding: utf-8 -*- """ Display the current window title. Configuration parameters: cache_timeout: How often we refresh this module in seconds (default 0.5) format: display format for window_title (default '{title}') max_width: If width of title is greater, shrink it and add '...' (default 120)...
Python
0.025603
252eeac29bd7f5c1237a0868059fab5577b401ac
Use total bytes values to calculate rates
checks.d/iis.py
checks.d/iis.py
''' Check the performance counters from IIS ''' from checks import AgentCheck class IIS(AgentCheck): METRICS = [ ('iis.uptime', 'gauge', 'ServiceUptime'), # Network ('iis.net.bytes_sent', 'rate', 'TotalBytesSent'), ('iis.net.bytes_rcvd', 'rate', 'TotalBytesReceived'), ('iis...
''' Check the performance counters from IIS ''' from checks import AgentCheck class IIS(AgentCheck): METRICS = [ ('iis.uptime', 'gauge', 'ServiceUptime'), # Network ('iis.net.bytes_sent', 'gauge', 'BytesSentPerSec'), ('iis.net.bytes_rcvd', 'gauge', 'BytesReceivedPerSec'), (...
Python
0.000001
efe2e46c36501afa6072e0bb984ee737caeaeb13
order APi is instant not a progress
chiphub/urls.py
chiphub/urls.py
"""chiphub URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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-bas...
"""chiphub URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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-bas...
Python
0.000001
39824268150fb5b9cb86c599dad81b18f7ef7142
Add the Award and AwardGrant models to the init set
pyforge/pyforge/model/__init__.py
pyforge/pyforge/model/__init__.py
# -*- coding: utf-8 -*- """The application's model objects""" from .session import ProjectSession from .project import Theme, Neighborhood, NeighborhoodFile, Project, ProjectFile, AppConfig, SearchConfig, ScheduledMessage from .discuss import Discussion, Thread, PostHistory, Post, Attachment from .artifact import Arti...
# -*- coding: utf-8 -*- """The application's model objects""" from .session import ProjectSession from .project import Theme, Neighborhood, NeighborhoodFile, Project, ProjectFile, AppConfig, SearchConfig, ScheduledMessage from .discuss import Discussion, Thread, PostHistory, Post, Attachment from .artifact import Arti...
Python
0
804402572ca664b7a1bd3ed21de277210fe5c74e
Use importlib instead of django.utils.importlib
src/decorator_include/__init__.py
src/decorator_include/__init__.py
""" A replacement for ``django.conf.urls.include`` that takes a decorator, or an iterable of view decorators as the first argument and applies them, in reverse order, to all views in the included urlconf. """ from __future__ import unicode_literals from builtins import object, str from django.core.exceptions import Im...
""" A replacement for ``django.conf.urls.include`` that takes a decorator, or an iterable of view decorators as the first argument and applies them, in reverse order, to all views in the included urlconf. """ from __future__ import unicode_literals from builtins import object, str from django.core.exceptions import Imp...
Python
0.000001
803368f1741a9558ea84092dc975c1a10f51fa79
Change url in dashboard administrador
administracion/urls.py
administracion/urls.py
from django.conf.urls import url from .views import admin_main_dashboard, admin_users_dashboard, \ admin_users_create, admin_users_edit, admin_users_edit_form, \ admin_users_delete_modal, admin_users_delete, list_studies app_name = 'administracion' # Urls en espanol urlpatterns =...
from django.conf.urls import url from .views import admin_main_dashboard, admin_users_dashboard, \ admin_users_create, admin_users_edit, admin_users_edit_form, \ admin_users_delete_modal, admin_users_delete, list_studies app_name = 'administracion' # Urls en espanol urlpatterns =...
Python
0.000001
b488b884cf802546a795b0084003a9200e0d646b
Implement update_cmd in cli
cibopath/cli.py
cibopath/cli.py
# -*- coding: utf-8 -*- import logging import click from cibopath import __version__ from cibopath.user_config import UserConfig from cibopath.log import create_logger from cibopath.scraper import load_templates from cibopath.templates import dump @click.group() @click.pass_context @click.option( '-v', '--verb...
# -*- coding: utf-8 -*- import logging import click from cibopath import __version__ from cibopath.user_config import UserConfig from cibopath.log import create_logger @click.group() @click.pass_context @click.option( '-v', '--verbose', is_flag=True, help='Print debug information' ) @click.option( '-c'...
Python
0.000001
30230a29ea8ee40121a83bb5a3203f80a296cf0e
Bump to v0.5.0
setup.py
setup.py
""" ---------------- Flask-Mustache ---------------- `Mustache`__ integration for Flask. __ http://mustache.github.com/ Flask-Mustache adds template helpers and context processors to assist Flask developers with integrating the Mustache library into their development process. """ from setuptools import setup se...
""" ---------------- Flask-Mustache ---------------- `Mustache`__ integration for Flask. __ http://mustache.github.com/ Flask-Mustache adds template helpers and context processors to assist Flask developers with integrating the Mustache library into their development process. """ from setuptools import setup se...
Python
0
f61c82152042197d03d49b3ba9a141d025edf1c9
Add cp.get_url test
tests/integration/modules/cp.py
tests/integration/modules/cp.py
# Import python libs import os # Import salt libs import integration class CPModuleTest(integration.ModuleCase): ''' Validate the test module ''' def test_get_file(self): ''' cp.get_file ''' tgt = os.path.join(integration.TMP, 'scene33') self.run_function( ...
# Import python libs import os # Import salt libs import integration class CPModuleTest(integration.ModuleCase): ''' Validate the test module ''' def test_get_file(self): ''' cp.get_file ''' tgt = os.path.join(integration.TMP, 'scene33') self.run_function( ...
Python
0.000001
5d9cea1b0cefaeb38dd86623e05144aa3b91ff9e
Update mangaChapterDownload.py
comic_dl/manga_eden/mangaChapterDownload.py
comic_dl/manga_eden/mangaChapterDownload.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import cloudscraper import requests import json import sys import os import globalFunctions class MangaChapterDownload(): def __init__(self, page_id, download_directory, **kwargs): self.page_id = str(page_id).strip() self.manga_name = str(kwargs.get("...
#!/usr/bin/env python # -*- coding: utf-8 -*- import cfscrape import requests import json import sys import os import globalFunctions class MangaChapterDownload(): def __init__(self, page_id, download_directory, **kwargs): self.page_id = str(page_id).strip() self.manga_name = str(kwargs.get("mang...
Python
0
b617b778d2e442d8e2ab6a2098f7799bfb83bf85
Bump version to 0.8.1
setup.py
setup.py
#!/usr/bin/env python """Setup ACAPI package.""" import os from setuptools import setup with open(os.path.join(os.path.dirname(__name__), "README.md")) as f: long_description = f.read() setup( name="acapi", version="0.8.1", description="Acquia Cloud API client.", long_description=long_descriptio...
#!/usr/bin/env python """Setup ACAPI package.""" import os from setuptools import setup with open(os.path.join(os.path.dirname(__name__), "README.md")) as f: long_description = f.read() setup( name="acapi", version="0.8.0", description="Acquia Cloud API client.", long_description=long_descriptio...
Python
0
c7db3806a57935921c733609a265e505654ab601
Add Korean language
Cura/util/resources.py
Cura/util/resources.py
#coding:utf8 """ Helper module to get easy access to the path where resources are stored. This is because the resource location is depended on the packaging method and OS """ __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License" import os import sys import glob import gettext ...
#coding:utf8 """ Helper module to get easy access to the path where resources are stored. This is because the resource location is depended on the packaging method and OS """ __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License" import os import sys import glob import gettext ...
Python
0.999998
d2b08f37fce58cd5fedabe17430dc172a8b0c7d7
fix broken setup :-(
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from coherence import __version__ packages = find_packages() packages.append('misc') setup( name="Coherence", version=__version__, description="""Coherence - DLNA/UPnP framework for the digital living""", long_description="""Coheren...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from coherence import __version__ setup( name="Coherence", version=__version__, description="""Coherence - DLNA/UPnP framework for the digital living""", long_description="""Coherence is a framework written in Python, providing a var...
Python
0
562f28a37d5187f1813545ca5a18f56b8a7d1e51
Linear interpolation
audio_to_img_to_audio/img_to_audio.py
audio_to_img_to_audio/img_to_audio.py
#!/usr/bin/env python import struct import sys import wave from PIL import Image width = None height = None sampleRate = 48000 duration = 3 frequency = 440.0 with Image.open(sys.argv[1]) as img: # convert image to 1-bit B&W image bw_image = img.convert() (width, height) = bw_image.size min_max = [] for w...
#!/usr/bin/env python import struct import sys import wave from PIL import Image width = None height = None sampleRate = 48000 duration = 3 frequency = 440.0 with Image.open(sys.argv[1]) as img: # convert image to 1-bit B&W image bw_image = img.convert() (width, height) = bw_image.size min_max = [] for w...
Python
0.999927
b5d679b7dd10f928d487a43ba5e233598eeb6dfa
Renamed daily_prepost_onset() to daily_rel2onset(). Housekeeping
utils.py
utils.py
import sys sys.path.append('/home/jwalker/dynamics/python/atmos-tools') sys.path.append('/home/jwalker/dynamics/python/atmos-read') import numpy as np import xray import matplotlib.pyplot as plt import collections import atmos as atm import merra # --------------------------------------------------------------------...
import sys sys.path.append('/home/jwalker/dynamics/python/atmos-tools') sys.path.append('/home/jwalker/dynamics/python/atmos-read') import numpy as np import xray import matplotlib.pyplot as plt import atmos as atm import merra # ---------------------------------------------------------------------- def daily_prepos...
Python
0.999999
697ac96146aa1996e9e50aeb89703a2bb8eb5219
update compact-couchdb management command
mygpo/maintenance/management/commands/compact-couchdb.py
mygpo/maintenance/management/commands/compact-couchdb.py
import sys from datetime import datetime from time import sleep from urlparse import urlparse from couchdbkit import Database from restkit import BasicAuth from django.core.management.base import BaseCommand from django.conf import settings from mygpo.decorators import repeat_on_conflict from mygpo.core.models import...
import sys from datetime import datetime from time import sleep from couchdbkit import Database from django.core.management.base import BaseCommand from django.conf import settings from mygpo.decorators import repeat_on_conflict from mygpo.core.models import SanitizingRule from mygpo.utils import progress class Co...
Python
0
ff8b7ddbea7980c8464957880a1ae07afed49c64
Update antibody_lot.py
src/encoded/audit/antibody_lot.py
src/encoded/audit/antibody_lot.py
from ..auditor import ( AuditFailure, audit_checker, ) @audit_checker('antibody_lot') def audit_antibody_lot_target(value, system): ''' Antibody lots should not have associated characterizations for different target labels ''' if value['status'] in ['not pursued', 'deleted']: retur...
from ..auditor import ( AuditFailure, audit_checker, ) @audit_checker('antibody_lot') def audit_antibody_lot_target(value, system): ''' Antibody lots should not have associated characterizations for different target labels ''' if value['status'] in ['not pursued', 'deleted']: retur...
Python
0
9cd0098b4e353cfaaa0723ac28a797d7400188b4
Use jasperpath in brain.py
client/brain.py
client/brain.py
# -*- coding: utf-8-*- import logging import os import pkgutil import importlib import jasperpath def logError(): logger = logging.getLogger('jasper') fh = logging.FileHandler('jasper.log') fh.setLevel(logging.WARNING) formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') fh.setFo...
# -*- coding: utf-8-*- import logging import os import pkgutil import importlib def logError(): logger = logging.getLogger('jasper') fh = logging.FileHandler('jasper.log') fh.setLevel(logging.WARNING) formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') fh.setFormatter(formatter)...
Python
0.000003
b0dd91b60c95b6a22f12b785e6cd686d97c2c689
Clean log configuration after cache_gc tests.
tests/cache_gc_unittest.py
tests/cache_gc_unittest.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010-2011, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # only, as published by the Free Software Foundation. # # OpenQuak...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010-2011, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # only, as published by the Free Software Foundation. # # OpenQuak...
Python
0.000056
763689a72d9453813a8be25f568cce11ba119a2a
Remove old settings from tests module
aldryn_search/tests.py
aldryn_search/tests.py
from django.template import Template from django.test import TestCase from cms.api import create_page, add_plugin from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cms.models.placeholdermodel import Placeholder from cms.models import CMSPlugin from aldryn_search.search_indexes imp...
from django.template import Template from django.test import TestCase from django.test.utils import override_settings from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cms.models.placeholdermodel import Placeholder from cms.models import CMSPlugin from aldryn_search.search_indexes...
Python
0.000001
bff7cf3d3cc2b636fb46a37b1edb60f7935e646e
Update consultants model
radar/radar/models/consultants.py
radar/radar/models/consultants.py
from sqlalchemy import Integer, Column, String from sqlalchemy.orm import relationship from radar.database import db class Consultant(db.Model): __tablename__ = 'consultants' id = Column(Integer, primary_key=True) title = Column(String, nullable=False) first_name = Column(String, nullable=False) ...
from sqlalchemy import Integer, Column, String from sqlalchemy.orm import relationship from radar.database import db class Consultant(db.Model): __tablename__ = 'consultants' id = Column(Integer, primary_key=True) first_name = Column(String, nullable=False) last_name = Column(String, nullable=False)...
Python
0
c26dc22512e9b36a497930df544891cd0d96310b
Remove useless function
utils.py
utils.py
import string import random from werkzeug.security import generate_password_hash, check_password_hash from flask import current_app as app, url_for, redirect, session from functools import wraps def hash_password(s): return generate_password_hash(s) def check_password(hashed_password, try_password): return ch...
import string import random from werkzeug.security import generate_password_hash, check_password_hash from flask import current_app as app, url_for, redirect, session from functools import wraps def hash_password(s): return generate_password_hash(s) def check_password(hashed_password, try_password): return ch...
Python
0.000904
3450712ec629c1720b6a6af28835d95a91b8fce7
Use classifiers to specify the license.
setup.py
setup.py
#!/usr/bin/python import os import re from setuptools import setup from m2r import parse_from_file import restructuredtext_lint # Parser README.md into reStructuredText format rst_readme = parse_from_file('README.md') # Validate the README, checking for errors errors = restructuredtext_lint.lint(rst_readme) # Raise ...
#!/usr/bin/python import os import re from setuptools import setup from m2r import parse_from_file import restructuredtext_lint # Parser README.md into reStructuredText format rst_readme = parse_from_file('README.md') # Validate the README, checking for errors errors = restructuredtext_lint.lint(rst_readme) # Raise ...
Python
0