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 |
|---|---|---|---|---|---|---|---|
ab0868b777101a8442cec80009b84b40e79a3a08 | add a sample script | decode.py | decode.py | Python | 0.000001 | @@ -0,0 +1,505 @@
+%22%22%22Command-line tool to decode audio files to raw PCM.%22%22%22%0Aimport audioread%0Aimport sys%0Aimport os%0A%0Adef decode(filename):%0A filename = os.path.abspath(os.path.expanduser(filename))%0A with audioread.audio_open(filename) as f:%0A print 'Input file: %25i channels at %25... | |
51055b6fbd81ffc88215b88f9a63d702535bdd93 | Add missing file | jobslave/job_data.py | jobslave/job_data.py | Python | 0.000006 | @@ -0,0 +1,1043 @@
+#%0A# Copyright (c) 2011 rPath, Inc.%0A#%0A%0A%0ABUILD_DEFAULTS = %7B%0A 'autoResolve': False,%0A 'maxIsoSize': '681574400',%0A 'bugsUrl': 'http://issues.rpath.com/',%0A 'natNetworking': False,%0A 'vhdDiskType': 'dynamic',%0A 'anacondaCustomTrove': '',%0A ... | |
41cc4d54d5eddcf30e2c9a98179ff1e745a12f90 | Add missing migration | core/migrations/0009_wagtail112upgrade.py | core/migrations/0009_wagtail112upgrade.py | Python | 0.000001 | @@ -0,0 +1,833 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.7 on 2017-11-21 23:14%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('core', '0008_wagtailcompanypage_sites_ordering'),%0... | |
896132d9068ed736587047e7a4501f49d7a1bffd | Update test helpers | test/selenium/src/lib/test_helpers.py | test/selenium/src/lib/test_helpers.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: jernej@reciprocitylabs.com
# Maintained By: jernej@reciprocitylabs.com
"""
Utility classes for page objects used in tests.
Details:
Most of the te... | Python | 0.000001 | @@ -799,16 +799,17 @@
by html%0A
+%0A
Args
@@ -825,16 +825,27 @@
ext (str
+ or unicode
)%0A %22%22
@@ -899,23 +899,23 @@
ModalNew
-Program
+Control
Page(bas
@@ -1119,57 +1119,93 @@
new_
-program.EditProgramModal)%0A %22%22%22%0A unique_id =
+control.NewControlModal)%0A %22%22%22%0A modal.enter... |
9bc05db6bc3b6b2570c8e37d528639c310a6f162 | Add login required decorator | pybossa_analyst/login.py | pybossa_analyst/login.py | Python | 0.000001 | @@ -0,0 +1,365 @@
+# -*- coding: utf8 -*-%0A%0Afrom functools import wraps%0Afrom flask import session, request, redirect, url_for%0A%0A%0Adef login_required(f):%0A @wraps(f)%0A def decorated_function(*args, **kwargs):%0A if session.get('api_key') is None:%0A return redirect(url_for('home.login'... | |
24bdb8217a921f3f1833a8e9c1bcd7cc1615ea9b | add mgmt command to migrate testruns between projects | squad/core/management/commands/migrate_test_runs.py | squad/core/management/commands/migrate_test_runs.py | Python | 0.005135 | @@ -0,0 +1,3495 @@
+import sys%0Afrom django.core.exceptions import ObjectDoesNotExist%0Afrom django.core.management.base import BaseCommand%0A%0Afrom squad.core.models import Project, Build, Environment%0Afrom squad.core.tasks import UpdateProjectStatus%0A%0A%0Aclass Command(BaseCommand):%0A%0A help = %22%22%22Move... | |
0b09eeede5f8a1533c166fe97844834ceb2ee178 | remove some hard-coded paths | autoload/nimrod_vim.py | autoload/nimrod_vim.py | import threading, Queue, subprocess, signal, os
try:
import vim
except ImportError:
class Vim:
def command(self, x):
print("Executing vim command: " + x)
vim = Vim()
def disable_sigint():
# Ignore the SIGINT signal by setting the handler to the standard
# signal handler SIG_IGN.
signal.signal... | Python | 0.999058 | @@ -399,24 +399,38 @@
_init__(self
+, project_path
):%0A super
@@ -614,20 +614,20 @@
n%22,
-%22nimrod.nim%22
+project_path
%5D,%0A
@@ -642,45 +642,37 @@
d =
-%22/Users/zahary/Projects/nim/compiler%22
+os.path.dirname(project_path)
,%0A
@@ -1978,16 +1978,23 @@
mThread(
+project
)%0A pr
|
0ba2b5f63aeb39a1d1faf6d0f9eb2626bcc86d3e | Create urls.py | urls.py | urls.py | Python | 0.000017 | @@ -0,0 +1,331 @@
+from django.conf.urls import url%0Afrom django.contrib import admin%0Afrom django.conf.urls.static import static%0Afrom django.conf import settings%0Afrom likes import *%0A%0Aurlpatterns = %5B%0A url(r'%5Eadmin/', admin.site.urls),%0A url(r'%5E$', index),%0A url(r'%5Elike', uri_manager, name... | |
5f7dfe4b83f318cc712bc1a7ed955d6c6374f7f5 | Create es4_windows.py | 04-work-with-multiple-windows/python/es4_windows.py | 04-work-with-multiple-windows/python/es4_windows.py | Python | 0.000001 | @@ -0,0 +1,1360 @@
+# http://elementalselenium.com/tips/4-work-with-multiple-windows%0Aimport os%0Aimport unittest%0Afrom selenium import webdriver%0Afrom selenium.webdriver.common.keys import Keys # for send_keys%0A%0Aclass ES4_Windows(unittest.TestCase):%0A %0A def setUp(self):%0A self.driver = webdriver... | |
8c0612232a79c55b3c58a6230f590e5d6d4e36f9 | Implement taking info parser | backend/core/parser.py | backend/core/parser.py | Python | 0.000006 | @@ -0,0 +1,1227 @@
+def parse_credit(text):%0A semester_name = %7B%0A 'U000200001U000300001': '1',%0A 'U000200001U000300002': 'S',%0A 'U000200002U000300001': '2',%0A 'U000200002U000300002': 'W',%0A %7D%0A lines = text.split('%5Cn')%5B:-1%5D%0A columns = %5B%5D%0A infos = %5B%5... | |
8e16ac329d459d11b971216b0eab032e81b5557e | Add flowline benchmarks (#489) | benchmarks/flowline.py | benchmarks/flowline.py | Python | 0 | @@ -0,0 +1,2216 @@
+# Write the benchmarking functions here.%0A# See %22Writing benchmarks%22 in the asv docs for more information.%0Aimport os%0Aimport shutil%0Aimport numpy as np%0Aimport oggm%0Afrom oggm.tests.funcs import init_hef, get_test_dir%0Afrom oggm import utils, tasks%0Afrom oggm.core import massbalance, fl... | |
59c173bf4179fc77eacf97f3f08359498d35a635 | Add switch class for good utility | util.py | util.py | Python | 0 | @@ -0,0 +1,653 @@
+# coding=utf-8%0A%22%22%22%0AThe switch class refers to PEP 275 (Marc-Andr%C3%A9 Lemburg %3Cmal at lemburg.com%3E)%0A(https://www.python.org/dev/peps/pep-0275/)%0A%0A%22%22%22%0Aclass switch(object):%0A def __init__(self,value):%0A self.value = value%0A self.fall = False%0A%0A def... | |
ef5260a53773bdc024702ca804b128ba9b12698b | 566. Reshape the Matrix. C matrix | p566_c_matrix.py | p566_c_matrix.py | Python | 0.999999 | @@ -0,0 +1,1049 @@
+import unittest%0A%0A%0Aclass Solution(object):%0A def matrixReshape(self, nums, r, c):%0A %22%22%22%0A :type nums: List%5BList%5Bint%5D%5D%0A :type r: int%0A :type c: int%0A :rtype: List%5BList%5Bint%5D%5D%0A %22%22%22%0A if not nums or len(nums) ... | |
3cb47114dc40ebbbcc946c79946ec59813a7af7f | add email module | emails.py | emails.py | Python | 0.000006 | @@ -0,0 +1,885 @@
+import smtplib%0A%0Afrom config import MAIL_SERVER%0Afrom config import MAIL_PORT%0Afrom config import MAIL_USERNAME%0Afrom config import MAIL_PASSWORD%0Afrom config import DEFAULT_MAIL_SENDER%0A%0A%0Adef send_email(recipient, subject, body, sender=None):%0A%0A if sender is None:%0A FROM = ... | |
c08ebde007b0c57780d8d63c1f925c1d6a8bfc7c | Append 'grpc' to the C++ service namespaces for google APIs | third_party/googleapis/build_rules.bzl | third_party/googleapis/build_rules.bzl | # Copyright 2020 The TensorFlow Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | Python | 0.000021 | @@ -1835,16 +1835,44 @@
s, deps,
+ service_namespace = %22grpc%22,
**kwarg
@@ -2477,16 +2477,100 @@
= srcs,%0A
+ flags = %5B%0A %22services_namespace=%22 + service_namespace,%0A %5D,%0A
|
f301aa5ecdc3f9d821a72bb6a03d9857c43e72fc | add missing file | app/fields/auth.py | app/fields/auth.py | Python | 0.000003 | @@ -0,0 +1,308 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0Afrom flask_restplus import fields%0Afrom app import api%0A%0Aauth_fields_get = api.model('AuthGet', %7B 'access_token': fields.String %7D)%0Aauth_fields_post = api.model('AuthPost', %7B%0A%09'username': fields.String(required=True),%0A%09'password': f... | |
2785b8d5b1338126b6887b23fefec106ed877601 | Add first 16 hexagrams | hexagrams.py | hexagrams.py | Python | 0.999999 | @@ -0,0 +1,566 @@
+# -*- coding: utf-8 -*-%0A%0Ahexagrams = %7B%0A %22Ch'ien%22: (1, 1, 1, 1, 1, 1),%0A %22K'un%22: (0, 0, 0, 0, 0, 0),%0A %22Chun%22: (0, 1, 0, 0, 0, 1),%0A %22M%C3%AAng%22: (1, 0, 0, 0, 1, 0),%0A %22Hs%C3%BC%22: (0, 1, 0, 1, 1, 1 ),%0A %22Sung%22: (1, 1, 1, 0, 1, 0),%0A %22Shih%22... | |
11cc94f4a6545b49317042df4edf1804ccc3bdd8 | add a python script to export the links | export.py | export.py | Python | 0 | @@ -0,0 +1,1457 @@
+#!/usr/bin/env python%0A%22%22%22%0AA quick script to turn the database into KML showing pairs of point-to-point links%0A%22%22%22%0Aimport sys%0Aimport sqlite3%0Afrom xml.sax.saxutils import escape%0A%0Aconn = sqlite3.connect(%22prism.sqlite3%22)%0Ac = conn.cursor()%0Asql = open(%22getpairs.sql%22)... | |
6e80dd7537ec545175f9ab16c12c4591c5ac0531 | add jurisdiction_id | pupa/scrape/popolo.py | pupa/scrape/popolo.py | import copy
from .base import (BaseModel, SourceMixin, LinkMixin, ContactDetailMixin, OtherNameMixin,
IdentifierMixin)
from .schemas.post import schema as post_schema
from .schemas.person import schema as person_schema
from .schemas.membership import schema as membership_schema
from .schemas.organiza... | Python | 0.999611 | @@ -3595,16 +3595,38 @@
f, name,
+ jurisdiction_id=None,
classif
@@ -3638,16 +3638,33 @@
on=None,
+%0A
parent_
@@ -3689,33 +3689,16 @@
date='',
-%0A
dissolu
@@ -3706,24 +3706,41 @@
ion_date='',
+%0A
image=''):%0A
@@ -4082,16 +4082,96 @@
image%0A%0A
+ ... |
2d7d4b533999c029a33d7802d7ddfba631e07604 | Add Django 1.4 style wsgi app settings file | wsgi.py | wsgi.py | Python | 0 | @@ -0,0 +1,1693 @@
+%22%22%22 WSGI application settings for FST instance %0A%0AThe default setup at Domstolsverket assumes every instance of FST is %0Arunning under it's own virtualenv. %0A%22%22%22%0Aimport os%0Aimport sys%0Aimport site%0A%0A#VIRTUALENV_PATH = '/path/of/your/virtualenv'%0APYTHON_SITE_PACKAGES = 'lib/p... | |
c131e6108a72c57af4d3bdbe67d182d6c0ddb1eb | Add migration to modify on_delete | geotrek/feedback/migrations/0008_auto_20200326_1252.py | geotrek/feedback/migrations/0008_auto_20200326_1252.py | Python | 0.000001 | @@ -0,0 +1,1154 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.27 on 2020-03-26 12:52%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('feedback', '00... | |
b42c13de01a49e7fe3fb7caa22089ea1cd87f7bf | Add sanity tests for baremetal power state commands | ironicclient/tests/functional/osc/v1/test_baremetal_node_power_states.py | ironicclient/tests/functional/osc/v1/test_baremetal_node_power_states.py | Python | 0.999226 | @@ -0,0 +1,2393 @@
+# Copyright (c) 2016 Mirantis, Inc.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%... | |
f0b5b6a84f9b217376b54361b2afaeb19af24380 | Add containers | blox/containers.py | blox/containers.py | Python | 0.000005 | @@ -0,0 +1,1291 @@
+'''blox/containers.py%0A%0AContains containers that aid in group bloxs together in a logical way%0A%0ACopyright (C) 2015 Timothy Edmund Crosley%0A%0APermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated%0Adocumentation files (the %22Software%22... | |
2c174eeafa48302951e743ed2b9bbe91a1992899 | make sure that the file you are trying to import actually exists | tests/utils.py | tests/utils.py | Python | 0 | @@ -0,0 +1,1507 @@
+from __future__ import unicode_literals%0A%0ARAW_DOC = %7B%0A 'doc': str('%7B%7D'),%0A 'docID': 'someID',%0A 'timestamps': %7B%0A 'consumeFinished': '2012-11-30T17:05:48+00:00',%0A 'consumeStarted': '2012-11-30T17:05:48+00:00',%0A 'consumeTaskCreated': '2012-11-30T17:05... | |
3b06894ba1aadb3460ed60e47e931065484976ee | Add a command to undo results imports for specified projects | akvo/rsr/management/commands/undo_results_import.py | akvo/rsr/management/commands/undo_results_import.py | Python | 0.000121 | @@ -0,0 +1,1018 @@
+# -*- coding: utf-8 -*-%0A%0A# Akvo Reporting is covered by the GNU Affero General Public License.%0A# See more details in the license.txt file located at the root folder of the Akvo RSR module.%0A# For additional details on the GNU license please see %3C http://www.gnu.org/licenses/agpl.html %3E.%0... | |
6c28bd060ca1d28eb581ba32dc7f5b17ce1e70ac | Remove redundant output | mllib/collaborative_filtering/als/movie_recommender.py | mllib/collaborative_filtering/als/movie_recommender.py | #!/usr/bin/env python
import sys
from math import sqrt
from operator import add
from os.path import isfile
from pyspark import SparkConf, SparkContext
from pyspark.mllib.recommendation import ALS
##########################################################################
# Imports
####################################... | Python | 0.999999 | @@ -4472,134 +4472,8 @@
.1%0A%0A
- print %22Training model based on rank = %25d, %25d iterations, and lambda = %25.1f.%5Cn%22 %25 %5C%0A (rank, num_iterations, lmbda)%0A%0A
|
5dde9f6aca671440253729c29530e93974921ea0 | Add a migration to add the 'Other' field to QueuedImage.why_allowed | moderation_queue/migrations/0007_auto_20150303_1420.py | moderation_queue/migrations/0007_auto_20150303_1420.py | Python | 0.000001 | @@ -0,0 +1,887 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('moderation_queue', '0006_auto_20150303_0838'),%0A %5D%0A%0A operations = %5B%0A migration... | |
065b8ec2865b0746393a427d1d078c655905241c | Add renaming PDF files | rename-pdf.py | rename-pdf.py | Python | 0 | @@ -0,0 +1,967 @@
+#!/usr/bin/env python%0A__author__ = 'Jacob Bieker'%0Aimport os%0ADATA_DIRECTORY = os.path.join(%22test_file%22)%0ADATA = os.listdir(DATA_DIRECTORY)%0Afile_name_dict = %7B%7D%0A%0Afor file_name in DATA:%0A split_name = file_name.split(%22_%22)%0A print split_name%0A file_name_dict.setdefault... | |
57b396177854636257ad5884b0deeca6a79d207a | Add libpfm4 package. (#3667) | var/spack/repos/builtin/packages/libpfm4/package.py | var/spack/repos/builtin/packages/libpfm4/package.py | Python | 0 | @@ -0,0 +1,1968 @@
+##############################################################################%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... | |
d4f498db7c2cb5da0ad0202d7a4b6a919ac896b3 | add new package (#24989) | var/spack/repos/builtin/packages/py-rply/package.py | var/spack/repos/builtin/packages/py-rply/package.py | Python | 0 | @@ -0,0 +1,591 @@
+# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other%0A# Spack Project Developers. See the top-level COPYRIGHT file for details.%0A#%0A# SPDX-License-Identifier: (Apache-2.0 OR MIT)%0A%0Afrom spack import *%0A%0A%0Aclass PyRply(PythonPackage):%0A %22%22%22A pure Python Lex/Yac... | |
f627f04ebe0186b19d58619cab8b7098f5ca2e4c | Add plugin for Nova server state metrics | plugins/openstack/nova/nova-server-state-metrics.py | plugins/openstack/nova/nova-server-state-metrics.py | Python | 0 | @@ -0,0 +1,1646 @@
+#!/usr/bin/env python%0Afrom argparse import ArgumentParser%0Aimport socket%0Aimport time%0A%0Afrom novaclient.v3 import Client%0A%0ADEFAULT_SCHEME = '%7B%7D.nova.states'.format(socket.gethostname())%0A%0Adef output_metric(name, value):%0A print '%7B%7D%5Ct%7B%7D%5Ct%7B%7D'.format(name, value, in... | |
c0cd62af0ee29743430156eda613665dd58a97c3 | Apply SA naming convention | chat/indico_chat/migrations/201503101131_35badbd96474_apply_naming_convention.py | chat/indico_chat/migrations/201503101131_35badbd96474_apply_naming_convention.py | Python | 0 | @@ -0,0 +1,1260 @@
+%22%22%22Apply naming convention%0A%0ARevision ID: 35badbd96474%0ARevises: 1bd6c5129d29%0ACreate Date: 2015-03-10 11:31:42.850496%0A%22%22%22%0A%0Afrom alembic import op%0A%0Afrom indico.core.db.sqlalchemy.util.bulk_rename import bulk_rename%0A%0A%0A# revision identifiers, used by Alembic.%0Arevisio... | |
46c1a39041d89325d849339ebab0854a91f520d4 | Create rtl-config.py | rtl-config.py | rtl-config.py | Python | 0.000001 | @@ -0,0 +1,320 @@
+##%0A## User configuration file - edit these settings to suit your own project%0A##%0Afile_path = '/home/pi/RPi-RTL/images/' ## path to save images%0Afile_prefix = 'img_' ## prefix before timestamp.jpg, if needed - e.g. a project number%0Ause_timestamp = True ## True = timestamp in filename, F... | |
9ad5d9668c3faf85c38d5655054b8530d2e14444 | set up migration for meta_data ingest | datapoints/migrations/0002_populate_initial_data.py | datapoints/migrations/0002_populate_initial_data.py | Python | 0 | @@ -0,0 +1,1270 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0Aimport jsonfield.fields%0Aimport django.db.models.deletion%0Afrom django.conf import settings%0A%0Aimport pandas as pd%0Afrom datapoints.models import IndicatorTag%0Afrom django.db.model... | |
828f7dc96ac5ad10baf57e8697cb797f81863d48 | change transaction related_name for consistency | OIPA/iati/transaction/models.py | OIPA/iati/transaction/models.py | from decimal import Decimal
from django.db import models
from django.contrib.contenttypes.fields import GenericRelation
from iati.transaction.transaction_manager import TransactionQuerySet
from geodata.models import Country
from geodata.models import Region
from iati_vocabulary.models import RegionVocabulary
from iat... | Python | 0.000001 | @@ -6710,32 +6710,34 @@
CASCADE,%0A
+ #
related_name=%22r
@@ -7242,32 +7242,34 @@
CASCADE,%0A
+ #
related_name=%22r
|
9aeb9d35cd49ccd7ab1ede87d70666e34b80320c | Add tests for run docker mgmt command | readthedocs/rtd_tests/tests/test_core_management.py | readthedocs/rtd_tests/tests/test_core_management.py | Python | 0.000001 | @@ -0,0 +1,2433 @@
+from StringIO import StringIO%0A%0Afrom django.test import TestCase%0Afrom mock import patch%0A%0Afrom core.management.commands import run_docker%0Afrom projects.models import Project%0Afrom builds.models import Version%0A%0A%0Aclass TestRunDocker(TestCase):%0A '''Test run_docker command with goo... | |
7df706d8727064275aeccf04f5411661b33f9250 | Create show_vlans.py | show_vlans.py | show_vlans.py | Python | 0 | @@ -0,0 +1,1552 @@
+%0A__version__ = '0.9'%0A__author__ = 'Remi Batist'%0A%0A# Overview of vlans including ip-addresses in procurve-style%0A# An example below%0A%0A# VLAN-ID %7C IP Address IP Subnet NAME%0A# ------- %7C --------------- --------------- ---------------%0A# 1 %7C ... | |
66831279407e7a6626b8fe0ea06c886d5191f699 | Create q24telnetexec.py | q24telnetexec.py | q24telnetexec.py | Python | 0.000014 | @@ -0,0 +1,1022 @@
+#%0A# Q24 Util. for Pythonista%0A# 2014/12/23 : First Release%0A#%0A##############################################################################################################%0A%0Aimport sys%0Aimport telnetlib%0Aimport time%0Aimport os%0A#import subprocess%0Afrom ftplib import FTP%0A%0A#########... | |
991d40c62a7a44fc94ebd83e6726e5beaf867728 | Add exercise Chuck Norris | codingame/easy/chuck_norris.py | codingame/easy/chuck_norris.py | Python | 0.000205 | @@ -0,0 +1,874 @@
+def writeSegment(type, length):%0A%09out = %22%22%0A%09if (type == 1):%0A%09%09out += %220 %22%0A%09else:%0A%09%09out += %2200 %22%0A%0A%09out += '0' * length%0A%0A%09return out%0A%0Adef inputToBits(text):%0A%09out = %22%22%0A%09for ch in text:%0A%09%09chBin = bin(ord(ch))%5B2:%5D%0A%09%09while len(c... | |
e4cde9db9f9b99622cac8fa88f4acab1fce41d80 | add myrename | bin/myrename.py | bin/myrename.py | Python | 0.000001 | @@ -0,0 +1,754 @@
+#!/usr/bin/env python3%0A%0Aimport sys%0Aimport shutil%0Aimport re%0Aimport os%0A%0Aif len(sys.argv) %3E 1:%0A src_filename = sys.argv%5B1%5D%0Aelse:%0A print(%22Please supply filename%22)%0A sys.exit()%0A%0Aif not os.path.exists(src_filename):%0A print(%22%7B%7D does't exist%22.format(sr... | |
92ec039cdecffd7ec03f5954dfe5c69499921ba7 | Make consonants | lib/hindkit/_lab.py | lib/hindkit/_lab.py | Python | 0.999999 | @@ -0,0 +1,2577 @@
+#!/usr/bin/env AFDKOPython%0A# encoding: UTF-8%0Afrom __future__ import division, absolute_import, print_function, unicode_literals%0Aimport collections%0Aimport pytoml%0A%0Aenum = collections.namedtuple%0A%0Ap = enum(%0A %22Property%22,%0A %22%22%22%0A Vowel Consonant%0A Stop Na... | |
ab553873c782a7975e6b2cb3d240d5b9751c7a44 | Add API for RepositoryLayout. | layout.py | layout.py | Python | 0 | @@ -0,0 +1,2031 @@
+# Copyright (C) 2005-2007 Jelmer Vernooij %3Cjelmer@samba.org%3E%0A %0A# This program is free software; you can redistribute it and/or modify%0A# it under the terms of the GNU General Public License as published by%0A# the Free Software Foundation; either version 3 of the License, or%0A# (at your op... | |
cbaf4e86c4409735a8f011f5a8f801a34278c21c | Increase text index property size | src/ggrc/migrations/versions/20170112013716_421b2179c02e_update_fulltext_index.py | src/ggrc/migrations/versions/20170112013716_421b2179c02e_update_fulltext_index.py | Python | 0 | @@ -0,0 +1,976 @@
+# Copyright (C) 2017 Google Inc.%0A# Licensed under http://www.apache.org/licenses/LICENSE-2.0 %3Csee LICENSE file%3E%0A%0A%22%22%22Update fulltext index.%0A%0ACreate Date: 2017-01-12 01:37:16.801973%0A%22%22%22%0A# disable Invalid constant name pylint warning for mandatory Alembic variables.%0A# pyl... | |
fa5a570af022404d7a68f2d58851033c75a60920 | add import script for Hartlepool | polling_stations/apps/data_collection/management/commands/import_hartlepool.py | polling_stations/apps/data_collection/management/commands/import_hartlepool.py | Python | 0 | @@ -0,0 +1,1110 @@
+from data_collection.management.commands import BaseXpressWebLookupCsvImporter%0A%0Aclass Command(BaseXpressWebLookupCsvImporter):%0A council_id = 'E06000001'%0A addresses_name = 'HartlepoolProperty Post Code New.csv'%0A stations_name = 'HartlepoolProperty Post Code New.csv'%0A e... | |
5deb0710578313b61c4099b0970de1c3d1a15171 | remove a print() | ltu/engine/client.py | ltu/engine/client.py | import os
import requests
from result import Result
# Register the streaming http handlers with requests
class BaseClient(object):
"""Base class from which ModifyClient and QueryClient inherit.
This class contains basic methods for accessing the API.
"""
def __init__(self, application_key, server_url):
... | Python | 0.000348 | @@ -1097,26 +1097,8 @@
y)%5D%0A
- print(params)%0A
|
241ac6d844febf829f6442897ebf547a291e5db4 | Add Summarization API code for blog post | summarization/summarization.py | summarization/summarization.py | Python | 0 | @@ -0,0 +1,1075 @@
+import indicoio%0Aimport csv%0A%0Aindicoio.config.api_key = 'YOUR_API_KEY'%0A%0Adef clean_article(article):%0A return article.replace(%22%5Cn%22, %22 %22).decode('cp1252').encode('utf-8', 'replace')%0A%0Adef clean_articles(article_list):%0A # data processing: clean up new lines and convert str... | |
0c305fac7138fe0354d220cdee69c995cbd73eda | Include gstreamer in pyinstaller | kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py | kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py | '''
Kivy hook for PyInstaller
=========================
Kivy load itself in a complete dynamic way. PyImported don't see most of the
import cause of the Factory and Core.
In addition, the data and missing module are not copied automatically.
With this hook, everything needed for running kivy is correctly copied.
Che... | Python | 0 | @@ -2210,24 +2210,95 @@
ra_opencv',%0A
+ 'kivy.core.video.video_gi',%0A 'kivy.core.video.video_gstplayer',%0A
'kivy.co
@@ -2348,25 +2348,21 @@
o.video_
+py
gst
-reamer
',%0A '
|
49b8d12e03088950d960105414294af8a56e1393 | Create get_genome_size.py | kinetic_datanator/data_source/array_express_tools/get_genome_size.py | kinetic_datanator/data_source/array_express_tools/get_genome_size.py | Python | 0.000003 | @@ -0,0 +1,1024 @@
+import numpy as np%0Afrom ete3 import NCBITaxa%0A%0A%0Adef get_genome_size(organism_name):%0A%09domain = get_taxonomic_lineage(organism_name)%5B-3:-2%5D%5B0%5D%0A%09if domain == %22Bacteria%22:%0A%09%09file = open('number_of_prokaryote_genes.txt')%0A%09if domain == 'Eukaryota':%0A%09%09file = open('... | |
4efe6903ac54cefd9871965853f63ec8841b6e4b | add new splitted countries and remove old ones | osmaxx/excerptexport/migrations/0039_update_countries_20160528_2049.py | osmaxx/excerptexport/migrations/0039_update_countries_20160528_2049.py | Python | 0.000002 | @@ -0,0 +1,1564 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.6 on 2016-05-28 18:49%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0Afrom osmaxx.utils.polyfile_helpers import get_polyfile_names_to_file_mapping%0A%0A%0Adef update_excerpt(excerpt, polyfile_path):%0A from o... | |
626b0b54fdcc9cd797bd5a1b355c01f9e9947252 | Fix empty query result | node/datastore.py | node/datastore.py | #!/usr/bin/env python
#
# This library is free software, distributed under the terms of
# the GNU Lesser General Public License Version 3, or any later version.
# See the COPYING file included in this archive
#
# The docstrings in this module contain epytext markup; API documentation
# may be created by processing this... | Python | 0.999994 | @@ -6730,18 +6730,28 @@
-print row%0A
+if row != None:%0A
@@ -6787,24 +6787,28 @@
e%5D)%0A
+
return value
@@ -6807,16 +6807,49 @@
rn value
+%0A else:%0A return
%0A%0A de
|
6612fffdb5d45b3752851d6d1c692753d6827795 | Update user module URLS | plinth/modules/users/urls.py | plinth/modules/users/urls.py | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | Python | 0 | @@ -764,16 +764,17 @@
ns, url%0A
+%0A
from . i
@@ -820,34 +820,8 @@
'
-plinth.modules.users.views
',%0A
@@ -986,13 +986,8 @@
ers/
-edit/
(?P%3C
@@ -993,32 +993,38 @@
%3Cslug%3E%5B%5Cw.@+-%5D+)
+/edit/
$', views.UserUp
@@ -1086,15 +1086,8 @@
ers/
-delete/
(?P%3C
@@ -1101,16 +1101,24 @@
w.@+-%5D+)
+/delete... |
e10a31d85900fbd815cefa3c6d1227c8cc65911c | Improve recurive_get() applying code review comments | udata/utils.py | udata/utils.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import hashlib
import re
from datetime import date, datetime
from calendar import monthrange
from math import ceil
def get_by(lst, field, value):
'''Find an object in a list given a field value'''
for row in lst:
if ((isinstance(row, di... | Python | 0 | @@ -4960,19 +4960,23 @@
= parts
-%5B0%5D
+.pop(0)
%0A if
@@ -5087,35 +5087,8 @@
ne)%0A
- if len(parts) %3E 1:%0A
@@ -5124,24 +5124,23 @@
arts
-%5B1:%5D)%0A return
+) if parts else
val
|
bb43a2e63f7f7c337b01ef855d426a84b73eeee5 | Add a command prototype to list all items from a playlist | telemeta/management/commands/telemeta-export-items-from-user-playlists.py | telemeta/management/commands/telemeta-export-items-from-user-playlists.py | Python | 0 | @@ -0,0 +1,1191 @@
+from optparse import make_option%0Afrom django.conf import settings%0Afrom django.core.management.base import BaseCommand, CommandError%0Afrom django.contrib.auth.models import User%0Afrom django.template.defaultfilters import slugify%0Afrom django.utils import translation%0A%0Afrom telemeta.models ... | |
811b51c9d3003dc156f8d7ea005182a0be875e32 | add utils for sorting functionality with missing values | bonspy/utils.py | bonspy/utils.py | Python | 0 | @@ -0,0 +1,443 @@
+def compare_vectors(x, y):%0A for x_i, y_i in zip(x, y):%0A comparison = _compare(x_i, y_i)%0A if comparison == 0:%0A continue%0A else:%0A return comparison%0A return 0%0A%0A%0Adef _compare(x, y):%0A if x is not None and y is not None:%0A ret... | |
b3e1b721d6439cf8ba69f40536b4fb4e6be0b1ec | fix beaker.py for python3, add that as new file in beaker3.py. next need to make it dynamically choose which to load. | plugin/ipythonPlugins/src/dist/ipython/beaker3.py | plugin/ipythonPlugins/src/dist/ipython/beaker3.py | Python | 0 | @@ -0,0 +1,3109 @@
+# Copyright 2014 TWO SIGMA OPEN SOURCE, LLC%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# U... | |
f9331db039dc549bf9e1d149338f67c455f29bea | add manage.py | manage.py | manage.py | Python | 0.000001 | @@ -0,0 +1,542 @@
+#!/usr/bin/python%0Afrom django.core.management import execute_manager%0Atry:%0A import settings # Assumed to be in the same directory.%0Aexcept ImportError:%0A import sys%0A sys.stderr.write(%22Error: Can't find the file 'settings.py' in the directory containing %25r. It appears you've cust... | |
a62dc18745f952b3fcb05ddf4768758e25883698 | Add datamigration to create staff clearances | accelerator/migrations/0058_grant_staff_clearance_for_existing_staff_members.py | accelerator/migrations/0058_grant_staff_clearance_for_existing_staff_members.py | Python | 0 | @@ -0,0 +1,1400 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.8 on 2019-06-12 19:38%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0ASTAFF = %22Staff%22 # don't import from models in migrations.%0A%0Adef grant_staff_clearances_for_role_grantees(apps, program_role):%0A ... | |
ed514214967f4f9dde252070993f519db67057c3 | add tests for intermittent water | test/668-intermittent-water.py | test/668-intermittent-water.py | Python | 0.000002 | @@ -0,0 +1,833 @@
+#http://www.openstreetmap.org/way/107817218%0A# Arizona Canal Diversion Channel (ACDC) %0Aassert_has_feature(%0A 16, 12353, 26272, 'water',%0A %7B 'kind': 'river', 'intermittent': 'yes' %7D)%0A%0A#http://www.openstreetmap.org/way/96528126%0A# 10th Street Wash%0Aassert_has_feature(%0A 16, 123... | |
2d18583309a189e263bda13e19f7a05ba832c14d | Add file to write templates to json | backend/scripts/templates/templates2file.py | backend/scripts/templates/templates2file.py | Python | 0 | @@ -0,0 +1,728 @@
+#!/usr/bin/env python%0A%0Aimport rethinkdb as r%0Afrom optparse import OptionParser%0Aimport json%0Aimport os%0A%0Aif __name__ == %22__main__%22:%0A parser = OptionParser()%0A parser.add_option(%22-P%22, %22--port%22, dest=%22port%22, type=%22int%22,%0A help=%22rethinkdb p... | |
72a851829a2190adc240bff3a62f4f03526a5e39 | add basic checks | ndd/check.py | ndd/check.py | Python | 0 | @@ -0,0 +1,1263 @@
+# -*- coding: utf-8 -*-%0A%22%22%22Basic distribution tests.%22%22%22%0A# pylint: disable=missing-docstring%0Aimport pytest%0A%0Aimport ndd%0A%0ACOUNTS = %5B4, 12, 4, 5, 3, 1, 5, 1, 2, 2, 2, 2, 11, 3, 4, 12, 12, 1, 2%5D%0AK = 100%0A%0A%0Adef rounded(*args, **kwargs):%0A result = ndd.entropy(COUNT... | |
10d020cc7b91257b74e63c0579788c0f9435857f | add loadTestData.py | templates/test/loadTestData.py | templates/test/loadTestData.py | Python | 0.000003 | @@ -0,0 +1,1093 @@
+import os%0A%0Aif not os.path.exists('setup.py'):%0A print %22This script should be run from /install/community-edition-setup/%22%0A sys.exit()%0A %0Aif not os.path.exists('/install/community-edition-setup/setup.properties.last'):%0A print %22setup.properties.last is missing can't contin... | |
6df873a26ff71b07e68dcb2e9fa9c4b1725a70ce | Add migration for expert bid [WAL-976] | src/nodeconductor_assembly_waldur/experts/migrations/0003_expertbid.py | src/nodeconductor_assembly_waldur/experts/migrations/0003_expertbid.py | Python | 0 | @@ -0,0 +1,1222 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.1 on 2017-07-07 15:09%0Afrom __future__ import unicode_literals%0A%0Afrom decimal import Decimal%0Aimport django.core.validators%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0Aimport nodeconductor.core.fields%0A%0A... | |
578ee687ca5b2270c3d01376606c1f074fd15e4e | convert to float/int | src/collectors/memcached/memcached.py | src/collectors/memcached/memcached.py | # coding=utf-8
"""
Collect memcached stats
#### Dependencies
* subprocess
#### Example Configuration
MemcachedCollector.conf
```
enabled = True
hosts = localhost:11211, app-1@localhost:11212, app-2@localhost:11213, etc
```
TO use a unix socket, set a host string like this
```
hosts = /path/to/bla... | Python | 0.999999 | @@ -3154,32 +3154,69 @@
continue%0A
+ if '.' in pieces%5B2%5D:%0A
stat
@@ -3230,16 +3230,22 @@
s%5B1%5D%5D =
+float(
pieces%5B2
@@ -3245,16 +3245,85 @@
ieces%5B2%5D
+)%0A else:%0A stats%5Bpieces%5B1%5D%5D = int(pieces%5B2%5D)
%0A%0A
|
8e983472134817c1312e3713ca45c7359300dedf | Set students current flag based on enrolled and attending | academics/management/commands/set_student_current.py | academics/management/commands/set_student_current.py | Python | 0 | @@ -0,0 +1,861 @@
+#!/usr/bin/python%0A%0Aimport logging%0Afrom datetime import date%0A%0Afrom django.core.management.base import BaseCommand, CommandError%0Afrom django.db import transaction%0A%0Afrom academics.models import Student, Enrollment, AcademicYear%0A%0Alogger = logging.getLogger(__name__)%0A%0Aclass Command... | |
c812f283762f18cdf9107b2b7fd679c6b57e32d7 | Create coins.py | common/coins.py | common/coins.py | Python | 0.000005 | @@ -0,0 +1 @@
+%0A
| |
b7d94d888552161432154750a8ca6a96775a32e2 | modify domain XML to boot from hda after installation. | vmfront/vmmanager/views.py | vmfront/vmmanager/views.py | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from xml.dom.minidom import parseString
from django.core.context_processors import csrf
from django import forms
from django.http import Ht... | Python | 0 | @@ -5868,36 +5868,13 @@
ev='
-cdrom'/%3E %3C!-- Boot Device --
+hd' /
%3E%0A
@@ -5890,37 +5890,60 @@
%3Cboot dev='
-hd' /
+cdrom'/%3E %3C!-- Boot Device --
%3E%0A %3C/os%3E%0A
|
1190ae0f9f926db3b6969700a8a2b3ca67d7631c | Add google analytics script | query_google_analytics.py | query_google_analytics.py | Python | 0.000001 | @@ -0,0 +1,248 @@
+import json%0Aimport random%0A%0Adata = %7B%0A 'unique_users': random.randint(11, 99),%0A 'number_of_cats': random.randint(11, 99),%0A%7D%0A%0Awith open('/fs/website/people/fergus.cooper/google_analytics_data.json', 'w') as outfile:%0A json.dump(data, outfile)%0A
| |
145b84b8ad2ba2568a3ca3044a551c042496cb9c | Fix ordered dict rendering for task templates | rally/common/yamlutils.py | rally/common/yamlutils.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Python | 0.000019 | @@ -584,16 +584,28 @@
lections
+%0Aimport json
%0A%0Aimport
@@ -772,16 +772,681 @@
Error%0A%0A%0A
+# NOTE(andreykurilin): Jinja2 uses __repr__ methods of objects while rendering%0A# templates. Such behaviour converts OrderedDict to the string like%0A# %22OrderedDict(%5B('foo', 'xxx'), ('bar', 'yyy')%5D)%22%... |
6e4be2c3c082ea8551c1eee9fc792511a043f1a7 | Fix bug when using unix sockets. | redis_cache/connection.py | redis_cache/connection.py | from redis.connection import UnixDomainSocketConnection, Connection
class CacheConnectionPool(object):
def __init__(self):
self._clients = {}
self._connection_pools = {}
def __contains__(self, server):
return server in self._clients
def __getitem__(self, server):
return ... | Python | 0 | @@ -1463,36 +1463,135 @@
ut,%0A
+%7D%0A%0A
+ if not issubclass(connection_class, UnixDomainSocketConnection):%0A kwargs%5B
'socket_connect_
@@ -1590,33 +1590,35 @@
connect_timeout'
-:
+%5D =
socket_connect_
@@ -1624,31 +1624,17 @@
_timeout
-,%0A %7D
+%0A
%0A ... |
3e0004283e32b29ac4792c3a0f97abe2c2bfaf25 | version bump for 0.25.12.1. | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.25.12'
| Python | 0 | @@ -12,11 +12,13 @@
'0.25.12
+.1
'%0A%0A
|
d9e47e7b3200586a41a2d4f6cbd555b4b3c3d0cb | version bump for 0.81.3. | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.81.2'
| Python | 0 | @@ -14,8 +14,8 @@
.81.
-2
+3
'%0A%0A
|
7e65f4da82cb9176247c1aa9ab72f40116cc6a8e | Add the Caliper package | var/spack/repos/builtin/packages/caliper/package.py | var/spack/repos/builtin/packages/caliper/package.py | Python | 0 | @@ -0,0 +1,714 @@
+from spack import *%0A%0Aclass Caliper(Package):%0A %22%22%22%0A Caliper is a generic context annotation system. It gives programmers the%0A ability to provide arbitrary program context information to (performance)%0A tools at runtime.%0A %22%22%22%0A%0A homepage = %22https://github... | |
c67b8173e33ed619d9601654a71c47d67fb82fe3 | add package py-rope (#3314) | var/spack/repos/builtin/packages/py-rope/package.py | var/spack/repos/builtin/packages/py-rope/package.py | Python | 0 | @@ -0,0 +1,1548 @@
+##############################################################################%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... | |
cdcf814003694b86df6abee8f24af9b8609ea9a6 | Add py-zipp package (#12656) | var/spack/repos/builtin/packages/py-zipp/package.py | var/spack/repos/builtin/packages/py-zipp/package.py | Python | 0 | @@ -0,0 +1,757 @@
+# 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 PyZipp(PythonPackage):%0A %22%22%22Backport of pathlib-c... | |
a206d2aebd5ae6f084377b4b7f2261a83afe4e70 | Add new package: rsyslog (#18304) | var/spack/repos/builtin/packages/rsyslog/package.py | var/spack/repos/builtin/packages/rsyslog/package.py | Python | 0 | @@ -0,0 +1,1195 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other%0A# Spack Project Developers. See the top-level COPYRIGHT file for details.%0A#%0A# SPDX-License-Identifier: (Apache-2.0 OR MIT)%0A%0Afrom spack import *%0A%0A%0Aclass Rsyslog(AutotoolsPackage):%0A %22%22%22The rocket-fast ... | |
05f794499997a1097bf625e3bd202eaaf06fe373 | Add exec module | common/modules/exec.py | common/modules/exec.py | Python | 0.000001 | @@ -0,0 +1,2320 @@
+import module%0A%0Aimport re%0A%0AREGEX = re.compile('%5Eexec(%5Cs+-o(%5Cs+%5B%5Cw.%5D+)?)?%5Cs+((%22%5B%5E%22%5D+%22)%5Cs+)+$')%0AMODNAME = 'exec'%0AUSAGE = %22%22%22Execute commands on target.%0Ausage: exec %5B-o %5Bfilename%5D%5D %22cmd1%22 %5B%22cmd2%22 %22cmd3%22 ...%5D%0A%5CnExecute given comm... | |
8a6fdc7c79f9038c1b89ba90d60555f3dcbbfdb9 | Add migration | project/api/migrations/0016_selection_competitor.py | project/api/migrations/0016_selection_competitor.py | Python | 0.000002 | @@ -0,0 +1,523 @@
+# Generated by Django 2.1.5 on 2019-02-12 14:15%0A%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('api', '0015_auto_20190211_2028'),%0A %5D%0A%0A operations = %5B%0A migra... | |
646e8cc87b4bb0d032f6f725a0fc2fbc8dfe5a1f | add a command exporting field with their locales to XLS | telemeta/management/commands/telemeta-export-fields.py | telemeta/management/commands/telemeta-export-fields.py | Python | 0 | @@ -0,0 +1,1603 @@
+from optparse import make_option%0Afrom django.conf import settings%0Afrom django.core.management.base import BaseCommand, CommandError%0Afrom django.contrib.auth.models import User%0Afrom django.template.defaultfilters import slugify%0Afrom django.utils import translation%0Afrom telemeta.models imp... | |
d5e77eba7cb7fe5c3235d1e59612e4c32fbe658f | Add test for Flags | tests/cupy_tests/test_flags.py | tests/cupy_tests/test_flags.py | Python | 0 | @@ -0,0 +1,641 @@
+import unittest%0A%0Afrom cupy import flags%0A%0A%0Aclass TestFlags(unittest.TestCase):%0A%0A def setUp(self):%0A self.flags = flags.Flags(1, 2, 3)%0A%0A def test_c_contiguous(self):%0A self.assertEqual(1, self.flags%5B'C_CONTIGUOUS'%5D)%0A%0A def test_f_contiguous(self):%0A ... | |
990b452e8c142d6ada840026e80cbc15ebff895c | add csv test runner | tests/python_tests/csv_test.py | tests/python_tests/csv_test.py | Python | 0.000001 | @@ -0,0 +1,1518 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport glob%0Afrom nose.tools import *%0Afrom utilities import execution_path%0A%0Aimport os, mapnik2%0A%0A%0Adef setup():%0A # All of the paths used are relative, if we run the tests%0A # from another directory we need to chdir()%0A os.c... | |
033809cbc96e380bdd657fd4f10d1ca60b0aa9af | Create Graphingcalc.py | Graphingcalc.py | Graphingcalc.py | Python | 0 | @@ -0,0 +1 @@
+%0A
| |
b0d50f52f45d8f1c7de261c7fe8d15e621d0e641 | Add a script to "untie" tied model weights. | scripts/theanets-untie.py | scripts/theanets-untie.py | Python | 0 | @@ -0,0 +1,1074 @@
+#!/usr/bin/env python%0A%0Aimport climate%0Aimport cPickle as pickle%0Aimport gzip%0Aimport numpy as np%0A%0Alogging = climate.get_logger('theanets-untie')%0A%0A@climate.annotate(%0A source='load a saved network from FILE',%0A target='save untied network weights to FILE',%0A)%0Adef main(source... | |
cb403c3934f2401b6b337a19c8f5fd2c1f77805d | Solve 31. | 031/solution.py | 031/solution.py | Python | 0.999942 | @@ -0,0 +1,1070 @@
+# coding: utf-8%0A%0A%22%22%22 Project Euler problem #31. %22%22%22%0A%0A%0Adef problem():%0A u%22%22%22 Solve the problem.%0A%0A In England the currency is made up of pound, %C2%A3, and pence, p, and there are%0A eight coins in general circulation:%0A%0A 1p, 2p, 5p, 10p, 20p, 50p, %C2%A... | |
1774794c448d13a20891454a79f664406b364e4c | add cdr_serieshelper | cdr_stats/call_analytic/cdr_serieshelper.py | cdr_stats/call_analytic/cdr_serieshelper.py | Python | 0.000002 | @@ -0,0 +1,2107 @@
+#%0A# CDR-Stats License%0A# http://www.cdr-stats.org%0A#%0A# This Source Code Form is subject to the terms of the Mozilla Public%0A# License, v. 2.0. If a copy of the MPL was not distributed with this file,%0A# You can obtain one at http://mozilla.org/MPL/2.0/.%0A#%0A# Copyright (C) 2011-2014 Star2B... | |
eb9fde03dd7b650c59db7a64389bdf1231844407 | use get_by_name to benefit from caching | corehq/apps/users/middleware.py | corehq/apps/users/middleware.py | from redis_cache.exceptions import ConnectionInterrumped
from django.conf import settings
import django.core.exceptions
from dimagi.utils.couch.cache import cache_core
rcache = cache_core.get_redis_default_cache()
#######################################################################################################... | Python | 0 | @@ -2915,174 +2915,26 @@
ain.
-view(%22domain/domains%22,%0A key=domain,%0A reduce=False,%0A include_docs=True,%0A ).one(
+get_by_name(domain
)%0A
|
fdf3df4154411652b340a38e901c52d678dbd92e | Replace get_user_profile_by_email with get_user. | zerver/management/commands/bulk_change_user_name.py | zerver/management/commands/bulk_change_user_name.py | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand
from zerver.lib.actions import do_change_full_name
from zerver.models import UserProfile, get_user_profile_by_email
class Comman... | Python | 0 | @@ -171,27 +171,28 @@
import
-Base
Command
+Error
%0A%0Afrom z
@@ -252,60 +252,46 @@
ver.
-models import UserProfile, get_user_profile_by_email
+lib.management import ZulipBaseCommand
%0A%0Acl
@@ -302,16 +302,21 @@
Command(
+Zulip
BaseComm
@@ -615,16 +615,58 @@
name%3E%22)
+%0A self.add_realm_args(par... |
7e4803db10f0cd2ccb6d54117bc68dd999023908 | Create __init__.py | run_tests/__init__.py | run_tests/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
339fdd927f9da0f7e15726d087c9916301aef935 | Add soft margin SVM and added kernels and class | softMarginSVMwithKernels/howItWorksSoftMarginSVM.py | softMarginSVMwithKernels/howItWorksSoftMarginSVM.py | Python | 0 | @@ -0,0 +1,2307 @@
+# -*- coding: utf-8 -*-%0A%22%22%22Soft Margin SVM classification with kernels for machine learning.%0A%0ASoft margin SVM is basically an SVM (see folder **supportVectorMachine**) which%0Ahas some 'slack' and allows features to be 'wrongly' classified to avoid%0Aoverfitting the classifier. This also... | |
b89a98f0a5b6d4af94b5c52ff4baf4e7c10f2b53 | Create PrintExpScalingFactors.py | solidity/python/constants/PrintExpScalingFactors.py | solidity/python/constants/PrintExpScalingFactors.py | Python | 0 | @@ -0,0 +1,258 @@
+from math import exp%0A%0A%0AMIN_PRECISION = 32%0A%0A%0Afor n in %5B1,2,3%5D:%0A print ' uint256 constant SCALED_EXP_%7B%7D = 0x%7B:x%7D;'.format(n,int(exp(n)*(1%3C%3CMIN_PRECISION)))%0A print ' uint256 constant SCALED_VAL_%7B%7D = 0x%7B:x%7D;'.format(n,int( (n)*(1%3C%3CMIN_PRECISION)))... | |
171283cc2dee67eed8469fac08f531268a21c780 | add influxdb_user salt state to manage influxdb users | salt/states/influxdb_user.py | salt/states/influxdb_user.py | Python | 0 | @@ -0,0 +1,3199 @@
+# -*- coding: utf-8 -*-%0A'''%0AManagement of InfluxDB users%0A============================%0A'''%0A%0A%0Adef present(name, passwd, database, user=None, password=None, host=None,%0A port=None):%0A '''%0A Ensure that the user is present%0A%0A name%0A The name of the user to... | |
8601790648a17dd1794be4f88d61e4af01349a80 | Test for the chipseq pipeline code | tests/test_pipeline_chipseq.py | tests/test_pipeline_chipseq.py | Python | 0 | @@ -0,0 +1,2472 @@
+%22%22%22%0A.. Copyright 2017 EMBL-European Bioinformatics Institute%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/licens... | |
4da92f170a89ebc0f8b995ce60439e684c558192 | Properly parse comma-separated query string params | app/main/views/jobs.py | app/main/views/jobs.py | # -*- coding: utf-8 -*-
import time
from flask import (
render_template,
abort,
jsonify,
request
)
from flask_login import login_required
from werkzeug.datastructures import MultiDict
from utils.template import Template
from app import (
job_api_client,
notification_api_client,
service_ap... | Python | 0.999508 | @@ -29,16 +29,33 @@
ort time
+%0Aimport itertools
%0A%0Afrom f
@@ -564,24 +564,25 @@
lter_dict):%0A
+%0A
if not i
@@ -665,22 +665,19 @@
ct)%0A
+%0A
-out_dict =
+return
Mul
@@ -687,126 +687,121 @@
ict(
-)
%0A
-if 'type' in filter_dict:%0A out_dict.setlist('template_type', filter_dict.getlis... |
8cb665e107cb33b5ff3825e5ffb3bde919d36cff | Add cache runner as per #2897 | salt/runners/cache.py | salt/runners/cache.py | Python | 0 | @@ -0,0 +1,1422 @@
+'''%0AReturn cached data from minions%0A'''%0A# Import python libs%0Aimport os%0A%0A# Import salt libs%0Aimport salt.output%0Aimport salt.payload%0A%0A%0Adef _cdata():%0A '''%0A Return the cached data from the minions%0A '''%0A ret = %7B%7D%0A serial = salt.payload.Serial(__opts__)%0A... | |
93bb4703205166d49ced19c621bf120298018ddc | Fix yaml-hl to use the new API. | examples/yaml-hl/yaml_hl.py | examples/yaml-hl/yaml_hl.py | #!/usr/bin/python
import yaml, codecs, sys, optparse
yaml.add_resolver(u'!Config', [])
yaml.add_resolver(u'!TokensConfig', [u'tokens'])
yaml.add_resolver(u'!EventsConfig', [u'events'])
yaml.add_resolver(u'!StartEndConfig', [u'tokens', None])
yaml.add_resolver(u'!StartEndConfig', [u'events', None])
class YAMLHighli... | Python | 0 | @@ -48,18 +48,17 @@
tparse%0A%0A
-%0A%0A
+#
yaml.add
@@ -83,16 +83,17 @@
g', %5B%5D)%0A
+#
yaml.add
@@ -129,24 +129,25 @@
u'tokens'%5D)%0A
+#
yaml.add_res
@@ -183,16 +183,17 @@
ents'%5D)%0A
+#
yaml.add
@@ -241,16 +241,17 @@
None%5D)%0A
+#
yaml.add
@@ -354,16 +354,16 @@
onfig):%0A
+
@@ -388,17 +388... |
78ab60f9a0d7251effc238b98dc110706876da8e | add migration for new queue_empty field | scripts/migrations/029-set-mailbox-queue_empty.py | scripts/migrations/029-set-mailbox-queue_empty.py | Python | 0 | @@ -0,0 +1,427 @@
+import logging%0A%0Afrom allura import model as M%0A%0Alog = logging.getLogger(__name__)%0A%0A%0Adef main():%0A M.Mailbox.query.update(%7B'queue': %5B%5D%7D,%0A %7B'$set': %7B'queue_empty': True%7D%7D,%0A multi=True)%0A%0A M.Mailbox.query.upda... | |
1519f6be1d888f107a3b747e17cb1bd9d89c976f | Add SciPy benchmark | lib/node_modules/@stdlib/math/base/special/beta/benchmark/python/benchmark.scipy.py | lib/node_modules/@stdlib/math/base/special/beta/benchmark/python/benchmark.scipy.py | Python | 0 | @@ -0,0 +1,1601 @@
+#!/usr/bin/env python%0A%22%22%22Benchmark scipy.special.beta.%22%22%22%0A%0Afrom __future__ import print_function%0Aimport timeit%0A%0ANAME = %22beta%22%0AREPEATS = 3%0AITERATIONS = 1000000%0A%0A%0Adef print_version():%0A %22%22%22Print the TAP version.%22%22%22%0A print(%22TAP version 13%22)... | |
f93e29f52a59d5f545faf8fd94e950f50383c7fc | Integrate LLVM at llvm/llvm-project@9c8f950a0400 | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "3019898e0d1b494b7e7e76790adb3d83eff4aca1"
LLVM_SHA256 = "cb37f53299af16bc7e196c9dadd1e3fa889583d966b5d3e9adde7dc18d3094c5"
tf_http_archive(
... | Python | 0.000002 | @@ -160,133 +160,133 @@
= %22
-3019898e0d1b494b7e7e76790adb3d83eff4aca1%22%0A LLVM_SHA256 = %22cb37f53299af16bc7e196c9dadd1e3fa889583d966b5d3e9adde7dc18d3094c5
+9c8f950a04004736bddb5093eda15f9a1c4f2eea%22%0A LLVM_SHA256 = %229dc64e4b455908f00d47b52d8a195b1e8dc98dd6337d16c85f3eda0ca37a1c8e
%22%0A%0A
|
f902202b5e7f2473a7ce22505a4cc8b4f39377e0 | Add scantailor package (#12833) | var/spack/repos/builtin/packages/scantailor/package.py | var/spack/repos/builtin/packages/scantailor/package.py | Python | 0 | @@ -0,0 +1,1081 @@
+# 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 Scantailor(CMakePackage):%0A %22%22%22Scan Tailor is an... | |
4155d6ca5db149d8b213cc4078580fc2e85d7f4d | Migrate database for model changes. | vinotes/apps/api/migrations/0002_auto_20150325_1104.py | vinotes/apps/api/migrations/0002_auto_20150325_1104.py | Python | 0 | @@ -0,0 +1,608 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('api', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AddField(%0A ... | |
253acd0afd532e8fa431ab140856fe0c4ba41684 | make the plugins directory a package, so that plugins can depend on each other. | plugins/__init__.py | plugins/__init__.py | Python | 0 | @@ -0,0 +1,60 @@
+# keep this to be able to access plugins from other plugins%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.