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 |
|---|---|---|---|---|---|---|---|
79170b41e947557dad23ef2ea93934075548dc32 | Add reactor example with ODEs implemented in Python | interfaces/cython/cantera/examples/reactors/custom.py | interfaces/cython/cantera/examples/reactors/custom.py | Python | 0.000001 | @@ -0,0 +1,2444 @@
+%22%22%22%0ASolve a constant pressure ignition problem where the governing equations are%0Aimplemented in Python.%0A%0AThis demonstrates an approach for solving problems where Cantera's reactor%0Anetwork model cannot be configured to describe the system in question. Here,%0ACantera is used for evalu... | |
d9d59666695ef9bdfce6fc4d8d886d5b492c546b | add code to submit oozie jobs via rest api | ws/jobs/manage_oozie_jobs.py | ws/jobs/manage_oozie_jobs.py | Python | 0 | @@ -0,0 +1,1569 @@
+# Memex cluster oozie url - http://10.1.94.54:11000/oozie%0A%0Aimport requests%0A%0A%0Aclass OozieJobs(object):%0A def __init__(self, oozie_url='http://localhost:11000/oozie'):%0A self.oozie_url = oozie_url%0A%0A def submit_oozie_jobs(self, config_xml):%0A oozie_url = self.oozie_... | |
1cb8f468325825bcadac1d5126a1415e57e8d314 | add test runner for notebooks | ipynb_runner.py | ipynb_runner.py | Python | 0 | @@ -0,0 +1,2697 @@
+%22%22%22%0AScript for running ipython notebooks.%0A%22%22%22%0Afrom IPython.nbformat.current import read%0Afrom IPython.kernel import KernelManager%0Aimport argparse%0Afrom pprint import pprint%0Aimport sys%0A%0Adef get_ncells(nb):%0A # return number of code cells in a notebook%0A ncells=0%0A... | |
fa855ae48a15cfd9b1e01227952a29249faa55d0 | Create longest-uncommon-subsequence-i.py | Python/longest-uncommon-subsequence-i.py | Python/longest-uncommon-subsequence-i.py | Python | 0.999996 | @@ -0,0 +1,1323 @@
+# Time: O(min(a, b))%0A# Space: O(1)%0A%0A# Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings.%0A# The longest uncommon subsequence is defined as the longest subsequence of one of these strings%0A# and this subsequence should not be any sub... | |
f61d0bffc71c85c3ea57dfae09c1a0275a42e1b0 | Create network.py | network.py | network.py | Python | 0.000001 | @@ -0,0 +1,342 @@
+#uses scapy, you need to have scapy installed%0A%0Afrom scapy.all import *%0Aip = raw_input('Enter IP address')%0A%0Atry:%0A alive, dead = alive,dead=srp(Ether(dst=%22ff:ff:ff:ff:ff:ff%22)/ARP(pdst=ip), timeout=2, verbose=0)%0A print %22MAC - IP%22%0A print alive%5B0%5D%5B1%5D.hwsrc # will prin... | |
4eeb2f120f42cb0af1cb8aca9c95b98a1c568d18 | add july class, and first script of pyplot | july-ml-course/first_of_pyplot.py | july-ml-course/first_of_pyplot.py | Python | 0 | @@ -0,0 +1,512 @@
+import matplotlib.pyplot as plt%0Aimport math%0A%0A%0Aif __name__ == %22__main__%22:%0A%09# prepare data %0A%09x = %5Bfloat(i) / 100 for i in range(1, 300)%5D%0A%09y = %5Bmath.log(i) for i in x%5D%0A%09# plot%0A%09plt.plot(x, y, 'r-', linewidth=3, label='log curve')%0A%0A%09# prepare data%0A%09p1 = 2... | |
7f927f460e75e14174ed0da3a49151e73fa0813d | remove unused import | src/robotide/namespace/cache.py | src/robotide/namespace/cache.py | # Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Python | 0.000001 | @@ -613,36 +613,8 @@
os%0A
-from threading import Event%0A
impo
|
9d60de90e49231f64e2fe1719077a3b58c582faa | Create lcm.py | data-structures-and-algorithms/algorithmic-toolbox/week-2/lcm.py | data-structures-and-algorithms/algorithmic-toolbox/week-2/lcm.py | Python | 0.000002 | @@ -0,0 +1,214 @@
+# Uses python3%0Aimport sys%0A%0Adef gcd(a, b):%0A while b!= 0:%0A (a,b) = (b,a%25b)%0A return a%0A%0A%0Adef main():%0A a,b = map(int,sys.stdin.readline().split())%0A c = gcd(a, b)%0A d = (a*b)//c%0A print(d)%0A%0Amain()%0A
| |
51d15d4c94ad9daeea15a559c9201a560971ad10 | Create english_to_hack3r.py | english_to_hack3r.py | english_to_hack3r.py | Python | 0.999929 | @@ -0,0 +1,2196 @@
+# @AUTHOR: Benjamin Meyers%0A# @DESCRIPTION: Try to write code to convert text into hAck3r, using regular%0A# expressions and substitution, where e %E2%86%92 3, i %E2%86%92 1, o %E2%86%92 0,%0A# l %E2%86%92 %7C, s %E2%86%92 5, . %E2%86%92 5w33t!, ate %E2%86%92 8. Normaliz... | |
47ae456b3a4252d7c838219e3ebd15e049316891 | Add three shutters and open/close functions | profile_collection/startup/25-shutter.py | profile_collection/startup/25-shutter.py | Python | 0.000001 | @@ -0,0 +1,1350 @@
+from __future__ import print_function%0Aimport epics%0Aimport logging%0A%0Afrom ophyd.controls import EpicsSignal%0Afrom ophyd.controls.signal import SignalGroup%0A%0A%0Aclass Shutter(SignalGroup):%0A def __init__(self, open=None, open_status=None,%0A close=None, close_status=None... | |
99ab0354c5e0812020d983fbb0480d8b7b649645 | add django migrations | djangocms_googlemap/migrations/0002_auto_20160621_0926.py | djangocms_googlemap/migrations/0002_auto_20160621_0926.py | Python | 0.000001 | @@ -0,0 +1,1009 @@
+# -*- 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 ('djangocms_googlemap', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.Alter... | |
e1576ced6ffabefc65d0c8a2dc981fc558c32e67 | Adding Fibonacci Number | Fibonacci.py | Fibonacci.py | Python | 0.999788 | @@ -0,0 +1,626 @@
+#!/usr/bin/env python2%0A# -*- coding: utf-8 -*-%0A#===============================#%0A#CODE PROPERTY OF LUKAS G. OLSON#%0A#https://github.com/lukasdragon #%0A#===============================#%0A%0A#variables%0AFirstDigit=0;%0ASecondDigit=1;%0ANumber = 0;%0Asequence = %5BFirstDigit, SecondDigit%5D;%0... | |
ecdd4aa60fadd392cdb1cfbdc178d742d260d640 | Add a new example | examples/example1.py | examples/example1.py | Python | 0.000102 | @@ -0,0 +1,116 @@
+import imba%0Aimba.install(%5B%22json%22, %22requests%22%5D)%0A%0Amy_ip = %22http://httpbin.org/ip%22.fetch().json%5B%22origin%22%5D%0Aprint(my_ip)%0A
| |
1d021cd7b52ecc4d9684dc607a1ff9f0b8181b37 | Add python script to read receiver file | read_receiver.py | read_receiver.py | Python | 0 | @@ -0,0 +1,2196 @@
+#! /usr/bin/env python%0A%0Aimport numpy%0Afrom matplotlib import pyplot as plt%0Aimport matplotlib.colors as colors%0Aimport os%0Aimport sys%0A%0Aimport seaborn%0A%0Adef ParseVariableBinaryHeader(header):%0A%0A header_detect = '#'%0A%0A header = header.strip(%22%5Cn%22).split()%0A%0A asser... | |
a737844028a576f08a63767a42da92b53b567a67 | add missing script | fecreader/summary_data/management/commands/set_committee_candidate_linkage.py | fecreader/summary_data/management/commands/set_committee_candidate_linkage.py | Python | 0.000003 | @@ -0,0 +1,1423 @@
+# Sets the curated_candidate_overlay field in committee_overlay from the Authorized_Candidate_Committees model. Use pop_auth_committees to set the data in Authorized_Candidate_Committees itself. %0A%0Afrom django.core.management.base import BaseCommand, CommandError%0A%0Afrom summary_data.models imp... | |
8a9490a962936c4695fbe639b45807aba012d102 | Create LongSubWRC_001.py | leetcode/003-Longest-Substring-Without-Repeating-Characters/LongSubWRC_001.py | leetcode/003-Longest-Substring-Without-Repeating-Characters/LongSubWRC_001.py | Python | 0.000001 | @@ -0,0 +1,452 @@
+class Solution:%0A # @return an integer%0A def lengthOfLongestSubstring(self, s):%0A start, maxlen = 0, 0%0A dict = %7Bs%5Bi%5D: -1 for i in range(len(s))%7D%0A for i in range(len(s)):%0A if dict%5Bs%5Bi%5D%5D != -1:%0A while start %3C= dict%5Bs%5B... | |
1c2d41bebbadfe41cad72e950864dcbfcdc938c0 | test file following new format with C code and header, missing decorators for getting dll handles and hypothesis-based testing | tests/test_devide.py | tests/test_devide.py | Python | 0 | @@ -0,0 +1,2230 @@
+# -*- coding: utf-8 -*-%0A%0A%22%22%22%0A%0AZUGBRUECKE%0ACalling routines in Windows DLLs from Python scripts running on unixlike systems%0Ahttps://github.com/pleiszenburg/zugbruecke%0A%0A%09tests/test_devide.py: Tests by reference argument passing (int pointer)%0A%0A%09Required to run on platform /... | |
2dc8ae91713fdd73ac1e835dcb191714c2e93593 | Add unittests for some methods of runner | tests/test_runner.py | tests/test_runner.py | Python | 0 | @@ -0,0 +1,2534 @@
+from twisted.trial import unittest%0A%0A%0Afrom ooni.inputunit import InputUnit%0Afrom ooni.nettest import NetTestCase%0Afrom ooni.reporter import OReporter%0A%0Afrom ooni.runner import loadTestsAndOptions, runTestCasesWithInputUnit%0A%0A%0Aclass DummyTestCase(NetTestCase):%0A def test_a(self):%0... | |
5e5e58b705d30df62423ec8bb6018c6807114580 | Add the app config for osf registrations | providers/io/osf/registrations/apps.py | providers/io/osf/registrations/apps.py | Python | 0 | @@ -0,0 +1,379 @@
+from share.provider import ProviderAppConfig%0Afrom .harvester import OSFRegistrationsHarvester%0A%0A%0Aclass AppConfig(ProviderAppConfig):%0A name = 'providers.io.osf.registrations'%0A version = '0.0.1'%0A title = 'osf_registrations'%0A long_title = 'Open Science Framework Registrations'... | |
04fa680f4be4afc44dc0df3834b096d8fa7a05ac | Add tests for nbgrader update | nbgrader/tests/apps/test_nbgrader_update.py | nbgrader/tests/apps/test_nbgrader_update.py | Python | 0 | @@ -0,0 +1,1424 @@
+from os.path import join%0A%0Afrom .. import run_nbgrader%0Afrom .base import BaseTestApp%0A%0A%0Aclass TestNbGraderUpdate(BaseTestApp):%0A%0A def test_help(self):%0A %22%22%22Does the help display without error?%22%22%22%0A run_nbgrader(%5B%22update%22, %22--help-all%22%5D)%0A%0A ... | |
48d6c81e79e867d448380a087f81b034b162d5bf | Add GostTrack implementation | GostTrack.py | GostTrack.py | Python | 0 | @@ -0,0 +1,669 @@
+class GostTrack:%0A%0A def __init__(self):%0A self.list_size = 0%0A self.current_pos = 0%0A self.pos_list = %5B%5D%0A%0A def add_pos(self, ang, rad):%0A self.list_size += 1%0A self.pos_list.append((ang, rad))%0A%0A def get_next_pos(self):%0A if self.... | |
6e74d412681f36b921d84c0cc72929be0a3df828 | Use threadlocals to store middleware data instead of the request | src/auditlog/middleware.py | src/auditlog/middleware.py | from __future__ import unicode_literals
import time
from django.conf import settings
from django.db.models.signals import pre_save
from django.utils.functional import curry
from django.db.models.loading import get_model
from auditlog.models import LogEntry
class AuditlogMiddleware(object):
"""
Middleware to... | Python | 0 | @@ -34,16 +34,33 @@
terals%0A%0A
+import threading%0A
import t
@@ -271,16 +271,50 @@
Entry%0A%0A%0A
+threadlocal = threading.local()%0A%0A%0A
class Au
@@ -747,32 +747,493 @@
%22%22%22%0A
+# Initialize thread local storage%0A threadlocal.auditlog = %7B%0A 'signal_duid': (self.__class__... |
ba6f426ca3f1eaf909cfa6257673a1800cc1c8fe | add download url script | sandbox/webapi/dropboxapi_download_url.py | sandbox/webapi/dropboxapi_download_url.py | Python | 0 | @@ -0,0 +1,2319 @@
+#! /usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport json%0Aimport requests%0Aimport os.path%0A%0Adef get_api_token():%0A %22%22%22read my api token%0A %22%22%22%0A with open('E:%5CDropbox%5CBin%5Cdropbox_api_token.txt') as f:%0A token = f.readline().rstrip()%0A #print %22... | |
bdabe892bae382ab24d595ac47a2b278a497d00b | Use random_state in test cases | sklearn/linear_model/tests/test_ransac.py | sklearn/linear_model/tests/test_ransac.py | import numpy as np
from numpy.testing import assert_equal, assert_raises
from sklearn import linear_model
np.random.seed(1)
# Generate coordinates of line
X = np.arange(-200, 200)
y = 0.2 * X + 20
data = np.column_stack([X, y])
# Add some faulty data
outliers = np.array((10, 30, 200))
data[outliers[0], :] = (1000,... | Python | 0.000017 | @@ -106,27 +106,8 @@
l%0A%0A%0A
-np.random.seed(1)%0A%0A
# Ge
@@ -575,16 +575,75 @@
or, 2, 5
+,%0A random_state=0
)%0A%0A #
@@ -1308,24 +1308,83 @@
s_data_valid
+,%0A random_state=0
)%0A%0A asser
@@ -1721,16 +1721,75 @@
el_... |
729fda094a195c4c24846e637fcba70b5d416f18 | add .py version of upcoming2posts | docs/upcoming2posts.py | docs/upcoming2posts.py | Python | 0 | @@ -0,0 +1,926 @@
+%0A# coding: utf-8%0A%0A# # upcoming2posts%0A# %0A# By Stuart Geiger (@staeiou), MIT license%0A# %0A# This is a script you run the day after THW, which changes yesterday's file from %22upcoming%22 to %22posts%22 so that the next week's topic shows on the main page.%0A%0A# In%5B78%5D:%0A%0A%0A# In%5B1... | |
c7a9ed8771039be0fa8288cf0cca14f44a1f3d35 | Add timeslice example | examples/offline_analysis/timeslices.py | examples/offline_analysis/timeslices.py | Python | 0.000011 | @@ -0,0 +1,2104 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A# vim: ts=4 sw=4 et%0A%22%22%22%0A==================%0AReading Timeslices%0A==================%0A%0AThis examples show how to access L0, L1, L2 and SN timeslice streams using%0Akm3pipe. Note that you need an activated Jpp environment and jppy install... | |
5ef616d0563f9e4f29ef7eaa3c163d24cf3e131f | Add simple integration test for memory profiler | spyder_memory_profiler/widgets/tests/test_memoryprofiler.py | spyder_memory_profiler/widgets/tests/test_memoryprofiler.py | Python | 0 | @@ -0,0 +1,2431 @@
+# -*- coding: utf-8 -*-%0A# -----------------------------------------------------------------------------%0A# Copyright (c) Spyder Project Developers%0A#%0A# Licensed under the terms of the MIT License%0A# (see LICENSE.txt for details)%0A# ------------------------------------------------------------... | |
6b3d2ae77f3c1eb9b960cf01e1a94ec6fdbf6632 | load information from res1.mat | CO2simulation.py | CO2simulation.py | Python | 0 | @@ -0,0 +1,788 @@
+import scipy.io%0Aimport numpy as np%0A%0A# class CO2simulation(object):%0A%09# def __init__(self, resolution):%0A%09%09# %22%22%22%0A%09%09# %09resolution: low(59x55), medium(117x109), large(217x234)%0A%09%09# %22%22%22%0A%09%09# Load Vp1.mat, Vp2.mat, Vp3.mat into%0Aresolution = 'low' %0Aif resolu... | |
58af5137225855ffbfa62a03dc1015570ef0d203 | Purge beffer just in case before getting the result | judge/math_parser.py | judge/math_parser.py | from HTMLParser import HTMLParser
import re
from django.conf import settings
MATHTEX_CGI = getattr(settings, 'MATHTEX_CGI', 'http://www.forkosh.com/mathtex.cgi')
inline_math = re.compile(r'~(.*?)~|\\\((.*?)\\\)')
display_math = re.compile(r'\$\$(.*?)\$\$|\\\[(.*?)\\\]')
REPLACES = [
(u'\u2264', r'\le'),
(u... | Python | 0 | @@ -1247,32 +1247,60 @@
f result(self):%0A
+ self.purge_buffer()%0A
return '
|
21295e723abbff6c9a04c19179e7c61658f36418 | Create clickhouse_system_metrics.py | clickhouse/clickhouse_system_metrics/clickhouse_system_metrics.py | clickhouse/clickhouse_system_metrics/clickhouse_system_metrics.py | Python | 0.000001 | @@ -0,0 +1,2991 @@
+#!/usr/bin/python%0A'''%0ASite24x7 Plugin to monitor Clickhouse Asynchronous metrics%0A'''%0A%0Afrom clickhouse_driver import Client%0Aimport json%0Aimport argparse%0A%0A### Query: SELECT event, value FROM system.events%0A### Ignored metrics%0A### %22BackgroundBufferFlushSchedulePoolTask%22, %22Back... | |
e5304549600ab58687c97f58aa37e2734b55c735 | add a command to clear task metas | crate_project/apps/crate/management/commands/clear_celery_meta.py | crate_project/apps/crate/management/commands/clear_celery_meta.py | Python | 0.000002 | @@ -0,0 +1,441 @@
+import redis%0A%0Afrom django.conf import settings%0Afrom django.core.management.base import BaseCommand%0A%0A%0Aclass Command(BaseCommand):%0A%0A def handle(self, *args, **options):%0A r = redis.StrictRedis(host=settings.GONDOR_REDIS_HOST, port=settings.GONDOR_REDIS_PORT, password=settings... | |
0bda6b7c6b77144c9a356d3e5846b365d2ce4600 | add TextRenderer protocol | src/ezdxf/addons/drawing/text_renderer.py | src/ezdxf/addons/drawing/text_renderer.py | Python | 0 | @@ -0,0 +1,922 @@
+# Copyright (c) 2022, Manfred Moitzi%0A# License: MIT License%0Afrom typing import TypeVar%0Afrom typing_extensions import Protocol%0Afrom ezdxf.tools.fonts import FontFace, FontMeasurements%0Afrom ezdxf.path import Path%0A%0AT = TypeVar(%22T%22)%0A%0A%0Aclass TextRenderer(Protocol):%0A %22%22%2... | |
e05345f3133313c77ebf1dd26c8a44a5d4d98cfe | add test_TreeReaderPackage.py | tests/test_TreeReaderPackage.py | tests/test_TreeReaderPackage.py | Python | 0.000001 | @@ -0,0 +1,1272 @@
+#!/usr/bin/env python%0Afrom AlphaTwirl import TreeReaderPackage%0Aimport unittest%0A%0A##____________________________________________________________________________%7C%7C%0Aclass MockReader(object):%0A pass%0A%0A##____________________________________________________________________________%7C%7... | |
2ab5dc1d9f2f19811e168aef90df086bcb618909 | Create /tests02_treat/ with __init__.py | tests/tests02_treat/__init__.py | tests/tests02_treat/__init__.py | Python | 0.000202 | @@ -0,0 +1,887 @@
+%22%22%22%0AThis module contains tests for tofu.geom in its structured version%0A%22%22%22%0A%0A%0A# Nose-specific%0Afrom nose import with_setup # optional%0A%0A%0A%0A%0A%0A%0A#######################################################%0A#%0A# Setup and Teardown%0A#%0A################################... | |
d5fdbc97dbf64e2a49a898644f03b2ead27c5095 | Add an interface for ContainerRegistry | UM/Settings/ContainerRegistry.py | UM/Settings/ContainerRegistry.py | Python | 0 | @@ -0,0 +1,1691 @@
+# Copyright (c) 2016 Ultimaker B.V.%0A# Uranium is released under the terms of the AGPLv3 or higher.%0A%0Afrom UM.PluginRegistry import PluginRegistry%0A%0A## Central class to manage all Setting containers.%0A#%0A#%0Aclass ContainerRegistry:%0A def __init__(self, *args, **kwargs):%0A supe... | |
548cf8f797abae99658573c289747cc498be3a5a | add dispatch | toughlib/dispatch.py | toughlib/dispatch.py | Python | 0 | @@ -0,0 +1,694 @@
+#!/usr/bin/env python%0A# coding=utf-8%0A%0Aimport types%0Aclass EventDispatcher:%0A%0A def __init__(self, prefix=%22event_%22):%0A self.prefix = prefix%0A self.callbacks = %7B%7D%0A%0A%0A def sub(self, name, meth):%0A self.callbacks.setdefault(name, %5B%5D).append(meth)%0A... | |
c8e4fc3cea9cb294a609eccc5024a25fc20ddc29 | Add tests for failedloginblocker | tests.py | tests.py | Python | 0 | @@ -0,0 +1,954 @@
+from django.test import TestCase%0Afrom django.core.urlresolvers import reverse%0Afrom django.contrib.auth.models import User%0A%0A%0Aclass FailedLoginBlockerTest(TestCase):%0A def setUp(self):%0A self.test_user = User.objects.create_user('test_user', 'test@example.com', 'password')%0A ... | |
71fd282aed8b299e3365c84df6d9a7b282157d45 | Update shopping_app | shopping_app.py | shopping_app.py | import configparser
import os
from flask import Flask
from views import (IndexView, AddItemsView, DashboardView,
LoginView, Logout, RegisterView,
RemoveShoppingList, ShoppingListDetail)
BASEDIR = os.path.dirname(os.path.abspath(__file__))
app = Flask(__name__)
config = configpars... | Python | 0.000002 | @@ -1055,16 +1055,45 @@
et_key =
+ os.environ.get('SECRET_KEY',
config%5B
@@ -1112,16 +1112,17 @@
%5D%5B'KEY'%5D
+)
%0A%0A%0Aif __
|
f1c49a22a57f81a2d9358507c98e6527861ba3f3 | add project tag command | seqr/management/commands/add_project_tag.py | seqr/management/commands/add_project_tag.py | Python | 0.000001 | @@ -0,0 +1,1307 @@
+from django.core.management.base import BaseCommand, CommandError%0Afrom django.db.models.query_utils import Q%0A%0Afrom seqr.models import Project, VariantTagType%0Afrom seqr.model_utils import create_seqr_model%0A%0A%0Aclass Command(BaseCommand):%0A%0A def add_arguments(self, parser):%0A ... | |
e762fc5b9ceb1fda0c61bec64a5ec795af66e1f0 | add migration to update Meta options | mygpo/podcasts/migrations/0021_meta.py | mygpo/podcasts/migrations/0021_meta.py | Python | 0 | @@ -0,0 +1,884 @@
+# -*- 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 ('podcasts', '0020_extend_episode_mimetypes'),%0A ('contenttypes', '__first__'),%0A %5D%0A%0A ... | |
c6efc8f73c264dd57a7d248d0aa33858863de826 | Update clipboard_pygame.py | kivy/core/clipboard/clipboard_pygame.py | kivy/core/clipboard/clipboard_pygame.py | '''
Clipboard Pygame: an implementation of the Clipboard using pygame.scrap.
'''
__all__ = ('ClipboardPygame', )
from kivy.utils import platform
from kivy.compat import PY2
from kivy.core.clipboard import ClipboardBase
if platform not in ('win', 'linux', 'macosx'):
raise SystemError('unsupported platform for pyg... | Python | 0.000002 | @@ -669,33 +669,8 @@
t()%0A
-%3C%3C%3C%3C%3C%3C%3C Updated upstream%0A
@@ -763,17 +763,16 @@
utf-8')%0A
-%0A
@@ -786,98 +786,8 @@
text
-%0A=======%0A return pygame.scrap.get(mimetype).encode('utf-8')%0A%3E%3E%3E%3E%3E%3E%3E Stashed changes
%0A%0A
|
efd3fbf51be25b46e3d5dd0cb76aaab60de7e4c8 | Add a file allowing you to try it manually | tryit.py | tryit.py | Python | 0 | @@ -0,0 +1,667 @@
+import json%0Afrom ranch import Address, InvalidAddressException%0A%0A%0Afilename = input('Read data from: %5Bdata/export.json%5D ')%0Aif filename == '':%0A filename = 'data/export.json'%0A%0Awith open(filename, 'r') as data:%0A specs = json.load(data)%0A a = Address(specs)%0A%0A%0Awhile not... | |
873ea60249747acb6e75dc2e1c9c5472d115763c | save attachments in order | snoop/digest.py | snoop/digest.py | from django.conf import settings
import hashlib
import json
from pathlib import Path
from .tikalib import tika_parse, extract_meta, tika_lang
from . import emails
from . import text
from . import queues
from . import models
from . import archives
from . import pst
from . import exceptions
from . import pgp
from . impor... | Python | 0 | @@ -2836,24 +2836,31 @@
me, info in
+sorted(
data.get('at
@@ -2882,16 +2882,17 @@
.items()
+)
:%0A
|
de438ae338f0fff48edff1e148ae860bf9354fc3 | Create 2-motors.py | Code/2-motors.py | Code/2-motors.py | Python | 0.000076 | @@ -0,0 +1,672 @@
+# CamJam EduKit 3 - Robotics%0A# Worksheet 2 - Motor Test Code%0A%0Aimport RPi.GPIO as GPIO # Import the GPIO Library%0Aimport time # Import the Time library%0A%0A# Set the GPIO modes%0AGPIO.setmode(GPIO.BCM)%0AGPIO.setwarnings(False)%0A%0A# Set the GPIO Pin mode%0AGPIO.setup(7, GPIO.OUT)%0AGPIO.setu... | |
d32414164552f48226842176e05229f6895e3c1d | Add test utility for creating users. | wafer/tests/utils.py | wafer/tests/utils.py | Python | 0 | @@ -0,0 +1,679 @@
+%22%22%22Utilities for testing wafer.%22%22%22%0A%0Afrom django.contrib.auth import get_user_model%0Afrom django.contrib.auth.models import Permission%0A%0A%0Adef create_user(username, email=None, superuser=False, perms=()):%0A if superuser:%0A create = get_user_model().objects.create_super... | |
76d2119cd6b065dddc85046e302f55188ae1207b | Create test_package.py | test_package.py | test_package.py | Python | 0.000015 | @@ -0,0 +1,1361 @@
+import numpy as np%0Aimport os%0Aimport bfimage as bf%0A%0Afilename = r'C:%5CPython_ZEN_Output%5CExperiment-454.czi'%0A%0Aimgbase = os.path.basename(filename)%0Aimgdir = os.path.dirname(filename)%0A## get image meta-information%0AMetaInfo = bf.bftools.get_relevant_metainfo_wrapper(filename)%0Aimg6d ... | |
089c1529a74cbe8f294b5ef4e81ec144a44a5a7b | Add broker object tests. | tests/broker.py | tests/broker.py | Python | 0 | @@ -0,0 +1,466 @@
+%22%22%22%0A.. moduleauthor:: Adam Gagorik %3Cadam.gagorik@gmail.com%3E%0A%22%22%22%0Aimport unittest%0Aimport pydarkstar.logutils%0Aimport pydarkstar.database%0Aimport pydarkstar.broker%0Aimport pydarkstar.rc%0A%0Apydarkstar.logutils.setDebug()%0A%0Aclass TestDarkObject(unittest.TestCase):%0A def... | |
aae317c01772b46cad96adaab5c7611897b1ade5 | add configuration for NDK 25 and Android API 32 (12L) | platforms/android/ndk-25.config.py | platforms/android/ndk-25.config.py | Python | 0 | @@ -0,0 +1,1210 @@
+# Docs: https://developer.android.com/ndk/guides/cmake#android_native_api_level%0AANDROID_NATIVE_API_LEVEL = int(os.environ.get('ANDROID_NATIVE_API_LEVEL', 32))%0Acmake_common_vars = %7B%0A # Docs: https://source.android.com/docs/setup/about/build-numbers%0A # Docs: https://developer.android.c... | |
44f374f89638ed53d882f0c738d47fae2b25ebbb | Update sds_detect.py | tendrl/node_agent/node_sync/sds_detect.py | tendrl/node_agent/node_sync/sds_detect.py | import time
import uuid
import etcd
from tendrl.commons.event import Event
from tendrl.commons.message import ExceptionMessage
from tendrl.commons.objects.job import Job
from tendrl.commons.utils import etcd_utils
from tendrl.commons.utils import log_utils as logger
from tendrl.node_agent.discovery.sds import manager... | Python | 0.000001 | @@ -1519,17 +1519,17 @@
er_id'%5D%0A
-%0A
+
@@ -1543,19 +1543,23 @@
- if
+_ptag =
%22provis
@@ -1569,16 +1569,46 @@
er/%25s%22 %25
+ %5C%0A
NS.tend
@@ -1632,18 +1632,16 @@
ation_id
- %5C
%0A
@@ -1657,19 +1657,24 @@
-
+if _ptag
in NS.n
@@ -182... |
b62b0c79e5da2312867ce44078e6098edcc09a5c | Implement more unit tests | speculator/tests/unit/test_poloniex.py | speculator/tests/unit/test_poloniex.py | Python | 0.000001 | @@ -0,0 +1,1775 @@
+import unittest%0Afrom speculator.utils import poloniex%0A %0A# https://poloniex.com/public?command=returnChartData¤cyPair=USDT_BTC&start=1483228800&end=1483272000&period=86400%0A%0AEXPECTED_RESPONSE = %5B%7B'close': 999.36463982,%0A 'date': 1483228800,%0A ... | |
e6e1a737e729a40dbda35a41fc861720f79c6907 | Fix OSS build. | build_defs/fb_core_android_library.bzl | build_defs/fb_core_android_library.bzl | Python | 0.000001 | @@ -0,0 +1,141 @@
+%22%22%22OSS shim of the internal fb_core_android_library macros.%22%22%22%0A%0A%0Adef fb_core_android_library(**kwargs):%0A native.android_library(**kwargs)%0A
| |
251607873e6da532040882a9873c47c7d7998dcf | Add __main__.py file to drupdate package | drupdates/__main__.py | drupdates/__main__.py | Python | 0.000006 | @@ -0,0 +1,34 @@
+from drupdates import main%0Amain()%0A
| |
374428e14e4291856659b0043cd01b51e0aca141 | Add main.py example | usr/examples/main.py | usr/examples/main.py | Python | 0.000004 | @@ -0,0 +1,210 @@
+import led, time%0Awhile (vcp_is_connected()==False):%0A led.on(led.BLUE)%0A time.sleep(150)%0A led.off(led.BLUE)%0A time.sleep(100)%0A led.on(led.BLUE)%0A time.sleep(150)%0A led.off(led.BLUE)%0A time.sleep(600)%0A
| |
38a20b4746230d9e6b62d9a93aaa4102087d20e2 | Add User Handler | handler/user.py | handler/user.py | Python | 0.000001 | @@ -0,0 +1,292 @@
+#!/usr/bin/python%0A# -*- coding:utf-8 -*-%0A# Powered By KK Studio%0A%0Afrom BaseHandler import BaseHandler%0A%0Aclass LoginHandler(BaseHandler):%0A%0A def get(self):%0A self.render('user/login.html')%0A%0Aclass RegisterHandler(BaseHandler):%0A%0A def get(self):%0A self.render('u... | |
4c17b9e487e3e423f77d15fcefc9e78694d3b806 | Add sql2csv utility | csvkit/utilities/sql2csv.py | csvkit/utilities/sql2csv.py | Python | 0.000062 | @@ -0,0 +1,2571 @@
+#!/usr/bin/env python%0A%0Afrom argparse import FileType%0Aimport sys%0A%0Afrom csvkit import CSVKitWriter%0Afrom csvkit import sql%0Afrom csvkit import table%0Afrom csvkit.cli import CSVKitUtility%0A%0Aclass SQL2CSV(CSVKitUtility):%0A description = 'Execute an SQL query on a database and output ... | |
1c659e3f58a23beabaab2a2aaa917fe7d35bf4e3 | add a setup_package for ALMA data (needed for the cycle0 table) | astroquery/alma/setup_package.py | astroquery/alma/setup_package.py | Python | 0 | @@ -0,0 +1,225 @@
+# Licensed under a 3-clause BSD style license - see LICENSE.rst%0Aimport os%0A%0A%0Adef get_package_data():%0A paths = %5Bos.path.join('data', 'cycle0_delivery_asdm_mapping.txt'),%0A %5D%0A return %7B'astroquery.alma': paths%7D%0A%0A
| |
b43501a6f0a01330f5c65a1998319e4edd96d864 | Create IRC2Interview.py | IRC2Interview.py | IRC2Interview.py | Python | 0 | @@ -0,0 +1,1098 @@
+from io import StringIO%0A%0A%0A%0Atext = %22%22%22%0A%3Cjunh1024%3E Both upscaled to 2/3 ch%0A%3Cjunh1024%3E I upscale to 6/7 ch this time%0A%3Cjunh1024%3E In prev 2, i made fake stereo width, this time, it's all real stereo, but i chopped it up lots%0A%3Cjunh1024%3E so 3xstereo vs 3xmono%0A%3Cdrf%... | |
2ab367a28919763d2ec2ebb435b51c1545c16a6f | add s3stat tool | tools/s3stat.py | tools/s3stat.py | Python | 0 | @@ -0,0 +1,2217 @@
+from datetime import datetime, timedelta%0A%0Aimport boto3%0Aimport json%0Aimport pprint%0Aimport logging%0Aimport os%0A%0A%0Adef bucket_info(c, bucket):%0A result = %7B'Bucket': bucket%7D%0A %0A response = c.get_metric_statistics(%0A Namespace='AWS/S3',%0A MetricName='Number... | |
710a4db6c9e50f09de3359b8b53b3003e41e8480 | Add a simple watchdog python script. | watchdog.py | watchdog.py | Python | 0 | @@ -0,0 +1,669 @@
+#!/usr/bin/env%0A%0A'''Watchdog script to keep a krad_radio instance running'''%0A%0Aimport subprocess%0Aimport time%0A%0Aclass Daemon:%0A def __init__(self):%0A self.cmd = 'krad_radio_daemon'%0A self.station = 'test'%0A self.running = False%0A%0A def log(self, msg):%0A timestamp = time... | |
f30d459b8527074e50de504695491ad17bb18f0e | Add tests for exclude passing | tests/pytests/unit/states/test_saltmod.py | tests/pytests/unit/states/test_saltmod.py | Python | 0 | @@ -0,0 +1,1567 @@
+import pytest%0Aimport salt.modules.saltutil as saltutil%0Aimport salt.states.saltmod as saltmod%0Afrom tests.support.mock import create_autospec, patch%0A%0A%0A@pytest.fixture(autouse=True)%0Adef setup_loader(request):%0A setup_loader_modules = %7Bsaltmod: %7B%22__opts__%22: %7B%22__role%22: %22... | |
3990c1fdd4fb3d0c40ae1b9b96f72af7ec2df6e7 | Find password | find-pass.py | find-pass.py | Python | 0.99952 | @@ -0,0 +1,1400 @@
+#!/usr/bin/env python%0A%0Afrom subprocess import check_output, STDOUT, CalledProcessError%0Afrom sys import platform%0Aimport re%0A%0A# password: %22XXXXX%22%0Afind_passwd = re.compile('password: %22(%5B%5E%22%5D+)%22').search%0A# %22acct%22%3Cblob%3E=%22miki.tebeka@gmail.com%22%0Afind_user = r... | |
b7532ac5daa922fd9cf64b0cee01afedc7452101 | Remove hardcoded IP | flask/app.py | flask/app.py | from flask import Flask, jsonify, request
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy import create_engine
from random import randint
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://benchmarkdbuser:benchmarkdbpass@192.168.0.12:3306/hello_world'
db = SQLAlchemy(app)
dbraw_engine =... | Python | 0.003987 | @@ -251,20 +251,18 @@
ass@
-192.168.0.12
+DBHOSTNAME
:330
@@ -1181,30 +1181,16 @@
ngle():%0A
- worlds = %5B%5D%0A
wid =
@@ -1211,32 +1211,28 @@
00)%0A worlds
-.append(
+ = %5B
World.query.
@@ -1241,33 +1241,33 @@
t(wid).serialize
-)
+%5D
%0A return jsonif
@@ -1800,30 +1800,16 @@
nnect()%0A
- worlds = %5... |
5c003984a9fa0776e926ced2727b87284e37dbd3 | Create flotation.py | flotation.py | flotation.py | Python | 0 | @@ -0,0 +1,1213 @@
+%0A# coding: utf-8%0A%0A# In%5B1%5D:%0A%0Aimport matplotlib.pyplot as plt%0Aimport matplotlib.patches as mpatches%0Aimport numpy as np%0Aget_ipython().magic(u'matplotlib inline')%0A%0A%0A# In%5B2%5D:%0A%0Awater = %5B0,2,2,3,1.5,1.5,3,2,2,2,2,2.5,2%5D%0Aalc = %5B0,2.5,2.5,2.5,2.5,3,2.5,2.5%5D%0Aweigh... | |
0c4f140d887e339c8182abb3caf6def3406e700d | add new package at v2.3.3 (#22043) | var/spack/repos/builtin/packages/professor/package.py | var/spack/repos/builtin/packages/professor/package.py | Python | 0 | @@ -0,0 +1,825 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other%0A# Spack Project Developers. See the top-level COPYRIGHT file for details.%0A#%0A# SPDX-License-Identifier: (Apache-2.0 OR MIT)%0A%0Afrom spack import *%0A%0A%0Aclass Professor(Package):%0A %22%22%22Professor Monte-Carlo tu... | |
6143408507468c1718999bc2bc16d7e394741e29 | Add unit test for TimedProc regression | tests/unit/utils/test_timed_subprocess.py | tests/unit/utils/test_timed_subprocess.py | Python | 0 | @@ -0,0 +1,700 @@
+# -*- coding: utf-8 -*-%0A%0A# Import python libs%0Afrom __future__ import absolute_import, print_function, unicode_literals%0A%0A# Import Salt Testing libs%0Afrom tests.support.unit import TestCase%0A%0A# Import salt libs%0Aimport salt.utils.timed_subprocess as timed_subprocess%0A%0A%0Aclass TestTim... | |
6b882d76e7ea141b12adb0464555d0f7526002fb | add word2vec skipgrams | word2vec/gram_skip.py | word2vec/gram_skip.py | Python | 0.999989 | @@ -0,0 +1,1350 @@
+from keras.layers.core import Dense, Reshape%0Afrom keras.layers.embeddings import Embedding %0Afrom keras.models import Sequential%0Afrom keras.preprocessing.text import *%0Afrom keras.preprocessing.sequence import skipgrams%0A%0Atext = %22I love green eggs and ham .%22%0A%0Atokenizer = Tokenizer()... | |
e6cf2eb5bcc164e84672d1c2c2f653da6406220e | add example of querying a specific server | examples/query_specific.py | examples/query_specific.py | Python | 0 | @@ -0,0 +1,855 @@
+#!/usr/bin/env python%0A%0A# Two ways of querying a specific nameserver.%0A%0Afrom __future__ import print_function%0A%0Aimport dns.message%0Aimport dns.rdataclass%0Aimport dns.rdatatype%0Aimport dns.query%0A%0A# This way is just like nslookup/dig:%0A%0Aqname = dns.name.from_text('amazon.com')%0Aq = ... | |
5e93c27a8ba8fed12ae871b49e295cf773b3443a | Add the get_arguments function in include | survey_creation/include/get_arguments.py | survey_creation/include/get_arguments.py | Python | 0.000027 | @@ -0,0 +1,914 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport sys%0Aimport getopt%0A%0A%22%22%22%0AShort script to parse%0Athe argments from the command line%0A%22%22%22%0A%0A%0Adef get_arguments(argv):%0A %22%22%22%0A %22%22%22%0A country = None%0A year = None%0A try:%0A opts, ar... | |
4d6543c3860806730e2f3b7a6534418f0e75ff81 | add solution for Sort List | src/sortList.py | src/sortList.py | Python | 0 | @@ -0,0 +1,1125 @@
+# Definition for singly-linked list.%0A# class ListNode:%0A# def __init__(self, x):%0A# self.val = x%0A# self.next = None%0A%0A%0Aclass Solution:%0A # @param head, a ListNode%0A # @return a ListNode%0A%0A def sortList(self, head):%0A if head is None or head.next i... | |
1f4aadc77bbc5e75db2737d5c580a887f5114945 | Add files via upload | LinkNaarRules.py | LinkNaarRules.py | Python | 0 | @@ -0,0 +1,809 @@
+import pygame%0Aimport sys %0Aimport os%0Afrom pygame.locals import *%0A%0Apygame.init()%0A%0A# Class spelregels openen%0Aclass spelregels:%0A def open_spelregel(self, open1):%0A self.open1 = img1%0A%0A# Openen spelregels vanuit bestand (Emma's computer)%0A%0A img1 = pygame.image.load(os... | |
754d4dc5feab67f55751ed07c706499e7d3dac89 | add Flask-Table hello.py | flask/Flask-Table/hello.py | flask/Flask-Table/hello.py | Python | 0.000077 | @@ -0,0 +1,878 @@
+# import things%0Afrom flask_table import Table, Col%0A%0A%0A# Declare your table%0Aclass ItemTable(Table):%0A name = Col('Name')%0A description = Col('Description')%0A%0A%0A# Get some objects%0Aclass Item(object):%0A def __init__(self, name, description):%0A self.name = name%0A ... | |
39fc0fe91ca4bf787ceeab9ff594168f70fe0dba | Add a new version of dump source that actually marches along the nodes | src/python2/dump_source.py | src/python2/dump_source.py | Python | 0 | @@ -0,0 +1,815 @@
+# Import the JModelica.org Python packages%0Aimport pymodelica%0Afrom pymodelica.compiler_wrappers import ModelicaCompiler%0A%0A# Create a compiler and compiler target object%0Amc = ModelicaCompiler()%0A%0A# Build trees as if for an FMU or Model Exchange v 1.0%0A#target = mc.create_target_object(%22m... | |
b67dd1f240e913c3423bd4c382852b7c234b487c | Support the 'localtime_into_day' type | fitparse/processors.py | fitparse/processors.py | import datetime
class FitFileDataProcessor(object):
# TODO: Document API
#def process_type_<type_name> (field_data)
#def process_field_<field_name> (field_data) -- can be unknown_DD but NOT recommended
#def process_message_<mesg_name / mesg_type_num> (data_message)
def process_type_bool(self, fie... | Python | 0.999177 | @@ -936,16 +936,288 @@
= None%0A%0A
+ def process_type_localtime_into_day(self, field_data):%0A if field_data.value is not None:%0A m, s = divmod(field_data.value, 60)%0A h, m = divmod(m, 60)%0A field_data.value = datetime.time(h, m, s)%0A field_data.units = None%0... |
65ea8db1df34834a3af801425009c9ce4e38b7a8 | Add metrics for buffer failures | src/sentry/buffer/redis.py | src/sentry/buffer/redis.py | """
sentry.buffer.redis
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from django.conf import settings
from django.db import models
from django.utils.encoding import force_bytes
fr... | Python | 0.000001 | @@ -494,16 +494,49 @@
ss_incr%0A
+from sentry.utils import metrics%0A
from sen
@@ -4087,24 +4087,84 @@
ue, ex=10):%0A
+ metrics.incr('buffer.revoked', reason='locked')%0A
@@ -4389,16 +4389,75 @@
.value:%0A
+ metrics.incr('buffer.revoked', reason='empty')%0A
|
a50b96ece7db9b732a6dc96c6d981588a5760311 | Add script to convert tests from RethinkDB core. | test_builder.py | test_builder.py | Python | 0 | @@ -0,0 +1,1657 @@
+import re%0A%0Atry:%0A import yaml%0Aexcept:%0A print('PyYAML not installed')%0A%0Afrom pathlib import Path%0A%0Adef mkdir(path):%0A try:%0A path.mkdir(parents=True)%0A except FileExistsError:%0A pass%0A%0Adef test_loop(path, c_path, cpp_path):%0A for file in path.glob('... | |
0893474403afb2af780d407cbffc95635ae91a50 | Fix for test against prod site broken by MT 10 upgrade | apps/devmo/tests/test_misc.py | apps/devmo/tests/test_misc.py | import logging
import csv
import shlex
import urllib2
from os.path import basename, dirname, isfile, isdir
from mock import patch
from nose.tools import assert_equal, with_setup, assert_false, eq_, ok_
from nose.plugins.attrib import attr
from pyquery import PyQuery as pq
import test_utils
from django.contrib.auth.mo... | Python | 0 | @@ -1695,50 +1695,8 @@
%22),%0A
- (%22Disallow%22, %22/@api/deki/*%22),%0A
|
936e9bbbc994b0f15e3cfb9d95557d62279340f9 | update comment | testsettings.py | testsettings.py | from __future__ import absolute_import
from __future__ import unicode_literals
import settingshelper as helper
from settings import *
# note: the only reason these are prepended to INSTALLED_APPS is because of
# a weird travis issue with kafka. if for any reason this order causes problems
# it can be reverted whenever... | Python | 0 | @@ -3227,252 +3227,122 @@
%0A%0A#
-Define an aaa-data database if its not already defined%0A# This is necessary because REPORTING_DATABASES references aaa-data.%0A# We must have aaa-data in a separate database%0A# https://github.com/dimagi/commcare-hq/pull/23351#issuecomment-467500691
+Required in Python 3 to prevent... |
b7785c53dbf8bd07360fa2ae62590fb0fcd1012e | Add gpio test | gpio_test.py | gpio_test.py | Python | 0.000001 | @@ -0,0 +1,211 @@
+import RPi.GPIO as GPIO%0Afrom time import sleep%0A%0AGPIO.setmode(GPIO.BOARD)%0A%0AGPIO.setup(7, GPIO.OUT)%0A%0Afor i in range(5):%0A GPIO.output(7, False)%0A sleep(2)%0A GPIO.output(7, True)%0A sleep(2)%0A%0AGPIO.cleanup()%0A
| |
f47a7678072471c7f78232138c850a2a7b5800a0 | add kattis/flexible | Kattis/flexible.py | Kattis/flexible.py | Python | 0.003308 | @@ -0,0 +1,482 @@
+%22%22%22%0AProblem: flexible%0ALink: https://open.kattis.com/problems/flexible%0ASource: ACM ICPC 2014 North America Qualifier%0A%22%22%22%0A%0AW, P = list(map(int, input().split()))%0AA = %5B0%5D + list(map(int, input().split())) + %5BW%5D%0A%0Aanswer = set()%0Afor i in range(len(A)-1):%0A for j... | |
42dfe9e99f24c0e05b2f411ea48ccee03612c711 | Add hfsm.py | hfsm/hfsm.py | hfsm/hfsm.py | Python | 0.000007 | @@ -0,0 +1,1493 @@
+# -*- coding: utf-8 -*-%0A%0A#TODO%0Aclass State(object):%0A def __init__(self, name, parent):%0A self.name = name%0A self.parent = parent%0A%0A def entry(self):%0A print('%25s entry' %25 (self.name))%0A%0A def execute(self):%0A print('%25s execute' %25 (self.nam... | |
410e9fb5f509165845934ff7b9ca10e058c2d2c5 | fix formatting | package_managers/install_pkgs.bzl | package_managers/install_pkgs.bzl | #Copyright 2017 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 agree... | Python | 0.001459 | @@ -2212,16 +2212,18 @@
= rule(%0A
+
attrs
@@ -2222,24 +2222,28 @@
attrs = %7B%0A
+
%22image_t
@@ -2259,32 +2259,36 @@
.label(%0A
+
+
default = Label(
@@ -2326,32 +2326,36 @@
.tar%22),%0A
+
allow_files = Tr
@@ -2358,32 +2358,36 @@
= True,%0A
+
+
single_file =... |
dce6b5f41720f253979d3c299be0222a6c2039cc | Fix the Android build. | gyp/opts.gyp | gyp/opts.gyp | {
'targets': [
# Due to an unfortunate intersection of lameness between gcc and gyp,
# we have to build the *_SSE2.cpp files in a separate target. The
# gcc lameness is that, in order to compile SSE2 intrinsics code, it
# must be passed the -msse2 flag. However, with this flag, it may
# emit SSE... | Python | 0.000053 | @@ -5024,62 +5024,8 @@
S',%0A
- '../src/opts/SkBitmapProcState_arm_neon.cpp',%0A
|
51855e6d44fc1f095c4b07a4bda5803e8ca65d2d | Task "Transcribing DNA into RNA" solved | rna/rna.py | rna/rna.py | Python | 0.998811 | @@ -0,0 +1,412 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A%0Adef main(argv):%0A if len(argv) %3C 2:%0A print(%22Input file name isn't specified. Using test input line.%22)%0A input_line = 'GATGGAACTTGACTACGTAAATT'%0A else:%0A with open(argv%5B1%5D) as f:%0A input_lin... | |
d99f5fd775d0ab57e964d8403266fc1adc7a4004 | add a script to print a json summary of our jenkins configs | tools/jenkins/jenkins_home/print_summary.py | tools/jenkins/jenkins_home/print_summary.py | Python | 0 | @@ -0,0 +1,1208 @@
+#!/usr/bin/python%0Aimport urllib%0Aimport json%0Aimport sys%0A%0A%0Adef print_usage():%0A print %22Usage: %25s %5Bjenkins_url (eg. http://50.56.12.202:8080/)%5D%22%5C%0A %25 sys.argv%5B0%5D%0A sys.exit()%0A%0A%0Adef fetch_blob(url):%0A return json.loads(urllib.urlopen(url + '/api/... | |
9819658d9cc343d67c1b2c438853c6f065394751 | Add Flask example. | examples/flask/flask_party.py | examples/flask/flask_party.py | Python | 0 | @@ -0,0 +1,1126 @@
+from flask import Flask, request%0Afrom wsgi_party import WSGIParty, PartylineConnector%0A%0A%0Aclass PartylineFlask(Flask, PartylineConnector):%0A def __init__(self, import_name, *args, **kwargs):%0A super(PartylineFlask, self).__init__(import_name, *args, **kwargs)%0A self.add_url... | |
69b1e1bdf50991e609b548c02dd14225642cae85 | Add focus-last example | examples/focus-last.py | examples/focus-last.py | Python | 0.000003 | @@ -0,0 +1,2552 @@
+#!/usr/bin/env python3%0A%0Aimport os%0Aimport socket%0Aimport selectors%0Afrom argparse import ArgumentParser%0Afrom multiprocessing import Process, Value%0Afrom gi.repository import i3ipc%0A%0ASOCKET_FILE = '/tmp/i3_focus_last'%0A%0A%0Aclass FocusWatcher:%0A%0A def __init__(self):%0A sel... | |
54f3c05d369a3256d1adac1118ca6b2a8cd9b77e | add proximity example | examples/proximity_example.py | examples/proximity_example.py | Python | 0 | @@ -0,0 +1,470 @@
+#!/usr/bin/env python3%0A%22%22%22This example shows how to read a measure from the Proximity Click inserted%0Ain Mikrobus 1.%0A%22%22%22%0A%0Afrom letmecreate.core import i2c%0Afrom letmecreate.core.common import MIKROBUS_1%0Afrom letmecreate.click import proximity%0A%0A%0A# Initialise I2C on Mikrob... | |
e5ad0f3029df610a308c107a640de438f62eb00b | Add test for early stopping trigger | tests/chainer_tests/training_tests/triggers_tests/test_early_stopping_trigger.py | tests/chainer_tests/training_tests/triggers_tests/test_early_stopping_trigger.py | Python | 0 | @@ -0,0 +1,1607 @@
+import unittest%0A%0Aimport chainer%0Aimport numpy%0A%0Afrom chainer import testing%0Afrom chainer import training%0Afrom chainer.training import triggers%0Afrom chainer.training import util%0A%0A%0Aclass DummyUpdater(training.Updater):%0A%0A def __init__(self):%0A self.iteration = 0%0A%0A... | |
ca8d539f39015b043d51eff8c1359dca0818f348 | Include scratch script to duplicate cropped dataset | src/tasks/python/create_test_cutout.py | src/tasks/python/create_test_cutout.py | Python | 0 | @@ -0,0 +1,1797 @@
+from cloudvolume import CloudVolume%0A%0Aimage_in = 'gs://neuroglancer/pinky100_v0/image_single_slices'%0Aimage_out = 'gs://neuroglancer/pinky100_v0/test_image'%0Aimage_mip = 0%0Aroi_in = 'gs://neuroglancer/pinky100_v0/image_single_slices/roicc'%0Aroi_out = 'gs://neuroglancer/pinky100_v0/test_image/... | |
b28e8b94191752a92de24845f99db1f59da32a9b | Add module | apps/word.py | apps/word.py | Python | 0.00001 | @@ -0,0 +1,1423 @@
+from apps.decorators import on_command%0D%0Afrom bs4 import BeautifulSoup%0D%0Afrom urllib.request import urlopen, quote%0D%0Aimport json%0D%0Aimport re%0D%0ACACHE_DEFAULT_URL = './apps/game_cache/relay.json'%0D%0ANAVER_DICTIONARY_URL = 'http://krdic.naver.com/search.nhn?query=%25s&kind=keyword'%0D%... | |
f1ba28d900e6a06aeab34fa67ef8d4552f438c99 | Create ImageNormalize.py | src/Python/ImageData/ImageNormalize.py | src/Python/ImageData/ImageNormalize.py | Python | 0.000001 | @@ -0,0 +1,2054 @@
+#!/usr/bin/env python%0A%0Aimport vtk%0A%0Adef main():%0A colors = vtk.vtkNamedColors()%0A # Create an image%0A source = vtk.vtkImageSinusoidSource()%0A source.Update()%0A %0A normalizeFilter = vtk.vtkImageNormalize()%0A %0A normalizeFilter.SetInputConnection(source.GetOutput... | |
dc7b2e1674806511c0ec117b5d13f9e4c4f8e5b6 | Bump version to 0.3.2 | django_socketio/__init__.py | django_socketio/__init__.py |
from django_socketio.utils import NoSocket, send, broadcast, broadcast_channel
__version__ = "0.3.1"
| Python | 0.000001 | @@ -98,9 +98,9 @@
0.3.
-1
+2
%22%0A%0A%0A
|
c4a05cfc469793fccb4bb958e51ef536a8f8e983 | Add Support Vector regression with Python | Regression/SupportVectorRegression/regularSVMRegression.py | Regression/SupportVectorRegression/regularSVMRegression.py | Python | 0 | @@ -0,0 +1,2769 @@
+# -*- coding: utf-8 -*-%0A%22%22%22Support Vector regression for machine learning.%0A%0ASupport Vector Machine can also be used as a regression method, maintaining all%0Athe main features that characterize the algorithm (maximal margin). The Support%0AVector Regression (SVR) uses the same principles... | |
f6d3594042f41866b7b590539700d000c01d0e91 | add script to integrate disambiguated results | integrate.py | integrate.py | Python | 0 | @@ -0,0 +1,1348 @@
+#!/usr/bin/env python%0A%22%22%22%0ATakes in a CSV file that represents the output of the disambiguation engine:%0A Patent Number, Firstname, Lastname, Unique_Inventor_ID%0AGroups by Unique_Inventor_ID and then inserts them into the Inventor table using%0Alib.alchemy.match%0A%22%22%22%0A%0Aimport s... | |
704f3441de39a07901faaf8b0622de77aa3d0f86 | Fix error in loader.discover() call | tempest/test_discover/test_discover.py | tempest/test_discover/test_discover.py | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | Python | 0.000016 | @@ -1809,32 +1809,36 @@
t_dir, top_level
+_dir
=top_path))%0A
@@ -1969,16 +1969,20 @@
op_level
+_dir
=top_pat
|
0483be7fc08f429461d2901d22ef220ab9ee59e5 | allow to run tox as 'python -m tox', which is handy on Windoze | tox/__main__.py | tox/__main__.py | Python | 0 | @@ -0,0 +1,38 @@
+from tox._cmdline import main%0A%0Amain()%0A
| |
98c84b6bb9304919929d4602631dd7b4f473a113 | fix test, match dict | tests/plugins/pi_support/test_pi_support.py | tests/plugins/pi_support/test_pi_support.py |
import unittest
import ddt
import mock
OCTOPI_VERSION = "0.14.0"
DT_MODEL = "Raspberry Pi Model F Rev 1.1"
VCGENCMD = "/usr/bin/vcgencmd get_throttled"
class PiSupportTestCase(unittest.TestCase):
def test_get_octopi_version(self):
from octoprint.plugins.pi_support import get_octopi_version
with mock.patch("... | Python | 0.000001 | @@ -5054,11 +5054,70 @@
sue=True
+,%0A%09%09 raw_value=-1
))%0A
|
91f961fa73bc193ba72700814fd8cec0c81168b4 | add iris classification example | examples/classification.py | examples/classification.py | Python | 0.000394 | @@ -0,0 +1,1300 @@
+import os%0Aimport sys%0Asys.path.insert(0, os.path.abspath('..'))%0A%0Afrom sklearn import datasets%0Afrom sklearn.model_selection import train_test_split%0Afrom sklearn.preprocessing import StandardScaler%0Afrom sklearn import metrics%0A%0Aimport torch%0Aimport numpy as np%0Afrom aorun.models impo... | |
3644df1b645d4fd607f22b24c5e676644be4a9da | Test script for the bsddb C extension module. | Lib/test/test_bsddb.py | Lib/test/test_bsddb.py | Python | 0 | @@ -0,0 +1,1402 @@
+#! /usr/bin/env python%0A%22%22%22Test script for the bsddb C module%0A Roger E. Masse%0A%22%22%22%0Aimport bsddb%0Aimport tempfile%0Afrom test_support import verbose%0A%0Adef test(openmethod, what):%0A%0A if verbose:%0A%09print '%5CnTesting: ', what%0A%09%0A fname = tempfile.mktemp()%0A ... | |
7cb4a7290b2af1983e1e291073c0a740d9e1334e | Add some useful finder tests | failure/tests/test_finders.py | failure/tests/test_finders.py | Python | 0 | @@ -0,0 +1,733 @@
+# -*- coding: utf-8 -*-%0A%0A# Copyright (C) 2016 GoDaddy Inc. All Rights Reserved.%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# ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.