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 |
|---|---|---|---|---|---|---|---|
6e43f611420068f0829fc64c1963ee51931b0099 | change name of data.py | node-interactions.py | node-interactions.py | Python | 0.000016 | @@ -0,0 +1,1420 @@
+import operator%0Afrom os import listdir%0Afrom os.path import isfile, join%0Aimport sys%0A%0Adef get_dict_of_all_contacts():%0A datapath = 'flu-data/moteFiles'%0A datafiles = %5Bf for f in listdir(datapath) if isfile(join(datapath,f)) %5D%0A dict_of_all_contacts = dict()%0A for datafile... | |
0c6becaa179aba9408def1b3cce61d5ec1509942 | Load the simul module and run a simulation | python/main.py | python/main.py | Python | 0 | @@ -0,0 +1,429 @@
+from simul import *%0A%0Aif __name__ == '__main__':%0A # create a new simulation%0A s = Simulation(Re=5)%0A%0A # initial conditions psi(0) = 0, Omega(0) = 0%0A s.psi.initial(%22null%22)%0A s.omega.initial(%22null%22)%0A # T_n(t=0) = sin(pi*k*dz) & T_0(t=0) = 1-k*dz%0A s.T.initial... | |
90169095a9e1adbc23e1efa35ea0e1a9a09259de | Solve Code Fights sortByHeight problem | Problems/sortByHeight.py | Problems/sortByHeight.py | Python | 0.999278 | @@ -0,0 +1,387 @@
+#!/usr/local/bin/python%0A# Code Fights Arcade Mode%0A%0A%0Adef sortByHeight(a):%0A trees = %5Bi for i, t in enumerate(a) if t == -1%5D%0A humans = sorted(%5Bh for h in a if h != -1%5D)%0A for tree in trees:%0A humans.insert(tree, -1)%0A return humans%0A%0A%0Adef main():%0A a =... | |
1a97d686ed5afd9a97083bc09f6c4bfb4ef124fc | Add quick helpers to get a client | helpers.py | helpers.py | Python | 0 | @@ -0,0 +1,518 @@
+from zaqarclient.queues import client%0A%0Aimport os%0A%0Aconf = %7B%0A 'auth_opts': %7B%0A 'backend': 'keystone',%0A 'options': %7B%0A 'os_username': os.environ.get('OS_USERNAME'),%0A 'os_password': os.environ.get('OS_PASSWORD'),%0A 'os_project_name'... | |
7aee3720617aa3442245e2d0bf3de7393e4acb01 | Add lc0133_clone_graph.py | lc0133_clone_graph.py | lc0133_clone_graph.py | Python | 0.000002 | @@ -0,0 +1,1464 @@
+%22%22%22Leetcode 133. Clone Graph%0AMedium%0A%0AURL: https://leetcode.com/problems/clone-graph/%0A%0AGiven a reference of a node in a connected undirected graph, return a deep copy%0A(clone) of the graph. Each node in the graph contains a val (int) and a list%0A(List%5BNode%5D) of its neighbors.%0A... | |
ef63c538aff066230030aaf02981933b652830e4 | Create module_posti.py | pyfibot/modules/module_posti.py | pyfibot/modules/module_posti.py | Python | 0.000001 | @@ -0,0 +1,2454 @@
+# -*- encoding: utf-8 -*-%0A%22%22%22%0AGet package tracking information from the Finnish postal service%0A%22%22%22%0A%0Afrom __future__ import unicode_literals, print_function, division%0Afrom bs4 import BeautifulSoup%0Aimport requests%0Afrom datetime import datetime, timedelta%0A%0Alang = 'en'%0A... | |
fbfdc979b5fbb7534a625db390b92856714dcfe1 | add basic tests for model_utils | pysat/tests/test_model_utils.py | pysat/tests/test_model_utils.py | Python | 0 | @@ -0,0 +1,1337 @@
+import numpy as np%0Aimport sys%0A%0Afrom nose.tools import assert_raises, raises%0Aimport pandas as pds%0A%0Aimport pysat%0Afrom pysat import model_utils as mu%0A%0A%0Aclass TestBasics():%0A def setup(self):%0A %22%22%22Runs before every method to create a clean testing setup.%22%22%22%0A... | |
458a4a3e5759c4ea1e5b33349288012a86d0d97d | revert syntax object instantiation change as it appears to be buggy. use an optional, dedicated value mangling methods instead. | pysnmp/entity/rfc3413/mibvar.py | pysnmp/entity/rfc3413/mibvar.py | # MIB variable pretty printers/parsers
import types
from pyasn1.type import univ
from pysnmp.smi.error import NoSuchObjectError
# Name
def mibNameToOid(mibView, name):
if type(name[0]) == types.TupleType:
modName, symName = apply(lambda x='',y='': (x,y), name[0])
if modName: # load module if neede... | Python | 0 | @@ -2264,17 +2264,13 @@
tax.
-__class__
+clone
(val
|
6cd8b4c733de5a4ed39e3d3ba3d06e78b04dbb4b | read a value from a file that is in ConfigObj format - no section check | python/2.7/read_config_value.py | python/2.7/read_config_value.py | Python | 0 | @@ -0,0 +1,875 @@
+#!/usr/bin/env python%0A%0Afrom configobj import ConfigObj%0Aimport argparse%0Aimport os%0Aimport sys%0A%0Adef read_config(fname, skey):%0A%09config = ConfigObj(fname, raise_errors=True)%0A%09return config%5Bskey%5D%0A%0Adef main():%0A%09parser = argparse.ArgumentParser(description='read a value from... | |
837d1f26ad339fbe4338ef69c947f83042daba9f | add prelim script for looking at incident data | Scripts/fire_incident.py | Scripts/fire_incident.py | Python | 0.000001 | @@ -0,0 +1,458 @@
+#Weinschenk%0A#12-14%0A%0Afrom __future__ import division%0Aimport numpy as np%0Aimport pandas as pd%0Afrom pylab import *%0Afrom matplotlib import rcParams%0ArcParams.update(%7B'figure.autolayout': True%7D)%0A%0Aincident = pd.read_csv('../Data/arlington_incidents.csv', header=0)%0Atotal_incidents = ... | |
ab00f54344e4aa39503a59551e87db2ed4be9c3d | Create print_rectangle.py | python3/print_rectangle.py | python3/print_rectangle.py | Python | 0.001609 | @@ -0,0 +1,168 @@
+while 1:%0A m, n = input().split()# m:height, n:width%0A if m == %220%22 and n == %220%22:%0A breaku%0A for i in range(int(m)):%0A print(%22#%22 * int(n))%0A print()%0A
| |
3897513dcba7b4a94fcacac8c264afadf134ebe5 | Put latency calculations onto the bridge to not have issues related to clock synchronization. | judge/bridge/judgehandler.py | judge/bridge/judgehandler.py | import logging
import json
import threading
import time
from event_socket_server import ZlibPacketHandler
logger = logging.getLogger('judge.bridge')
class JudgeHandler(ZlibPacketHandler):
def __init__(self, server, socket):
super(JudgeHandler, self).__init__(server, socket)
self.handlers = {
... | Python | 0 | @@ -6831,16 +6831,30 @@
atency =
+ time.time() -
packet%5B
@@ -6854,20 +6854,20 @@
packet%5B'
-time
+when
'%5D%0A
|
989a94c81f74a17707e66f126960b6bb45e9b4d5 | Add index to cover testgroup_details (previous runs) | migrations/versions/3042d0ca43bf_index_job_project_id.py | migrations/versions/3042d0ca43bf_index_job_project_id.py | Python | 0 | @@ -0,0 +1,491 @@
+%22%22%22Index Job(project_id, status, date_created) where patch_id IS NULL%0A%0ARevision ID: 3042d0ca43bf%0ARevises: 3a3366fb7822%0ACreate Date: 2014-01-03 15:24:39.947813%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '3042d0ca43bf'%0Adown_revision = '3a3366fb7822'%0A%0Af... | |
b96f39b3527cef7fd9766315fbdf7b87b6315ec8 | add watch file which generated by scratch | src/car_control_manual/scratch/watch_file.py | src/car_control_manual/scratch/watch_file.py | Python | 0 | @@ -0,0 +1,2356 @@
+from __future__ import print_function%0A%0A%22%22%22Watch File generated by Scratch%0A 1. save Scratch file *.sb2 into the same directory or specify with path%0A 2. change name *.sb2 to *.zip%0A 3. unzip *.zip file and read json data from project.json%0A%22%22%22%0A%0A%0Aimport sys, time, l... | |
46b3c0c024dd0d8dbb80911d04848571b3176be7 | add yaml config reader | config.py | config.py | Python | 0 | @@ -0,0 +1,2592 @@
+# -*- coding: utf-8 -*-%0A%0Aimport (os, sys, yaml)%0A%0Aclass Settings(dict):%0A ''' base settings class '''%0A def __init__( self, data = None ):%0A super( Settings, self ).__init__()%0A if data:%0A self.__update( data, %7B%7D )%0A%0A def __update( self, data, did... | |
8b9fe74976d77df32d73792f74ef4ddea1eb525f | Add Config.get() to skip KeyErrors | config.py | config.py | #! /usr/bin/env python
import os
import warnings
import yaml
class Config(object):
config_fname = "configuration.yaml"
def __init__(self, config_fname=None):
config_fname = config_fname or self.config_fname
fo = open(config_fname, "r")
blob = fo.read()
fo.close()
self... | Python | 0 | @@ -639,16 +639,168 @@
rname%5D%0A%0A
+ def get(self, attrname, fallback=None):%0A try:%0A return self.config%5Battrname%5D%0A except KeyError:%0A return fallback%0A%0A
%0A# This
|
7dde102dd51db08f9021234fa3d8f11ab165b210 | add custom_preprocess.py | src/custom_preprocess.py | src/custom_preprocess.py | Python | 0.000001 | @@ -0,0 +1,954 @@
+import unittest%0Aimport csv%0Afrom datetime import datetime, timedelta%0A%0A%0Adef load_raw_data_and_split_by_dt(path, output_dir):%0A base_datetime = datetime.strptime('141021', '%25y%25m%25d')%0A output_file_dict = %7B(base_datetime + timedelta(days=x)).strftime('%25y%25m%25d'): open(%0A ... | |
1f5134b36846cf0e5e936888a4fe51a2012e0d78 | Create alternate_disjoint_set.py (#2302) | data_structures/disjoint_set/alternate_disjoint_set.py | data_structures/disjoint_set/alternate_disjoint_set.py | Python | 0 | @@ -0,0 +1,2192 @@
+%22%22%22%0AImplements a disjoint set using Lists and some added heuristics for efficiency%0AUnion by Rank Heuristic and Path Compression%0A%22%22%22%0A%0A%0Aclass DisjointSet:%0A def __init__(self, set_counts: list) -%3E None:%0A %22%22%22%0A Initialize with a list of the number of... | |
4c53ffbd9b23238b3402752f33fcabb2724921f4 | Add dunder init for lowlevel. | astrodynamics/lowlevel/__init__.py | astrodynamics/lowlevel/__init__.py | Python | 0 | @@ -0,0 +1,81 @@
+# coding: utf-8%0Afrom __future__ import absolute_import, division, print_function%0A
| |
94f922c77ee89a5b54b99e135a5045f450badb0e | add new script to dump nice looking release notes like. Borrowed from antlr. | scripts/github_release_notes.py | scripts/github_release_notes.py | Python | 0 | @@ -0,0 +1,1840 @@
+# Get github issues / PR for a release%0A# Exec with %22python github_release_notes.py YOUR_GITHUB_API_ACCESS_TOKEN 1.19%22%0A%0Aimport sys%0Afrom collections import Counter%0Afrom github import Github%0A%0ATOKEN=sys.argv%5B1%5D%0AMILESTONE=sys.argv%5B2%5D%0Ag = Github(login_or_token=TOKEN)%0A%0A# T... | |
fe08ce77958c637539b24817ffca45587fa31a7e | Implement shared API | platformio/shared.py | platformio/shared.py | Python | 0.00001 | @@ -0,0 +1,1324 @@
+# Copyright (c) 2014-present PlatformIO %3Ccontact@platformio.org%3E%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/... | |
42297354f575e2c82346cf033202c5dfad5ddd99 | Add python class for writing out xyz files of trajectory coordinates | lib/examples/nacl_amb/utils.py | lib/examples/nacl_amb/utils.py | Python | 0.000072 | @@ -0,0 +1,1613 @@
+#!/usr/bin/env python%0Aimport numpy%0A%0Aclass TrajWriter(object):%0A '''%0A A class for writing out trajectory traces as an xyz file, for subsequent%0A visualization.%0A '''%0A def __init__(self, trace, w, filename='trace.xyz'):%0A self.trace = trace%0A self.w = w%0A ... | |
88bd6466940d21d52c0d5235ace10b6a97d69d46 | Create emailtoHIBP.py | emailtoHIBP.py | emailtoHIBP.py | Python | 0 | @@ -0,0 +1,783 @@
+#!/usr/bin/python%0A %0A#EmailtoHIBP.py%0A#Author: Sudhanshu Chauhan - @Sudhanshu_C%0A %0A#This Script will retrieve the Domain(s) at which the specified account has been compromised%0A#It uses the API provided by https://haveibeenpwned.com/%0A#Special Thanks to Troy Hunt - http://www.troyhunt.... | |
084a6c11a6e74af7835502a78028f19db6423265 | simplify byte_unit conversion into a list | src/diamond/collector.py | src/diamond/collector.py | # coding=utf-8
"""
The Collector class is a base class for all metric collectors.
"""
import os
import socket
import platform
import logging
import configobj
import traceback
from diamond.metric import Metric
# Detect the architecture of the system and set the counters for MAX_VALUES
# appropriately. Otherwise, rol... | Python | 0.002396 | @@ -2031,137 +2031,34 @@
-units = self.config%5B'byte_unit'%5D.split()%0A self.config%5B'byte_unit'%5D = %5B%5D%0A for unit in units:%0A
+self.config%5B'byte_unit'%5D =
sel
@@ -2083,19 +2083,14 @@
t'%5D.
-append(un
+spl
it
+(
)%0A%0A
|
450557e0bfb902de862e5fe42868d3fbf7165600 | Add lc0983_minimum_cost_for_tickets.py from Hotel Schulz Berlin | lc0983_minimum_cost_for_tickets.py | lc0983_minimum_cost_for_tickets.py | Python | 0.000001 | @@ -0,0 +1,2024 @@
+%22%22%22Leetcode 983. Minimum Cost For Tickets%0AMedium%0A%0AURL: https://leetcode.com/problems/minimum-cost-for-tickets/%0A%0AIn a country popular for train travel, you have planned some train travelling%0Aone year in advance. The days of the year that you will travel is given as %0Aan array days... | |
a737126f8f8bcac1a00999f9e5c2a23bca9efd0d | Create hamming.py | hamming.py | hamming.py | Python | 0.000001 | @@ -0,0 +1,1337 @@
+#Python Problem 2%0A#hamming.py%0A#Introduction to Bioinformatics Assignment 2%0A#Purpose:Calculate Hamming Distance%0A#Your Name: Michael Thomas%0A#Date: 10/10/15%0A%0A#stores 3 database sequences%0AseqList = %5B%22AGGATACAGCGGCTTCTGCGCGACAAATAAGAGCTCCTTGTAAAGCGCCAAAAAAAGCCTCTCGGTCTGTGGCAGCAGCGTTGG... | |
290239e45b5a4eae88a5c92304b46bf74a04b616 | update Enclosure.mime docstring [skip ci] | mailthon/enclosure.py | mailthon/enclosure.py | """
mailthon.enclosure
~~~~~~~~~~~~~~~~~~
Implements Enclosure objects- parts that collectively
make up body of the email.
:copyright: (c) 2015 by Eeo Jun
:license: MIT, see LICENSE for details.
"""
from email.encoders import encode_base64
from email.message import Message
from email.mime.bas... | Python | 0 | @@ -1221,32 +1221,77 @@
nternal headers.
+ Usually this%0A is not to be overriden.
%0A %22%22%22%0A
|
7b73c957ad52f9b846955b96b7cc6d0938587bb3 | Add 3rd order covariance | src/conventional/cum3est.py | src/conventional/cum3est.py | Python | 0.999372 | @@ -0,0 +1,1993 @@
+#!/usr/bin/env python%0A%0Afrom __future__ import division%0Aimport numpy as np%0Afrom scipy.linalg import hankel%0Aimport scipy.io as sio%0Aimport matplotlib.pyplot as plt%0A%0Afrom tools import *%0A%0A%0Adef cum3est(y, maxlag, nsamp, overlap, flag, k1):%0A %22%22%22%0A UM3EST Third-order cumulan... | |
ded893c34db0c6de521e6d735d6fce30f16f3a51 | Add WSGI file. | noodleamp.wsgi | noodleamp.wsgi | Python | 0 | @@ -0,0 +1,620 @@
+import os%0Aimport pwd%0Aimport sys%0A%0A%0ABASE_DIR = os.path.dirname(os.path.abspath(__file__))%0A%0A%0Adef path(*paths):%0A return os.path.join(BASE_DIR, *paths)%0A%0A%0Aos.environ%5B'NOODLEAMP_CONFIG'%5D = path('settings_local.py')%0A# http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Us... | |
33393fcfcca30edafcf06df53550f4985033c459 | Add numba error module | numba/error.py | numba/error.py | Python | 0 | @@ -0,0 +1,73 @@
+class NumbaError(Exception):%0A %22Some error happened during compilation%22
| |
5784158855eba090c24bb93ece991fba3b1e1a67 | Add never_cache to views | radmin/views.py | radmin/views.py | from django.http import HttpResponse
from django.contrib.admin.views.decorators import staff_member_required
from django.utils import simplejson as json
from radmin.console import REGISTERED_NAMED_ITEMS, REGISTERED_TO_ALL
from radmin.utils import *
@staff_member_required
def entry_point(request):
""" This is the e... | Python | 0 | @@ -146,16 +146,70 @@
as json%0A
+from django.views.decorators.cache import never_cache%0A
from rad
@@ -297,16 +297,29 @@
port *%0A%0A
+@never_cache%0A
@staff_m
@@ -1444,16 +1444,29 @@
json%22)%0A%0A
+@never_cache%0A
@staff_m
|
c1e801798d3b7e8d4c9ba8a11f79ffa92bf182f5 | Add test cases for the logger | test/test_logger.py | test/test_logger.py | Python | 0.000002 | @@ -0,0 +1,1038 @@
+# encoding: utf-8%0A%0A%22%22%22%0A.. codeauthor:: Tsuyoshi Hombashi %3Ctsuyoshi.hombashi@gmail.com%3E%0A%22%22%22%0A%0Afrom __future__ import print_function%0Afrom __future__ import unicode_literals%0A%0Aimport logbook%0Afrom pingparsing import (%0A set_logger,%0A set_log_level,%0A)%0Aimport ... | |
59aa8fbba193e7b9e1e63a146f8d59eefda48dea | Version bump. | mezzanine/__init__.py | mezzanine/__init__.py |
__version__ = "0.8.3"
| Python | 0 | @@ -17,7 +17,7 @@
0.8.
-3
+4
%22%0A
|
c559cdd34a2dc8f3129c1fed5235291f22329368 | install crontab | install_crontab.py | install_crontab.py | Python | 0.000001 | @@ -0,0 +1,665 @@
+#!/usr/bin/python2%0A%0Afrom crontab import CronTab%0Aimport sys%0A%0ACRONTAB_TAG = %22ubuntu-cleanup-annoifier%22%0A%0Adef install_cron():%0A my_cron = CronTab(user=True)%0A %0A# job = my_cron.new(command=executable_path(args))%0A job = my_cron.new(command=%22dummy123%22)%0A job.minu... | |
ca8a7320cbec1d4fa71ec5a7f909908b8765f573 | Allow underscores for release tags (#4976) | test_utils/scripts/circleci/get_tagged_package.py | test_utils/scripts/circleci/get_tagged_package.py | # Copyright 2016 Google LLC
#
# 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, s... | Python | 0 | @@ -818,22 +818,15 @@
z%5D+)
--)*)
+%5B_-%5D)*)
#
@@ -847,16 +847,30 @@
hyphens-
+or-underscores
(empty
|
74e24debf55b003f1d56d35f4b040d91a0698e0a | Add example for cluster centroids method | example/under-sampling/plot_cluster_centroids.py | example/under-sampling/plot_cluster_centroids.py | Python | 0.000001 | @@ -0,0 +1,1905 @@
+%22%22%22%0A=================%0ACluster centroids%0A=================%0A%0AAn illustration of the cluster centroids method.%0A%0A%22%22%22%0A%0Aprint(__doc__)%0A%0Aimport matplotlib.pyplot as plt%0Aimport seaborn as sns%0Asns.set()%0A%0A# Define some color for the plotting%0Aalmost_black = '#262626'... | |
25cd25dab4de9e6963ffa622474b3f0bdcdc1e48 | Create preprocessor.py | interpreter/preprocessor.py | interpreter/preprocessor.py | Python | 0.000006 | @@ -0,0 +1 @@
+%0A
| |
0c1ccd5180601d3ed3f5dc98b3330d40c014f7c0 | Add simul. (#3300) | var/spack/repos/builtin/packages/simul/package.py | var/spack/repos/builtin/packages/simul/package.py | Python | 0.000027 | @@ -0,0 +1,1861 @@
+##############################################################################%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... | |
6cb953dc01a77bc549c53cc325a741d1952ed6b6 | Bump FIDO version to 1.3.12 | fpr/migrations/0025_update_fido_1312.py | fpr/migrations/0025_update_fido_1312.py | Python | 0 | @@ -0,0 +1,1953 @@
+# -*- coding: utf-8 -*-%0A%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0A%0Adef data_migration_up(apps, schema_editor):%0A %22%22%22%0A Update identification tool FIDO to 1.3.12, correcting a%0A character-spacing issue bug identified in PRONOM94 (again... | |
8fa9a54c9a5ee683fc9e9d361a4eb7affe5e83ed | Add functions to paint game of life to screen | game_of_life.py | game_of_life.py | Python | 0 | @@ -0,0 +1,757 @@
+#!/usr/bin/env python%0Afrom curses import wrapper%0Afrom time import sleep%0A%0Adef enumerate_lines(matrix):%0A on = '*'%0A off = ' '%0A for i, row in enumerate(matrix):%0A yield i, ''.join(on if v else off for v in row)%0A%0Adef paint(stdscr, matrix):%0A stdscr.clear()%0A for ... | |
ff8cee4f98dde0533751dfd15308c5fdfdec3982 | test file for rapid iteration | tests/quick_test.py | tests/quick_test.py | Python | 0 | @@ -0,0 +1,1880 @@
+%22%22%22%0Anosetests -sv --nologcapture tests/quick_test.py%0A%22%22%22%0A%0Aimport datetime%0Aimport os%0Aimport random%0Aimport sys%0Asys.path = %5Bos.path.abspath(os.path.dirname(__file__))%5D + sys.path%0Aos.environ%5B'is_test_suite'%5D = 'True'%0Aos.environ%5B'KERAS_BACKEND'%5D = 'theano'%0A%0... | |
c98a744f5f436ae2c6266a7bb5d32173cfd0e4a9 | Add a script that scrapes the Socrata catalog, just in case we need that in another format | scripts/socrata_scraper.py | scripts/socrata_scraper.py | Python | 0 | @@ -0,0 +1,2703 @@
+#!/usr/bin/python3%0A%0A%22%22%22%0AThis is a basic script that downloads the catalog data from the smcgov.org%0Awebsite and pulls out information about all the datasets.%0A%0AThis is in python3%0A%0AThere is an optional download_all argument that will allow you to download%0Aall of the datasets ind... | |
0c11d2740e561586bb4f9d2b67bda2ccc87e146e | Add new command to notify New Relic of deployment | ixdjango/management/commands/newrelic_notify_deploy.py | ixdjango/management/commands/newrelic_notify_deploy.py | Python | 0 | @@ -0,0 +1,1665 @@
+%22%22%22%0AManagement command to enable New Relic notification of deployments%0A%0A.. moduleauthor:: Infoxchange Development Team %3Cdevelopment@infoxchange.net.au%3E%0A%0A%22%22%22%0A%0Aimport pwd%0Aimport os%0Afrom subprocess import Popen, PIPE%0Afrom urllib import urlencode%0A%0Afrom httplib2 im... | |
c0ea919305bcedf080a2213f4c549c68fa4efa2d | test tools | tests/test_tools.py | tests/test_tools.py | Python | 0.000002 | @@ -0,0 +1,974 @@
+import unittest2 as unittest%0Afrom fabric.api import run%0Aimport tempfile%0A%0Afrom mixins import WebServerMixin%0Afrom parcel.tools import dl, rpull, rpush%0A%0Adef tempname():%0A return tempfile.mkstemp()%5B1%5D%0A %0Aimport zlib, os%0A%0Adef crc32(filename):%0A CHUNKSIZE = 8192%0A ch... | |
9de5728e5fdb0f7dc606681df685eb084477d8d0 | Add exercise | multiplyTwoNumbers.py | multiplyTwoNumbers.py | Python | 0.000196 | @@ -0,0 +1,170 @@
+#!/usr/bin/env python%0A%0Adef main():%0A a = input(%22Enter a number: %22)%0A b = input(%22Enter another number: %22)%0A print %22The product of %25d and %25d is %25d%22 %25 (a, b, a * b)%0A%0Amain()%0A
| |
f883edc209928494c45693c5ecfd279bfbb09c97 | Add partfrac1 | timing/partfrac1.py | timing/partfrac1.py | Python | 0.999998 | @@ -0,0 +1,1218 @@
+import time%0Afrom lcapy import *%0A%0Afuncs = %5B1 / s, 1 / s**2, 1 / (s + 3), 1 / (s + 3)**2, (s + 3) / (s + 4),%0A 1 / (s + 3)**2 / (s + 4), 1 / (s + 3)**3 / (s + 4),%0A 1 / (s + 3) / (s + 4) / (s + 5), (s + 6) / (s + 3) / (s + 4) / (s + 5),%0A 1 / (s + 3)**2 / (s + 4)**2,... | |
e71c232660a7480c2b56f6e76e83fad4c7e9da8a | Add ctm_test.py test for testing CRTC's CTM color matrix property. | py/tests/ctm_test.py | py/tests/ctm_test.py | Python | 0 | @@ -0,0 +1,1706 @@
+#!/usr/bin/python3%0A%0Aimport sys%0Aimport pykms%0A%0Adef ctm_to_blob(ctm, card):%0A len=9%0A arr = bytearray(len*8)%0A view = memoryview(arr).cast(%22I%22)%0A%0A for x in range(len):%0A i, d = divmod(ctm%5Bx%5D, 1)%0A if i %3C 0:%0A i = -i%0A sign = ... | |
04477b11bbe7efa1720829691b7d1c3fe2a7a492 | Add __init__ | h2/__init__.py | h2/__init__.py | Python | 0.000917 | @@ -0,0 +1,86 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0Ah2%0A~~%0A%0AA HTTP/2 implementation.%0A%22%22%22%0A__version__ = '0.1.0'%0A
| |
2e2ad49c7ada145b5a4a81bd8941cf5e72d2d81b | Test case for wordaxe bug | rst2pdf/tests/input/test_180.py | rst2pdf/tests/input/test_180.py | Python | 0 | @@ -0,0 +1,661 @@
+# -*- coding: utf-8 -*-%0Afrom reportlab.platypus import SimpleDocTemplate%0Afrom reportlab.platypus.paragraph import Paragraph%0Afrom reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle%0Afrom reportlab.lib.colors import Color%0Afrom reportlab.platypus.flowables import _listWrapOn, _FUZZ... | |
698eee3db238189ba066670c4fe4a1193e6a942a | add flask-login | app/user/loginmanager.py | app/user/loginmanager.py | Python | 0.000001 | @@ -0,0 +1,223 @@
+from flask.ext.login import LoginManager%0Afrom models import User%0A%0Alogin_manager = LoginManager()%0A%0A@login_manager.user_loader%0Adef user_loader(user_id):%0A return User.query.get(user_id)%0A%0Alogin_manager.login_view = '.login'%0A
| |
d5d8e16b5ccbbb65398ce015f020db3839fac409 | add test_rotate.py | tests/transforms_tests/image_tests/test_rotate.py | tests/transforms_tests/image_tests/test_rotate.py | Python | 0.000003 | @@ -0,0 +1,591 @@
+import random%0Aimport unittest%0A%0Aimport numpy as np%0A%0Afrom chainer import testing%0Afrom chainercv.transforms import flip%0Afrom chainercv.transforms import rotate%0A%0A%0Aclass TestRotate(unittest.TestCase):%0A%0A def test_rotate(self):%0A img = np.random.uniform(size=(3, 32, 24))%0... | |
de74c933b74d9066984fe040edf026b7d9f87711 | Split problem statement 2 | 69_split_problem_statement_2.py | 69_split_problem_statement_2.py | Python | 0.99994 | @@ -0,0 +1,780 @@
+'''%0AOpen the file sample.txt and read it line by line.%0AWhen you find a line that starts with 'From:' like the following line:%0A%0A From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008%0A%0AYou will parse the From line using split() and print out the second word in the line%0A(i.e. the entir... | |
01029805a6fb3484cf803f0c0abd18232b4ad810 | Add database tools | egoio/tools/db.py | egoio/tools/db.py | Python | 0.000001 | @@ -0,0 +1,1679 @@
+def grant_db_access(conn, schema, table, role):%0A r%22%22%22Gives access to database users/ groups%0A%0A Parameters%0A ----------%0A conn : sqlalchemy connection object%0A A valid connection to a database%0A schema : str%0A The database schema%0A table : str%0A ... | |
bc9072cee7ce880c30af83ee4c239ae9cf1ddbfe | Create NumberofIslandsII_001.py | lintcode/Number-of-Islands-II/NumberofIslandsII_001.py | lintcode/Number-of-Islands-II/NumberofIslandsII_001.py | Python | 0.000215 | @@ -0,0 +1,1878 @@
+# Definition for a point.%0A# class Point:%0A# def __init__(self, a=0, b=0):%0A# self.x = a%0A# self.y = b%0A%0A%0Aclass UnionFind:%0A def __init__(self, n, m):%0A self.fathers = %7B%7D%0A self.nsets = 0%0A self.grid = %5B%5B0 for _ in range(m)%5D for _ in... | |
1ced3a967742783ef649f7c7defecf333050d547 | Update http_endpoint to use convert_xml() | jenkins_jobs/modules/notifications.py | jenkins_jobs/modules/notifications.py | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Python | 0.000001 | @@ -903,12 +903,14 @@
ML%0A%0A
-from
+import
jen
@@ -923,75 +923,84 @@
obs.
-errors import JenkinsJobsException%0Aimport jenkins_jobs.modules.base
+modules.base%0Afrom jenkins_jobs.modules.helpers import convert_mapping_to_xml
%0A%0A%0Ad
@@ -2002,346 +2002,8 @@
L'%5D%0A
- fmt = data.get('format', 'JSON').upper... |
4856b426b380d4d46cccc2f5b8ab2212956a96c2 | test of time module. not terribly fancy, but it does touch every function and variable in the module, verifies a few return values and even tests a couple of known error conditions. | Lib/test/test_time.py | Lib/test/test_time.py | Python | 0 | @@ -0,0 +1,800 @@
+import time%0A%0Atime.altzone%0Atime.clock()%0At = time.time()%0Atime.asctime(time.gmtime(t))%0Aif time.ctime(t) %3C%3E time.asctime(time.localtime(t)):%0A print 'time.ctime(t) %3C%3E time.asctime(time.localtime(t))'%0A%0Atime.daylight%0Aif int(time.mktime(time.localtime(t))) %3C%3E int(t):%0A ... | |
c851501cc8149685a9e9c023aa200b92c17a9078 | Add decoder ida fields name | pida_fields.py | pida_fields.py | Python | 0.000001 | @@ -0,0 +1,306 @@
+def decode_name_fields(ida_fields):%0A i = -1%0A stop = len(ida_fields)%0A while True:%0A i += 1%0A if i == stop:%0A break%0A%0A count = ord(ida_fields%5Bi%5D) - 1%0A if count == 0:%0A continue%0A%0A i += 1%0A yield ida_fields%5... | |
015c7f7fbab200084cf08bd1f7e35cbcd61b369e | Axonical hello world. | Sketches/PT/helloworld.py | Sketches/PT/helloworld.py | Python | 0.999999 | @@ -0,0 +1,895 @@
+#!/usr/bin/env python%0Aimport time%0Afrom Axon.Component import component%0Afrom Axon.Scheduler import scheduler%0A%0Aclass HelloPusher(component):%0A def main(self):%0A while True:%0A time.sleep(0.5) # normally this would be a bad idea, since the entire scheduler will halt insi... | |
e869c7ef9e3d19da4c98cda57b5e22fb5a35cba5 | Add first basic unittests using py.test | tests/test_validators.py | tests/test_validators.py | Python | 0 | @@ -0,0 +1,2375 @@
+%22%22%22%0A test_validators%0A ~~~~~~~~~~~~~~%0A %0A Unittests for bundled validators.%0A %0A :copyright: 2007-2008 by James Crasta, Thomas Johansson.%0A :license: MIT, see LICENSE.txt for details.%0A%22%22%22%0A%0Afrom py.test import raises%0Afrom wtforms.validators import Val... | |
54c358a296733d2a5236a9a776830f1b78682b73 | Add lc040_combination_sum_ii.py | lc040_combination_sum_ii.py | lc040_combination_sum_ii.py | Python | 0.004345 | @@ -0,0 +1,963 @@
+%22%22%22Leetcode 40. Combination Sum II%0AMedium%0A%0AURL: https://leetcode.com/problems/combination-sum-ii/%0A%0AGiven a collection of candidate numbers (candidates) and a target number (target),%0Afind all unique combinations in candidates where the candidate numbers sums to target.%0A%0AEach numb... | |
7fab8c2d014f013131bd4d6301f5f8e5268d6037 | add leetcode Pow(x, n) | leetcode/powx-n/solution.py | leetcode/powx-n/solution.py | Python | 0.000908 | @@ -0,0 +1,483 @@
+# -*- coding:utf-8 -*-%0Aclass Solution:%0A # @param x, a float%0A # @param n, a integer%0A # @return a float%0A def pow(self, x, n):%0A if n == 0:%0A return 1%0A%0A if n %3C 0:%0A neg_flag = True%0A n = -n%0A else:%0A neg_f... | |
191b7d4edbcd01289242b8f82e0288adfdfc7f23 | call is returning 0 | initHeaders.py | initHeaders.py |
from pyepm import api, config
# ### #!/usr/bin/env python
def main():
api_config = config.read_config()
instance = api.Api(api_config)
from_ = "0x9dc2299a76b68b7ffa9e3ba0fd8cd7646d21d409"
to = "0x824c0d8b9b08a769d237a236af27572ff08ba145"
fun_name = "storeBlockHeader"
sig = "s"
data = '\x0... | Python | 0.998827 | @@ -143,21 +143,32 @@
g)%0A%0A
-from_
+instance.address
= %220x9d
@@ -207,16 +207,17 @@
21d409%22%0A
+%0A
to =
@@ -321,16 +321,17 @@
data =
+%5B
'%5Cx02%5Cx0
@@ -1528,16 +1528,17 @@
x9c%5Cx82'
+%5D
%0A gas
@@ -1541,18 +1541,22 @@
gas = 3
-e6
+000000
%0A gas
@@ -1602,14 +1602,16 @@
o, f
-rom... |
736103ea495c89defcae9bf6ab72aa7b89768026 | add start of advisory module | updatebot/advise.py | updatebot/advise.py | Python | 0 | @@ -0,0 +1,872 @@
+#%0A# Copyright (c) 2008 rPath, Inc.%0A#%0A# This program is distributed under the terms of the Common Public License,%0A# version 1.0. A copy of this license should have been distributed with this%0A# source file in a file called LICENSE. If it is not present, the license%0A# is always available at ... | |
a571271c396cd43fb3f6ac8109ec1f699b0da498 | Use voluptuous for Aruba (#3119) | homeassistant/components/device_tracker/aruba.py | homeassistant/components/device_tracker/aruba.py | """
Support for Aruba Access Points.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.aruba/
"""
import logging
import re
import threading
from datetime import timedelta
from homeassistant.components.device_tracker import DOMAIN
from homeas... | Python | 0 | @@ -243,16 +243,95 @@
edelta%0A%0A
+import voluptuous as vol%0A%0Aimport homeassistant.helpers.config_validation as cv%0A
from hom
@@ -380,16 +380,33 @@
t DOMAIN
+, PLATFORM_SCHEMA
%0Afrom ho
@@ -474,58 +474,8 @@
AME%0A
-from homeassistant.helpers import validate_config%0A
from
@@ -868,311 +868,312 @@
')%0A%0A
-... |
27b9727926139ae2cfde6d3cdcdf5746ed28e03d | Add new package arbor (#11914) | var/spack/repos/builtin/packages/arbor/package.py | var/spack/repos/builtin/packages/arbor/package.py | Python | 0 | @@ -0,0 +1,2693 @@
+# 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 Arbor(CMakePackage):%0A %22%22%22Arbor is a high-perfor... | |
ac851c402952cf44b24dfdf5277765ff286dd994 | convert embeddingns to js-friendly format | src/convert_embeddings_to_js.py | src/convert_embeddings_to_js.py | Python | 0.999997 | @@ -0,0 +1,971 @@
+import h5py%0Aimport json%0Aimport numpy as np%0A%0Adef load_embeddings(path):%0A f = h5py.File(path, 'r')%0A nemb = f%5B'nemb'%5D%5B:%5D%0A f.close()%0A return nemb%0A%0Adef load_vocab(path):%0A vocab = %5B%5D%0A with open(path, 'rb') as f:%0A for line in f.readlines():%0A split = line... | |
11efa5583bbeeee7c7823264f6f73715ea81edc0 | Add trivial test for ECO fetching | luigi/tests/ontologies/eco_test.py | luigi/tests/ontologies/eco_test.py | Python | 0.000002 | @@ -0,0 +1,804 @@
+# -*- coding: utf-8 -*-%0A%0A%22%22%22%0ACopyright %5B2009-2017%5D EMBL-European Bioinformatics Institute%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0Ahttp://www.apa... | |
ec3b080b2f1922f4989b853db45475d185e314de | add all | examples/gcharttestapp/TestGChart00.py | examples/gcharttestapp/TestGChart00.py | Python | 0.000308 | @@ -0,0 +1,400 @@
+%0Aimport GChartTestAppUtil%0Afrom pyjamas.chart.GChart import GChart%0A%0A%0A%22%22%22* Empty chart without anything on it except a title and footnotes %22%22%22%0Aclass TestGChart00 (GChart):%0A def __init__(self):%0A GChart.__init__(self, 150,150)%0A self.setChartTitle(GChartTestA... | |
4fdba8a1a5a2123843cc9eefd8949fb8996f59b2 | Add a wrapper for ChromeOS to call into telemetry. | telemetry/telemetry/unittest/run_chromeos_tests.py | telemetry/telemetry/unittest/run_chromeos_tests.py | Python | 0.000003 | @@ -0,0 +1,2269 @@
+# Copyright 2014 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.%0Aimport logging%0Aimport os%0Aimport sys%0A%0Afrom telemetry.unittest import gtest_progress_reporter%0Afrom telemetry.unittest import... | |
fcce65daf40bb1c198be7ddadee8769bf6feea9b | Create k-order-test.py | k-order-test.py | k-order-test.py | Python | 0.000032 | @@ -0,0 +1,2086 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated on Thu Mar 6 16:41:40 2014%0A%0A@author: xiao%0A%22%22%22%0A%0Afrom k_order import *%0A#number of items to recommand%0Ap=2%0Afadress = %22/home/xiao/ProjetLibre/matrix/matrixInfo%22%0A%0AreadDataFromFile(fadress)%0AgetDu()%0ArecommendationListe = zeros(... | |
d73235dd994d3705178d0cff142293444977d764 | Remove bad imports | odo/backends/tests/conftest.py | odo/backends/tests/conftest.py | import os
import shutil
import pytest
@pytest.fixture(scope='session')
def sc():
pytest.importorskip('pyspark')
from pyspark import SparkContext
return SparkContext('local[*]', 'odo')
@pytest.yield_fixture(scope='session')
def sqlctx(sc):
pytest.importorskip('pyspark')
from odo.backends.sparksql... | Python | 0.000015 | @@ -75,24 +75,34 @@
ef sc():%0A
+ pyspark =
pytest.impo
@@ -129,20 +129,22 @@
-from
+return
pyspark
imp
@@ -143,40 +143,9 @@
park
- import SparkContext%0A return
+.
Spar
@@ -232,16 +232,26 @@
sc):%0A
+ pyspark =
pytest.
@@ -278,154 +278,44 @@
k')%0A
- from odo.backends.sparksql import Hi... |
4c5a8f018af4377ce3f9367b0c66a51a6cad671b | add __init__.py | eatable/__init__.py | eatable/__init__.py | Python | 0.00212 | @@ -0,0 +1,47 @@
+%0Afrom .table import Table%0Afrom .row import Row%0A
| |
2b15d2df8333db5f5cd6fcefaf56f5400baba95e | add test_results_table.py | metaseq/test/test_results_table.py | metaseq/test/test_results_table.py | Python | 0.000104 | @@ -0,0 +1,734 @@
+from metaseq import results_table%0Aimport metaseq%0Aimport numpy as np%0A%0Afn = metaseq.example_filename('ex.deseq')%0Ad = results_table.ResultsTable(fn)%0A%0A%0Adef test_dataframe_access():%0A%0A # different ways of accessing get the same data in memory%0A assert d.id is d.data.id%0A asse... | |
2382c1c9daf2b17799ceb03f42a6917966b3162c | add kattis/cold | Kattis/cold.py | Kattis/cold.py | Python | 0.999545 | @@ -0,0 +1,224 @@
+%22%22%22%0D%0AProblem: cold%0D%0ALink: https://open.kattis.com/problems/cold %0D%0ASource: Kattis%0D%0A%22%22%22%0D%0AN = int(input())%0D%0AA = list(map(int, input().split()))%0D%0A%0D%0Aanswer = 0%0D%0Afor i in range(len(A)):%0D%0A answer += (A%5Bi%5D %3C 0)%0D%0A%0D%0Aprint(answer)%0D%0A
| |
652a03d96cbc5c06850fa62fa3507fb74ee3deab | Create python_ciphertext.py | Encryption/python_ciphertext.py | Encryption/python_ciphertext.py | Python | 0.999975 | @@ -0,0 +1,369 @@
+#Simply how to make a ciphertext only with 1 line.%0A%0A%3E%3E%3E #hex_encode = 'summonagus'.encode('hex')%0A%3E%3E%3E hex_encode = '73756d6d6f6e61677573'%0A%3E%3E%3E chip = ''.join(%5B str(int(a)*2) if a.isdigit() and int(a) == 3 else str(int(a)/2) if a.isdigit() and int(a) == 6 else a for a in hex... | |
8add0d44139b527d40aaa9da43d023ddde52c410 | Add string python solution | HackerRank/PYTHON/Strings/alphabet_rangoli.py | HackerRank/PYTHON/Strings/alphabet_rangoli.py | Python | 0.999999 | @@ -0,0 +1,628 @@
+#!/usr/bin/env python3%0A%0Aimport sys%0Afrom string import ascii_lowercase%0A%0Adef print_rangoli(size):%0A width = size * 4 - 3%0A alphabet = (ascii_lowercase%5B0:size%5D)%5B::-1%5D%0A res = %5B%5D%0A for i in range(size):%0A s = ''%0A for a in alphabet%5B0:i+1%5D:%0A ... | |
eac74d731b01f732d23ce21e8132fa0785aa1ab2 | Create visible_elements.py | visible_elements.py | visible_elements.py | Python | 0.000003 | @@ -0,0 +1,968 @@
+# -*- coding: utf-8 -*-%0Aimport unittest%0Afrom selenium import webdriver%0Afrom selenium.webdriver.support.wait import WebDriverWait%0Afrom selenium.webdriver.common.by import By%0A%0Aclass visible_elements(unittest.TestCase):%0A%0A def setUp(self):%0A self.driver = webdriver.Chrome(%22C:... | |
eaa45d8a9a8cd26379ea7bd3bcee99cbab08d9e7 | Remove hdf5 ~cxx constraint on netcdf | var/spack/repos/builtin/packages/netcdf/package.py | var/spack/repos/builtin/packages/netcdf/package.py | from spack import *
class Netcdf(Package):
"""NetCDF is a set of software libraries and self-describing, machine-independent
data formats that support the creation, access, and sharing of array-oriented
scientific data."""
homepage = "http://www.unidata.ucar.edu/software/netcdf"
url = "ftp:/... | Python | 0.000001 | @@ -501,16 +501,17 @@
t('mpi',
+
default
@@ -516,16 +516,17 @@
lt=True,
+
descrip
@@ -576,19 +576,16 @@
('hdf4',
-
default
@@ -604,17 +604,17 @@
ription=
-%22
+'
Enable H
@@ -628,82 +628,32 @@
port
-%22
+'
)%0A%0A
-# Dependencies:%0A depends_on(%22curl%22) # required for DAP support
+depends_o... |
5343c89686fd05cf251388e1f28bfd4343d4c277 | Add python-based CPU implementation | src/CPU/color_histogram.py | src/CPU/color_histogram.py | Python | 0.000074 | @@ -0,0 +1,188 @@
+from PIL import Image%0Afrom collections import defaultdict%0Aimport sys%0A%0Aim = Image.open(sys.argv%5B1%5D)%0Acolors = defaultdict(int)%0Afor pixel in im.getdata():%0A colors%5Bpixel%5D += 1%0Aprint colors%0A
| |
f408465521484032631adfe9dced21119ad2bf82 | Revert "Delete old MultiServer implementation" | MultiServer.py | MultiServer.py | Python | 0 | @@ -0,0 +1,421 @@
+from multiprocessing import Process%0Aimport subprocess%0Aimport GlobalVars%0A%0A%0Adef botInstance(server, channels):%0A args = %5B%22python%22, %22hubbebot.py%22%5D%0A args.append(server)%0A for chan in channels:%0A args.append(chan)%0A subprocess.call(args)%0A%0A%0Aif __name__ =... | |
2ef9618e705bb293641674ca5e7cc1f14daf3483 | Set default branding for all organisations | migrations/versions/0285_default_org_branding.py | migrations/versions/0285_default_org_branding.py | Python | 0 | @@ -0,0 +1,1116 @@
+%22%22%22empty message%0A%0ARevision ID: 0285_default_org_branding%0ARevises: 0284_0283_retry%0ACreate Date: 2016-10-25 17:37:27.660723%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '0285_default_org_branding'%0Adown_revision = '0284_0283_retry'%0A%0Afrom alembic import o... | |
52b870d36370f46fdc33de2948504c2aec8db1a1 | fix field names in network object | planetstack/core/migrations/0002_network_field_case.py | planetstack/core/migrations/0002_network_field_case.py | Python | 0.000003 | @@ -0,0 +1,1095 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0Aimport timezones.fields%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('core', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migra... | |
9b584c6d23ad93fd497fb2e71d2343a954cea4e5 | Create PaulFinalproject.py | PaulFinalproject.py | PaulFinalproject.py | Python | 0 | @@ -0,0 +1 @@
+%0A
| |
8462466f8a21f25f85b8a06076877361b2545a12 | Add initialize script | PyResis/__init__.py | PyResis/__init__.py | Python | 0.000002 | @@ -0,0 +1,22 @@
+__author__ = 'Yu Cao'%0A
| |
8fcc727f9a7fbd886bc900f9c24cf2711a0c5b99 | Create Record.py | Record.py | Record.py | Python | 0.000001 | @@ -0,0 +1,1730 @@
+%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... | |
0bbddd9b3708c167a4ce75c3cccdc5c1804714ed | fix for issue #8 | aclgen.py | aclgen.py | #!/usr/bin/env python
#
# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python | 0 | @@ -1997,16 +1997,25 @@
%25s%25s' %25
+(%22.%22.join
(os.path
@@ -2048,17 +2048,21 @@
t('.')%5B0
-%5D
+:-1%5D)
, pol_su
|
1708eb17fb9c232414b0e162754ca31b6fd9366c | Add tests for plagiarism filter command | services/comprehension/main-api/comprehension/tests/management/commands/test_pre_filter_responses.py | services/comprehension/main-api/comprehension/tests/management/commands/test_pre_filter_responses.py | Python | 0 | @@ -0,0 +1,2336 @@
+import csv%0A%0Afrom io import StringIO%0Afrom unittest.mock import call, MagicMock, patch%0A%0Afrom django.test import TestCase%0A%0Afrom ....views.plagiarism import PlagiarismFeedbackView%0Afrom ....management.commands import pre_filter_responses%0A%0ACommand = pre_filter_responses.Command%0A%0A%0... | |
06ced5abe2226a234c2e2887fbf84f18dfa7ddc4 | Update timer for new label. Clean up a bit and use more pyglet 1.1 features. | examples/timer.py | examples/timer.py | from pyglet import window
from pyglet import text
from pyglet import clock
from pyglet import font
w = window.Window(fullscreen=True)
class Timer(text.Label):
def stop(self):
self.__time = 0
def reset(self):
self.__time = 0
self.__running = False
self.text = '00:00'
def ani... | Python | 0 | @@ -1,108 +1,284 @@
-from pyglet impor
+'''A full-screen minute:second timer. Leave i
t
-w
in
-dow%0Afrom pyglet import text%0Afrom pyglet import clock%0Afrom pyglet import font%0A%0Aw =
+ charge of your conference%0Alighting talks.%0A%0AAfter 5 minutes, the timer goes red. This limit is easily adjustable by%0Aha... |
064c1a5bd8790c9ea407f62de0428657354e979f | Create jcolor.py | jcolor.py | jcolor.py | Python | 0.000001 | @@ -0,0 +1,729 @@
+# colors%0AHEADER = '%5C033%5B95m'%0AFAIL = '%5C033%5B91m'%0AFGBLUE2 = '%5C033%5B94m'%0AFGGREEN2 = '%5C033%5B92m'%0AFGORANGE = '%5C033%5B93m'%0AFGGRAY = '%5C033%5B30m'%0AFGRED = '%5C033%5B31m'%0AFGGREEN = '%5C033%5B32m'%0AFGYELLOW = '%5C033%5B33m'%0AFGBLUE = '%5C033%5B34m'%0AFGMAG = '%5C033%5B35m'%0A... | |
040911e2343ec6753c767eff44be2cf54eb33ff8 | add file name to fasta sequence headers | add_file_name_to_reads.py | add_file_name_to_reads.py | Python | 0 | @@ -0,0 +1,300 @@
+import os%0Aimport sys%0Afrom Bio import SeqIO%0A%0Aout = open(sys.argv%5B2%5D, 'w')%0Afor records in SeqIO.parse(open(sys.argv%5B1%5D, 'rU'), %22fasta%22):%0A%09records.id = records.id.strip() + '%25s' %25 sys.argv%5B1%5D.split('.')%5B0%5D%0A%09records.name = records.id%0A%09records.description = re... | |
c420f6bf996c53fa8958956626c136ac0e9e55f6 | Add sonos updater plugin. | beetsplug/sonosupdate.py | beetsplug/sonosupdate.py | Python | 0 | @@ -0,0 +1,1938 @@
+# -*- coding: utf-8 -*-%0A# This file is part of beets.%0A# Copyright 2018, Tobias Sauerwein.%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining%0A# a copy of this software and associated documentation files (the%0A# %22Software%22), to deal in the Software without restric... | |
797114781ed4f31c265c58a76e39aa8ff6a16443 | Add missing file from last commit | tensorpack/utils/compatible_serialize.py | tensorpack/utils/compatible_serialize.py | Python | 0.000001 | @@ -0,0 +1,548 @@
+#!/usr/bin/env python%0A%0Aimport os%0Afrom .serialize import loads_msgpack, loads_pyarrow, dumps_msgpack, dumps_pyarrow%0A%0A%22%22%22%0ASerialization that has compatibility guarantee (therefore is safe to store to disk).%0A%22%22%22%0A%0A__all__ = %5B'loads', 'dumps'%5D%0A%0A%0A# pyarrow has no com... | |
2f155e1dafd5302dfbf4607af81bfa979046be8e | add test file | junk/t.py | junk/t.py | Python | 0.000001 | @@ -0,0 +1,28 @@
+def f():%0A print %22hi%22%0A%0Af()
| |
cfb39d7389d63a293dc075d420f80276a34df193 | Add minimal pygstc example to play a video | examples/pygstc/simple_pipeline.py | examples/pygstc/simple_pipeline.py | Python | 0 | @@ -0,0 +1,1557 @@
+import time%0Aimport sys%0Afrom pygstc.gstc import *%0Afrom pygstc.logger import *%0A%0A#Create a custom logger with loglevel=DEBUG%0Agstd_logger = CustomLogger('simple_pipeline', loglevel='DEBUG')%0A%0A#Create the client with the logger%0Agstd_client = GstdClient(logger=gstd_logger)%0A%0Adef printE... | |
f8d06f85e896c1098f58667c161d920f6d255d7b | Add utility for sent mail | sendmail/log_mail.py | sendmail/log_mail.py | Python | 0 | @@ -0,0 +1,1703 @@
+# -*- coding: utf-8 -*-%0A###############################################################################%0A#%0A# Copyright (C) 2001-2014 Micronaet SRL (%3Chttp://www.micronaet.it%3E).%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the... | |
ddac657da2743c7435e8408677406d37eaea5836 | Add migration. | instance/migrations/0041_auto_20160420_1409.py | instance/migrations/0041_auto_20160420_1409.py | Python | 0 | @@ -0,0 +1,1137 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('instance', '0040_auto_20160420_0754'),%0A %5D%0A%0A operations = %5B%0A migrations.Alter... | |
4c6964a6043c6c5bb3df7ad184e2c6a5537ca6da | Create __init__.py | intelmq/tests/bots/experts/fqdn2ip/__init__.py | intelmq/tests/bots/experts/fqdn2ip/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
ce5ca3ac3268af331150f66865072a049869b3b2 | add abstraction magics | abstraction.py | abstraction.py | Python | 0.000088 | @@ -0,0 +1,1153 @@
+%22%22%22%0Aabstraction magics%0A%0Alet's you turn a cell into a function%0A%0AIn %5B1%5D: plot(x, f(y))%0A ...: xlabel('x')%0A ...: ylabel('y')%0A%0AIn %5B2%5D: %25functionize 1%0A%22%22%22%0Afrom IPython.utils.text import indent%0A%0Adef parse_ranges(s):%0A blocks = s.split(',')%0A range... | |
9af5c4e79234a47ac26e5d1890e70f741363b18a | Create factorise_test.py | factorise_test.py | factorise_test.py | Python | 0.000001 | @@ -0,0 +1 @@
+%0A
| |
425a8e26d371038f6ebf7c80dd7faea0f1dd906e | Add base test for admin endpoints [WAL-883] | nodeconductor/core/tests/unittests/test_admin.py | nodeconductor/core/tests/unittests/test_admin.py | Python | 0 | @@ -0,0 +1,1918 @@
+from django.contrib import admin%0Afrom django.contrib.auth import get_user_model%0Afrom django.test import TestCase%0Afrom django.urls import reverse%0A%0A%0AUser = get_user_model()%0A%0A%0Aclass TestAdminEndpoints(TestCase):%0A%0A def setUp(self):%0A user, _ = User.objects.get_or_create(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.