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 |
|---|---|---|---|---|---|---|---|
c1c5f58d12ff9a8e532de971c28e3676915a7117 | Add py-cairocffi package (#12161) | var/spack/repos/builtin/packages/py-cairocffi/package.py | var/spack/repos/builtin/packages/py-cairocffi/package.py | Python | 0 | @@ -0,0 +1,1157 @@
+# 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 PyCairocffi(PythonPackage):%0A %22%22%22cairocffi is a ... | |
eda01c6b45629d6c039785ba502dcde47cabd020 | Add python implementation | probability.py | probability.py | Python | 0.000099 | @@ -0,0 +1,1035 @@
+#!/usr/bin/env python%0Aimport random%0Aimport sets%0A%0ABOARD_SIZE = 9%0AMINES = 10%0ASAMPLES = 10**5%0A%0Adef generate_mines(board_size, num_of_mines):%0A mines = sets.Set()%0A while len(mines) != num_of_mines:%0A mines.add((random.randint(0, board_size - 1),%0A rando... | |
3352236ff27dbfd749b71dd152f6809b2019bee4 | add tests | test_czech_holidays.py | test_czech_holidays.py | Python | 0 | @@ -0,0 +1,1521 @@
+import re%0Afrom datetime import date%0A%0Aimport requests%0Aimport pytest%0A%0Afrom czech_holidays import holidays, Holidays, Holiday%0A%0A%0AWIKIPEDIA_RE = re.compile(r'Rok%5Cs%5Cd%7B4%7D%3C/th%3E%5Cs%3Ctd%3E(?P%3Cdate%3E%5Cw+)')%0A%0AWIKIPEDIA_DATE_RE = re.compile(r'(?P%3Cday%3E%5Cd+)%5C.%5Cs+(?P... | |
0415071808b1bfa659a790e50692dc65d479b627 | add config.sample.py | tests/config.sample.py | tests/config.sample.py | Python | 0.000003 | @@ -0,0 +1,230 @@
+%22%22%22%0AThis is the sample config.py%0A%0Acreate your own config.py which match your testsetup%0AIt will be imported by device tests%0A%22%22%22%0A%0Afrom testWrt import testsetup%0A%0ATestSetup = testsetup.TestSetup()%0ATestSetup.set_openwrt(%22192.168.2.1%22)%0A
| |
ca823664d40a9ee3eb0d70cdc20a6aa3e13318d3 | Fix for WidgetsTree | designer/nodetree.py | designer/nodetree.py | from kivy.uix.treeview import TreeViewLabel
from kivy.uix.scrollview import ScrollView
from kivy.properties import ObjectProperty, BooleanProperty
from kivy.app import App
from kivy.clock import Clock
from kivy.uix.tabbedpanel import TabbedPanel
from designer.common import widgets
class WidgetTreeElement(TreeViewLabe... | Python | 0 | @@ -3288,55 +3288,8 @@
lse%0A
- if self.collide_point(*touch.pos):%0A
@@ -3331,35 +3331,38 @@
agging)%0A
-
-
+return
super(WidgetsTr
@@ -3391,38 +3391,16 @@
touch)%0A%0A
- return False%0A%0A
def
@@ -3955,19 +3955,22 @@
-
+return
super(W
@@ -4013,30 +4013,8 @@... |
eb091fc81dc374d0eb0800a596d6e0db95a55687 | Create CombinationSumII_001.py | leetcode/040-Combination-Sum-II/CombinationSumII_001.py | leetcode/040-Combination-Sum-II/CombinationSumII_001.py | Python | 0.000021 | @@ -0,0 +1,1084 @@
+#Node simplification, improvement & optimization%0A#How, it's good because it can be done on the original code of %22Combination Sum%22%0A%0Aclass Solution:%0A # @param %7Binteger%5B%5D%7D candidates%0A # @param %7Binteger%7D target%0A # @return %7Binteger%5B%5D%5B%5D%7D%0A def combinati... | |
d3a9a4a300acc204111e19945381a995f0f7cdda | add import script for Dumfries and Galloway | polling_stations/apps/data_collection/management/commands/import_dumfries_and_galloway.py | polling_stations/apps/data_collection/management/commands/import_dumfries_and_galloway.py | Python | 0 | @@ -0,0 +1,258 @@
+from data_collection.management.commands import BaseScotlandSpatialHubImporter%0A%0Aclass Command(BaseScotlandSpatialHubImporter):%0A council_id = 'S12000006'%0A council_name = 'Dumfries and Galloway'%0A elections = %5B'local.dumfries-and-galloway.2017-05-04'%5D%0A
| |
ba5d87ff551df47df2ed4de15058df28ad49fe41 | add error classes. | pumblr/error.py | pumblr/error.py | Python | 0 | @@ -0,0 +1,371 @@
+#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%0Aclass PumblrError(object):%0A %22%22%22Pumblr exception%22%22%22%0A %0A def __init__(self, msg):%0A self._msg = msg%0A%0A def __str__(self):%0A return self._msg%0A%0A%0Aclass PumblrAuthError(PumblrError):%0A %22%22%22403 Fo... | |
e6fb23f0bfb095b63bb9427f7838719f5248177c | Update Mindreader to use copy and no longer manipulate state | axelrod/strategies/mindreader.py | axelrod/strategies/mindreader.py | import copy
import inspect
from axelrod import Player, RoundRobin, Game, update_histories
def simulate_match(player_1, player_2, strategy, rounds=10):
"""Simulates a number of matches."""
for match in range(rounds):
play_1, play_2 = strategy, player_2.strategy(player_1)
# Update histories and... | Python | 0 | @@ -952,17 +952,16 @@
-#
opponent
@@ -1013,37 +1013,8 @@
ere%0A
- opponent_ = player_2%0A
@@ -1358,52 +1358,8 @@
nds)
-%0A roll_back_history(player_2, rounds)
%0A%0A
@@ -1761,19 +1761,20 @@
state':
-Tru
+Fals
e%0A %7D%0A
|
86fe554e8cc67ad346d2ecc532cea6e94461a0c6 | Add support for file session | app/tools/session.py | app/tools/session.py | Python | 0 | @@ -0,0 +1,2058 @@
+#-*- coding:utf-8 -*-%0A%0Aimport uuid%0Aimport time%0Aimport os%0Aimport json%0Aclass Session(dict):%0A%09def __init__(self,session_id=None,expire=None,*args,**kw):%0A%09%09if session_id==None:%0A%09%09%09self._session_id=self._generate_session_id()%0A%09%09else:%0A%09%09%09self._session_id=session... | |
8bfd0031c4a93b644cd8f9892a0cc1a8671a9024 | add build/BuildSpawn.py | Source/Python/build/BuildSpawn.py | Source/Python/build/BuildSpawn.py | Python | 0.000001 | @@ -0,0 +1,594 @@
+import os%0D%0Afrom threading import *%0D%0Afrom subprocess import *%0D%0A%0D%0A%0D%0A%0D%0Aclass BuildSpawn(Thread):%0D%0A def __init__(self, Sem=None, Filename=None, Args=None, Num=0):%0D%0A Thread.__init__(self)%0D%0A self.sem=Sem%0D%0A self.filename=Filename%0D%0A s... | |
00a00621f005e3db3fd25c4c09fb1540ba165fed | Test the VenvBuilder | tests/unit/builders/test_venv.py | tests/unit/builders/test_venv.py | Python | 0 | @@ -0,0 +1,1648 @@
+import subprocess%0A%0Aimport pretend%0Aimport pytest%0A%0Aimport virtualenv.builders.venv%0A%0Afrom virtualenv.builders.venv import VenvBuilder, _SCRIPT%0A%0A%0Adef test_venv_builder_check_available_success(monkeypatch):%0A check_output = pretend.call_recorder(lambda *a, **kw: None)%0A monkey... | |
efc8d3182f79111b3a1b7df445dafd46fef9862a | Add YAML wrapper allowing conf strings to be used in YAML source files | controlbeast/utils/yaml.py | controlbeast/utils/yaml.py | Python | 0 | @@ -0,0 +1,1495 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0A controlbeast.utils.yaml%0A ~~~~~~~~~~~~~~~~~~~~~~~%0A%0A :copyright: Copyright 2014 by the ControlBeast team, see AUTHORS.%0A :license: ISC, see LICENSE for details.%0A%22%22%22%0Aimport os%0Aimport yaml%0Afrom controlbeast.conf import CbConf%0Afrom... | |
79f92d050fbf9ebe4f088aeabb5e832abeefe0d5 | Initialize unit tests for Coursera API module | tests/test_coursera.py | tests/test_coursera.py | Python | 0.000001 | @@ -0,0 +1,1040 @@
+import unittest%0A%0Afrom mooc_aggregator_restful_api import coursera%0A%0A%0Aclass CourseraTestCase(unittest.TestCase):%0A '''%0A Unit Tests for module udacity%0A%0A '''%0A%0A def setUp(self):%0A self.coursera_test_object = coursera.CourseraAPI()%0A%0A def test_coursera_api_co... | |
7d65a128ee71bc5c85170b247730ea385ab58d0c | add first handler test | tests/test_handlers.py | tests/test_handlers.py | Python | 0 | @@ -0,0 +1,988 @@
+import unittest%0Afrom unittest.mock import Mock%0A%0A%0Aclass RangeVotingHandler():%0A def __init__(self, member_repository):%0A self.repository = member_repository%0A%0A def handle(self, command):%0A self.repository.save()%0A%0A%0Aclass RangeVotingRepository():%0A def save(se... | |
f647545b98693e309fa535c1c917be965df12cd7 | allow null | apps/intel/models.py | apps/intel/models.py | from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.db import connection
from domain.models import Membership
from intel.schema_models import *
# Adding roles and clinics to the user profile
class Role(models.Model):
name ... | Python | 0.000813 | @@ -756,16 +756,27 @@
y(Clinic
+, null=True
)%0A ro
@@ -805,16 +805,27 @@
Key(Role
+, null=True
)%0A%0A%0A# sc
|
8415decb4fea7cb8ad3a2800ecd9c9a9190fa331 | Add rename script in python | rename.py | rename.py | Python | 0.000001 | @@ -0,0 +1,322 @@
+import os%0A%0ASEPARATOR = '_'%0AEXT = %22.png%22%0Adigits = range(1, 10)%0A%0Afor d in digits:%0A%09i = 1%0A%09for file in os.listdir(str(d)):%0A%09%09if file.endswith(EXT):%0A%09%09%09filepath = str(d) + '/'%0A%09%09%09old_filename = filepath + file%0A%09%09%09new_filename = filepath + str(d) + SEP... | |
96cfe4d55ae6dd34cc30a72f19118aa66c65f7ca | add __main__ file to for python 2.7 entrypoint | selenium_odoo_qunit/__main__.py | selenium_odoo_qunit/__main__.py | Python | 0.000007 | @@ -0,0 +1,105 @@
+if __name__ == '__main__':%0A from selenium_odoo_qunit import selenium_odoo_qunit as soq%0A soq.main()%0A
| |
769f350802b78ffa9c74bc5b9a1e912b64ab718d | Add new package: py-asgiref (#16233) | var/spack/repos/builtin/packages/py-asgiref/package.py | var/spack/repos/builtin/packages/py-asgiref/package.py | Python | 0 | @@ -0,0 +1,1486 @@
+# 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 PyAsgiref(PythonPackage):%0A %22%22%22ASGI specificatio... | |
e6e641e3beb2aad3e6d4eb1a37a7ee029006631b | add download_data.py for downloading data from nrao, it is not working yet | aws/download_data.py | aws/download_data.py | Python | 0 | @@ -0,0 +1,1317 @@
+import sys%0Aimport os%0Aimport urllib %0Aimport urllib2 %0Aimport webbrowser%0A%0Afrom mechanize import ParseResponse, urlopen, urljoin, Browser%0A%0Aurl = 'https://archive.nrao.edu/archive/advquery.jsp'%0A%0A%0Adef download_with_mech(email, destination, file):%0A%09'''%0A%09download data from nr... | |
f3ed5d434b83d7531aecd1431645267dedfecb45 | Create mqtt_sender.py | raspi/mqtt_sender.py | raspi/mqtt_sender.py | Python | 0.000002 | @@ -0,0 +1,160 @@
+import paho.mqtt.publish as publish%0A %0AMQTT_SERVER = %22192.168.1.10%22%0AMQTT_PATH = %22test_channel%22%0A %0Apublish.single(MQTT_PATH, %22Hello World!%22, hostname=MQTT_SERVER)%0A
| |
696402e5e292f52f96fc9dcd07457ac54387b21a | Remove fallback related code from backend interface. | redis_cache/cache.py | redis_cache/cache.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.core.cache.backends.base import BaseCache
from django.core.exceptions import ImproperlyConfigured
from django.core.cache import get_cache
from .util import load_class
from .exceptions import ConnectionInterrupted
import functools
DJANGO_REDIS_IGNO... | Python | 0 | @@ -1304,167 +1304,8 @@
ne%0A%0A
- self._fallback_name = options.get('FALLBACK', None)%0A self._fallback = None%0A self._fallback_counter = 0%0A self._on_fallback = False%0A
%0A
@@ -1822,452 +1822,8 @@
e)%0A%0A
- @property%0A def fallback_client(self):%0A %22%22%22%0A ... |
a51a226dc0a134e01915e514e2146a664671d998 | Update dates for CFP | pyconcz_2017/proposals/pyconcz2016_config.py | pyconcz_2017/proposals/pyconcz2016_config.py | from datetime import datetime
from django.utils.timezone import get_current_timezone
from pyconcz_2017.proposals.models import Talk, Workshop, FinancialAid
tz = get_current_timezone()
class TalksConfig:
model = Talk
key = 'talks'
title = 'Talks'
cfp_title = 'Submit your talk'
template_about = '... | Python | 0.000001 | @@ -371,33 +371,33 @@
ime(year=201
-6
+7
, month=
8, day=1, ho
@@ -380,32 +380,32 @@
2017, month=
-8
+3
, day=
-1
+6
, hour=12, m
@@ -452,33 +452,33 @@
ime(year=201
-6
+7
, month=
9, day=15, h
@@ -469,17 +469,17 @@
nth=
-9
+4
, day=1
-5
+7
, ho
@@ -737,25 +737,25 @@
year=201
-6
+7
, month=
8, day=1
@@ -7... |
ca842aee42fcb149e72a39334035cba81e969c65 | add clock | files/bin/bin/clock.py | files/bin/bin/clock.py | Python | 0.000741 | @@ -0,0 +1,1013 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A##############################################################################%0A#%0A# clock%0A# -----%0A#%0A# This script prints an icon representation of the time of day.%0A#%0A# Dependencies: python3, nerd-fonts%0A#%0A# :authors: J.P.H. Bruins... | |
0c09a85ff19a48dd69f44720823e8bb2cb75eef8 | add the visualization of the 1st conv layer kernels | chap9/visualize_conv1_kernels.py | chap9/visualize_conv1_kernels.py | Python | 0 | @@ -0,0 +1,1087 @@
+import sys%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0Aimport cv2%0Asys.path.append('/path/to/caffe/python')%0Aimport caffe%0A%0AZOOM_IN_SIZE = 50%0APAD_SIZE = 4%0A%0AWEIGHTS_FILE = 'freq_regression_iter_10000.caffemodel'%0ADEPLOY_FILE = 'deploy.prototxt'%0A%0Anet = caffe.Net(DEPLOY_FIL... | |
65546f4cd97331455a3309509d076825f07a078c | Add set_up file to run all tests | set_up.py | set_up.py | Python | 0 | @@ -0,0 +1,184 @@
+import os%0Aimport unittest2 as unittest%0A%0Adef suite():%0A return unittest.TestLoader().discover('tests','test_*.py')%0A%0Aif __name__ == '__main__':%0A unittest.main(defaultTest = 'suite')
| |
abea1f4598928fddf750358efcedbfaade019bf4 | Add migration to fix Attachment cache. | zerver/migrations/0386_fix_attachment_caches.py | zerver/migrations/0386_fix_attachment_caches.py | Python | 0 | @@ -0,0 +1,2291 @@
+# Generated by Django 3.2.12 on 2022-03-23 04:32%0A%0Afrom django.db import migrations, models%0Afrom django.db.backends.postgresql.schema import DatabaseSchemaEditor%0Afrom django.db.migrations.state import StateApps%0Afrom django.db.models import Exists, Model, OuterRef%0A%0A%0Adef fix_attachment_... | |
e7232c4050b4cae1302d2c638ed20f3ac69bf22c | comment out ui tests temporarily | tests/ui/test_login.py | tests/ui/test_login.py | import unittest
from tests.common.common import BASE_URL, USERNAME, PASSWORD
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
LOGIN_URL = BASE_URL + u'/accounts/login/'
HOME_URL = BASE_URL + u'/home/my/'
LOGOUT_URL = BASE_URL + u'/accounts/logout/'
def get_logged_instance():
browser ... | Python | 0 | @@ -1,12 +1,14 @@
+#
import unitt
@@ -11,16 +11,18 @@
nittest%0A
+#
from tes
@@ -74,16 +74,18 @@
ASSWORD%0A
+#
from sel
@@ -107,16 +107,18 @@
bdriver%0A
+#
from sel
@@ -158,16 +158,18 @@
t Keys%0A%0A
+#
LOGIN_UR
@@ -203,16 +203,18 @@
login/'%0A
+#
HOME_URL
@@ -240,16 +240,18 @@
me/my/'%0A
+#
LOGOUT_... |
7b063825ca3fbd8a638d56a477d3b2380b7901be | Add tests for list_max_two | domaci-zadaci/06/test_list_max_two.py | domaci-zadaci/06/test_list_max_two.py | Python | 0.00001 | @@ -0,0 +1,1066 @@
+from solutions import list_max_two%0A%0Aimport unittest%0Aimport random%0A%0Aclass TestListMax(unittest.TestCase):%0A def test_two_equal_elements(self):%0A in_list = %5Brandom.randint(0, 1000)%5D * 2%0A%0A expected = (in_list%5B0%5D, in_list%5B1%5D)%0A actual = list_max_two(i... | |
bcb3948eea1903dc0127c8aee1b1decf11040496 | Add tolower simproc. | angr/procedures/libc/tolower.py | angr/procedures/libc/tolower.py | Python | 0 | @@ -0,0 +1,694 @@
+import angr%0Afrom angr.sim_type import SimTypeInt%0A%0Aimport logging%0Al = logging.getLogger(%22angr.procedures.libc.tolower%22)%0A%0A%0Aclass tolower(angr.SimProcedure):%0A def run(self, c):%0A self.argument_types = %7B0: SimTypeInt(self.state.arch, True)%7D%0A self.return_type = ... | |
405bef33c1c68029b31ec6cb8f88b1edc28e2a6e | Create extract_wavelength tests module | tests/plantcv/hyperspectral/test_extract_wavelength.py | tests/plantcv/hyperspectral/test_extract_wavelength.py | Python | 0 | @@ -0,0 +1,280 @@
+import numpy as np%0Afrom plantcv.plantcv.hyperspectral import extract_wavelength%0A%0A%0Adef test_extract_wavelength(hyperspectral_test_data):%0A new = extract_wavelength(spectral_data=hyperspectral_test_data.load_hsi(), wavelength=500)%0A assert np.shape(new.array_data) == (1, 1600)%0A
| |
d1abba72b79262c0b1462d7f7e42c798dc30003e | Create twinkle-status | twinkle-status/edit.py | twinkle-status/edit.py | Python | 0.000245 | @@ -0,0 +1,797 @@
+# -*- coding: utf-8 -*-%0Aimport os%0Aimport re%0A%0Aos.environ%5B'PYWIKIBOT_DIR'%5D = os.path.dirname(os.path.realpath(__file__))%0Aimport pywikibot%0A%0A%0Aos.environ%5B'TZ'%5D = 'UTC'%0A%0Asite = pywikibot.Site()%0Asite.login()%0A%0Awith open('list.txt', 'r') as f:%0A for user in f:%0A u... | |
af062396637c86e5f12fcbf2a8250d6189ac207b | Create flask_fysql_example.py | flask_fysql_example.py | flask_fysql_example.py | Python | 0.000032 | @@ -0,0 +1,958 @@
+# -*- coding: utf-8 -*-%0Afrom fysql.databases import MySQLDatabase%0Afrom flask import current_app as app%0A%0Aclass FySQL(object):%0A config = %7B%7D%0A name = %22%22%0A engine = MySQLDatabase%0A%0A def __init__(self, app=None):%0A self.app = None%0A if app is not None:%0A... | |
8b7c32f2058ce3c24ef3c19eb7d2d3f8d3154037 | Disable large profile startup benchmarks. | tools/perf/benchmarks/startup.py | tools/perf/benchmarks/startup.py | # Copyright 2013 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.
from telemetry import benchmark
from measurements import startup
import page_sets
class _StartupCold(benchmark.Benchmark):
"""Measures cold startup time... | Python | 0.00002 | @@ -1499,32 +1499,147 @@
'linux', 'mac')%0A
+# TODO(erikchen): Investigate source of 30s browser hang on startup.%0A# http://crbug.com/473827%0A@benchmark.Disabled%0A
class StartupLar
@@ -2148,16 +2148,131 @@
'mac')%0A
+# TODO(erikchen): Investigate source of 30s browser hang on startup.%0A# http://crbug.com/473827... |
2ec3614693e8343e04400e51326be5305b5abbf3 | Set a max_length for all snippets. Nobody needs more than 256k of space. | dpaste/forms.py | dpaste/forms.py | from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from dpaste.models import Snippet
from dpaste.highlight import LEXER_LIST, LEXER_DEFAULT
import datetime
#===============================================================================
# Snippet Form and ... | Python | 0 | @@ -572,16 +572,51 @@
4 * 30%0A%0A
+MAX_CONTENT_LENGTH = 250*1024*1024%0A
%0Aclass S
@@ -785,24 +785,63 @@
ere...')%7D),%0A
+ max_length=MAX_CONTENT_LENGTH,%0A
)%0A%0A l
|
0c2d22ed98917c5115a01b3d44172fd9bdd0429f | Fix to api to allow images to launch | django-openstack/django_openstack/api.py | django-openstack/django_openstack/api.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
from django.conf import settings
import logging
import glance.client
import httplib
import json
import openstack.compute
import openstackx.admin
import openstackx.extras
import openstackx.auth
from urlparse import urlparse
import json
def url_for(request, service_name, a... | Python | 0 | @@ -3521,34 +3521,53 @@
lavor, user_data
-,
+=user_data, key_name=
key_name)%0A%0A%0Adef
|
e13e714fa179544bef895274baf4f8ddb52ddd4a | add script to separate source columns to 6 columns with boolean values | python_scripts/seperating_source_column.py | python_scripts/seperating_source_column.py | Python | 0 | @@ -0,0 +1,1331 @@
+%22%22%22%0Aseperating the Variant_Source column merged_v4.tsv into six columns:%0AVariant_in_ENIGMA%0AVariant_in_ClinVar%0AVariant_in_1000_Genomes%0AVariant_in_ExAC%0AVariant_in_LOVD%0AVariant_in_BIC%0A%22%22%22%0A%0ACOLUMNS = %5B%22Variant_in_ENIGMA%22,%0A %22Variant_in_ClinVar%22,%0A ... | |
e0ab65f3877da992ac3705475ea0bdc520677cbe | Test CommandObjectMultiword functionality | packages/Python/lldbsuite/test/functionalities/multiword-commands/TestMultiWordCommands.py | packages/Python/lldbsuite/test/functionalities/multiword-commands/TestMultiWordCommands.py | Python | 0.000177 | @@ -0,0 +1,1152 @@
+%22%22%22%0ATest multiword commands ('platform' in this case).%0A%22%22%22%0A%0Aimport lldb%0Afrom lldbsuite.test.decorators import *%0Afrom lldbsuite.test.lldbtest import *%0A%0Aclass MultiwordCommandsTestCase(TestBase):%0A%0A mydir = TestBase.compute_mydir(__file__)%0A%0A @no_debug_info_test... | |
a23e45a65221ec076059bd32cdb1d5bb787e123b | add less filter | dukpy/webassets/lessfilter.py | dukpy/webassets/lessfilter.py | Python | 0.000001 | @@ -0,0 +1,703 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import, print_function%0A%0Aimport os%0A%0Afrom webassets.filter import Filter%0A%0Aimport dukpy%0A%0A%0A__all__ = ('CompileLess', )%0A%0A%0Aclass CompileLess(Filter):%0A name = 'lessc'%0A max_debug_level = None%0A%0A def setup(self):... | |
0f251e6c8620e19fc5e16e88b1ffbd5d51f7a7be | Add initial HDF storage class | gcmstools/datastore.py | gcmstools/datastore.py | Python | 0 | @@ -0,0 +1,1953 @@
+import numpy as np%0Aimport pandas as pd%0Aimport tables as tb%0A%0Aclass HDFStore(object):%0A def __init__(self, hdfname):%0A self.pdh5 = pd.HDFStore(hdfname, mode='a', complevel=9,%0A complib='blosc')%0A self.h5 = self.pdh5._handle%0A self._filters = tb.Filte... | |
585a5fa27321134623dcf431ebf80ba1dcd708de | add example script test equality of coefficients in two regression (basic example for onewaygls) | scikits/statsmodels/examples/try_2regress.py | scikits/statsmodels/examples/try_2regress.py | Python | 0 | @@ -0,0 +1,1868 @@
+# -*- coding: utf-8 -*-%0A%22%22%22F test for null hypothesis that coefficients in two regressions are the same%0A%0Asee discussion in http://mail.scipy.org/pipermail/scipy-user/2010-March/024851.html%0A%0ACreated on Thu Mar 25 22:56:45 2010%0AAuthor: josef-pktd%0A%22%22%22%0A%0Aimport numpy as np%0... | |
06945ae360bdab9726ea78757d8e63b10ea252fe | Create cbalusek_02.py | Week01/Problem02/cbalusek_02.py | Week01/Problem02/cbalusek_02.py | Python | 0.000182 | @@ -0,0 +1,297 @@
+%22%22%22%0ACreated on Fri Jul 21 10:17:21 2017%0AThis short program will sum all of the even numbers in the fibonnacci%0Asequence less than 4 million.%0A@author: cbalusek3%0A%22%22%22%0A%0Ai1 = 1%0Ai2 = 2%0Acum = 0%0Awhile i2 %3C 4000000:%0A itemp = i2%0A i2 += i1%0A i1 = itemp%0A if i2%... | |
5e42ed2908f6186db4da92f283ca9b9b30ac9e31 | Add executable file | bin/paxit.py | bin/paxit.py | Python | 0.000009 | @@ -0,0 +1,249 @@
+#!/usr/bin/env python%0Afrom pax import pax%0A%0Aif __name__ == '__main__':%0A pax.Processor(input='DumbExample.DumbExampleInput',%0A transform='DumbExample.DumbExampleTransform',%0A output='DumbExample.DumbExampleOutput')%0A%0A
| |
74c2563f55c71ff8d3d2cbb7ff2b69a4be8767ec | Create client.py | client.py | client.py | Python | 0.000001 | @@ -0,0 +1,152 @@
+#!/usr/bin/env python%0A%0A# TODO take user choice for c2 method%0A%0A# TODO start with pipe delimited HTTP POST data to test%0A%0A# TODO loop and output to STDOUT%0A
| |
6693c02315ba16c8a849c7a1892397bf819a2efd | Add meshDisplay commands | app/module/polygon/meshDisplay.py | app/module/polygon/meshDisplay.py | Python | 0.000001 | @@ -0,0 +1,1213 @@
+import maya.cmds as cmds%0D%0Aimport maya.mel as mel%0D%0A%0D%0A%0D%0A# class name must be 'Commands'%0D%0Aclass Commands(object):%0D%0A%0D%0A commandDict = %7B%7D%0D%0A%0D%0A def _applyColor(self):%0D%0A mel.eval(%22polyColorPerVertex -r 0.5 -g 0.5 -b 0.5 -a 1 -cdo;%22)%0D%0A comman... | |
65df19a82df1432f72674eb35765937aa6c889eb | Add migration removing database columns following removal of FileUpload fields (#16035) | src/olympia/files/migrations/0005_auto_20201120_0926.py | src/olympia/files/migrations/0005_auto_20201120_0926.py | Python | 0 | @@ -0,0 +1,581 @@
+# Generated by Django 2.2.17 on 2020-11-20 09:26%0A%0Afrom django.db import migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('files', '0004_auto_20200923_1808'),%0A %5D%0A%0A operations = %5B%0A migrations.RemoveIndex(%0A model_n... | |
48d7fc87c51cb15829e9cf161b38dc004affee9e | ADD example_sequential | example/example_sequential.py | example/example_sequential.py | Python | 0.000004 | @@ -0,0 +1,1347 @@
+import sklearn.cross_validation%0Aimport sklearn.datasets%0Aimport sklearn.metrics%0A%0Aimport autosklearn.classification%0A%0A%0Adef main():%0A digits = sklearn.datasets.load_digits()%0A X = digits.data%0A y = digits.target%0A X_train, X_test, y_train, y_test = %5C%0A sklearn.cro... | |
3246873aad0482b9087663f452c2fe32c37daa36 | Add new migration | custom/icds_reports/migrations/0101_auto_20190227_1801.py | custom/icds_reports/migrations/0101_auto_20190227_1801.py | Python | 0 | @@ -0,0 +1,1468 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.20 on 2019-02-27 18:01%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('icds_reports', '0100_add_supervisor_id'),%0A %... | |
c1d04467fdc58e4f97e7768f77706ac4c8099c42 | clear the error queue | src/cryptography/hazmat/bindings/openssl/binding.py | src/cryptography/hazmat/bindings/openssl/binding.py | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import os
import threading
from cryptography.hazmat.bindings._openssl im... | Python | 0 | @@ -1167,24 +1167,61 @@
m_engine():%0A
+ assert lib.ERR_peek_error() == 0%0A
looked_u
@@ -1318,16 +1318,84 @@
-return 2
+assert lib.ERR_peek_error() == 0%0A return 2%0A%0A lib.ERR_clear_error()
%0A%0A
|
d7cd9951581df833ac3e6eecd099035f2d30df0e | Add initial Starling mapping | csv2ofx/mappings/starling.py | csv2ofx/mappings/starling.py | Python | 0 | @@ -0,0 +1,477 @@
+from __future__ import (%0A absolute_import, division, print_function, unicode_literals)%0A%0Afrom operator import itemgetter%0A%0A%0Adef fixdate(ds):%0A dmy = ds.split('/')%0A # BUG (!?): don't understand but stolen from ubs-ch-fr.py%0A return '.'.join((dmy%5B1%5D, dmy%5B0%5D, dmy%5B2%5D... | |
67a5e2797e362bb5a38b8af5b05cf72d1e28a262 | add import script for Wokingham (closes #795) | polling_stations/apps/data_collection/management/commands/import_wokingham.py | polling_stations/apps/data_collection/management/commands/import_wokingham.py | Python | 0 | @@ -0,0 +1,344 @@
+from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter%0A%0Aclass Command(BaseXpressDemocracyClubCsvImporter):%0A council_id = 'E06000041'%0A addresses_name = 'parl.2017-06-08/Version 1/merged.tsv'%0A stations_name = 'parl.2017-06-08/Version 1/merged.tsv'%0A el... | |
c86b61a23ad9b3a152bb6644cb5dde5a4b42fbc9 | Add Management Command to Dump Project and RemoteRepository Relationship in JSON format | readthedocs/projects/management/commands/dump_project_remote_repo_relation.py | readthedocs/projects/management/commands/dump_project_remote_repo_relation.py | Python | 0 | @@ -0,0 +1,1589 @@
+import json%0A%0Afrom django.core.management.base import BaseCommand%0A%0Afrom readthedocs.projects.models import Project%0A%0A%0Aclass Command(BaseCommand):%0A help = %22Dump Project and RemoteRepository Relationship in JSON format%22%0A%0A def handle(self, *args, **options):%0A data =... | |
e358061bb433c52b8d545791582d71cd4eab48a7 | Move example to README.md | lib/storage/ellipticsbackend.py | lib/storage/ellipticsbackend.py | """
Elliptics is a fault tolerant distributed key/value storage.
See http://reverbrain.com/elliptics and
https://github.com/reverbrain/elliptics for additional info.
Docs: http://doc.reverbrain.com/
Deployment guide: http://doc.reverbrain.com/elliptics:server-tutorial
Packages: http://repo.reverbrain.com/
"""
import ... | Python | 0.000002 | @@ -472,597 +472,8 @@
g):%0A
- %22%22%22%0A Example:%0A%0A storage: elliptics%0A nodes:%0A elliptics-host1: 1025%0A elliptics-host2: 1025%0A ...%0A %3ChostN%3E: %3Cport%3E%0A wait-timeout: 60%0A ch... |
0f92843ec20007dc4379ff88d2e711bdad5e9125 | Add ftp module, the backend for salt-ftp | salt/cli/ftp.py | salt/cli/ftp.py | Python | 0.000001 | @@ -0,0 +1,2236 @@
+'''%0AThe ftp module is used to execute the logic used by the salt-ftp command%0Aline application, salt-ftp is NOT intended to broadcast large files, it is%0Aintened to handle text files.%0ASalt-ftp can be used to distribute configuration files%0A'''%0A# Import python modules%0Aimport os%0Aimport st... | |
b6e0daa9ee06961743ad5a5f728f3385bfdb0b4c | Add a helper script to apply changes in zuul | playbooks/roles/ironic-install/files/parse_zuul_changes.py | playbooks/roles/ironic-install/files/parse_zuul_changes.py | Python | 0 | @@ -0,0 +1,2318 @@
+#!/usr/bin/env python%0A%0A# (c) 2015, Hewlett-Packard Development Company, L.P.%0A#%0A# This module 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%... | |
bc40b4c25c4f45d8d1e75963bb84fad2e1008762 | Past 12, should ideally be in day 9 | day8/stringCompression.py | day8/stringCompression.py | Python | 0.999977 | @@ -0,0 +1,624 @@
+import unittest%0Afrom collections import Counter%0A%0Adef stringCompression(str1):%0A dicty = dict(Counter(str1))%0A result = %5B%5D%0A for x in sorted(dicty.keys()):%0A temp = x + str(dicty%5Bx%5D)%0A result.append(temp)%0A result = ''.join(result)%0A if(len(result)%3El... | |
855fe9e95651626c2737c65424ad1067f253e28a | Implement invisible user mode | txircd/modules/rfc/umode_i.py | txircd/modules/rfc/umode_i.py | Python | 0.000047 | @@ -0,0 +1,956 @@
+from twisted.plugin import IPlugin%0Afrom txircd.module_interface import IMode, IModuleData, Mode, ModuleData%0Afrom txircd.utils import ModeType%0Afrom zope.interface import implements%0A%0Aclass InvisibleMode(ModuleData, Mode):%0A implements(IPlugin, IModuleData, IMode)%0A %0A name = %22In... | |
cfec967be4602dff636adb951b582d1db114f578 | Add single dataset doc gen | tensorflow_datasets/scripts/document_dataset_version.py | tensorflow_datasets/scripts/document_dataset_version.py | Python | 0.000001 | @@ -0,0 +1,1653 @@
+# coding=utf-8%0A# Copyright 2020 The TensorFlow Datasets 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... | |
ba5a251896e51bab70fa6b664e6974d3c42ff7b4 | add asciidoctor gem (#9905) | var/spack/repos/builtin/packages/asciidoctor/package.py | var/spack/repos/builtin/packages/asciidoctor/package.py | Python | 0 | @@ -0,0 +1,604 @@
+# Copyright 2013-2018 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 Asciidoctor(Package):%0A %22%22%22Modern asciidoc tool b... | |
a189203bf2dc7ddd925ed8cfbeb191ee52d43711 | Add Python script to investigate s3 speeds | src/aws_scripts/benchmark_s3.py | src/aws_scripts/benchmark_s3.py | Python | 0.000001 | @@ -0,0 +1,1776 @@
+from __future__ import print_function%0Aimport boto3%0Aimport subprocess%0Aimport os%0Aimport pandas as pd%0Aimport time%0A%0Adef DownloadFile(local_file, bucket, bucket_path):%0A print(%22Downloading file...%22, end=%22%22)%0A s3 = boto3.resource('s3')%0A s3.Bucket(bucket).download_file(bu... | |
a78e2566d26b229192e94fecb3c89801afbdce02 | Create MQTT.py | service/MQTT.py | service/MQTT.py | Python | 0 | @@ -0,0 +1,365 @@
+from time import sleep%0A%0Atopic = %22mrl%22%0Aqos = 2%0Abroker = %22tcp://iot.eclipse.org:1883%22 //if you have your own just change the hostname/IP%0AclientID = %22MRL MQTT python%22%0A%0Amqtt1 = Runtime.createAndStart(%22mqtt%22, %22MQTT%22)%0Amqtt1.startService()%0Aprint mqtt1.getDescription()%0... | |
2f0be29357a8b649b59cd685eb6dea646813feac | Add discovery example (#361) | examples/discovery_example.py | examples/discovery_example.py | Python | 0 | @@ -0,0 +1,1005 @@
+%22%22%22%0AExample that shows how to receive updates on discovered chromecasts.%0A%22%22%22%0Aimport argparse%0Aimport logging%0Aimport time%0A%0Aimport pychromecast%0A%0Aparser = argparse.ArgumentParser(description=%22Example on how to receive updates on discovered chromecasts.%22)%0Aparser.add_ar... | |
182d4229f6293eec791a5eba716917ace3bcfaca | Make looking for outliers easier | cal_pipe/manual_outlier_flag.py | cal_pipe/manual_outlier_flag.py | Python | 0.000013 | @@ -0,0 +1,1028 @@
+%0Aimport sys%0A%0A'''%0ACheck for garbage points in a MS by SPW.%0A'''%0A%0Atry:%0A vis_name = sys.argv%5B1%5D%0A corrstring = sys.argv%5B2%5D%0A starting_spw = int(sys.argv%5B3%5D)%0Aexcept IndexError:%0A vis_name = raw_input(%22MS Name? : %22)%0A corrstring = raw_input(%22Corrstrin... | |
8bf7b5ae2464721be8270b159b99cd728109f000 | Create __init__.py | Python_Version/Ex7.K-Means_PCA_-_Clustering/__init__.py | Python_Version/Ex7.K-Means_PCA_-_Clustering/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
13056d362fceb0aa20487a440c7347ad4231ea97 | Add tiltoc.py | tiltoc.py | tiltoc.py | Python | 0.001485 | @@ -0,0 +1,2065 @@
+import os%0Afrom datetime import datetime%0A%0A# Directory%0Aroot = os.getcwd()%0A%0A# Exclude%0Aexcludes = (root, %22drafts%22)%0A%0Adef relative(root, path):%0A return '/'.join(path.replace(root, '').split(os.path.sep)%5B1:%5D)%0A%0Adef tils(root):%0A for (path, dirs, files) in os.walk(root)... | |
7fa62ea8374c839f8f188f34505de4d3114e6b56 | Create app.py | channels/r_BetterEveryLoop/app.py | channels/r_BetterEveryLoop/app.py | Python | 0.000003 | @@ -0,0 +1,1720 @@
+#encoding:utf-8%0A%0Afrom utils import get_url, weighted_random_subreddit%0A%0A%0A# Subreddit that will be a source of content%0Asubreddit = weighted_random_subreddit(%7B%0A 'BetterEveryLoop': 1.0,%0A # If we want get content from several subreddits%0A # please provide here 'subreddit': pro... | |
7a8c6520beb7dfb086d1c9b5254e7083d694f35c | check for globals in the lib that are not prefixed with toku. addresses #74 | src/tokuglobals.py | src/tokuglobals.py | Python | 0.00001 | @@ -0,0 +1,1252 @@
+#!/usr/bin/python%0A%0Aimport sys%0Aimport os%0Aimport re%0A%0Adef checkglobals(libname, exceptsymbols, verbose):%0A badglobals = 0%0A nmcmd = %22nm -g %22 + libname%0A f = os.popen(nmcmd)%0A b = f.readline()%0A while b != %22%22:%0A match = re.match(%22%5E(%5B0-9a-f%5D+)%5Cs(.... | |
e53adf003c38f826b82a090489b2deb8c438dece | Version bump to 0.16 | homeassistant/const.py | homeassistant/const.py | # coding: utf-8
"""Constants used by Home Assistant components."""
__version__ = "0.16.0.dev0"
REQUIRED_PYTHON_VER = (3, 4)
# Can be used to specify a catch all when registering state or event listeners.
MATCH_ALL = '*'
# If no name is specified
DEVICE_DEFAULT_NAME = "Unnamed Device"
# #### CONFIG ####
CONF_ICON = ... | Python | 0 | @@ -86,13 +86,8 @@
16.0
-.dev0
%22%0ARE
|
f709f00e5c4e112774cebbc7ab3f546354290da8 | Create human_readable_time.py | human_readable_time.py | human_readable_time.py | Python | 0.002008 | @@ -0,0 +1,269 @@
+#Kunal Gautam%0A#Codewars : @Kunalpod%0A#Problem name: Human Readable Time%0A#Problem level: 5 kyu%0A%0Adef make_readable(seconds):%0A s = '%7B:0%3E2%7D'.format(seconds%2560) %0A m = '%7B:0%3E2%7D'.format((seconds//60)%2560)%0A h = '%7B:0%3E2%7D'.format(seconds//3600)%0A return ':'.join(%... | |
17d1bb1e381a1bfcbf0a4dab866dedf2840d1d26 | substrings must be of length 3 | 043_sub_string_divisibility.py | 043_sub_string_divisibility.py | Python | 0.999999 | @@ -0,0 +1,927 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A#%0A# A Solution to %22Sub-string divisibility%22 %E2%80%93 Project Euler Problem No. 43%0A# by Florian Buetow%0A#%0A# Sourcecode: https://github.com/fbcom/project-euler%0A# Problem statement: https://projecteuler.net/problem=43%0Aimport itertools%0A%... | |
56e51e48de854c83870549c1cab2893c24116734 | add tests | check_mk_web_api/test_WebApi.py | check_mk_web_api/test_WebApi.py | Python | 0 | @@ -0,0 +1,2372 @@
+import os%0A%0Aimport pytest%0A%0Afrom check_mk_web_api import WebApi, CheckMkWebApiException%0A%0Aapi = WebApi(%0A os.environ%5B'CHECK_MK_URL'%5D,%0A os.environ%5B'CHECK_MK_USER'%5D,%0A os.environ%5B'CHECK_MK_SECRET'%5D%0A)%0A%0A%0Adef setup():%0A api.delete_all_hosts()%0A%0A%0Adef test... | |
bb638c49f0a73289392e63dff7bec6e9b49b8199 | Add a simple wrapper around losetup | datapath/raw+file/losetup.py | datapath/raw+file/losetup.py | Python | 0 | @@ -0,0 +1,1323 @@
+#!/usr/bin/env python%0A%0Aimport xapi%0Aimport commands%0A%0Adef log(txt):%0A print %3E%3Esys.stderr, txt%0A%0A# %5Brun dbg cmd%5D executes %5Bcmd%5D, throwing a BackendError if exits with%0A# a non-zero exit code.%0Adef run(dbg, cmd):%0A code, output = commands.getstatusoutput(cmd)%0A if ... | |
79f7a947d9fbf1903957aea0ef459bee53d2ba82 | use subnet_service_types extension from neutron-lib | neutron/extensions/subnet_service_types.py | neutron/extensions/subnet_service_types.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.000003 | @@ -616,19 +616,29 @@
bnet
- as subnet_
+_service_types as api
def%0A
@@ -680,1772 +680,8 @@
ons%0A
-from neutron_lib.api import validators%0Afrom neutron_lib import constants%0Afrom neutron_lib import exceptions%0Aimport six%0Aimport webob.exc%0A%0Afrom neutron._i18n import _%0A%0A%0A# List for service plugins to r... |
cd8110b0ca4d53477b8331af2317e267da057df6 | add example 'audit' where chat is replicated in a secondary space | examples/audit.py | examples/audit.py | Python | 0 | @@ -0,0 +1,2745 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A# Licensed to the Apache Software Foundation (ASF) under one or more%0A# contributor license agreements. See the NOTICE file distributed with%0A# this work for additional information regarding copyright ownership.%0A# The ASF licenses this file t... | |
0229c868a8f204759c76ecae92cecc4e7a6312b5 | Add link module + Link class stub | flask_hal/link.py | flask_hal/link.py | Python | 0 | @@ -0,0 +1,679 @@
+#!/usr/bin/env python%0A# encoding: utf-8%0A%0A%22%22%22%0Aflask_hal.link%0A==============%0A%0AImplements the %60%60HAL%60%60 Link specification.%0A%22%22%22%0A%0A%0Aclass Link(object):%0A %22%22%22%0A %22%22%22%0A%0A def __init__(%0A self,%0A href,%0A name=... | |
34206ab96b5546e617b1478f59357a6a3f7ed8b6 | Add a custom gunicorn Sync worker implementation which works around some issues which occur when eventlet monkey patching is used with sync worker. | st2common/st2common/util/gunicorn_workers.py | st2common/st2common/util/gunicorn_workers.py | Python | 0 | @@ -0,0 +1,1568 @@
+# 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... | |
1650824ef5886a12715bd0004e95ab3bf4dc5dfd | Add new package: phoenix (#18143) | var/spack/repos/builtin/packages/phoenix/package.py | var/spack/repos/builtin/packages/phoenix/package.py | Python | 0 | @@ -0,0 +1,745 @@
+# 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 Phoenix(Package):%0A %22%22%22Apache Phoenix is a SQL sk... | |
7b688747a02f9ac29d4f119bf142f7ef0ad805e9 | Test for COM collections; IEnumVariant so far only. | comtypes/test/test_collections.py | comtypes/test/test_collections.py | Python | 0 | @@ -0,0 +1,2279 @@
+import unittest%0Afrom comtypes.client import CreateObject, GetModule #, Constants%0Afrom find_memleak import find_memleak%0Afrom ctypes import ArgumentError%0A%0Aclass Test(unittest.TestCase):%0A%0A def test_IEnumVARIANT(self):%0A # The XP firewall manager.%0A fwmgr = CreateObject(... | |
e055cc963eb5eb05c2685ae75d1614c81ef3c59a | load qld data into elasticsearch | injest/search_index.py | injest/search_index.py | Python | 0 | @@ -0,0 +1,865 @@
+# -*- coding: utf-8 -*-%0A%0A%22%22%22%0AThis module contains the code for putting heritage places into a search index.%0A%0A%22%22%22%0A%0Afrom elasticsearch import Elasticsearch%0A%0AES_HOST = %22192.168.10.200%22%0A%0Aes = Elasticsearch(ES_HOST)%0A%0A%0Adef add_heritage_place(place):%0A %22%22%... | |
7cc0f1cc461d6ccd4c191ec243184deab7f1028f | Create strings.py | strings/strings.py | strings/strings.py | Python | 0.999865 | @@ -0,0 +1 @@
+%0A
| |
6917e3b8689ace77bda912f82163f0f91a1a881b | Solve conflict in DB schema for circle CI | digikey/migrations/0022_merge.py | digikey/migrations/0022_merge.py | Python | 0.001334 | @@ -0,0 +1,284 @@
+# -*- 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 ('digikey', '0019_merge'),%0A ('digikey', '0021_auto_20151125_1353'),%0A %5D%0A%0A operatio... | |
502e04b031036ea4506c85efb2903a85647627f8 | remove logout_path from public_urls (CVE-2015-5963) | django_auth_policy/middleware.py | django_auth_policy/middleware.py | import logging
from django.core.urlresolvers import resolve, reverse
from django.views.decorators.csrf import requires_csrf_token
from django.conf import settings
from django import http
from django_auth_policy.handlers import PasswordChangePolicyHandler
from django_auth_policy.forms import StrictPasswordChangeForm
f... | Python | 0 | @@ -5358,44 +5358,8 @@
ath)
-%0A public_urls.append(logout_path)
%0A%0A
|
5155312d5ce092cc0e1e6e8724ae2d4f0e03cb04 | Add pylint disable for alembic in CA migration | src/ggrc/migrations/versions/20160208143508_1839dabd2357_custom_attributes_should_be_unique.py | src/ggrc/migrations/versions/20160208143508_1839dabd2357_custom_attributes_should_be_unique.py | # Copyright (C) 2015 Reciprocity, Inc - All Rights Reserved
# Unauthorized use, copying, distribution, displaying, or public performance
# of this file, via any medium, is strictly prohibited. All information
# contained herein is proprietary and confidential and may not be shared
# with any third party without the exp... | Python | 0 | @@ -666,16 +666,78 @@
t text%0A%0A
+# mandatory alembic variables%0A# pylint: disable=invalid-name%0A%0A
# revisi
|
875ca73c4cab4c3d036f824c3942589f0ced935f | Test password update | tests/services/authentication/test_update_password_hash.py | tests/services/authentication/test_update_password_hash.py | Python | 0.000001 | @@ -0,0 +1,1637 @@
+%22%22%22%0A:Copyright: 2006-2017 Jochen Kupperschmidt%0A:License: Modified BSD, see LICENSE for details.%0A%22%22%22%0A%0Afrom byceps.services.authentication.password.models import Credential%0Afrom byceps.services.authentication.password import service as password_service%0Afrom byceps.services.us... | |
4b040fd365c2a8609b2943525b87c2e27924eb19 | add novaclient sample | test-novaclient.py | test-novaclient.py | Python | 0 | @@ -0,0 +1,664 @@
+from novaclient.v1_1.client import Client%0A%0Acontext = %7B%0A 'user': 'admin',%0A 'auth_token': '22b07d939fa544769bf625753ecaec18',%0A 'tenant': '7dfd3b6a98664f7cb78808f57b7984da',%0A%7D%0A%0A# nova_compute_url%0Aurl = 'http://192.168.242.10:8774/v2/7dfd3b6a98664f7cb78808f57b7984da'%0APROX... | |
1d355343700bd74ebc2944053e5086a22c1c0b5c | add post-commit.py | git/post-commit.py | git/post-commit.py | Python | 0 | @@ -0,0 +1,1560 @@
+#!/usr/bin/python%0Aimport os%0Aimport re%0Aimport subprocess as sp%0A%0A%0Adef up_version(ver, idx):%0A ver%5Bidx%5D += 1%0A return ver%5B:idx + 1%5D + %5B0%5D * (3 - idx)%0A%0Acommands = %7B%0A '#vtwe++': lambda ver: up_version(ver, 3),%0A '#vpat++': lambda ver: up_version(ver, 2),%0A ... | |
b778e3438909d290ce88bbb0d187aa793652ff5e | Create euler2.py | euler2.py | euler2.py | Python | 0.000001 | @@ -0,0 +1 @@
+%0A
| |
fe7e82257703e3c5773d3e321435cb4443eed46d | Add gunicorn configuration file | gunicorn_config.py | gunicorn_config.py | Python | 0 | @@ -0,0 +1,214 @@
+import multiprocessing, os.path%0A%0A%0Acommand = '/usr/local/bin/gunicorn'%0Apythonpath = os.path.dirname( os.path.abspath(__file__) )%0Abind = '127.0.0.1:9000'%0Aworkers = multiprocessing.cpu_count() * 2 + 1%0Auser = 'nobody'%0A
| |
91370b54e4a974fe51f563edda75e2738d3fb00c | Add noise sensor | haffmpeg/sensor.py | haffmpeg/sensor.py | Python | 0.000004 | @@ -0,0 +1,859 @@
+%22%22%22For HA camera components.%22%22%22%0Afrom .core import HAFFmpegQue%0A%0A%0Aclass SensorNoise(HAFFmpegQue):%0A %22%22%22Implement a noise detection on a autio stream.%22%22%22%0A%0A def __init__(self, ffmpeg_bin):%0A %22%22%22Init CameraMjpeg.%22%22%22%0A HAFFmpegQue.__ini... | |
65f05e93edc2e9a7033edb8d54bd25b04c32d084 | test script.. | test_elemaccess.py | test_elemaccess.py | Python | 0 | @@ -0,0 +1,165 @@
+from cern import cpymad%0Alhc=cpymad.model('lhc')%0Aprint lhc.get_sequences()%0Aall_elements=lhc.get_element_list('lhcb1')%0Aprint lhc.get_element('lhcb1',all_elements%5B3%5D)%0A%0A
| |
10ac7ea7a67b7a15146ae7c9c0ba9ba74876df81 | Add a testcase for RubyGems | tests/test_gems.py | tests/test_gems.py | Python | 0.000005 | @@ -0,0 +1,205 @@
+from tests.helper import ExternalVersionTestCase%0A%0A%0Aclass RubyGemsTest(ExternalVersionTestCase):%0A def test_gems(self):%0A self.assertEqual(self.sync_get_version(%22example%22, %7B%22gems%22: None%7D), %221.0.2%22)%0A
| |
e9115cb3c52386dc7b74b4d06070b44697725811 | Add manage.py | tests/manage.py | tests/manage.py | Python | 0.000001 | @@ -0,0 +1,219 @@
+import os%0Aimport sys%0A%0Aif __name__ == %22__main__%22:%0A os.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22, %22config%22)%0A%0A from django.core.management import execute_from_command_line%0A%0A execute_from_command_line(sys.argv)%0A%0A
| |
9eaf735bcdba9f3fd8a51219d0eebb61f8b2f166 | add 20.6.7 | var/spack/repos/builtin/packages/py-setuptools/package.py | var/spack/repos/builtin/packages/py-setuptools/package.py | from spack import *
class PySetuptools(Package):
"""Easily download, build, install, upgrade, and uninstall Python packages."""
homepage = "https://pypi.python.org/pypi/setuptools"
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-11.3.tar.gz"
version('20.5', 'fadc1e1123ddbe3... | Python | 0.000002 | @@ -277,16 +277,74 @@
ar.gz%22%0A%0A
+ version('20.6.7', '45d6110f3ec14924e44c33411db64fe6')%0A
vers
|
bcc48ecba38450bd77b5dcce7ae60d2966cbd7d2 | Migrate object_sections to relationships | src/ggrc/migrations/versions/20150521150652_23880aa43323_migrate_object_sections_to_relationships.py | src/ggrc/migrations/versions/20150521150652_23880aa43323_migrate_object_sections_to_relationships.py | Python | 0.000103 | @@ -0,0 +1,1490 @@
+# Copyright (C) 2015 Google Inc., authors, and contributors %3Csee AUTHORS file%3E%0A# Licensed under http://www.apache.org/licenses/LICENSE-2.0 %3Csee LICENSE file%3E%0A# Created By: anze@reciprocitylabs.com%0A# Maintained By: anze@reciprocitylabs.com%0A%0A%22%22%22Migrate object_sections to relati... | |
2f0bf45ec747778d38801892e97d5a902443841d | Define "Assessment updated" notification type | src/ggrc/migrations/versions/20170207134238_562ec606ff7c_add_assessment_updated_notification_type.py | src/ggrc/migrations/versions/20170207134238_562ec606ff7c_add_assessment_updated_notification_type.py | Python | 0.000001 | @@ -0,0 +1,1582 @@
+# Copyright (C) 2017 Google Inc.%0A# Licensed under http://www.apache.org/licenses/LICENSE-2.0 %3Csee LICENSE file%3E%0A%0A%22%22%22%0AAdd Assessment updated notification type%0A%0ACreate Date: 2017-02-07 13:42:38.921370%0A%22%22%22%0A# disable Invalid constant name pylint warning for mandatory Alem... | |
3ec80d1a0de750af7831cca5a29294558600e88f | Add python_bootstrap.py | xunit-autolabeler-v2/ast_parser/python/python_bootstrap.py | xunit-autolabeler-v2/ast_parser/python/python_bootstrap.py | Python | 0.999875 | @@ -0,0 +1,977 @@
+# Copyright 2020 Google 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# Unless required by a... | |
3ccc8357d5d5466acc97f1b065f500e9b096eeb7 | add exception for cursor | addons/mrp/wizard/wizard_procurement.py | addons/mrp/wizard/wizard_procurement.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | Python | 0 | @@ -1370,16 +1370,29 @@
ursor()%0A
+ try:%0A
proc
@@ -1426,16 +1426,20 @@
ement')%0A
+
proc
@@ -1512,16 +1512,48 @@
ontext)%0A
+ finally:%0A cr.close()%0A
retu
|
f1145fc98f825b20452dd924d287349b4a8ae628 | Update templates.py | infra/templates.py | infra/templates.py | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | Python | 0.000001 | @@ -2364,32 +2364,56 @@
it c
-heckout put git url here
+lone %3Cgit_url%3E # or use other version control
%0ACOP
|
7318cadbb63cd2077ba73dd16cade2165a702c8a | Change client side tests to work with functions.py | distarray/tests/test_umath.py | distarray/tests/test_umath.py | """
Tests for distarray ufuncs.
Many of these tests require a 4-engine cluster to be running locally.
"""
import unittest
import warnings
import numpy as np
from IPython.parallel import Client
from distarray.context import Context
from numpy.testing import assert_array_equal
def add_checkers(cls, ops, checker_name)... | Python | 0 | @@ -133,16 +133,17 @@
arnings%0A
+%0A
import n
@@ -153,16 +153,61 @@
y as np%0A
+from numpy.testing import assert_array_equal%0A
from IPy
@@ -234,20 +234,23 @@
Client%0A
-from
+%0Aimport
distarr
@@ -255,76 +255,38 @@
rray
-.context import Context%0Afrom numpy.testing import assert_array_equal
+%0Afrom distarra... |
4efc039389b9aab3813a3815a58281c898f1acfd | Create user_exceptions.py | user_exceptions.py | user_exceptions.py | Python | 0.000005 | @@ -0,0 +1,764 @@
+#/bin/python%0A# Python program for playing around with user defined exceptions%0A%0Aclass TooSmallError(Exception):%0A message = %22Too small! Try again ;)%22%0A%0Aclass TooBigError(Exception):%0A message = %22Too big! Try again ;)%22%0A %0Aclass ExactError(Exception):%0A def __init__(self):%0A ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.