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 |
|---|---|---|---|---|---|---|---|
8c82465a08f5a601e6a43a8eb675136fc3678954 | Create lc960.py | LeetCode/lc960.py | LeetCode/lc960.py | Python | 0.000001 | @@ -0,0 +1,815 @@
+def createArray(dims) :%0A%09if len(dims) == 1:%0A%09%09return %5B0 for _ in range(dims%5B0%5D)%5D%0A%09return %5BcreateArray(dims%5B1:%5D) for _ in range(dims%5B0%5D)%5D%0A%09%0A%0Adef f(A, x, y):%0A m = len(A)%0A for i in range(m):%0A if A%5Bi%5D%5Bx%5D %3E A%5Bi%5D%5By%5D:%0A ... | |
3ebae0f57ae3396213eb28b6fc7a23ff3e3c4980 | Create file and add pseudocode | uml-to-cpp.py | uml-to-cpp.py | Python | 0.000001 | @@ -0,0 +1,1995 @@
+# Copyright (C) 2017 Bran Seals. All rights reserved.%0A# Created: 2017-06-05%0A%0Aprint(%22== UML to CPP ==%22)%0Aprint(%22Create or modify C++ header and implementation files by plaintext UML.%22)%0A#print(%22Enter a UML filename: %22) # file import currently disabled%0A# check if file isn't too b... | |
b5f3a984b068d0bf09f63380b365436114e54591 | Switch to a cleaner method of getting version number from server. | flexget/options.py | flexget/options.py | from __future__ import unicode_literals, division, absolute_import
import sys
import subprocess
import re
from argparse import ArgumentParser as ArgParser, Action, ArgumentError, SUPPRESS, _VersionAction
import flexget
from flexget.utils.tools import console
from flexget.utils import requests
def required_length(nmi... | Python | 0 | @@ -93,18 +93,8 @@
ess%0A
-import re%0A
from
@@ -1618,32 +1618,46 @@
load.flexget.com
+/latestversion
')%0A excep
@@ -1805,49 +1805,8 @@
er =
- re.search(r'FlexGet-(%5B%5Cd%5C.%5D*)%5C.tar%5C.gz',
pag
@@ -1815,17 +1815,15 @@
text
-).grou
+.stri
p(
-1
)%0A
|
e2ed635fb3289a5b45f5f15cd1eb543d87fb93d7 | Add test for posting a review through the view | wafer/talks/tests/test_review_views.py | wafer/talks/tests/test_review_views.py | Python | 0 | @@ -0,0 +1,1919 @@
+%22%22%22Tests for wafer.talk review form behaviour.%22%22%22%0A%0Afrom django.test import Client, TestCase%0Afrom django.urls import reverse%0A%0Afrom reversion import revisions%0Afrom reversion.models import Version%0A%0Afrom wafer.talks.models import (SUBMITTED, UNDER_CONSIDERATION,%0A ... | |
466410249867b3eadbe5e2b59c46c95ecd288c6c | Add script for word counts | python_scripts/solr_query_fetch_all.py | python_scripts/solr_query_fetch_all.py | Python | 0.000001 | @@ -0,0 +1,935 @@
+#!/usr/bin/python%0A%0Aimport requests%0Aimport ipdb%0Aimport time%0Aimport csv%0Aimport sys%0Aimport pysolr%0A%0Adef fetch_all( solr, query ) :%0A documents = %5B%5D%0A num_matching_documents = solr.search( query ).hits%0A%0A start = 0%0A rows = num_matching_documents%0A%0A sys.stderr... | |
3f69fae4f15efff515b82f216de36dd6d57807e9 | add ci_test.py file for ci | settings/ci_test.py | settings/ci_test.py | Python | 0.000001 | @@ -0,0 +1,182 @@
+__author__ = 'quxl'%0Afrom base import *%0A%0ADATABASES = %7B%0A 'default': %7B%0A 'ENGINE': 'django.db.backends.sqlite3',%0A 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),%0A %7D%0A%7D%0A%0A
| |
50f0e040f363e52a390efc6acd1bc0bc0ddcabcc | Add test funcs in report_reader for DB reading | report_reader.py | report_reader.py | Python | 0.000001 | @@ -0,0 +1,466 @@
+import pymongo as pm%0A%0Adef connectDB():%0A%09conn = pm.MongoClient('localhost', 27017)%0A%09db = conn.get_database('report_db')%0A%09return db%0A%0Adef getColList(db):%0A%09return db.collection_names()%0A%0Adef getDocNum(col):%0A%09return col.find().count()%0A%0Adef match(col, matchDict):%0A%09ret... | |
1c9d398be7f99f15fb550adca31f3366870930e3 | Set debug to false in prod, otherwise true | wazimap_np/settings.py | wazimap_np/settings.py | # pull in the default wazimap settings
from wazimap.settings import * # noqa
# install this app before Wazimap
INSTALLED_APPS = ['wazimap_np'] + INSTALLED_APPS
DATABASE_URL = os.environ.get('DATABASE_URL', 'postgresql://wazimap_np:wazimap_np@localhost/wazimap_np')
DATABASES['default'] = dj_database_url.parse(DATABA... | Python | 0.004374 | @@ -72,16 +72,89 @@
# noqa%0A%0A
+DEBUG = False if (os.environ.get('APP_ENV', 'dev') == 'prod') else True%0A%0A
# instal
@@ -229,17 +229,16 @@
D_APPS%0A%0A
-%0A
DATABASE
|
22578771d9812a21361ec959d16e3eaacba998e3 | Add APData Info collector | APData/APInfo.py | APData/APInfo.py | Python | 0 | @@ -0,0 +1,830 @@
+#%0A#%0A#%0A#%0A%0Aclass APInfo:%0A%09%22%22%22...%22%22%22%0A%09%0A%09# Protected members%0A%09__IPAddress = %22%22%0A%09__MACAddress = %22%22%0A%09__Channel = 0%0A%09__Region = 0%0A%09__Localization = %22%22%0A%09__TxPowerList = %5B%5D%0A%09__CurrentPowerIndex = -1%0A%09__UnderloadLimit = -1%0A%09_... | |
bd1e135a6ffd9186451ec02fcbcaab7f9066e40f | Add breakpad fetch recipe. | recipes/breakpad.py | recipes/breakpad.py | Python | 0.001108 | @@ -0,0 +1,1091 @@
+# Copyright (c) 2015 The Chromium Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0Aimport sys%0A%0Aimport recipe_util # pylint: disable=F0401%0A%0A%0A# This class doesn't need an __init__ method, so we disab... | |
4996ddddc14ad0d20759abbcf4d54e6132b7b028 | Add the dj_redis_url file | dj_redis_url.py | dj_redis_url.py | Python | 0.000001 | @@ -0,0 +1,951 @@
+# -*- coding: utf-8 -*-%0A%0Aimport os%0A%0Atry:%0A import urlparse%0Aexcept ImportError:%0A import urllib.parse as urlparse%0A%0A%0A# Register database schemes in URLs.%0Aurlparse.uses_netloc.append(%22redis%22)%0A%0ADEFAULT_ENV = %22REDIS_URL%22%0A%0A%0Adef config(env=DEFAULT_ENV, default=Non... | |
1487722c0431fce19d54b1b020c3af0ab411cc8a | Add sample config.py file | rename_to_config.py | rename_to_config.py | Python | 0.000001 | @@ -0,0 +1,126 @@
+account_sid = %22ACXXXXXXXXXXXXXXXXX%22%0Aauth_token = %22XXXXXXXXXXXXXXXX%22%0Afrom_number = %22+441111222333%22%0Ato_number = %22+447777222333%22%0A
| |
74dcd072efabe20137e32fcfa0560a41a532a2ba | reverse Integer | python/math/reverseInteger.py | python/math/reverseInteger.py | Python | 0.99998 | @@ -0,0 +1,1060 @@
+class Solution:%0A # @return an integer%0A def reverse(self, x):%0A INT_MAX = 2147483647%0A INT_MIN = -2147483648%0A result = 0%0A negative = 1%0A %0A if x %3C 0:%0A negative = -1%0A x = 0 - x %0A %0A temp = x / ... | |
0cc3aafced65d2f128a8036aad62edb5ee19f566 | Add brume main script | scripts/brume.py | scripts/brume.py | Python | 0 | @@ -0,0 +1,2689 @@
+#!/usr/bin/env python%0A%0Aimport os%0Aimport click%0Aimport yaml%0A%0Afrom glob import glob%0Afrom subprocess import check_output%0Afrom brume.template import CfnTemplate%0Afrom brume.stack import Stack%0A%0A%0Adef load_configuration(config_file='brume.yml'):%0A %22%22%22Return the YAML configur... | |
bf02019c8b97d8dc35e3e186b31cb57adac6a8ec | Create a measurement | shrugd-create.py | shrugd-create.py | Python | 0.998877 | @@ -0,0 +1,1373 @@
+import ripe.atlas.cousteau%0Afrom atlaskeys import create_key%0A%0A# DNS query properties%0Aquery_argument = %22wide.ad.jp%22%0Aquery_type = %22AAAA%22%0Adnssec_ok = True%0Aset_nsid_bit = True%0A%0A# IP addresses to start from%0Adns_server_ips = %5B %0A %22199.7.91.13%22, %222001:500:2d::d%22, # ... | |
69d358fa08652e44dc37974bb735cfdc40ccf1db | increase UPDATE_INTERVAL (#18429) | homeassistant/components/edp_redy.py | homeassistant/components/edp_redy.py | """
Support for EDP re:dy.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/edp_redy/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD,
... | Python | 0 | @@ -826,9 +826,9 @@
L =
-3
+6
0%0A%0AR
|
bbdc1961271acf0dd0ad8818d41b84eea4a5aec4 | Use entity_id attribute | homeassistant/components/influxdb.py | homeassistant/components/influxdb.py | """
homeassistant.components.influxdb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InfluxDB component which allows you to send data to an Influx database.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/influxdb/
"""
import logging
import homeassistant.util as util... | Python | 0.000002 | @@ -3035,53 +3035,23 @@
t =
-'%7B%7D.%7B%7D'.format(state.domain, state.object
+state.entity
_id
-)
%0A%0A
|
323176a9749d37d05e87339fe34b50b90cc6b663 | add solution for Maximum Product Subarray | src/maximumProductSubarray.py | src/maximumProductSubarray.py | Python | 0 | @@ -0,0 +1,509 @@
+class Solution:%0A # @param A, a list of integers%0A # @return an integer%0A%0A def maxProduct(self, A):%0A if not A:%0A return 0%0A if len(A) == 1:%0A return A%5B0%5D%0A%0A maxV, minV = A%5B0%5D, A%5B0%5D%0A res = maxV%0A for val in A... | |
abd23cbc80149d4f2985eb8aef5d893714cca717 | add a script to reset the db | scripts/reset_db.py | scripts/reset_db.py | Python | 0 | @@ -0,0 +1,115 @@
+from scraper import clean%0A%0Adef run():%0A if raw_input(%22Are you sure? Then write 'yes'%22) == %22yes%22:%0A clean()%0A
| |
43e5727d4091e0b6cb11e0e13ea9f7daf69628fc | Add corpusPreProcess. | corpusPreProcess.py | corpusPreProcess.py | Python | 0 | @@ -0,0 +1,266 @@
+#! /usr/share/env python%0A# -*- coding=utf-8 -*-%0A%0AresultFile = open('corpus/BigCorpusPre.txt', 'w')%0Awith open('corpus/BigCorpus.txt', 'r') as f:%0A for line in f:%0A line = line%5Bline.find(':')+1:%5D%0A resultFile.write(line.strip()+'%5Cn')%0AresultFile.close()%0A%0A
| |
82089ad5e5c0d597cfdd16575b4fa5a9a09415ff | introduce plumbery from the command line -- no python coding, yeah! | plumbery/__main__.py | plumbery/__main__.py | Python | 0 | @@ -0,0 +1,2652 @@
+# 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 License, Version 2.0%0A# (the ... | |
7182af317116db7eb3f7a278b3487ad91a3b3331 | Add example for a clunky 3D high resolution loupe for napari | high-res-slider.py | high-res-slider.py | Python | 0.000001 | @@ -0,0 +1,2236 @@
+import functools%0Aimport numpy as np%0Aimport dask.array as da%0Afrom magicgui.widgets import Slider, Container%0Aimport napari%0A%0A# stack = ... # your dask array%0A# stack2 = stack%5B::2, ::2, ::2%5D%0A# stack4 = stack2%5B::2, ::2, ::2%5D%0A# %F0%9F%91%86 quick and easy multiscale pyramid, don'... | |
a9cdf3c5a1911586530fb825a7a55d2ef7c88a41 | remove old import statement | pelican/contents.py | pelican/contents.py | # -*- coding: utf-8 -*-
import copy
import locale
import logging
import functools
from datetime import datetime
from os import getenv
from sys import platform, stdin
from pelican.settings import _DEFAULT_CONFIG
from pelican.utils import slugify, truncate_html_words
from pelican import signals
logger = logging.getLo... | Python | 0.999254 | @@ -110,30 +110,8 @@
ime%0A
-from os import getenv%0A
from
@@ -307,16 +307,17 @@
ame__)%0A%0A
+%0A
class Pa
|
2cadad76c2756852b94948088e92b9191abebbb7 | make one pickle file with all metadata (for faster loading) | generate_metadata_pkl.py | generate_metadata_pkl.py | Python | 0 | @@ -0,0 +1,2951 @@
+import argparse%0Afrom dicom.sequence import Sequence%0Aimport glob%0Aimport re%0Afrom log import print_to_file%0Aimport cPickle as pickle%0A%0A%0Adef read_slice(path):%0A return pickle.load(open(path))%5B'data'%5D%0A%0A%0Adef convert_to_number(value):%0A value = str(value)%0A try:%0A ... | |
8939e873f4ea61169f9384eded5b8c603cfde988 | Add crypto pre-submit that will add the openssl builder to the default try-bot list. | crypto/PRESUBMIT.py | crypto/PRESUBMIT.py | Python | 0.000006 | @@ -0,0 +1,478 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0A%22%22%22Chromium presubmit script for src/net.%0A%0ASee http://dev.chromium.org/developers/how-tos/depottools/presubmit-scrip... | |
27ed31c7a21c4468bc86aaf220e30315e366c425 | add message to SearxParameterException - fixes #1722 | searx/exceptions.py | searx/exceptions.py | '''
searx is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
searx is distributed in the hope that it will be useful,
but WITHOUT ANY WA... | Python | 0 | @@ -1041,16 +1041,47 @@
essage)%0A
+ self.message = message%0A
|
a230bb1b2f1c96c7f9764ee2bf759ea9fe39e801 | add populations tests | isochrones/tests/test_populations.py | isochrones/tests/test_populations.py | Python | 0 | @@ -0,0 +1,1770 @@
+import unittest%0A%0Afrom pandas.testing import assert_frame_equal%0Afrom scipy.stats import uniform, norm%0Afrom isochrones import get_ichrone%0Afrom isochrones.priors import ChabrierPrior, FehPrior, GaussianPrior, SalpeterPrior, DistancePrior, AVPrior%0Afrom isochrones.populations import StarForma... | |
6ebed7a2a6488a857fc6878c2d39d26ce9bc72f5 | Add release 9.1.0 recognition to the Dyninst API package file. | var/spack/repos/builtin/packages/dyninst/package.py | var/spack/repos/builtin/packages/dyninst/package.py | ##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
... | Python | 0 | @@ -1597,16 +1597,149 @@
t-8.x%22%0A%0A
+ version('9.1.0', '5c64b77521457199db44bec82e4988ac',%0A url=%22http://www.paradyn.org/release9.1.0/DyninstAPI-9.1.0.tgz%22)%0A
vers
|
f982cd78ae79f77c2ca59440de20de37002d6658 | Add a pcakge: libzip. (#3656) | var/spack/repos/builtin/packages/libzip/package.py | var/spack/repos/builtin/packages/libzip/package.py | Python | 0.001174 | @@ -0,0 +1,1531 @@
+##############################################################################%0A# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.%0A# Produced at the Lawrence Livermore National Laboratory.%0A#%0A# This file is part of Spack.%0A# Created by Todd Gamblin, tgamblin@llnl.gov, All r... | |
9877c21c502b27460f70e6687ed3fd6a2d3fd0d5 | add new package at v8.3.0 (#27446) | var/spack/repos/builtin/packages/racket/package.py | var/spack/repos/builtin/packages/racket/package.py | Python | 0 | @@ -0,0 +1,1030 @@
+# 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 Racket(Package):%0A %22%22%22The Racket programming lan... | |
27b1695a09694e86ce985e8dc2ff9fd1802204bd | Remove the print statement | addons/stock_location/mrp_pull.py | addons/stock_location/mrp_pull.py | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publ... | Python | 0.004301 | @@ -1360,78 +1360,8 @@
-print line.location_src_id.name, line.location_id.name, line.type_proc
%0A
|
bd49a4c82e011d7c5025abc15324220b1496f8c8 | add deepspeech.py to support DeepSpeech | deepspeech.py | deepspeech.py | Python | 0.000001 | @@ -0,0 +1,1008 @@
+import subprocess%0A%0Aclass DeepSpeechRecognizer():%0A def __init__(self, model=None, alphabet=None, lm=None, trie=None):%0A self.model = model%0A self.alphabet = alphabet%0A self.lm = lm%0A self.trie = trie%0A%0A def recognize(self, audio_file):%0A %22%22%2... | |
ca09dc0b9d555f10aafb17380a9a8592727d0a0f | Add dp/SPOJ-ROCK.py | dp/SPOJ-ROCK.py | dp/SPOJ-ROCK.py | Python | 0.000001 | @@ -0,0 +1,772 @@
+def compute_zero_counts(rock_desc):%0A zero_counts = %5B0 for i in xrange(N+1)%5D%0A for i in xrange(1, N+1):%0A zero_counts%5Bi%5D = zero_counts%5Bi-1%5D%0A if rock_desc%5Bi-1%5D == '0':%0A zero_counts%5Bi%5D += 1%0A%0A return zero_counts%0A%0Adef score(zero_counts,... | |
50d05aabc2eb1d5bcb20d457dd05d2882b983afa | Add installation script for profiler. | install_and_run.py | install_and_run.py | Python | 0 | @@ -0,0 +1,2006 @@
+# Copyright 2020 The TensorFlow Authors. All Rights Reserved.%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# http://www.apache.org/licenses/LICENS... | |
734967196c8f0577b218802c16d9eab31c9e9054 | Add problem 36, palindrome binaries | problem_36.py | problem_36.py | Python | 0.999978 | @@ -0,0 +1,460 @@
+from time import time%0A%0A%0Adef is_palindrome(s):%0A for idx in range(len(s)/2):%0A if s%5Bidx%5D != s%5B-1*idx - 1%5D:%0A return False%0A return True%0A%0A%0Adef main():%0A palindrom_nums = %5Bnum for num in range(int(1e6)) if is_palindrome(str(num)) and is_palindrome(st... | |
ad9a9df8e144c41456aeded591081a3a339853f3 | Create RLU_forward_backward.py | Neural-Networks/RLU_forward_backward.py | Neural-Networks/RLU_forward_backward.py | Python | 0.000019 | @@ -0,0 +1,575 @@
+%0Afrom numpy import *%0Afrom RLU_neural_forward import *%0Afrom RLU_back_propagation import *%0A%0Adef forwardBackward(xi, x, y, MT, time_queue, good_queue, DELTA_queue):%0A%09A = neural_forward(xi, x, MT)%0A%09check = argmax(A%5B-xi%5B-1%5D:%5D)%0A%09# send back some progress statistic%0A %09if y%5... | |
1ecb4a0711304af13f41ae1aae67792057783334 | Create ScaperUtils.py | data/ScaperUtils.py | data/ScaperUtils.py | Python | 0 | @@ -0,0 +1,2581 @@
+class ScraperUtil (object) :%0A class Base :%0A def __init__(self,data_get,data_parse, data_formatter=None) :%0A self.get_data = data_get%0A self.parse_data = data_parse%0A self.data_formatter = data_formatter%0A%0A class Yahoo(Base) :%0A def __init__(self,data... | |
6d33ed73adeea4808ed4b3b9bd8642ad83910dfc | add ridgeline example (#1519) | altair/examples/ridgeline_plot.py | altair/examples/ridgeline_plot.py | Python | 0 | @@ -0,0 +1,1636 @@
+%22%22%22%0ARidgeline plot (Joyplot) Example%0A--------------------------------%0AA %60Ridgeline plot %3Chttps://serialmentor.com/blog/2017/9/15/goodbye-joyplots%3E%60_%0Achart is a chart that lets you visualize distribution of a numeric value for %0Aseveral groups.%0A%0ASuch a chart can be created ... | |
dfe65e6839a4347c7acfc011f052db6ec4ee1d9d | test Task | tests/unit/test_task.py | tests/unit/test_task.py | Python | 0.999998 | @@ -0,0 +1,1563 @@
+import sys%0Afrom zorn import tasks%0Afrom io import StringIO%0A%0Adef test_task():%0A task = tasks.Task()%0A assert task.verbosity == 1%0A%0Adef test_parse_verbosity_standard():%0A silent = False%0A verbose = False%0A verbosity = tasks.Task.parse_verbosity(verbose, silent)%0A asse... | |
02156d3e9140b7f8f61b79816891ede2fff2cc49 | rename models to properties | properties.py | properties.py | Python | 0.000005 | @@ -0,0 +1,207 @@
+import ConfigParser%0Aimport os%0Aimport sys%0A%0Asubreddit = 'taigeilove'%0Auser_agent = 'Python:whalehelpbot:v1.0 (by /u/Noperative)'%0A%0Ageneral_words = %5B%5D%0Afirst_time_words = %5B%5D%0Aexpedition_words = %5B%5D%0Aquest_words = %5B%5D%0A
| |
e74c3273f840afbca25936083abdfb6577b4fdd0 | Devuelve lista de etiquetas y atributos | smallsmilhandler.py | smallsmilhandler.py | Python | 0 | @@ -0,0 +1,1226 @@
+#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A#CELIA GARCIA FERNANDEz%0A%0Afrom xml.sax import make_parser%0Afrom xml.sax.handler import ContentHandler%0A%0Aclass SmallSMILHandler(ContentHandler):%0A%0A def __init__ (self):%0A %0A self.lista = %5B%5D%0A self.etiquetas = %5B'r... | |
024e7fe473a19a16b7e34203aef2841af7a3aad4 | add markreads script | etc/markreads.py | etc/markreads.py | Python | 0 | @@ -0,0 +1,459 @@
+#!/usr/bin/env python%0A%0Aimport pysam%0Aimport sys%0A%0A%0Adef markreads(bamfn, outfn):%0A bam = pysam.AlignmentFile(bamfn, 'rb')%0A out = pysam.AlignmentFile(outfn, 'wb', template=bam)%0A%0A for read in bam.fetch(until_eof=True):%0A tags = read.tags%0A tags.append(('BS',1))%... | |
0bd69e17d75cf1ecaa53153fd07abf2e139f57b7 | add function0-input.py | input/function0-input.py | input/function0-input.py | Python | 0.000021 | @@ -0,0 +1,180 @@
+# -*- coding: utf-8 -*-%0A# Author Frank Hu%0A# iDoulist Function 0 - input%0A%0Aimport urllib2%0A%0Aresponse = urllib2.urlopen(%22http://www.douban.com/doulist/38390646/%22)%0Aprint response.read()
| |
0b840dadc03d7d4256e4969620413090d5808868 | fix g18/zx arc preview | lib/python/rs274/interpret.py | lib/python/rs274/interpret.py | # This is a component of AXIS, a front-end for emc
# Copyright 2004, 2005, 2006 Jeff Epler <jepler@unpythonic.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version... | Python | 0 | @@ -2127,33 +2127,33 @@
=cx+self.offset_
-x
+z
%0A cy=
@@ -2159,33 +2159,33 @@
=cy+self.offset_
-z
+x
%0A xyz
|
70d5b47a66d883187574c409ac08ece24277d292 | Add the test.py example that is cited in the cytomine.org documentation | examples/test.py | examples/test.py | Python | 0 | @@ -0,0 +1,1728 @@
+# -*- coding: utf-8 -*-%0A%0A# * Copyright (c) 2009-2020. Authors: see NOTICE file.%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# * ht... | |
1c2bde23ffc6188fe839b36011775663f86c8919 | Create config.py | config.py | config.py | Python | 0.000002 | @@ -0,0 +1,347 @@
+# -*- coding: utf-8 -*-%0Aimport configparser%0A%0Aclass Config:%0A%09_cp = None%0A%0A%09def load():%0A%09%09Config._cp = configparser.ConfigParser()%0A%09%09Config._cp.read(%22config.ini%22)%0A%09%09for category in Config._cp.sections():%0A%09%09%09temp = %7B%7D%0A%09%09%09for op in Config._cp.optio... | |
0712d78cf76c1d3f699317fcc64db3fe60dc6266 | Add utility functions for generating documentation | docs/utils.py | docs/utils.py | Python | 0.000001 | @@ -0,0 +1,158 @@
+def cleanup_docstring(docstring):%0A doc = %22%22%0A stripped = %5Bline.strip() for line in docstring.split(%22%5Cn%22)%5D%0A doc += '%5Cn'.join(stripped)%0A return doc%0A%0A
| |
1bf634bd24d94a7d7ff358cea3215bba5b59d014 | Create power_of_two.py in bit manipulation | bit_manipulation/power_of_two/python/power_of_two.py | bit_manipulation/power_of_two/python/power_of_two.py | Python | 0.000011 | @@ -0,0 +1,336 @@
+# Check if given number is power of 2 or not %0A %0A# Function to check if x is power of 2 %0Adef isPowerOfTwo (x): %0A %0A # First x in the below expression is for the case when x is 0 %0A return (x and (not(x & (x - 1))) ) %0A %0A# Driver code %0Ax = int(input(%22Enter a no:%22))%0Aif(is... | |
00fa30068b36385c8b9b574074743af01aedff1f | find best parameters | mkTargeted/find_parameters.py | mkTargeted/find_parameters.py | Python | 0.999989 | @@ -0,0 +1,1694 @@
+%0Adef common_elements(list1, list2):%0A return %5Belement for element in list1 if element in list2%5D%0A%0A%0Angap_best = 0 %0Aglimit_best = 0%0Afit_best = -1%0A%0Afor ngap in range(5,50):%0A for glimit in range(100,1500,100):%0A data = t2%0A data = updateArray(data)%0A #... | |
5124d27adbaac0304b2b9a318461257ed9d678fc | valid number | python/valid_num.py | python/valid_num.py | Python | 0.999385 | @@ -0,0 +1,644 @@
+#! /usr/bin/python%0A%0A%0A'''%0AValidate if a given string is numeric.%0A%0ASome examples:%0A%220%22 =%3E true%0A%22 0.1 %22 =%3E true%0A%22abc%22 =%3E false%0A%221 a%22 =%3E false%0A%222e10%22 =%3E true%0ANote: It is intended for the problem statement to be ambiguous. You should gather all requirem... | |
8fddde260af6ea1e6de8491dd99dca671634327c | Add test for the matrix representation function. | test/operator/utility_test.py | test/operator/utility_test.py | Python | 0 | @@ -0,0 +1,2030 @@
+# Copyright 2014, 2015 The ODL development group%0A#%0A# This file is part of ODL.%0A#%0A# ODL is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU General Public License as published by%0A# the Free Software Foundation, either version 3 of the License, or%0A# (a... | |
8b92e55fa202723f7859cd1ea22e835e5c693807 | Add some time handling functions | Instanssi/kompomaatti/misc/awesometime.py | Instanssi/kompomaatti/misc/awesometime.py | Python | 0.000015 | @@ -0,0 +1,1822 @@
+# -*- coding: utf-8 -*-%0A%0Afrom datetime import datetime, timedelta%0A%0Adef todayhelper():%0A today = datetime.today()%0A return datetime(day=today.day, year=today.year, month=today.month)%0A%0Adef format_single_helper(t):%0A now = datetime.now()%0A today = todayhelper()%0A tomorro... | |
bca4a0a0dda95306fe126191166e733c7ccea3ee | Add staff permissions for backup models | nodeconductor/backup/perms.py | nodeconductor/backup/perms.py | Python | 0 | @@ -0,0 +1,231 @@
+from nodeconductor.core.permissions import StaffPermissionLogic%0A%0A%0APERMISSION_LOGICS = (%0A ('backup.BackupSchedule', StaffPermissionLogic(any_permission=True)),%0A ('backup.Backup', StaffPermissionLogic(any_permission=True)),%0A)%0A
| |
8f2d421242da11ab2b4fc3482ce6de5480b20070 | Improve documentation | bears/c_languages/ClangComplexityBear.py | bears/c_languages/ClangComplexityBear.py | from clang.cindex import Index, CursorKind
from coalib.bears.LocalBear import LocalBear
from coalib.results.Result import Result
from coalib.results.SourceRange import SourceRange
from bears.c_languages.ClangBear import clang_available
class ClangComplexityBear(LocalBear):
"""
Calculates cyclomatic complexit... | Python | 0 | @@ -229,16 +229,27 @@
vailable
+, ClangBear
%0A%0A%0Aclass
@@ -380,24 +380,62 @@
er.%0A %22%22%22%0A
+%0A LANGUAGES = ClangBear.LANGUAGES%0A%0A
check_pr
@@ -2511,33 +2511,84 @@
%22%22%0A C
-alculates
+heck for all functions if they are too complicated using the
cyclomatic
@@ -2578,32 +2578,40 @... |
54b66e132137eb6abea0a5ae6571dbc52e309b59 | change all libraries to have module_main of 'index', and add an index.js if it doesn't have one | migrations/011-ensure_library_main_module.py | migrations/011-ensure_library_main_module.py | Python | 0.000001 | @@ -0,0 +1,618 @@
+from jetpack.models import PackageRevision%0A%0ALIB_MODULE_MAIN = 'index'%0A%0Alibs = PackageRevision.objects.filter(package__type='l', module_main='main')%0A .select_related('package', 'modules')%0A%0Alibs.update(module_main=LIB_MODULE_MAIN)%0A%0Amain_per_package = %7B%7D%0A%0Afor revision in... | |
2fda10a83aa5a4d3080a0ce8751e28a18fc9a3e0 | Add two-point example to serve as a regression test for gridline/plot distinguishing | examples/two_point.py | examples/two_point.py | Python | 0.000004 | @@ -0,0 +1,567 @@
+%22%22%22%0ADemonstrates plotting multiple linear features with a single %60%60ax.pole%60%60 call.%0A%0AThe real purpose of this example is to serve as an implicit regression test for%0Asome oddities in the way axes grid lines are handled in matplotlib and%0Amplstereonet. A 2-vertex line can sometim... | |
ee85acb7f9f3af91db3bfb4bf766636883f07685 | Add an extra test for the OpalSerializer | opal/tests/test_core_views.py | opal/tests/test_core_views.py | Python | 0.000001 | @@ -0,0 +1,297 @@
+%22%22%22%0AUnittests for opal.core.views%0A%22%22%22%0Afrom opal.core import test%0A%0Afrom opal.core import views%0A%0Aclass SerializerTestCase(test.OpalTestCase):%0A%0A def test_serializer_default_will_super(self):%0A s = views.OpalSerializer()%0A with self.assertRaises(TypeError)... | |
1fdffc42c7ff7ea4339a58e8a19ffa07253e4149 | Add script to resolve conflicts | resolveconflicts.py | resolveconflicts.py | Python | 0.000001 | @@ -0,0 +1,2905 @@
+# Copyright (C) 2014 Igor Tkach%0A#%0A# This Source Code Form is subject to the terms of the Mozilla Public%0A# License, v. 2.0. If a copy of the MPL was not distributed with this%0A# file, You can obtain one at http://mozilla.org/MPL/2.0/.%0A%0Aimport argparse%0Aimport couchdb%0Afrom urlparse impor... | |
ff6040e00aaa0b0b93f96e0d03caabbc02d08f00 | Fix import order in openstack/common/lockutils.py | openstack/common/lockutils.py | openstack/common/lockutils.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... | Python | 0.00055 | @@ -857,69 +857,69 @@
mmon
-.gettextutils import _%0Afrom openstack.common import fileutils
+ import fileutils%0Afrom openstack.common.gettextutils import _
%0Afro
|
a0a2017e05af986cd0a7207c429e7dc5e8b3fcd2 | Add missing tests for Variable | tests/test_solver_variable.py | tests/test_solver_variable.py | Python | 0.000005 | @@ -0,0 +1,1728 @@
+from gaphas.solver import Variable%0A%0A%0Adef test_equality():%0A v = Variable(3)%0A w = Variable(3)%0A o = Variable(2)%0A%0A assert v == 3%0A assert 3 == v%0A assert v == w%0A assert not v == o%0A%0A assert v != 2%0A assert 2 != v%0A assert not 3 != v%0A assert v !... | |
865356c5b7bbec2b9412ffd3d2a39fea19e4b01a | Create getcounts.py | usbcounter/getcounts.py | usbcounter/getcounts.py | Python | 0.000001 | @@ -0,0 +1,53 @@
+import serial%0Aimport json%0Aimport os, sys%0Aimport time%0A
| |
5063cabcd1d85b31868308e376c0f62588c5e3cc | convert bands to list | landsat/landsat.py | landsat/landsat.py | #!/usr/bin/env python
# Landsat Util
# License: CC0 1.0 Universal
from __future__ import print_function
import argparse
import textwrap
import json
from dateutil.parser import parse
from downloader import Downloader
from search import Search
from utils import reformat_date, convert_to_integer_list, timer, exit
from... | Python | 0.999999 | @@ -7994,17 +7994,16 @@
oader()%0A
-%0A
@@ -8010,154 +8010,68 @@
-bands = None%0A if args.bands:%0A bands = args.bands.replace(' ', '').sp
+d.download(args.scenes, convert_to_integer_
li
+s
t(
-',')%0A%0A d.download(args.scenes,
+args.
bands)
+)
%0A%0A%0Ad
|
993b1af160e6ed7886c2c95770683fae72332aed | remove __debug__ | direct/src/task/Task.py | direct/src/task/Task.py | """ This module exists temporarily as a gatekeeper between
TaskOrig.py, the original Python implementation of the task system,
and TaskNew.py, the new C++ implementation. """
wantNewTasks = False
if __debug__:
from pandac.PandaModules import ConfigVariableBool
wantNewTasks = ConfigVariableBool('want-new-tasks'... | Python | 0.000105 | @@ -173,64 +173,35 @@
%22%22%0A%0A
-wantNewTasks = False%0Aif __debug__:%0A from pandac.Panda
+from pandac.libpandaexpress
Modu
@@ -230,20 +230,16 @@
bleBool%0A
-
wantNewT
|
85cbec4f398c49a4903c7370f74deeae3d5adabf | Create ShowData.py | ShowData.py | ShowData.py | Python | 0 | @@ -0,0 +1,2710 @@
+%22%22%22%0AThe MIT License (MIT)%0A%0ACopyright (c) %3C2016%3E %3CLarry McCaig (aka: Larz60+ aka: Larz60p)%3E%0A%0APermission is hereby granted, free of charge, to any person obtaining a%0Acopy of this software and associated documentation files (the %22Software%22),%0Ato deal in the Software witho... | |
64130f988f2154870db540244a399a8297a103e9 | move hardcoded URL from email script to model definition. | dj/scripts/email_url.py | dj/scripts/email_url.py | #!/usr/bin/python
# email_url.py
# emails the video URL to the presenters
import itertools
from pprint import pprint
from email_ab import email_ab
class email_url(email_ab):
ready_state = 7
subject_template = "[{{ep.show.name}}] Video up: {{ep.name}}"
body_body = """
The video is posted:
{% for ur... | Python | 0 | @@ -588,93 +588,26 @@
%0A
- https://veyepar.nextdayvideo.com/main/approve/%7B%7Bep.id%7D%7D/%7B%7Bep.slug%7D%7D/%7B%7Bep.edit_key%7D%7D/
+%7B%7Bep.approve_url%7D%7D
%0A%0AAs
|
ce47fec10ccda45550625221c64322d89622c707 | Add libjpeg.gyp that wraps third_party/externals/libjpeg/libjpeg.gyp Review URL: https://codereview.appspot.com/5848046 | gyp/libjpeg.gyp | gyp/libjpeg.gyp | Python | 0.000001 | @@ -0,0 +1,513 @@
+# Copyright 2012 The Android Open Source Project%0A#%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0A# Depend on this wrapper to pick up libjpeg from third_party%0A%0A%7B%0A 'targets': %5B%0A %7B%0A 'target_name': 'libjpeg',%0A ... | |
d4ff515df7e12d26c759adfafcacf82e47da71a1 | Add util | snapchat_fs/util.py | snapchat_fs/util.py | Python | 0.000051 | @@ -0,0 +1,580 @@
+#!/usr/bin/env python%0A%0A%22%22%22%0Autil.py provides a set of nice utility functions that support the snapchat_fs pkg%0A%22%22%22%0A%0A__author__ = %22Alex Clemmer, Chad Brubaker%22%0A__copyright__ = %22Copyright 2013, Alex Clemmer and Chad Brubaker%22%0A__credits__ = %5B%22Alex Clemmer%22, %22Cha... | |
7d9fd2eed72a2a65744259af1bd8580253f282d3 | Create a.py | abc067/a.py | abc067/a.py | Python | 0.000489 | @@ -0,0 +1,136 @@
+a, b = map(int, input().split())%0A %0Aif a %25 3 == 0 or b %25 3 == 0 or (a + b) %25 3 == 0:%0A print('Possible')%0Aelse:%0A print('Impossible')%0A
| |
c4d5d04a957fed09228995aa7f84ed19c64e3831 | Add previously forgotten afterflight utilities module | af_utils.py | af_utils.py | Python | 0 | @@ -0,0 +1,2822 @@
+ #Copyright 2013 Aaron Curtis%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 #http://www.apache.org/licenses/LICENSE-2.0%0A%0A #Unless re... | |
f68b0bb1e1f10b10e58057f60e17377f027690f8 | add a util function for ungzip. | web/my_util/compress.py | web/my_util/compress.py | Python | 0 | @@ -0,0 +1,274 @@
+import gzip%0Afrom StringIO import StringIO%0A%0Adef ungzip(resp):%0A if resp.info().get('Content-Encoding') == 'gzip':%0A buf = StringIO(resp.read())%0A f = gzip.GzipFile(fileobj=buf)%0A data = f.read()%0A%0A return data%0A%0A else:%0A return resp.read()%0A%0... | |
f66b799a22f2c74b88f867266c2e51eda1377b1c | Create find_the_mine.py | find_the_mine.py | find_the_mine.py | Python | 0.00075 | @@ -0,0 +1,229 @@
+#Kunal Gautam%0A#Codewars : @Kunalpod%0A#Problem name: Find the Mine!%0A#Problem level: 6 kyu%0A%0Adef mineLocation(field):%0A for i in range(len(field)):%0A for j in range(len(field)):%0A if field%5Bi%5D%5Bj%5D==1: return %5Bi,j%5D%0A
| |
febc735e79f3cc1b5f2e5fe2882bf28c458f638a | Initialize init file | wikilink/db/__init__.py | wikilink/db/__init__.py | Python | 0 | @@ -0,0 +1,468 @@
+%22%22%22%0A%09wikilink%0A%09~~~~~~~~%0A%0A%09wiki-link is a web-scraping application to find minimum number %0A%09of links between two given wiki pages. %0A%0A :copyright: (c) 2016 - 2018 by Tran Ly VU. All Rights Reserved.%0A :license: Apache License 2.0.%0A%22%22%22%0A__all__ = %5B%22db%22, ... | |
3fdb673977de57e5555eafb18e36544f3ea8c056 | Solve the absurd problem with an absurd file | selection/absurd.py | selection/absurd.py | Python | 0.999963 | @@ -0,0 +1,371 @@
+import kmeans%0Aimport numpy as np%0Akmeans = reload(kmeans)%0A%0An_sample = 100%0Ap_array = %5B%5D%0Afor i in range(n_sample):%0A if i%2510 == 0:%0A print i, %22 / %22, n_sample%0A %0A kmeans = reload(kmeans)%0A p = kmeans.f(10)%0A p_array.append(p)%0A%0A%0A%0Aimport matplo... | |
c2bce27530f9997bffcb04f80a8d78db65ff98b2 | Create GPS.py | home/kmcgerald/GPS.py | home/kmcgerald/GPS.py | Python | 0.000007 | @@ -0,0 +1,1937 @@
+from time import sleep%0A# The geofence and measure distance methods should be available in MRL %3E 1.0.86%0A%0Agps1 = Runtime.start(%22gps1%22, %22GPS%22)%0A%0Agps1.connect(%22/dev/tty.palmOneGPS-GPSSerialOut%22)%0Asleep(1)%0A%0A# define some points ... %0A# Lets use Nova Labs 1.0%0Alat1 = 38.95082... | |
ddc80392b17a3fadcbea09f82ea5f6936f0fd459 | add fbcode_builder_config for mvfst build in oss | build/fbcode_builder/specs/mvfst.py | build/fbcode_builder/specs/mvfst.py | Python | 0 | @@ -0,0 +1,538 @@
+#!/usr/bin/env python%0A# Copyright (c) Facebook, Inc. and its affiliates.%0Afrom __future__ import absolute_import%0Afrom __future__ import division%0Afrom __future__ import print_function%0Afrom __future__ import unicode_literals%0A%0Aimport specs.folly as folly%0Aimport specs.fizz as fizz%0A%0A%0A... | |
2593b23d261eb595b0844868360974bf180b21d8 | Version bump | jrnl/__init__.py | jrnl/__init__.py | #!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.5.1'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
from .jrnl import cli
| Python | 0.000001 | @@ -142,17 +142,17 @@
= '1.5.
-1
+2
'%0A__auth
|
d8ff61b72c07a9f0b22e5cbaefe6277bf2697afc | Create project.py | project_surgery/project.py | project_surgery/project.py | Python | 0.000001 | @@ -0,0 +1,2007 @@
+# -*- coding: utf-8 -*-%0A##############################################################################%0A#%0A# Author: Gideoni Silva (Omnes)%0A# Copyright 2013-2014 Omnes Tecnologia%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of t... | |
e87982d03edeb7c16d3c183309adfff4be50d168 | Add Qt4 file to start on creating a Qt-based GUI | gui/qt.py | gui/qt.py | Python | 0 | @@ -0,0 +1,439 @@
+from lib.version import AMON_VERSION%0Afrom lib.keybase import KeybaseUser%0Afrom lib.gmail import GmailUser%0Afrom lib.addresses import AddressBook%0Aimport lib.gpg as gpg%0A%0Aimport sys%0Aimport logging%0Aimport json%0Afrom PyQt4 import QtGui%0A%0A%0Aclass Amon(QtGui.QMainWindow):%0A def __init... | |
3972c4a16894732db418a2d04f36b5104e0fac86 | add rms code in own namespace | tkp/quality/rms.py | tkp/quality/rms.py | Python | 0.000001 | @@ -0,0 +1,822 @@
+from tkp.utility import nice_format%0A%0A%0Adef rms_invalid(rms, noise, low_bound=1, high_bound=50):%0A %22%22%22%0A Is the RMS value of an image too high?%0A%0A :param rms: RMS value of an image, can be computed with%0A tkp.quality.statistics.rms%0A :param noise: Theoretic... | |
1613bde53cfda3d38d7e62c6c91f3d6c5407fb9c | Add script inspect_checkpoint.py to check if a model checkpoint is corrupted with NaN/inf values | inspect_checkpoint.py | inspect_checkpoint.py | Python | 0.000001 | @@ -0,0 +1,1312 @@
+%22%22%22%0ASimple script that checks if a checkpoint is corrupted with any inf/NaN values. Run like this:%0A python inspect_checkpoint.py model.12345%0A%22%22%22%0A%0Aimport tensorflow as tf%0Aimport sys%0Aimport numpy as np%0A%0A%0Aif __name__ == '__main__':%0A if len(sys.argv) != 2:%0A raise... | |
d5e16fdf73eb281da3541fa7a0e3f8792b83faeb | bump to 0.3.0 | tproxy/__init__.py | tproxy/__init__.py | # -*- coding: utf-8 -
#
# This file is part of tproxy released under the MIT license.
# See the NOTICE for more information.
version_info = (0, 2, 4)
__version__ = ".".join(map(str, version_info))
| Python | 0.000019 | @@ -143,12 +143,12 @@
(0,
-2, 4
+3, 0
)%0A__
|
bb5a94208bb3a96995182b773998dbec4ebf7667 | Test wrapper py script | py_scripts/EoSeval_test.py | py_scripts/EoSeval_test.py | Python | 0.000001 | @@ -0,0 +1,490 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0ACode description goes in here%0A%22%22%22%0Aimport numpy%0Aimport EoSeq%0Afrom scipy.optimize import curve_fit%0A%0A# Prompt user for filename string%0A# filename = raw_input(%22Please enter a file path for P and V data%22)%0A%0A# Load in data file%0A# data = num... | |
9a082b04973a9927014df496aa31f5c05e8be6ca | add 143 | python/143_reorder_list.py | python/143_reorder_list.py | Python | 0.999998 | @@ -0,0 +1,1657 @@
+%22%22%22%0AGiven a singly linked list L: L0%E2%86%92L1%E2%86%92%E2%80%A6%E2%86%92Ln-1%E2%86%92Ln,%0Areorder it to: L0%E2%86%92Ln%E2%86%92L1%E2%86%92Ln-1%E2%86%92L2%E2%86%92Ln-2%E2%86%92%E2%80%A6%0A%0AYou must do this in-place without altering the nodes' values.%0A%0AFor example,%0AGiven %7B1,2,3,4%... | |
38756d3fd7ac1d858d45f256e8d4ad118ecbf531 | add basic admin file | emencia/django/socialaggregator/admin.py | emencia/django/socialaggregator/admin.py | Python | 0 | @@ -0,0 +1,583 @@
+%22%22%22Admin for parrot.gallery%22%22%22%0Afrom django.contrib import admin%0Afrom django.utils.translation import ugettext_lazy as _%0A%0A%0Afrom emencia.django.socialaggregator.models import Feed%0Afrom emencia.django.socialaggregator.models import Aggregator%0Afrom emencia.django.socialaggregato... | |
8b7db3fc9b90897c0e8da6d6b63d12e79754c625 | Solve Knowit2019/19 | knowit2019/19.py | knowit2019/19.py | Python | 0.999966 | @@ -0,0 +1,436 @@
+def hidden_palindrome(n):%0A n_s = str(n)%0A%0A if n_s == n_s%5B::-1%5D:%0A return False%0A%0A s = str(n + int(n_s%5B::-1%5D))%0A%0A return s == s%5B::-1%5D%0A%0A%0Adef test_hidden_palindrome():%0A assert hidden_palindrome(38)%0A assert not hidden_palindrome(49)%0A%0A%0Aif __... | |
605d34f5bb5736851d71e5a5280ad6b889d6189f | Check that verbose output is sound. | sklearn/neural_network/tests/test_rbm.py | sklearn/neural_network/tests/test_rbm.py | import sys
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_equal
from sklearn.datasets import load_digits
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.neural_network import BernoulliRBM
from sklearn.utils.validation import assert_all_finite
np.seterr(all='... | Python | 0.999999 | @@ -3,16 +3,26 @@
port sys
+%0Aimport re
%0A%0Aimport
@@ -3909,10 +3909,24 @@
r=1,
-
%0A
+
@@ -3988,32 +3988,232 @@
.fit(X)%0A
-finally:
+ s = sys.stdout.getvalue()%0A # make sure output is sound%0A assert(re.match(r%22Iteration 0, pseudo-likelihood = -?(%5Cd)+(%5C.%5Cd+)... |
58d19ea654e0c8d250f46b0d72191e48b4bc8588 | add tests for encryption/decryption in awx.main.utils.common | awx/main/tests/unit/common/test_common.py | awx/main/tests/unit/common/test_common.py | Python | 0.000001 | @@ -0,0 +1,1157 @@
+from awx.conf.models import Setting%0Afrom awx.main.utils import common%0A%0A%0Adef test_encrypt_field():%0A field = Setting(pk=123, value='ANSIBLE')%0A encrypted = common.encrypt_field(field, 'value')%0A assert encrypted == '$encrypted$AES$Ey83gcmMuBBT1OEq2lepnw=='%0A assert common.decr... | |
8ae3e44b0a43f382c98194b9caa097b62de899ef | Add script to save ner data to a csv file | nlpppln/save_ner_data.py | nlpppln/save_ner_data.py | Python | 0 | @@ -0,0 +1,1040 @@
+#!/usr/bin/env python%0Aimport click%0Aimport os%0Aimport codecs%0Aimport json%0Aimport pandas as pd%0A%0A%0A@click.command()%0A@click.argument('input_dir', type=click.Path(exists=True))%0A@click.argument('output_file', type=click.Path())%0Adef nerstats(input_dir, output_file):%0A output_dir = os... | |
46a40e7e8fc424cc7e7a601fc99ab2d852cd0980 | Add example GCP CLI tool. (#69) | examples/gcp_cli.py | examples/gcp_cli.py | Python | 0 | @@ -0,0 +1,2618 @@
+# -*- coding: utf-8 -*-%0A# Copyright 2020 Google Inc.%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# http://www.apache.org/licenses/LICENSE-2.0%... | |
b773c0d7f5ae3b223b8a02ff29d8fb6313b8445f | Version bump | jrnl/__init__.py | jrnl/__init__.py | #!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.2.1'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
from .jrnl import cli
| Python | 0.000001 | @@ -144,11 +144,11 @@
'1.
-2.1
+3.0
'%0A__
|
9cc4067d581f6a97136e0f186dc8aa1dbc734e47 | verify that the dynamic oracle for ArcEager can reach all projective parses | hals/transition_system/arc_eager_test.py | hals/transition_system/arc_eager_test.py | Python | 0 | @@ -0,0 +1,1768 @@
+from copy import copy, deepcopy%0Aimport numpy as np%0Afrom unittest import TestCase%0A%0Afrom transition_system.arc_eager import ArcEager, ArcEagerDynamicOracle%0A%0A%0Adef generate_all_projective_parses(size):%0A arc_eager = ArcEager(1)%0A initial = arc_eager.state(size)%0A stack = %5B%5D... | |
db380d8e6a8dfa5444f82a0978fad3494d923278 | Add tests of generate_matrix | tests/chainer_tests/testing_tests/test_matrix.py | tests/chainer_tests/testing_tests/test_matrix.py | Python | 0.000003 | @@ -0,0 +1,1794 @@
+import unittest%0A%0Aimport numpy%0A%0Afrom chainer import testing%0Afrom chainer.testing import condition%0A%0A%0A@testing.parameterize(*testing.product(%7B%0A 'dtype': %5B%0A numpy.float16, numpy.float32, numpy.float64,%0A numpy.complex64, numpy.complex128,%0A %5D,%0A 'x_s_s... | |
3cad51e08ef4c1dcfb11cbb8c32272328b31015a | Prepare v1.2.306.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.30
-5
+6.dev
'%0A
|
0ef5aa5abaf220579915e4068fd61513114b0be6 | Fix evolver get_mif() | joommf/drivers/evolver.py | joommf/drivers/evolver.py | import textwrap
class Minimiser(object):
def __init__(self, m_init, Ms, name, d_mxHxm=0.1):
self.m_init = m_init
self.Ms = Ms
self.name = name
self.d_mxHxm = d_mxHxm
def get_mif(self):
mif = textwrap.dedent("""\
Specify Oxs_CGEvolve:evolver {}
Specify... | Python | 0.000001 | @@ -295,16 +295,18 @@
volver %7B
+%7B%7D
%7D%0A%0A
@@ -638,117 +638,8 @@
mat(
- # self.solver,%0A # self.alpha,%0A # self.gamma,%0A self.dm,%0A self.t,
%0A
@@ -757,24 +757,17 @@
self.
-stopping
+d
_mxHxm,%0A
|
05e7db377b7f0224ec97d5f96c387d711e1e0f23 | Add problem | src/SRM-144/time.py | src/SRM-144/time.py | Python | 0.03246 | @@ -0,0 +1,318 @@
+%0Aclass Time:%0A%0A def whatTime(self, seconds):%0A hours = seconds / 3600%0A a = 3600%0A leftover = seconds - hours * 3600%0A minutes = leftover / 60%0A final_sec = seconds - hours * 3600 - minutes * 60%0A final = str(hours) + %22:%22 + str(minutes)+ %22... | |
a1de448ff755dc938d70fc41e20b521dc6d4bfb6 | Fix logging | check_mesos.py | check_mesos.py | #!/usr/bin/env python
import nagiosplugin
import argparse
import logging
import re
import requests
INFINITY = float('inf')
HEALTHY = 1
UNHEALTHY = -1
class MesosMaster(nagiosplugin.Resource):
def __init__(self, baseuri, frameworks):
self.baseuri = baseuri
self.frameworks = frameworks
def probe(self):
... | Python | 0.000007 | @@ -145,16 +145,57 @@
Y = -1%0A%0A
+log = logging.getLogger(%22nagiosplugin%22)%0A%0A
class Me
@@ -382,28 +382,24 @@
euri%0A log
-ging
.info('Looki
@@ -830,20 +830,16 @@
log
-ging
.error('
@@ -945,20 +945,16 @@
%0A log
-ging
.info('B
@@ -1047,36 +1047,32 @@
health')%0A log
-ging
.debug('Response... |
61f542c215c0b45bf8b4121bc4705c760c334aa9 | Add a SetObjectExtruderOperation class | cura/Settings/SetObjectExtruderOperation.py | cura/Settings/SetObjectExtruderOperation.py | Python | 0 | @@ -0,0 +1,1136 @@
+# Copyright (c) 2017 Ultimaker B.V.%0A# Cura is released under the terms of the AGPLv3 or higher.%0A%0Afrom UM.Scene.SceneNode import SceneNode%0Afrom UM.Operations.Operation import Operation%0A%0Afrom cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator%0A%0A## Simple operation t... | |
57c29ec11b91505cade24670cc45726a8689bb9a | add needed util module | hera_mc/cm_utils.py | hera_mc/cm_utils.py | Python | 0.000001 | @@ -0,0 +1,1134 @@
+# -*- mode: python; coding: utf-8 -*-%0A# Copyright 2016 the HERA Collaboration%0A# Licensed under the 2-clause BSD license.%0A%0A%22%22%22Some dumb low-level configuration management utility functions.%0A%0A%22%22%22%0A%0Afrom __future__ import print_function%0A%0Aimport datetime%0A%0Adef _get_date... | |
860b7b30f393622dac9badd15d65bf59679580e2 | Create utils.py | image_gnip/utils.py | image_gnip/utils.py | Python | 0.000001 | @@ -0,0 +1,3221 @@
+import os%0Aimport sys%0Aimport time%0Aimport logging.config%0Aimport json%0A%0Aclass Utils:%0A%0A @staticmethod%0A def insert_record(client, dataset_id, table_id, record):%0A %0A result = client.push_rows(dataset_id, table_id, %5Brecord%5D, None) %0A %0A if resul... | |
0080b6744b0ed9603ecf28b826e03aef01a58d2c | add editmate extension | editmate.py | editmate.py | Python | 0 | @@ -0,0 +1,738 @@
+%22%22%22%0AUse TextMate as the editor%0A%0AUsage: %25load_ext editmate%0A%0ANow when you %25edit something, it opens in textmate.%0AThis is only necessary because the textmate command-line entrypoint%0Adoesn't support the +L format for linenumbers, it uses %60-l L%60.%0A%0A%22%22%22%0A%0Afrom subpr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.