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
896482b83ad75c445e72dbb0eb6bc7246662f699
access token is adjusted
skybotapp/views.py
skybotapp/views.py
import json import requests from pprint import pprint from django.shortcuts import render from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt # yomamabot/fb_yomamabot/views.py from django.views import generic from django.http.response import HttpResponse from djang...
import json import requests from pprint import pprint from django.shortcuts import render from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt # yomamabot/fb_yomamabot/views.py from django.views import generic from django.http.response import HttpResponse from djang...
Python
0.000003
06fa3a4625576a0d7d4897dabcc2979c36d62ce1
Remove unused code
dwarf/image/api_response.py
dwarf/image/api_response.py
#!/usr/bin/env python # # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://...
#!/usr/bin/env python # # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://...
Python
0
1334c8fa989981e3c917cdc16869b04ad1c2f6e0
add --g-fatal-warnings gtk option
snaked/core/run.py
snaked/core/run.py
from optparse import OptionParser import os def get_manager(): parser = OptionParser() parser.add_option('-s', '--session', dest='session', help="Open snaked with specified session", default='default') parser.add_option('', '--select-session', action="store_true", dest='select_session', hel...
from optparse import OptionParser import os def get_manager(): parser = OptionParser() parser.add_option('-s', '--session', dest='session', help="Open snaked with specified session", default='default') parser.add_option('', '--select-session', action="store_true", dest='select_session', hel...
Python
0.000001
6670fe1d081e27417a3d340e2c12c061078582af
Bump version (pre-release)
django_xhtml2pdf/__init__.py
django_xhtml2pdf/__init__.py
# -*- coding: utf-8 -*- """ See PEP 386 (http://www.python.org/dev/peps/pep-0386/) Release logic: 1. Remove "dev" from current. 2. git commit 3. git tag <version> 4. push to pypi + push to github 5. bump the version, append '.dev0' 6. git commit 7. push to github (to avoid confusion) """ __version__ = '0.0.3'
# -*- coding: utf-8 -*- """ See PEP 386 (http://www.python.org/dev/peps/pep-0386/) Release logic: 1. Remove "dev" from current. 2. git commit 3. git tag <version> 4. push to pypi + push to github 5. bump the version, append '.dev0' 6. git commit 7. push to github (to avoid confusion) """ __version__ = '0.0.3.dev0'
Python
0
94d18ba6ede9dc58a558c68fd3af9bbcadc7f189
Update urls.py For Django 1.6
djangobb_forum/tests/urls.py
djangobb_forum/tests/urls.py
from django.conf.urls import patterns, include urlpatterns = patterns('', (r'^forum/', include('djangobb_forum.urls', namespace='djangobb')), )
from django.conf.urls.defaults import patterns, include urlpatterns = patterns('', (r'^forum/', include('djangobb_forum.urls', namespace='djangobb')), )
Python
0.000001
bdceb4c7bc0b71755d9f63974a5597e29fd94e75
comment test code
tester.py
tester.py
import urllib2 from socket import p import settings import random import threading import Queue import json import requests from settings import USER_AGENTS def makeRequest(proxy, target): i_headers = {'User-Agent': random.choice(USER_AGENTS)} print("\n") try: r = requests.get(target, proxies=proxy, headers=i_he...
import urllib2 from socket import p import settings import random import threading import Queue import json import requests from settings import USER_AGENTS def makeRequest(proxy, target): i_headers = {'User-Agent': random.choice(USER_AGENTS)} print("\n") try: r = requests.get(target, proxies=proxy, headers=i_he...
Python
0
c6cde6a72204a9e688ea0d6dfe9550f2cb39a0fc
resolve incorrect merge conflict resolution
common/lib/xmodule/xmodule/modulestore/tests/test_xml.py
common/lib/xmodule/xmodule/modulestore/tests/test_xml.py
import os.path from nose.tools import assert_raises, assert_equals from xmodule.course_module import CourseDescriptor from xmodule.modulestore.xml import XMLModuleStore from xmodule.modulestore import XML_MODULESTORE_TYPE from .test_modulestore import check_path_to_location from xmodule.tests import DATA_DIR class...
import os.path from nose.tools import assert_raises, assert_equals from xmodule.course_module import CourseDescriptor from xmodule.modulestore.xml import XMLModuleStore from xmodule.modulestore import XML_MODULESTORE_TYPE from .test_modulestore import check_path_to_location from . import DATA_DIR class TestXMLModu...
Python
0.000005
c79ccb44edbca1ccc5d5b1bddb4fa8dc19e6df66
update middleware for django 1.10 issue
chapter6/growth_studio/settings.py
chapter6/growth_studio/settings.py
""" Django settings for growth_studio project. Generated by 'django-admin startproject' using Django 1.10.2. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ imp...
""" Django settings for growth_studio project. Generated by 'django-admin startproject' using Django 1.10.2. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ imp...
Python
0
2b3667dfc4fbd6571da288146d4e8f8f8f2d51a1
Fix broken sorted set unit test.
test/unit/test_sorted_set.py
test/unit/test_sorted_set.py
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import pytest from clique.sorted_set import SortedSet @pytest.fixture def standard_set(request): '''Return sorted set.''' return SortedSet([4, 5, 6, 7, 2, 1, 1]) @pytest.mark.parametrize(('item', 'expec...
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import pytest from clique.sorted_set import SortedSet @pytest.fixture def standard_set(request): '''Return sorted set.''' return SortedSet([4, 5, 6, 7, 2, 1, 1]) @pytest.mark.parametrize(('item', 'expec...
Python
0
656e41ef504d42d2fcf0155aaedccc45c9d72c33
Add the null handler to the root logger to prevent Tornado from doing logging.basicConfig
rejected/controller.py
rejected/controller.py
""" OS Level controlling class invokes startup, shutdown and handles signals. """ import clihelper import logging import signal import sys from rejected import common from rejected import mcp from rejected import __version__ LOGGER = logging.getLogger(__name__) class Controller(clihelper.Controller): """Reject...
""" OS Level controlling class invokes startup, shutdown and handles signals. """ import clihelper import logging import signal import sys from rejected import mcp from rejected import __version__ LOGGER = logging.getLogger(__name__) class Controller(clihelper.Controller): """Rejected Controller application th...
Python
0.000001
db0e6265892231ecf10244eb7ddcddc62a12b82b
Fix bug where cached items in subfolders would be re-read.
configmanager.py
configmanager.py
import json import os import os.path class ConfigManager(): _cache = {} def __init__(self, configPath = "configs/"): if os.path.isdir(configPath): self.configPath = configPath else: raise IOError("Config Path does not eixst") self._configs = {} self._syncCache() self.getConfigs() def __getitem__(se...
import json import os import os.path class ConfigManager(): _cache = {} def __init__(self, configPath = "configs/"): if os.path.isdir(configPath): self.configPath = configPath else: raise IOError("Config Path does not eixst") self._configs = {} self._syncCache() self.getConfigs() def __getitem__(se...
Python
0
109a07b8344df9c2420c2cea7f9bd6419284c920
Fix get_employees_with_number query
erpnext/communication/doctype/call_log/call_log.py
erpnext/communication/doctype/call_log/call_log.py
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document from erpnext.crm.doctype.utils import get_scheduled_employ...
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document from erpnext.crm.doctype.utils import get_scheduled_employ...
Python
0.000003
17af071faa70d3dc4a884f62fb50f34e8621ac6d
Update watchman/constants.py
watchman/constants.py
watchman/constants.py
DEFAULT_CHECKS = ( 'watchman.checks.caches', 'watchman.checks.databases', 'watchman.checks.storage', ) PAID_CHECKS = ( 'watchman.checks.email', )
DEFAULT_CHECKS = ( 'watchman.checks.caches', 'watchman.checks.databases', 'watchman.checks.storage', ) PAID_CHECKS = ( 'watchman.checks.email', )
Python
0
6fedc3e826220f69ffd503b7c73e02962cfc1752
use cp.testing.assert_array_equal
examples/gemm/sgemm.py
examples/gemm/sgemm.py
from __future__ import division import argparse import math import cupy as cp import numpy as np from utils import benchmark from utils import load_kernel from utils import read_code sgemm_file = 'sgemm.cu' def sgemm(A, B, dim_x=16, dim_y=16, blk_m=64, blk_n=64, blk_k=4, dim_xa=64, dim_ya=4, ...
from __future__ import division import argparse import math import cupy as cp import numpy as np from utils import benchmark from utils import load_kernel from utils import read_code sgemm_file = 'sgemm.cu' def sgemm(A, B, dim_x=16, dim_y=16, blk_m=64, blk_n=64, blk_k=4, dim_xa=64, dim_ya=4, ...
Python
0.000337
e1a7e4535e64c005fb508ba6d3fed021bbd40a62
Update only tables in visible schemas
oedb_datamodels/versions/1a73867b1e79_add_meta_search.py
oedb_datamodels/versions/1a73867b1e79_add_meta_search.py
"""Add meta_search table Revision ID: 1a73867b1e79 Revises: 1c6e2fb3d3b6 Create Date: 2019-04-29 11:47:04.783168 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql from sqlalchemy.orm.session import sessionmaker from api.actions import update_meta_search from dataedit.views...
"""Add meta_search table Revision ID: 1a73867b1e79 Revises: 1c6e2fb3d3b6 Create Date: 2019-04-29 11:47:04.783168 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql from sqlalchemy.orm.session import sessionmaker from api.actions import update_meta_search # revision identif...
Python
0
f1fec3790fee11ff3d83c272e3a2aa7bb548ddfa
Remove print
open_spiel/python/algorithms/expected_game_score_test.py
open_spiel/python/algorithms/expected_game_score_test.py
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
Python
0.000016
fa52bbde01f62bb0816e71970ac50761947afa72
Improve comment
retaining_wall.py
retaining_wall.py
class RetainingWallSolver(object): def retaining_wall(self, wood_lengths, required_lengths): self.required_lengths = required_lengths return self.retaining_wall_recursive(wood_lengths, len(required_lengths) - 1) def retaining_wall_recursive(self, wood_lengths, required_length_idx): if r...
class RetainingWallSolver(object): def retaining_wall(self, wood_lengths, required_lengths): self.required_lengths = required_lengths return self.retaining_wall_recursive(wood_lengths, len(required_lengths) - 1) def retaining_wall_recursive(self, wood_lengths, required_length_idx): if r...
Python
0
b4a9380c73dd367c2cf6249cdf4cdbbdfdbc7907
fix example
examples/pythonnews.py
examples/pythonnews.py
""" Extract python news from python.org """ import re import logging from pomp.core.base import BaseCrawler, BasePipeline from pomp.core.item import Item, Field from pomp.contrib import SimpleDownloader logging.basicConfig(level=logging.DEBUG) news_re = re.compile(r'<h2 class="news">(.*?)</h2>([\s\S]*?)<div class="pu...
""" Extract python news from python.org """ import re import logging from pomp.core.base import BaseCrawler, BasePipeline from pomp.core.item import Item, Field from pomp.contrib import SimpleDownloader logging.basicConfig(level=logging.DEBUG) news_re = re.compile(r'<h2 class="news">(.*?)</h2>([\s\S]*?)<div class="pu...
Python
0.0001
e3c42442f090b8b6982f7ff8c93632c43cfa80b3
use insights landing for offseason
tba_config.py
tba_config.py
import os DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev') MAX_YEAR = 2015 # For choosing what the main landing page displays KICKOFF = 1 BUILDSEASON = 2 COMPETITIONSEASON = 3 OFFSEASON = 4 INSIGHTS = 5 CHAMPS = 6 # The CONFIG variables should have exactly the same structure between environments # Ev...
import os DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev') MAX_YEAR = 2015 # For choosing what the main landing page displays KICKOFF = 1 BUILDSEASON = 2 COMPETITIONSEASON = 3 OFFSEASON = 4 INSIGHTS = 5 CHAMPS = 6 # The CONFIG variables should have exactly the same structure between environments # Ev...
Python
0
b860d7cb81488f5ebbe7e9e356a6d4f140c33df5
update to follow python 2to3 changes
tests/__init__.py
tests/__init__.py
from .test_home import * from .test_feed import * from .test_shownote import * from .test_agenda import * from .test_episode import *
from test_home import * from test_feed import * from test_shownote import * from test_agenda import * from test_episode import *
Python
0
d77256d1964354eb7dd178f383dd3254c3b4d975
Fix source docs page
docs/_helpers/source_page.py
docs/_helpers/source_page.py
"""Generate a restructured text document that describes built-in sources and save it to this module's docstring for the purpose of including in sphinx documentation via the automodule directive.""" import string from sncosmo.models import _SOURCES lines = [ '', ' '.join([30*'=', 7*'=', 10*'=', 27*'=', 30*'...
"""Generate a restructured text document that describes built-in sources and save it to this module's docstring for the purpose of including in sphinx documentation via the automodule directive.""" import string from sncosmo.models import _SOURCES lines = [ '', ' '.join([20*'=', 7*'=', 10*'=', 27*'=', 30*'...
Python
0.000001
5f5a7ec9460d60a964663ace670529813a41a9d9
Update bluetooth_ping_test.py
tests/bluetooth_ping_test.py
tests/bluetooth_ping_test.py
#!/usr/bin/env python import os import subprocess as subp from subprocess import * from avocado import Test #I have used my Samsung Galaxy S7 Edge as target device class WifiScanAP(Test): def test(): targetDeviceMac = '8C:1A:BF:0D:31:A9' bluetoothChannel = '2' port = 1 print("Bluetooth pi...
#!/usr/bin/env python import os import subprocess as subp from subprocess import * from avocado import Test class WifiScanAP(Test): def test(): targetDeviceMac = '8C:1A:BF:0D:31:A9' bluetoothChannel = '2' port = 1 print("Bluetooth ping test: testing " + targetDeviceMac) p = subp.Pope...
Python
0.000002
9cc45f750c0860715e66c085895611984531c48c
update standalone disclosure url
paying_for_college/config/urls.py
paying_for_college/config/urls.py
from django.conf.urls import url, include from django.conf import settings from paying_for_college.views import LandingView, StandAloneView from django.contrib import admin from django.conf import settings try: STANDALONE = settings.STANDALONE except AttributeError: # pragma: no cover STANDALONE = False urlp...
from django.conf.urls import url, include from django.conf import settings from paying_for_college.views import LandingView, StandAloneView from django.contrib import admin from django.conf import settings try: STANDALONE = settings.STANDALONE except AttributeError: # pragma: no cover STANDALONE = False urlp...
Python
0
43b4910e004e7096addb3d50e8a0a6c307a669c6
Remove dead get_body_parameter_name_override
lepo/apidef/operation/openapi.py
lepo/apidef/operation/openapi.py
from lepo.apidef.operation.base import Operation from lepo.apidef.parameter.openapi import OpenAPI3BodyParameter, OpenAPI3Parameter from lepo.utils import maybe_resolve class OpenAPI3Operation(Operation): parameter_class = OpenAPI3Parameter body_parameter_class = OpenAPI3BodyParameter def _get_body_param...
from lepo.apidef.operation.base import Operation from lepo.apidef.parameter.openapi import OpenAPI3BodyParameter, OpenAPI3Parameter from lepo.utils import maybe_resolve class OpenAPI3Operation(Operation): parameter_class = OpenAPI3Parameter body_parameter_class = OpenAPI3BodyParameter def _get_body_param...
Python
0.000064
b5a6d540f5fdef37b1d58fc45921737e3c77ae96
fix user autocomplete
let_me_app/views/autocomplete.py
let_me_app/views/autocomplete.py
from dal import autocomplete from slugify import slugify from let_me_auth.models import User from let_me_app.models import Equipment, StaffRole from let_me_auth.social.pipeline import ABSENT_MAIL_HOST import re class UserAutocomplete(autocomplete.Select2QuerySetView): create_field = 'username' def create_ob...
from dal import autocomplete from slugify import slugify from let_me_auth.models import User from let_me_app.models import Equipment, StaffRole class UserAutocomplete(autocomplete.Select2QuerySetView): def get_queryset(self): # Don't forget to filter out results depending on the visitor ! if not ...
Python
0.000066
060576768e02c0499282770dd22e35048d62b12e
Improve clarity of session finish function
tests/conftest.py
tests/conftest.py
from __future__ import print_function import os import boto import pytest from boto.s3.key import Key as S3Key from boto.exception import NoAuthHandlerFound from os.path import join s3_bucket = "bokeh-travis" s3 = "https://s3.amazonaws.com/%s" % s3_bucket build_id = os.environ.get("TRAVIS_BUILD_ID") # Can we make thi...
from __future__ import print_function import os import boto import pytest from boto.s3.key import Key as S3Key from boto.exception import NoAuthHandlerFound from os.path import join, isfile s3_bucket = "bokeh-travis" s3 = "https://s3.amazonaws.com/%s" % s3_bucket build_id = os.environ.get("TRAVIS_BUILD_ID") # Can we ...
Python
0
36a00bd6ece27b89843a856cd2b99d25a1d0e4d3
Modify conftest.py to support Python 3.5 only
tests/conftest.py
tests/conftest.py
# -*- coding: utf-8 -*- """Used by pytest to do some preparation work before running tests.""" # # (C) Pywikibot team, 2016-2020 # # Distributed under the terms of the MIT license. # import sys def pytest_configure(config): """Set the sys._test_runner_pytest flag to True, if pytest is used.""" sys._test_runne...
# -*- coding: utf-8 -*- """Used by pytest to do some preparation work before running tests.""" # # (C) Pywikibot team, 2016-2018 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, division, unicode_literals import sys def pytest_configure(config): """Set the sys._test_r...
Python
0.000002
d3fbe9934329df1b1c5f752e4a43981b4fc8beae
Use pathlib.Path
tests/conftest.py
tests/conftest.py
import pathlib import pytest from _pytest.compat import LEGACY_PATH from libvcs.shortcuts import create_repo_from_pip_url from libvcs.util import run @pytest.fixture(scope="function") def tmpdir_repoparent(tmp_path: pathlib.Path): """Return temporary directory for repository checkout guaranteed unique.""" ...
import pytest from _pytest.compat import LEGACY_PATH from libvcs.shortcuts import create_repo_from_pip_url from libvcs.util import run @pytest.fixture(scope="function") def tmpdir_repoparent(tmpdir_factory): """Return temporary directory for repository checkout guaranteed unique.""" fn = tmpdir_factory.mkte...
Python
0.000003
8913f5d6a06e0f25d1c8c1a45e0f5b4da8cbf421
bump version
rodeo/__init__.py
rodeo/__init__.py
__version__ = "0.1.0"
__version__ = "0.0.2"
Python
0
56b1ef461cfce11ad5e08a031abf175ed73c2081
Add radius2fov and imagexy_to_pixelXY functions. Clean import.
coordinate_transformations.py
coordinate_transformations.py
# -*- coding: utf-8 -*- """ Created on Sat Oct 21 22:35:50 2017 @author: lauri.kangas """ import numpy as np from numpy import sin,cos,arccos,arctan2,mod,pi import projections def rotate_RADEC(RAs, DECs, center_RA, center_DEC, output='xyz'): # rotate RA,DEC coordinates to turn center_RA,center_DEC to origin ...
# -*- coding: utf-8 -*- """ Created on Sat Oct 21 22:35:50 2017 @author: lauri.kangas """ import numpy as np from numpy import sin,cos,arccos,arctan2,mod,pi from projections import stereographic def rotate_RADEC(RAs, DECs, center_RA, center_DEC, output='xyz'): # rotate RA,DEC coordinates to turn center_RA,center...
Python
0
7eb10376b585e56faad4672959f6654f2500a38d
Add `one` as shortcut to `dimensionless_unscaled`
astropy/units/__init__.py
astropy/units/__init__.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains classes and functions for defining and converting between different physical units. This code is adapted from the `pynbody <http://code.google.com/p/pynbody/>`_ units module written by Andrew Pontzen, who has granted the Astr...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains classes and functions for defining and converting between different physical units. This code is adapted from the `pynbody <http://code.google.com/p/pynbody/>`_ units module written by Andrew Pontzen, who has granted the Astr...
Python
0.999976
865940bd126c7c45b7c615f751244a46176aca4d
Update version to 2.3b2-dev
openslides/__init__.py
openslides/__init__.py
__author__ = 'OpenSlides Team <support@openslides.org>' __description__ = 'Presentation and assembly system' __version__ = '2.3b2-dev' __license__ = 'MIT' __url__ = 'https://openslides.org' args = None
__author__ = 'OpenSlides Team <support@openslides.org>' __description__ = 'Presentation and assembly system' __version__ = '2.3b1' __license__ = 'MIT' __url__ = 'https://openslides.org' args = None
Python
0
8a9fa06c36a89e3fde93059cfbe827506d5b8b62
Disable exception logging of status code 500 during testing.
orchard/errors/e500.py
orchard/errors/e500.py
# -*- coding: utf-8 -*- """ This module sets up the view for handling ``500 Internal Server Error`` errors. """ import datetime import flask import flask_classful from orchard.errors import blueprint class Error500View(flask_classful.FlaskView): """ View for ``500 Internal Server Error`` errors. ...
# -*- coding: utf-8 -*- """ This module sets up the view for handling ``500 Internal Server Error`` errors. """ import datetime import flask import flask_classful from orchard.errors import blueprint class Error500View(flask_classful.FlaskView): """ View for ``500 Internal Server Error`` errors. ...
Python
0
b8d693a8fd2e0fb9fa8592b9672bc71e874547d3
Bump version to 0.1.1
fancypages/__init__.py
fancypages/__init__.py
import os __version__ = (0, 1, 1, 'alpha', 1) def get_fancypages_paths(path): """ Get absolute paths for *path* relative to the project root """ return [os.path.join(os.path.dirname(os.path.abspath(__file__)), path)] def get_apps(): return ( 'django_extensions', # used for image thumbna...
import os __version__ = (0, 1, 0, 'alpha', 1) def get_fancypages_paths(path): """ Get absolute paths for *path* relative to the project root """ return [os.path.join(os.path.dirname(os.path.abspath(__file__)), path)] def get_apps(): return ( 'django_extensions', # used for image thumbna...
Python
0.000002
4234da1953121f6384e366966ec3ce59d604c00c
Add tests to verify softwarecontainer functionality
lib/oeqa/runtime/cases/softwarecontainer.py
lib/oeqa/runtime/cases/softwarecontainer.py
import os from oeqa.oetest import oeRuntimeTest from oeqa.runtime.case import OERuntimeTestCase from oeqa.utils.decorators import skipUnlessPassed class SoftwareContainerTest(OERuntimeTestCase): def test_softwarecontainer_install(self): (status, _) = self.target.run('rpm -qa | grep softwarecontainer') ...
import os from oeqa.oetest import oeRuntimeTest from oeqa.runtime.case import OERuntimeTestCase from oeqa.utils.decorators import skipUnlessPassed class SoftwareContainerTest(OERuntimeTestCase): def test_softwarecontainer_installed(self): (status, _) = self.target.run('rpm -qa | grep softwarecontainer') ...
Python
0
b72f3ce27034ba3f810f205d133445267847f667
fix CSRF get request
mpweb_core/rester.py
mpweb_core/rester.py
# coding: utf-8 # https://github.com/materialsproject/pymatgen/blob/1eb2f2f/pymatgen/matproj/rest.py from __future__ import division, unicode_literals import os, requests, json, warnings, urlparse class MPResterBase(object): """ A base class to conveniently interface with a REST interface in the style of t...
# coding: utf-8 # https://github.com/materialsproject/pymatgen/blob/1eb2f2f/pymatgen/matproj/rest.py from __future__ import division, unicode_literals import os, requests, json, warnings, urlparse class MPResterBase(object): """ A base class to conveniently interface with a REST interface in the style of t...
Python
0
622d3ae0d6434ff84a96d5e51b1d14ac70364c28
make this a module that can be imported for testing
multigrid/mg_test.py
multigrid/mg_test.py
#!/usr/bin/env python """ an example of using the multigrid class to solve Laplace's equation. Here, we solve u_xx + u_yy = -2[(1-6x**2)y**2(1-y**2) + (1-6y**2)x**2(1-x**2)] u = 0 on the boundary this is the example from page 64 of the book `A Multigrid Tutorial, 2nd Ed.' The analytic solution is u(x,y) = (x**2 -...
#!/usr/bin/env python """ an example of using the multigrid class to solve Laplace's equation. Here, we solve u_xx + u_yy = -2[(1-6x**2)y**2(1-y**2) + (1-6y**2)x**2(1-x**2)] u = 0 on the boundary this is the example from page 64 of the book `A Multigrid Tutorial, 2nd Ed.' The analytic solution is u(x,y) = (x**2 -...
Python
0.000001
1506dda66814b8f51ec2dcbf2e632bdafa98bf75
add root node info to form
arches/app/views/graph.py
arches/app/views/graph.py
''' ARCHES - a program developed to inventory and manage immovable cultural heritage. Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund 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 ...
''' ARCHES - a program developed to inventory and manage immovable cultural heritage. Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund 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 ...
Python
0
b699f950eebbe10c400e9867ce8bead02d2f651c
Remove another thing.
src/txacme/interfaces.py
src/txacme/interfaces.py
# -*- coding: utf-8 -*- """ Interface definitions for txacme. """ from zope.interface import Interface class ITLSSNI01Responder(Interface): """ Configuration for a tls-sni-01 challenge responder. The actual responder may exist somewhere else, this interface is merely for an object that knows how to c...
# -*- coding: utf-8 -*- """ Interface definitions for txacme. """ from zope.interface import Interface class ITLSSNI01Responder(Interface): """ Configuration for a tls-sni-01 challenge responder. The actual responder may exist somewhere else, this interface is merely for an object that knows how to c...
Python
0.000001
358729ade26e9a8a101bd77d574d9f5e1f065b0d
Delete single question
relier/api/question.py
relier/api/question.py
from flask import abort, request, make_response from relier.models import Event, Question, Answer from relier.api import AuthenticatedResource from datetime import datetime from flask import g class QuestionResource(AuthenticatedResource): def post(self, event_id): if not g.user.can_ask: abort...
from flask import abort, request, make_response from relier.models import Event, Question, Answer from relier.api import AuthenticatedResource from datetime import datetime from flask import g class QuestionResource(AuthenticatedResource): def post(self, event_id): if not g.user.can_ask: abort...
Python
0.999999
8112440223e2e8e4f5d8cb93b28fd846dd59418b
Add logout view.
repocracy/repo/urls.py
repocracy/repo/urls.py
from django.conf.urls.defaults import * from django.conf import settings import os urlpatterns = patterns('repocracy.repo.views', url(r'^$', 'home', name='home'), url(r'^claim/(?P<pk>\d+)/(?P<claim_hash>[a-fA-F\d]{40})/$', 'repo_claim', name='repo_claim'), url(r'^users/(?P<name>[\-_\d\w\\\.]+)/$', 'repo_ow...
from django.conf.urls.defaults import * from django.conf import settings import os urlpatterns = patterns('repocracy.repo.views', url(r'^$', 'home', name='home'), url(r'^claim/(?P<pk>\d+)/(?P<claim_hash>[a-fA-F\d]{40})/$', 'repo_claim', name='repo_claim'), url(r'^users/(?P<name>[\-_\d\w\\\.]+)/$', 'repo_ow...
Python
0
8b008968e92cabf1022dff6edb37f38c3aaa5214
Update merge_filter.py
uf_examples/courses/merge_filter.py
uf_examples/courses/merge_filter.py
#!/usr/bin/env/python """ merge_filter.py -- find the courses in VIVO, and match them to the courses in the source. They must match on ccn There are two inputs: 1. Courses in VIVO. Keyed by ccn 2. UF courses in the source. Keyed the same. There are three cases 1. Course in VIVO and in ...
#!/usr/bin/env/python """ merge_filter.py -- find the courses in VIVO, and match them to the courses in the source. They must match on ccn There are two inputs: 1. Courses in VIVO. Keyed by ccn 2. UF courses in the source. Keyed the same. There are three cases 1. Course in VIVO and in ...
Python
0.000001
672876c172d9bba9e2f29707f9fdd95e0ff10f9f
put data early in Redis at hourly recache
hortiradar/website/refresh_cache.py
hortiradar/website/refresh_cache.py
import argparse from datetime import datetime import flask import ujson as json from app import app, get_period from hortiradar import time_format from processing import get_cache_key, get_process_top_params, process_details, process_top, redis def main(): parser = argparse.ArgumentParser(description="Refresh t...
import argparse from datetime import datetime import flask import ujson as json from app import app, get_period from hortiradar import time_format from processing import get_cache_key, get_process_top_params, process_details, process_top, redis def main(): parser = argparse.ArgumentParser(description="Refresh t...
Python
0
e77243ebd39eea6033b14d53ddeea870893548ae
Create tomato.py
tomato.py
tomato.py
#!/bin/python2.7 import argparse import re import random import struct from itertools import chain ################# ### ARGUMENTS ### ################# parser = argparse.ArgumentParser(add_help=True) parser.add_argument("file", help="input file") parser.add_argument("-o", "--output", help="output file") parser.add_...
#!/bin/python2.7 import argparse import re import random import struct from itertools import chain ################# ### ARGUMENTS ### ################# parser = argparse.ArgumentParser(add_help=True) parser.add_argument("file", help="input file") parser.add_argument("-o", "--output", help="output file") parser.add_...
Python
0.999536
2e39edbfab0d1d70ca527a024210a15d357842b7
Fix non-existent import
elaboratecharts/__init__.py
elaboratecharts/__init__.py
from os import path from shutil import copytree, rmtree from flask.ext.assets import Environment, Bundle from .views import elaboratecharts def rel(p): return path.join(path.dirname(__file__), p) class ElaborateCharts(object): def __init__(self, app=None, url_prefix=None): if app is not None: ...
from os import path from shutil import copytree, rmtree from flask.ext.assets import Environment, Bundle from . import assets from .views import elaboratecharts def rel(p): return path.join(path.dirname(__file__), p) class ElaborateCharts(object): def __init__(self, app=None, url_prefix=None): if ...
Python
0.999866
b6098d5b4578547fea192fe96998dbc43ef9dcb0
upgrade values check
http_lazy_headers/fields/upgrade.py
http_lazy_headers/fields/upgrade.py
# -*- coding: utf-8 -*- from ..shared.utils import constraints from ..shared.utils import assertions from ..shared import bases def upgrade(name, version=None): return name, version class ProtocolName: # http://www.iana.org/assignments/http-upgrade-tokens/http-upgrade-tokens.xml http = 'HTTP' tls...
# -*- coding: utf-8 -*- from ..shared.utils import constraints from ..shared import bases def upgrade(name, version=None): return name, version class ProtocolName: # http://www.iana.org/assignments/http-upgrade-tokens/http-upgrade-tokens.xml http = 'HTTP' tls = 'TLS' web_socket = 'WebSocket' ...
Python
0.000001
471e0f4e91eb4513315193ce2b2b0f13e2c9724c
remove stray "
corehq/util/datadog/gauges.py
corehq/util/datadog/gauges.py
from functools import wraps from celery.task import periodic_task from corehq.util.datadog import statsd from corehq.util.soft_assert import soft_assert def datadog_gauge_task(name, fn, run_every, enforce_prefix='commcare'): """ helper for easily registering datadog gauges to run periodically To update a...
from functools import wraps from celery.task import periodic_task from corehq.util.datadog import statsd from corehq.util.soft_assert import soft_assert def datadog_gauge_task(name, fn, run_every, enforce_prefix='commcare'): """" helper for easily registering datadog gauges to run periodically To update ...
Python
0.000042
213ddc9ffbb171c17c051c6394baa0499abfc820
fix UnboundLocalError
corehq/util/tests/test_log.py
corehq/util/tests/test_log.py
from __future__ import absolute_import from __future__ import unicode_literals import six from django.test import SimpleTestCase from ..log import clean_exception class TestLogging(SimpleTestCase): def test_bad_traceback(self): result = "JJackson's SSN: 555-55-5555" exception = None try:...
from __future__ import absolute_import from __future__ import unicode_literals import six from django.test import SimpleTestCase from ..log import clean_exception class TestLogging(SimpleTestCase): def test_bad_traceback(self): result = "JJackson's SSN: 555-55-5555" try: # copied fro...
Python
0.000002
24b85059dcc5c17d21011bc7d1975f519e09837d
Improve formatting
netsecus/__init__.py
netsecus/__init__.py
#!/usr/bin/env python from __future__ import unicode_literals import imaplib import logging import time import helper import rules # useful for debugging: $ openssl s_client -crlf -connect imap.gmail.com:993 # # core functions # def main(): # patching imaplib imaplib.Commands["MOVE"] = ("SELECTED",) ...
#!/usr/bin/env python from __future__ import unicode_literals import imaplib import logging import time import helper import rules # useful for debugging: $ openssl s_client -crlf -connect imap.gmail.com:993 # # core functions # def main(): # patching imaplib imaplib.Commands["MOVE"] = ("SELECTED",) ...
Python
0.99985
c492c42639f7a487dc27a95a5a785dd9c62ecdb7
Change project status formatting
clowder/utility/print_utilities.py
clowder/utility/print_utilities.py
"""Print utilities""" import os from termcolor import colored from clowder.utility.git_utilities import ( git_current_sha, git_current_branch, git_is_detached, git_is_dirty ) def print_project_status(root_directory, path, name): """Print repo status""" repo_path = os.path.join(root_directory, p...
"""Print utilities""" import os from termcolor import colored from clowder.utility.git_utilities import ( git_current_sha, git_current_branch, git_is_detached, git_is_dirty ) def print_project_status(root_directory, path, name): """Print repo status""" repo_path = os.path.join(root_directory, p...
Python
0
b82cc5adba91610093621fefc5121393d7a8bd35
Split ignored_paths
coalib/parsing/DefaultArgParser.py
coalib/parsing/DefaultArgParser.py
""" 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ...
""" 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ...
Python
0
d4f86c8b9ced020f842a4321b4108c9372d7b4ec
Add the staticfiles app.
coda/coda_project/settings/base.py
coda/coda_project/settings/base.py
# Base settings for coda_project import os import json from datetime import timedelta from django.core.exceptions import ImproperlyConfigured # Absolute path to the settings module SETTINGS_ROOT = os.path.dirname(__file__) # Absolute path to the project PROJECT_ROOT = os.path.dirname(SETTINGS_ROOT) # Absolute path t...
# Base settings for coda_project import os import json from datetime import timedelta from django.core.exceptions import ImproperlyConfigured # Absolute path to the settings module SETTINGS_ROOT = os.path.dirname(__file__) # Absolute path to the project PROJECT_ROOT = os.path.dirname(SETTINGS_ROOT) # Absolute path ...
Python
0
6565627e44566f1230ea8c3176678d604c020050
Generate network with bias properly
network_simulator.py
network_simulator.py
import numpy as np from scipy import stats def exp_cosh(H, beta=1.0): return 0.5 * np.exp(beta * H) / np.cosh(beta * H) def kinetic_ising_model(S, J): """ Returns probabilities of S[t+1,:] being one. :param S: numpy.ndarray (T,N) Binary data where an entry is either 1 ('spike') or -1 ('silence')...
import numpy as np from scipy import stats def exp_cosh(H, beta=1.0): return 0.5 * np.exp(beta * H) / np.cosh(beta * H) def kinetic_ising_model(S, J): """ Returns probabilities of S[t+1,:] being one. :param S: numpy.ndarray (T,N) Binary data where an entry is either 1 ('spike') or -1 ('silence')...
Python
0.999129
70021d5df6beb0e8eb5b78a6484cbb650a7a1fb6
fix docs
cupyx/distributed/__init__.py
cupyx/distributed/__init__.py
from cupyx.distributed._init import init_process_group # NOQA from cupyx.distributed._comm import Backend # NOQA from cupyx.distributed._nccl_comm import NCCLBackend # NOQA
from cupyx.distributed._init import init_process_group # NOQA from cupyx.distributed._nccl_comm import NCCLBackend # NOQA
Python
0.000001
3061affd313aff39f722e6e5846a3191d6592a7d
fix FaqQuestionSitemap URLs
fluent_faq/sitemaps.py
fluent_faq/sitemaps.py
from django.contrib.sitemaps import Sitemap from django.core.urlresolvers import NoReverseMatch from fluent_faq.models import FaqCategory, FaqQuestion from fluent_faq.urlresolvers import faq_reverse def _url_patterns_installed(): # This module can use normal Django urls.py URLs, or mount the "FaqPage" in the page...
from django.contrib.sitemaps import Sitemap from django.core.urlresolvers import NoReverseMatch from fluent_faq.models import FaqCategory, FaqQuestion from fluent_faq.urlresolvers import faq_reverse def _url_patterns_installed(): # This module can use normal Django urls.py URLs, or mount the "FaqPage" in the page...
Python
0.000164
79e7ef509e4757c29d6fa0bd9161410aadbd305a
fix os.path.expand [sic] typo, and refactor
salt/utils/xdg.py
salt/utils/xdg.py
# -*- coding: utf-8 -*- ''' Create an XDG function to get the config dir ''' import os def xdg_config_dir(config_dir=None): ''' Check xdg locations for config files ''' xdg_config = os.getenv('XDG_CONFIG_HOME', os.path.expanduser('~/.config')) xdg_config_dir = os.path.join(xdg_config, 'salt') ...
# -*- coding: utf-8 -*- ''' Create an XDG function to get the config dir ''' import os def xdg_config_dir(config_dir=None): ''' Check xdg locations for config files ''' xdg_config = os.getenv('XDG_CONFIG_HOME', os.path.expanduser('~/.config')) xdg_config_dir = os.path.join(xdg_config, 'salt') ...
Python
0.000004
237fcac11a12a1fb0eba32a4fc516cb449f15577
Fix bounce test
froide/bounce/tests.py
froide/bounce/tests.py
import os import unittest from datetime import datetime, timedelta from django.test import TestCase from django.db import connection from froide.helper.email_utils import EmailParser from froide.foirequest.tests.factories import UserFactory from .models import Bounce from .utils import ( make_bounce_address, add...
import os import unittest from datetime import datetime, timedelta from django.test import TestCase from django.db import connection from froide.helper.email_utils import EmailParser from froide.foirequest.tests.factories import UserFactory from .models import Bounce from .utils import ( make_bounce_address, add...
Python
0.000002
e6db95cce0239d9e8ce33aec5cf21aa1bd19df03
Add __str__ method
imagersite/imager_profile/models.py
imagersite/imager_profile/models.py
import six from django.db import models from django.contrib.auth.models import User @six.python_2_unicode_compatible class ImagerProfile(models.Model): user = models.OneToOneField(User) fav_camera = models.CharField(max_length=30) address = models.CharField(max_length=100) web_url = models.URLField()...
from django.db import models from django.contrib.auth.models import User import six @six.python_2_unicode_compatible class ImagerProfile(models.Model): user = models.OneToOneField(User) fav_camera = models.CharField(max_length=30) address = models.CharField(max_length=100) web_url = models.URLField() ...
Python
0.999825
e9f986a0ade7d08a56157641efb49366f3c54bcc
Add a create column migration for canonical_bug_link
mysite/search/migrations/0016_add_looks_closed_column.py
mysite/search/migrations/0016_add_looks_closed_column.py
from south.db import db from django.db import models from mysite.search.models import * class Migration: def forwards(self, orm): # Adding field 'Bug.looks_closed' db.add_column('search_bug', 'looks_closed', orm['search.bug:looks_closed']) db.add_column('search_bug', 'canonic...
from south.db import db from django.db import models from mysite.search.models import * class Migration: def forwards(self, orm): # Adding field 'Bug.looks_closed' db.add_column('search_bug', 'looks_closed', orm['search.bug:looks_closed']) def backwards(self, o...
Python
0.000001
18bb441017c26b850eeb84fda576c613a08238b1
Fix the case when Paths.CWD is None
sc2/sc2process.py
sc2/sc2process.py
import sys import signal import time import asyncio import os.path import shutil import tempfile import subprocess import portpicker import websockets import logging logger = logging.getLogger(__name__) from .paths import Paths from .protocol import Protocol from .controller import Controller class kill_switch(objec...
import sys import signal import time import asyncio import os.path import shutil import tempfile import subprocess import portpicker import websockets import logging logger = logging.getLogger(__name__) from .paths import Paths from .protocol import Protocol from .controller import Controller class kill_switch(objec...
Python
1
93d75e45a277cbdbc551831d6e0462e3e5c430fb
Set keys public again on S3 caching.
funsize/cache/cache.py
funsize/cache/cache.py
""" funsize.database.cache ~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is currently a stub file that contains function prototypes for the caching layer core """ import os from boto.s3.connection import S3Connection import funsize.utils.oddity as oddity class Cache(object): """ Class that provides access to cache ...
""" funsize.database.cache ~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is currently a stub file that contains function prototypes for the caching layer core """ import os from boto.s3.connection import S3Connection import funsize.utils.oddity as oddity class Cache(object): """ Class that provides access to cache ...
Python
0
37b994f96a7760ae962092e59d603455202f0985
Document what the interface is for...
usingnamespace/traversal/Archive.py
usingnamespace/traversal/Archive.py
import logging log = logging.getLogger(__name__) from zope.interface import Interface from zope.interface import implementer from Entry import Entry class IArchive(Interface): """Marker interface for archive contexts""" @implementer(IArchive) class ArchiveYear(object): """ArchiveYear is the context for this...
import logging log = logging.getLogger(__name__) from zope.interface import Interface from zope.interface import implementer from Entry import Entry class IArchive(Interface): pass @implementer(IArchive) class ArchiveYear(object): """ArchiveYear is the context for this years archives""" def __init__(se...
Python
0
f930a0d8a52ef493098390c38d27622e882a8203
fix published_by typo
openedx/core/djangoapps/content/course_overviews/connector.py
openedx/core/djangoapps/content/course_overviews/connector.py
import MySQLdb import logging from django.conf import settings logger = logging.getLogger(__name__) class EdevateDbConnector: host = settings.EDEVATE_MYSQL_HOST port = settings.EDEVATE_MYSQL_PORT user = settings.EDEVATE_MYSQL_USER passwd = settings.EDEVATE_MYSQL_PASSWD db = settings.EDEVATE_MYSQ...
import MySQLdb import logging from django.conf import settings logger = logging.getLogger(__name__) class EdevateDbConnector: host = settings.EDEVATE_MYSQL_HOST port = settings.EDEVATE_MYSQL_PORT user = settings.EDEVATE_MYSQL_USER passwd = settings.EDEVATE_MYSQL_PASSWD db = settings.EDEVATE_MYSQ...
Python
0
d01d12a0cbe286d808c9870b71374b36c0585230
simplify newline handling
weka_weca/__init__.py
weka_weca/__init__.py
class Node: """Data structure of a single node.""" def __init__(self, start, end, depth=0, indent=' '): """ Wrap string initially around string. Parameters ---------- :param start : string The start of the if-condition. :param end : string ...
class Node: """Data structure of a single node.""" def __init__(self, start, end, depth=0, indent=' '): """ Wrap string initially around string. Parameters ---------- :param start : string The start of the if-condition. :param end : string ...
Python
0.000147
9a21c446f1236e1b89663c991ea354d8e473b3b9
Fix a copyright and pep8 issues in lanzano_luzi_2019_test.py
openquake/hazardlib/tests/gsim/lanzano_luzi_2019_test.py
openquake/hazardlib/tests/gsim/lanzano_luzi_2019_test.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2019 GEM Foundation # # OpenQuake 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, o...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2015-2019 GEM Foundation # # OpenQuake 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.001416
03ed43d7d8867ba066d9eea3b3fc7cfe557a31d9
Use C++
test/setup.py
test/setup.py
from distutils.core import setup, Extension test_py3c_module = Extension( 'test_py3c', sources=['test_py3c.c'], include_dirs=['../include'], extra_compile_args = ['--std=c++0x', '-l mylib'], ) setup_args = dict( name='test_py3c', version='0.0', description = '', ext_modules = [test_py3...
from distutils.core import setup, Extension test_py3c_module = Extension( 'test_py3c', sources=['test_py3c.c'], include_dirs=['../include'], ) setup_args = dict( name='test_py3c', version='0.0', description = '', ext_modules = [test_py3c_module] ) if __name__ == '__main__': setup(**se...
Python
0.000211
2543709c204f1dd6aca5d012e7c28193631bb74c
Use postgres standard env vars
gargbot_3000/config.py
gargbot_3000/config.py
#! /usr/bin/env python3.6 # coding: utf-8 import os import datetime as dt from pathlib import Path import pytz from dotenv import load_dotenv env_path = Path(".") / ".env" load_dotenv(dotenv_path=env_path) slack_verification_token = os.environ["slack_verification_token"] slack_bot_user_token = os.environ["slack_bot...
#! /usr/bin/env python3.6 # coding: utf-8 import os import datetime as dt from pathlib import Path import pytz from dotenv import load_dotenv env_path = Path(".") / ".env" load_dotenv(dotenv_path=env_path) slack_verification_token = os.environ["slack_verification_token"] slack_bot_user_token = os.environ["slack_bot...
Python
0
58e234ad7961e955726152436bcb3c8f270564c4
fix py33 error in setup.py
vendor.py
vendor.py
import subprocess import os from os import path import re import traceback import sys error_msg = """ This library depends on sources fetched when packaging that failed to be retrieved. This means that it will *not* work as expected. Errors encountered: """ def run(cmd): sys.stdout.write('[vendoring] Running c...
import subprocess import os from os import path import re import traceback import sys error_msg = """ This library depends on sources fetched when packaging that failed to be retrieved. This means that it will *not* work as expected. Errors encountered: """ def run(cmd): sys.stdout.write('[vendoring] Running c...
Python
0
281fd926786186e8f0b1ebc7d8aeb1c362310fc1
Remove unused variable
viewer.py
viewer.py
import sys import pygame import pygame.locals pygame.init() size = width, height = 575, 575 screen = pygame.display.set_mode(size) label_lights = False def up_row(x_offset): for i in range(20): x = x_offset + (i % 2) * 0.5 y = i * 0.5 yield x, y def down_row(x_offset): for i in rang...
import sys import pygame import pygame.locals pygame.init() size = width, height = 575, 575 screen = pygame.display.set_mode(size) label_lights = False def up_row(x_offset): for i in range(20): x = x_offset + (i % 2) * 0.5 y = i * 0.5 yield x, y def down_row(x_offset): for i in rang...
Python
0.000015
30088e034e32209e32e65218974ee717c718b1ab
Add start and stop entry points to sims.
wmt/flask/api/sims.py
wmt/flask/api/sims.py
import os from flask import Blueprint from flask import json, url_for, current_app from flask import g, request, abort, send_file from flask.ext.login import current_user, login_required from ..utils import as_resource, as_collection from ..errors import InvalidFieldError, AuthorizationError from ..services import si...
import os from flask import Blueprint from flask import json, url_for, current_app from flask import g, request, abort, send_file from flask.ext.login import current_user, login_required from ..utils import as_resource, as_collection from ..errors import InvalidFieldError, AuthorizationError from ..services import si...
Python
0
8c026f79c223091c06deb0589dbf0ee342f4f0e5
Change skeleton #2.
wood_site/settings.py
wood_site/settings.py
""" Django settings for wood_site project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import ...
""" Django settings for wood_site project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import ...
Python
0
2321dd5b0afedb9bb4a6e894149dd636174adf2c
Bump version to 4.0.1
stix2elevator/version.py
stix2elevator/version.py
__version__ = "4.0.1"
__version__ = "4.0.0"
Python
0
282ac04e49c6adef237ea30fa4dcae64e6f959d8
Support for non-blank server roots
stronghold/middleware.py
stronghold/middleware.py
from django.contrib.auth.decorators import login_required from stronghold import conf class LoginRequiredMiddleware(object): """ Force all views to use login required View is deemed to be public if the @public decorator is applied to the view View is also deemed to be Public if listed in in django s...
from django.contrib.auth.decorators import login_required from stronghold import conf class LoginRequiredMiddleware(object): """ Force all views to use login required View is deemed to be public if the @public decorator is applied to the view View is also deemed to be Public if listed in in django s...
Python
0
79893a76c0b438ab3885a9c09027842ff92a26d2
Update multiplier constant / tweak brightness
wakeup.py
wakeup.py
#!/usr/bin/python # -*- coding: utf-8 -*- # The Pin. Use Broadcom numbers. BRIGHT_PIN = 17 # User config START_BRIGHT = 15 # Minutes before alarm to start lighting up END_BRIGHT = -45 # Minutes after alarm to turn off MAX_BRIGHT = 255 # Max brightness 1 - 255 # Other constants BRIGHT_MULTI = MAX_BRIGHT / S...
#!/usr/bin/python # -*- coding: utf-8 -*- # The Pin. Use Broadcom numbers. BRIGHT_PIN = 17 # User config START_BRIGHT = 15 # Minutes before alarm to start lighting up END_BRIGHT = -45 # Minutes after alarm to turn off MAX_BRIGHT = 255 # Max brightness 1 - 255 # Other constants BRIGHT_MULTI = 255 / START_BR...
Python
0
35de4045bc30a1ee0e9aaa17f0b3f370ad95d6c8
Bump (#16)
swag_client/__about__.py
swag_client/__about__.py
from __future__ import absolute_import, division, print_function __all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__author__", "__email__", "__license__", "__copyright__", ] __title__ = "swag-client" __summary__ = ("Cloud multi-account metadata management tool.") __uri__ = "https://github.co...
from __future__ import absolute_import, division, print_function __all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__author__", "__email__", "__license__", "__copyright__", ] __title__ = "swag-client" __summary__ = ("Cloud multi-account metadata management tool.") __uri__ = "https://github.co...
Python
0
2c2e5bc83bbca3cd3c7ce7649be657293978ddd8
append _tbl
webapp.py
webapp.py
import cherrypy import os import json import getpass from collections import OrderedDict from configparser import ConfigParser from builtins import input import mysql.connector # # import sys # import os.path class DBConfig: settings = {} def __init__(self, config_file='..\db.cfg'): if os.path.isfil...
import cherrypy import os import json import getpass from collections import OrderedDict from configparser import ConfigParser from builtins import input import mysql.connector # # import sys # import os.path class DBConfig: settings = {} def __init__(self, config_file='..\db.cfg'): if os.path.isfil...
Python
0.999691
67614fb784dca6166b112ddc60254ef5e493541d
Change 9/5 to 1.8
wfinal.py
wfinal.py
import RPi.GPIO as GPIO import pywapi import string import time channels = [4, 7, 8, 9, 10, 14, 15, 17, 18, 22, 23, 24, 25] GPIO.setwarnings(True) GPIO.setmode(GPIO.BCM) GPIO.setup(channels, GPIO.OUT) GPIO.output(channels, 0) weather = pywapi.get_weather_from_weather_com('33020') temperature = int(weather['current_...
import RPi.GPIO as GPIO import pywapi import string import time channels = [4, 7, 8, 9, 10, 14, 15, 17, 18, 22, 23, 24, 25] GPIO.setwarnings(True) GPIO.setmode(GPIO.BCM) GPIO.setup(channels, GPIO.OUT) GPIO.output(channels, 0) weather = pywapi.get_weather_from_weather_com('33020') temperature = int(weather['current_...
Python
0.999999
5b02f334519964ffae6812df5413fcdae84db6ba
Undo changes to logger config, ie. remove the access_log_file option: decision is to support this through log_config rather tan adding an option.
synapse/config/logger.py
synapse/config/logger.py
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # 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 applica...
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # 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 applica...
Python
0
07f8f44fc5f69c71922bb3b85d621867d0df49fa
Support core logger as a property on the main scraper.
scrapekit/core.py
scrapekit/core.py
from uuid import uuid4 from time import time from datetime import datetime from threading import local from scrapekit.config import Config from scrapekit.tasks import TaskManager, Task from scrapekit.http import make_session from scrapekit.logs import make_logger class Scraper(object): """ Scraper application ob...
from scrapekit.config import Config from scrapekit.tasks import TaskManager, Task from scrapekit.http import make_session class Scraper(object): """ Scraper application object which handles resource management for a variety of related functions. """ def __init__(self, name, config=None): self.nam...
Python
0
6edd4114c4e715a3a0c440af455fff089a099620
Clarify comment about Pyhton versions
scrapy/squeues.py
scrapy/squeues.py
""" Scheduler queues """ import marshal from six.moves import cPickle as pickle from queuelib import queue def _serializable_queue(queue_class, serialize, deserialize): class SerializableQueue(queue_class): def push(self, obj): s = serialize(obj) super(SerializableQueue, self).p...
""" Scheduler queues """ import marshal from six.moves import cPickle as pickle from queuelib import queue def _serializable_queue(queue_class, serialize, deserialize): class SerializableQueue(queue_class): def push(self, obj): s = serialize(obj) super(SerializableQueue, self).p...
Python
0.000001
d6cdf99d87b23cd6bfd8fd7079919d89d6496501
Complete incomplete sentence
partner_identification/models/res_partner_id_category.py
partner_identification/models/res_partner_id_category.py
# -*- coding: utf-8 -*- # # © 2004-2010 Tiny SPRL http://tiny.be # © 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH # http://www.camptocamp.at # © 2015 Antiun Ingenieria, SL (Madrid, Spain) # http://www.antiun.com # Antonio Espinosa <antonioea@antiun.com> # © 2016 ACSONE SA/NV (<http://a...
# -*- coding: utf-8 -*- # # © 2004-2010 Tiny SPRL http://tiny.be # © 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH # http://www.camptocamp.at # © 2015 Antiun Ingenieria, SL (Madrid, Spain) # http://www.antiun.com # Antonio Espinosa <antonioea@antiun.com> # © 2016 ACSONE SA/NV (<http://a...
Python
0.998694
573d3a7411a1653f64b901077264ecb98c1f9673
Use subprocess.check_call replace os.system
script/version.py
script/version.py
import importlib import os import sys import subprocess here = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def get_version() -> str: """ Return version. """ sys.path.insert(0, here) return importlib.import_module("a2wsgi").__version__ os.chdir(here) subprocess.check_call(f"poetr...
import importlib import os import sys here = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def get_version() -> str: """ Return version. """ sys.path.insert(0, here) return importlib.import_module("a2wsgi").__version__ os.chdir(here) os.system(f"poetry version {get_version()}") os...
Python
0.000003
cbdee53bc2239277d314b93d09368ab2462ab8d6
Allow variety of input types
geojsonio/geojsonio.py
geojsonio/geojsonio.py
#!/usr/bin/env python #-*- coding: utf-8 -*- import argparse import json import sys import urllib import webbrowser import github3 MAX_URL_LEN = 150e3 # Size threshold above which a gist is created def display(contents, domain='http://geojson.io/'): url = geojsonio_url(contents, domain) webbrowser.open(url...
#!/usr/bin/env python #-*- coding: utf-8 -*- import argparse import sys import urllib import webbrowser import github3 MAX_URL_LEN = 150e3 # Size threshold above which a gist is created def display(contents, domain='http://geojson.io/'): url = geojsonio_url(contents, domain) webbrowser.open(url) return...
Python
0.000016
61d07e1ef8b01f80111f24efbbdf9fa02010daff
Handle missing package "imbox" with error message
intelmq/bots/collectors/mail/collector_mail_url.py
intelmq/bots/collectors/mail/collector_mail_url.py
# -*- coding: utf-8 -*- import re import sys try: import imbox except ImportError: imbox = None import requests from intelmq.lib.bot import Bot from intelmq.lib.message import Report class MailURLCollectorBot(Bot): def init(self): if imbox is None: self.logger.error('Could not impo...
# -*- coding: utf-8 -*- import re import sys import imbox import requests from intelmq.lib.bot import Bot from intelmq.lib.message import Report class MailURLCollectorBot(Bot): def process(self): mailbox = imbox.Imbox(self.parameters.mail_host, self.parameters.mail_user, ...
Python
0.000003
a4feb3abb75e9fd686546e877290c191961601e1
Update trns_validate_Genbank_Genome.py
plugins/scripts/validate/trns_validate_Genbank_Genome.py
plugins/scripts/validate/trns_validate_Genbank_Genome.py
#!/usr/bin/env python # standard library imports import sys import os import argparse import logging import subprocess # 3rd party imports # None # KBase imports import biokbase.Transform.script_utils as script_utils def transform(input_file=None, level=logging.INFO, logger=None): """ Validat...
#!/usr/bin/env python # standard library imports import sys import os import argparse import logging import subprocess # 3rd party imports # None # KBase imports import biokbase.Transform.script_utils as script_utils def transform(input_file=None, level=logging.INFO, logger=None): """ Validat...
Python
0.000001
714815fd943207089c1805e01c4f476ddf7c6917
Add suport for html reports
jasperserver/core/ExportExecutionRequestBuilder.py
jasperserver/core/ExportExecutionRequestBuilder.py
from time import sleep from resources_mime_type import ResourceFilesMimeType as rmt import json class ExportExecutionRequestBuilder(object): def __init__(self, ReportExecutionRequestBuilder,js_connect, requestId, exportId): self.rerb = ReportExecutionRequestBuilder self.requestId = requestId ...
from time import sleep from resources_mime_type import ResourceFilesMimeType as rmt import json class ExportExecutionRequestBuilder(object): def __init__(self, ReportExecutionRequestBuilder,js_connect, requestId, exportId): self.rerb = ReportExecutionRequestBuilder self.requestId = requestId ...
Python
0
487f7a2235e8541670fc0e9949dd3c0fb80eb932
fix formatting
projects/dendrites/permutedMNIST/experiments/__init__.py
projects/dendrites/permutedMNIST/experiments/__init__.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2021, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2021, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
Python
0.001459
57ac1c43181d3bd1f5a18a1ed3137c1b997e2533
Fix lint error
keras_cv/layers/regularization/stochastic_depth.py
keras_cv/layers/regularization/stochastic_depth.py
# Copyright 2022 The KerasCV 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# Copyright 2022 The KerasCV 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
0.000035
6fbfa11a6f13f8271687a83fc4de68f62d4a4501
Fix encrpytion with custom salt
crypto/encrypt.py
crypto/encrypt.py
#!/bin/env python3 """ Encrypt password with salt for unix Usage: encrypt.py [options] [--rounds <count>] [--sha512 | --sha256 | --md5 | --crypt] [<salt>] Options: --sha512 --sha256 --md5 --crypt -r, --rounds <count> rounds[default: 1000] """ import sys import crypt from getpass import getpas...
#!/bin/env python3 """ Encrypt password with salt for unix Usage: encrypt.py [options] [--sha512 | --sha256 | --md5 | --crypt] [<salt>] Options: --sha512 --sha256 --md5 --crypt """ import sys import crypt from getpass import getpass from docopt import docopt # docopt(doc, argv=None, help=True, ve...
Python
0
4c2f6372bb5c1db18998626049aa8e53e9889452
Fix an invalid build dependency.
syzygy/trace/rpc/rpc.gyp
syzygy/trace/rpc/rpc.gyp
# Copyright 2012 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 a...
# Copyright 2012 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 a...
Python
0.999952
84df8646ba396088e70ca8469b301d11d13d2da7
Fix wrong query on running tis (#17631)
airflow/api/common/experimental/delete_dag.py
airflow/api/common/experimental/delete_dag.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
Python
0.000017
bf87d7a60f20d9811fe2ff2c579f52b3e77a1ed3
Remove unneeded print statement.
ctree/c/dotgen.py
ctree/c/dotgen.py
""" DOT generator for C constructs. """ from ctree.dotgen import DotGenLabeller from ctree.types import codegen_type class CDotGenLabeller(DotGenLabeller): """ Manages generation of DOT. """ def visit_SymbolRef(self, node): s = r"" if node._global: s += r"__global " ...
""" DOT generator for C constructs. """ from ctree.dotgen import DotGenLabeller from ctree.types import codegen_type class CDotGenLabeller(DotGenLabeller): """ Manages generation of DOT. """ def visit_SymbolRef(self, node): s = r"" if node._global: s += r"__global " ...
Python
0.000005
742cdc4419449a8190bddd8439c3559a1bf19180
fix a bug, adding import
alphatwirl/concurrently/TaskPackageDropbox.py
alphatwirl/concurrently/TaskPackageDropbox.py
# Tai Sakuma <tai.sakuma@cern.ch> import logging import time from operator import itemgetter from .WorkingArea import WorkingArea ##__________________________________________________________________|| class TaskPackageDropbox(object): """A drop box for task packages. It puts task packages in a working area a...
# Tai Sakuma <tai.sakuma@cern.ch> import logging from operator import itemgetter from .WorkingArea import WorkingArea ##__________________________________________________________________|| class TaskPackageDropbox(object): """A drop box for task packages. It puts task packages in a working area and dispatche...
Python
0.000001
50861c6d256438afd880aebbb3a19ea360367fac
upgrade IdentityDetailSerializer to DRF3
api/serializers/identity_detail_serializer.py
api/serializers/identity_detail_serializer.py
from core.models.identity import Identity from rest_framework import serializers class IdentityDetailSerializer(serializers.ModelSerializer): # created_by = serializers.CharField(source='creator_name') quota = serializers.ReadOnlyField(source='get_quota_dict') provider_id = serializers.ReadOnlyField(sourc...
from core.models.identity import Identity from rest_framework import serializers class IdentityDetailSerializer(serializers.ModelSerializer): created_by = serializers.CharField(source='creator_name') quota = serializers.Field(source='get_quota_dict') provider_id = serializers.Field(source='provider.uuid')...
Python
0
ef18eb5ce3ed8c65a1cf57c139cd5380f76ef707
Improve `is_node` error message
graphene/relay/node.py
graphene/relay/node.py
from functools import partial import six from graphql_relay import from_global_id, to_global_id from ..types import ID, Field, Interface, ObjectType from ..types.interface import InterfaceMeta def is_node(objecttype): ''' Check if the given objecttype has Node as an interface ''' assert issubclass(...
from functools import partial import six from graphql_relay import from_global_id, to_global_id from ..types import ID, Field, Interface, ObjectType from ..types.interface import InterfaceMeta def is_node(objecttype): ''' Check if the given objecttype has Node as an interface ''' assert issubclass(...
Python
0.000002
f21180292db82abfc69272c5c1b9e50c68645eca
fix gdpr form scrub tests in python 3
corehq/apps/users/management/commands/gdpr_scrub_user_from_forms.py
corehq/apps/users/management/commands/gdpr_scrub_user_from_forms.py
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from django.core.management.base import BaseCommand from corehq.apps.users.models import CouchUser from corehq.form_processor.interfaces.dbaccessors import FormAccessors from io import StringIO from lxml...
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from django.core.management.base import BaseCommand from corehq.apps.users.models import CouchUser from corehq.form_processor.interfaces.dbaccessors import FormAccessors from io import StringIO from lxml...
Python
0
1e4d80c50aaf253fd2bad9a2139737d8bf8dc927
fix escape sequence DeprecationWarning (#1595)
gym/spaces/discrete.py
gym/spaces/discrete.py
import numpy as np from .space import Space class Discrete(Space): r"""A discrete space in :math:`\{ 0, 1, \\dots, n-1 \}`. Example:: >>> Discrete(2) """ def __init__(self, n): assert n >= 0 self.n = n super(Discrete, self).__init__((), np.int64) def sample(sel...
import numpy as np from .space import Space class Discrete(Space): """A discrete space in :math:`\{ 0, 1, \dots, n-1 \}`. Example:: >>> Discrete(2) """ def __init__(self, n): assert n >= 0 self.n = n super(Discrete, self).__init__((), np.int64) ...
Python
0.000004
50248c3989624f935a4ff2a80229b997ca77f5c2
fix generator issue
hazm/SequenceTagger.py
hazm/SequenceTagger.py
# coding: utf8 from __future__ import unicode_literals from nltk.tag.api import TaggerI from wapiti import Model class SequenceTagger(TaggerI): """ wrapper for [Wapiti](http://wapiti.limsi.fr) sequence tagger >>> tagger = SequenceTagger(patterns=['*', 'U:word-%x[0,0]']) >>> tagger.train([[('من', 'PRO'), ('به', '...
# coding: utf8 from __future__ import unicode_literals from nltk.tag.api import TaggerI from wapiti import Model class SequenceTagger(TaggerI): """ wrapper for [Wapiti](http://wapiti.limsi.fr) sequence tagger >>> tagger = SequenceTagger(patterns=['*', 'U:word-%x[0,0]']) >>> tagger.train([[('من', 'PRO'), ('به', '...
Python
0
649a70d825d2182e3d5a4f42a83f377b66043e09
bump version
yandextank/version.py
yandextank/version.py
VERSION = '1.17.2'
VERSION = '1.17.1'
Python
0.000001
60d93c3ade6f465e627c6c47c17d9c86e2b52f2a
Handle None challenge
app/grandchallenge/core/context_processors.py
app/grandchallenge/core/context_processors.py
import logging from django.conf import settings from guardian.shortcuts import get_perms from guardian.utils import get_anonymous_user logger = logging.getLogger(__name__) def challenge(request): try: challenge = request.challenge if challenge is None: return {} except Attribut...
import logging from django.conf import settings from guardian.shortcuts import get_perms from guardian.utils import get_anonymous_user logger = logging.getLogger(__name__) def challenge(request): try: challenge = request.challenge except AttributeError: logger.warning(f"Could not get challen...
Python
0.000001