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 |
|---|---|---|---|---|---|---|---|
44e3876d76c7d7b3571c82030ff78260e4ec7e65 | Add PCA.py template | ML/PCA.py | ML/PCA.py | Python | 0 | @@ -0,0 +1,217 @@
+%22%22%22%0AExact principal component analysis (PCA)%0A%22%22%22%0A%0Aclass PCA(object):%0A %22%22%22%0A Exact principal component analysis (PCA)%0A %22%22%22%0A %0A def __init__(self):%0A return %0A %0A def fit(self, X):%0A return
| |
cd2c959674043fcc3b6261129f57f266539a8658 | Add a Python snippet. | Python.py | Python.py | Python | 0.000043 | @@ -0,0 +1,220 @@
+#!/usr/bin/env python%0A# coding: utf-8%0A%0A%22%22%22Python snippet%0A%22%22%22%0A%0Aimport os%0Aimport sys%0A%0Aif __name__ == '__main__':%0A if len (sys.argv) == 1:%0A print (%22Hi there!%22)%0A else:%0A print (%22Hello, %25s!%22 %25 sys.argv%5B1%5D)%0A
| |
65449c60f357eeab5ddc9eb91a468ab1e3719de7 | Add dismiss_recommendation example (#35) | examples/v0/recommendations/dismiss_recommendation.py | examples/v0/recommendations/dismiss_recommendation.py | Python | 0 | @@ -0,0 +1,2990 @@
+# Copyright 2019 Google LLC%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# https://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by ... | |
8d6ca433d33551cc1fe5c08edcf68ec65e5447b0 | Add solution to exercise 3.3. | exercises/chapter_03/exercise_03_03/exercies_03_03.py | exercises/chapter_03/exercise_03_03/exercies_03_03.py | Python | 0.000054 | @@ -0,0 +1,299 @@
+# 3-3 Your Own List%0Atransportation = %5B%22mountainbike%22, %22teleportation%22, %22Citro%C3%ABn DS3%22%5D%0A%0Aprint(%22A %22 + transportation%5B0%5D + %22 is good when exercising in the woods.%5Cn%22)%0Aprint(%22The ultimate form of trarsportation must be %22 + transportation%5B1%5D + %22.%5Cn%22... | |
d82ecab372ed22da0b00512294ee6cd3f5fcb012 | Add script to reindex datasets. | ckanofworms/scripts/reindex.py | ckanofworms/scripts/reindex.py | Python | 0 | @@ -0,0 +1,2817 @@
+#! /usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A%0A# CKAN-of-Worms -- A logger for errors found in CKAN datasets%0A# By: Emmanuel Raviart %3Cemmanuel@raviart.com%3E%0A#%0A# Copyright (C) 2013 Etalab%0A# http://github.com/etalab/ckan-of-worms%0A#%0A# This file is part of CKAN-of-Worms.%0A#%0A# ... | |
d7adec1fefae1ff64e0caab2cf1c774ed9498fd8 | Use simpler form of pg_try_advisory_lock | configure-aspen.py | configure-aspen.py | from __future__ import division
from decimal import Decimal as D
import threading
import time
import traceback
import gratipay
import gratipay.wireup
from gratipay import canonize, utils
from gratipay.security import authentication, csrf, x_frame_options
from gratipay.utils import cache_static, i18n, set_cookie, time... | Python | 0.000901 | @@ -2147,11 +2147,8 @@
ock(
-0,
0)%22)
|
ab99892d974503f2e0573a8937dc8f1b085b0014 | Add stringbuilder module | modules/pipestrconcat.py | modules/pipestrconcat.py | Python | 0.000001 | @@ -0,0 +1,592 @@
+# pipestrconcat.py #aka stringbuilder%0A#%0A%0Afrom pipe2py import util%0A%0Adef pipe_strconcat(context, _INPUT, conf, **kwargs):%0A %22%22%22This source builds a string and yields it forever.%0A %0A Keyword arguments:%0A context -- pipeline context%0A _INPUT -- not used%0A conf:%0... | |
e7053da76c14f12bfc02992ab745aac193e7c869 | Create compareLists.py | compareLists.py | compareLists.py | Python | 0.000001 | @@ -0,0 +1,464 @@
+def unique(a):%0A %22%22%22 return the list with duplicate elements removed %22%22%22%0A return list(set(a))%0A%0Adef intersect(a, b):%0A %22%22%22 return the intersection of two lists %22%22%22%0A return list(set(a) & set(b))%0A%0Adef union(a, b):%0A %22%22%22 return the union of two ... | |
0ca69bd8c29d123702e1934863d5d8a8c0d1703b | Create parse.py | parse.py | parse.py | Python | 0.00002 | @@ -0,0 +1,2213 @@
+# Parse the Essential Script%0Adef parse(source):%0A parsedScript = %5B%5B%5D%5D%0A word = ''%0A prevChar = ''%0A inArgs = False%0A inList = False%0A inString = False%0A inQuote = False%0A for char in source:%0A if char == '(' and not inString and not inQuote:%0A ... | |
c4b7bd5b74aaba210a05f946d59c98894b60b21f | Add test for pixel CLI | tests/cli/test_pixel.py | tests/cli/test_pixel.py | Python | 0 | @@ -0,0 +1,552 @@
+%22%22%22 Test %60%60yatsm line%60%60%0A%22%22%22%0Aimport os%0A%0Afrom click.testing import CliRunner%0Aimport pytest%0A%0Afrom yatsm.cli.main import cli%0A%0A%0A@pytest.mark.skipif(%22DISPLAY%22 not in os.environ, reason=%22requires display%22)%0Adef test_cli_pixel_pass_1(example_timeseries):%0A ... | |
26dd65a282ada1e79309c4ff35cee4e49b086b66 | Create part3.py | part3.py | part3.py | Python | 0.000002 | @@ -0,0 +1,1054 @@
+import pygame%0A%0Apygame.init()%0A%0Adisplay_width = 800%0Adisplay_height = 600%0A%0Ablack = (0,0,0)%0Awhite = (255,255,255)%0Ared = (255,0,0)%0A%0AgameDisplay = pygame.display.set_mode((display_width,display_height))%0Apygame.display.set_caption('A bit Racey')%0Aclock = pygame.time.Clock()%0A%0Aca... | |
98663d644b90e0e4c6188555501bcbc2b42d391a | Create part4.py | part4.py | part4.py | Python | 0.000001 | @@ -0,0 +1,1268 @@
+import pygame%0A%0Apygame.init()%0A%0Adisplay_width = 800%0Adisplay_height = 600%0A%0Ablack = (0,0,0)%0Awhite = (255,255,255)%0Ared = (255,0,0)%0A%0Acar_width = 73%0A%0AgameDisplay = pygame.display.set_mode((display_width,display_height))%0Apygame.display.set_caption('A bit Racey')%0Aclock = pygame.... | |
4727d86e5207dac3f53018b4ff2d1d0ade97d4e6 | Add http_json external pillar (#32741) | salt/pillar/http_json.py | salt/pillar/http_json.py | Python | 0 | @@ -0,0 +1,1157 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0AA module that adds data to the Pillar structure retrieved by an http request%0A%0A%0AConfiguring the HTTP_JSON ext_pillar%0A====================================%0A%0ASet the following Salt config to setup Foreman as external pillar source:%0A%0A.. code-block:: j... | |
d2e5c2d20cf7e07f2dc8288d303e8f4088d5877a | Update module! | Modules/Update.py | Modules/Update.py | Python | 0 | @@ -0,0 +1,992 @@
+from ModuleInterface import ModuleInterface%0Afrom IRCResponse import IRCResponse, ResponseType%0Aimport GlobalVars%0Aimport re%0Aimport subprocess%0A%0A%0Aclass Module(ModuleInterface):%0A triggers = %5B%22update%22%5D%0A help = %22update - pulls the latest code from GitHub%22%0A%0A def onT... | |
555cfbb827532c54598cecde01ef4e6e5e07714d | Create a test for re-evaluating external tasks while a workflow is running. | test/worker_external_task_test.py | test/worker_external_task_test.py | Python | 0 | @@ -0,0 +1,2065 @@
+# Copyright (c) 2015%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may not%0A# use this file except in compliance with the License. You may obtain a copy of%0A# the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable l... | |
7edcf7e1aa4824dc18584b88f21b2dc4ff9cab98 | Use the requests.session() helper to get a Session() object. | rightscale/httpclient.py | rightscale/httpclient.py | from functools import partial
import requests
DEFAULT_ROOT_RES_PATH = '/'
class HTTPResponse(object):
"""
Wrapper around :class:`requests.Response`.
Parses ``Content-Type`` header and makes it available as a list of fields
in the :attr:`content_type` member.
"""
def __init__(self, raw_respo... | Python | 0 | @@ -1088,17 +1088,17 @@
equests.
-S
+s
ession()
|
d10505678fd5624e5e88f72ac7852109f149b264 | Add new kcov package (#14574) | var/spack/repos/builtin/packages/kcov/package.py | var/spack/repos/builtin/packages/kcov/package.py | Python | 0 | @@ -0,0 +1,1184 @@
+# 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 Kcov(CMakePackage):%0A %22%22%22Code coverage tool for ... | |
a6e65ac7378b12cc6889199cac602a8fbee4b6e8 | add nagios check on autoplot metrics | nagios/check_autoplot.py | nagios/check_autoplot.py | Python | 0 | @@ -0,0 +1,656 @@
+%22%22%22Check autoplot stats%22%22%22%0Afrom __future__ import print_function%0Aimport sys%0A%0Aimport psycopg2%0A%0A%0Adef main():%0A %22%22%22Go Main Go%22%22%22%0A pgconn = psycopg2.connect(database='mesosite', host='iemdb',%0A user='nobody')%0A cursor = pgco... | |
81b713d69408f6b5712f67d7707bbb17f9588ef6 | Update __init__.py | tendrl/node_agent/manager/__init__.py | tendrl/node_agent/manager/__init__.py | import signal
import threading
from tendrl.commons.event import Event
from tendrl.commons import manager as commons_manager
from tendrl.commons.message import Message
from tendrl.commons import TendrlNS
from tendrl.node_agent.provisioner.gluster.manager import \
ProvisioningManager as GlusterProvisioningManager
f... | Python | 0.000072 | @@ -3504,16 +3504,41 @@
lass__()
+%0A NS.config.save()
%0A%0A si
|
b39eeea0b25e1e5bcec1d762a041e5ecf465885c | add solution for Reorder List | src/reorderList.py | src/reorderList.py | Python | 0 | @@ -0,0 +1,988 @@
+# 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 nothing%0A%0A def reorderList(self, head):%0A if head is None or head.next is... | |
68e056459dd3818ebb0c5dbdc8b4f1089bec9f07 | Add a few behavior tests for selection | tests/selection_test.py | tests/selection_test.py | Python | 0 | @@ -0,0 +1,1453 @@
+import os%0Aimport pytest%0Aimport yaml%0A%0Afrom photoshell.selection import Selection%0A%0A%0A@pytest.fixture%0Adef sidecar(tmpdir):%0A tmpdir.join(%22test.sidecar%22).write(yaml.dump(%7B%0A 'developed_path': os.path.join(tmpdir.strpath, %22test.jpeg%22),%0A 'datetime': '2014-10-1... | |
63a34000402f4253f16221b11d620e65e1786447 | add solution for Reverse Bits | src/reverseBits.py | src/reverseBits.py | Python | 0.000001 | @@ -0,0 +1,149 @@
+class Solution:%0A # @param n, an integer%0A # @return an integer%0A%0A def reverseBits(self, n):%0A return int(bin(n)%5B2:%5D.zfill(32)%5B::-1%5D, 2)%0A
| |
f81a612eabf5972d15a5b3f11d12897530cbf155 | Add dump-tree command (wip) | cvsgit/command/dump-tree.py | cvsgit/command/dump-tree.py | Python | 0.000003 | @@ -0,0 +1,875 @@
+%22%22%22Command to dump the full state of the source tree at a certain%0Apoint in time.%22%22%22%0A%0Aimport re%0Aimport subprocess%0Afrom subprocess import PIPE%0Aimport sys%0A%0Afrom cvsgit.cvs import split_cvs_source%0Afrom cvsgit.i18n import _%0Afrom cvsgit.main import Command, Conduit%0Afrom cv... | |
ff2c4b68a5eace4451eeef4fd6ca84d37435c556 | Add fields to privatemessage for network invitations. | project/editorial/migrations/0087_auto_20180226_1409.py | project/editorial/migrations/0087_auto_20180226_1409.py | Python | 0 | @@ -0,0 +1,756 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.9 on 2018-02-26 22:09%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('editorial', '008... | |
73084b964f964c05cb948be3acaa6ba68d62dc30 | test plotting particles | ws/CSUIBotClass2014/test/test_plot_particles.py | ws/CSUIBotClass2014/test/test_plot_particles.py | Python | 0 | @@ -0,0 +1,1997 @@
+#!/usr/bin/python%0A%0A# @author: vektor dewanto%0A# @obj: demonstrate how to plot particles in an occupancy grid map, _although_, for now, all positions are valid%0A%0Aimport matplotlib.pyplot as plt%0Aimport numpy as np%0Aimport math%0Aimport matplotlib.cm as cmx%0Afrom matplotlib import colors%0A... | |
68330d9b991b090c0ea0cd0da48a7d2a1fc04a29 | Update builds status | infra/gcb/builds_status.py | infra/gcb/builds_status.py | #!/usr/bin/env python2
import datetime
import os
import sys
import jinja2
import json
import tempfile
import dateutil.parser
from oauth2client.client import GoogleCredentials
from googleapiclient.discovery import build as gcb_build
from google.cloud import logging
from google.cloud import storage
from jinja2 import E... | Python | 0 | @@ -839,18 +839,8 @@
ures
-, unstable
):%0A
@@ -1065,19 +1065,8 @@
sses
- + unstable
,%0A
@@ -3856,32 +3856,83 @@
st_build%5B'id'%5D,%0A
+ 'finish_time': last_build%5B'finishTime'%5D,%0A
%7D)%0A els
@@ -4021,24 +4021,75 @@
uild%5B'id'%5D,%0A
+ 'finish_time': last_build%5B'finishTime... |
6342c6cab9b5dd0b34ca5de575ef82592474e1d5 | add mvnsite.py to build site without javadocs or test run | bin/mvnsite.py | bin/mvnsite.py | Python | 0 | @@ -0,0 +1,1004 @@
+#!/usr/bin/env python%0A%0A# Licensed to the Apache Software Foundation (ASF) under one or more%0A# contributor license agreements. See the NOTICE file distributed with%0A# this work for additional information regarding copyright ownership.%0A# The ASF licenses this file to You under the Apache Lic... | |
598d937f3f180e22a1b4793644ffdb1b9a26f261 | update crawler_main.py | crawler_main.py | crawler_main.py | """
crawler study code
Author: smilexie1113@gmail.com
"""
import urllib.request
import os
import re
from collections import deque
from filecmp import cmp
ERROR_RETURN = "ERROR:"
def retrun_is_error(return_str):
return return_str[0 : len(ERROR_RETURN)] == ERROR_RETURN
def python_cnt(str):
return s... | Python | 0.000001 | @@ -130,32 +130,8 @@
eque
-%0Afrom filecmp import cmp
%0A%0AER
@@ -150,16 +150,17 @@
%22ERROR:
+
%22%0Adef re
@@ -1425,32 +1425,40 @@
= %7Burl%7D%0A
+
%0A py_cnt_
@@ -1734,15 +1734,8 @@
') #
-links'
regu
|
e904341eb7b426ea583e345689249d7f13451dc9 | Add biome types. | biome_types.py | biome_types.py | Python | 0 | @@ -0,0 +1,524 @@
+biome_types = %7B%0A -1: %22Will be computed%22,%0A 0: %22Ocean%22,%0A 1: %22Plains%22,%0A 2: %22Desert%22,%0A 3: %22Extreme Hills%22,%0A 4: %22Forest%22,%0A 5: %22Taiga%22,%0A 6: %22Swampland%22,%0A 7: %22River%22,%0A 8: %22Hell%22,%0A 9: %22Sky%22,%0A 10: %22Froz... | |
0a0b322ca7d42d28ba495b7786cd2bd92c0bfd34 | Add test_register.py | tests/test_assembler/test_register.py | tests/test_assembler/test_register.py | Python | 0.000003 | @@ -0,0 +1,535 @@
+'Test of videocore.Register'%0A%0Afrom nose.tools import raises%0A%0Afrom videocore.assembler import Register, AssembleError, REGISTERS%0A%0Adef test_register_names():%0A for name in REGISTERS:%0A assert name == REGISTERS%5Bname%5D.name%0A assert name == str(REGISTERS%5Bname%5D)%0A%0... | |
12266ffcb7fcb809ec0e0a3102077581e64eb9e0 | Update migrations | server/adventures/migrations/0002_auto_20160909_1901.py | server/adventures/migrations/0002_auto_20160909_1901.py | Python | 0.000001 | @@ -0,0 +1,1324 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.10 on 2016-09-09 19:01%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('adventures', '000... | |
df9b7cd8d1b34f8c29c372589ad9efd3a5435d0f | Implement TwitchWordsCounterBot class. | twitchbot/twitch_words_counter_bot.py | twitchbot/twitch_words_counter_bot.py | Python | 0 | @@ -0,0 +1,1211 @@
+import irc.bot%0Aimport irc.strings%0A%0Afrom .words_counter import WordsCounter%0A%0A%0Aclass TwitchWordsCounterBot(irc.bot.SingleServerIRCBot):%0A def __init__(self, channel, nickname, password, server, port=6667):%0A irc.bot.SingleServerIRCBot.__init__(self, %5B(server, port, password)%... | |
6136eef341f1ac5ce0be278c3ab78192192d0efa | check if OS is UNIX-y | posix.py | posix.py | Python | 0.999519 | @@ -0,0 +1,155 @@
+#!/bin/py %0A%0Afrom sys import platform %0A%0Adef osCheck():%0A%09# Check if OS is UNIX-y %0A%09if %22darwin%22 or %22linux%22 in platform.lower(): %0A%09%09print platform%0A%0AosCheck()%0A
| |
2a0724922bde4cdd5219c721cdfd5460a2e5f3ed | Create Timely_Tweeter.py | Timely_Tweeter.py | Timely_Tweeter.py | Python | 0.000001 | @@ -0,0 +1,774 @@
+#-=- Coding: Python UTF-8 -=-%0A%0Aimport tweepy, time, sys %0A%0Aargfile = str(sys.argv%5B1%5D)%0A%0A#Twitter Account info%0A #Place Keys and Tokens bewteen the quotes%0ACONSUMER_KEY = '' #The Consumer Key (API Key)%0ACONSUMER_SECRET = '' #The Consumer Secret (API Secret)%0AACCESS_KEY = '' #The A... | |
9c0750ef401870e0187e3b7f0e4e39cf3d7e3944 | Make sure the profile data is unmarshallable as profile data. | test/test_benchmarks.py | test/test_benchmarks.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import pytest
import six
from asv import benchmarks
from asv import config
from asv import environment
BENCH... | Python | 0.000002 | @@ -203,16 +203,30 @@
ort os%0A%0A
+import pstats%0A
import p
@@ -1911,16 +1911,210 @@
alue'%5D%0A%0A
+ profile_path = os.path.join(tmpdir, 'test.profile')%0A with open(profile_path, 'wb') as fd:%0A fd.write(times%5B'time_secondary.track_value'%5D%5B'profile'%5D)%0A pstats.Stats(profile_path)%0A%0A
... |
d1ecc996269a801c65d3b88791f7f5546c8af1b8 | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,321 @@
+from setuptools import setup%0A%0Asetup(%0A name='daria',%0A version='0.0.1',%0A description='pytorch trainer',%0A author='odanado',%0A author_email='odan3240@gmail.com',%0A url='https://github.com/odanado/daria',%0A license='MIT License',%0A packages=%5B'daria'%5D,%0A test... | |
38bf3ce6db844999fe5903dad91e991c6fea57c7 | Add setup | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,686 @@
+#!/usr/bin/env python%0A%0Afrom setuptools import setup, find_packages%0A%0A%0Asetupconf = dict(%0A name = 'contract',%0A version = '0.3',%0A license = 'BSD',%0A url = 'https://github.com/Deepwalker/contract/',%0A author = 'Barbuza, Deepwalker',%0A author_email = 'krivushinme@gmail.... | |
ea7d55fa309d592669e86dae826b7cc08323de16 | update setup.py version to 0.2 | setup.py | setup.py | from distutils.core import setup
setup(name='mpmath',
description = 'Python library for arbitrary-precision floating-point arithmetic',
version='0.1',
url='http://mpmath.googlecode.com',
author='Fredrik Johansson',
author_email='fredrik.johansson@gmail.com',
license = 'BSD',... | Python | 0 | @@ -161,9 +161,9 @@
='0.
-1
+2
',%0D%0A
|
12ece36bf0355ad619635675b419d9d0e7163cf4 | Add setup.py file | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,341 @@
+#!/usr/bin/env python%0A%0Afrom setuptools import setup, find_packages%0A%0Asetup(%0A name='django-cache-relation',%0A description=%22Non-magical object caching for Django.%22,%0A version='0.1',%0A url='http://code.playfire.com/',%0A%0A author='Playfire.com',%0A author_email='tech@p... | |
30d3f42b4910b84b2a3419e43ea6e5e6da2ab7a0 | Add setup | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,362 @@
+from setuptools import setup%0A%0Asetup(name = 'enzynet',%0A description = 'EnzyNet: enzyme classification using 3D convolutional neural networks on spatial representation',%0A author = 'Afshine Amidi and Shervine Amidi',%0A author_email = '%3Cauthor1-lastname%3E@mit.edu, %3Cauthor2-fi... | |
45e624fe5176dd59b8f42636b777a1b6a6106dca | Add initial setuptools integration, required by click | setup.py | setup.py | Python | 0 | @@ -0,0 +1,209 @@
+# -*- coding: utf-8 -*-%0A# vi:si:et:sw=4:sts=4:ts=4%0A%0Afrom setuptools import setup%0A%0Asetup(%0A name='loafer',%0A version='0.0.1',%0A entry_points='''%0A %5Bconsole_scripts%5D%0A loafer=loafer.cli:cli%0A ''',%0A)%0A
| |
81e7e9ed4b3b0f6840e11adc5c73648471f606ef | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,907 @@
+# coding: utf-8%0A%0Afrom __future__ import print_function, unicode_literals%0A%0Aimport sys%0A%0Afrom setuptools import setup%0A%0Ainstall_requires = %5B%5D%0Aif sys.version_info%5B0%5D == 2:%0A install_requires.append('statistics')%0A%0Asetup(%0A name='scrapy-slotstats',%0A version='0.1',%... | |
21380bcf76a8144d182166c3441d308af2eda417 | Add first pass at setup.py | setup.py | setup.py | Python | 0 | @@ -0,0 +1,449 @@
+#!/usr/bin/python%0Aimport os%0Afrom distutils.core import setup, Extension%0A%0Aext_modules = %5B%5D%0A%0Apackages = %5B'bayesdb', 'bayesdb.tests'%5D%0Asetup(%0A name='BayesDB',%0A version='0.1',%0A author='MIT.PCP',%0A author_email = 'bayesdb@mit.edu',%0A url='pro... | |
374e27087d6d432ba01a0ef65c4109be84e50dcf | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1752 @@
+import os%0Aimport sys%0A%0Atry:%0A from setuptools import setup%0Aexcept ImportError:%0A from distutils.core import setup%0A%0Atry:%0A from distutils.command.build_py import build_py_2to3 as build_py%0Aexcept ImportError:%0A from distutils.command.build_py import build_py%0A%0Apath, scr... | |
cde4cf347080d927e9e7d3aad2146300ddf5ebbd | version 0.1.0 | setup.py | setup.py | Python | 0.000003 | @@ -0,0 +1,1693 @@
+# python setup.py register bdist_wheel upload -r https://www.python.org/pypi%0A%0Afrom setuptools import setup, find_packages%0A# To use a consistent encoding%0Afrom codecs import open%0Afrom os import path%0A%0Ahere = path.abspath(path.dirname(__file__))%0A%0A# Get the long description from the REA... | |
9c05031446d0d17bdc207b00ebf47d9769f96d33 | Add a setup.py for owebunit to be able to obtain ocookie via pip | setup.py | setup.py | Python | 0 | @@ -0,0 +1,278 @@
+#!/usr/bin/env python%0A%0Afrom distutils.core import setup%0A%0Asetup(name='ocookie',%0A version='0.1',%0A description='Comprehensive cookie library',%0A author='Oleg Pudeyev',%0A author_email='oleg@bsdpower.com',%0A url='http://github.com/p/ocookie',%0A packages=%5B'ocookie'%5D,%0... | |
431acaabf7a3e77b416a57998bfadcb2d3864555 | Add a setup.py | setup.py | setup.py | Python | 0 | @@ -0,0 +1,861 @@
+from setuptools import setup, find_packages%0Aimport codecs%0Aimport os%0Aimport re%0A%0Asetup(%0A name=%22httpbin%22,%0A version=%220.1.0%22,%0A description=%22HTTP Request and Response Service%22,%0A%0A # The project URL.%0A url='https://github.com/kennethreitz/httpbin',%0A%0A # A... | |
82b8651c9eed0c19224c8a7b53a0bedae81337a3 | Add a setup.py. | setup.py | setup.py | Python | 0 | @@ -0,0 +1,196 @@
+%0Afrom setuptools import setup, find_packages%0A%0Asetup(%0A%0A name = %22WebStar%22,%0A version = %220.1b%22,%0A %0A author=%22Mike Boers%22,%0A author_email=%22webstar@mikeboers.com%22,%0A license=%22BSD-3%22%0A)%0A
| |
d157b4e1f4709b0205d5de31df65a5308f926d49 | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,608 @@
+#!/usr/bin/env python%0A# coding: utf-8%0A%0Aimport re%0A%0Atry:%0A from setuptools import setup%0Aexcept ImportError:%0A from distutils.core import setup%0A%0A%0Aversion = %22%22%0A%0Awith open(%22autumn.py%22, %22r%22) as f:%0A version = re.search(r'%5E__version__%5Cs*=%5Cs*%5B%5C'%22%5D(%... | |
a2bfe07ba67e902870dd366626b23dbb5e6e2696 | Create messageMode.py | messageMode.py | messageMode.py | Python | 0.000001 | @@ -0,0 +1,1828 @@
+%0A#!/usr/bin/python%0A#coding=utf-8%0A#filename: messageMode.py%0A %0Aimport telnetlib%0Aimport os,sys,commands,multiprocessing%0Aimport smtplib%0Aimport time%0Afrom email.mime.multipart import MIMEMultipart%0Afrom email.mime.text import MIMEText%0Afrom email.mime.image import MIMEImage%0Aimport ur... | |
3d020f09332093807f70a1bca5360e1418633bb4 | Add setup.py. | setup.py | setup.py | Python | 0 | @@ -0,0 +1,100 @@
+from setuptools import setup, find_packages%0Asetup(name='Anytask',%0A packages=find_packages(),%0A)%0A
| |
b38eb4f8a7b8e3400ea09c600e241d8c4a9d0846 | Add setup so sgfs can install this to test with | setup.py | setup.py | Python | 0 | @@ -0,0 +1,635 @@
+from distutils.core import setup%0A%0Asetup(%0A name='sgsession',%0A version='0.1-dev',%0A description='Shotgun ORM/Session.',%0A url='http://github.com/westernx/sgsession',%0A %0A packages=%5B'sgsession'%5D,%0A %0A author='Mike Boers',%0A author_email='sgsession@mikeboers.... | |
5263a684d4bd111b903456a8da2c92ddb25e7811 | Add migration | seriesly/series/migrations/0002_auto_20180127_0718.py | seriesly/series/migrations/0002_auto_20180127_0718.py | Python | 0.000002 | @@ -0,0 +1,918 @@
+# Generated by Django 2.0 on 2018-01-27 13:18%0A%0Afrom django.db import migrations, models%0Aimport django.utils.timezone%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('series', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterFie... | |
874fbb6749d60ea3fcf078d25d7911d7ac314ab1 | Add a setup.py file for use with python install tools. | setup.py | setup.py | Python | 0 | @@ -0,0 +1,430 @@
+try:%0A from setuptools import setup%0Aexcept ImportError:%0A from distutils.core import setup%0A%0Aconfig = %7B%0A 'description': 'File validator',%0A 'author': 'Iestyn Pryce',%0A 'url': '',%0A 'download_url': '',%0A 'author_email': 'iestyn.pryce@gmail.com',%0A 'version': '0.... | |
952bbd2ba7b58856487ce96a3c8bdd4bd35b7d77 | version bump | setup.py | setup.py | from __future__ import unicode_literals, print_function
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname), 'rb') \
.read().decode('utf-8')
setup(
name='xunitmerge',
version='1.0.2',
author='Miroslav Shubernetskiy... | Python | 0.000001 | @@ -275,17 +275,17 @@
on='1.0.
-2
+3
',%0A a
|
3258a5ba8c748ce079082c34d13b231f157b1463 | Add experimental top-level copy of setup.py | setup.py | setup.py | Python | 0 | @@ -0,0 +1,2520 @@
+#!/usr/bin/env python%0A%0A# Original libphonenumber Java code:%0A# Copyright (C) 2009-2011 The Libphonenumber Authors%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the L... | |
58dd2d188aab1fbf30ff843307eecf5ca685527c | Add setup | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,716 @@
+from setuptools import find_packages, setup%0A%0Asetup(%0A name='ngx-task',%0A version='0.1',%0A description='Testimonial for candidates to show up their code-foo',%0A author='Dmitry Shulyak',%0A author_email='dmitri.shulyak@gmail.com',%0A url='https://github.com/shudmi/ngx-task',%0... | |
90746eba08c67c4f62462ed74d08566cafa18724 | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,765 @@
+#!/usr/bin/env python%0A%0Afrom setuptools import setup, find_packages%0A%0Asetup(%0A name='wrenet',%0A version='0.1',%0A description='Network configurations viewer in the Windows Registry',%0A author='graypawn',%0A author_email='choi.pawn' '@gmail.com',%0A url='https://github.com/g... | |
50742b6e629e6f54a9f3784a3c1495eb9d82c238 | Add start of processed package | brightway_projects/processing/processed_package.py | brightway_projects/processing/processed_package.py | Python | 0 | @@ -0,0 +1,3294 @@
+from ..errors import InconsistentFields, NonUnique%0A%0A%0Adef greedy_set_cover(data, exclude=None):%0A %22%22%22Find unique set of attributes that uniquely identifies each element in %60%60data%60%60.%0A%0A Feature selection is a well known problem, and is analogous to the %60set cover proble... | |
c68cda0549bb9c47be0580ecd43f55966e614b31 | Add Pascal's Triangle/nCr Table | mathematics/combinatorics/ncr_table/kevin.py | mathematics/combinatorics/ncr_table/kevin.py | Python | 0.000004 | @@ -0,0 +1,740 @@
+#!/usr/bin/env python%0A%0A# https://www.hackerrank.com/challenges/ncr-table%0A%0A%0Adef get_number():%0A return int(input().strip())%0A%0A%0Adef nCr(row_number):%0A rows = %5B%5B1%5D, %5B1, 1%5D, %5B1, 2, 1%5D%5D%0A while row_number %3E= len(rows):%0A # 1%0A # 1 1%0A # ... | |
7e04f5012c44fac086fc0f693dc653884d7377a3 | remove errant print | beaver/utils.py | beaver/utils.py | # -*- coding: utf-8 -*-
import argparse
import glob2
import itertools
import logging
import platform
import re
import sys
import beaver
logging.basicConfig()
MAGIC_BRACKETS = re.compile("({([^}]+)})")
IS_GZIPPED_FILE = re.compile(".gz$")
REOPEN_FILES = 'linux' not in platform.platform().lower()
cached_regices = {}
... | Python | 0.001167 | @@ -4323,24 +4323,8 @@
)))%0A
- print paths%0A
|
842869063ead9b2e6a1e22d11c9901072f2319aa | Add script to self generate docs for recurring data types | docs/generate_spec.py | docs/generate_spec.py | Python | 0 | @@ -0,0 +1,900 @@
+# -*- encoding: utf-8 -*-%0A#%0A# This script is to be used to automagically generate the recurring data types%0A# documentation based on the API specification.%0A#%0A# to run it just do:%0A#%0A# $ python generate_spec.py %3E outputfile.md%0A#%0A# :authors: Arturo Filast%C3%B2%0A# :licence: see LIC... | |
7d23ad49da0044d83f781105cb01addb1a4aa41c | Add catalog.wsgi file | catalog.wsgi | catalog.wsgi | Python | 0 | @@ -0,0 +1,157 @@
+#!/usr/bin/python%0Aimport sys%0Asys.path.insert(0,%22/var/www/html/catalog/%22)%0A%0Afrom catalog import app as application%0Aapplication.secret_key = 'super_secret_key'%0A
| |
dd5ae6788b4bb3630c16ce0996b206ae5e26228f | Extract env seq | scripts/extract_paths.py | scripts/extract_paths.py | import glob
import sys
import avidaspatial
num = sys.argv[1]
env = sys.argv[2]
filenames = glob.glob("*"+env+"*/lineage_locs_"+num+".dat")
env = avidaspatial.parse_environment_file("../config/env"+env+".cfg", (60, 60))
outfile = open("paths_"+num+"_"+env+".dat", "w")
outfile_env = open("env_seq_"+num+"_"+env+".dat"... | Python | 0.999944 | @@ -58,16 +58,19 @@
v%5B1%5D%0Aenv
+_id
= sys.a
@@ -106,16 +106,19 @@
(%22*%22+env
+_id
+%22*/line
@@ -202,16 +202,19 @@
env%22+env
+_id
+%22.cfg%22,
@@ -252,32 +252,35 @@
hs_%22+num+%22_%22+env
+_id
+%22.dat%22, %22w%22)%0Aou
@@ -318,16 +318,19 @@
+%22_%22+env
+_id
+%22.dat%22,
|
c16fae0519068e40d7b1ed988f49460198f6fd43 | Create decode_diameter.py | decode_diameter.py | decode_diameter.py | Python | 0.000327 | @@ -0,0 +1,2203 @@
+#-------------------------------------------------------------------------------%0A# Name: Decode Diameter%0A# Purpose:%0A#%0A# Author: XIAO Zhen%0A#%0A# Created: 08/10/2014%0A# Copyright: (c) XIAO Zhen 2014%0A# Licence: MIT License%0A#------------------------------------------... | |
8968251b7e1b89171b285e377d17dae299019cd0 | Test that '--checks' accepts notebooks either before or after the check command (#887) | tests/test_cli_check.py | tests/test_cli_check.py | Python | 0 | @@ -0,0 +1,1066 @@
+import pytest%0Afrom nbformat.v4.nbbase import new_code_cell, new_notebook%0A%0Afrom jupytext import write%0Afrom jupytext.cli import jupytext%0A%0Afrom .utils import requires_black%0A%0A%0A@pytest.fixture%0Adef non_black_notebook(python_notebook):%0A return new_notebook(metadata=python_notebook.... | |
4694f6bf2405d0aae5e6c3fc393f8a839e8aac07 | Add tests for converter.Line and converter.Generator. | tests/test_converter.py | tests/test_converter.py | Python | 0 | @@ -0,0 +1,2135 @@
+# coding: utf-8%0A# Copyright (c) 2010-2012 Rapha%C3%ABl Barrois%0A%0Aimport unittest%0A%0Afrom confmgr import converter%0A%0A%0Aclass LineTestCase(unittest.TestCase):%0A def test_repr(self):%0A self.assertEqual(%22Line('foo', 'bar')%22,%0A repr(converter.Line('foo', 'bar')))%0A... | |
a37640d107d1dd58ba4f9db3e043020ad76cd25d | Create cam_control.py | cam_control.py | cam_control.py | Python | 0.000001 | @@ -0,0 +1,1788 @@
+#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%0Afrom cv2 import *%0Aimport MySQLdb as ms%0Aimport time%0Aimport _mysql_exceptions as M%0Aimport os%0A%0Adef get_image():%0A cam1 = VideoCapture(0)%0A cam2 = VideoCapture(1)%0A s1, img1 = cam1.read()%0A s2, img2 = cam2.read()%0A if s1:%0... | |
d2a283856a9e2559a131c5aaa2407477be993af0 | add file to help gather all the data we need | collate.py | collate.py | Python | 0 | @@ -0,0 +1,792 @@
+import csv%0Afrom glob import glob%0A%0A%0Adef collate_from_breath_meta(cohort):%0A %22%22%22%0A Gets all breath_meta.csv files in our specific cohort and then gets all%0A the data from these files and stores them in a dictionary.%0A %22%22%22%0A if cohort not in %5B%22ardscohort%22, %... | |
d2667faded6dfdd1fb2992ec188b8fed12bb2723 | Add ncurses 5.9 | packages/ncurses.py | packages/ncurses.py | Python | 0.000015 | @@ -0,0 +1,972 @@
+class NcursesPackage (GnuPackage):%0A%09def __init__ (self):%0A%09%09GnuPackage.__init__ (self, 'ncurses', '5.9')%0A%09%09%0A%0A%09%09self.sources.extend (%5B%0A%09%09%09%09'https://trac.macports.org/export/136235/trunk/dports/devel/ncurses/files/hex.diff',%0A%09%09%09%09'https://trac.macports.org/ex... | |
00bfd02f921a42d4f288254d1accb7546d8df2c5 | Add hbase consistency check throw hbase hbck command, easily can be added some checks like backups servers or region servers | check_hbase.py | check_hbase.py | Python | 0 | @@ -0,0 +1,1832 @@
+#!/usr/bin/env python%0A# vim: ts=4:sw=4:et:sts=4:ai:tw=80%0Afrom utils import krb_wrapper,StringContext%0Aimport os%0Aimport argparse%0Aimport nagiosplugin%0Aimport re%0Aimport subprocess%0A%0Ahtml_auth = None%0A%0Adef parser():%0A version=%220.1%22%0A parser = argparse.ArgumentParser(descrip... | |
f865bf2d7365ccecec07be7e51e8d81676f3aae2 | Add check_cycles tests module | tests/plantcv/morphology/test_check_cycles.py | tests/plantcv/morphology/test_check_cycles.py | Python | 0 | @@ -0,0 +1,350 @@
+import cv2%0Afrom plantcv.plantcv import outputs%0Afrom plantcv.plantcv.morphology import check_cycles%0A%0A%0Adef test_check_cycles(morphology_test_data):%0A # Clear previous outputs%0A outputs.clear()%0A mask = cv2.imread(morphology_test_data.ps_mask, -1)%0A _ = check_cycles(mask)%0A ... | |
1ab296398aaa796a9a5b620c4281d9376ada8b3e | Add short script which prints the entire CMIP6 MIP experiment list #197. | ece2cmor3/scripts/mip-experiment-list.py | ece2cmor3/scripts/mip-experiment-list.py | Python | 0 | @@ -0,0 +1,739 @@
+#!/usr/bin/env python%0A# Thomas Reerink%0A#%0A# Run example:%0A# python mip-experiment-list.py%0A#%0A# Looping over all MIPs and within each MIP over all its MIP experiments.%0A# Printing the MIP experiment list with some additional info.%0A#%0A%0Afrom dreqPy import dreq%0Adq = dreq.loadDreq()%0A%0... | |
97eabd4e33086c66372b0e15dd1eeda12e99f427 | Create createfile.py | createfile.py | createfile.py | Python | 0.000004 | @@ -0,0 +1,497 @@
+import os%0A#creates file on the go on the entries of a tuple%0A%0Aports=%5B20,21,23,25,43,49,53,69,70,79,80,109,110,115,137,139,143,161,194,389,443,444,458,546,547,1080%5D%0A%0Apath=raw_input('Enter the path you want to create the files: ')%0A%0Atry:%0A os.chdir(path)%0Aexcept:%0A print %22Inval... | |
6d50dc3c266f4a1b7f517935b961cfb20602011b | add benchmark.py | suite/benchmark.py | suite/benchmark.py | Python | 0.000003 | @@ -0,0 +1,802 @@
+#!/usr/bin/python%0A%0A# Simple benchmark for Capstone by disassembling random code. By Nguyen Anh Quynh, 2014%0A%0Afrom capstone import *%0A%0Afrom time import time%0Afrom random import randint%0A%0A%0Adef random_str(size):%0A lst = %5Bstr(randint(0, 255)) for _ in xrange(size)%5D%0A return %2... | |
95c0d34be2699ee85d23a32384d408ac25561978 | Normalize to str to work around Unicode for now | base32_crockford.py | base32_crockford.py | """
base32-crockford
================
A Python module implementing the alternate base32 encoding as described
by Douglas Crockford at: http://www.crockford.com/wrmg/base32.html.
According to his description, the encoding is designed to:
* Be human and machine readable
* Be compact
* Be error resistant
* ... | Python | 0 | @@ -3640,16 +3640,20 @@
tring =
+str(
symbol_s
@@ -3657,16 +3657,17 @@
l_string
+)
.transla
|
78aea51f508a14bb1b03b49933576c84b56a7459 | Add an example for the new dropdowns | examples/views/dropdown.py | examples/views/dropdown.py | Python | 0.000003 | @@ -0,0 +1,2241 @@
+import typing%0A%0Aimport discord%0Afrom discord.ext import commands%0A%0A# Defines a custom Select containing colour options%0A# that the user can choose. The callback function%0A# of this class is called when the user changes their choice%0Aclass Dropdown(discord.ui.Select):%0A def __init__(sel... | |
bcb6c0780aacf77069a08f8d5b44d295881d9b9d | Create solution to swap odd even characters | swapOddEvenChar.py | swapOddEvenChar.py | Python | 0.000001 | @@ -0,0 +1,159 @@
+#Python3%0Aword = list(input().strip())%0A%0Afor i in range(0,len(word),2):%0A%09if(i+1%3E=len(word)):%0A%09%09break%0A%09word%5Bi%5D,word%5Bi+1%5D = word%5Bi+1%5D,word%5Bi%5D%0A%0Aprint(''.join(word))
| |
7bde47d48f4e80b4449049a8b05767b30eb2c516 | Add stupid CSV export example | utilities/export-csv.py | utilities/export-csv.py | Python | 0 | @@ -0,0 +1,2143 @@
+#!/usr/bin/python%0A%0Aimport os%0Aimport csv%0A%0Aimport sys%0Asys.path.append('../pynipap')%0Aimport pynipap%0A%0Aclass Export:%0A%09def __init__(self, xmlrpc_uri):%0A%09%09self.xmlrpc_uri = xmlrpc_uri%0A%0A%0A%09def write(self, output_file, schema_name):%0A%09%09%22%22%22%0A%09%09%22%22%22%0A%09%... | |
9b6eddb88f5de1b7c44d42e1d4a3dc1c90180862 | Implement deck. | onirim/deck.py | onirim/deck.py | Python | 0 | @@ -0,0 +1,877 @@
+import random%0A%0Aclass Deck:%0A%0A def __init__(self, cards):%0A self._undrawn = list(cards)%0A self._discarded = %5B%5D%0A self._limbo = %5B%5D%0A%0A def draw(self, n=1):%0A %22%22%22Draw n cards.%22%22%22%0A if n %3E len(self._undrawn) or n %3C 0:%0A ... | |
f5711401b79433f5b52e675cec67b63f6511836a | add tests file | tests.py | tests.py | Python | 0.000001 | @@ -0,0 +1,408 @@
+#!flask/bin/python%0Aimport unittest%0A%0Afrom server import app%0A%0Adef add(a, b):%0A return a+b%0A%0A%0Aclass TestCase(unittest.TestCase):%0A def setUp(self):%0A app.config%5B'TESTING'%5D = True%0A self.app = app.test_client()%0A%0A def tearDown(self):%0A pass%0A%0A ... | |
e9d87a087a0f0102157d7c718a048c72f655c54a | Store registered refs as plugin metadata | smore/ext/marshmallow.py | smore/ext/marshmallow.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from marshmallow.compat import iteritems
from marshmallow import class_registry
from smore import swagger
from smore.apispec.core import Path
from smore.apispec.utils import load_operations_from_docstring
def schema_definition_helper(name, schema, **kwar... | Python | 0 | @@ -293,16 +293,22 @@
_helper(
+spec,
name, sc
@@ -516,16 +516,201 @@
%22%22%22%0A
+ # Store registered refs, keyed by Schema class%0A plug = spec.plugins%5B'smore.ext.marshmallow'%5D%0A if 'refs' not in plug:%0A plug%5B'refs'%5D = %7B%7D%0A plug%5B'refs'%5D%5Bschema%5D = name%0A
retu
|
3654817845e1d22a5b0e648a79d0bf6db12c2704 | add run_sql shell command | treeherder/model/management/commands/run_sql.py | treeherder/model/management/commands/run_sql.py | Python | 0.000002 | @@ -0,0 +1,2638 @@
+import MySQLdb%0Afrom optparse import make_option%0A%0Afrom django.core.management.base import BaseCommand%0A%0Afrom treeherder.model.models import Datasource%0Afrom django.conf import settings%0A%0A%0Aclass Command(BaseCommand):%0A help = (%22Runs an arbitrary sql statement or file%22%0A ... | |
5b20a487afa90c0d91a43d4d29526d352511316f | add utils.py with utilities | utils.py | utils.py | Python | 0.000001 | @@ -0,0 +1,526 @@
+from csv import DictReader%0Aimport re%0A%0Adef read_csv(filename):%0A with open(filename) as csvfile:%0A return list(DictReader(csvfile, dialect='excel'))%0A%0Adef split_name(string):%0A surname, name = re.search(r'%5E(%5BA-Z%5C'%5C.%5Cs%5D+)%5Cs(.+)$', string).groups()%0A return nam... | |
89d8e6a8a422bade352d3bf94f2c59c1d0dc601b | Create dictionary.py | dictionary.py | dictionary.py | Python | 0.000096 | @@ -0,0 +1,312 @@
+x = %7B'job': 'teacher', 'color': 'blue'%7D // Create a dictionary, list with defination%0A%0Aprint(x%5B'job'%5D) // You will see 'teacher'%0A%0Ay = %7B'emotion': 'happy', 'reason': %7B'action': 'playing game', 'platform': 'PC'%7D%7D%0A%0Aprint(y%5B'reason'%5D%5B'action'%5... | |
b08341d2822ad266e07d4104a45604ad9d5b504a | add unit test for text_analyzer | src/text_analyzer.py | src/text_analyzer.py | Python | 0.000002 | @@ -0,0 +1,1242 @@
+import os%0Aimport unittest%0A%0Adef analyze_text(filename):%0A%0A lines = 0%0A chars = 0%0A with open(filename, 'r') as f:%0A for line in f:%0A lines += 1%0A chars += len(line)%0A return (lines, chars)%0A%0Aclass TextAnalysisTests(unittest.TestCase):%0A %22%2... | |
e1aa02badee2951f4f4aeeb09f37be030466e711 | Add pyupgrades.py | bin/pyupgrades.py | bin/pyupgrades.py | Python | 0.000003 | @@ -0,0 +1,1885 @@
+#!/usr/bin/env python%0A%0Aimport xmlrpclib%0Aimport pip%0Aimport argparse%0Aimport re%0Afrom pkg_resources import parse_version%0A%0Adef version_number_compare(version1, version2):%0A return cmp(parse_version(version1), parse_version(version2))%0A %0A def normalize(v):%0A return %5B... | |
7b09a44c7df8b2aa28e45c5382626c2f8c4bf61b | Add a script to convert from rst style files to markdown | bin/run_redpen.py | bin/run_redpen.py | Python | 0 | @@ -0,0 +1,1368 @@
+#!/usr/bin/python%0A%0Aimport os%0Aimport re%0Aimport shutil%0Afrom optparse import OptionParser%0A%0Adef main():%0A parser = OptionParser(usage=%22usage: %25prog %5Boptions%5D%22,%0A version=%22%25prog 1.0%22)%0A parser.add_option(%22-i%22, %22--inputdir%22,%0A ... | |
30c368f1794f7bbc4121f732143ac07e7148a3ca | Create KevinAndExpectation.py | Probability/KevinAndExpectation.py | Probability/KevinAndExpectation.py | Python | 0 | @@ -0,0 +1,1211 @@
+# Importing standard libraries%0Aimport sys%0Afrom math import sqrt%0A%0A# Parsing functions%0Adef parseInt(stream):%0A return int(stream.readline().rstrip())%0A%0A'''%0A %0A Dynamically precomputing the summation series for N %3C 10%5E6 so that each test case%0A is solved in constnat ti... | |
53b0d93a7a29121e9d24058bfe4b7ee3bd33f7ca | Add info for version 2.16 (#3601) | var/spack/repos/builtin/packages/ack/package.py | var/spack/repos/builtin/packages/ack/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | Python | 0 | @@ -1625,16 +1625,86 @@
-file%22%0A%0A
+ version('2.16', '7085b5a5c76fda43ff049410870c8535', expand=False)%0A
vers
|
3b30e8a66ca5a3c68055696c339a44fffc98afb3 | compute jaccard with numpy boradcasting | exercise/broadcast.py | exercise/broadcast.py | Python | 0.999999 | @@ -0,0 +1,1512 @@
+import numpy as np%0A%0A# a = np.array(%5B1.0, 2.0, 3.0%5D)%0A# b = 2.0%0A%0A# print(a * b)%0A%0A# x = np.arange(4)%0A# xx = x.reshape(4,1)%0A# %0A# y = np.ones(5)%0A%0A# x = np.array(%5B1,2%5D).reshape((2,1))%0A# y =np.arange(4).reshape((1,4))%0A# %0A# print(x-y)%0A%0A# from numpy import array, arg... | |
d0d182605389ec73773df35b9e06455b9f9a2923 | add get_posts | facebook/get_posts.py | facebook/get_posts.py | Python | 0.000005 | @@ -0,0 +1,1608 @@
+%22%22%22%0AA simple example script to get all posts on a user's timeline.%0AOriginally created by Mitchell Stewart.%0A%3Chttps://gist.github.com/mylsb/10294040%3E%0A%22%22%22%0Aimport facebook%0Aimport requests%0A%0A%0Adef some_action(post):%0A %22%22%22 Here you might want to do something with ... | |
419ca7099bf47ed00ede73d9de14690a643a3943 | Add data for integration testing of basic csv and crosstab formats | test/test_integration.py | test/test_integration.py | Python | 0 | @@ -0,0 +1,745 @@
+%22%22%22Integrations tests for EcoData Retriever%22%22%22%0A%0Aimport os%0Aimport shutil%0Afrom retriever import HOME_DIR%0A%0Asimple_csv = %7B'name': 'simple_csv',%0A 'raw_data': %22a,b,c%5Cn1,2,3%5Cn4,5,6%22,%0A 'script': %22shortname: simple_csv%5Cntable: simple_csv, htt... | |
465fbc1657e90134323fd05ee4216da5af110ee4 | add tools | pycrawler/utils/tools.py | pycrawler/utils/tools.py | Python | 0.000001 | @@ -0,0 +1,368 @@
+__author__ = 'mengpeng'%0Aimport time%0A%0A%0Adef gethash(string, cap=0xffffffff):%0A return hash(string) & cap%0A%0A%0Adef timestamp():%0A return time.strftime(%22%25H:%25M:%25S%22, time.localtime(time.time()))%0A%0A%0Adef datastamp():%0A return time.strftime(%22%25Y-%25m-%25d%22, time.loca... | |
d8fc66417860e634bbb2a6d860628b645811d62c | Add WIP for Python example | examples/python/curieimu.py | examples/python/curieimu.py | Python | 0 | @@ -0,0 +1,1816 @@
+#!/usr/bin/python%0A%0A# Author: Ron Evans (@deadprogram)%0A# Copyright (c) 2016 Intel Corporation.%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining%0A# a copy of this software and associated documentation files (the%0A# %22Software%22), to deal in the Software without r... | |
2f7aa680b79b60d707d7b09818e3ec55748448b2 | fix anonymous token extraction(closes #23650) | youtube_dl/extractor/discovery.py | youtube_dl/extractor/discovery.py | from __future__ import unicode_literals
import random
import re
import string
from .discoverygo import DiscoveryGoBaseIE
from ..compat import compat_urllib_parse_unquote
from ..utils import ExtractorError
from ..compat import compat_HTTPError
class DiscoveryIE(DiscoveryGoBaseIE):
_VALID_URL = r'''(?x)https?://
... | Python | 0 | @@ -347,25 +347,12 @@
-(?:(?:www%7C
go
-)
%5C.
-)?
disc
@@ -374,18 +374,13 @@
-(?:
www%5C.
-)?
%0A
@@ -639,38 +639,8 @@
tlc
-%7C%0A velocity
%0A
@@ -3175,93 +3175,27 @@
s://
-fusion.ddmcdn.com/app/mercury-sdk/180/redirectHandler.html?https://www.%25s.com' %25 site
+www.disc... |
b78fb81cba34992bb84ed3814aae04ce05ef913f | Add del-uri.py example script | examples/scripts/del-uri.py | examples/scripts/del-uri.py | Python | 0.000001 | @@ -0,0 +1,3460 @@
+#!/usr/bin/env python3%0A###%0A# (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A# of this software and associated documentation files (the %22Software%22), to deal%0A# in the Software without ... | |
5cf3ff125226ddbf2edfad9d3c0d6ea2d59618ce | add missing file | pygraphviz/tests/test.py | pygraphviz/tests/test.py | Python | 0.000003 | @@ -0,0 +1,1105 @@
+#!/usr/bin/env python%0Aimport sys%0Afrom os import path,getcwd%0A%0Adef run(verbosity=1,doctest=False,numpy=True):%0A %22%22%22Run PyGraphviz tests.%0A%0A Parameters%0A ----------%0A verbosity: integer, optional%0A Level of detail in test reports. Higher numbers provide more deta... | |
2af53a39096c0eab9d95c304c802281fe3c580ae | Make JAX CompiledFunction objects pickle-able. | tests/pickle_test.py | tests/pickle_test.py | Python | 0.000032 | @@ -0,0 +1,1496 @@
+# Copyright 2021 Google LLC%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# https://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by ... | |
c4ee6bb374e07a07bac8b8f52cf94d7d474e0e33 | Fix typo in test comment | tests/test_config.py | tests/test_config.py | import os
from pathlib import Path
from rhizo.config import load_config
def check_config(config):
assert config.output_path == '/foo/bar'
assert config.sub_config.a == 'test'
assert config.sub_config.b == 2
assert round(config.sub_config.c - 3.14, 4) == 0
def _load_test_config(filename, use_environ... | Python | 0.000092 | @@ -827,17 +827,17 @@
vironmen
-e
+t
%0A ass
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.