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
a42ae6f2c761809813b9851bc1e449e3dac685ba
Remove mongo _id from resource.
superdesk/items.py
superdesk/items.py
from datetime import datetime from flask import request, url_for from . import mongo from . import rest from .auth import auth_required from .utils import get_random_string from .io.reuters_token import ReutersTokenProvider tokenProvider = ReutersTokenProvider() class ItemConflictException(Exception): pass def...
from datetime import datetime from flask import request, url_for from . import mongo from . import rest from .auth import auth_required from .utils import get_random_string from .io.reuters_token import ReutersTokenProvider tokenProvider = ReutersTokenProvider() class ItemConflictException(Exception): pass def...
Python
0
b3761729b156367229b5cd8895d225cb13d3267a
Fix example `Set-Based Column Map Expectation` template import (#6134)
examples/expectations/set_based_column_map_expectation_template.py
examples/expectations/set_based_column_map_expectation_template.py
""" This is a template for creating custom SetBasedColumnMapExpectations. For detailed instructions on how to use it, please see: https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_set_based_column_map_expectations """ from great_expectations.expectations.s...
""" This is a template for creating custom SetBasedColumnMapExpectations. For detailed instructions on how to use it, please see: https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_set_based_column_map_expectations """ from great_expectations.expectations.r...
Python
0
407bb78c34b769f8d993853761234c60e1fbeabd
Update util.py
tabpy-server/tabpy_server/app/util.py
tabpy-server/tabpy_server/app/util.py
import csv import logging import os from datetime import datetime from OpenSSL import crypto logger = logging.getLogger(__name__) def log_and_raise(msg, exception_type): ''' Log the message and raise an exception of specified type ''' logger.fatal(msg) raise exception_type(msg) def validate_ce...
import csv import logging import os from datetime import datetime from OpenSSL import crypto logger = logging.getLogger(__name__) def log_and_raise(msg, exception_type): ''' Log the message and raise an exception of specified type ''' logger.fatal(msg) raise exception_type(msg) def validate_ce...
Python
0.000001
da6650e96523f8be4dc2d95663ec8cf94cd9c3ba
Adjust the Whataburger spider
locations/spiders/whataburger.py
locations/spiders/whataburger.py
# -*- coding: utf-8 -*- import scrapy import json from locations.items import GeojsonPointItem class WhataburgerSpider(scrapy.Spider): name = "whataburger" allowed_domains = ["locations.whataburger.com"] start_urls = ( 'https://locations.whataburger.com/', ) def store_hours(self, store_h...
# -*- coding: utf-8 -*- import scrapy import json from locations.items import GeojsonPointItem class WhataburgerSpider(scrapy.Spider): name = "whataburger" allowed_domains = ["locations.whataburger.com"] start_urls = ( 'https://locations.whataburger.com/', ) def store_hours(self, store_h...
Python
0.998751
99e9ef79178d6e2dffd8ec7ed12b3edbd8b7d0f1
Add basket total to context
longclaw/longclawbasket/views.py
longclaw/longclawbasket/views.py
from django.shortcuts import render from django.views.generic import ListView from longclaw.longclawbasket.models import BasketItem from longclaw.longclawbasket import utils class BasketView(ListView): model = BasketItem template_name = "longclawbasket/basket.html" def get_context_data(self, **kwargs): ...
from django.shortcuts import render from django.views.generic import ListView from longclaw.longclawbasket.models import BasketItem from longclaw.longclawbasket import utils class BasketView(ListView): model = BasketItem template_name = "longclawbasket/basket.html" def get_context_data(self, **kwargs): ...
Python
0.99994
1d07732e0fae0dca9eae1d89de913a1e124e32fc
Disable some prod optimisations
lutrisweb/settings/production.py
lutrisweb/settings/production.py
import os from base import * # noqa DEBUG = False MEDIA_URL = '//lutris.net/media/' FILES_ROOT = '/srv/files' ALLOWED_HOSTS = ['.lutris.net', '.lutris.net.', ] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'lutris', 'USER': 'lutris', 'PASS...
import os from base import * # noqa DEBUG = False MEDIA_URL = '//lutris.net/media/' FILES_ROOT = '/srv/files' ALLOWED_HOSTS = ['.lutris.net', '.lutris.net.', ] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'lutris', 'USER': 'lutris', 'PASS...
Python
0
cd9fc5a6ea8925de67041408d96a63beccf573a2
add docopt
taksman.py
taksman.py
#!/usr/bin/env python """ Assignment management tool for school. Usage: taksman.py (-h | --help) taksman.py add <entry> taksman.py course taksman.py date taksman.py debug Examples: taksman.py add 033-reading Options: -h, --help """ import os import errno import re from pprint import pprint from docopt ...
#!/usr/bin/env python import os import errno import re from pprint import pprint def show_by_course(tasks): courses = set(tasks[name].get('course') for name in tasks) courses -= set([None]) courses = sorted(courses) for course in courses: print print "Course: %s" % course cours...
Python
0
616f2419774136b6cd98bc6dbee31bf39a99acea
add zhihu special spider
DataHouse/zhihu/zhihu_special_spider.py
DataHouse/zhihu/zhihu_special_spider.py
""" a web spider for Zhihu Special """ import random import os import time import logging import requests from pymongo import MongoClient import pandas as pd logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s', d...
""" a web spider for Zhihu Special """ import random import os import time import logging import requests from pymongo import MongoClient import pandas as pd logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s', d...
Python
0
362312ad1a26dbecf0c4942c9a6e7042cbaab3bd
Test the rest of Roman masters
test-mm.py
test-mm.py
from psautohint import autohint from psautohint import psautohint def getFonts(masters, baseDir): options = autohint.ACOptions() options.quiet = True fonts = [] infos = [] for master in masters: path = "%s/%s/font.ufo" % (baseDir, master) font = autohint.openUFOFile(path, None, Fal...
from psautohint import autohint from psautohint import psautohint def getFonts(masters, baseDir): options = autohint.ACOptions() options.quiet = True fonts = [] infos = [] for master in masters: path = "%s/%s/font.ufo" % (baseDir, master) font = autohint.openUFOFile(path, None, Fal...
Python
0.000002
6aa5e2c95c0f529aa2803395779ca7274d5795b1
Bump version to 1.0.1-machtfit-67
src/oscar/__init__.py
src/oscar/__init__.py
import os # Use 'dev', 'beta', or 'final' as the 4th element to indicate release type. VERSION = (1, 0, 1, 'machtfit', 67) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): return '{}.{}.{}-{}-{}'.format(*VERSION) # Cheeky setting that allows each template to be acces...
import os # Use 'dev', 'beta', or 'final' as the 4th element to indicate release type. VERSION = (1, 0, 1, 'machtfit', 66) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): return '{}.{}.{}-{}-{}'.format(*VERSION) # Cheeky setting that allows each template to be acces...
Python
0
d9c2bb2de79db80bc94509cb6a23de7f85e6e899
update tests
tests/test_pecanstreet_dataset_adapter.py
tests/test_pecanstreet_dataset_adapter.py
import sys sys.path.append('../') from disaggregator import PecanStreetDatasetAdapter import unittest class PecanStreetDatasetAdapterTestCase(unittest.TestCase): def setUp(self): db_url = "postgresql://USERNAME:PASSWORD@db.wiki-energy.org:5432/postgres" self.psda = PecanStreetDatasetAdapter(db_u...
import sys sys.path.append('../') from disaggregator import PecanStreetDatasetAdapter import unittest class PecanStreetDatasetAdapterTestCase(unittest.TestCase): def setUp(self): db_url = "postgresql://USERNAME:PASSWORD@db.wiki-energy.org:5432/postgres" self.psda = PecanStreetDatasetAdapter(db_u...
Python
0.000001
e1da85d46f84a35198959881b55196db4e0a67c4
Fix loading of description.yaml
lava_results_app/utils.py
lava_results_app/utils.py
import os import yaml import logging import subprocess from django.utils.translation import ungettext_lazy from django.conf import settings from django.http import Http404 from linaro_django_xmlrpc.models import AuthToken def help_max_length(max_length): return ungettext_lazy( # pylint: disable=no-member ...
import os import yaml import logging import subprocess from django.utils.translation import ungettext_lazy from django.conf import settings from django.http import Http404 from linaro_django_xmlrpc.models import AuthToken def help_max_length(max_length): return ungettext_lazy( # pylint: disable=no-member ...
Python
0.000155
52ebe157585019c9be01b22638fff924ba328892
Increase delay (to fix tests that are failing randomly on travis but are always passing on my locale machine)
test/test_modes/test_goto_assignments.py
test/test_modes/test_goto_assignments.py
""" Test the autocomplete mode """ from pyqode.core.api import TextHelper from pyqode.qt import QtCore, QtWidgets from pyqode.qt.QtTest import QTest from pyqode.python import modes as pymodes from test.helpers import editor_open def get_mode(editor): return editor.modes.get(pymodes.GoToAssignmentsMode) @editor_...
""" Test the autocomplete mode """ from pyqode.core.api import TextHelper from pyqode.qt import QtCore, QtWidgets from pyqode.qt.QtTest import QTest from pyqode.python import modes as pymodes from test.helpers import editor_open def get_mode(editor): return editor.modes.get(pymodes.GoToAssignmentsMode) @editor_...
Python
0
93f912b9eb3a17ab24b0a7a67ad2297a7bae6e91
Fix .aar building on Mac
tensorflow/lite/java/aar_with_jni.bzl
tensorflow/lite/java/aar_with_jni.bzl
"""Generate zipped aar file including different variants of .so in jni folder.""" load("@build_bazel_rules_android//android:rules.bzl", "android_binary") def aar_with_jni( name, android_library, headers = None, flatten_headers = False): """Generates an Android AAR given an Android ...
"""Generate zipped aar file including different variants of .so in jni folder.""" load("@build_bazel_rules_android//android:rules.bzl", "android_binary") def aar_with_jni( name, android_library, headers = None, flatten_headers = False): """Generates an Android AAR given an Android ...
Python
0.000002
eb5d7f91286779ff0f3b6d7c829967f74ef1db7a
replace managers by plain functions
testbot.py
testbot.py
# -*- coding: utf-8 -*- from bot import Tofbot import unittest from collections import namedtuple def print_resp(msg): print (" -> %s" % msg) class TestTofbot(Tofbot): def __init__(self, nick, name, chan, origin): chans = [chan] self.nick = nick Tofbot.__init__(self, nick, name, ch...
# -*- coding: utf-8 -*- from bot import Tofbot import unittest from collections import namedtuple def print_resp(msg): print (" -> %s" % msg) class TestTofbot(Tofbot): def __init__(self, nick, name, chan, origin): chans = [chan] self.nick = nick Tofbot.__init__(self, nick, name, ch...
Python
0.000041
48e280177123902001e4ff6fb3e178190b435054
fix test for Exscript.workqueue.MainLoop.
tests/Exscript/workqueue/MainLoopTest.py
tests/Exscript/workqueue/MainLoopTest.py
import sys, unittest, re, os.path, threading sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..', 'src')) from Exscript.workqueue import MainLoop from Exscript.workqueue.Job import ProcessJob class MainLoopTest(unittest.TestCase): CORRELATE = MainLoop def setUp(self): pass ...
import sys, unittest, re, os.path, threading sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..', 'src')) from Exscript.workqueue import MainLoop class MainLoopTest(unittest.TestCase): CORRELATE = MainLoop def setUp(self): pass def testMainLoop(self): lock = threa...
Python
0
f62c53af583657ee13d220edbb25803bbc3c9c22
Fix style
tests/cupy_tests/core_tests/test_core.py
tests/cupy_tests/core_tests/test_core.py
import unittest import numpy import cupy from cupy.core import core class TestGetSize(unittest.TestCase): def test_none(self): self.assertEqual(core.get_size(None), ()) def test_list(self): self.assertEqual(core.get_size([1, 2]), (1, 2)) def test_tuple(self): self.assertEqual(...
import unittest import numpy import cupy from cupy.core import core class TestGetSize(unittest.TestCase): def test_none(self): self.assertEqual(core.get_size(None), ()) def test_list(self): self.assertEqual(core.get_size([1, 2]), (1, 2)) def test_tuple(self): self.assertEqual(...
Python
0.000001
523216bbf6f21757651e41ac307bc296041b7963
load nonlinux_config if the platform is not linux
tests/docker/test_async_docker_client.py
tests/docker/test_async_docker_client.py
import os import sys import warnings from tornado.testing import AsyncTestCase, gen_test from remoteappmanager.docker.async_docker_client import AsyncDockerClient from tests.docker.config import nonlinux_config from tests import utils class TestAsyncDockerClient(AsyncTestCase): def setUp(self): super().s...
import os import warnings from tornado.testing import AsyncTestCase, gen_test from remoteappmanager.docker.async_docker_client import AsyncDockerClient from tests.docker.config import nonlinux_config from tests import utils class TestAsyncDockerClient(AsyncTestCase): def setUp(self): super().setUp() ...
Python
0.000477
6bec22cd51288c94dff40cf0c973b975538040d5
Increase timeout for test_long_running_job test
tests/integration/minion/test_timeout.py
tests/integration/minion/test_timeout.py
# -*- coding: utf-8 -*- ''' Tests for various minion timeouts ''' # Import Python libs from __future__ import absolute_import import os import sys import salt.utils.platform # Import Salt Testing libs from tests.support.case import ShellCase class MinionTimeoutTestCase(ShellCase): ''' Test minion timing fu...
# -*- coding: utf-8 -*- ''' Tests for various minion timeouts ''' # Import Python libs from __future__ import absolute_import import os import sys import salt.utils.platform # Import Salt Testing libs from tests.support.case import ShellCase class MinionTimeoutTestCase(ShellCase): ''' Test minion timing fu...
Python
0.000008
ce391c53f46c9eddcc8293081d7b62c8cca91cfc
Add regression test for #44299
tests/integration/states/test_pkgrepo.py
tests/integration/states/test_pkgrepo.py
# -*- coding: utf-8 -*- ''' tests for pkgrepo states ''' # Import Python libs from __future__ import absolute_import # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin from tests.support.unit import skipIf from tests.support.helpers import ( ...
# -*- coding: utf-8 -*- ''' tests for pkgrepo states ''' # Import Python libs from __future__ import absolute_import # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin from tests.support.unit import skipIf from tests.support.helpers import ( ...
Python
0.000001
0bb2ebc52e720a3d693ca14f3621fd710ea36d4b
use make_result_iq
tests/twisted/vcard/test-avatar-async.py
tests/twisted/vcard/test-avatar-async.py
""" Test support for retrieving avatars asynchronously using RequestAvatars. """ import base64 import hashlib from servicetest import EventPattern from gabbletest import exec_test, acknowledge_iq, make_result_iq def test(q, bus, conn, stream): conn.Connect() _, iq_event = q.expect_many( EventPattern...
""" Test support for retrieving avatars asynchronously using RequestAvatars. """ import base64 import hashlib from servicetest import EventPattern from gabbletest import exec_test, acknowledge_iq def test(q, bus, conn, stream): conn.Connect() _, iq_event = q.expect_many( EventPattern('dbus-signal', ...
Python
0.000003
cf4d8318557d971cee1869fe8cbac82cc6316020
Change expected exception
plotly/tests/test_core/test_file/test_file.py
plotly/tests/test_core/test_file/test_file.py
""" test_meta: ========== A module intended for use with Nose. """ import random import string import requests from unittest import TestCase from nose.plugins.attrib import attr import plotly.plotly as py from plotly.exceptions import PlotlyRequestError @attr('slow') class FolderAPITestCase(TestCase): def se...
""" test_meta: ========== A module intended for use with Nose. """ import random import string import requests from unittest import TestCase from nose.plugins.attrib import attr import plotly.plotly as py from plotly.exceptions import PlotlyRequestError @attr('slow') class FolderAPITestCase(TestCase): def se...
Python
0.000002
6cfc94d8a03439c55808090aa5e3a4f35c288887
Use assert_allclose so we can see the appveyor failure
menpodetect/tests/opencv_test.py
menpodetect/tests/opencv_test.py
from numpy.testing import assert_allclose from menpodetect.opencv import (load_opencv_frontal_face_detector, load_opencv_eye_detector) import menpo.io as mio takeo = mio.import_builtin_asset.takeo_ppm() def test_frontal_face_detector(): takeo_copy = takeo.copy() opencv_detecto...
from menpodetect.opencv import (load_opencv_frontal_face_detector, load_opencv_eye_detector) import menpo.io as mio takeo = mio.import_builtin_asset.takeo_ppm() def test_frontal_face_detector(): takeo_copy = takeo.copy() opencv_detector = load_opencv_frontal_face_detector() ...
Python
0
b8d0a7cbac6ab2415a1d059a1f68428e9312f3cb
Make our error page handlers work on Django 2.0 (#969)
judge/views/error.py
judge/views/error.py
import traceback from django.shortcuts import render from django.utils.translation import gettext as _ def error(request, context, status): return render(request, 'error.html', context=context, status=status) def error404(request, exception=None): # TODO: "panic: go back" return render(request, 'generi...
import traceback from django.shortcuts import render from django.utils.translation import gettext as _ def error(request, context, status): return render(request, 'error.html', context=context, status=status) def error404(request): # TODO: "panic: go back" return render(request, 'generic-message.html',...
Python
0
4e92dabe65416a3a751a0b38e75512b6daa1ba38
Remove useless imports
ticketshop/ticketapp/tests/test_views.py
ticketshop/ticketapp/tests/test_views.py
from django.test import Client from django.contrib.auth.models import User from django.test import TestCase from ..models import TicketType, TicketPurchase class TicketPurchaseViewTest(TestCase): def test_getForm(self): """ Test that we can get the purchase form """ self.assertCon...
from django.test import Client from django.contrib.auth.models import User from django.contrib.messages.storage.base import Message from django.contrib.messages.constants import ERROR from django.test import TestCase from ..models import TicketType, Ticket, TicketPurchase, Coupon class TicketPurchaseViewTest(TestCase...
Python
0.000007
bec1d224771daefd9ce18c81b14f550e59b1577a
DidelEntity.__getattr__ raises the correct exception
didel/base.py
didel/base.py
# -*- coding: UTF-8 -*- try: from urlparse import urljoin except ImportError: # Python 3 from urllib.parse import urljoin from bs4 import BeautifulSoup ROOT_URL = 'http://didel.script.univ-paris-diderot.fr' class DidelError(Exception): """ Base exception for Didel errors """ pass class D...
# -*- coding: UTF-8 -*- try: from urlparse import urljoin except ImportError: # Python 3 from urllib.parse import urljoin from bs4 import BeautifulSoup ROOT_URL = 'http://didel.script.univ-paris-diderot.fr' class DidelError(Exception): """ Base exception for Didel errors """ pass class D...
Python
0.195904
31e3f4486eba2d933582a00a643700ac2f51ab56
add blank string for null colmun
optional/_data_generation/create_SNPChrPosOnRef_bcp_with_allele.py
optional/_data_generation/create_SNPChrPosOnRef_bcp_with_allele.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import re import gzip from pyfasta import Fasta path_to_fasta = sys.argv[1] path_to_bcp = sys.argv[2] # GRCh37.p13 # $ wget -r ftp://ftp.ncbi.nlm.nih.gov/genbank/genomes/Eukaryotes/vertebrates_mammals/Homo_sapiens/GRCh37.p13/Primary_Assembly/assembled_chromoso...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import re import gzip from pyfasta import Fasta path_to_fasta = sys.argv[1] path_to_bcp = sys.argv[2] # GRCh37.p13 # $ wget -r ftp://ftp.ncbi.nlm.nih.gov/genbank/genomes/Eukaryotes/vertebrates_mammals/Homo_sapiens/GRCh37.p13/Primary_Assembly/assembled_chromoso...
Python
0.999683
1f98e497136ce3d9da7e63a6dc7c3f67fedf50b5
Save the observation if the form was valid.
observations/views.py
observations/views.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import messages from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.views.generic.edit import FormView from braces.views import LoginRequiredMixin from .forms import O...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import messages from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.views.generic.edit import FormView from braces.views import LoginRequiredMixin from .forms import O...
Python
0.000001
6353dd8caa3656b8c37280bcccd56cfaa78ff67a
Add API for making authenticated API requests
valohai_cli/api.py
valohai_cli/api.py
import platform from urllib.parse import urljoin, urlparse import requests from click.globals import get_current_context from requests.auth import AuthBase from valohai_cli import __version__ as VERSION from valohai_cli.exceptions import APIError, ConfigurationError from valohai_cli.settings import settings from valo...
import platform from urllib.parse import urljoin, urlparse import requests from requests.auth import AuthBase from valohai_cli import __version__ as VERSION from valohai_cli.exceptions import APIError, ConfigurationError from valohai_cli.settings import settings class TokenAuth(AuthBase): def __init__(self, net...
Python
0.000001
513b2ca1d3499e3786f1769ce67c41ba16b70419
switch the default prompt to "" from None
virtualenv/core.py
virtualenv/core.py
import sys import click from virtualenv import __version__ from virtualenv.builders.legacy import LegacyBuilder from virtualenv.builders.venv import VenvBuilder def select_builder(python, builders=None): # Determine what Python we're going to be using. If this is None we'll use # the Python which we're curr...
import sys import click from virtualenv import __version__ from virtualenv.builders.legacy import LegacyBuilder from virtualenv.builders.venv import VenvBuilder def select_builder(python, builders=None): # Determine what Python we're going to be using. If this is None we'll use # the Python which we're curr...
Python
0.999907
1b2a1bb5f4c99f80c3664a40796939732e9fe91c
bump dev version
bndl/__init__.py
bndl/__init__.py
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...
Python
0
ee3ee6810f1f8fcc535e29f0f2a2af425dcea7c4
add db_handler instance to lint_github
lintable_lintball/lintball.py
lintable_lintball/lintball.py
# Copyright 2015-2016 Capstone Team G # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# Copyright 2015-2016 Capstone Team G # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
0
b159d28dc965e60843f2617b4ae40d6c04cd2604
Optimize sensitive areas API
geotrek/api/v2/views/sensitivity.py
geotrek/api/v2/views/sensitivity.py
from __future__ import unicode_literals from django.conf import settings from django.db.models import F, Case, When from django_filters.rest_framework.backends import DjangoFilterBackend from rest_framework.permissions import IsAuthenticatedOrReadOnly from geotrek.api.v2 import serializers as api_serializers, \ v...
from __future__ import unicode_literals from django.conf import settings from django.db.models import F, Case, When from django_filters.rest_framework.backends import DjangoFilterBackend from rest_framework.permissions import IsAuthenticatedOrReadOnly from geotrek.api.v2 import serializers as api_serializers, \ v...
Python
0.000001
9433fa8970341cb2d024bceb0e23e93fbfb71393
Update python test
solidity/python/FormulaTestSale.py
solidity/python/FormulaTestSale.py
from sys import argv from decimal import Decimal from random import randrange from Formula import calculateSaleReturn def formulaTest(supply,reserve,ratio,amount): fixed = Decimal(calculateSaleReturn(supply,reserve,ratio,amount)) real = Decimal(reserve)*(1-(1-Decimal(amount)/Decimal(supply))**(100/Decim...
from sys import argv from decimal import Decimal from random import randrange from Formula import calculateSaleReturn def formulaTest(supply,reserve,ratio,amount): fixed = Decimal(calculateSaleReturn(supply,reserve,ratio,amount)) real = Decimal(reserve)*(1-(1-Decimal(amount)/Decimal(supply))**(100/Decim...
Python
0.000001
e364bdf7723ca45ac1000eda13a76cf1b19f0ad8
Remove a debug print
plugins/plugin_node_manager/src/plugin_node_manager/launch_item.py
plugins/plugin_node_manager/src/plugin_node_manager/launch_item.py
#!/usr/bin/env python ################################################################################ # # Copyright Airbus Group SAS 2015 # All rigths reserved. # # File Name : setup.py # Authors : Martin Matignon # # If you find any bug or if you have any question please contact # Adolfo Suarez Roos <adolfo.suarez@ai...
#!/usr/bin/env python ################################################################################ # # Copyright Airbus Group SAS 2015 # All rigths reserved. # # File Name : setup.py # Authors : Martin Matignon # # If you find any bug or if you have any question please contact # Adolfo Suarez Roos <adolfo.suarez@ai...
Python
0.000028
3c916451ebb584a72fb0a92c2a577427ff10003c
Make Height Change Also Be A Valid Ping
dataserv/Farmer.py
dataserv/Farmer.py
import hashlib from dataserv.run import db from datetime import datetime from sqlalchemy import DateTime from dataserv.Validator import is_btc_address def sha256(content): """Finds the sha256 hash of the content.""" content = content.encode('utf-8') return hashlib.sha256(content).hexdigest() class Farme...
import hashlib from dataserv.run import db from datetime import datetime from sqlalchemy import DateTime from dataserv.Validator import is_btc_address def sha256(content): """Finds the sha256 hash of the content.""" content = content.encode('utf-8') return hashlib.sha256(content).hexdigest() class Farme...
Python
0
31caceefaa2f6b6dc7d2601d8537e613ce600743
Use account's static groups instead of a conversation's groups for dialogue group state
go/apps/dialogue/view_definition.py
go/apps/dialogue/view_definition.py
import json from django.http import HttpResponse from django.forms import Form from go.api.go_api import client from go.api.go_api.client import GoApiError from go.conversation.view_definition import ( ConversationViewDefinitionBase, ConversationTemplateView) class DialogueEditView(ConversationTemplateView): ...
import json from django.http import HttpResponse from django.forms import Form from go.api.go_api import client from go.api.go_api.client import GoApiError from go.conversation.view_definition import ( ConversationViewDefinitionBase, ConversationTemplateView) class DialogueEditView(ConversationTemplateView): ...
Python
0.000001
513817ef4ede24ce7609afb9d025107d8f96532b
Fix test on Windows
gouda/tests/test_decode_barcodes.py
gouda/tests/test_decode_barcodes.py
import unittest import shutil from pathlib import Path from gouda.engines import ZbarEngine from gouda.scripts.decode_barcodes import main from utils import temp_directory_with_files TESTDATA = Path(__file__).parent.joinpath('test_data') @unittest.skipUnless(ZbarEngine.available(), 'ZbarEngine unavailable') clas...
import unittest import shutil from pathlib import Path from gouda.engines import ZbarEngine from gouda.scripts.decode_barcodes import main from utils import temp_directory_with_files TESTDATA = Path(__file__).parent.joinpath('test_data') @unittest.skipUnless(ZbarEngine.available(), 'ZbarEngine unavailable') clas...
Python
0
883cd72c33ae434f8452ca6923eaa2aa8dfd5f3d
Access key tests.
src/encoded/tests/test_access_key.py
src/encoded/tests/test_access_key.py
import pytest def basic_auth(username, password): from base64 import b64encode return 'Basic ' + b64encode('%s:%s' % (username, password)) @pytest.datafixture def access_keys(app): from webtest import TestApp environ = { 'HTTP_ACCEPT': 'application/json', 'REMOTE_USER': 'TEST', }...
import pytest @pytest.fixture def users(testapp): from .sample_data import URL_COLLECTION url = '/users/' users = [] for item in URL_COLLECTION[url]: res = testapp.post_json(url, item, status=201) principals = [ 'system.Authenticated', 'system.Everyone', ...
Python
0
db22f7a508524409f5e03fdbcbf6a394670ebbde
Use built-in auth views
sweettooth/auth/urls.py
sweettooth/auth/urls.py
from django.conf.urls.defaults import patterns, url from django.views.generic import TemplateView urlpatterns = patterns('', url(r'login/$', 'django.contrib.auth.views.login', dict(template_name='login.html'), name='login'), url(r'logout/$', 'django.contrib.auth.views.logout', dict(template_na...
from django.conf.urls.defaults import patterns, url from django.views.generic import TemplateView urlpatterns = patterns('', url(r'login/$', 'django.contrib.auth.views.login', dict(template_name='login.html'), name='login'), url(r'logout/$', 'django.contrib.auth.views.logout', name='logout'), url(r'regist...
Python
0.000001
91a30d8e5cd18e3c5e6c5f00e48f44d6b33346b5
clean up cache initialization in mail completer
roles/dotfiles/files/.vim/rplugin/python3/deoplete/sources/mail.py
roles/dotfiles/files/.vim/rplugin/python3/deoplete/sources/mail.py
from .base import Base from itertools import chain from deoplete.util import parse_buffer_pattern, getlines import re from subprocess import PIPE, Popen import string class Source(Base): def __init__(self, vim): super().__init__(vim) self.filetypes = ['mail'] self.name = 'mail' s...
from .base import Base from itertools import chain from deoplete.util import parse_buffer_pattern, getlines import re from subprocess import PIPE, Popen import string class Source(Base): def __init__(self, vim): super().__init__(vim) self.filetypes = ['mail'] self.name = 'mail' s...
Python
0.000001
87d2780a710e98c3b824583a2cf2607461bce35c
remove an unnecessary import
roles/dotfiles/files/.vim/rplugin/python3/deoplete/sources/mail.py
roles/dotfiles/files/.vim/rplugin/python3/deoplete/sources/mail.py
from .base import Base from itertools import chain from deoplete.util import parse_buffer_pattern, getlines import re from subprocess import PIPE, Popen class Source(Base): def __init__(self, vim): super().__init__(vim) self.filetypes = ['mail'] self.name = 'mail' self.mark = '[@...
from .base import Base from itertools import chain from deoplete.util import parse_buffer_pattern, getlines import re from subprocess import PIPE, Popen import string class Source(Base): def __init__(self, vim): super().__init__(vim) self.filetypes = ['mail'] self.name = 'mail' s...
Python
0.000005
92f0dd46bbc1f6fa8d9539d026d6ec1e968cbcfc
Drop inaccessible code from singleton.py
sympy/core/singleton.py
sympy/core/singleton.py
"""Singleton mechanism""" from .assumptions import ManagedProperties class SingletonRegistry(object): """ A map from singleton classes to the corresponding instances. """ def __init__(self): self._classes_to_install = {} # Dict of classes that have been registered, but that have not ...
"""Singleton mechanism""" from .assumptions import ManagedProperties class SingletonRegistry(object): """ A map from singleton classes to the corresponding instances. """ def __init__(self): self._classes_to_install = {} # Dict of classes that have been registered, but that have not ...
Python
0.000001
32fba62d157953eaeea6e5885a7ea860632a1945
rename filter function and set the second parameter as required
sync_settings/helper.py
sync_settings/helper.py
# -*- coding: utf-8 -*- import os, re from urllib import parse def getDifference (setA, setB): return list(filter(lambda el: el not in setB, setA)) def getHomePath (fl = ""): if isinstance(fl, str) and fl != "": return joinPath((os.path.expanduser('~'), fl)) return os.path.expanduser('~') def existsPath(p...
# -*- coding: utf-8 -*- import os, re from urllib import parse def getDifference (setA, setB): return list(filter(lambda el: el not in setB, setA)) def getHomePath (fl = ""): if isinstance(fl, str) and fl != "": return joinPath((os.path.expanduser('~'), fl)) return os.path.expanduser('~') def existsPath(p...
Python
0
9d53e369e9757c659c72ca1e8bbb8eea8080ab2d
Add possiblity to pass an output stream to the update method
updater.py
updater.py
import configparser import hashlib import json import os import sys import requests def go_through_files(cur_dir, data, repo_name, bw_list, is_whitelist, output): updated = False for content in data: path = os.path.join(cur_dir, content['name']) print(path, file=output) # check if fi...
import configparser import hashlib import json import os import requests def go_through_files(cur_dir, data, repo_name, bw_list, is_whitelist): updated = False for content in data: path = os.path.join(cur_dir, content['name']) print(path) # check if file is in the black/whitelist ...
Python
0
c3c703c6d8b434da40beef6202bf2cbdc01e50a1
Add configured tests
gym/wrappers/tests/test_wrappers.py
gym/wrappers/tests/test_wrappers.py
import gym from gym import error from gym import wrappers from gym.wrappers import SkipWrapper import tempfile import shutil def test_skip(): every_two_frame = SkipWrapper(2) env = gym.make("FrozenLake-v0") env = every_two_frame(env) obs = env.reset() env.render() def test_configured(): env ...
import gym from gym import error from gym import wrappers from gym.wrappers import SkipWrapper import tempfile import shutil def test_skip(): every_two_frame = SkipWrapper(2) env = gym.make("FrozenLake-v0") env = every_two_frame(env) obs = env.reset() env.render() def test_no_double_wrapping():...
Python
0.000001
fa0174185832fac608cc1b65255231a73aac630a
fix evacuate call on branched lient
healing/handler_plugins/evacuate.py
healing/handler_plugins/evacuate.py
from healing.handler_plugins import base from healing import exceptions from healing.openstack.common import log as logging from healing import utils LOG = logging.getLogger(__name__) class Evacuate(base.HandlerPluginBase): """evacuate VM plugin. Data format in action_meta is: 'evacuate_host': True...
from healing.handler_plugins import base from healing import exceptions from healing.openstack.common import log as logging from healing import utils LOG = logging.getLogger(__name__) class Evacuate(base.HandlerPluginBase): """evacuate VM plugin. Data format in action_meta is: 'evacuate_host': True...
Python
0
5336ff3967f4e297237045ca0914ae5257e3a767
fix csv output in one autoplot
htdocs/plotting/auto/scripts/p92.py
htdocs/plotting/auto/scripts/p92.py
import psycopg2.extras import pyiem.nws.vtec as vtec import datetime import pandas as pd def get_description(): """ Return a dict describing how to call this plotter """ d = dict() d['data'] = True d['cache'] = 3600 d['description'] = """This map depicts the number of days since a Weather Fore...
import psycopg2.extras import pyiem.nws.vtec as vtec import datetime import pandas as pd def get_description(): """ Return a dict describing how to call this plotter """ d = dict() d['data'] = True d['cache'] = 3600 d['description'] = """This map depicts the number of days since a Weather Fore...
Python
0.000046
a8d639cbac2439c0079b86b72dd3daee6505e9d0
Update version file
version.py
version.py
"""Versioning controlled via Git Tag, check setup.py""" __version__ = "0.3.3"
"""Versioning controlled via Git Tag, check setup.py""" __version__ = "0.3.2"
Python
0
50a5644e2f4ea4bcc425c4a8ae2ebe230ce7af3d
implement the logic
python/docker_tool/detect_big_docker_image.py
python/docker_tool/detect_big_docker_image.py
# -*- coding: utf-8 -*- #!/usr/bin/python ##------------------------------------------------------------------- ## @copyright 2017 DennyZhang.com ## Licensed under MIT ## https://raw.githubusercontent.com/DennyZhang/devops_public/master/LICENSE ## ## File : detect_big_docker_image.py ## Author : Denny <denny@dennyzha...
# -*- coding: utf-8 -*- #!/usr/bin/python ##------------------------------------------------------------------- ## @copyright 2017 DennyZhang.com ## Licensed under MIT ## https://raw.githubusercontent.com/DennyZhang/devops_public/master/LICENSE ## ## File : detect_big_docker_image.py ## Author : Denny <denny@dennyzha...
Python
0.999999
137b20e4aa779be3c97c500ab485126085492ce5
comment format
pywikibot/families/scratchpad_wikia_family.py
pywikibot/families/scratchpad_wikia_family.py
# -*- coding: utf-8 -*- from pywikibot import family class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'scratchpad_wikia' self.langs = { 'de':'de.mini.wikia.com', 'en':'scratchpad.wikia.com', 'fr':'bloc-notes.wiki...
# -*- coding: utf-8 -*- from pywikibot import family class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'scratchpad_wikia' self.langs = { 'de':'de.mini.wikia.com', 'en':'scratchpad.wikia.com', 'fr':'bloc-notes.wiki...
Python
0.000001
c898b68fa8d81963b7a5282e67ecb28764bbd0a3
Add comment explaining mocking
tests/app/models/test_contact_list.py
tests/app/models/test_contact_list.py
from datetime import datetime from app.models.contact_list import ContactList from app.models.job import PaginatedJobs def test_created_at(): created_at = ContactList({'created_at': '2016-05-06T07:08:09.061258'}).created_at assert isinstance(created_at, datetime) assert created_at.isoformat() == '2016-05...
from datetime import datetime from app.models.contact_list import ContactList from app.models.job import PaginatedJobs def test_created_at(): created_at = ContactList({'created_at': '2016-05-06T07:08:09.061258'}).created_at assert isinstance(created_at, datetime) assert created_at.isoformat() == '2016-05...
Python
0
cfe2c5b405cc5cc74fed81e506e717698236f608
debug print lines
yumoter.py
yumoter.py
#!/usr/bin/env python2 import sys, os, json, errno, subprocess, yum class yumoter: def __init__(self, configFile, repobasepath): self.repobasepath = repobasepath self.reloadConfig(configFile) self.yb = yum.YumBase() self.yb.setCacheDir() def reloadConfig(self, jsonFile): ...
#!/usr/bin/env python2 import sys, os, json, errno, subprocess, yum class yumoter: def __init__(self, configFile, repobasepath): self.repobasepath = repobasepath self.reloadConfig(configFile) self.yb = yum.YumBase() self.yb.setCacheDir() def reloadConfig(self, jsonFile): ...
Python
0.000003
39c34860fa9992f38892aa026c5b0c6547bd4b23
Fix flaky evergreen test
tests/content/test_content_manager.py
tests/content/test_content_manager.py
from django.test import override_settings from django.utils import timezone from bulbs.campaigns.models import Campaign from bulbs.content.models import Content from bulbs.utils.test import make_content, BaseIndexableTestCase from example.testcontent.models import TestContentObj, TestContentObjTwo class ContentMana...
from django.test import override_settings from django.utils import timezone from bulbs.campaigns.models import Campaign from bulbs.content.models import Content from bulbs.utils.test import make_content, BaseIndexableTestCase from example.testcontent.models import TestContentObj, TestContentObjTwo class ContentMana...
Python
0.000003
3c82d0ca4a314ffd052b99ece7afec6aaea4e063
Update BatchKwargs to_id tests
tests/datasource/test_batch_kwargs.py
tests/datasource/test_batch_kwargs.py
import pytest import os from freezegun import freeze_time try: from unittest import mock except ImportError: import mock from great_expectations.datasource.types import * def test_batch_kwargs_fingerprint(): test_batch_kwargs = PathBatchKwargs( { "path": "/data/test.csv" } ...
import pytest import os from freezegun import freeze_time try: from unittest import mock except ImportError: import mock from great_expectations.datasource.types import * @freeze_time("1955-11-05") def test_batch_kwargs_fingerprint(): test_batch_kwargs = PathBatchKwargs( { "path": ...
Python
0
8c8bc1ef8e3ba7519d4612856a420ed410974e12
add redactor on installed apps settings
opps/core/__init__.py
opps/core/__init__.py
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from django.conf import settings trans_app_label = _('Opps') settings.INSTALLED_APPS += ('redactor',)
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ trans_app_label = _('Opps')
Python
0
9412b362b649a8eaa62448bef5772b0f001efdbb
Remove the download syncing as it's no longer part of Conveyor
conveyor/core.py
conveyor/core.py
from __future__ import absolute_import from __future__ import division import bz2 import csv import logging import logging.config import io import time import urlparse import lxml.html import redis import requests import slumber import yaml from apscheduler.scheduler import Scheduler from conveyor.processor import...
from __future__ import absolute_import from __future__ import division import bz2 import csv import logging import logging.config import io import time import urlparse import lxml.html import redis import requests import slumber import yaml from apscheduler.scheduler import Scheduler from conveyor.processor import...
Python
0
6a02c5e1844ad7d1b9ae50cd5dbae6975fb685ee
Make internal error more clear
numba/error.py
numba/error.py
import traceback def format_pos(node): if node is not None and hasattr(node, 'lineno'): return "%s:%s: " % (node.lineno, node.col_offset) else: return "" class NumbaError(Exception): "Some error happened during compilation" def __init__(self, node, msg=None, *args): if msg is ...
import traceback def format_pos(node): if node is not None and hasattr(node, 'lineno'): return "%s:%s: " % (node.lineno, node.col_offset) else: return "" class NumbaError(Exception): "Some error happened during compilation" def __init__(self, node, msg=None, *args): if msg is ...
Python
0.000321
619269367c9e38fe55ae8667ead8486f63467d2b
Fix case where apache passes DN in the format we expect rather than ssl format.
src/python/apache_utils.py
src/python/apache_utils.py
""" Apache Utils. Tools for dealing with credential checking from X509 SSL certificates. These are useful when using Apache as a reverse proxy to check user credentials against a local DB. """ from collections import namedtuple import cherrypy from sqlalchemy_utils import create_db, db_session from tables import Users...
""" Apache Utils. Tools for dealing with credential checking from X509 SSL certificates. These are useful when using Apache as a reverse proxy to check user credentials against a local DB. """ from collections import namedtuple import cherrypy from sqlalchemy_utils import create_db, db_session from tables import Users...
Python
0
429bf52eb482955cfe195708898ce275e1a72dcb
Validate input.
src/devilry_qualifiesforexam/devilry_qualifiesforexam/rest/preview.py
src/devilry_qualifiesforexam/devilry_qualifiesforexam/rest/preview.py
from djangorestframework.views import View from djangorestframework.permissions import IsAuthenticated from djangorestframework.response import ErrorResponse from djangorestframework import status as statuscodes from django.shortcuts import get_object_or_404 from devilry_qualifiesforexam.pluginhelpers import create_se...
from djangorestframework.views import View from djangorestframework.permissions import IsAuthenticated from django.shortcuts import get_object_or_404 from devilry_qualifiesforexam.pluginhelpers import create_sessionkey from devilry.apps.core.models import Period from devilry.utils.groups_groupedby_relatedstudent_and_a...
Python
0.000017
8ab7ad1f6aee485c64a7e1347c76e628cc820ba8
add some docker Builder args
src/py/gopythongo/builders/docker.py
src/py/gopythongo/builders/docker.py
# -* encoding: utf-8 *- import argparse import gopythongo.shared.docker_args from gopythongo.utils import print_info, highlight from gopythongo.builders import BaseBuilder from typing import Any class DockerBuilder(BaseBuilder): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*ar...
# -* encoding: utf-8 *- import argparse import gopythongo.shared.docker_args from gopythongo.utils import print_info, highlight from gopythongo.builders import BaseBuilder from typing import Any class DockerBuilder(BaseBuilder): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*ar...
Python
0
6248a0b813fc6598d964639ad696ecd506015918
Rename to TaarifaAPI
taarifa_api/settings.py
taarifa_api/settings.py
"""Global API configuration.""" from os import environ from urlparse import urlparse from schemas import facility_schema, request_schema, resource_schema, \ service_schema API_NAME = 'TaarifaAPI' URL_PREFIX = 'api' if 'EVE_DEBUG' in environ: DEBUG = True if 'MONGOLAB_URI' in environ: url = urlparse(envi...
"""Global API configuration.""" from os import environ from urlparse import urlparse from schemas import facility_schema, request_schema, resource_schema, \ service_schema API_NAME = 'Taarifa' URL_PREFIX = 'api' if 'EVE_DEBUG' in environ: DEBUG = True if 'MONGOLAB_URI' in environ: url = urlparse(environ...
Python
0.999999
ab8930c771d71c09186f94fb554ee0e6d82cea43
Remove ignore source from multi push notification commands #11
notification/management/commands/multipush.py
notification/management/commands/multipush.py
from django.core.exceptions import ObjectDoesNotExist from django.core.management.base import BaseCommand from notification.apns.apns import APNs, Payload, PayloadAlert from notification.models import DeviceToken, CertFile import logging import os.path import random import sys CERT_FILE_UPLOAD_DIR = os.path.join( ...
from django.core.exceptions import ObjectDoesNotExist from django.core.management.base import BaseCommand from notification.apns.apns import APNs, Frame, Payload, PayloadAlert from notification.models import DeviceToken, CertFile import logging import os.path import random import sys import time CERT_FILE_UPLOAD_DIR...
Python
0
059a799b9c347b6abfcd2daa3678d98cd0884210
Add "no cover" to teardown() and handle_address_delete() on TiedModelRealtimeSignalProcessor. These are never called.
ovp_search/signals.py
ovp_search/signals.py
from django.db import models from haystack import signals from ovp_projects.models import Project from ovp_organizations.models import Organization from ovp_core.models import GoogleAddress class TiedModelRealtimeSignalProcessor(signals.BaseSignalProcessor): """ TiedModelRealTimeSignalProcessor handles updates...
from django.db import models from haystack import signals from ovp_projects.models import Project from ovp_organizations.models import Organization from ovp_core.models import GoogleAddress class TiedModelRealtimeSignalProcessor(signals.BaseSignalProcessor): """ TiedModelRealTimeSignalProcessor handles updates...
Python
0
2f357ac185e7728e0a0afec6827500c78a4b2796
Update SavedModel example to use serialized tf Example. Change: 135378723
tensorflow/python/saved_model/example/saved_model_half_plus_two.py
tensorflow/python/saved_model/example/saved_model_half_plus_two.py
## Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
## Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
Python
0
e8a29a6af8856c2957ed93a2da31b62916b6694d
add git support and support passing project_name in VersionControl __init__
deps/__init__.py
deps/__init__.py
import os import sys import shutil import logging import urlparse logger = logging.getLogger('deps') logger.setLevel(logging.DEBUG) logger.addHandler(logging.StreamHandler()) class MissingDependency(Exception): pass class VersionControl(object): def __init__(self, url, root, app_name=None, project_name=No...
import os import sys import shutil import logging import urlparse logger = logging.getLogger('deps') logger.setLevel(logging.DEBUG) logger.addHandler(logging.StreamHandler()) class MissingDependency(Exception): pass class VersionControl(object): def __init__(self, url, root, app_name='', project_name=''):...
Python
0
b2ed2050fdab7ba1052e33786c0a0868333114c4
Update treeviz_example.py
open_spiel/python/examples/treeviz_example.py
open_spiel/python/examples/treeviz_example.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.000001
9cbdc64bcc1144b8ca7d32d08aa5d36afa7f1e73
index command - reflected _log_id_short change
pageobject/commands/index.py
pageobject/commands/index.py
def index(self, value): """ Return index of the first child containing the specified value. :param str value: text value to look for :returns: index of the first child containing the specified value :rtype: int :raises ValueError: if the value is not found """ self.logger.info('getting ...
def index(self, value): """ Return index of the first child containing the specified value. :param str value: text value to look for :returns: index of the first child containing the specified value :rtype: int :raises ValueError: if the value is not found """ self.logger.info('getting ...
Python
0.000001
6143e6b015ed0435dc747b8d4242d47dca79c7a8
improve busydialog handling
lib/kodi65/busyhandler.py
lib/kodi65/busyhandler.py
# -*- coding: utf8 -*- # Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv> # This program is Free Software see LICENSE file for details import xbmcgui from kodi65 import utils import traceback from functools import wraps class BusyHandler(object): """ Class to deal with busydialog handling """ ...
# -*- coding: utf8 -*- # Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv> # This program is Free Software see LICENSE file for details import xbmc from kodi65 import utils import traceback from functools import wraps class BusyHandler(object): """ Class to deal with busydialog handling """ ...
Python
0.000001
99eca228811022281da8c93123d7562e5e5c6acb
Update recommender_system.py
lib/recommender_system.py
lib/recommender_system.py
#!/usr/bin/env python """ This is a module that contains the main class and functionalities of the recommender systems. """ import numpy from lib.content_based import ContentBased from lib.evaluator import Evaluator from lib.LDA import LDARecommender from util.data_parser import DataParser from util.recommender_configu...
#!/usr/bin/env python """ This is a module that contains the main class and functionalities of the recommender systems. """ import numpy from lib.content_based import ContentBased from lib.evaluator import Evaluator from lib.LDA import LDARecommender from util.data_parser import DataParser from util.recommender_configu...
Python
0
767a50052895cf10386f01bab83941a2141c30f1
fix json test and add json from string test
tests/python_tests/datasource_test.py
tests/python_tests/datasource_test.py
#!/usr/bin/env python from nose.tools import * from utilities import execution_path import os, mapnik2 def setup(): # All of the paths used are relative, if we run the tests # from another directory we need to chdir() os.chdir(execution_path('.')) def test_field_listing(): lyr = mapnik2.Layer('t...
#!/usr/bin/env python from nose.tools import * from utilities import execution_path import os, mapnik2 def setup(): # All of the paths used are relative, if we run the tests # from another directory we need to chdir() os.chdir(execution_path('.')) def test_field_listing(): lyr = mapnik2.Layer('t...
Python
0.000008
05855c934624c667053635a8ab8679c54426e49f
Rewrite the initialization of Release.eol_date.
releases/migrations/0003_populate_release_eol_date.py
releases/migrations/0003_populate_release_eol_date.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.db import migrations, models def set_eol_date(apps, schema_editor): Release = apps.get_model('releases', 'Release') # Set the EOL date of all releases to the date of the following release # except for the final o...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.db import migrations, models def set_eol_date(apps, schema_editor): Release = apps.get_model('releases', 'Release') # List of EOL dates for releases for which docs are published. for version, eol_date in [ ...
Python
0
ab93ea01dacc0fbd63fac91b1afcf5af1b711c2f
correct latest migration
umklapp/migrations/0009_teller_hasleft.py
umklapp/migrations/0009_teller_hasleft.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-31 20:38 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('umklapp', '0008_auto_20160528_2332'), ] operations = [ migrations.AddField( ...
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-31 19:39 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('umklapp', '0008_auto_20160528_2332'), ] operations = [ migrations.AddField( ...
Python
0.000002
dbd11fcc20f6770afa097e65d0a81c82b7f0c334
Update tests with access token
mnubo/tests/test_auth_manager.py
mnubo/tests/test_auth_manager.py
from mnubo.api_manager import APIManager import requests import datetime from requests import Response from mock import MagicMock def test_auth_maneger_init(): response = Response() response._content = '{"access_token":"ACCESS_TOKEN","token_type":"Bearer","expires_in":3887999}' requests.post = MagicMock...
from mnubo.api_manager import APIManager import requests import json from requests import Response from mock import MagicMock def test_auth_maneger_init(): response = Response() response._content = '{"access_token":"CLIENT_ACCESS_TOKEN","token_type":"Bearer","expires_in":3887999}' requests.post = MagicMo...
Python
0
aa203b23eec8ff9ccbde3678f01f4ee14f43a09f
Fix typo introduced by code quality patch
src/storage/sqlite.py
src/storage/sqlite.py
import collections from threading import current_thread, enumerate as threadingEnumerate, RLock import Queue import time from helper_sql import * from storage import InventoryStorage, InventoryItem class SqliteInventory(InventoryStorage): def __init__(self): super(self.__class__, self).__init__() ...
import collections from threading import current_thread, enumerate as threadingEnumerate, RLock import Queue import time from helper_sql import * from storage import InventoryStorage, InventoryItem class SqliteInventory(InventoryStorage): def __init__(self): super(self.__class__, self).__init__() ...
Python
0.000003
3405dc54b611b3d12583f0ff14f6b8d9e32a18a9
Revert "fixed pipeline is dropping frames and GUI can't see any videos"
voctocore/lib/sources/decklinkavsource.py
voctocore/lib/sources/decklinkavsource.py
#!/usr/bin/env python3 import logging import re from gi.repository import Gst, GLib from lib.config import Config from lib.sources.avsource import AVSource class DeckLinkAVSource(AVSource): timer_resolution = 0.5 def __init__(self, name, has_audio=True, has_video=True): super().__init__('DecklinkA...
#!/usr/bin/env python3 import logging import re from gi.repository import Gst, GLib from lib.config import Config from lib.sources.avsource import AVSource class DeckLinkAVSource(AVSource): timer_resolution = 0.5 def __init__(self, name, has_audio=True, has_video=True): super().__init__('DecklinkA...
Python
0
c5bfd55147e7fb18264f601c34e180453974f55e
DEBUG messages deleted
vt_manager/src/python/agent/provisioning/ProvisioningDispatcher.py
vt_manager/src/python/agent/provisioning/ProvisioningDispatcher.py
''' @author: msune Provisioning dispatcher. Selects appropiate Driver for VT tech ''' from communications.XmlRpcClient import XmlRpcClient from utils.VmMutexStore import VmMutexStore import threading class ProvisioningDispatcher: @staticmethod def __getProvisioningDispatcher(vtype): #Import of Dispatchers ...
''' @author: msune Provisioning dispatcher. Selects appropiate Driver for VT tech ''' from communications.XmlRpcClient import XmlRpcClient from utils.VmMutexStore import VmMutexStore import threading class ProvisioningDispatcher: @staticmethod def __getProvisioningDispatcher(vtype): #Import of Dispatchers ...
Python
0.000001
b78165d68e1e01e722b746e926a36b5680debdfa
remove email filter and rfactor
web/impact/impact/v1/views/mentor_program_office_hour_list_view.py
web/impact/impact/v1/views/mentor_program_office_hour_list_view.py
# MIT License # Copyright (c) 2019 MassChallenge, Inc. from impact.v1.views.base_list_view import BaseListView from impact.v1.helpers import ( MentorProgramOfficeHourHelper, ) class MentorProgramOfficeHourListView(BaseListView): view_name = "office_hour" helper_class = MentorProgramOfficeHourHelper ...
# MIT License # Copyright (c) 2019 MassChallenge, Inc. from impact.v1.views.base_list_view import BaseListView from impact.v1.helpers import ( MentorProgramOfficeHourHelper, ) LOOKUPS = { 'mentor_email': 'mentor__email__icontains', 'mentor_id': 'mentor_id', 'finalist_email': 'finalist__email__icontai...
Python
0
05b7f56bdfa600e72d4cca5a4c51324ff3c94d4d
Update file distancematrixtest.py
pymsascoring/distancematrix/test/distancematrixtest.py
pymsascoring/distancematrix/test/distancematrixtest.py
import unittest from pymsascoring.distancematrix.distancematrix import DistanceMatrix __author__ = "Antonio J. Nebro" class TestMethods(unittest.TestCase): def setUp(self): pass def test_should_default_gap_penalty_be_minus_eight(self): matrix = DistanceMatrix() self.assertEqual(-8,...
import unittest __author__ = "Antonio J. Nebro" class TestMethods(unittest.TestCase): def setUp(self): pass if __name__ == '__main__': unittest.main()
Python
0.000001
bd32faf934bd26957a16a0aa2ac092c5759d2342
annotate new test
python/ql/test/experimental/dataflow/fieldflow/test.py
python/ql/test/experimental/dataflow/fieldflow/test.py
# These are defined so that we can evaluate the test code. NONSOURCE = "not a source" SOURCE = "source" def is_source(x): return x == "source" or x == b"source" or x == 42 or x == 42.0 or x == 42j def SINK(x): if is_source(x): print("OK") else: print("Unexpected flow", x) def SINK_F(x)...
# These are defined so that we can evaluate the test code. NONSOURCE = "not a source" SOURCE = "source" def is_source(x): return x == "source" or x == b"source" or x == 42 or x == 42.0 or x == 42j def SINK(x): if is_source(x): print("OK") else: print("Unexpected flow", x) def SINK_F(x)...
Python
0.004804
091ebd935c6145ac233c03bedeb52c65634939f4
Include the version-detecting code to allow PyXML to override the "standard" xml package. Require at least PyXML 0.6.1.
Lib/xml/__init__.py
Lib/xml/__init__.py
"""Core XML support for Python. This package contains three sub-packages: dom -- The W3C Document Object Model. This supports DOM Level 1 + Namespaces. parsers -- Python wrappers for XML parsers (currently only supports Expat). sax -- The Simple API for XML, developed by XML-Dev, led by David Meggins...
"""Core XML support for Python. This package contains three sub-packages: dom -- The W3C Document Object Model. This supports DOM Level 1 + Namespaces. parsers -- Python wrappers for XML parsers (currently only supports Expat). sax -- The Simple API for XML, developed by XML-Dev, led by David Meggins...
Python
0
3f0fc980629f0645acb813b2ef8ed5d91761cbcc
add missing pkgconfig dependency and fix boost version range (#9835)
var/spack/repos/builtin/packages/wt/package.py
var/spack/repos/builtin/packages/wt/package.py
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Wt(CMakePackage): """Wt, C++ Web Toolkit. Wt is a C++ library for developing web appl...
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Wt(CMakePackage): """Wt, C++ Web Toolkit. Wt is a C++ library for developing web appl...
Python
0
308b3f9b2b8a4f2be9bfc09f0c026b54880ec94c
Remove unwanted print statement
gemdeps/views.py
gemdeps/views.py
import json import os from flask import Markup, render_template, request from gemdeps import app @app.route('/', methods=['GET', 'POST']) def index(): completedeplist = {} gemnames = [] SITE_ROOT = os.path.realpath(os.path.dirname(__file__)) for app in ['diaspora', 'gitlab', 'asciinema']: ap...
import json import os from flask import Markup, render_template, request from gemdeps import app @app.route('/', methods=['GET', 'POST']) def index(): completedeplist = {} gemnames = [] SITE_ROOT = os.path.realpath(os.path.dirname(__file__)) for app in ['diaspora', 'gitlab', 'asciinema']: ap...
Python
0.000034
49fafd2107719f0d0c588e85bb8c37a9d60a0845
Fix PEP8 and remove pdb
sponsorship_tracking/wizard/sub_sponsorship_wizard.py
sponsorship_tracking/wizard/sub_sponsorship_wizard.py
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __open...
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __open...
Python
0.000001
48f593bae26e1a587789a41aa82f9f984271bb4c
add check mode to dhcp_server
library/mt_dhcp_server.py
library/mt_dhcp_server.py
# -*- coding: utf-8 -*- DOCUMENTATION = ''' module: mt_dhcp_server.py author: - "Valentin Gurmeza" version_added: "2.4" short_description: Manage mikrotik dhcp-server endpoints requirements: - mt_api description: - Mikrotik dhcp-server generic module options: hostname: description: - hotstname of mikr...
# -*- coding: utf-8 -*- DOCUMENTATION = ''' module: mt_dhcp_server.py author: - "Valentin Gurmeza" version_added: "2.4" short_description: Manage mikrotik dhcp-server endpoints requirements: - mt_api description: - Mikrotik dhcp-server generic module options: hostname: description: - hotstname of mikr...
Python
0
7cebbd615544dc165d6711833747bc978c3bd2d6
fix call
dihedral_mutinf.py
dihedral_mutinf.py
import numpy as np import mdtraj as md import argparse import cPickle import time from multiprocessing import Pool from itertools import combinations_with_replacement as combinations from sklearn.metrics import mutual_info_score from contextlib import closing class timing(object): "Context manager for printing pe...
import numpy as np import mdtraj as md import argparse import cPickle import time from multiprocessing import Pool from itertools import combinations_with_replacement as combinations from sklearn.metrics import mutual_info_score from contextlib import closing class timing(object): "Context manager for printing pe...
Python
0.000001
3a27568211c07cf614aa9865a2f08d2a9b9bfb71
Return errors in json only
dinosaurs/views.py
dinosaurs/views.py
import os import json import httplib as http import tornado.web import tornado.ioloop from dinosaurs import api from dinosaurs import settings class SingleStatic(tornado.web.StaticFileHandler): def initialize(self, path): self.dirname, self.filename = os.path.split(path) super(SingleStatic, self...
import os import json import httplib as http import tornado.web import tornado.ioloop from dinosaurs import api from dinosaurs import settings class SingleStatic(tornado.web.StaticFileHandler): def initialize(self, path): self.dirname, self.filename = os.path.split(path) super(SingleStatic, self...
Python
0.000002
c9f25b7fb983c3d635ab7f13f350a53422059a8c
Handle errors in reloaded code
cpp/pineal-run.py
cpp/pineal-run.py
#!/usr/bin/env python from __future__ import print_function import os from time import sleep from sys import argv import logging from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler import hy from pineal.hy_utils import run_hy_code logger = logging.getLogger("pineal-run") logger....
#!/usr/bin/env python from __future__ import print_function import os from time import sleep from sys import argv from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler import hy from pineal.hy_utils import run_hy_code def update_file(file_name, ns, history): "Update running ...
Python
0.000001
f574e19b14ff861c45f6c66c64a2570bdb0e3a3c
Apply change of file name
crawl_comments.py
crawl_comments.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __doc__ = ''' Crawl comment from nicovideo.jp Usage: crawl_comments.py [--sqlite <sqlite>] [--csv <csv>] Options: --sqlite <sqlite> (optional) path of comment DB [default: comments.sqlite3] --csv <csv> (optional) path of csv file contains urls of vid...
#!/usr/bin/env python # -*- coding: utf-8 -*- __doc__ = ''' Crawl comment from nicovideo.jp Usage: main_crawl.py [--sqlite <sqlite>] [--csv <csv>] Options: --sqlite <sqlite> (optional) path of comment DB [default: comments.sqlite3] --csv <csv> (optional) path of csv file contains urls of videos ...
Python
0.000001
3bc4fa33c3ec9272fed565260677518dcf5957fe
change version to 0.10.0.dev0
csaps/_version.py
csaps/_version.py
# -*- coding: utf-8 -*- __version__ = '0.10.0.dev0'
# -*- coding: utf-8 -*- __version__ = '0.9.0'
Python
0.000006
3bb9c0aacdfff372e41d7a8d4c43e71535bff930
Remove perf regression in not yet finished size estimation code
sdks/python/google/cloud/dataflow/worker/opcounters.py
sdks/python/google/cloud/dataflow/worker/opcounters.py
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Python
0.000001
4920391c4e6d690264ebc0bb829ad9b9a374917d
math is hard
services/extract-entities/entityextractor/aggregate.py
services/extract-entities/entityextractor/aggregate.py
import logging from banal import ensure_list from collections import Counter from alephclient.services.entityextract_pb2 import ExtractedEntity from entityextractor.extract import extract_polyglot, extract_spacy from entityextractor.patterns import extract_patterns from entityextractor.cluster import Cluster log = l...
import logging from banal import ensure_list from collections import Counter from alephclient.services.entityextract_pb2 import ExtractedEntity from entityextractor.extract import extract_polyglot, extract_spacy from entityextractor.patterns import extract_patterns from entityextractor.cluster import Cluster log = l...
Python
0.998297
aab7c01c94088594258e33e3074f76d8735b8c2e
Add default config and config schema
mopidy/frontends/mpd/__init__.py
mopidy/frontends/mpd/__init__.py
from __future__ import unicode_literals import mopidy from mopidy import ext from mopidy.utils import config, formatting default_config = """ [ext.mpd] # If the MPD extension should be enabled or not enabled = true # Which address the MPD server should bind to # # 127.0.0.1 # Listens only on the IPv4 loopback ...
from __future__ import unicode_literals import mopidy from mopidy import ext __doc__ = """The MPD server frontend. MPD stands for Music Player Daemon. MPD is an independent project and server. Mopidy implements the MPD protocol, and is thus compatible with clients for the original MPD server. **Dependencies:** - ...
Python
0
43653246bfdcf78e76bb41846fbf80ac2e5dc0f2
Use declared_attr for ColorMixin columns
indico/core/db/sqlalchemy/colors.py
indico/core/db/sqlalchemy/colors.py
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
Python
0
2b50fd475829aa25889b49da4d4a2dcdcece9893
Remove unused imports.
src/Products/UserAndGroupSelectionWidget/at/widget.py
src/Products/UserAndGroupSelectionWidget/at/widget.py
import types from zope.component import ComponentLookupError from AccessControl import ClassSecurityInfo from Products.Archetypes.Widget import TypesWidget from Products.Archetypes.Registry import registerWidget from Products.UserAndGroupSelectionWidget.interfaces import IGenericGroupTranslation class UserAndGroupSele...
import types from zope.component import ComponentLookupError from Globals import InitializeClass from AccessControl import ClassSecurityInfo from Products.Archetypes.Widget import TypesWidget from Products.Archetypes.Registry import registerWidget from Products.Archetypes.utils import shasattr from Products.UserAndG...
Python
0
317926c18ac2e139d2018acd767d10b4f53428f3
Remove unneeded post method from CreateEnvProfile view
installer/installer_config/views.py
installer/installer_config/views.py
from django.shortcuts import render from django.shortcuts import render_to_response from django.views.generic import CreateView, UpdateView, DeleteView from installer_config.models import EnvironmentProfile, UserChoice, Step from installer_config.forms import EnvironmentForm from django.core.urlresolvers import reverse...
from django.shortcuts import render from django.shortcuts import render_to_response from django.views.generic import CreateView, UpdateView, DeleteView from installer_config.models import EnvironmentProfile, UserChoice, Step from installer_config.forms import EnvironmentForm from django.core.urlresolvers import reverse...
Python
0
c24dbc2d4d8b59a62a68f326edb350b3c633ea25
Change the comment of InterleavingMethod.evaluate
interleaving/interleaving_method.py
interleaving/interleaving_method.py
class InterleavingMethod(object): ''' Interleaving ''' def interleave(self, k, a, b): ''' k: the maximum length of resultant interleaving a: a list of document IDs b: a list of document IDs Return an instance of Ranking ''' raise NotImplementedErr...
class InterleavingMethod(object): ''' Interleaving ''' def interleave(self, k, a, b): ''' k: the maximum length of resultant interleaving a: a list of document IDs b: a list of document IDs Return an instance of Ranking ''' raise NotImplementedErr...
Python
0.000001
e94af78bbeae26933d987494e628b18e201f8da2
fix logger error message
spotseeker_server/management/commands/sync_techloan.py
spotseeker_server/management/commands/sync_techloan.py
# Copyright 2022 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 import logging from django.core.management.base import BaseCommand from django.conf import settings from schema import Schema from .techloan.techloan import Techloan from .techloan.spotseeker import Spots logger = logging.getLog...
# Copyright 2022 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 import logging from django.core.management.base import BaseCommand from django.conf import settings from schema import Schema from .techloan.techloan import Techloan from .techloan.spotseeker import Spots logger = logging.getLog...
Python
0.000005
a9bcbe8bf69403dbf7780843fe362cf8e1f02c95
update tree topo
mininet/tree/tree.py
mininet/tree/tree.py
#!/usr/bin/env python from mininet.cli import CLI from mininet.node import Link from mininet.net import Mininet from mininet.node import RemoteController from mininet.term import makeTerm from functools import partial def ofp_version(switch, protocols): protocols_str = ','.join(protocols) command = 'ovs-vsctl set...
#!/usr/bin/env python from mininet.cli import CLI from mininet.link import Link from mininet.net import Mininet from mininet.node import RemoteController from mininet.term import makeTerm def ofp_version(switch, protocols): protocols_str = ','.join(protocols) command = 'ovs-vsctl set Bridge %s protocols=%s' % (swi...
Python
0.000001
e2e57a89b63943857eb2954d0c5bdcf8e2191ff4
simplify logic for player count requirement
mk2/plugins/alert.py
mk2/plugins/alert.py
import os import random from mk2.plugins import Plugin from mk2.events import Hook, StatPlayerCount class Alert(Plugin): interval = Plugin.Property(default=200) command = Plugin.Property(default="say {message}") path = Plugin.Property(default="alerts.txt") min_pcount = Plugin.Property(default=0)...
import os import random from mk2.plugins import Plugin from mk2.events import Hook, StatPlayerCount class Alert(Plugin): interval = Plugin.Property(default=200) command = Plugin.Property(default="say {message}") path = Plugin.Property(default="alerts.txt") min_pcount = Plugin.Property(default=0)...
Python
0.000011