commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
f3f363e8911d3a635d68c7dbe767ee2585ed4f36 | Check for duplicates based on coordinates and select only one database (EU/NASA) | checkDuplicates.py | checkDuplicates.py | Python | 0 | @@ -0,0 +1,2209 @@
+import pandas as pd%0Afrom astropy import coordinates as coord%0Afrom astropy import units as u%0A%0A%0Aclass Sweetcat:%0A %22%22%22Load SWEET-Cat database%22%22%22%0A def __init__(self):%0A%0A self.fname_sc = 'WEBSITE_online_EU-NASA_full_database.rdb'%0A %0A # Loading the... | |
485bbe732dfb8539ffaf017f3a005896a7f3e503 | create subhash module | iscc_bench/imageid/subhash.py | iscc_bench/imageid/subhash.py | Python | 0.000001 | @@ -0,0 +1,209 @@
+# -*- coding: utf-8 -*-%0A%22%22%22Test strategy with hashing mutiple shift invariant aligned patches%0A%0ASee: https://stackoverflow.com/a/20316789/51627%0A%22%22%22%0A%0Adef main():%0A pass%0A%0A%0Aif __name__ == '__main__':%0A main()%0A
| |
1742beec320d40e7859ea6f3b72e5fb3a7d1a51e | add flask hello world | hello.py | hello.py | Python | 0.999928 | @@ -0,0 +1,145 @@
+from flask import Flask%0Aapp = Flask(__name__)%0A%0A%0A@app.route(%22/%22)%0Adef hello():%0A return %22Hello World!%22%0A%0Aif __name__ == %22__main__%22:%0A app.run()%0A
| |
f2b329d5ab98cfd1c1e9a9c28e373e1411a78967 | Convert text/plain to multipart/alternative | home/bin/parse_mail.py | home/bin/parse_mail.py | Python | 0.999999 | @@ -0,0 +1,2616 @@
+#!/usr/bin/python3%0A%0Aimport email%0Afrom email import policy%0Aimport pypandoc%0Aimport fileinput%0Aimport subprocess%0Afrom email import charset%0A%0A# use 8bit encoded utf-8 when applicable%0Acharset.add_charset('utf-8', charset.SHORTEST, '8bit')%0A%0A# read email%0Astdin_lines = %5B%5D%0Awith ... | |
ef192ebd7679b96317cc6d878fb82c925787710d | Add Pattern based filterer. | source/bark/filterer/pattern.py | source/bark/filterer/pattern.py | Python | 0 | @@ -0,0 +1,1740 @@
+# :coding: utf-8%0A# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips%0A# :license: See LICENSE.txt.%0A%0Aimport re%0A%0Afrom .base import Filterer%0A%0A%0Aclass Pattern(Filterer):%0A '''Filter logs using pattern matching.'''%0A%0A INCLUDE, EXCLUDE = ('include', 'exclude')%0A%0A def ... | |
bcd485f240a7eb6373f847d6cc9dd07ebd2c3ef2 | add test case for redeem of default coupon (user limit=1, not bound to user) | coupons/tests/test_use_cases.py | coupons/tests/test_use_cases.py | Python | 0 | @@ -0,0 +1,721 @@
+from datetime import datetime%0A%0Afrom django.contrib.auth.models import User%0Afrom django.utils import timezone%0Afrom django.test import TestCase%0A%0Afrom coupons.forms import CouponForm%0Afrom coupons.models import Coupon%0A%0A%0Aclass DefaultCouponTestCase(TestCase):%0A def setUp(self):%0A ... | |
424d7107944f3ecb8ebf78a62dc35428952b380b | add reindex script | contrib/reindex.py | contrib/reindex.py | Python | 0.000001 | @@ -0,0 +1,797 @@
+#!/bin/python%0A# coding: utf-8%0A%0Aimport signal%0Aimport argparse%0Afrom datetime import datetime%0A%0Aargparser = argparse.ArgumentParser()%0Aargparser.add_argument(%22--database-type%22, %22-T%22, choices=%5B%22nic%22, %22ipam%22%5D,%0A default=%22nic%22)%0Aargparser.add_argument(%22datab... | |
65a1c06b6e5d7ec37ac232ab048b3cc541b75a45 | refactor Coupon | customermanage/models/Coupon.py | customermanage/models/Coupon.py | Python | 0.999424 | @@ -0,0 +1,546 @@
+from django.db import models%0Afrom storemanage.models.Currency import Currency%0Afrom storemanage.models.Ticket import Ticket%0Afrom django.contrib.auth.models import User%0Afrom django.contrib.postgres.fields import JSONField%0A# Create your models here.%0A%0Aclass Coupon(models.Model):%0A ticke... | |
837dc69a430161f6b942b629793ec1d37db780d4 | Create virtool.db.settings | virtool/db/settings.py | virtool/db/settings.py | Python | 0.000001 | @@ -0,0 +1,928 @@
+import logging%0Aimport pymongo.errors%0A%0Alogger = logging.getLogger(__name__)%0A%0A%0Aasync def initialize(db):%0A try:%0A await db.settings.insert_one(%7B%0A %22_id%22: %22settings%22,%0A %22enable_sentry%22: %7B%22type%22: %22boolean%22, %22default%22: True%7D,%0A... | |
094020855126721827342da98992a8c057d1a135 | fix memory benchmark for reference builds. | tools/perf/perf_tools/memory_benchmark.py | tools/perf/perf_tools/memory_benchmark.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import multi_page_benchmark
MEMORY_HISTOGRAMS = [
{'name': 'V8.MemoryExternalFragmentationTotal', 'units': 'percent'},
{'name': 'V... | Python | 0.000017 | @@ -1366,16 +1366,75 @@
aluate(%0A
+ 'window.domAutomationController.getHistogram ? '%0A
@@ -1485,16 +1485,21 @@
am(%22%25s%22)
+ : %22%22
' %25 name
@@ -1500,16 +1500,33 @@
%25 name)%0A
+ if data:%0A
re
@@ -1585,16 +1585,18 @@
, data,%0A
+
|
4e797dd9c8b43ab62f70b0515dee9e6b5c17d043 | Create secret.py | propalyzer_site/propalyzer_site/secret.py | propalyzer_site/propalyzer_site/secret.py | Python | 0.000032 | @@ -0,0 +1,34 @@
+class Secret():%0A SECRET_KEY = ''%0A
| |
3d8fe5cfc64c3667f938fa221353489846a9aeb0 | Add test of F.diagonal | tests/chainer_tests/functions_tests/array_tests/test_diagonal.py | tests/chainer_tests/functions_tests/array_tests/test_diagonal.py | Python | 0.999693 | @@ -0,0 +1,2524 @@
+import unittest%0A%0Aimport numpy%0Aimport chainer%0Afrom chainer.backends import cuda%0Afrom chainer import functions%0Afrom chainer import gradient_check%0Afrom chainer import testing%0Afrom chainer.testing import attr%0A%0A%0A@testing.parameterize(*testing.product_dict(%0A %5B%0A %7B'sh... | |
254564ceb905dc512693febed44e908c27f249ce | Add tests for cupyx.scipy.ndimage.label | tests/cupyx_tests/scipy_tests/ndimage_tests/test_measurements.py | tests/cupyx_tests/scipy_tests/ndimage_tests/test_measurements.py | Python | 0 | @@ -0,0 +1,1923 @@
+import unittest%0A%0Aimport numpy%0A%0Afrom cupy import testing%0Aimport cupyx.scipy.ndimage # NOQA%0A%0Atry:%0A import scipy.ndimage # NOQA%0Aexcept ImportError:%0A pass%0A%0A%0Adef _generate_binary_structure(rank, connectivity):%0A if connectivity %3C 1:%0A connectivity = 1%0A ... | |
2a6907ddf9c7b5df2e1b59c8feeb0fa4bd4b5752 | add rudimentary validation tests for azure | tests/validation/cattlevalidationtest/core/test_machine_azure.py | tests/validation/cattlevalidationtest/core/test_machine_azure.py | Python | 0 | @@ -0,0 +1,3343 @@
+import logging%0A%0Afrom common_fixtures import * # NOQA%0A%0ADEFAULT_TIMEOUT = 900%0A%0Asubscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID')%0Asubscription_cert = os.environ.get('AZURE_SUBSCRIPTION_CERT')%0A%0A# Use azure settings from environment variables , if set%0Ai = 'b39f27a8b8c64d52b05... | |
e9091be4ae9ddf0cb83bd7535c4ced5bb2d691d2 | add config_edit.py | castiron/lib/castiron/actions/config_edit.py | castiron/lib/castiron/actions/config_edit.py | Python | 0.000004 | @@ -0,0 +1,2453 @@
+from castiron.tools import Action, register_actions%0A%0Aimport os%0Aimport re%0A%0Aclass G:%0A all_edits = %5B%5D%0A%0Adef _file_contains_re(runner, path, contains_re):%0A real_path = os.path.realpath(os.path.expanduser(path))%0A if os.path.exists(real_path):%0A with open(real_path)... | |
bba34d3bf938bcf2a69a69b7c9e4993e19fc7002 | Add missed ProductMapping.is_empty new method. | src/python/twitter/pants/goal/products.py | src/python/twitter/pants/goal/products.py | from collections import defaultdict
class Products(object):
class ProductMapping(object):
"""Maps products of a given type by target. Each product is a map from basedir to a list of
files in that dir.
"""
def __init__(self, typename):
self.typename = typename
self.by_target = defaultdict... | Python | 0 | @@ -30,16 +30,17 @@
ltdict%0A%0A
+%0A
class Pr
@@ -343,16 +343,75 @@
list))%0A%0A
+ def empty(self):%0A return len(self.by_target) == 0%0A
%0A def
@@ -1191,37 +1191,35 @@
et as a
-map
+tuple
of
-%3C
+(
basedir
-%3E -%3E %3C
+,
products
@@ -1227,10 +1227,10 @@
list
-%3E,
+).
%0A
@@ -1238,41 +... |
99430e9f51eccb79f32af49bedfb28ba5f39cd09 | update : minor changes | ptop/plugins/system_sensor.py | ptop/plugins/system_sensor.py | Python | 0.000001 | @@ -0,0 +1,778 @@
+'''%0A System sensor plugin%0A%0A Generates the basic system info%0A'''%0Afrom ptop.core import Plugin%0Aimport psutil, socket, getpass%0Aimport datetime, time%0A%0Aclass SystemSensor(Plugin):%0A def __init__(self,**kwargs):%0A super(SystemSensor,self).__init__(**kwargs)%0A%0A # ov... | |
ded21520c1fde89336480b48387d383a2e449c2a | Write test for array | tests/chainer_tests/utils_tests/test_array.py | tests/chainer_tests/utils_tests/test_array.py | Python | 0.000234 | @@ -0,0 +1,755 @@
+import unittest%0A%0Aimport numpy%0A%0Afrom chainer import cuda%0Afrom chainer.utils import array%0Afrom chainer.testing import attr%0A%0A%0Aclass TestFullLike(unittest.TestCase):%0A%0A def test_full_like_cpu(self):%0A x = numpy.array(%5B1, 2%5D, numpy.float32)%0A y = array.full_like... | |
f4260ad3e652a09922395e64d29bcf8f96ee12bc | Add test_colormap.py | tests/test_colormap.py | tests/test_colormap.py | Python | 0.000003 | @@ -0,0 +1,1419 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%22%0AFolium Colormap Module%0A----------------------%0A%22%22%22%0Aimport folium.colormap as cm%0A%0Adef test_simple_step():%0A step = cm.StepColormap(%5B'green','yellow','red'%5D, vmin=3., vmax=10., index=%5B3,4,8,10%5D, caption='step')%0A step = cm.StepCol... | |
dd65fb84e41b11f8d97e3862d00137969589ab4b | integrate greenify | tests/test_greenify.py | tests/test_greenify.py | Python | 0.000475 | @@ -0,0 +1,595 @@
+from __future__ import absolute_import%0Aimport sys%0Aimport time%0Aimport greenify%0Agreenify.greenify()%0Aimport pylibmc%0Aimport random%0Afrom tornado.ioloop import IOLoop%0Afrom tornado.gen import coroutine%0Afrom gtornado import green%0A%0Agreenify.patch_lib(%22/usr/lib/x86_64-linux-gnu/libmemca... | |
7401d1ecd6b3323b266cf02eabd42a2c4e40d988 | Add initial tests for test module | tests/test_test.py | tests/test_test.py | Python | 0 | @@ -0,0 +1,1649 @@
+%22%22%22tests/test_test.py.%0A%0ATest to ensure basic test functionality works as expected.%0A%0ACopyright (C) 2019 Timothy Edmund Crosley%0A%0APermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated%0Adocumentation files (the %22Software%22), to... | |
925da64adf0b74ba18eb78acd9127e3a6dc6f903 | Add test cases for reported issues | tests/test_reported.py | tests/test_reported.py | Python | 0 | @@ -0,0 +1,561 @@
+# -*- coding: utf-8 -*-%0A%0A%0Afrom pyrql import parse%0A%0A%0ACMP_OPS = %5B'eq', 'lt', 'le', 'gt', 'ge', 'ne'%5D%0A%0A%0Aclass TestReportedErrors:%0A%0A def test_like_with_string_parameter(self):%0A expr = 'like(name,*new jack city*)'%0A rep = %7B'name': 'like', 'args': %5B'name', ... | |
e61c6eb5b5a9f6f70df036dcfedf552325a6e9bd | move unit test syn import to pytest fixture | tests/unit/conftest.py | tests/unit/conftest.py | Python | 0 | @@ -0,0 +1,437 @@
+import logging%0A%0Aimport pytest%0A%0Afrom synapseclient import Synapse%0Afrom synapseclient.core.logging_setup import SILENT_LOGGER_NAME%0A%0A%22%22%22%0Apytest unit test session level fixtures%0A%22%22%22%0A%0A%0A@pytest.fixture(scope=%22session%22)%0Adef syn():%0A %22%22%22%0A Create a Syna... | |
182762812cb1945dd2b50c21b34609be00b7bf45 | Create wordlist_add_digits.py | wordlist_add_digits.py | wordlist_add_digits.py | Python | 0.000575 | @@ -0,0 +1,859 @@
+#!/usr/bin/env python%0A#Adds 4digits to the end of the common word lists%0Aimport os, sys%0A%0A%0Aclass Wordlist_Add_Digits():%0A%0A%09def add_digits(self, wordlist, outfile):%0A%09%09#File to start with%0A%09%09file=wordlist%0A%09%09#Output file%0A%09%09out=open(outfile, 'w')%0A%09%09#Start loop of... | |
da3e9d5f7ffeae68ef7ae3b07247a9f6cb16d40d | Create get_user_statuses.py | src/Python/get_user_statuses.py | src/Python/get_user_statuses.py | Python | 0.000003 | @@ -0,0 +1,1450 @@
+import sys%0Aimport urllib2%0Aimport time%0Aimport re%0Afrom lxml import html%0A%0Adef get_user_statuses(userid):%0A %0A reached_end = False%0A i = 1%0A saying_list = %5B%5D%0A while not reached_end:%0A page_url = %22http://www.douban.com/people/%25s/statuses?p=%25d%22 %25 (userid, i)%0A ... | |
c0637f482a95dd7ec02bb7b85bc8d164c0a80585 | add missing check_headers tool | tools/check_headers.py | tools/check_headers.py | Python | 0.000001 | @@ -0,0 +1,1267 @@
+#!/usr/bin/env python2%0A%0Aimport sys%0Afrom os import unlink%0Afrom os.path import exists%0A%0AHEADERS = ('Content-Disposition', 'Content-Length', 'Content-Type',%0A 'ETag', 'Last-Modified')%0A%0Adef is_sig_header(header):%0A header = header.lower()%0A for s in HEADERS:%0A i... | |
3e5105218976549a0a782f179bb358edfd4e89c9 | Add load_tests / __init__.py to the azure/cli/tests module to allow for simpler unit test discovery | src/azure/cli/tests/__init__.py | src/azure/cli/tests/__init__.py | Python | 0.000001 | @@ -0,0 +1,305 @@
+from .test_argparse import Test_argparse%0A%0Afrom unittest import TestSuite%0A %0Atest_cases = %5BTest_argparse%5D%0A%0Adef load_tests(loader, tests, pattern):%0A suite = TestSuite()%0A for testclass in test_cases:%0A tests = loader.loadTestsFromTestCase(testclass)%0A suite.addTe... | |
543190dfb0b467127841b5960d2c1deaf9eff9ea | add hosts and interface_addr to sonos config | homeassistant/components/media_player/sonos.py | homeassistant/components/media_player/sonos.py | """
homeassistant.components.media_player.sonos
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides an interface to Sonos players (via SoCo)
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.sonos/
"""
import logging
import datetime
from home... | Python | 0 | @@ -1373,16 +1373,34 @@
ort soco
+%0A import socket
%0A%0A if
@@ -1523,22 +1523,374 @@
s =
-soco.discover(
+None%0A hosts = config.get('hosts', None)%0A if hosts:%0A players = %5B%5D%0A for host in hosts.split(%22,%22):%0A host = socket.gethostbyname(host)%0A players.... |
f91d666cc06f5db48bea43de29ca4153e58c473d | add test for os platform check | check.py | check.py | Python | 0 | @@ -0,0 +1,325 @@
+#!/bin/py%0A%0Aimport os%0Aimport sys%0A%0Adef osCheck():%0A %22%22%22 Check if OS is 'UNIX-like' %22%22%22%0A if not sys.platform.startswith('linux') or sys.platform.startswith('darwin'): %0A # if not sys.platform.startswith('darwin'):%0A print(%22This program was designed for UNIX-... | |
cafb802c51e0c0b8ff58cb749fa30b99cd7182b4 | Fix versions script to accept versions without -ce suffix | scripts/versions.py | scripts/versions.py | import operator
import re
from collections import namedtuple
import requests
base_url = 'https://download.docker.com/linux/static/{0}/x86_64/'
categories = [
'edge',
'stable',
'test'
]
STAGES = ['tp', 'beta', 'rc']
class Version(namedtuple('_Version', 'major minor patch stage edition')):
@classmet... | Python | 0 | @@ -2018,16 +2018,17 @@
.%5B0-9%5D+-
+?
.*tgz%22',
|
6c7f241656a2ae3059af27f91799a8247d84cfe7 | fix score.py for factored models | nematus/score.py | nematus/score.py | """
Given a parallel corpus of sentence pairs: with one-to-one of target and source sentences,
produce the score, and optionally alignment for each pair.
"""
import sys
import argparse
import tempfile
import numpy
import json
from data_iterator import TextIterator
from util import load_dict, load_config
from alignme... | Python | 0 | @@ -2235,16 +2235,17 @@
aries'%5D%5B
+-
1%5D,%0A
|
ba82331fa694ec26c7f0108451abf3912b5a37ff | Reimplement deprecated (1.6) _is_ignorable_404 | opbeat/contrib/django/middleware/__init__.py | opbeat/contrib/django/middleware/__init__.py | """
opbeat.contrib.django.middleware
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011-2012 Opbeat
Large portions are
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from django.middleware.commo... | Python | 0.000001 | @@ -284,17 +284,16 @@
_import%0A
-%0A
from dja
@@ -300,50 +300,28 @@
ngo.
-middleware.common import _is_ignorable_404
+conf import settings
%0Afro
@@ -382,16 +382,16 @@
reading%0A
-
import l
@@ -398,16 +398,222 @@
ogging%0A%0A
+def _is_ignorable_404(self, uri):%0A %22%22%22%0A Returns True if the given req... |
92b572004264c69baed5cce721e20e1a830514f8 | add 'is_changed' filter | filter_plugins/is_changed.py | filter_plugins/is_changed.py | Python | 0.000036 | @@ -0,0 +1,679 @@
+class FilterModule(object):%0A ''' A comment '''%0A%0A def filters(self):%0A return %7B%0A 'is_changed': self.is_changed,%0A %7D%0A%0A def is_changed(self, input_value, key, value):%0A if type(input_value) is not dict:%0A raise TypeError, u%22%7B%7D... | |
82cab3f91df9b4bb9f60e553d6b9e4ef431cb6ae | Add __init__.py | eppconvert/__init__.py | eppconvert/__init__.py | Python | 0.006636 | @@ -0,0 +1,822 @@
+#%0A# Copyright (c) 2017 Ralf Horstmann %3Cralf@ackstorm.de%3E%0A#%0A# Permission to use, copy, modify, and distribute this software for any%0A# purpose with or without fee is hereby granted, provided that the above%0A# copyright notice and this permission notice appear in all copies.%0A#%0A# THE SOF... | |
2f9699d5088266aaa76dad1742f2432d78da9d3b | add validator class | biothings_explorer/resolve_ids/validator.py | biothings_explorer/resolve_ids/validator.py | Python | 0.000001 | @@ -0,0 +1,2670 @@
+from collections import defaultdict%0A%0Afrom ..config_new import ID_RESOLVING_APIS%0Afrom ..exceptions.id_resolver import InvalidIDResolverInputError%0Afrom ..utils.common import getPrefixFromCurie%0A%0A%0Aclass Validator:%0A def __init__(self, user_input):%0A self.__user_input = user_inp... | |
c69fdba07aa4228f3e708b49e7fef4d0143e7a13 | Add missing stats.py | vpr/tests/api_stats.py | vpr/tests/api_stats.py | Python | 0.000095 | @@ -0,0 +1,266 @@
+from django.db import connection%0A%0ASQL_COUNT = 'select count(id) from vpr_api_apirecord where %25s=%25s;'%0A%0Adef countValue(field, value, time_start=None, time_end=None):%0A cur = connection.cursor()%0A cur.execute(SQL_COUNT %25 (field, value))%0A return cur.fetchone()%0A%0A%0A
| |
13addaf6e5a0423b632efcc4d16e3e5d864fdac3 | Create validate_csv_wd.py | validate_csv_wd.py | validate_csv_wd.py | Python | 0.001169 | @@ -0,0 +1,542 @@
+#!/usr/bin/env python3.5%0A%0Aimport sys%0Aimport re%0Aimport os%0Aimport csv%0A%0Adef read_file(fname):%0A f = open(fname, 'r')%0A csv_reader = csv.reader(f, delimiter='~')%0A no_rows = 0%0A for row in csv_reader:%0A no_rows += 1%0A no_cols = len(row)%0A print(%22Row %25d: columns = %25... | |
6c4ef8298bbdf48f82d13fb25a0f3958237392f2 | Add nova client for retrieving instance information | novajoin/nova.py | novajoin/nova.py | Python | 0 | @@ -0,0 +1,1420 @@
+# Copyright 2016 Red Hat, Inc.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# U... | |
d53358a6a0a564a5b4982f7f3dfdfd1163d6a295 | Add test covering no RunStop for v2. | databroker/tests/test_v2/test_no_run_stop.py | databroker/tests/test_v2/test_no_run_stop.py | Python | 0 | @@ -0,0 +1,985 @@
+# This is a special test because we corrupt the generated data.%0A# That is why it does not reuse the standard fixures.%0A%0Aimport tempfile%0Afrom suitcase.jsonl import Serializer%0Afrom bluesky import RunEngine%0Afrom bluesky.plans import count%0Afrom ophyd.sim import det%0Afrom databroker._drivers... | |
ace782a3f4c616f9e22e1a1ce29f053b71391845 | Add missing migration for column description. | cms/migrations/0002_update_template_field.py | cms/migrations/0002_update_template_field.py | Python | 0 | @@ -0,0 +1,564 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('cms', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField(%0A ... | |
c1e76dbdf07e67d98814d6f357a70c692af3a31d | Add first pass at db router | osf/db/router.py | osf/db/router.py | Python | 0 | @@ -0,0 +1,2134 @@
+from django.conf import settings%0Aimport psycopg2%0A%0ACACHED_MASTER = None%0A%0A%0Aclass PostgreSQLFailoverRouter(object):%0A %22%22%22%0A 1. CHECK MASTER_SERVER_DSN @ THREAD LOCAL%0A 2. THERE?, GOTO 9%0A 3. GET RANDOM_SERVER FROM %60settings.DATABASES%60%0A 4. CONNECT TO RANDOM_SER... | |
aca6b8b4cd221efca6d3a5f59f96b73d70e65714 | test integration against scipy | gary/integrate/tests/test_1d.py | gary/integrate/tests/test_1d.py | Python | 0.000001 | @@ -0,0 +1,1434 @@
+# coding: utf-8%0A%0Afrom __future__ import division, print_function%0A%0A__author__ = %22adrn %3Cadrn@astro.columbia.edu%3E%22%0A%0A# Standard library%0Aimport os%0Aimport time%0Aimport logging%0A%0A# Third-party%0Aimport numpy as np%0Afrom astropy import log as logger%0Afrom scipy.integrate import... | |
003cb0478a7fcbc7fb9b3521c174397a9dd9a318 | Use sources.list instead of sources.all. | zilencer/lib/stripe.py | zilencer/lib/stripe.py | from functools import wraps
import logging
import os
from typing import Any, Callable, TypeVar
from django.conf import settings
from django.utils.translation import ugettext as _
import stripe
from zerver.lib.exceptions import JsonableError
from zerver.lib.logging_util import log_to_file
from zerver.models import Rea... | Python | 0.000001 | @@ -3244,35 +3244,36 @@
ustomer.sources.
-all
+list
(object=%22card%22)%5B
@@ -3911,35 +3911,36 @@
ustomer.sources.
-all
+list
(object=%22card%22)%5B
|
833fcc808ab856720072b164a130e98433dffccc | Set procpool debug status to False by default. | contrib/procpools/python_procpool_plugin.py | contrib/procpools/python_procpool_plugin.py | """
Python ProcPool plugin
Evennia contribution - Griatch 2012
This is a plugin for the Evennia services. It will make the service
and run_async in python_procpool.py available to the system.
To activate, add the following line to your settings file:
SERVER_SERVICES_PLUGIN_MODULES.append("contrib.procpools.python_p... | Python | 0 | @@ -742,18 +742,18 @@
se write
- -
+s.
SQLite3
@@ -849,16 +849,51 @@
clashes.
+ Test what works with your mileage.
%0A%0A%22%22%22%0Aim
@@ -1123,19 +1123,20 @@
DEBUG =
-Tru
+Fals
e%0A# max/
@@ -1251,16 +1251,145 @@
OC = 20%0A
+# maximum time (seconds) a process may idle before being pruned from%0A# pool (if po... |
ca002a18b7e392bbdca9d7e0ed8c39739dc5b4a3 | Add code to get 99th percentile absolute pointing for POG | pog_absolute_pointing.py | pog_absolute_pointing.py | Python | 0 | @@ -0,0 +1,678 @@
+import numpy as np%0Afrom Chandra.Time import DateTime%0Aimport plot_aimpoint%0A%0A# Get 99th percential absolute pointing radius%0A%0Aplot_aimpoint.opt = plot_aimpoint.get_opt()%0Aasols = plot_aimpoint.get_asol()%0A# Last six months of data%0Aasols = asols%5Basols%5B'time'%5D %3E DateTime(-183).secs... | |
228a643dd54cefec82fdbca0d637deb7e1ea302c | Fix quoting in templates | graphitepager/description.py | graphitepager/description.py | from jinja2 import Template
from urllib import urlencode
from graphitepager.level import Level
ALERT_MISSING_TEMPLATE = r"""{{level}} alert for
"{{alert.get('name')}}". Go to {{graph_url}}.
{% if docs_url %}Documentation: {{docs_url}}{% endif %}.
"""
HTML_ALERT_MISSING_TEMPLATE = r"""{{level}} alert for
"{{alert.get... | Python | 0.000001 | @@ -131,33 +131,32 @@
vel%7D%7D alert for%0A
-%22
%7B%7Balert.get('nam
@@ -152,33 +152,50 @@
rt.get('name')%7D%7D
-%22
+ %7B%7Brecord.target%7D%7D
. Go to %7B%7Bgraph_
@@ -309,33 +309,32 @@
vel%7D%7D alert for%0A
-%22
%7B%7Balert.get('nam
@@ -338,17 +338,34 @@
name')%7D%7D
-%22
+ %7B%7Brecord.target%7D%7D
.%0AG... |
fa28e80dc7aeed1eb4fb0a18126a2f8105d5a5d2 | Create Cleverbot.py | Cleverbot.py | Cleverbot.py | Python | 0 | @@ -0,0 +1,1144 @@
+mport re%0Aimport cleverbot%0Aimport traceback%0A%0AWORDS = %5B%22CLEVERBOT%22, %22BOT%22%5D%0APATTERN = r%22%5Cb(cleverbot%7Cbot)%5Cb%22%0A%0Adef handle(text, mic, profile):%0A %22%22%22%0A Responds to user-input, typically speech text, starting a conversation with cleverbot%0A%0A ... | |
405dfc9a0a814001961e4090be83a3da4a4d4369 | Copy in constants file from master | cea/technologies/constants.py | cea/technologies/constants.py | Python | 0 | @@ -0,0 +1,730 @@
+%22%22%22%0AConstants used throughout the cea.technologies package.%0A%0AHistory lesson: This is a first step at removing the %60cea.globalvars.GlobalVariables%60 object.%0A%22%22%22%0A%0A# Heat Exchangers%0AU_cool = 2500.0 # W/m2K%0AU_heat = 2500.0 # W/m2K%0AdT_heat = 5.0 # K - pinch delta at d... | |
656cf2955510151675dfb4acae4e92e21021a6b5 | Add the Course of LiaoXueFeng | LiaoXueFeng/function.py | LiaoXueFeng/function.py | Python | 0.000001 | @@ -0,0 +1,86 @@
+def fact(n):%0A if n==1:%0A return 1%0A return n * fact(n - 1)%0A%0Aprint fact(10)%0A
| |
7a8250e6640c8ebf36cd159607da24b095cf708e | Create Fibonacci.py | Fibonacci.py | Fibonacci.py | Python | 0.999733 | @@ -0,0 +1,1712 @@
+#Author-Michael Aubry%0A#Description-This script outputs a spiraling fibinacci sequence onto a Fusion 360 sketch%0A%0Aimport adsk.core, adsk.fusion%0A%0Aapp= adsk.core.Application.get()%0Adesign = app.activeProduct%0Aui = app.userInterface;%0A%0A#**User Inputs**%0ASteps = 15 #How many steps of Fibo... | |
e52b6eed224274ee58bd2284382cf45b4f78864e | Support for django 1.3 Response.templates attribute is added | django_webtest/__init__.py | django_webtest/__init__.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.models import User
from django.core import signals
from django.test.signals import template_rendered
from django.core.handlers.wsgi import WSGIHandler
from django.core.servers.basehttp import AdminMediaHandler
from django.db import close_... | Python | 0 | @@ -2573,44 +2573,27 @@
-for detail in ('template', 'context'
+def flattend(detail
):%0A
@@ -2610,24 +2610,30 @@
if
-data.get(detail)
+len(data%5Bdetail%5D) == 1
:%0A
@@ -2638,39 +2638,39 @@
-if len(
+return
data%5Bdetail%5D) ==
@@ -2657,39 +2657,35 @@
urn data%5Bdetail%5D
-) == 1:
+%... |
b777872d1b06714f538dc8fb21b790de822b5a66 | Update Example folder | examples/listing_instruments.py | examples/listing_instruments.py | Python | 0 | @@ -0,0 +1,59 @@
+import visa%0Arm = visa.ResourceManager()%0Arm.list_resources()
| |
735c55d68d4831137255808042684733f93d5c18 | add iconv clone | iconv.py | iconv.py | Python | 0 | @@ -0,0 +1,1156 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0Aimport sys%0Aimport locale%0Aimport argparse%0Aimport fileinput%0A%0Apreferredenc = locale.getpreferredencoding()%0A%0Aparser = argparse.ArgumentParser(%0A description=%22Convert encoding of given files from one encoding to another.%22)%0Apars... | |
6a13295ea0e3e763683ec2317502141e4913935b | Make prowl debug output actually go to debug log | flexget/plugins/output/prowl.py | flexget/plugins/output/prowl.py | from __future__ import unicode_literals, division, absolute_import
import logging
from requests import RequestException
from flexget.plugin import register_plugin, priority
from flexget.utils.template import RenderError
__version__ = 0.1
log = logging.getLogger('prowl')
headers = {'User-Agent': 'FlexGet Prowl plug... | Python | 0.000001 | @@ -2894,15 +2894,13 @@
log.
-verbose
+debug
('op
|
72dcd6857f5f895f0fb9325681302f5875bc50ec | Add a new user-defined file | profile_collection/startup/31-capillaries.py | profile_collection/startup/31-capillaries.py | Python | 0 | @@ -0,0 +1,798 @@
+#6.342 mm apart%0A%0A#6.074%0A%0Adef capillary6_in():%0A mov(diff.xh,12.41)%0A mov(diff.yh,-12.58)%0A%0Adef capillary7_in():%0A mov(diff.xh,6.075) %0A mov(diff.yh,-12.58)%0A%0Adef capillary8_in():%0A mov(diff.xh,-.26695) %0A mov(diff.yh,-12.58)%0A%0Adef capillary9_in():%0A ... | |
f1ee6ce108626342b42a2d2a7b5aa4779af87e6c | Add python code to plot the histogram | plot-histogram.py | plot-histogram.py | Python | 0.00008 | @@ -0,0 +1,203 @@
+import matplotlib.pyplot as plt%0Aimport sys%0A%0Aif __name__ == %22__main__%22:%0A with open(sys.argv%5B1%5D) as f:%0A data = map(float, f.readlines())%0A plt.hist(list(data), 100)%0A plt.show()%0A %0A
| |
c9f64c0e61fb08c43b1c8cb93ec6f9c389b9c31c | delete finished pods from cluster | XcScripts/deletePods.py | XcScripts/deletePods.py | Python | 0 | @@ -0,0 +1,1148 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport os%0Aimport sys%0Aimport json%0Aimport shutil%0Aimport subprocess%0Aimport time%0A%0Adef ReadPodsToBeDeleted(fname):%0A %22%22%22%0A self explanatory%0A %22%22%22%0A%0A listPods = %5B%5D%0A%0A with open(fname,'r') as f:%0A ... | |
93c828b7c94004321a3801c2b53ba692532d1c79 | Update TwitterSearchSensor to retrieve and store last_id in the datastore. | packs/twitter/sensors/twitter_search_sensor.py | packs/twitter/sensors/twitter_search_sensor.py | from TwitterSearch import TwitterSearch
from TwitterSearch import TwitterSearchOrder
from st2reactor.sensor.base import PollingSensor
BASE_URL = 'https://twitter.com'
class TwitterSearchSensor(PollingSensor):
def __init__(self, sensor_service, config=None, poll_interval=None):
super(TwitterSearchSensor,... | Python | 0 | @@ -129,16 +129,57 @@
Sensor%0A%0A
+__all__ = %5B%0A 'TwitterSearchSensor'%0A%5D%0A%0A
BASE_URL
@@ -1366,17 +1366,50 @@
-if self._
+last_id = self._get_last_id()%0A%0A if
last
@@ -1446,22 +1446,20 @@
_id(
-self._
+int(
last_id)
%0A%0A
@@ -1454,16 +1454,17 @@
last_id)
+)
%0A%0A
@@ -1779,... |
7da94fd5576f4c052e79a8068164c101054d5ae7 | Add Python / `requests` example | python/simple.py | python/simple.py | Python | 0.000024 | @@ -0,0 +1,612 @@
+import requests # http://python-requests.org/%0A%0A# Premium user authentication process and API access example%0Ar = requests.post('https://api.masterleague.net/auth/token/', data=%7B'username': 'user', 'password': '12345'%7D)%0A%0Aif 'token' not in r.json():%0A print(r.text)%0A raise ValueEr... | |
b4f2c7b8bde0d28f7d1b61718eb7cd0b9159f507 | add __version__ | epistasis/__version__.py | epistasis/__version__.py | Python | 0.000984 | @@ -0,0 +1,22 @@
+__version__ = %220.6.4%22%0A
| |
9498ac9ec27bbef1725b92e84a3b0d4c9e967aa6 | add ex14 | lpthw/ex14.py | lpthw/ex14.py | Python | 0.99846 | @@ -0,0 +1,590 @@
+#!/usr/bin/env python%0A%0A# Exercise 14: Prompting and Passing%0A%0Afrom sys import argv%0A%0Ascript, user_name = argv%0Aprompt = '%3E '%0A%0Aprint %22Hi %25s, I'm the %25s script.%22 %25 (user_name, script)%0Aprint %22I'd like to ask you a few questions.%22%0Aprint %22Do you like me %25s?%22 %25 us... | |
1c8fd79c783ba6f21140b4c08bbf648bf5989dd4 | Add main module | core/hybra.py | core/hybra.py | Python | 0.000001 | @@ -0,0 +1,1579 @@
+import data_loader%0Aimport descriptives%0Aimport network%0Aimport timeline%0Aimport wordclouds%0A%0A%0Adef load_data( terms = %5B%5D, data_folder = '' ):%0A if data_folder == '':%0A return load_all_data( terms )%0A else:%0A if '/' not in data_folder:%0A data_folder +=... | |
0ec0398f8e50ed0adca426f9c468fd5154603941 | add mmd matrix example | open_spiel/python/examples/mmd_matrix_example.py | open_spiel/python/examples/mmd_matrix_example.py | Python | 0 | @@ -0,0 +1,1363 @@
+%22%22%22 Example of using MMD with dilated entropy%0A to solve for QRE in a Matrix Game %22%22%22%0A%0Afrom absl import app%0Afrom absl import flags%0A%0Afrom open_spiel.python.algorithms import mmd_dilated%0Aimport pyspiel%0A%0AFLAGS = flags.FLAGS%0A%0Aflags.DEFINE_integer(%22iterations%22, 100... | |
3425d265c32d33c189710bcffd1d0df62ce27b3a | update model | model.py | model.py | class User(dict):
""" Every user must have keys for a username, name, passphrase (this
is a md5 hash of the password), groups, and an email address. They can be
blank or None, but the keys must exist. """
def __init__(self, dict=None):
for key in ['username', 'name', 'passphrase', 'email']:
... | Python | 0.000001 | @@ -97,11 +97,14 @@
s a
-md5
+bcrypt
has
@@ -122,16 +122,22 @@
ssword),
+ salt,
groups,
@@ -158,16 +158,19 @@
address.
+%0A
They c
@@ -174,20 +174,16 @@
y can be
-%0A
blank o
@@ -307,16 +307,24 @@
phrase',
+ 'salt',
'email'
|
b4eb3a55be9e753496c5fd12a89ef85d6a904c09 | Annotate zerver/management/commands/realm_emoji.py. | zerver/management/commands/realm_emoji.py | zerver/management/commands/realm_emoji.py | from __future__ import absolute_import
from __future__ import print_function
from argparse import RawTextHelpFormatter
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand
from zerver.models import Realm, get_realm
from zerver.lib.actions import check_add_real... | Python | 0 | @@ -224,16 +224,31 @@
eCommand
+, CommandParser
%0Afrom ze
@@ -862,24 +862,71 @@
**kwargs):%0A
+ # type: (*Any, **Any) -%3E CommandParser%0A
pars
|
2a33ad8317b1642f4ff30b7466b83bbaf85299df | Remove unused var | resources/site-packages/quasar/navigation.py | resources/site-packages/quasar/navigation.py | import os
import sys
import urllib2
import xbmc
import xbmcgui
import xbmcplugin
import socket
from quasar.config import QUASARD_HOST
from quasar.addon import ADDON, ADDON_ID
from quasar.util import notify, GetLocalizedString
try:
import simplejson as json
except ImportError:
import json
HANDLE = int(sys.arg... | Python | 0.000001 | @@ -3031,11 +3031,8 @@
rror
-, e
:%0A
|
f95d7011ff89badfadbd07da0226f67f6dbd27a5 | Remove unused `organizations:new-tracebacks` flag. (#4083) | src/sentry/features/__init__.py | src/sentry/features/__init__.py | from __future__ import absolute_import
from .base import * # NOQA
from .handler import * # NOQA
from .manager import * # NOQA
default_manager = FeatureManager() # NOQA
default_manager.add('auth:register')
default_manager.add('organizations:api-keys', OrganizationFeature) # NOQA
default_manager.add('organization... | Python | 0 | @@ -551,89 +551,8 @@
OQA%0A
-default_manager.add('organizations:new-tracebacks', OrganizationFeature) # NOQA%0A
defa
|
bbfcddbb21a6b6f40fafe8c88ca76ab4a0b4667b | add script to analysis the flow map | FlowNet/flowAnalysis.py | FlowNet/flowAnalysis.py | Python | 0 | @@ -0,0 +1,2716 @@
+# When the movement of the objects in the video is not distinct to be%0A# captured by optical flow algorithm, training this %22noisy%22 flow map%0A# against the ground truth labeling is risky. In this code, we would%0A# like to iterate through all the generated flow videos, and filter%0A# out the no... | |
629ccdc27d2eb3522def903cc42606e43c3f816b | Add script to write network related files | AdaptivePELE/analysis/writeNetworkFiles.py | AdaptivePELE/analysis/writeNetworkFiles.py | Python | 0 | @@ -0,0 +1,2832 @@
+import os%0Aimport sys%0Aimport argparse%0Afrom AdaptivePELE.utilities import utilities%0Aimport matplotlib.pyplot as plt%0A%0A%0Adef parseArguments():%0A desc = %22Write the information related to the conformation network to file%5Cn%22%0A parser = argparse.ArgumentParser(description=desc)%0A... | |
daa4565abe4059e8588ddf374fde0f51d9ec784e | Create a skeleton for node propagation integration tests | test/integration/test_node_propagation.py | test/integration/test_node_propagation.py | Python | 0.000001 | @@ -0,0 +1,366 @@
+class TestPropagation(object):%0A def test_node_propagation(self):%0A %22%22%22%0A Tests that check node propagation%0A%0A 1) Spin up four servers.%0A 2) Make the first one send a sync request to all three others.%0A 3) Count the numbers of requests made.%0A ... | |
5b9b27d98cad06f0bbd67026b6533dee7c218df7 | update series server code shifted from custom script to py file | setup/doctype/update_series/update_series.py | setup/doctype/update_series/update_series.py | Python | 0 | @@ -0,0 +1,2318 @@
+# Please edit this list and import only required elements%0Aimport webnotes%0A%0Afrom webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common,... | |
4eab434002c99daf9c302cb1007e7ec384453aae | Fix cherrypy example | examples/cherrypysample.py | examples/cherrypysample.py | Python | 0.000045 | @@ -0,0 +1,197 @@
+#! /usr/bin/env python%0A# -*- coding: utf-8 -*-%0A# vim:fenc=utf-8%0A%0Aimport bottle%0A%0A%0A@bottle.get('/')%0Adef index():%0A return %7B'key': 'value'%7D%0A%0Abottle.run(port=8080, host=%220.0.0.0%22, server=%22cherrypy%22)%0A
| |
93e07841d961fb7956612339f13dfd4e8ddd8bac | Create RPi_Final.py | RPi_Final.py | RPi_Final.py | Python | 0.000001 | @@ -0,0 +1,21 @@
+from random import *%0A
| |
2eba3f5072b547829964eac9d2d5b03076a49faf | add firmwareupdate sample | examples/firmwareupdate.py | examples/firmwareupdate.py | Python | 0 | @@ -0,0 +1,266 @@
+from sakuraio.hardware.rpi import SakuraIOGPIO%0A#from sakuraio.hardware.rpi import SakuraIOSMBus%0Aimport time%0A%0Asakuraio = SakuraIOGPIO()%0A#sakuraio = SakuraIOSMBus()%0A%0Asakuraio.unlock()%0Atime.sleep(1)%0Asakuraio.update_firmware()%0A%0A#print(sakuraio.get_firmware_version())%0A%0A%0A
| |
16c57e5f3bd63667c7ca0b828e1f0fcd85d64b76 | Create SecureMSG.py | SecureMSG.py | SecureMSG.py | Python | 0.000001 | @@ -0,0 +1,853 @@
+#!/usr/python%0A#%0A# I dedicate this application for my best friend, Robert Niemiec :)%0A#%0A# Copyright (c) 2015 Dawid Wiktor%0A# This app is writed for all whistleblowers, journalists and %0A# cryptoanarchists. Use it when you need. Be carefull! NSA watchin'%0A# %0A# This is the Open Source Softwa... | |
522fb2e4b9fdf46abed3b5ca8ba43758b22253a1 | add missing file | addons/web/ir_module.py | addons/web/ir_module.py | Python | 0.000001 | @@ -0,0 +1,485 @@
+from openerp.osv import osv%0Aimport openerp.wsgi.core as oewsgi%0A%0Afrom common.http import Root%0A%0Aclass ir_module(osv.Model):%0A _inherit = 'ir.module.module'%0A%0A def update_list(self, cr, uid, context=None):%0A result = super(ir_module, self).update_list(cr, uid, context=context... | |
380a87e71c347eab5d9c5d22a255753e62e1d739 | Add the original game code to the files to show progress made during the week using classes and other skills | Original_python_game.py | Original_python_game.py | Python | 0 | @@ -0,0 +1,1656 @@
+import random%0A%0AGuessesTaken = 0%0A%0Aprint (%22Hello and welcome to my higher or lower number guessing game.%22)%0Aprint (%22Whats your name?%22)%0AmyName = input()%0A%0Anumber = random.randint(1, 20)%0Anumber1 = random.randint(1, 20)%0Anumber2 = random.randint(1, 20)%0Anumber3 = random.randint(... | |
958e6ca0ba5be68802e61a450aeb2bf39ea5d5ba | Create psf2pdb.py | psf2pdb.py | psf2pdb.py | Python | 0.000012 | @@ -0,0 +1,733 @@
+import sys%0A%0Apdbfile = open(sys.argv%5B1%5D,'r')%0Apsfile = open(sys.argv%5B2%5D,'r')%0A%0Ainline = pdbfile.readline()%0Aoutput = ''%0Awhile inline != 'END%5Cn':%0A output = output + inline%0A inline = pdbfile.readline()%0A if inline == '': #sanity check%0A print %22Error%22%0A ... | |
e73d16d4051c6bc66daf415d2da4e8d204a97004 | Add rainbow function | rainbow.py | rainbow.py | Python | 0 | @@ -0,0 +1,1694 @@
+import re%0Aimport colorsys%0Afrom pymol import cmd%0A%0A%0Adef rainbow(range_string):%0A %22%22%22%0ADESCRIPTION%0A%0A Colors rainbow spectrum for a selection given in range string.%0A%0A The difference between coloring in rainbow with built-in 'spectrum' is that%0A this relies on the s... | |
cbaed7d194f4a91198fc097d4657ad327819af4b | Add new migration. | invite/migrations/0004_auto_20191126_1740.py | invite/migrations/0004_auto_20191126_1740.py | Python | 0 | @@ -0,0 +1,1795 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.22 on 2019-11-26 17:40%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport uuid%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('invite', '0003_abstract_invitation_... | |
47044317e4067fb38bf9e0fdb2e9c5f9ccb78053 | add migration | pokemon_v2/migrations/0006_auto_20200725_2205.py | pokemon_v2/migrations/0006_auto_20200725_2205.py | Python | 0.000001 | @@ -0,0 +1,691 @@
+from django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A (%22pokemon_v2%22, %220005_auto_20200709_1930%22),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField(%0A model_name=%22pokemon%22,%0A n... | |
bad97abfe7fd93cefac10d46b5434b63cc7e3d2b | add line to end of file | keras_contrib/constraints.py | keras_contrib/constraints.py | from __future__ import absolute_import
from . import backend as K
from keras.utils.generic_utils import get_from_module
from keras.constraints import *
class Clip(Constraint):
"""Clips weights to [-c, c].
# Arguments
c: Clipping parameter.
"""
def __init__(self, c=0.01):
self.c = c
... | Python | 0.000001 | @@ -508,12 +508,13 @@
%0Aclip = Clip
+%0A
|
d558ed9875cf99ebdf6915e7acd877fc7fae69f3 | Add missing migration | candidates/migrations/0028_auto_20160411_1055.py | candidates/migrations/0028_auto_20160411_1055.py | Python | 0.0002 | @@ -0,0 +1,1172 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('candidates', '0027_create_standard_complex_fields'),%0A %5D%0A%0A operations = %5B%0A mi... | |
d663893c857605a53372d30395d3ca86f89bd201 | FIX default attribute value | test/acceptance/commons/constants.py | test/acceptance/commons/constants.py | __author__ = 'arobres'
#AUTHENTICATION CONSTANTS
AUTH = u'auth'
TENANT_NAME = u'tenantName'
USERNAME = u'username'
PASSWORD = u'password'
ACCESS = u'access'
TOKEN = u'token'
TENANT = u'tenant'
ID = u'id'
#PRODUCT_PROPERTIES
PRODUCT_NAME = u'name'
PRODUCT_DESCRIPTION = u'description'
PRODUCT = u'product'
PRODUCTS = u... | Python | 0.000001 | @@ -1467,28 +1467,19 @@
%22key%22: %22
-custom_
att
-_0
1%22, %22val
@@ -1487,27 +1487,40 @@
e%22: %22att
-_01_default
+1_value%22, %22type%22: %22Plain
%22%7D,%0A
@@ -1563,20 +1563,11 @@
%22: %22
-custom_
att
-_0
2%22,
@@ -1579,27 +1579,40 @@
e%22: %22att
-_02_default
+2_value%22, %22type%22: %22Plain
%... |
90a5242a93beda053ad91adca0728995232e23d2 | Create toggle_editor_text_console.py | cg/blender/scripts/toggle_editor_text_console.py | cg/blender/scripts/toggle_editor_text_console.py | Python | 0 | @@ -0,0 +1,395 @@
+import bpy%0A%0Akeyconfig = bpy.context.window_manager.keyconfigs.user%0A%0Aargs = ('wm.context_set_enum', 'ESC', 'PRESS')%0Akwargs = %7B'shift':True%7D%0A%0Afor source, destination in (('Console', 'TEXT_EDITOR'), ('Text', 'CONSOLE')): %0A kmi = keyconfig.keymaps%5Bsource%5D.keymap_items.new(*args... | |
cb505bd4c86c39bd7ce575a7d72e4a3d33875b93 | Create polyDataMake.py | figureCode/polyDataMake.py | figureCode/polyDataMake.py | Python | 0 | @@ -0,0 +1,1478 @@
+import numpy as np%0Afrom random import seed, getstate, setstate%0A%0Adef polyDataMake(n=21,deg=3,sampling='sparse'):%0A old_state = getstate()%0A seed(0)%0A%0A if sampling == 'irregular':%0A xtrain = np.array(%5Bnp.linspace(-1,-.5,6),np.linspace(3,3.5,6)%5D).reshape(-1,1)%0A elif... | |
f0fcfa4df3ce4e09e712a3f0a0fe4013fda10ca5 | make optimize_png_images.py platform-agnostic. | Source/devtools/scripts/optimize_png_images.py | Source/devtools/scripts/optimize_png_images.py | #!/usr/bin/env python
# Copyright (c) 2014 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | Python | 0.000009 | @@ -2022,32 +2022,45 @@
frontend_path =
+os.path.join(
devtools_path +
@@ -2056,21 +2056,19 @@
ols_path
- +
+,
%22
-/
front_en
@@ -2069,16 +2069,17 @@
ont_end%22
+)
%0Aimages_
@@ -2085,16 +2085,29 @@
_path =
+os.path.join(
devtools
@@ -2124,20 +2124,19 @@
path
- +
+,
%22
-/
Images%22
+)
%0Aima
@@ -214... |
53dc0a5a1e8cc94dd23f6b6cfa1997f7b8b6f926 | call FSL NIDM export from command line | nidm-results_fsl.py | nidm-results_fsl.py | Python | 0 | @@ -0,0 +1,920 @@
+#!/usr/bin/python%0A%22%22%22%0AExport neuroimaging results created with FSL feat following NIDM-Results %0Aspecification. The path to feat directory must be passed as first argument.%0A%0A@author: Camille Maumet %3Cc.m.j.maumet@warwick.ac.uk%3E%0A@copyright: University of Warwick 2013-2014%0A%22%22%... | |
6e2fb17f191047553d81c22d189d494d9d80faac | Fix KeyError on 'title' when title is empty | homeassistant/components/media_player/mpd.py | homeassistant/components/media_player/mpd.py | """
homeassistant.components.media_player.mpd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to interact with a Music Player Daemon.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.mpd/
"""
import logging
import socket
try:... | Python | 0.002891 | @@ -4022,17 +4022,27 @@
song
-%5B
+.get(
'title'
-%5D
+, None)
%0A%0A
@@ -4095,32 +4095,112 @@
e%0A else:%0A
+ if title is None:%0A return name%0A else:%0A
retu
|
88fe28ea1bca1f0f0784828592c2414e85e5ceb9 | add update service | homeassistant/components/sensor/speedtest.py | homeassistant/components/sensor/speedtest.py | """
homeassistant.components.sensor.speedtest
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Speedtest.net sensor based on speedtest-cli.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.speedtest/
"""
import logging
import sys
import re
from datetime imp... | Python | 0 | @@ -508,16 +508,107 @@
e_change
+%0Afrom homeassistant.components.sensor import DOMAIN%0Aimport homeassistant.util.dt as dt_util
%0A%0AREQUIR
@@ -1330,17 +1330,16 @@
config)%0A
-%0A
dev
@@ -1596,16 +1596,249 @@
s(dev)%0A%0A
+ def update(call=None):%0A %22%22%22 Update service for manual updates. %22... |
cfb3384ee31945d0afef6c558b873d956247e791 | Add link to docs | homeassistant/components/switch/tellstick.py | homeassistant/components/switch/tellstick.py | """
homeassistant.components.switch.tellstick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for Tellstick switches.
Because the tellstick sends its actions via radio and from most
receivers it's impossible to know if the signal was received or not.
Therefore you can configure the switch to try to send each signal ... | Python | 0 | @@ -118,300 +118,141 @@
s.%0A%0A
-Because the tellstick sends its actions via radio and from most%0Areceivers it's impossible to know if the signal w
+For more details about this platform, ple
as
+e
re
-ceived or not.%0ATherefore you can configure the switch to try to send each signal repeatedly%0Awith the config p... |
775a86179c321ac3cab73c9556edaa798f4273fd | add PassiveTotal OneShotAnalytics | plugins/analytics/passive_total.py | plugins/analytics/passive_total.py | Python | 0.000001 | @@ -0,0 +1,1545 @@
+import requests%0Aimport json%0Afrom datetime import datetime%0A%0Afrom core.analytics import OneShotAnalytics%0Afrom core.observables import Observable, Hostname%0A%0A%0Aclass PassiveTotal(OneShotAnalytics):%0A default_values = %7B%0A %22name%22: %22PassiveTotal Passive DNS%22,%0A ... | |
24aad104e2cdc8e37e66c4d87401b30619c8cd97 | Fix code style | chainer/functions/softplus.py | chainer/functions/softplus.py | import numpy
from chainer import cuda
from chainer import function
from chainer.utils import type_check
class Softplus(function.Function):
"""Softplus function."""
def __init__(self, beta=1.0):
self.beta = numpy.float32(beta)
self.beta_inv = numpy.float32(1.0 / beta)
def check_type_for... | Python | 0.000169 | @@ -2200,20 +2200,19 @@
))%60,
+%0A
where
-%0A
:mat
|
2bd913c6cad94f3bc244d92a1ae1caffda82dcf8 | Add humble plugin | plugins/humble.py | plugins/humble.py | Python | 0 | @@ -0,0 +1,1370 @@
+import lxml.html%0Aimport requests%0A%0Afrom smartbot import utils%0A%0Aclass Plugin:%0A def __call__(self, bot):%0A bot.on_respond(r%22humble( weekly)?( sale)?%22, self.on_respond)%0A bot.on_help(%22humble%22, self.on_help)%0A%0A def on_respond(self, bot, msg, reply):%0A ... | |
bd97873ea6b3b1de572027a8a13b895c84bdf7bf | version bump for 0.25.1.1. | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.25.1'
| Python | 0 | @@ -11,11 +11,13 @@
'0.25.1
+.1
'%0A%0A
|
4d3dd9752681f1194241e6bf5c90dda34b600014 | version bump for 0.88.8. | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.88.7'
| Python | 0 | @@ -14,8 +14,8 @@
.88.
-7
+8
'%0A%0A
|
6076340cf3b9f186b944423dd8d64d8d5d29b268 | version bump for 0.25.11.21. | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.25.11.20'
| Python | 0 | @@ -14,12 +14,12 @@
.25.11.2
-0
+1
'%0A%0A
|
48951aa7c2c82ca03e801e1bfce09be5492ce27b | Add python_analytics package | python_analytics/__init__.py | python_analytics/__init__.py | Python | 0.000031 | @@ -0,0 +1,244 @@
+import logging%0Atry: # pragma: no cover%0A from ._version import full_version as __version__%0Aexcept ImportError: # pragma: no cover%0A __version__ = %22not-built%22%0A%0A%0Alogger = logging.getLogger(__name__)%0Alogger.addHandler(logging.NullHandler())%0A
| |
9fa9b339cb0da0ae6a4318288afd8c75e6890e4e | prepare for provider | flask_oauthlib/provider.py | flask_oauthlib/provider.py | Python | 0 | @@ -0,0 +1,141 @@
+# coding: utf-8%0A%22%22%22%0AFlask-OAuthlib%0A--------------%0A%0AImplemnts OAuth2 provider support for Flask.%0A%0A:copyright: (c) 2013 by Hsiaoming Yang.%0A%22%22%22%0A
| |
f8e64d26c86e84ce9efe36db1155fdf5a4c6d5f8 | Add example to show of icons. | flexx/ui/examples/icons.py | flexx/ui/examples/icons.py | Python | 0 | @@ -0,0 +1,1244 @@
+# doc-export: Icons%0A%0A%22%22%22%0AThis example demonstrates the use of icons in Flexx.%0A%22%22%22%0A%0Aimport os%0A%0Aimport flexx%0Afrom flexx import app, ui%0A%0A# todo: support icons in widgets like Button, TabWidget, etc.%0A# todo: support fontawesome icons%0A%0A%0Aclass Icons(ui.Widget):%0A... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.