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 |
|---|---|---|---|---|---|---|---|
295823afe17cedaa1934afbcd19d955974089c63 | Add producer written in Python | python/send.py | python/send.py | Python | 0.000005 | @@ -0,0 +1,679 @@
+#!/usr/bin/env python%0Aimport pika%0A%0A# Host in which RabbitMQ is running.%0AHOST = 'localhost'%0A%0A# Name of the queue.%0AQUEUE = 'pages'%0A%0A# The message to send.%0AMESSAGE = 'Hi there! This is a test message =)'%0A%0A# Getting the connection using pika.%0A# Creating the channel.%0A# Declarin... | |
04c8b38ac43c84abe64858cfd22a721e803b87eb | add mocked tests for internal /run folder | tests/core/test_run_files.py | tests/core/test_run_files.py | Python | 0 | @@ -0,0 +1,2322 @@
+# stdlib%0Aimport os%0Aimport shlex%0Aimport signal%0Aimport subprocess%0Aimport time%0Aimport unittest%0A%0A# 3p%0Aimport mock%0Afrom nose.plugins.attrib import attr%0A%0A# Mock gettempdir for testing%0Aimport tempfile; tempfile.gettempdir = mock.Mock(return_value='/a/test/tmp/dir')%0A%0A# project%... | |
cf9299aad62828f1cd116403076b2a6b086721d8 | add meta utilities | flask_ember/util/meta.py | flask_ember/util/meta.py | Python | 0.000001 | @@ -0,0 +1,477 @@
+import inspect%0A%0A%0Adef get_class_fields(klass, predicate=None):%0A return %5B(name, field) for name, field in klass.__dict__.items()%0A if (predicate(name, field) if predicate else True)%5D%0A%0A%0Adef get_fields(klass, predicate=None):%0A fields = list()%0A for base in inspec... | |
481a920fe89ea7f0e518b8cf815f966715b20ca3 | add new package : activemq (#14142) | var/spack/repos/builtin/packages/activemq/package.py | var/spack/repos/builtin/packages/activemq/package.py | Python | 0 | @@ -0,0 +1,698 @@
+# Copyright 2013-2019 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 Activemq(Package):%0A %22%22%22%0A Apache ActiveMQ is... | |
6b9adf9f00b481562cedf2debc5aede947734744 | remove dot | addons/account_analytic_analysis/cron_account_analytic_account.py | addons/account_analytic_analysis/cron_account_analytic_account.py | #!/usr/bin/env python
from osv import osv
from mako.template import Template
import time
try:
import cStringIO as StringIO
except ImportError:
import StringIO
import tools
MAKO_TEMPLATE = u"""Hello ${user.name},
Here is a list of contracts that have to be renewed for two
possible reasons:
- the end of cont... | Python | 0.000012 | @@ -1090,10 +1090,8 @@
- .
$%7Ba
|
2aa7a6260d9d5a74ee81677be2bd5f97774f9116 | Add tests for internal gregorian functions. | calexicon/internal/tests/test_gregorian.py | calexicon/internal/tests/test_gregorian.py | Python | 0 | @@ -0,0 +1,385 @@
+import unittest%0A%0Afrom calexicon.internal.gregorian import is_gregorian_leap_year%0A%0A%0Aclass TestGregorian(unittest.TestCase):%0A def test_is_gregorian_leap_year(self):%0A self.assertTrue(is_gregorian_leap_year(2000))%0A self.assertTrue(is_gregorian_leap_year(1984))%0A s... | |
387d05dbdb81bacc4851adffbfd7f827e709d4cc | Add Step class - Create Step.py to hold code for the Step class. - The Step class represents a single step/instruction for a Recipe object. | Step.py | Step.py | Python | 0 | @@ -0,0 +1,123 @@
+# Step object%0Aclass Step:%0A # Initiate object%0A def __init__(self,description):%0A self.description = description%0A
| |
7d8a566ac51e7e471603c2160dce2046eb698738 | add sn domains conversion tool | conv.py | conv.py | Python | 0 | @@ -0,0 +1,1472 @@
+#!/usr/bin/env python%0A%0A# Read the wiki for more infomation%0A# https://github.com/lennylxx/ipv6-hosts/wiki/sn-domains%0A%0Aimport sys%0Atable = '1023456789abcdefghijklmnopqrstuvwxyz'%0A%0Adef iata2sn(iata):%0A global table%0A sn = ''%0A for v in iata%5B0:3%5D:%0A i = ((ord(v) - o... | |
d2bdbd0d851fda046c0be55105a211a382c22766 | Add Day 2 | day2.py | day2.py | Python | 0.000031 | @@ -0,0 +1,749 @@
+#Advent of Code December 2%0A#Written by icydoge - icydoge AT gmail dot com%0A%0Awith open('paper.txt') as f:%0A content = f.read().splitlines()%5B:-1%5D #Remove last empty line%0A%0Apart_one_answer = 0%0Apart_two_answer = 0%0A%0Afor box in content:%0A dimensions = sorted(map(int,box.split('x')... | |
acf4ad1e5948354281fec040badfe412f5194529 | add wsgi | flaskr/flaskr.wsgi | flaskr/flaskr.wsgi | Python | 0.999824 | @@ -0,0 +1,356 @@
+%3CVirtualHost *%3E%0A ServerName example.com%0A%0A WSGIDaemonProcess flaskr user=user1 group=group1 threads=5%0A WSGIScriptAlias / /var/www/FlaskDB/flaskr/flaskr.wsgi%0A%0A %3CDirectory /var/www/FlaskDB/flaskr%3E%0A WSGIProcessGroup flaskr%0A WSGIApplicationGroup %25%7BGLOB... | |
b6fbdd70a0486718d711a7efc310e350a1837b9c | add collapse reads code | seqcluster/collapse.py | seqcluster/collapse.py | Python | 0.000001 | @@ -0,0 +1,788 @@
+import os%0Afrom libs.fastq import collapse, splitext_plus%0Aimport logging%0A%0A%0Alogger = logging.getLogger('seqbuster')%0A%0A%0Adef collapse_fastq(args):%0A %22%22%22collapse fasq files after adapter trimming%0A %22%22%22%0A idx = 0%0A try:%0A seqs = collapse(args.fastq)%0A ... | |
871ec5597059934bce64f7d31fa7e5ab165063ee | Add basic GUI frontend | memorise-frontend.py | memorise-frontend.py | Python | 0 | @@ -0,0 +1,1706 @@
+#!/usr/bin/env python%0A# -*- Coding: utf-8 -*-%0A%0Afrom tkinter import Tk, Menu%0Afrom ttk import Frame, Button, Style%0A%0Aclass MemoriseFrontend(Frame):%0A version = %220.1-py%22%0A padding = 10%0A%0A def __init__(self, parent):%0A Frame.__init__(self, parent)%0A self.pare... | |
db81e8ca0b0321994f188daf45211e6ae2dda4a4 | Make a control dataset that only contains sequences with titer data. | dengue/utils/make_titer_strain_control.py | dengue/utils/make_titer_strain_control.py | Python | 0.00001 | @@ -0,0 +1,644 @@
+from Bio import SeqIO%0Afrom pprint import pprint%0A%0Awith open('../../data/dengue_titers.tsv', 'r') as f:%0A%09titerstrains = set(%5B line.split()%5B0%5D for line in f %5D)%0Awith open('../../data/dengue_titers.tsv', 'r') as f:%0A%09serastrains = set(%5B line.split()%5B1%5D for line in f %5D)%0A%0A... | |
9a67c8eca45daa2f706e8fc6bde958c37229c837 | Create mpd_mouse_control.py | mpd_mouse_control.py | mpd_mouse_control.py | Python | 0.000002 | @@ -0,0 +1,2960 @@
+from evdev import InputDevice%0Afrom select import select%0Aimport os%0Aimport mpd%0Aimport socket%0Aimport alsaaudio%0Aimport time%0Aclient = mpd.MPDClient(use_unicode=True)%0Adev = InputDevice('/dev/input/event2')%0Adrop_lb_event = False%0Adrop_rb_event = False%0A%0Awhile True:%0A r,w,x = s... | |
d1024a2892c6e171b3d465d56c8a1fad25d7fbdc | Create ESLint styler | zazu/plugins/eslint_styler.py | zazu/plugins/eslint_styler.py | Python | 0 | @@ -0,0 +1,1113 @@
+# -*- coding: utf-8 -*-%0A%22%22%22eslint plugin for zazu.%22%22%22%0Aimport zazu.styler%0Azazu.util.lazy_import(locals(), %5B%0A 'subprocess',%0A 'os',%0A 'tempfile'%0A%5D)%0A%0A__author__ = %22Patrick Moore%22%0A__copyright__ = %22Copyright 2018%22%0A%0A%0Aclass eslintStyler(zazu.styler.S... | |
690b5a994bc20b561632d9aa3e332061457a3d72 | Add missing __init__.py to overkiz tests (#62727) | tests/components/overkiz/__init__.py | tests/components/overkiz/__init__.py | Python | 0.000001 | @@ -0,0 +1,39 @@
+%22%22%22Tests for the overkiz component.%22%22%22%0A
| |
d08426ffde22c2ded72425f1d1c54923b9aa0b97 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/4b193958ac9b893b33dc03cc6882c70ad4ad509d. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "f5ea7e9c419b881d7f3136de7a7388a23feee70e"
TFRT_SHA256 = "723c9b1fabc504fed5b391fc766e... | Python | 0 | @@ -228,133 +228,133 @@
= %22
-f5ea7e9c419b881d7f3136de7a7388a23feee70e%22%0A TFRT_SHA256 = %22723c9b1fabc504fed5b391fc766e2504559c2b02b4f4e01c55bc77b8ff0df8ed
+4b193958ac9b893b33dc03cc6882c70ad4ad509d%22%0A TFRT_SHA256 = %225b011d3f3b25e6c9646da078d0dbd8000ca063fa4fe6ef53449692c363fa13f7
%22%0A%0A
|
79a38e9ef0ac04c4efef55c26f74ad2b11442a7b | add a command to fix the missing packages | crate_project/apps/crate/management/commands/fix_missing_files.py | crate_project/apps/crate/management/commands/fix_missing_files.py | Python | 0.000009 | @@ -0,0 +1,494 @@
+from django.core.management.base import BaseCommand%0A%0Afrom packages.models import ReleaseFile%0Afrom pypi.processor import PyPIPackage%0A%0A%0Aclass Command(BaseCommand):%0A%0A def handle(self, *args, **options):%0A i = 0%0A for rf in ReleaseFile.objects.filter(digest=%22%22).dist... | |
50b9aff7914885b590748ebd8bca4350d138670c | Add admin section for the ``Resources``. | us_ignite/resources/admin.py | us_ignite/resources/admin.py | Python | 0 | @@ -0,0 +1,397 @@
+from django.contrib import admin%0A%0Afrom us_ignite.resources.models import Resource%0A%0A%0Aclass ResourceAdmin(admin.ModelAdmin):%0A list_display = ('name', 'slug', 'status', 'is_featured')%0A search_fields = ('name', 'slug', 'description', 'url')%0A list_filter = ('is_featured', 'created... | |
20c9f1416243c020b270041621098ca20e09eca4 | tag retrieval script added | private/scripts/extras/timus_tag_retrieval.py | private/scripts/extras/timus_tag_retrieval.py | Python | 0 | @@ -0,0 +1,1636 @@
+%22%22%22%0A Copyright (c) 2015-2018 Raj Patel(raj454raj@gmail.com), StopStalk%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 restriction, i... | |
0136d50265fc390d194436238b88655327982231 | add gobOauth.py | gobOauth.py | gobOauth.py | Python | 0.000003 | @@ -0,0 +1,479 @@
+import praw%0Aimport configparser%0A%0ASAVEFILE = %22oauth.ini%22%0Adef read_ini():%0A cfg = configparser.ConfigParser()%0A cfg.read(SAVEFILE)%0A return cfg%0A%0Adef get_refreshable_instance():%0A cfg = read_ini()%0A reddit = praw.Reddit(client_id=cfg%5B'app'%5D%5B'client_id'%5D,%0A ... | |
e0b84a97e4c7ad5dcef336080657a884cff603fc | Test two windows drawing GL with different contexts. | tests/gl_test_2.py | tests/gl_test_2.py | Python | 0.000005 | @@ -0,0 +1,1526 @@
+#!/usr/bin/env python%0A%0A'''%0A'''%0A%0A__docformat__ = 'restructuredtext'%0A__version__ = '$Id$'%0A%0Aimport pyglet.window%0Afrom pyglet.window.event import *%0Aimport time%0A%0Afrom pyglet.GL.VERSION_1_1 import *%0Afrom pyglet.GLU.VERSION_1_1 import *%0Afrom pyglet import clock%0A%0Afactory = py... | |
bdaa80badf1f3d8c972c5da7d0fe65a0c3f63752 | Update maasutils.py to fix pep8 | tests/maasutils.py | tests/maasutils.py | #!/usr/bin/env python
import os
import sys
import click
from rackspace_monitoring.providers import get_driver
from rackspace_monitoring.types import Provider
import requests
@click.group()
@click.option("--username", required=True)
@click.option("--api-key", required=True)
@click.pass_context
def cli(ctx, api_key, u... | Python | 0 | @@ -3104,8 +3104,9 @@
cli()
+%0A
|
8affb8e4a3744e604b88157a918ef690203cbfa8 | Remove disallowed characters from stream names. | zerver/migrations/0375_invalid_characters_in_stream_names.py | zerver/migrations/0375_invalid_characters_in_stream_names.py | Python | 0 | @@ -0,0 +1,2802 @@
+import unicodedata%0A%0Afrom django.db import connection, migrations%0Afrom django.db.backends.postgresql.schema import DatabaseSchemaEditor%0Afrom django.db.migrations.state import StateApps%0A%0A# There are 66 Unicode non-characters; see%0A# https://www.unicode.org/faq/private_use.html#nonchar4%0A... | |
1deb35d9aa62a6c950cb978063c7f4aed645067b | Add utility module for logging | mediacloud/mediawords/util/log.py | mediacloud/mediawords/util/log.py | Python | 0 | @@ -0,0 +1,363 @@
+import logging%0A%0A%0Adef create_logger(name):%0A %22%22%22Create and return 'logging' instance.%22%22%22%0A formatter = logging.Formatter(fmt='%25(asctime)s - %25(levelname)s - %25(module)s - %25(message)s')%0A%0A handler = logging.StreamHandler()%0A handler.setFormatter(formatter)%0A%0... | |
12c483953f39a3bacaab6d49ba17c4920db52179 | Add script to clean up all FD phone and fax numbers. | firecares/firestation/management/commands/cleanup_phonenumbers.py | firecares/firestation/management/commands/cleanup_phonenumbers.py | Python | 0 | @@ -0,0 +1,1445 @@
+from django.core.management.base import BaseCommand%0Afrom firecares.firestation.models import FireDepartment%0Afrom phonenumber_field.modelfields import PhoneNumber%0Aimport re%0A%0A%22%22%22%0AThis command is for cleaning up every phone and fax number in the%0Adatabase. It removes all non-numeric ... | |
c99b4c9c4b42d7f6c1e3800ed5595e86db95b6cf | finish hello world program for dajax | gui/ajax.py | gui/ajax.py | Python | 0.997924 | @@ -0,0 +1,456 @@
+# -*- coding: UTF-8 -*-%0A'''%0ACreated on 2013-03-25%0A%0A@author: tianwei%0A%0ADesc: This module will be used for ajax request, such as form valid, search%0A query, calculated submit.%0A'''%0A%0Aimport simplejson%0Afrom dajaxice.decorators import dajaxice_register%0A%0A%0A@dajaxice_register(me... | |
88cacd862477ded4344ac1ab3de1580d09f6db9c | add org level and lables | indicators/test.py | indicators/test.py | from django.test import TestCase
from django.test import RequestFactory
from django.test import Client
from indicators.models import Indicator, IndicatorType, DisaggregationType, ReportingFrequency, CollectedData
from workflow.models import Program, Country, Organization
from django.contrib.auth.models import User
cl... | Python | 0.000008 | @@ -382,10 +382,10 @@
rgan
-z
i
+z
atio
|
2db51d6c117bbe0555ddffe34f52679685c68fbb | update url | indicators/urls.py | indicators/urls.py | from django.conf.urls import patterns, include, url
from .views import CollectedDataList, CollectedDataCreate, CollectedDataUpdate, CollectedDataDelete, IndicatorCreate, IndicatorDelete, IndicatorUpdate,\
IndicatorList, IndicatorExport, CollectedDataExport
urlpatterns = patterns('',
###INDICATOR PLANING TOO... | Python | 0.000001 | @@ -233,37 +233,16 @@
orExport
-, CollectedDataExport
%0A%0A%0Aurlpa
|
7d128f2386fd3bbcbff1a407018f9ab9ed580810 | Add tests for path join | tests/test_path.py | tests/test_path.py | Python | 0 | @@ -0,0 +1,239 @@
+from gypsy.path import _join%0A%0Adef test_join():%0A assert _join('s3://', 'bucket', 'prefix') == 's3://bucket/prefix'%0A assert _join('s3://bucket', 'prefix') == 's3://bucket/prefix'%0A assert _join('bucket', 'prefix') == 'bucket/prefix'%0A
| |
af2654df47b8b7ea60d78fd7f692e911c2d3a82c | allow oveerride of font used | tests/text_test.py | tests/text_test.py | import sys
import os
import time
import pyglet.window
from pyglet.window.event import *
from pyglet.GL.VERSION_1_1 import *
from pyglet.GLU.VERSION_1_1 import *
from pyglet import clock
from pyglet.text import Font
from ctypes import *
factory = pyglet.window.WindowFactory()
factory.config._attributes['doublebuffer'... | Python | 0 | @@ -363,16 +363,76 @@
t=200)%0A%0A
+if len(sys.argv) == 2:%0A filename = sys.argv%5B1%5D%0Aelse:%0A
filename
|
7336cc3c89727383c7a9cbbf564f6cfce7f198f9 | add similiarty3.py | app/find_similarity3.py | app/find_similarity3.py | Python | 0 | @@ -0,0 +1,2440 @@
+import sys%0Aimport string%0Aimport requests%0Aimport json%0Aimport pymysql %0Aimport numpy as np%0Aimport pandas as pd%0Afrom operator import itemgetter%0Afrom sklearn.metrics.pairwise import cosine_similarity%0Afrom sklearn.decomposition import PCA, RandomizedPCA, TruncatedSVD%0Afrom sklearn.prepr... | |
08988d19c712ad4604f0acced71a069c7c20067a | Add kv store for file storage | zou/app/stores/file_store.py | zou/app/stores/file_store.py | Python | 0 | @@ -0,0 +1,1241 @@
+import flask_fs as fs%0A%0Afrom zou.app import app%0A%0A%0Apictures = fs.Storage(%22pictures%22, overwrite=True)%0Amovies = fs.Storage(%22movies%22, overwrite=True)%0A%0Apictures.configure(app)%0Amovies.configure(app)%0A%0A%0Adef make_key(prefix, id):%0A return %22%25s-%25s%22 %25 (prefix, id)%0A... | |
56c27d56ca16f6659a478af0b6529291b1140636 | Create find-peak-element-ii.py | Python/find-peak-element-ii.py | Python/find-peak-element-ii.py | Python | 0.00137 | @@ -0,0 +1,2257 @@
+# Time: O(max(m, n))%0A# Space: O(1)%0A%0Aclass Solution:%0A #@param A: An list of list integer %0A #@return: The index of position is a list of integer, for example %5B2,2%5D%0A def findPeakII(self, A):%0A upper, down = 0, len(A) - 1%0A left, right = 0, len(A%5B0%5D) - 1%0A%... | |
49882e51faa26dbaa17a5f3510f0ba215b317dac | add simple test | test/simple.py | test/simple.py | Python | 0.000011 | @@ -0,0 +1,1185 @@
+import matplotlib.pyplot as plt%0Aimport numpy%0A%0Anumpy.random.seed(0)%0A%0AN = 1000%0ANe = N * 0.8%0ANi = N - Ne%0A%0Aa = numpy.concatenate((%0A 0.02 * numpy.ones((Ne, 1)),%0A 0.1 * numpy.ones((Ni, 1))%0A))%0Ab = numpy.concatenate((%0A 0.2 * numpy.ones((Ne, 1)),%0A 0.2 * numpy.ones((N... | |
32c5a681c7dd498204d38d5d1152aa7f67e09069 | Add feedback entries to the Admin panel | taiga/feedback/admin.py | taiga/feedback/admin.py | Python | 0 | @@ -0,0 +1,1242 @@
+# Copyright (C) 2014 Andrey Antukh %3Cniwi@niwi.be%3E%0A# Copyright (C) 2014 Jes%C3%BAs Espino %3Cjespinog@gmail.com%3E%0A# Copyright (C) 2014 David Barrag%C3%A1n %3Cbameda@dbarragan.com%3E%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Aff... | |
f68b1a9d5aa2c36f9301588a55bc217a9ed120c1 | Create PowerofThree_001.py | leetcode/326-Power-of-Three/PowerofThree_001.py | leetcode/326-Power-of-Three/PowerofThree_001.py | Python | 0.000002 | @@ -0,0 +1,180 @@
+class Solution(object):%0A def isPowerOfThree(self, n):%0A %22%22%22%0A :type n: int%0A :rtype: bool%0A %22%22%22%0A return n %3E 0 and 3 ** round(math.log(n, 3)) == n%0A
| |
6c00711a5440fe958691c8064227565461e0acdf | add tools for laa analysis | sequana/laa.py | sequana/laa.py | Python | 0 | @@ -0,0 +1,2360 @@
+from sequana import BAM%0Aimport glob%0Aimport pandas as pd%0Aimport pylab%0A%0A%0Aclass LAA():%0A def __init__(self, where=%22bc*%22):%0A self.filenames = glob.glob(where + %22/%22 + %22amplicon_*summary.csv%22)%0A self.data = %5Bpd.read_csv(this) for this in self.filenames%5D%0A%0... | |
bbbe3b7d79d57e350b1203a636b6ea64fe818caa | Update migration chain | src/ggrc/migrations/versions/20160421141928_1257140cbce5_delete_responses_table.py | src/ggrc/migrations/versions/20160421141928_1257140cbce5_delete_responses_table.py | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: peter@reciprocitylabs.com
"""Delete responses table and any other references to responses
Create Date: 20... | Python | 0.000001 | @@ -169,27 +169,22 @@
By:
-dan@reciprocitylabs
+goodson@google
.com
@@ -205,29 +205,22 @@
By:
-peter@reciprocitylabs
+goodson@google
.com
@@ -579,20 +579,20 @@
= '
-33459bd8b70d
+5599d1769f25
'%0A%0A%0A
|
1d3327d8d804a6e53c020e69b77efbea2086379b | Add staging settings file | manchester_traffic_offences/settings/staging.py | manchester_traffic_offences/settings/staging.py | Python | 0 | @@ -0,0 +1,1439 @@
+from .base import *%0Aimport os%0A%0ADEBUG = False%0ATEMPLATE_DEBUG = DEBUG%0A%0AINSTALLED_APPS += ('raven.contrib.django.raven_compat', )%0A%0ARAVEN_CONFIG = %7B%0A 'dsn': os.environ%5B'RAVEN_DSN'%5D,%0A%7D%0A%0ADATABASES = %7B%0A 'default': %7B%0A 'ENGINE': 'django.db.backends.postgre... | |
a79a463624ab8bf62fe54d2392d4768c5a38626a | Add migration for removing challenge from Participant. (#203) | apps/participants/migrations/0003_remove_participant_challenge.py | apps/participants/migrations/0003_remove_participant_challenge.py | Python | 0 | @@ -0,0 +1,425 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.2 on 2016-12-02 14:45%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('participants', '0002_participantteam_participantteammember'... | |
d78b6c8d0efa3c4b29f254b7465e5e6fcb889395 | Initialize P1_multiplicationTable | books/AutomateTheBoringStuffWithPython/Chapter12/PracticeProjects/P1_multiplicationTable.py | books/AutomateTheBoringStuffWithPython/Chapter12/PracticeProjects/P1_multiplicationTable.py | Python | 0.000405 | @@ -0,0 +1,223 @@
+# Create a program multiplicationTable.py that takes a number N from the%0A# command line and creates an N%C3%97N multiplication table in an Excel spreadsheet.%0A# Row 1 and column A should be used for labels and should be in bold.%0A
| |
58cfcfbde61859a98b317f0498f35f7b7921e41b | Add dummy FileBrowseField | mezzanine_grappelli/filebrowser/fields.py | mezzanine_grappelli/filebrowser/fields.py | Python | 0 | @@ -0,0 +1,125 @@
+from filebrowser.fields import FileBrowseField as BaseFileBrowseField%0A%0A%0Aclass FileBrowseField(BaseFileBrowseField):%0A pass%0A
| |
775104979a8ee5be040ac830133e69ca848d1ce1 | add snpPriority.py, LD score and effect size weighted SNP scoring | snpPriority.py | snpPriority.py | Python | 0 | @@ -0,0 +1,2372 @@
+'''%0AsnpPriority.py - score SNPs based on their LD score and SE weighted effect sizes%0A===============================================================================%0A%0A:Author: Mike Morgan%0A:Release: $Id$%0A:Date: %7Ctoday%7C%0A:Tags: Python%0A%0APurpose%0A-------%0A%0A.. Score SNPs based on ... | |
80d579bd9376d955eab4a431fb3bcb493518582a | Create __init__.py | kernel/__init__.py | kernel/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
6deb5c1f2f614e6e6cb420c56c250a27fa032c8b | Add undelete script | bin/undelete.py | bin/undelete.py | Python | 0.000001 | @@ -0,0 +1,2394 @@
+#!/usr/bin/env python%0A%22%22%22%0ARemove the %60deleted%60 tag from containers (recursively) or from individual files.%0A%22%22%22%0Aimport argparse%0Aimport logging%0Aimport sys%0A%0Aimport bson%0A%0Afrom api import config%0Afrom api.dao.containerutil import propagate_changes%0A%0A%0Alog = loggin... | |
d0cb340a874cc0430c8b77a0af052d8f2fd4d8c3 | test script to cache Genewiki content | scheduled_bots/cache/genes/getWDHumanGenes.py | scheduled_bots/cache/genes/getWDHumanGenes.py | Python | 0 | @@ -0,0 +1,676 @@
+from wikidataintegrator import wdi_core%0Aimport pandas as pd%0Afrom rdflib import Graph%0Aimport time%0Aimport sys%0Aquery = %22%22%22%0ASELECT * WHERE %7B%0A ?item wdt:P31 wd:Q7187 ;%0A wdt:P703 wd:Q15978631 .%0A%7D%0A%22%22%22%0Akg = Graph()%0Aresults = wdi_core.WDItemEngine.execute_spar... | |
4f2df78c7d8a9621340ff4ee5cfc6f22548d26d5 | add TracedThread that continues the context propagation | proposal/helpers.py | proposal/helpers.py | Python | 0 | @@ -0,0 +1,912 @@
+%22%22%22Helpers that are used in examples. In the current state, we may not require%0Ato put these classes and functions as part of the main proposal.%0A%22%22%22%0Afrom threading import Thread%0Afrom proposal import tracer%0A%0A%0Aclass TracedThread(Thread):%0A %22%22%22Helper class OpenTracing-... | |
8f1beddb8e3d1a63df10fcde9d3faae0d8d11171 | Add kodi_automation.py | kodi_automation.py | kodi_automation.py | Python | 0.00001 | @@ -0,0 +1,1517 @@
+%0Aimport sys%0Aimport argparse%0A%0A%0Adef Classification(paths):%0A return (%5B%5D, %5B%5D)%0A%0A%0Adef MoveMoveFile(path, movies_dir, dry_run=False):%0A if dry_run:%0A sys.stderr.write('Moving movie', path)%0A return%0A%0A%0Adef MoveEpisodeFile(path, seria, season, episode, series_dir, dr... | |
d1ca3e7363b835aeca7be2fa00cd7083d9fc8c08 | Create divide_by_year.py | pipeline/preprocessing/google/divide_by_year.py | pipeline/preprocessing/google/divide_by_year.py | Python | 0.999031 | @@ -0,0 +1,1543 @@
+import glob%0Aimport gzip%0Aimport codecs%0Aimport re%0Aimport sys%0Aimport os%0A%0Awith_pos = False%0A%0Atargets = %7B%7D%0Amy_buffer = %7B%7D%0A%0Adef flush(a_buffer, some_targets, a_year):%0A for line in a_buffer%5Ba_year%5D:%0A some_targets%5Ba_year%5D.write(line)%0A ... | |
8832a542405a1999c296cc8b55d454b8cf35b5ea | Add merge.py | algorithms/merge.py | algorithms/merge.py | Python | 0.000003 | @@ -0,0 +1,800 @@
+import sys%0A%0Asys.setrecursionlimit(1000000)%0A%0A%0Aclass Merge:%0A def merge_sort(self, lists):%0A if len(lists) %3C= 1:%0A return lists%0A num = len(lists) // 2%0A left = self.merge_sort(lists%5B:num%5D)%0A right = self.merge_sort(lists%5Bnum:%5D)%0A ... | |
85b518638e990cb7be298ea4b533aa465dd681b5 | Add models to store data in... | acctwatch/models.py | acctwatch/models.py | Python | 0 | @@ -0,0 +1,2050 @@
+from sqlalchemy import *%0Afrom sqlalchemy.ext.declarative import declarative_base%0A%0Afrom sqlalchemy.orm import (%0A scoped_session,%0A sessionmaker,%0A relationship,%0A )%0A%0ADBSession = scoped_session(sessionmaker())%0ABase = declarative_base()%0A%0Aclass LoginItem(Base):%0A __t... | |
42e88bc8e6d81916164e8e0fe6b8b6c476567526 | add script to integrate disambiguated results | integrate.py | integrate.py | Python | 0 | @@ -0,0 +1,1348 @@
+#!/usr/bin/env python%0A%22%22%22%0ATakes in a CSV file that represents the output of the disambiguation engine:%0A Patent Number, Firstname, Lastname, Unique_Inventor_ID%0AGroups by Unique_Inventor_ID and then inserts them into the Inventor table using%0Alib.alchemy.match%0A%22%22%22%0A%0Aimport s... | |
80ecafd51cf258880bb5b1e183d5dd166c2d18fc | Add lockrun.py | lockrun.py | lockrun.py | Python | 0.000002 | @@ -0,0 +1,1985 @@
+import optparse%0Aimport signal%0Aimport threading%0Aimport syslog%0Aimport time%0Aimport os%0Aimport re%0A%0A%0Adef find_process(first_pid, process):%0A # Find a process in /proc%0A process = re.sub(%22 +%22, %22 %22, process).strip()%0A m = re.compile(%22%5E%5B0-9%5D+$%22)%0A all_proc ... | |
f87fba419a59513d2356ab8b911dba471b0676ce | mark entity class Parameter explicitly as abstract. | icat/entities.py | icat/entities.py | """Provide the classes corresponding to the entities in the ICAT schema.
Entity classes defined in this module are derived from the abstract
base class :class:`icat.entity.Entity`. They override the class
attributes :attr:`icat.entity.Entity.BeanName`,
:attr:`icat.entity.Entity.Constraint`,
:attr:`icat.entity.Entity.... | Python | 0 | @@ -3282,24 +3282,109 @@
a_attrs = %7B%0A
+ 'Parameter': %5B%0A (None, %7B%0A 'BeanName': None,%0A %7D),%0A %5D,%0A
'DataCol
|
1551cb57ab21364a4e96fa109786ccb0a4ccc3a0 | Create MergeCSVs.py | utils/MergeCSVs.py | utils/MergeCSVs.py | Python | 0 | @@ -0,0 +1,422 @@
+# merge all columns of the csv file in current directory into a single 'merge.csv' file. %0A# requires pandas librairy to be installed.%0A# you can customize the merge in many ways: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.concat.html%0A%0Aimport pandas as pd%0Aimport glob%0A... | |
9b6c1af3420653124495103169865036df4f7705 | Add logging module for Pyro-related debugging | osbrain/logging.py | osbrain/logging.py | Python | 0 | @@ -0,0 +1,96 @@
+import os%0Aos.environ%5B%22PYRO_LOGFILE%22%5D = %22pyro_osbrain.log%22%0Aos.environ%5B%22PYRO_LOGLEVEL%22%5D = %22DEBUG%22%0A
| |
bb188bcc196b12842378aa1c0c535800717a6b61 | add example to extract word frequencies | polbotcheck/word_frequencies.py | polbotcheck/word_frequencies.py | Python | 0.001091 | @@ -0,0 +1,1495 @@
+import nltk%0Afrom nltk.corpus import stopwords%0A%0Adef get_word_frequencies(text, words_n=10, lang='german'):%0A default_stopwords = set(nltk.corpus.stopwords.words(lang))%0A words = nltk.tokenize.word_tokenize(text)%0A words = %5Bword for word in words if len(word) %3E 1%5D%0A words =... | |
20ecbf00c05d1f959e78cbf87cf459fd46dea59f | Create pythonhelloworld.py | pythonhelloworld.py | pythonhelloworld.py | Python | 0.999993 | @@ -0,0 +1,21 @@
+print %22hello world%22 %0A
| |
99a63431e441a1c52d3f16f6faf0594497755d45 | add a new special case install_zstack. It only installs zstack and initalize database, but not do any real cloud deployment | integrationtest/vm/basic/install_zstack.py | integrationtest/vm/basic/install_zstack.py | Python | 0 | @@ -0,0 +1,597 @@
+'''%0D%0A%0D%0A@author: Youyk%0D%0A'''%0D%0A%0D%0Aimport os%0D%0Aimport zstackwoodpecker.setup_actions as setup_actions%0D%0Aimport zstackwoodpecker.test_lib as test_lib%0D%0Aimport zstackwoodpecker.test_util as test_util%0D%0A%0D%0AUSER_PATH = os.path.expanduser('~')%0D%0AEXTRA_SUITE_SETUP_SCRIPT = ... | |
c6ded12845f25e305789840e1687bfee83e82be5 | Add a few simple pytest tests | tests/test_standings.py | tests/test_standings.py | Python | 0 | @@ -0,0 +1,964 @@
+#!/usr/bin/env python%0Aimport pytest%0Afrom datetime import datetime%0Afrom mlbgame import standings%0A%0A%0A%0Adate = datetime(2017, 5, 15, 19, 4, 59, 367187)%0As = standings.Standings(date)%0A%0Adef test_standings_url():%0A standings_url = 'http://mlb.mlb.com/lookup/json/named.standings_schedul... | |
66d3d329674521c8756a8644f2f0a58824a1ec41 | add spider for ups freight | locations/spiders/ups_freight_service_centers.py | locations/spiders/ups_freight_service_centers.py | Python | 0.000001 | @@ -0,0 +1,1776 @@
+# -*- coding: utf-8 -*-%0Aimport re%0A%0Aimport scrapy%0Afrom locations.items import GeojsonPointItem%0A%0A%0Aclass UPSFreightServiceCenter(scrapy.Spider):%0A download_delay = 0.2%0A name = %22ups_freight_service_centers%22%0A allowed_domains = %5B%22upsfreight.com%22%5D%0A start_urls = ... | |
74f5bc8e9abb79a2a394fd0f397ca30af9e83794 | Rework arbitrary arg passing to be consistent with v20 | acos_client/v30/axapi_http.py | acos_client/v30/axapi_http.py | # Copyright 2014, Doug Wiegley, A10 Networks.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 0 | @@ -1663,24 +1663,41 @@
ontent=None,
+ axapi_args=None,
**kwargs):%0A
@@ -1688,32 +1688,32 @@
one, **kwargs):%0A
-
LOG.debu
@@ -1935,20 +1935,22 @@
ms with
-**kw
+axapi_
args for
@@ -1985,26 +1985,16 @@
guration
-%0A #
of obje
@@ -1997,16 +1997,55 @@
objects%0A
+ if axapi_args is not N... |
9311d3d4acd8c67c20d76cc74d00e0f5a83318e6 | add product-of-array-except-self | vol5/product-of-array-except-self/product-of-array-except-self.py | vol5/product-of-array-except-self/product-of-array-except-self.py | Python | 0.999376 | @@ -0,0 +1,432 @@
+class Solution(object):%0A def productExceptSelf(self, nums):%0A %22%22%22%0A :type nums: List%5Bint%5D%0A :rtype: List%5Bint%5D%0A %22%22%22%0A n = len(nums)%0A ret = %5B1%5D * n%0A product = 1%0A for i in range(n):%0A ret%5Bi%5D ... | |
6ae6544cca07e857d680d199b2c2f436cb1d9a82 | add wordpress stats | wordpress_stats.py | wordpress_stats.py | Python | 0.000001 | @@ -0,0 +1,1066 @@
+from utils import *%0D%0Aimport urllib, json%0D%0Aimport time%0D%0Aimport datetime%0D%0A%0D%0Adef dump(blogid,filepath): %0D%0A posts = %5B%5D%0D%0A offset = 0%0D%0A while True:%0D%0A puts(%22offset%22,offset)%0D%0A url = %22https://public-api.wordpress.com/rest/v1/sites/%22 +... | |
e349a43ad33abf0e6cce2a410e0e6cb2342456f1 | No in Python | 2017-05-06/no.py | 2017-05-06/no.py | Python | 0.999311 | @@ -0,0 +1,12 @@
+print('No!')
| |
9cc09c6143025d88eedfa4f8eedcd23e2fe7990e | Create sahilprakash.py | Python/sahilprakash.py | Python/sahilprakash.py | Python | 0.000024 | @@ -0,0 +1,22 @@
+print(%22Hello World!%22)%0A
| |
9cc13ca511987584ea4f52cf0c2e57e6b98a9e8b | Add lc0350_intersection_of_two_arrays_ii.py | lc0350_intersection_of_two_arrays_ii.py | lc0350_intersection_of_two_arrays_ii.py | Python | 0.000351 | @@ -0,0 +1,1025 @@
+%22%22%22Leetcode 350. Intersection of Two Arrays II%0AEasy%0A%0AURL: https://leetcode.com/problems/intersection-of-two-arrays-ii/%0A%0AGiven two arrays, write a function to compute their intersection.%0A%0AExample 1:%0AInput: nums1 = %5B1,2,2,1%5D, nums2 = %5B2,2%5D%0AOutput: %5B2,2%5D%0A%0AExample... | |
eb3882051241843716ef9b7ceef8aeb6ee2a35c6 | add mysqlproxy.py | misc/mysqlproxy.py | misc/mysqlproxy.py | Python | 0.000002 | @@ -0,0 +1,3046 @@
+#!/usr/bin/env python3%0A##############################################################################%0A#The MIT License (MIT)%0A#%0A#Copyright (c) 2016 Hajime Nakagami%0A#%0A#Permission is hereby granted, free of charge, to any person obtaining a copy%0A#of this software and associated documentat... | |
f1c389a0028c6f92300573bef587c084204e858f | Create circlecli.py | mocks/circlecli.py | mocks/circlecli.py | Python | 0 | @@ -0,0 +1,979 @@
+# -*- coding: utf-8 -*-%0A%0A%22%22%22%0AMocks for the CircleCLI API library tests.%0A%0A%22%22%22%0A%0A%0Afrom httmock import response, urlmatch%0A%0ANETLOC = r'(.*%5C.)?circleci%5C.com$'%0AHEADERS = %7B'content-type': 'application/json'%7D%0AGET = 'get'%0A%0A%0Aclass Resource:%0A %22%22%22 A Cir... | |
30359b6e9ec105b2938cedd59127e5fa40964396 | Create setrun.py | rect-shelf/setrun.py | rect-shelf/setrun.py | Python | 0.000001 | @@ -0,0 +1 @@
+%0A
| |
39d2a5eec167e659cd30f5522a9e4e9ca11a620a | Create layoutUVPlus.py | af_scripts/uv/layoutUVPlus.py | af_scripts/uv/layoutUVPlus.py | Python | 0 | @@ -0,0 +1,374 @@
+import pymel.core as pm%0Aimport math%0Asels = pm.ls(sl=1)%0Agap = 0.003%0Afor i, x in enumerate(sels):%0A%09x=x.getShape()%0A%09pm.select('%7B0%7D.map%5B:%5D'.format(x), r=1)%0A%09buv = pm.polyEvaluate(x,b2=1)%0A%09w = abs(buv%5B0%5D%5B1%5D - buv%5B0%5D%5B0%5D)%0A%09if i==0:%0A%09%09pm.polyEditUV(u=... | |
eee6b08e07e60a8ec1f3c2fa2e156344e01737d2 | clean out | avatar/admin.py | avatar/admin.py | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from django.utils import six
from django.template.loader import render_to_string
from avatar.models import Avatar
from avatar.signals import avatar_updated
from avatar.util import get_user_model
class AvatarAdmin(admin.ModelAdmi... | Python | 0.000002 | @@ -815,16 +815,17 @@
g.html',
+
context)
|
2d9300aeefc840e007d7c615ce48ad36343038f2 | Add "--optimize-autoloader" to `composer.phar install` command | php-silex/setup.py | php-silex/setup.py |
import subprocess
import sys
import setup_util
from os.path import expanduser
home = expanduser("~")
def start(args):
setup_util.replace_text("php-silex/web/index.php", "192.168.100.102", "" + args.database_host + "")
setup_util.replace_text("php-silex/deploy/php-silex", "\".*\/FrameworkBenchmarks", "\"" + home ... | Python | 0.000004 | @@ -1,17 +1,16 @@
-%0A
import subproces
@@ -973,16 +973,38 @@
install
+ --optimize-autoloader
%22, shell
|
26011563bf0880206269582a87f9fff61f262c83 | add a new migration | osf/migrations/0056_citationstyle_has_bibliography.py | osf/migrations/0056_citationstyle_has_bibliography.py | Python | 0.000001 | @@ -0,0 +1,465 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.4 on 2017-08-29 14:25%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('osf', '0055_auto_20170823_1648'),%0A %5D%0A%0A ... | |
d637cbe9c904fb0f0b67fbc10f66db299d153f4e | Add basic smoke tests for doc generation | tests/functional/test_docs.py | tests/functional/test_docs.py | Python | 0 | @@ -0,0 +1,1453 @@
+# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22). You%0A# may not use this file except in compliance with the License. A copy of%0A# the License is located at%0A#%0A# http://aws.amazon.com/apache2.0/%... | |
8fb94de6b72847bdb618ffa60fa037d16bab443e | Add closing tests module | tests/plantcv/test_closing.py | tests/plantcv/test_closing.py | Python | 0 | @@ -0,0 +1,868 @@
+import pytest%0Aimport cv2%0Aimport numpy as np%0Afrom plantcv.plantcv import closing%0A%0A%0Adef test_closing(test_data):%0A # Read in test data%0A bin_img = cv2.imread(test_data.small_bin_img, -1)%0A filtered_img = closing(gray_img=bin_img)%0A # Assert that the output image has the dime... | |
548f4f6512ced9a9c41a074a3c8382f87ccafa66 | add image resizing to python script and give it a better name | xkcd1110_stitch.py | xkcd1110_stitch.py | Python | 0.000001 | @@ -0,0 +1,1673 @@
+#! /usr/bin/env python%0A%22%22%22Combines resized tiles grabbed from xkcd 1110 into one large png%22%22%22%0A%0Aimport Image%0Aimport os%0Aimport sys%0A%0Adef coord(image_x, image_y, tilesize):%0A '''%0A converts x, y coordinates to tile naming format%0A '''%0A%0A image_dir = %22images/... | |
c226835aa56a2d5ba8583e63c4b75765cd24711d | add new package (#27971) | var/spack/repos/builtin/packages/py-zipfile-deflate64/package.py | var/spack/repos/builtin/packages/py-zipfile-deflate64/package.py | Python | 0 | @@ -0,0 +1,722 @@
+# 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 PyZipfileDeflate64(PythonPackage):%0A %22%22%22Extract D... | |
8c6646d75ec6f9345e1582c02611984a1d953582 | add reproducing case | tests/trac/test-issue-0092.py | tests/trac/test-issue-0092.py | Python | 0.000141 | @@ -0,0 +1,2173 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0Aimport logging%0Aimport pyxb.binding.generate%0Aimport pyxb.utils.domutils%0Aimport xml.dom.minidom as dom%0A%0A%0Aif __name__ == '__main__':%0A logging.basicConfig()%0A_log = logging.getLogger(__name__)%0A%0Axsd = '''%3C?xml ver... | |
86d8f0fd48ccb577a8300362ea9d181e63d2fa5d | Add unit tests for bandit.core.issue | tests/unit/core/test_issue.py | tests/unit/core/test_issue.py | Python | 0.000001 | @@ -0,0 +1,2288 @@
+# -*- coding:utf-8 -*-%0A#%0A# Copyright 2015 Hewlett-Packard Development Company, L.P.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License at%0A#%0A# http://www... | |
3d935fcc7d2d2afb004348a8839f2ec7813fe78c | Add unbound performance plugin | satori-rules/plugin/unbound/30_unbound.py | satori-rules/plugin/unbound/30_unbound.py | Python | 0 | @@ -0,0 +1,1079 @@
+#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import%0A%0A# -- prioritized --%0Aimport sys%0Aimport os.path%0A# sys.path.append(os.path.join(os.path.dirname(__file__), '../libs'))%0A%0A# -- stdlib --%0Aimport json%0Aimport re%0Aimport socket%0Aimport subprocess%0Aimpo... | |
a0714c8754c769c4fee868f2b449d9dc69d144a9 | Add Welcome plugin to welcome new members | plugins/welcome.py | plugins/welcome.py | Python | 0 | @@ -0,0 +1,1158 @@
+import json%0Afrom plugin import Plugin%0A%0A%0Aclass Welcome(Plugin):%0A %22%22%22%0A Welcomes new members when they join the Slack team%0A %22%22%22%0A%0A def __init__(self):%0A Plugin.__init__(self)%0A self.event_type = 'team_join'%0A%0A def on_event(self, bot, event,... | |
3ce048f8c0346c30173b52a691bd18ece1cbc13d | Add a TensorFlow Probability sample | scripts/stock_price/tough_question_tfp.py | scripts/stock_price/tough_question_tfp.py | Python | 0.000184 | @@ -0,0 +1,1862 @@
+#!/usr/bin/python3%0D%0A# coding: utf-8%0D%0A%0D%0A'''%0D%0AImplementation of the article below with TensorFlow Probability%0D%0A'Bayesian Methods for Hackers'%0D%0Ahttps://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/blob/master/Chapter2_MorePyMC/Ch2_MorePy... | |
e42c115f8a612b3995e30b3606913acb7e7b0f63 | Create 2-off.py | Code/2-off.py | Code/2-off.py | Python | 0.000001 | @@ -0,0 +1,252 @@
+import RPi.GPIO as GPIO%0AGPIO.setmode(GPIO.BCM)%0AGPIO.setwarnings(False)%0AGPIO.setup(18,GPIO.OUT)%0AGPIO.setup(23,GPIO.OUT)%0AGPIO.setup(24,GPIO.OUT)%0Aprint %22Lights off%22%0AGPIO.output(18,GPIO.LOW)%0AGPIO.output(23,GPIO.LOW)%0AGPIO.output(24,GPIO.LOW)%0AGPIO.cleanup()%0A
| |
a2214039defb1094d47b7ce0abc4e56032136508 | Add merge migration | osf/migrations/0137_merge_20181011_1525.py | osf/migrations/0137_merge_20181011_1525.py | Python | 0.000001 | @@ -0,0 +1,349 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.13 on 2018-10-11 15:25%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('osf', '0136_merge_20181010_2242'),%0A ('osf', '0136... | |
1a3b9eec2a947a8f036fdea80a4d7de4b7549211 | Add prime functions library | prime_functions.py | prime_functions.py | Python | 0.000005 | @@ -0,0 +1,770 @@
+import numpy as np%0Afrom math import sqrt%0A%0A%0Adef get_primes_below(n):%0A # http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python/3035188#3035188%0A %22%22%22 Input n%3E=6, Returns a array of primes, 2 %3C= p %3C n %22%22%22%0A sieve = np.ones(n/3 +... | |
451a65d6b5cbc182418f00703e2da84b7c346a70 | Create Dictionary._((glas+python?glaskrypt)) | Dictionary.py | Dictionary.py | Python | 0.00002 | @@ -0,0 +1,803 @@
+#!/usr/bin/env python%0A%0A#%0A# Basic hack%0A#%0A# What?Needed??%0A# Bison like parser for js%0A# _WHY? Because I forget things easily%0A%0Aclass Dict(dict)%0A def __init__(self, keyd, *arguments,**context):%0A self._context = context%0A%0A# Elaborate on that%0Aclass Elaboration(Dict... | |
0ebddf569f291ceca050972fe9cfd3d9e498e87c | add timeout decorator | pyannote/audio/utils/timeout.py | pyannote/audio/utils/timeout.py | Python | 0.000001 | @@ -0,0 +1,1609 @@
+#!/usr/bin/env python%0A# encoding: utf-8%0A%0A# Shamelessly stolen from%0A# https://gist.github.com/TySkby/143190ad1b88c6115597c45f996b030c%0A%0A%22%22%22Easily put time restrictions on things%0A%0ANote: Requires Python 3.x%0A%0AUsage as a context manager:%0A%60%60%60%0Awith timeout(10):%0A some... | |
927a49da0ac7fe633c72f6d08ed93710c1d71630 | Refactor image alias tests to reduce copypasta | pylxd/tests/test_image_alias.py | pylxd/tests/test_image_alias.py | # Copyright (c) 2015 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | Python | 0 | @@ -660,46 +660,8 @@
ock%0A
-import unittest%0A%0Afrom pylxd import api
%0Afro
@@ -763,269 +763,199 @@
api%0A
-%0A%0A@ddt%0Aclass LXDUnitTestAlias(unittest.TestCase):%0A%0A def setUp(self):%0A super(LXDUnitTestAlias, self).setUp()%0A self.lxd = api.API()%0A%0A def test_alias_list(self):%0A ... |
8276553a34c043e316c0ea2c5963c0375336f545 | fix 'done' is not found bug | btc/btclient.py | btc/btclient.py | import re, os
import json, sys
import argparse
import fileinput
import utils
class BTClientError(Exception):
pass
class BTClient:
def __init__(self, decoder, host='127.0.0.1', port=8080, username='admin', password=''):
self.host = host
self.port = port
self.username = username
... | Python | 0.000022 | @@ -4619,18 +4619,24 @@
dict%5B'do
-ne
+wnloaded
'%5D) / to
|
ca0bec705a6c68c7540c9b7f0a02972e1f26723c | Create py-递归设置.py | py-递归设置.py | py-递归设置.py | Python | 0.000001 | @@ -0,0 +1,251 @@
+#!/usr/bin/python%0A# -*- encoding:utf-8 -*-%0Aimport sys%0Asys.setrecursionlimit(1500) # set the maximum depth as 1500%0A%0Adef recursion(n): %0A if(n %3C= 0): %0A return %0A print n %0A recursion(n - 1) %0A%0Aif __name__ == %22__main__%22:%0A recursion(1200)%0A
| |
61419ddc8db5f393bd79d200fc09424721877729 | Change BG color of None state TIs | airflow/utils/state.py | airflow/utils/state.py | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | Python | 0 | @@ -1313,24 +1313,38 @@
QUEUED,%0A
+ NONE,%0A
)%0A%0A d
@@ -1702,24 +1702,51 @@
D: 'white',%0A
+ NONE: 'lightblue',%0A
%7D%0A%0A @
|
ad7d04f73637d6228b82fbb89d51c13844cb1025 | Fix styling of the invites icon | shell/view/frame/ActivitiesBox.py | shell/view/frame/ActivitiesBox.py | # Copyright (C) 2006, Red Hat, Inc.
#
# 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in... | Python | 0 | @@ -1306,26 +1306,85 @@
on()
-,%0A%09%09%09%09%09%09
+)%0A%0A%09%09style.apply_stylesheet(self, 'frame.ActivityIcon')%0A%09%09self.props.
color
-=
+ =
invi
@@ -1397,17 +1397,17 @@
_color()
-)
+%0A
%0A%09%09self.
|
5ade8c78e6ab875047ca29779dc37f9029a9f0d6 | Create set_auth.py | bluemix/set_auth.py | bluemix/set_auth.py | Python | 0.000003 | @@ -0,0 +1,315 @@
+import airflow%0Afrom airflow import models, settings%0Afrom airflow.contrib.auth.backends.password_auth import PasswordUser%0Auser = PasswordUser(models.User())%0Auser.username = 'username'%0Auser.email = 'your@email.com'%0Auser.password = 'pwd'%0Asession = settings.Session()%0Asession.add(user)%0As... | |
cb5b85fc4a011f7eb9628b7099311b399f4d033d | Create born_on_a_friday.py | born_on_a_friday.py | born_on_a_friday.py | Python | 0.000048 | @@ -0,0 +1,511 @@
+#!/usr/bin/env python3%0A%0Afrom datetime import datetime%0Afrom typing import Tuple%0A%0A%0Adef ask_month_day_year(prompt: str = %22Enter your birthday%22) -%3E Tuple%5Bint, int, int%5D:%0A date = input(f%22%7Bprompt%7D in the format: MM/DD/YYYY %22)%0A month, day, year = (int(x.strip()) for x... | |
576dd7270714ec63beab9ce6af22f94e20dc1dd5 | Add admin model classes to forum_tracking app | machina/apps/forum_tracking/admin.py | machina/apps/forum_tracking/admin.py | Python | 0 | @@ -0,0 +1,768 @@
+# -*- coding: utf-8 -*-%0A%0A# Standard library imports%0Afrom __future__ import unicode_literals%0A%0A# Third party imports%0Afrom django.contrib import admin%0A%0A# Local application / specific library imports%0Afrom machina.core.db.models import get_model%0A%0AForumReadTrack = get_model('forum_tra... | |
2f7e3cf34e8460565d572507c2f97b98ac653036 | Allow overriding of DEFAULT_ENV_PREFIX | cbs/__init__.py | cbs/__init__.py |
from functools import partial
import importlib
import inspect
import os
from django.utils import six
from .utils import as_bool
DEFAULT_ENV_PREFIX = ''
class env(object):
'''
Decorator to make environ based settings simpler.
@env
def SOMETHING_KEY(self):
return 'default'
You can ove... | Python | 0.00027 | @@ -881,34 +881,20 @@
prefix=
-DEFAULT_ENV_PREFIX
+None
):%0A
@@ -979,16 +979,83 @@
_name__%0A
+ if prefix is None:%0A prefix = DEFAULT_ENV_PREFIX%0A
|
a59f86ea4905534237f9a1e055bce6a3a3d5fb81 | add migration so edit_messaging is set to True when the role has edit_data set to True | corehq/apps/users/migrations/0037_add_edit_messaging_permission.py | corehq/apps/users/migrations/0037_add_edit_messaging_permission.py | Python | 0.012809 | @@ -0,0 +1,1008 @@
+%0Afrom django.db import migrations%0A%0Afrom corehq.apps.users.models_role import SQLPermission, UserRole%0Afrom corehq.util.django_migrations import skip_on_fresh_install%0A%0A%0A@skip_on_fresh_install%0Adef migrate_edit_migrations_permissions(apps, schema_editor):%0A permission, created = SQLP... | |
72467acd590ae5a3494e5059ce2ba99cf656baaa | Add IsAdminOrReadOnly permission class | registries/permissions.py | registries/permissions.py | Python | 0.000002 | @@ -0,0 +1,387 @@
+from rest_framework.permissions import IsAdminUser, SAFE_METHODS%0A%0Aclass IsAdminOrReadOnly(IsAdminUser):%0A %22%22%22%0A Allows read-only access to all users (including anonymous users) and write access to admin users only%0A %22%22%22%0A%0A def has_permission(self, request, view):%0A ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.