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 |
|---|---|---|---|---|---|---|---|
dab9a2a596151b6fb2127319cacf264cfa7ae4f2 | add an example | examples/example.py | examples/example.py | Python | 0.00017 | @@ -0,0 +1,1937 @@
+import django%0Afrom django.conf import settings%0A%0Afrom cerebral import forms%0A%0Asettings.configure()%0Adjango.setup()%0A%0A%0Aclass ExampleForm(forms.Form):%0A first_name = forms.CharField(%0A fill=True, hide=False, requires=%5B%5D)%0A last_name = forms.CharField(%0A fill=T... | |
21bee0c5b92d03a4803baf237c460223308ebb9f | Add a fake source code so you can embed it in the example | examples/fakecode.py | examples/fakecode.py | Python | 0.000001 | @@ -0,0 +1,570 @@
+# Get the hash %0A# 01/07/2017%0A# Melissa Hoffman%0A%0A# Get the current repo%0A%0Aimport os%0Aimport subprocess %0A%0Atestdir='/Users/melissahoffman1/'%0Arepo = testdir%0A%0A# Check if the repo is a git repo and get githash%0A%0Adef get_git_hash(path):%0A os.chdir(path)%0A try:%0A sha ... | |
077170874e3a08825e00f2b3cba68cc8f6e987ce | Prepare v1.2.509.dev | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | Python | 0.000002 | @@ -443,7 +443,11 @@
2.50
-8
+9.dev
'%0A
|
210f9c6acefdf2f51d33baa1ed7a2c131729fb93 | Update migrations to use lms.yml in the help text | common/djangoapps/third_party_auth/migrations/0004_auto_20200919_0955.py | common/djangoapps/third_party_auth/migrations/0004_auto_20200919_0955.py | Python | 0.000001 | @@ -0,0 +1,2303 @@
+# Generated by Django 2.2.16 on 2020-09-19 09:55%0A%0Afrom django.db import migrations, models%0Aimport openedx.core.lib.hash_utils%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('third_party_auth', '0003_samlconfiguration_is_public'),%0A %5D%0A%0A operat... | |
39a94674714dc3d8b83af2c3dcfe927306cbc0df | Fix Pooch getting data added in a PR | metpy/cbook.py | metpy/cbook.py | # Copyright (c) 2008,2015,2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Collection of generally useful utility code from the cookbook."""
import os
import numpy as np
import pooch
from . import __version__
try:
string_type = basestri... | Python | 0 | @@ -702,392 +702,417 @@
ter'
-,%0A env='TEST_DATA_DIR')%0A%0A# Check if we're running from a git clone and if so, bash the path attribute with the path%0A# to git's local data store (un-versioned)%0A# Look for the staticdata directory (i.e. this is a git checkout)%0Aif os.path.exists(os.path.join(os.path.dirname(__... |
18f6bf1b7862546a56c9bb7658c9bec41f19eea0 | Disable testDispatchNotification.testDispatchNotification on Mac | tools/telemetry/telemetry/core/backends/chrome_inspector/inspector_websocket_unittest.py | tools/telemetry/telemetry/core/backends/chrome_inspector/inspector_websocket_unittest.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry import decorators
from telemetry.core.backends.chrome_inspector import inspector_websocket
from telemetry.core.backends.chrom... | Python | 0 | @@ -1594,32 +1594,39 @@
abled('chromeos'
+, 'mac'
) # crbug.com/4
@@ -1622,32 +1622,50 @@
crbug.com/483212
+, crbug.com/498950
%0A def testDispa
|
19c0093e508923ff0d682fc4eb5764e4c93bfe8e | fix images pipeline tests | scrapy/tests/test_pipeline_images.py | scrapy/tests/test_pipeline_images.py | from twisted.trial import unittest
class ImagesPipelineTestCase(unittest.TestCase):
def setUp(self):
try:
import Image
except ImportError, e:
raise unittest.SkipTest(e)
from scrapy.contrib.pipeline.images import BaseImagesPipeline
self.pipeline = BaseImagesP... | Python | 0.000001 | @@ -27,16 +27,143 @@
unittest
+%0Afrom scrapy.conf import settings%0Afrom tempfile import mkdtemp%0Afrom shutil import rmtree%0A%0ASETTINGS_DISABLED = settings.disabled
%0A%0Aclass
@@ -386,20 +386,16 @@
import
-Base
ImagesPi
@@ -418,90 +418,286 @@
elf.
-pipeline = BaseImagesPipeline()%0A%0A def tearDown(self... |
dc042aea1bb977984fb69a1da9c958f855d479ea | add util plot of precip cells | scripts/cligen/map_clifile_points.py | scripts/cligen/map_clifile_points.py | Python | 0 | @@ -0,0 +1,1948 @@
+%22%22%22Create a map of where we have climate files!%22%22%22%0Aimport psycopg2%0Aimport numpy as np%0Aimport os%0Aimport glob%0Afrom pyiem.plot import MapPlot%0A%0A%0Adef get_domain():%0A pgconn = psycopg2.connect(database='idep', host='iemdb', user='nobody')%0A cursor = pgconn.cursor()%0A ... | |
68d3107c9b7e71c185b2f0b926af0057d96cdc5a | add script that gives invalid output and writes stderr | scripts/empty/invalid_plus_stderr.py | scripts/empty/invalid_plus_stderr.py | Python | 0.000001 | @@ -0,0 +1,191 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0Afrom __future__ import print_function%0A%0Aimport sys%0A%0A%0A# Write to standard error%0Aprint('TEST', file=sys.stderr)%0A%0Aprint('%7B%22_meta%22: %7B%22hostvars%22: %7B%7D%7D')
| |
52ae438ada955209e14c9c86ba56e3c81347930e | Make p-value calculations more numpythonic | skbio/math/stats/distance/_mantel.py | skbio/math/stats/distance/_mantel.py | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | Python | 0 | @@ -1448,19 +1448,66 @@
-better = 0%0A
+perm_gen = (corr_func(x.permute(), y_flat)%5B0%5D%0A
@@ -1514,17 +1514,17 @@
for
-i
+_
in rang
@@ -1538,17 +1538,17 @@
tations)
-:
+)
%0A
@@ -1552,187 +1552,232 @@
- r = corr_func(x.permute(), y_flat)%5B0%5D%0A%0A if al... |
6d36a383f3164f2c5e0090f31cebb2aad76cf433 | Use color print functions for spf_check | tools/spf_check.py | tools/spf_check.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tools/spf_check.py
#
# 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 of ... | Python | 0 | @@ -1701,16 +1701,47 @@
..')))%0A%0A
+from king_phisher import color%0A
from kin
@@ -2873,35 +2873,43 @@
rver_ip):%0A%09%09
-print('%5B-%5D
+color.print_error('
the smtp ser
@@ -3014,27 +3014,35 @@
ail):%0A%09%09
-print('%5B-%5D
+color.print_error('
the emai
@@ -3270,35 +3270,43 @@
ermError:%0A%09%09
-print('%... |
504a5390a78811393e011f01e5b6ddf2a3aae8e8 | Create ubuntu-monolith.py | ubuntu-monolith.py | ubuntu-monolith.py | Python | 0.000727 | @@ -0,0 +1,1126 @@
+#!/usr/bin/env python%0A%0Aimport subprocess%0Aimport os%0A%0Adef apt_install(packages):%0A env = os.environ.copy()%0A env%5BDEBIAN_FRONTEND%5D = %22noninteractive%22%0A subprocess.call('sudo -E apt-get update')%0A subprocess.call('sudo -E apt-get install -y ' + ' '.join(packages))%0A %0Apackag... | |
96c873da602bf34fb129b3d86378e729d7d94d72 | Create BoofCv.py | home/Mats/BoofCv.py | home/Mats/BoofCv.py | Python | 0 | @@ -0,0 +1,79 @@
+boof = Runtime.createAndStart(%22boof%22,%22BoofCv%22)%0Aargs = %5B%22Test%22%5D%0Aboof.main(args)%0A
| |
fcfb2b768f07bab8c94d83d9d53d70263d078b75 | Create MAP_loader.py | eduextractor/MAP_loader.py | eduextractor/MAP_loader.py | Python | 0 | @@ -0,0 +1,1597 @@
+import requests%0Aimport pandas as pd%0Afrom zipfile import ZipFile%0Afrom StringIO import StringIO%0Afrom nweaconfig import NWEA_USERNAME, NWEA_PASSWORD%0A%0A## import database configuration from parent directory%0A## config contains SQLalchemy engine and a few DB functions%0Aimport sys%0Asys.path.... | |
805188e8c5df3b92ec0fe5c3c4c4e7fe3f127a83 | prepend 0 in segment_length (#812) | neurom/features/sectionfunc.py | neurom/features/sectionfunc.py | # Copyright (c) 2020, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | Python | 0 | @@ -3312,32 +3312,52 @@
_lengths(section
+, prepend_zero=False
):%0A '''Return
@@ -3450,16 +3450,43 @@
n.points
+, prepend_zero=prepend_zero
)%0A%0A%0Adef
|
b044ba312b126cb17bf906b1984e7b407509fcc6 | Add script to assist in packaging. | Geneagrapher/makedist.py | Geneagrapher/makedist.py | Python | 0 | @@ -0,0 +1,1408 @@
+%22%22%22This tool sets up a distribution of the software by automating%0Aseveral tasks that need to be done.%0A%0AThe directory should be in pristine condition when this is run (i.e.,%0Adevoid of files that need to be removed before packaging begins). It%0Ais best to run this on a fresh check out o... | |
410b354cb0e72ba741439a337aba4ef4c3cda8b1 | Add existing python file for performing a very crude analysis on a set of lsl files (as taken from an untarred OAR, for example) | src/ossa.py | src/ossa.py | Python | 0 | @@ -0,0 +1,1070 @@
+#!/usr/bin/python%0A%0Aimport re%0Aimport sys%0A%0A%22%22%22 Taken from http://stackoverflow.com/questions/2669059/how-to-sort-alpha-numeric-set-in-python%22%22%22%0Adef sorted_nicely(l): %0A %22%22%22 Sort the given iterable in the way that humans expect.%22%22%22 %0A convert = lambda text: i... | |
252ab143b139e39a1ef87150d8008704107fe1d8 | Create Database.py | database/Database.py | database/Database.py | Python | 0.000001 | @@ -0,0 +1,2279 @@
+__author__ = 'albert cuesta'%0A%0Aimport os.path%0Aclass database:%0A%0A def listaraplicaiones(self):%0A result = %5B%5D%0A with open(%22database/data/aplicaciones.txt%22, mode='r+', encoding='utf-8') as file:%0A resultado = file.read()%0A texto = resultado.split(%22%5... | |
71d8ef8a872656df8a2319032855cb2b5ea5ed4b | Add a new benchmark - readline server | examples/bench/rlserver.py | examples/bench/rlserver.py | Python | 0 | @@ -0,0 +1,2376 @@
+import argparse%0Aimport asyncio%0Aimport gc%0Aimport uvloop%0Aimport os.path%0Aimport socket as socket_module%0A%0Afrom socket import *%0A%0A%0APRINT = 0%0A%0A%0Aasync def echo_client_streams(reader, writer):%0A sock = writer.get_extra_info('socket')%0A try:%0A sock.setsockopt(IPPROTO_... | |
af2303062c7d4bbbcbe92df3d0c01d7729b910f2 | add swap example | examples/py/huobi-swaps.py | examples/py/huobi-swaps.py | Python | 0 | @@ -0,0 +1,1611 @@
+# -*- coding: utf-8 -*-%0A%0Aimport os%0Afrom random import randint%0Aimport sys%0Afrom pprint import pprint%0A%0Aroot = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))%0Asys.path.append(root + '/python')%0A%0Aimport ccxt # noqa: E402%0A%0A%0Aprint('CCXT Version:', ccxt... | |
1ac4dd4438dd054f32e23c6db01d2382507ed4c7 | break out shapefile tests | tests/python_tests/shapefile_test.py | tests/python_tests/shapefile_test.py | Python | 0.000001 | @@ -0,0 +1,1679 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Afrom nose.tools import *%0Afrom utilities import execution_path%0A%0Aimport os, mapnik2%0A%0Adef setup():%0A # All of the paths used are relative, if we run the tests%0A # from another directory we need to chdir()%0A os.chdir(execution_pa... | |
64dac000cd4edb3a461918f8253e43bc47d6b594 | Create editUtils.py | utils/editUtils.py | utils/editUtils.py | Python | 0 | @@ -0,0 +1,704 @@
+# new_data = %7B'max_iter': 5000, 'snapshot': 500%7D%0Adef createSolverPrototxt(new_data, save_loc):%0A f = open('solverToy.prototxt')%0A def_text = f.read().split('%5Cn')%0A def_text.remove('')%0A solver_default_dict = %7Bmodule.split(': ')%5B0%5D: module.split(': ')%5B1%5D for module in... | |
b41776096e6982e6ef0faef1fc95b550bebed9e8 | add script to calculate average oil price | oil_price/average_oil_price.py | oil_price/average_oil_price.py | Python | 0 | @@ -0,0 +1,496 @@
+#!/usr/bin/env python%0A%0Aimport urllib%0Aimport paho.mqtt.publish as publish%0Afrom bs4 import BeautifulSoup as bs%0A%0Anewenglandoil = urllib.urlopen(%22http://www.newenglandoil.com/massachusetts/zone10.asp?x=0%22).read()%0Asoup = bs(newenglandoil, 'lxml')%0A%0Aoil_table = soup.find('table')%0Atbo... | |
a7a8cee70ffee9446aad19c9775d13c2b608c397 | Add RungeKuttaEvolver class. | new/evolvers.py | new/evolvers.py | Python | 0 | @@ -0,0 +1,1170 @@
+class RungeKuttaEvolve(object):%0A def __init__(self, alpha, gamma_G=2.210173e5, start_dm=0.01):%0A if not isinstance(alpha, (int, float)) or alpha %3C 0:%0A raise ValueError('alpha must be a positive float or int.')%0A else:%0A self.alpha = alpha%0A%0A ... | |
39c853f64b837d257333c5731067c811344f9dfd | Add highlight.py (Python syntax highlighting) | src/Lib/site-packages/highlight.py | src/Lib/site-packages/highlight.py | Python | 0.000003 | @@ -0,0 +1,2533 @@
+import keyword%0Aimport _jsre as re%0A%0Afrom browser import html%0A%0Aletters = 'abcdefghijklmnopqrstuvwxyz'%0Aletters += letters.upper()+'_'%0Adigits = '0123456789'%0A%0Abuiltin_funcs = (%22abs%7Cdivmod%7Cinput%7Copen%7Cstaticmethod%7Call%7Cenumerate%7Cint%7Cord%7Cstr%7Cany%7C%22 +%0A %22ev... | |
d5bf180394233a165f4b5ad8c6561509a4e465ca | add goliad health check | plugins/bongo/check-goliad-health.py | plugins/bongo/check-goliad-health.py | Python | 0 | @@ -0,0 +1,2325 @@
+#!/usr/bin/env python%0A%0Afrom optparse import OptionParser%0Aimport socket%0Aimport sys%0Aimport httplib%0Aimport json%0A%0APASS = 0%0AWARNING = 1%0AFAIL = 2%0A%0Adef get_bongo_host(server, app):%0A try:%0A con = httplib.HTTPConnection(server, timeout=45)%0A con.request(%22GET%22,... | |
ce68b7f025d1ee25a58a093adf462b4b77fb0ad4 | remove duplicate calls to cfg.get() | nova/version.py | nova/version.py | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | Python | 0.001196 | @@ -1432,56 +1432,8 @@
e)%0A%0A
- NOVA_VENDOR = cfg.get(%22Nova%22, %22vendor%22)%0A
@@ -1469,24 +1469,24 @@
%22vendor%22):%0A
+
@@ -1530,58 +1530,8 @@
%22)%0A%0A
- NOVA_PRODUCT = cfg.get(%22Nova%22, %22product%22)%0A
@@ -1631,58 +1631,8 @@
%22)%0A%0A
- NOVA_PACKAGE =... |
02de60c0157aaa52d8f31fe623902a32c734d248 | add generic A&A make script | tex/make.py | tex/make.py | Python | 0 | @@ -0,0 +1,2424 @@
+#!/bin/env python%0Aimport subprocess%0Aimport shutil%0Aimport glob%0Aimport argparse%0Aimport os%0A%0Aname = 'apex_cmz_h2co'%0A%0Aparser = argparse.ArgumentParser(description='Make latex files.')%0Aparser.add_argument('--referee', default=False,%0A action='store_true', help='refe... | |
c1fb3eb548b15ab8049841696b7ae74604c8ed89 | Test for pytest.ini as session-scoped fixture | tests/conftest.py | tests/conftest.py | Python | 0 | @@ -0,0 +1,1251 @@
+%22%22%22%0AConfig instructions and test fixtures%0A%22%22%22%0A%0Aimport pytest%0Aimport os%0Aimport sys%0A%0A%0A# # these are just some fun dividiers to make the output pretty%0A# # completely unnecessary, I was just playing with autouse fixtures%0A# @pytest.fixture(scope=%22function%22, autouse=T... | |
5da51f9ac93487d144f53de30fed69484b9b64dd | add setup script | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,972 @@
+#!/usr/bin/env python%0A%0Afrom distutils.core import setup%0Aimport xmlcompare%0A%0Asetup(name=%22XMLCompare%22,%0A version=xmlcompare.__version__,%0A description=%22XMLCompare checks XML documents/elements for semantic equality%22,%0A author=%22Jan Brohl%22,%0A author_email=%22j... | |
ab22712aa4dc628e257b592c56319871b6ed8f18 | Add setup.py file. | setup.py | setup.py | Python | 0 | @@ -0,0 +1,1818 @@
+#!/usr/bin/env python%0A%0Afrom setuptools import setup%0A%0Aimport traceview%0A%0Apackages = %5B%5D%0A%0Arequires = %5B%5D%0A%0Asetup(%0A name=%22python-traceview%22,%0A version=traceview.__version__,%0A description=%22TraceView API Client%22,%0A #long_description=long_description,%0A%0... | |
43bdadcad33751b2ddbdac332106127a938f3492 | Add setuptools-based setup.py file | setup.py | setup.py | Python | 0 | @@ -0,0 +1,549 @@
+#!/usr/bin/env python%0Afrom setuptools import find_packages, setup%0A%0Asetup(name='txampext',%0A version='20121226',%0A description=%22Extensions to Twisted's AMP implementation%22,%0A url='https://github.com/lvh/txampext',%0A%0A author='Laurens Van Houtven',%0A author_emai... | |
4a42116d0858089dbf2ac2fd8efdcb5ef9226b90 | bump version to 1.0.2 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup, Command
from unittest import TextTestRunner, TestLoader
import os
import os.path
class TestCommand(Command):
user_options = []
def initialize_options(self):
self._testdir = os.path.join(os.getcwd(), 'test')
def finalize_options(self):
... | Python | 0 | @@ -811,17 +811,17 @@
= '1.0.
-1
+2
',%0A d
|
33427521617e45e3227ff7320362c14a6588ea5b | Remove extensions. | setup.py | setup.py | import os
from distribute_setup import use_setuptools
use_setuptools(version='0.6.10')
from setuptools import setup, find_packages, Extension
with open("README.rst") as f:
long_desc = f.read()
setup(
name="custodian",
packages=find_packages(),
version="0.1.0a",
install_requires=[],
extras... | Python | 0 | @@ -128,19 +128,8 @@
ages
-, Extension
%0A%0Awi
@@ -181,20 +181,16 @@
.read()%0A
-
%0Asetup(%0A
|
048f643921fd291b262cac80fbc68531805419cf | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,296 @@
+from distutils.core import setup%0A%0Asetup(%0A name='AdxSuds',%0A version='1.0',%0A packages=%5B''%5D,%0A url='https://github.com/Flexin1981/AdxSuds',%0A license='',%0A author='John Dowling',%0A author_email='johndowling01@live.co.uk',%0A description='Brocade Adx Suds Module ... | |
f85dff78370a8d6d40c63c99615f95bf7ed5c43c | Add spelling requirements to setup.py | setup.py | setup.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
#
# Generate a Flocker package that can be deployed onto cluster nodes.
#
import os
from setuptools import setup, find_packages
import versioneer
versioneer.vcs = "git"
versioneer.versionfile_source = "flocker/_version.py"
versioneer.versionfile_build = "fl... | Python | 0.000001 | @@ -3768,16 +3768,26 @@
o build
+and check
the docu
@@ -3795,24 +3795,34 @@
entation for
+%0A #
Flocker.%0A
@@ -3835,16 +3835,29 @@
%22doc%22: %5B
+%0A
%22Sphinx=
@@ -3864,16 +3864,28 @@
=1.2.2%22,
+%0A
%22sphinx
@@ -3902,16 +3902,107 @@
==0.1.6%22
+,%0A %22pyench... |
7ec768f50d5d0e8537fac23a2b819965374ce582 | Use version of zope.interface we have available. | setup.py | setup.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
#
# Generate a Flocker package that can be deployed onto cluster nodes.
#
import os.path
from setuptools import setup
path = os.path.join(os.path.dirname(__file__), b"flocker/version")
with open(path) as fObj:
version = fObj.read().strip()
del path
se... | Python | 0 | @@ -1691,11 +1691,11 @@
= 4.
-1.1
+0.5
%22,%0A
|
e5175894d49afe8205f0f969ffc4ea9eecec0f72 | add setup.py file | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,479 @@
+from distutils.core import setup%0A%0Asetup(%0A name='pynvd3',%0A version='0.01',%0A description='A Python wrapper for NVD3.js',%0A url='http://github.com/jephdo/pynvd3/',%0A author='Jeph Do',%0A author_email='jephdo@gmail.com',%0A packages=%5B%0A 'pynvd3', %0A %5D,%0A ... | |
d38554332872c1b8f4a3a44bf4c18dda68752d04 | add setup.py file | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1517 @@
+%EF%BB%BFimport os%0Afrom setuptools import setup, find_packages%0Afrom pmll import version%0A%0A# Import multiprocessing to prevent test run problem. In case of nosetests%0A# (not nose2) there is probles, for details see:%0A# https://groups.google.com/forum/#!msg/nose-users/fnJ-kAUbYHQ/_UsLN786ygcJ... | |
340baa5f077b0ae3cb1ab6de736d67be89319c35 | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,2382 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom setuptools import setup%0A%0Asetup(%0A name=%22python-usernames%22,%0A description=%22Python library to validate usernames suitable for use in public facing applications.%22,%0A version=%220.0.1%22,%0A author=%22... | |
c3b44b012ddc18f7a6711609f04060f65bd36846 | include history with readme for setup.py | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
from setuptools import find_packages
import re
VERSIONFILE = 'gmusicapi/version.py'
version_line = open(VERSIONFILE).read()
version_re = r"^__version__ = ['\"]([^'\"]*)['\"]"
match = re.search(version_re, version_line, re.M)
if match:
version = match.group(... | Python | 0 | @@ -86,17 +86,16 @@
ackages%0A
-%0A
import r
@@ -95,16 +95,196 @@
mport re
+%0A%0A#This hack is from http://stackoverflow.com/a/7071358/1231454;%0A# the version is kept in a seperate file and gets parsed - this%0A# way, setup.py doesn't have to import the package.
%0A%0AVERSIO
@@ -904,16 +904,17 @@
ription=
+(
op... |
91dca4294beccd4b7ff4ff9e1f029c7d63273928 | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,163 @@
+from setuptools import setup%0A%0Asetup(name='track-class-availability',%0A version='1.0',%0A install_requires=%5B'BeautifulSoup %3E= 4.3.2', 'schedule %3E= 0.3.1'%5D%0A)%0A
| |
eb12d44dffadf0c62fe231926a5004e5ef58d1a4 | Add the setup script | setup.py | setup.py | Python | 0 | @@ -0,0 +1,605 @@
+from setuptools import setup, find_packages%0A%0Asetup(%0A name = %22ccpoviz%22,%0A version = %220.0.1%22,%0A packages = find_packages(),%0A scripts = %5B%5D,%0A%0A install_requires = %5B%0A 'docutils%3E=0.3',%0A 'pystache%3E=0.5',%0A %5D,%0A%0A package_data = %... | |
d3e1957915ed9d385742232475ac8992b17c6e7e | bump up version to 1.0.0 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
import os
import sys
# minimum required version is 2.6; py3k not supported yet
if not ((2, 6) <= sys.version_info < (3, 0)... | Python | 0.000002 | @@ -588,13 +588,13 @@
= '
-0.1.1
+1.0.0
',%0A
@@ -1316,16 +1316,15 @@
::
-3 - Alph
+4 - Bet
a',%0A
|
7f63c5b2a624870667d62ff21cbfb28c7cf2a189 | add setup script | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,627 @@
+#!/usr/bin/env python%0A%0A# -*- coding: utf-8 -*-%0A%0Afrom distutils.core import setup%0A%0A%0A%0Asetup(name='FileWatcher',%0A%09%09version='1.00',%0A%09%09description='File watching framework',%0A%09%09packages=%5B'filewatcher', %5D,%0A%09%09package_dir=%7B'': 'lib'%7D,%0A%09%09requires=%5B'PyYAML... | |
58b92617e03742658a6362f66664109de8993038 | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,267 @@
+from setuptools import setup%0A%0Asetup(%0A name='cvrminer',%0A author='Finn Aarup Nielsen',%0A author_email='faan@dtu.dk',%0A license='Apache License',%0A url='https://github.com/fnielsen/cvrminer',%0A packages=%5B'cvrminer'%5D,%0A test_requires=%5B'flake8'%5D,%0A )%0A %0A
| |
9abae470ce9cf9d255921d7c4306ee7daadcd6f2 | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1271 @@
+from setuptools import setup, find_packages%0Afrom codecs import open%0Afrom os import path%0A%0Ahere = path.abspath(path.dirname(__file__))%0A%0A# Get the long description from the relevant file%0Awith open(path.join(here, 'README.md'), encoding='utf-8') as f:%0A long_description = f.read()%0A%0... | |
54ec15fa8985a1eb8782643d84afba7e1506536f | Fix mixed-line-endings entrypoint | setup.py | setup.py | from setuptools import find_packages
from setuptools import setup
setup(
name='pre_commit_hooks',
description='Some out-of-the-box hooks for pre-commit.',
url='https://github.com/pre-commit/pre-commit-hooks',
version='0.9.3',
author='Anthony Sottile',
author_email='asottile@umich.edu',
c... | Python | 0.00108 | @@ -2761,32 +2761,19 @@
ending:m
-ixed_line_ending
+ain
',%0A
|
fcf000ee1b6834b5eabc106f6b617157443ed94d | Create sezar.py | sezar.py | sezar.py | Python | 0.000002 | @@ -0,0 +1,724 @@
+password = %5B7,29,12,21,5,19,2,11,28,16,10,1,15,24,8,25,4,13,20,18,14,3,17,22,9,23,26,27,6%5D%0Adef encrypt(a):%0A cipher = %5B%5D%0A i = 0%0A n = 0%0A while i %3C len(a):%0A while n %3C len(password):%0A if int(a%5Bi%5D) == (n+1):%0A cipher = cipher + %5... | |
f1334c006f07b2b1494d4b92a3ecb4186d8e3954 | add stack.py to branch | stack.py | stack.py | Python | 0.000001 | @@ -0,0 +1,398 @@
+from linked_list import LinkedList%0A%0A#Stack inherits from LinkedList class%0Aclass Stack(object):%0A%0A def __init__(self, iterable=None):%0A if iterable != None:%0A self._linkedList = LinkedList(iterable)%0A else:%0A self._linkedList = LinkedList()%0A%0A ... | |
785a1962c910a722f218bc814d1868f2b4bc7033 | Add interfaces: Parmeterizer, Converter, Analyzer and Synthesizer (and some thier subclasses) | vctk/interface.py | vctk/interface.py | Python | 0 | @@ -0,0 +1,2750 @@
+# coding: utf-8%0Aimport numpy as np%0A%0A%22%22%22%0AInterfaces%0A%22%22%22%0A%0A%0Aclass Analyzer(object):%0A%0A %22%22%22%0A Speech analyzer interface%0A%0A All of analyzer must implement this interface.%0A %22%22%22%0A%0A def __init__(self):%0A pass%0A%0A def analyze(sel... | |
ab7d1b230a5ef1c0763da1d150488add0b75ce31 | Add test file | tests.py | tests.py | Python | 0.000001 | @@ -0,0 +1,383 @@
+import unittest%0D%0A%0D%0A%0D%0Aclass MyappTestCase(unittest.TestCase):%0D%0A%0D%0A def setUp(self):%0D%0A myapp.app.config%5B'DEBUG'%5D = tempfile.mkstemp()%0D%0A self.app = myapp.app.test_client()%0D%0A%0D%0A def tearDown(self):%0D%0A pass%0D%0A%0D%0A def test_index(s... | |
4029f604a4c809a201d0334946d680fb53b467dd | add initial pygame prototype | Python_Data/multimedia/pygameTest.py | Python_Data/multimedia/pygameTest.py | Python | 0 | @@ -0,0 +1,1545 @@
+import random as rnd%0Aimport pygame%0Aimport sys%0A%0Adef generateObj():%0A objPos = (rnd.randint(50, 950), rnd.randint(50, 950))%0A objColor = (0, 0, 0)%0A return list(%5BobjColor, objPos%5D)%0A%0A%0Apygame.init()%0Abgcolor = (255, 255, 204)%0Asurf = pygame.display.set_mode((1000,1000))%0... | |
73575d8e8f8748530bc60ffd3b094eadadcdfe4c | Encode secret | jedihttp/hmaclib.py | jedihttp/hmaclib.py | # Copyright 2015 Cedraro Andrea <a.cedraro@gmail.com>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python | 0.999999 | @@ -2147,17 +2147,29 @@
ecret =
-b
+encode_string
( secret
|
b6ee1301075bcd391ce86d54075bf853f4ee6b2d | Add version.py | lantz_drivers/version.py | lantz_drivers/version.py | Python | 0.000001 | @@ -0,0 +1,22 @@
+__version__ = '0.0.1'%0A
| |
9387fb8ee3865fdc00b0b96fd8db77ef1b2f13a8 | Create watchingthestuffoverhere.py | python/watchingthestuffoverhere.py | python/watchingthestuffoverhere.py | Python | 0 | @@ -0,0 +1,1491 @@
+#!/usr/bin/env python%0A# coding=utf-8%0Aimport string%0Aimport re%0Aimport csv%0Afrom selenium import webdriver%0Afrom datetime import datetime%0A%0A#avaaz url to watch%0AtehURL = %22somethingsomething%22%0Aignores = re.compile('(seconds%7Cminute%7Cminutes%7Cjust)%5Cs(ago%7Cnow)')%0Alst = %5B%5D%0A... | |
fbbb65524a3b8f5486594d89f6cf885663ac7f3d | Support ubuntu variable for DESKTOP_SESSION | pythonpath/bookmarks/env/ubuntu.py | pythonpath/bookmarks/env/ubuntu.py | Python | 0 | @@ -0,0 +1,45 @@
+%0AOPEN = %22xdg-open%22%0AFILE_MANAGER = %22nautilus%22%0A
| |
c4f541b1bf6dac406e8849e528dbe7f5b954980e | Clean up & Fixes | qrl/core/StakeValidatorsTracker.py | qrl/core/StakeValidatorsTracker.py | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from collections import OrderedDict, defaultdict
from qrl.core import config
from qrl.core.StakeValidator import StakeValidator
from qrl.core.formulas import calc_seed... | Python | 0 | @@ -318,53 +318,8 @@
eed%0A
-from qrl.core.VoteTracker import VoteTracker%0A
%0A%0Acl
@@ -1098,32 +1098,79 @@
xn.txfrom%5D = sv%0A
+ self._total_stake_amount += sv.balance%0A
self._ex
|
a004747df945f3361b53106339dab43e652fce74 | Fix dependencies for weborigin_unittests | Source/weborigin/weborigin_tests.gyp | Source/weborigin/weborigin_tests.gyp | #
# Copyright (C) 2013 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 of conditions and th... | Python | 0.999975 | @@ -1886,20 +1886,37 @@
TH)/
-url/
+build/temp_gyp/google
url.gyp:
url'
@@ -1911,16 +1911,22 @@
url.gyp:
+google
url',%0A
@@ -2126,24 +2126,65 @@
dencies': %5B%0A
+ '%3C(DEPTH)/base/base.gyp:base',%0A
'%3C
|
abd70f40aaa026844f9b088a4a648ce58e469839 | add preliminary measure script | measure.py | measure.py | Python | 0 | @@ -0,0 +1,2187 @@
+from __future__ import absolute_import, division, print_function%0Afrom six.moves import filter, intern, map, range, zip%0A%0Afrom functools import reduce%0A%0Afrom numpy import cbrt, floor, sqrt%0A%0Afrom firedrake.petsc import PETSc%0Afrom firedrake import ExtrudedMesh, UnitSquareMesh, assemble%0A... | |
462f9a651eb93aca3c8ff980345e40429e6f3fe9 | add migrate script | migrate.py | migrate.py | Python | 0.000001 | @@ -0,0 +1,1239 @@
+# -*- coding: utf-8 -*-%0Aimport os%0Afrom boto.s3.connection import S3Connection%0Afrom boto.s3.key import Key%0A%0Aconnection = S3Connection(%0A host = 's3.amazonaws.com', # S3 Compatible Services%0A is_secure = True,%0A aws_access_key_id = 'access_key_id', # Add your access key%0A ... | |
feb4e40afa8b589d9dc90652099202d07921f4b8 | add 0021 | llluiop/0021/password.py | llluiop/0021/password.py | Python | 0.999997 | @@ -0,0 +1,385 @@
+#!/usr/bin/env python%0A#-*- coding: utf-8-*-%0A%0A%0A%0Aimport os%0Afrom hashlib import sha256%0Afrom hmac import HMAC%0A%0Adef encode(password):%0A salt = os.urandom(8)%0A print salt%0A%0A result = password.encode(%22utf-8%22)%0A%0A for i in range(10):%0A result = HMAC(result, sa... | |
debaa1f32b6b2dcbc7a7e8a02de19afc2c86a29f | add asgi file | django_react/asgi.py | django_react/asgi.py | Python | 0.000001 | @@ -0,0 +1,155 @@
+import os%0Aimport channels.asgi%0A%0Aos.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22, %22django_react.settings%22)%0Achannel_layer = channels.asgi.get_channel_layer()%0A
| |
002e903c978a30f27ed24316bb85958e5c69a259 | Solve Code Fights count visitors problem | CodeFights/countVisitors.py | CodeFights/countVisitors.py | Python | 0.000022 | @@ -0,0 +1,1044 @@
+#!/usr/local/bin/python%0A# Code Fights Count Visitors Problem%0A%0A%0Aclass Counter(object):%0A def __init__(self, value):%0A self.value = value%0A%0A def inc(self):%0A self.value += 1%0A%0A def get(self):%0A return self.value%0A%0A%0Adef countVisitors(beta, k, visitor... | |
f53aef9fdcd01fdb8607984e38b4fb8c5813aacf | Solve Code Fights fibonacci list problem | CodeFights/fibonacciList.py | CodeFights/fibonacciList.py | Python | 0.998522 | @@ -0,0 +1,1352 @@
+#!/usr/local/bin/python%0A# Code Fights Fibonacci List Problem%0A%0Afrom functools import reduce%0A%0A%0Adef fibonacciList(n):%0A return %5B%5B0%5D * x for x in reduce(lambda x, n: x + %5Bsum(x%5B-2:%5D)%5D,%0A range(n - 2), %5B0, 1%5D)%5D%0A%0A%0Adef main():%0A... | |
902cf7f0b167847a96e1db0cd523878c5abb9032 | add addlc.py: add 2 lightcurves (to be used to crate EPIC combined lightcurves) | addlcs.py | addlcs.py | Python | 0 | @@ -0,0 +1,668 @@
+#!/usr/env python%0A%0Aimport myscitools%0Aimport glob%0A%0Aif __name__ == '__main__':%0A '''%0A Add lightcurves%0A MOS1 + MOS2 = MOSS%0A PN + MOSS = EPIC%0A '''%0A mos1files = glob.glob('MOS1_lc_net*')%0A mos2files = glob.glob('MOS2_lc_net*')%0A pnfiles = glob.glob('PN_lc_net... | |
0116701a64748efe1348686c2c52069d8d94c5f9 | Add migration | cms_lab_carousel/migrations/0004_auto_20151207_0015.py | cms_lab_carousel/migrations/0004_auto_20151207_0015.py | Python | 0.000002 | @@ -0,0 +1,1938 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0Aimport django.db.models.deletion%0Aimport django.utils.timezone%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('cms_lab_carousel', '0003_auto_20150... | |
81a33445be7f48bdbe95f79c42d09332303f2d42 | Revert "Bugfix for displaying correctly the plugins in the event view." | sentry/plugins/__init__.py | sentry/plugins/__init__.py | """
sentry.plugins
~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from sentry.web.helpers import render_to_response
class Response(object)... | Python | 0 | @@ -508,14 +508,8 @@
text
- or %7B%7D
)%0A
|
5b1782ad41d738bce01f20b4cef5242420e83931 | Add a snippet. | python/matplotlib/colour_map_list.py | python/matplotlib/colour_map_list.py | Python | 0.000002 | @@ -0,0 +1,493 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A# See: http://matplotlib.org/1.2.1/examples/pylab_examples/show_colormaps.html%0A%0A# See also:%0A# - http://matplotlib.org/examples/color/colormaps_reference.html (the list of all colormaps)%0A# - http://matplotlib.org/users/colormaps.html?highli... | |
ad47e008ec61772c8c169742f0ab944f0f426a7a | Add solution to 97. | 097/97.py | 097/97.py | Python | 0.000025 | @@ -0,0 +1,1522 @@
+%0A%0Adef two_to_n_mod_10_to_m(n, m):%0A %22%22%22Successive squaring. Very fast and handles very large numbers.%0A%0A 1. Rewrite 2%5En so that n is a sum of powers of two.%0A 2. Create a list of powers 2%5E(2%5Ei) mod 10%5Em, by repeatedly squaring the prior result.%0A 3. Combine, with ... | |
bf744e472209162ce83b2759c9240cb3018cb0bf | Fix find_packages | henson/contrib/__init__.py | henson/contrib/__init__.py | Python | 0 | @@ -0,0 +1,33 @@
+%22%22%22Henson's contrib packages.%22%22%22%0A
| |
11296e24228ee10be009b04a9909504a8e8d5ace | Test for the save_character() function | tests/models/character/test_saver.py | tests/models/character/test_saver.py | Python | 0.00001 | @@ -0,0 +1,1327 @@
+import unittest%0A%0Aimport database.main%0Afrom tests.create_test_db import engine, session, Base%0Adatabase.main.engine = engine%0Adatabase.main.session = session%0Adatabase.main.Base = Base%0Aimport models.main%0A%0Afrom classes import Paladin%0Afrom models.characters.saved_character import Saved... | |
617fc7564685731daee309dd1478856395dc62dc | Make the documentation for the general class non-specific. | src/stratisd_client_dbus/_stratisd_constants.py | src/stratisd_client_dbus/_stratisd_constants.py | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Python | 0.997368 | @@ -886,32 +886,29 @@
f parse_
-error_list(error
+list(constant
_list):%0A
@@ -946,37 +946,40 @@
ist of stratisd
-error
+constant
s.%0A%0A :par
@@ -973,37 +973,40 @@
%0A :param
-error
+constant
_list: list of e
@@ -996,37 +996,40 @@
t_list: list of
-error
+constant
s published by s
@@ -1042,37 ... |
dcb4a8ae0732b78afa4385988714f19b78fb3312 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/ff451b346ffc6061369b7712da787ceb2b5becf7. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "94a9cc13caf5aa8e2ba54937ed837279c11c78e4"
TFRT_SHA256 = "8a9257aaf2b0042824659be7b2fd8335f37b98a4f57f76... | Python | 0.000001 | @@ -210,133 +210,133 @@
= %22
-94a9cc13caf5aa8e2ba54937ed837279c11c78e4%22%0A TFRT_SHA256 = %228a9257aaf2b0042824659be7b2fd8335f37b98a4f57f76fda58ad820fde00f2a
+ff451b346ffc6061369b7712da787ceb2b5becf7%22%0A TFRT_SHA256 = %22333151d184baf3b8b384615ea20c9ab14efab635f096b364e7b11a000cac2016
%22%0A%0A
|
5568f30f2bcb83eb8f4dd250d8c817aaea3815f5 | Create chalkboard-xor-game.py | Python/chalkboard-xor-game.py | Python/chalkboard-xor-game.py | Python | 0.000252 | @@ -0,0 +1,1502 @@
+# Time: O(n)%0A# Space: O(1)%0A%0A# We are given non-negative integers nums%5Bi%5D which are written on a chalkboard.%0A# Alice and Bob take turns erasing exactly one number from the chalkboard,%0A# with Alice starting first. If erasing a number causes the bitwise XOR of%0A# all the elements of th... | |
c9294cbc743923c8898b7775392e93313c1ba171 | Create FindMininRSA2_001.py | leetcode/154-Find-Minimum-in-Rotated-Sorted-Array-II/FindMininRSA2_001.py | leetcode/154-Find-Minimum-in-Rotated-Sorted-Array-II/FindMininRSA2_001.py | Python | 0.000002 | @@ -0,0 +1,378 @@
+class Solution:%0A # @param num, a list of integer%0A # @return an integer%0A def findMin(self, num):%0A L = 0; R = len(num)-1%0A while L %3C R and num%5BL%5D %3E= num%5BR%5D:%0A M = (L+R)/2%0A if num%5BM%5D %3E num%5BL%5D:%0A L = M + 1%0A ... | |
a78d93dbc23d832ca5eaae6535a45bfa478e4e56 | Add US state capitals from vega-lite. | altair/vegalite/v2/examples/us_state_capitals.py | altair/vegalite/v2/examples/us_state_capitals.py | Python | 0.001902 | @@ -0,0 +1,870 @@
+%22%22%22%0AU.S. state capitals overlayed on a map of the U.S%0A================================================-%0AThis is a geographic visualization that shows US capitals%0Aoverlayed on a map.%0A%22%22%22%0A%0Aimport altair as alt%0Afrom vega_datasets import data%0A%0Astates = alt.UrlData(data.us_... | |
43fb03cc5fb1d61c30e783fa5c771c626d29dd82 | Update forward compatibility horizon to 2019-01-18 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -1143,9 +1143,9 @@
1, 1
-7
+8
)%0A%0A%0A
|
e9a09aafb6c9098fa514eb48a0ab41a729c5a733 | Update forward compatibility horizon to 2019-02-25 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -1143,9 +1143,9 @@
2, 2
-4
+5
)%0A%0A%0A
|
301a506aa21d4439448508ed80844d402c574e97 | Add version 1.7 (#26712) | var/spack/repos/builtin/packages/py-pygraphviz/package.py | var/spack/repos/builtin/packages/py-pygraphviz/package.py | Python | 0 | @@ -0,0 +1,643 @@
+# Copyright 2013-2021 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 PyPygraphviz(PythonPackage):%0A %22%22%22Python interfac... | |
f22abf2b8a31d9621a891191db84364edb167390 | Add a management command to create realm administrators. | zephyr/management/commands/knight.py | zephyr/management/commands/knight.py | Python | 0 | @@ -0,0 +1,1163 @@
+from __future__ import absolute_import%0A%0Aimport sys%0Afrom optparse import make_option%0A%0Afrom django.core.management.base import BaseCommand, CommandError%0Afrom django.core.exceptions import ValidationError%0Afrom django.db.utils import IntegrityError%0Afrom django.core import validators%0A%0... | |
ee1beb9b4bd51ab8f0bcb473d329275c68430919 | Ajoute un script remplaçant des extraits d’enregistrement par les enregistrements entiers. | scripts/remplacement_extraits_AFO.py | scripts/remplacement_extraits_AFO.py | Python | 0 | @@ -0,0 +1,875 @@
+# coding: utf-8%0A%22%22%22%0ACopie les fichiers list%C3%A9s dans %22Campagne num%C2%B0 2012-13.xlsx%22 (chemin%C2%A0: filepath)%0Adepuis dir_source vers dir_dest.%0A%22%22%22%0A%0Afrom __future__ import print_function%0Aimport os%0Aimport shutil%0Aimport pandas as pd%0Afrom scripts.import_AFO_11_201... | |
7eef45621d3e917cf09101b309a7c839008dde76 | Fix indentation | tensorflow/core/platform/default/build_config_root.bzl | tensorflow/core/platform/default/build_config_root.bzl | # Lower-level functionality for build config.
# The functions in this file might be referred by tensorflow.bzl. They have to
# be separate to avoid cyclic references.
def tf_cuda_tests_tags():
return ["local"]
def tf_sycl_tests_tags():
return ["local"]
def tf_additional_plugin_deps():
return select({
"//... | Python | 0.017244 | @@ -707,32 +707,36 @@
pport%22: %5B%0A
+
%22//tensorflow/co
@@ -766,16 +766,20 @@
r_lib%22,%0A
+
%22/
@@ -822,16 +822,23 @@
_client%22
+%0A
%5D, %0A
@@ -964,24 +964,28 @@
t%22: %5B%0A
+
%22//tensorflo
@@ -1013,16 +1013,23 @@
ver_lib%22
+%0A
%5D,%0A
|
cfc11472f16040d06915a58c3dd3c027b77fdd80 | set up testing with py.test | scripts/tests/test_identify_locus.py | scripts/tests/test_identify_locus.py | Python | 0.000001 | @@ -0,0 +1,100 @@
+import sys%0Asys.path.append(%22..%22)%0Afrom identify_locus import *%0A%0Adef test_answer():%0A assert 5 == 5%0A
| |
4f1e1874f3ed9af8922aa26eb20230dbee5e6d73 | Add some example code for creation of disk partitions. | examples/partitioning.py | examples/partitioning.py | Python | 0 | @@ -0,0 +1,1901 @@
+import logging%0Aimport sys%0Aimport os%0A%0Afrom common import set_up_logging%0Afrom common import create_sparse_file%0Afrom common import tear_down_disk_images%0Afrom common import print_devices%0A%0A# doing this before importing blivet gets the logging from format class%0A# registrations and othe... | |
d35dd563b25f85d23191169e8f87882129f64adb | Add images admin | features/images/admin.py | features/images/admin.py | Python | 0 | @@ -0,0 +1,90 @@
+from django.contrib import admin%0A%0Afrom . import models%0A%0Aadmin.site.register(models.Image)%0A
| |
dc3f2b1e3a10c2d186b99a00553607845ac80c68 | Add an icon handler the MediaWiki processor | fedmsg/text/mediawiki.py | fedmsg/text/mediawiki.py | # This file is part of fedmsg.
# Copyright (C) 2012 Red Hat, Inc.
#
# fedmsg is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#... | Python | 0.000001 | @@ -2420,28 +2420,387 @@
raise NotImplementedError%0A
+%0A def handle_icon(self, msg, **config):%0A return any(%5Btarget in msg%5B'topic'%5D for target in %5B%0A 'wiki.article.edit',%0A 'wiki.upload.complete',%0A %5D%5D)%0A%0A def icon(self, msg, **config):%0A return ... |
a0c23d3fc448f916ffdd668a2daf56408dd9c0c0 | Add simple implementation for a pre-commit hook | mothermayi/pre_commit.py | mothermayi/pre_commit.py | Python | 0 | @@ -0,0 +1,271 @@
+import mothermayi.entryway%0Aimport mothermayi.git%0A%0Adef handle_plugins(entries):%0A for entry in entries:%0A result = entry()%0A%0Adef run():%0A with mothermayi.git.stash():%0A entries = mothermayi.entryway.get_entries('pre-commit')%0A handle_plugins(entries)%0A
| |
3f4e233075abe6f889dee82b44f46385d2811ca5 | Fix guid to be unique for landfill-generated test add-ons | src/olympia/landfill/generators.py | src/olympia/landfill/generators.py | import collections
import random
from datetime import datetime
from itertools import cycle, islice
from django.db.models.signals import post_save
from olympia.addons.forms import icons
from olympia.addons.models import Addon, Persona, update_search_index
from olympia.amo.utils import slugify
from olympia.constants.a... | Python | 0 | @@ -1693,47 +1693,8 @@
e),%0A
- 'guid': '@%25s' %25 slugify(name),%0A
@@ -2180,24 +2180,60 @@
ATUS_PUBLIC%0A
+ addon.guid = '@%25s' %25 addon.slug%0A
addon.sa
|
ec69c9260a2205ab0b7b9b7c4903ae2ced6029a1 | add settings file | msschem_settings.py | msschem_settings.py | Python | 0 | @@ -0,0 +1,458 @@
+import os.path%0A%0Afrom msschem.models import CAMSRegDriver%0Afrom msschem.download import CAMSRegDownload%0A%0Aregister_datasources = %7B%0A 'CAMSReg_ENSEMBLE': CAMSRegDriver(%0A dict(%0A dldriver=CAMSRegDownload(%0A token='MYTOKEN',%0A modelname='... | |
e8d579177ee9fae714dcc3dfc36b5a5c234dfa0e | Create simulator_follow_blue.py | simulator/simulator_follow_blue.py | simulator/simulator_follow_blue.py | Python | 0.000001 | @@ -0,0 +1,2538 @@
+from Myro import *%0Ainit(%22sim%22)%0A%0AsetPictureSize(%22small%22)%0AautoCamera()%0A%0A%0A#'''%0A#chase blue setting%0Aylow = 0%0Ayhigh = 255%0Aulow = 170 #130 for the straw # originally 134%0Auhigh = 250 # up to 158, really 145, 157 for the straw #142 originally%0Avlow = 90 # down to 109, really... | |
7ebded009386fe5b9ef4a6719fe100fa0a3836ba | Create 0013.py | Liez-python-code/0013/0013.py | Liez-python-code/0013/0013.py | Python | 0.000026 | @@ -0,0 +1,614 @@
+# %E7%BD%91%E5%9D%80%EF%BC%9Ahttp://tieba.baidu.com/p/4341640851%0A%0Aimport os%0Aimport re%0Aimport urllib.request%0A%0Adef pic_collector(url):%0A content = urllib.request.urlopen(url).read()%0A r = re.compile('%3Cimg class=%22BDE_Image%22 pic_type=%221%22 width=%22450%22 height=%22450%22 src=... | |
cc488a5082a98f9e0a5a60a86815cb8c518fcc2d | Add test for PosRecChiSquareGamma | tests/test_posrecchisquaregamma.py | tests/test_posrecchisquaregamma.py | Python | 0.000002 | @@ -0,0 +1,2450 @@
+import unittest%0Aimport numpy as np%0A%0Afrom pax import core, plugin%0Afrom pax.datastructure import Event, Peak%0Afrom pax.utils import empty_event%0A%0A%0Aclass TestPosRecChiSquareGamma(unittest.TestCase):%0A%0A def setUp(self):%0A self.pax = core.Processor(config_names='posrecChi',%0A... | |
d8eb3d1f840dbcfbe32bf98e757b841fd062ad9e | Create ContainDupII_001.py | leetcode/219-Contains-Duplicate-II/ContainDupII_001.py | leetcode/219-Contains-Duplicate-II/ContainDupII_001.py | Python | 0 | @@ -0,0 +1,408 @@
+class Solution:%0A # @param %7Binteger%5B%5D%7D nums%0A # @param %7Binteger%7D k%0A # @return %7Bboolean%7D%0A def containsNearbyDuplicate(self, nums, k):%0A tb = %7B%7D%0A for i in range(len(nums)):%0A num = nums%5Bi%5D%0A if num not in tb:%0A ... | |
a678694e0203cd7529e28789afca49d0ae7085df | Fix a bug in trust middleware | senlin/api/middleware/trust.py | senlin/api/middleware/trust.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | Python | 0.00006 | @@ -1885,16 +1885,18 @@
user_id(
+**
service_
|
16615d7794b127e9752b1a2b0bd8e70adfb0954c | Add tests for inplace subset | anndata/tests/test_inplace_subset.py | anndata/tests/test_inplace_subset.py | Python | 0 | @@ -0,0 +1,2119 @@
+import numpy as np%0Aimport pytest%0Afrom sklearn.utils.testing import (%0A assert_array_equal%0A)%0Afrom scipy import sparse%0A%0Afrom anndata.tests.helpers import (%0A gen_adata,%0A subset_func,%0A asarray%0A)%0A%0A@pytest.fixture(%0A params=%5Bnp.array, sparse.csr_matrix, sparse.cs... | |
db660f2a155b490f6a7f553ef19b8eaf8f9c9776 | Create สร้าง-LINE-Bot-ด้วย-Python.py | สร้าง-LINE-Bot-ด้วย-Python.py | สร้าง-LINE-Bot-ด้วย-Python.py | Python | 0.000005 | @@ -0,0 +1,1227 @@
+# %E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%9A%E0%B8%97%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1 https://python3.wannaphong.com/blog/2016/10/02/%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-line-bot-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-python/%0Afrom flask import Flask, request%0Aimport json%0Aimport requests%0A... | |
6ee126d275be184cba074f2638d122c0a3d774ef | Fix the googleurl_unittests hack so iOS builds work again. | url/url.gyp | url/url.gyp | # Copyright 2013 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.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
'target_name': 'url',
'type': 'static_library',
'dependencies': [
... | Python | 0.000114 | @@ -3898,55 +3898,31 @@
%7D
-%0A %5D,%0A %5B'OS == %22ios%22',%0A %7B
+, %7B # else OS == %22ios%22
%0A
@@ -4196,29 +4196,16 @@
sts.app/
-url_unittests
',%0A
@@ -4269,36 +4269,16 @@
ests.app
-/googleurl_unittests
',%0A
@@ -4543,32 +4543,16 @@
'
-python', '../build/cp.py... |
8f227ebc4900b931a90e0c87d9f61b4c6ea0e084 | add simple topology example | src/emuvim/examples/sonata_simple_topology.py | src/emuvim/examples/sonata_simple_topology.py | Python | 0.000002 | @@ -0,0 +1,2442 @@
+%22%22%22%0ACopyright (c) 2015 SONATA-NFV%0AALL RIGHTS RESERVED.%0A%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0A http://www.apache.org/licenses/LICENSE-2.0%0... | |
eb87d38a65620c7e4a716dca8a8b9488b3a338d3 | Fix syntax error in collector test | src/collectors/numa/test/testnuma.py | src/collectors/numa/test/testnuma.py | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import patch
from diamond.collector import Collector
from numa import NumaCollector
##########... | Python | 0.000022 | @@ -832,16 +832,17 @@
MB': 42
+,
%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.