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 |
|---|---|---|---|---|---|---|---|
fe10c79f1ab490f7e89430a50e88caa5fd5a979a | version fixed to dev | nipype/info.py | nipype/info.py | """ This file contains defines parameters for nipy that we use to fill
settings in setup.py, the nipy top-level docstring, and for building the
docs. In setup.py in particular, we exec this file, so it cannot import nipy
"""
# nipy version information. An empty _version_extra corresponds to a
# full release. '.dev... | Python | 0.000002 | @@ -416,17 +416,17 @@
minor =
-5
+6
%0A_versio
@@ -435,17 +435,17 @@
micro =
-3
+0
%0A_versio
@@ -455,16 +455,20 @@
xtra = '
+.dev
'%0A%0Adef g
|
86861db1c67ac4c5b069e0035ed33c18100d582e | Add a default tokenizer | spicedham/split_tokenizer.py | spicedham/split_tokenizer.py | Python | 0.000008 | @@ -0,0 +1,499 @@
+from re import split%0A%0Afrom spicedham.tokenizer import BaseTokenizer%0A%0Aclass SplitTokenizer(BaseTokenizer):%0A %0A def tokenize(self, text):%0A %22%22%22%0A Split the text on punctuation and newlines, lowercase everything, and%0A filter the empty strings%0A %22... | |
7cfb25047b7c7d463b0293854c55242798cd9d33 | Remove the test runner line I had in there by accident. | build/all.gyp | build/all.gyp | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'includes': [
'common.gypi',
],
'targets': [
{
'target_name': 'All',
'type': 'none',
'xcode_create_dependents_test_runn... | Python | 0.9999 | @@ -3716,60 +3716,8 @@
g',%0A
- 'xcode_create_dependents_test_runner': 1,%0A
|
dbe697ba4c74f2552678775ff25cb266d52cd312 | Update build script. | build-plugin.py | build-plugin.py | import os
UnrealEnginePath='~/workspace/UnrealEngine/Engine'
UATScript = os.path.join(UnrealEnginePath, 'Build/BatchFiles/RunUAT.sh')
if not os.path.isfile(UATScript):
print('Can not find Automation Script of UE4 %s' % UATScript)
print('Please set UnrealEnginePath correctly first')
FullPluginFile = os.path.abs... | Python | 0 | @@ -285,16 +285,26 @@
first')%0A
+else:%0A
FullPlug
@@ -352,18 +352,18 @@
n')%0A
-os.system(
+ cmd =
'%25s
@@ -415,10 +415,43 @@
ginFile)
+%0A print(cmd)%0A os.system(cmd
)%0A
|
50c8258f657837f5be36e1d449702da58ee22531 | add an incredibly basic test script | census/tests.py | census/tests.py | Python | 0 | @@ -0,0 +1,708 @@
+import os%0Aimport unittest%0A%0Afrom core import Census, UnsupportedYearException%0A%0AKEY = os.environ.get('CENSUS_KEY', '')%0A%0A%0Aclass TestUnsupportedYears(unittest.TestCase):%0A%0A def setUp(self):%0A self.client = Census(KEY, year=2008)%0A%0A def test_acs(self):%0A self.as... | |
aec48ebe3b0431fe39e3f59dc92b8e66eaddb318 | Add languagebar.py | panel/languagebar.py | panel/languagebar.py | Python | 0.000003 | @@ -0,0 +1,1901 @@
+import gtk%0Aimport gtk.gdk as gdk%0Aimport gobject%0Afrom image import Image%0Afrom handle import Handle%0A%0Aclass LanguageBar (gtk.Toolbar):%0A%09def __init__ (self):%0A%09%09gtk.Toolbar.__init__ (self)%0A%09%09self.set_property (%22icon-size%22, gtk.ICON_SIZE_MENU)%0A%09%09# self.set_orientation... | |
4b356690500c7374acb166f8055edc8eb7e57509 | Create wget.py | wget.py | wget.py | Python | 0.000001 | @@ -0,0 +1,408 @@
+import urllib%0Aimport sys%0A%0Aw = sys.argv%5B1%5D%0Adef wget(w):%0A%09return urllib.urlopen(w).read()%0A%0Adef getbase(w):%0A%09return w.split(%22/%22)%5B-1%5D%0A%0Adef write(filename):%0A%09f = open((filename),%22w%22)%0A%09f.write(wget(w))%0A%09f.close()%0A%0Adef main():%0A%09if w.endswith(%22/%2... | |
b420c9e24372d5c7057f7f3102cf7b364023f62c | Add files via upload | SimpleGUI.py | SimpleGUI.py | Python | 0 | @@ -0,0 +1,2510 @@
+%22%22%22%22%0ACreates a simple GUI for summing two numbers.%0A%22%22%22%0Aimport tkinter%0Afrom tkinter import ttk%0A %0Aclass Adder(ttk.Frame):%0A %22%22%22The adders gui and functions.%22%22%22%0A def __init__(self, parent, *args, **kwargs):%0A ttk.Frame.__init__(self, parent, *args,... | |
b8f90d2f2ab7fb439ddf912a47b7856dcb040a39 | Add move subcommand for label handling | binstar_client/commands/move.py | binstar_client/commands/move.py | Python | 0.000001 | @@ -0,0 +1,2773 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0AMove packages between labels.%0A%22%22%22%0A%0A# Standard library imports%0Afrom __future__ import unicode_literals, print_function%0Aimport logging%0A%0A# Local imports%0Afrom binstar_client import errors%0Afrom binstar_client.utils import get_server_api, parse... | |
50e2cfbcb2444fd34a77d42589afbf8929c1cf00 | add module that may be useful | biokit/rtools/nbstreamreader.py | biokit/rtools/nbstreamreader.py | Python | 0 | @@ -0,0 +1,1187 @@
+# http://eyalarubas.com/python-subproc-nonblock.html%0Afrom threading import Thread%0A%0A%0Atry:%0A from Queue import Queue, Empty%0Aexcept ImportError:%0A from queue import Queue, Empty%0A%0A%0Aclass NonBlockingStreamReader:%0A%0A def __init__(self, stream):%0A %22%22%22%0A s... | |
7523a3212a79228b3cffe82d50a7383a5d101aec | Add watcher(pagerduty) bot | boten/bots_available/watcher.py | boten/bots_available/watcher.py | Python | 0 | @@ -0,0 +1,899 @@
+from __future__ import absolute_import%0Afrom boten import core%0Aimport pygerduty%0Aimport datetime%0Afrom boten.config import watcher as config%0A%0A%0Aclass Bot(core.BaseBot):%0A def __init__(self):%0A super(Bot, self).__init__()%0A self.pager = pygerduty.PagerDuty(config.ORG_NAME... | |
023ca9fac2963d5dc998c1ba501e5705ec7dfe26 | Create elasticsearch_storage.py | storage/elasticsearch_storage.py | storage/elasticsearch_storage.py | Python | 0 | @@ -0,0 +1,1950 @@
+'''%0AStorage module that will interact with elasticsearch.%0A'''%0Afrom uuid import uuid4%0Afrom elasticsearch import Elasticsearch, helpers%0A%0Aimport storage%0A%0Aclass ElasticSearchStorage(storage.Storage):%0A '''%0A Subclass of Storage.%0A '''%0A DEFAULTCONF = %7B%0A 'ENABLE... | |
4d5b94ac4eded101148e21b4faa0ca7dafe74770 | fix the pylint "Class 'Position' has no 'objects' member" error | memopol2/main/models.py | memopol2/main/models.py | from django.db import models
from memopol2 import settings
from couchdbkit import *
class Mep(dict):
"""
Our Mep pseudo model. Currently we use couchdbkit as a glorified http client and json parser,
the objets we work with are just dicts. This is here to wrap things a little bit, and do our
fixups (wh... | Python | 0.000243 | @@ -943,16 +943,73 @@
Model):%0A
+ objects = models.Manager() # fix for pylint warnings%0A
mep_
|
4681ee081f5600cebf7540862efc60dbf1d190d7 | Rename test module and add test for login page content | test_app.py | test_app.py | Python | 0 | @@ -0,0 +1,1395 @@
+import unittest%0Afrom unittest import TestCase%0Afrom user import User%0Afrom bucketlist import BucketList%0Afrom flask import url_for%0A%0Afrom app import app%0A%0A%0Aclass BucketListTest(TestCase):%0A def setUp(self):%0A # creates a test client%0A self.client = app.test_client()%... | |
f6c64846fc066403d39d7cb60ce0bcc455aff2d5 | Add conversions for MIDI to hertz and hertz to MIDI | src/server/convert.py | src/server/convert.py | Python | 0.000001 | @@ -0,0 +1,1075 @@
+# midi-beeper-orchestra - program to create an orchestra from PC speakers%0A# Copyright (C) 2015 The Underscores%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as published%0A# by the Free Software Foundation, ... | |
57abe384393d9ec14e8c066d674e49742d42d12c | Return result code. | src/stats/__main__.py | src/stats/__main__.py | #!/usr/bin/env python3
## Copyright (c) 2011 Steven D'Aprano.
## See the file __init__.py for the licence terms for this software.
"""
Run the stats package as if it were an executable module.
Usage:
$ python3 -m stats [options]
Options:
-h --help Print this help text.
-V --version Print the ... | Python | 0.000002 | @@ -875,16 +875,27 @@
-q%0A%0A%22%22%22
+%0Aimport sys
%0A%0Adef pr
@@ -915,23 +915,8 @@
():%0A
- import sys%0A
@@ -1952,16 +1952,34 @@
ules)))%0A
+ return failed%0A
%0A%0Aif __n
@@ -2070,16 +2070,25 @@
s()%0A
+sys.exit(
self_tes
@@ -2100,13 +2100,15 @@
bose, quiet)
+)%0A
%0A
|
82761fcdce049ec0d8205a68c0899b8f03f0a38c | Add FileTree | source/support/FileTree.py | source/support/FileTree.py | Python | 0.000001 | @@ -0,0 +1,2114 @@
+import os%0Afrom gi.repository import Gtk%0Afrom gi.repository.GdkPixbuf import Pixbuf%0A%0A%0Aclass FileTree(Gtk.TreeStore):%0A def __init__(self, path):%0A Gtk.TreeStore.__init__(self, str, Pixbuf, str)%0A%0A self.path = path%0A%0A self.populateFileTree(self.path)%0A ... | |
f1e600ed5dfa8955af93c6ecd05d27cd8c63b2e0 | Add migration | fat/migrations/0058_auto_20160808_1007.py | fat/migrations/0058_auto_20160808_1007.py | Python | 0.000002 | @@ -0,0 +1,627 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.5 on 2016-08-08 10:07%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('fat', '0057_blog_reviewer'),%0A %5D%0A%0A oper... | |
9556ba5a64388895714bbe6a03203e75fac1dda0 | fix flake8 | Scripts/DBotPredictPhishingWords/DBotPredictPhishingWords.py | Scripts/DBotPredictPhishingWords/DBotPredictPhishingWords.py | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
try:
import demisto_ml
except Exception:
pass
def get_model_data(model_name, store_type):
if store_type == 'list':
res = demisto.executeCommand("getList", {"listName": model_name})
res = re... | Python | 0 | @@ -3391,16 +3391,66 @@
bility',
+%0A
'Positi
|
4ffad6ba3804238b288be59c7e0fc33206f79ca4 | Create ReaderAuthenticated.py | ibmcnx/config/j2ee/ReaderAuthenticated.py | ibmcnx/config/j2ee/ReaderAuthenticated.py | Python | 0 | @@ -0,0 +1,995 @@
+######%0A# Set Reader Roles to Restricted%0A# no anonymous access possible%0A#%0A# Author: Christoph Stoettner%0A# Blog: http://www.stoeps.de%0A# E-Mail:%0A# Documentation: http://scripting101.stoeps.de%0A#%0A# Version: 2.0%0A# Date: 2014-07-16%0A#%0A# License: Apache 2.... | |
d335496951e5979d9d8442369f47ca7c99f805e7 | Introduce a very simple vim modeline parser. | pygments/modeline.py | pygments/modeline.py | Python | 0 | @@ -0,0 +1,959 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0A pygments.modeline%0A ~~~~~~~~~~~~~~~~~%0A%0A A simple modeline parser (based on pymodeline).%0A%0A :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.%0A :license: BSD, see LICENSE for details.%0A%22%22%22%0Aimport re%0A%0A__all__ =... | |
27568f245f76aaf85f4a3db5b2a3486b37afd047 | add scripts that converts smiles to graph object | examples/graphproppred/mol/smiles2graph.py | examples/graphproppred/mol/smiles2graph.py | Python | 0.000001 | @@ -0,0 +1,1936 @@
+from ogb.utils.features import (allowable_features, atom_to_feature_vector,%0A bond_to_feature_vector, atom_feature_vector_to_dict, bond_feature_vector_to_dict) %0Afrom rdkit import Chem%0Aimport numpy as np%0A%0Adef mol_to_data_obj(smile_string):%0A %22%22%22%0A Converts SMILE string to graph... | |
2d323a632971b020ffbbe523cc553bb35b340c86 | Make take tests clearer wrt team member takes | tests/py/test_take.py | tests/py/test_take.py | from __future__ import unicode_literals
from decimal import Decimal as D
from gittip.testing import Harness
from gittip.models.participant import Participant
class Tests(Harness):
def make_team(self):
team = self.make_participant('A Team', number='plural')
warbucks = self.make_participant('Dadd... | Python | 0.00001 | @@ -550,12 +550,12 @@
k',
-'40'
+None
)%0A
@@ -636,29 +636,101 @@
if
-username == 'alice':%0A
+take_last_week is not None:%0A if self.db.one('SELECT * FROM paydays') is None:%0A
@@ -928,18 +928,29 @@
m',
-'alice', %25
+%25(tippee)s, %25(amount)
s)%22%0A
@@ -974,17 +974,45 @@
,
-(... |
d967163ee3bdd2f86041cace5b6e3d859d471f4f | add sample length test | tests/samplelength.py | tests/samplelength.py | Python | 0 | @@ -0,0 +1,260 @@
+from turan.models import *%0Aeds = Exercise.objects.get(pk=3723).exercisedetail_set.all()%0Aa = %7B%7D%0Aprevious = eds%5B0%5D.time%0Afor e in eds:%0A time_d = (e.time - previous).seconds%0A if not time_d in a:%0A a%5Btime_d%5D = 0%0A a%5Btime_d%5D += 1%0A previous = e.time%0A
| |
17cc4de3c0d6b7e3c843085a1f7f6694930a7e84 | Add Graham's Scan in Python | geometry/graham_scan/python/graham_scan.py | geometry/graham_scan/python/graham_scan.py | Python | 0.000001 | @@ -0,0 +1,1603 @@
+#!/usr/bin/env python%0A%0Aimport Tkinter as tk%0Afrom random import random%0A%0Adef make_a_right_turn(a, b, c):%0A %22%22%22Going from a to b to c involves a right turn?%22%22%22%0A%0A u = (c%5B0%5D - b%5B0%5D, c%5B1%5D - b%5B1%5D)%0A v = (a%5B0%5D - b%5B0%5D, a%5B1%5D - b%5B1%5D)%0A%0A ... | |
a9515ca8738520a9b963b74c509b3c32761528df | test convert | tests/test_convert.py | tests/test_convert.py | Python | 0.000021 | @@ -0,0 +1,645 @@
+from tempfile import TemporaryFile%0A%0Aimport pytest%0A%0Afrom imgpy import Img%0A%0A%0A@pytest.mark.parametrize('image', (%7B%0A 'sub': 'anima/bordered.gif',%0A 'res': ('P', 38)%0A%7D, %7B%0A 'sub': 'anima/clear.gif',%0A 'res': ('P', 12)%0A%7D, %7B%0A 'sub': 'fixed/bordered.jpg',%0A ... | |
06744ad235754de7e3baa68e6d884fff9781136a | Fix tests on py26 | tests/test_formats.py | tests/test_formats.py | # -*- coding: utf-8 -*-
import os
import unittest
import logging
from nose.tools import * # PEP8 asserts
from textblob import formats
from textblob.compat import unicode
HERE = os.path.abspath(os.path.dirname(__file__))
CSV_FILE = os.path.join(HERE, 'data.csv')
JSON_FILE = os.path.join(HERE, "data.json")
TSV_FILE = ... | Python | 0.000001 | @@ -47,23 +47,8 @@
est%0A
-import logging%0A
from
@@ -71,16 +71,22 @@
rt * #
+noqa (
PEP8 ass
@@ -89,16 +89,17 @@
asserts
+)
%0A%0Afrom t
@@ -3292,14 +3292,13 @@
ert_
-not_in
+false
(Cus
@@ -3298,33 +3298,35 @@
lse(CustomFormat
-,
+ in
registry.values
|
7ff804bb10b945d38e8ce98f176abcbe4255f65c | Test subdict | tests/test_subdict.py | tests/test_subdict.py | Python | 0.000003 | @@ -0,0 +1,313 @@
+from nose.tools import raises%0A%0Afrom skrt.utils import subdict%0A%0A%0A@raises(KeyError)%0Adef test_missing_key():%0A dict_ = %7B'a': 1, 'b': 2, 'c': 3, 'd': 4%7D%0A subdict_ = subdict(%5B'e'%5D, dict_)%0A%0A%0Adef test_subdict():%0A dict_ = %7B'a': 1, 'b': 2, 'c': 3, 'd': 4%7D%0A asse... | |
d9780fc7151a719b9cbd88622b6c2868eaa64d34 | Add tasks to manage system services | fabix/system.py | fabix/system.py | Python | 0.000002 | @@ -0,0 +1,352 @@
+from cuisine import upstart_ensure%0Afrom fabric.api import sudo%0Afrom fabric.decorators import task%0A%0A%0A@task%0Adef restart_service(service, force_start=True):%0A if force_start:%0A upstart_ensure(service)%0A else:%0A sudo('service %7B0%7D restart').format(service))%0A%0A@ta... | |
8e687ab4f85561e31e4da06d89e9505179abc127 | Modify the example of vgpu white_list set | nova/conf/devices.py | nova/conf/devices.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.000001 | @@ -1007,16 +1007,195 @@
nstance.
+ But please note that Nova only supports a single type in the%0AQueens release. If more than one vGPU type is specified (as a comma-separated%0Alist), only the first one will be used.
An exam
@@ -1262,10 +1262,8 @@
s =
-%5B'
GRID
@@ -1267,20 +1267,17 @@
RID K100
-', '
+,
Intel... |
215bef9d71097a18ad5ee6f20232a08ba88e9983 | Create example1.py | stepper_motor/example1.py | stepper_motor/example1.py | Python | 0.000001 | @@ -0,0 +1,349 @@
+from stepper_motor import StepperMotor%0A%0A# Instance the motor supplying GPIO ports%0A# Instancia al motor indicando los puertos GPIO a los que est%C3%A1 conectado%0Amotor = StepperMotor(12,16,20,21)%0A%0A# Go 100 steps forward%0A# Avanza 100 pasos a la derecha%0Amotor.goForward(100)%0A%0A# Go 150 ... | |
1d311f7e53ac1081d801e902d8cb1d9a0ad8d1ec | Add test for iteration loop bytecode generation | tests/compiler/test_loop_compilation.py | tests/compiler/test_loop_compilation.py | Python | 0.000001 | @@ -0,0 +1,1157 @@
+from tests.compiler import compile_local, LST_ID, IMPLICIT_ITERATOR_ID, IMPLICIT_ITERATION_ID%0Afrom thinglang.compiler.opcodes import OpcodePushLocal, OpcodeCallInternal, OpcodePopLocal, OpcodeJumpConditional, %5C%0A OpcodeJump%0Afrom thinglang.foundation.definitions import INTERNAL_TYPE_ORDERIN... | |
bd7394ed1873fd08c4b653d2e24538f637d12721 | Allow test cases to consider a custom Oscar user model | oscar/test/testcases.py | oscar/test/testcases.py | import httplib
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Permission
from django_webtest import WebTest
from purl import URL
from oscar.core.compat import get_user_model
User = get_user_model()
def add_permissions(user, permissions):
"""
:param permissions: e.g. ['... | Python | 0 | @@ -831,16 +831,435 @@
s = %5B%5D%0A%0A
+ def create_user(self, username=None, email=None, password=None):%0A %22%22%22%0A Creates a user. But as usernames are optional in newer versions of%0A Django, it only sets it if exists.%0A %22%22%22%0A kwargs = %7B'email': email, 'password... |
bd2e55e3e8d4c7c2e9af3aa43dff209a98fbf3d5 | test pabot suiten names io | tests/test_pabotsuitenames_io.py | tests/test_pabotsuitenames_io.py | Python | 0.00001 | @@ -0,0 +1,1616 @@
+import os%0Aimport shutil%0Aimport stat%0Aimport subprocess%0Aimport sys%0Aimport tempfile%0Aimport textwrap%0Aimport unittest%0A%0Afrom pabot import pabot%0A%0A%0Aclass TestPabotSuiteNamesIO(unittest.TestCase):%0A%0A def setUp(self):%0A self.tmpdir = tempfile.mkdtemp()%0A robot_fil... | |
0222cfe6555074cee63fd30dbd419efbfd0274b3 | add prof perf test | tests/test_profile_writer.py | tests/test_profile_writer.py | Python | 0.999789 | @@ -0,0 +1,2219 @@
+#!/usr/bin/env python%0A%0Aimport os%0Aimport csv%0Aimport time%0Aimport threading%0A%0AAGENT_THREADS = 'threads'%0AAGENT_MODE = AGENT_THREADS%0Aprofile_agent = True%0A%0A%0A# ------------------------------------------------------------------------------%0A#%0Atimestamp_zero = float(os.environ... | |
7c609188df1ef457440543beb9dc4dbf286abd87 | Add some source cache tests. | test/test_cache_source.py | test/test_cache_source.py | Python | 0 | @@ -0,0 +1,1355 @@
+import pytest%0A%0Aimport large_image%0Afrom large_image.cache_util import cachesClear%0A%0Afrom .datastore import datastore%0A%0A%0A@pytest.mark.singular%0Adef testCacheSourceStyle():%0A cachesClear()%0A imagePath = datastore.fetch('sample_image.ptif')%0A ts1 = large_image.open(imagePath)%... | |
5d58788f75a7334def3dc5a2471c9e0ed2893589 | Test ConfigItem created in __init__ goes to parent | test/item_in_init_test.py | test/item_in_init_test.py | Python | 0.000004 | @@ -0,0 +1,986 @@
+# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT%0A# All rights reserved. This work is under a BSD license, see LICENSE.TXT.%0A%0Afrom multiconf import mc_config, ConfigItem%0Afrom multiconf.envs import EnvFactory%0A%0Aef = EnvFactory()%0Aprod = ef.Env('prod')%0A%0A%0Adef test_item_in_init_goe... | |
2b8b1f80febc621e64c5bfcd0adcc6e5e0d5fa07 | add rss module base | vendor/edaemon/rss.py | vendor/edaemon/rss.py | Python | 0.000001 | @@ -0,0 +1,72 @@
+from flask import Blueprint, Response%0A%0Abp = Blueprint('rss', __name__)%0A%0A
| |
12616c6cf3957d9d7b3e20fa20d7d597d5b3cc6e | Add validator to import_series | flexget/plugins/plugin_import_series.py | flexget/plugins/plugin_import_series.py | from flexget.plugin import register_plugin, get_plugin_by_name, PluginError
from flexget.plugins.filter_series import FilterSeriesBase
import logging
log = logging.getLogger('imp_series')
class ImportSeries(FilterSeriesBase):
"""Generates series configuration from any input (supporting API version 2, soon all)
... | Python | 0.000001 | @@ -56,16 +56,38 @@
by_name,
+ get_plugins_by_event,
PluginE
@@ -628,16 +628,785 @@
%22%22%22%0A%0A
+ def validator(self):%0A from flexget import validator%0A root = validator.factory('dict')%0A self.build_options_validator(root.accept('dict', key='settings'))%0A from_section = roo... |
cbbc90fc2ef2a1a7e104c466fffb33766cf20986 | access parent payment method | addons/website_payment/controllers/main.py | addons/website_payment/controllers/main.py | # -*- coding: utf-8 -*-
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
class website_payment(http.Controller):
@http.route(['/my/payment_method'], type='http', auth="user", website=True)
def payment_method(self):
acquirers = list(request.env['payment.ac... | Python | 0.000122 | @@ -513,16 +513,99 @@
hod_ids%0A
+ payment_methods %7C= partner.commercial_partner_id.sudo().payment_method_ids%0A
|
bfef466ef549291faad3c37001c712d23b553e2a | Remove references to server_name column | src/sentry/models/event.py | src/sentry/models/event.py | """
sentry.models.event
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import logging
from django.db import models
from django.utils import timezone
from django.utils.datastructures import SortedDict
from django.utils.tr... | Python | 0 | @@ -1725,85 +1725,8 @@
ue)%0A
- server_name = models.CharField(max_length=128, db_index=True, null=True)%0A
|
8618c68046487d475c077cb30070c9080cc4fbc7 | Test prototype for WOA from a netCDF file. | tests/test_WOA_from_nc.py | tests/test_WOA_from_nc.py | Python | 0 | @@ -0,0 +1,630 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A%22%22%22%0A%22%22%22%0A%0Afrom datetime import datetime%0A%0Afrom WOA.woa import WOA%0A%0Adef test_import():%0A # A shortcut%0A from WOA import WOA%0A db = WOA()%0A%0A%0Adef test_available_vars():%0A db = WOA()%0A %0A for v in %5... | |
2c8a867a810b0e7af6e14be7ed3a70a8fb134252 | Add the py-vine package (#13857) | var/spack/repos/builtin/packages/py-vine/package.py | var/spack/repos/builtin/packages/py-vine/package.py | Python | 0 | @@ -0,0 +1,652 @@
+# 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 PyVine(PythonPackage):%0A %22%22%22Promises, promises, p... | |
a746c674747fe25bed4af2d56738cf5075d475ad | add integration test | tests/test_integration.py | tests/test_integration.py | Python | 0 | @@ -0,0 +1,2361 @@
+import unittest%0Aimport twiggy%0Aimport StringIO%0Aimport time%0A%0Afrom . import when%0A%0Adef fake_gmtime():%0A return when%0A%0Aclass IntegrationTestCase(unittest.TestCase):%0A%0A def setUp(self):%0A twiggy._populate_globals()%0A twiggy.log._fields%5B'time'%5D = fake_gmtime%0... | |
82e186c25971008444e33c6b4924232d690b6d15 | Add git diff python tool that outputs file:line in front of diff output. | tools/git/git-diff-ide.py | tools/git/git-diff-ide.py | Python | 0.000043 | @@ -0,0 +1,2668 @@
+#!/usr/bin/env python%0A# Copyright (c) 2012 The Chromium Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0A%22%22%22%0A Invokes git diff %5Bargs...%5D and inserts file:line in front of each line of diff%0A ... | |
7593923070766f53a35d3c404523199f68accd3e | Implement tests for a new _config_file fixture | tests/test_user_config.py | tests/test_user_config.py | Python | 0.000002 | @@ -0,0 +1,1346 @@
+# -*- coding: utf-8 -*-%0A%0A%0Adef test_config(testdir):%0A %22%22%22Make sure that pytest accepts the %60cookies%60 fixture.%22%22%22%0A%0A # create a temporary pytest test module%0A testdir.makepyfile(%22%22%22%0A import json%0A%0A%0A def test_user_dir(tmpdir_factory, _conf... | |
eeeb2b0657c395ade790d5f16e673f277b000e11 | fix socket send; increase buffer | transports/stratum_tcp.py | transports/stratum_tcp.py | import json
import socket
import threading
import time
import Queue as queue
from processor import Session, Dispatcher, timestr
class TcpSession(Session):
def __init__(self, connection, address):
Session.__init__(self)
self._connection = connection
self.address = address[0]
self.n... | Python | 0 | @@ -702,28 +702,20 @@
-raw_response
+data
= json.
@@ -729,16 +729,23 @@
esponse)
+ + %22%5Cn%22
%0A
@@ -959,44 +959,93 @@
-connection.send(raw_response + %22%5Cn%22)
+while data:%0A l = connection.send(data)%0A data = data%5Bl:%5D
%0A
@@ -1819,12 +1819,12 @@
... |
57d7950f85368bd41e8f3660c8bce7f2728f71f3 | fix traceback when default_version is not in the database | trove/datastore/models.py | trove/datastore/models.py | # Copyright 2013 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 co... | Python | 0.000002 | @@ -5515,334 +5515,8 @@
me)%0A
- if default_version:%0A version = DatastoreVersion.load(datastore, default_version)%0A if not version.active:%0A raise exception.DatastoreVersionInactive(version=%0A version.name)%0A ... |
4973cf7fda38168c8189d77ced2ee2a2c89cadfa | Add py solution for 605. Can Place Flowers | py/can-place-flowers.py | py/can-place-flowers.py | Python | 0.000457 | @@ -0,0 +1,502 @@
+from itertools import groupby%0Aclass Solution(object):%0A def canPlaceFlowers(self, flowerbed, n):%0A %22%22%22%0A :type flowerbed: List%5Bint%5D%0A :type n: int%0A :rtype: bool%0A %22%22%22%0A%0A prev = None%0A l = len(flowerbed)%0A for i, ... | |
5dc2ad1bf129ba2b4f77602678f8e62d26d132a9 | Add new utility script to add sample feeds as files | utils/add_sample_feeds.py | utils/add_sample_feeds.py | Python | 0 | @@ -0,0 +1,819 @@
+from smoke_signal import app, init_db%0Afrom smoke_signal.database.helpers import add_feed%0Afrom utils.generate_feed import SampleFeed%0A%0Afrom os import walk%0A%0Afeeds_dir = app.root_path + %22/test_resources/feeds/%22%0A%0Aapp.config%5B'DATABASE_PATH'%5D = 'sqlite:///smoke_signal/test_resources/... | |
d8968cd7697fd165194e6692e9322e7992564323 | Add xor_gate | python/ch02/xor_gate.py | python/ch02/xor_gate.py | Python | 0.000008 | @@ -0,0 +1,324 @@
+from ch02.and_gate02 import AND%0Afrom ch02.nand_gate import NAND%0Afrom ch02.or_gate import OR%0A%0A%0Adef XOR(x1, x2):%0A s1 = NAND(x1, x2)%0A s2 = OR(x1, x2)%0A return AND(s1, s2)%0A%0A%0Aif __name__ == '__main__':%0A for xs in %5B(0, 0), (1, 0), (0, 1), (1, 1)%5D:%0A y = XOR(xs... | |
399568bbb0c88b2aa3919ac3552483a9dd8f01ab | Add an example that uses the interators | python/examples/instruction-iterator.py | python/examples/instruction-iterator.py | Python | 0.998207 | @@ -0,0 +1,1364 @@
+#!/usr/bin/env python%0A%0Aimport sys%0Atry:%0A import binaryninja%0Aexcept ImportError:%0A sys.path.append(%22/Applications/Binary Ninja.app/Contents/Resources/python/%22)%0A import binaryninja%0Aimport time%0A%0Aif sys.platform.lower().startswith(%22linux%22):%0A%09bintype=%22ELF%22%0Aeli... | |
116d8dffdd72169a6ed62a49d1ec936c94277163 | make sure to clean .build and BUILD when testing iar | tools/export/iar/__init__.py | tools/export/iar/__init__.py | import os
from os.path import sep, join, exists
from collections import namedtuple
from subprocess import Popen, PIPE
import shutil
import re
import sys
from tools.targets import TARGET_MAP
from tools.export.exporters import Exporter
import json
from tools.export.cmsis import DeviceCMSIS
from multiprocessing import cp... | Python | 0 | @@ -5921,32 +5921,74 @@
_name + %22.eww%22)%0A
+ # legacy output file location%0A
if e
@@ -6043,16 +6043,87 @@
.build')
+%0A if exists('BUILD'):%0A shutil.rmtree('BUILD')
%0A%0A
|
3474dd5d406b47c6d29e296b3c2f0fe622e4d7ba | Create new package. (#6595) | var/spack/repos/builtin/packages/r-tidycensus/package.py | var/spack/repos/builtin/packages/r-tidycensus/package.py | Python | 0 | @@ -0,0 +1,2527 @@
+##############################################################################%0A# Copyright (c) 2013-2017, 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... | |
2d1d7630cb0d74e18fd9ca359569069a841acae6 | Create intent_bifuz.py | intent_bifuz.py | intent_bifuz.py | Python | 0.000003 | @@ -0,0 +1,767 @@
+#!/usr/bin/env python%0A%0A# Intent bifuz.%0A#%0A# Copyright (C) 2015 Intel Corporation%0A# Author: Andreea Brindusa Proca %3Candreea.brindusa.proca@intel.com%3E%0A# Author: Razvan-Costin Ionescu %3Crazvan.ionescu@intel.com%3E%0A#%0A# Licensed under the MIT license, see COPYING.MIT for details%0A%0Ai... | |
6b2a84f1199615b09e1a14210302a814730869ed | Solve quicksort2 | python/quicksort2.py | python/quicksort2.py | Python | 0.999999 | @@ -0,0 +1,499 @@
+def print_arr(arr):%0A print(%22 %22.join(map(str, arr)))%0A%0Adef divide(arr, pivot_i=0):%0A if len(arr) %3C= 1:%0A return arr%0A pivot = arr%5Bpivot_i%5D%0A left = %5B%5D%0A right = %5B%5D%0A for i in arr:%0A if i %3C pivot:%0A left.append(i)%0A eli... | |
fdc403cb477d6dbadd4b7b744f5107465c8ce697 | Add _compat module | recursely/_compat.py | recursely/_compat.py | Python | 0.000001 | @@ -0,0 +1,1370 @@
+%22%22%22%0ACompatibility shims for different Python versions and platforms.%0A%22%22%22%0Aimport sys%0AIS_PY3 = sys.version_info%5B0%5D == 3%0A%0A%0Aclass metaclass(object):%0A %22%22%22Decorator for creating a class through a metaclass.%0A%0A Unlike %60%60__metaclass__%60%60 attribute from P... | |
12808079bad84ee86aa66904e4c52606ba38c0d0 | Declare reply exchange when sending replyà | kombu/pidbox.py | kombu/pidbox.py | """
kombu.pidbox
===============
Generic process mailbox.
:copyright: (c) 2009 - 2010 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
import socket
from copy import copy
from itertools import count
from kombu.entity import Exchange, Queue
from kombu.messaging import Consumer, Producer
from kombu.ut... | Python | 0 | @@ -6038,20 +6038,19 @@
declare=
-Fals
+Tru
e)%0A
|
e868f47852ee814975861c61167b82243dc310ad | add script for extracting a list of translators from the .po files | scripts/get-translator-credits.py | scripts/get-translator-credits.py | Python | 0 | @@ -0,0 +1,1343 @@
+import subprocess%0Aimport re%0Afrom collections import defaultdict%0A%0Aauthors_by_locale = defaultdict(set)%0A%0Afile_listing = subprocess.Popen('find ../wagtail -iname *.po', shell=True, stdout=subprocess.PIPE)%0A%0Afor file_listing_line in file_listing.stdout:%0A filename = file_listing_line.... | |
214c81265db7dc23a805717126fad6f97d391fe8 | Add marker for 105 error | scripts/markers/mark_error_105.py | scripts/markers/mark_error_105.py | Python | 0.000002 | @@ -0,0 +1,806 @@
+%22%22%22Marks all fixed errors #105 on ruwiki's CheckWikipedia.%22%22%22%0Aimport re%0Aimport pywikibot%0Afrom checkwiki import load_page_list, mark_error_done, log%0A%0ANUMBER = %22105%22%0A%0Adef main():%0A %22%22%22Main script function.%22%22%22%0A site = pywikibot.Site()%0A for pagename... | |
2ea6920a498dcc2dee4c1b7d7dc5e454f8071aa8 | Add DeliveryBox table tests. | tests/tables/delivery_box.py | tests/tables/delivery_box.py | Python | 0 | @@ -0,0 +1,345 @@
+%22%22%22%0A.. moduleauthor:: Adam Gagorik %3Cadam.gagorik@gmail.com%3E%0A%22%22%22%0Aimport unittest%0Aimport pydarkstar.logutils%0Aimport pydarkstar.tables.delivery_box%0A%0Apydarkstar.logutils.setDebug()%0A%0Aclass TestDeliveryBox(unittest.TestCase):%0A def test_init(self):%0A pydarkstar... | |
7a669705a4870f04dfee620f24fb98d60b31b901 | add initial skeleton for carpenter tests | tests/test_carpenter_shop.py | tests/test_carpenter_shop.py | Python | 0 | @@ -0,0 +1,176 @@
+import unittest%0Afrom source.carpenter_shop import *%0A%0Aclass CarpenterTestCase(unittest.TestCase):%0A%0A def setUp(self):%0A pass%0A%0A def test_something(self):%0A pass%0A
| |
4cd1deab63b1896152cd45ed965bb07d101754ea | Allow ninja to use more CPUs on many core workstations. | tools/cr/cr/actions/ninja.py | tools/cr/cr/actions/ninja.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.
"""A module to add ninja support to cr."""
import os
import cr
_PHONY_SUFFIX = ': phony'
_LINK_SUFFIX = ': link'
DEFAULT = cr.Config.From(
GOMA_DIR=... | Python | 0.000033 | @@ -200,16 +200,39 @@
cr.%22%22%22%0A%0A
+import multiprocessing%0A
import o
@@ -233,16 +233,16 @@
port os%0A
-
%0Aimport
@@ -537,16 +537,46 @@
nabled.%0A
+ EXTRA_FOR_IO_BOUND_JOBS = 2%0A
ENABLE
@@ -675,36 +675,113 @@
OBS=
-10,%0A NINJA_PROCESSORS=4
+multiprocessing.cpu_count() + EXTRA_FOR_IO_BOUND_JOBS... |
8e47f297200b0bcf64d89dcb11242aace2e21a6a | check NoneType before using | docker/utils/ports.py | docker/utils/ports.py |
def add_port_mapping(port_bindings, internal_port, external):
if internal_port in port_bindings:
port_bindings[internal_port].append(external)
else:
port_bindings[internal_port] = [external]
def add_port(port_bindings, internal_port_range, external_range):
if external_range is None:
... | Python | 0 | @@ -2151,24 +2151,98 @@
ernal_port)%0A
+ if internal_range is None:%0A _raise_invalid_port(port)%0A%0A
exte
@@ -2309,17 +2309,16 @@
) == 1)%0A
-%0A
@@ -2324,34 +2324,8 @@
if
-internal_range is None or
exte
|
d438f1e54743b64eb0d6518df0f90956711568a6 | Add trace api module. | python/helpers/pydev/pydevd_trace_api.py | python/helpers/pydev/pydevd_trace_api.py | Python | 0 | @@ -0,0 +1,922 @@
+def add_line_breakpoint(plugin, pydb, type, file, line, condition, expression, func_name):%0A return None%0A%0Adef add_exception_breakpoint(plugin, pydb, type, exception):%0A return False%0A%0Adef remove_exception_breakpoint(plugin, pydb, type, exception):%0A return False%0A%0Adef get_breakp... | |
579b73cbeeddbba66e5fa0d9026a8a94036de0b0 | Make sure that CacheDir() works even when timestamp signatures are used. | test/CacheDir/timestamp.py | test/CacheDir/timestamp.py | Python | 0 | @@ -0,0 +1,1566 @@
+#!/usr/bin/env python%0A#%0A# __COPYRIGHT__%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining%0A# a copy of this software and associated documentation files (the%0A# %22Software%22), to deal in the Software without restriction, including%0A# without limitation the rights ... | |
e73261614fe5e6824e3b76e69eed59f802565407 | Disable a Dromaeo benchmark on XP. Getting a crash deep in v8. | tools/perf/benchmarks/dromaeo.py | tools/perf/benchmarks/dromaeo.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.
import math
import os
from metrics import power
from telemetry import benchmark
from telemetry.page import page_measurement
from telemetry.page import page_... | Python | 0.000002 | @@ -5314,32 +5314,78 @@
nt-prototype'%0A%0A%0A
+@benchmark.Disabled('xp') # crbug.com/389731%0A
class DromaeoJsl
|
53c423a9c8e8af83627e6775cadf9a625dacfa2b | Add LogPublishingOptions to Elasticsearch::Domain | troposphere/elasticsearch.py | troposphere/elasticsearch.py | # Copyright (c) 2012-2015, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSProperty, AWSObject, Tags
from .compat import policytypes
from .validators import boolean, integer, integer_range, positive_integer
VALID_VOLUME_TYPES = ('standard', 'gp2', 'io1')
def ... | Python | 0 | @@ -2593,32 +2593,79 @@
ptions, False),%0A
+ 'LogPublishingOptions': (dict, False),%0A
'NodeToN
|
ad96a3c1269f5615ad22b02620e1da7dfc02b9e3 | Add filtering by CIV equivalent width | civspectra.py | civspectra.py | Python | 0 | @@ -0,0 +1,2561 @@
+# -*- coding: utf-8 -*-%0A%22%22%22Class to gather and analyse various metal line statistics%22%22%22%0A%0Aimport numpy as np%0Aimport hdfsim%0Aimport spectra%0A%0Aclass CIVSpectra(spectra.Spectra):%0A %22%22%22Generate metal line spectra from simulation snapshot%22%22%22%0A def __init__(self,... | |
857b962e4a0e2209ff50508783b6856b6dd689d6 | Test object loader | test/test_object_loader.py | test/test_object_loader.py | Python | 0.000002 | @@ -0,0 +1,639 @@
+# -*- coding: utf8 -*-%0A%22%22%22Test the object loader module for libcrowds-analyst.%22%22%22%0A%0Afrom libcrowds_analyst import object_loader%0A%0A%0Aclass TestObjectLoader(object):%0A%0A def test_correct_objects_are_loaded(self, result):%0A %22%22%22Test that objects are loaded.%22%22%2... | |
c8fc95cfe4dc8d8d5956b4e1cce994c3350eca8b | add plugins_redis | plugins/exploit/plugin_redis.py | plugins/exploit/plugin_redis.py | Python | 0.000001 | @@ -0,0 +1,1976 @@
+#!/usr/bin/env python%0A# -*- coding:utf-8 -*-%0A%0Aimport socket%0Aimport urlparse%0Afrom bmplugin import *%0A%0Ainfo=%7B'desc':%22redis unauth vulns and get a shell%22,%0A 'cve':'',%0A 'link':%22https://www.sebug.net/vuldb/ssvid-89715%22%7D %0A%0Adef init_plugin(main):%0A active=main.... | |
c9d852041ed99964560c9f071a9c927911583a62 | Add Mediator pattern | mediator.py | mediator.py | Python | 0.000001 | @@ -0,0 +1,2761 @@
+%22%22%22Mediator pattern%0A%22%22%22%0Aimport random%0Aimport time%0A%0A%0Aclass ControlTower(object):%0A%0A def __init__(self):%0A self.available_runways = list()%0A self.engaged_runways = list()%0A%0A def authorize_landing(self):%0A if not self.available_runways:%0A ... | |
31b81e3f901da0a06f5a949dbc55a00aa8b0a407 | Add auditor repo's events | polyaxon/auditor/events/repo.py | polyaxon/auditor/events/repo.py | Python | 0 | @@ -0,0 +1,313 @@
+import auditor%0Afrom libs.event_manager import event_types%0Afrom libs.event_manager.event import Event%0A%0A%0Aclass RepoCreatedEvent(Event):%0A type = event_types.REPO_CREATED%0A%0A%0Aclass RepoNewCommitEvent(Event):%0A type = event_types.REPO_NEW_COMMIT%0A%0A%0Aauditor.register(RepoCreatedE... | |
ffd3b3367f7bb932505a6312c6370a7d30c3d1fe | Implement account-notify | txircd/modules/ircv3/accountnotify.py | txircd/modules/ircv3/accountnotify.py | Python | 0.999753 | @@ -0,0 +1,1649 @@
+from twisted.plugin import IPlugin%0Afrom txircd.module_interface import IModuleData, ModuleData%0Afrom zope.interface import implements%0A%0Aclass AccountNotify(ModuleData):%0A%09implements(IPlugin, IModuleData)%0A%09%0A%09name = %22AccountNotify%22%0A%09%0A%09def actions(self):%0A%09%09return %5B ... | |
4034e72d560a3d1ce40ba0bba51c44e7562d96c2 | disable implicit registration at asyncore's default socket map | pysnmp/carrier/asyncore/base.py | pysnmp/carrier/asyncore/base.py | """Defines standard API to asyncore-based transport"""
try:
from sys import version_info
except ImportError:
version_info = ( 0, 0 ) # a really early version
import socket, sys
import asyncore
from pysnmp.carrier import error
class AbstractSocketTransport(asyncore.dispatcher):
sockFamily = sockType = Non... | Python | 0 | @@ -621,16 +621,279 @@
%25 why)%0A
+ if sockMap is None:%0A # The socket map is managed by the AsynsockDispatcher on%0A # which this transport is registered, so this is a fake%0A # socket map to avoid registering with deafult asyncore map.%0A sockMap = %7B%7D%0A
... |
1ea465856739169aadd90b27fc8ad1cf42dcb665 | add 120 | vol3/120.py | vol3/120.py | Python | 0.999995 | @@ -0,0 +1,213 @@
+def calc(a):%0A s = set(%5B2%5D)%0A for n in range(1, 2 * a + 1, 2):%0A r = (2 * n * a) %25 (a * a)%0A s.add(r)%0A return max(s)%0A%0Aif __name__ == %22__main__%22:%0A print sum(%5Bcalc(a) for a in range(3, 1001)%5D)%0A
| |
94f621255ffb7b90f6233e45b658d9e73113cec4 | add 121 | vol3/121.py | vol3/121.py | Python | 0.999997 | @@ -0,0 +1,469 @@
+if __name__ == %22__main__%22:%0A LIMIT = 15 %0A res = %5B0%5D * (LIMIT + 1)%0A res%5BLIMIT - 1%5D = res%5BLIMIT%5D = 1%0A for i in range(2, LIMIT + 1):%0A for j in range(0, LIMIT):%0A res%5Bj%5D = res%5Bj + 1%5D%0A res%5BLIMIT%5D = 0%0A for j in range(L... | |
6361e766de14508342cc87f1b26dd99f43b02fc9 | Add script to calculate statistics about liwc categories | liwc2csv.py | liwc2csv.py | Python | 0 | @@ -0,0 +1,2970 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%22%22%22Script to generate statistics on LIWC entities.%0A%0AThe script calculates how many LIWC words are found. This script can be used to%0Acompare the differences in numbers of words found for the modern and historic%0Aversions of LIWC.%0A%22%22... | |
c788ff97a48d54d2b2c2cb181a1a0a95d100b850 | Add flip tests module | tests/plantcv/test_flip.py | tests/plantcv/test_flip.py | Python | 0 | @@ -0,0 +1,644 @@
+import pytest%0Aimport cv2%0Afrom plantcv.plantcv import flip%0A%0A%0Adef test_flip(test_data):%0A # Read in test data%0A img = cv2.imread(test_data.small_rgb_img)%0A flipped_img = flip(img=img, direction=%22horizontal%22)%0A assert img.shape == flipped_img.shape%0A%0A%0Adef test_flip_gra... | |
7b7ead5fb9814ba1d25d73c9dea50db86a2a827f | add a script to update jar only. So we don't need to reingest data. | myriadeploy/update_myria_jar_only.py | myriadeploy/update_myria_jar_only.py | Python | 0 | @@ -0,0 +1,1257 @@
+#!/usr/bin/env python%0A%0Aimport myriadeploy%0A%0Aimport subprocess%0Aimport sys%0A%0Adef host_port_list(workers):%0A return %5Bstr(x) + ':' + str(y) for (x, y) in workers%5D%0A%0Adef copy_distribution(config):%0A %22Copy the distribution (jar and libs and conf) to compute nodes.%22%0A nod... | |
b51742bb967665ed548a033168870ba0d798bd60 | Fix docstrings to be pep257 compliant | CAOS/logging.py | CAOS/logging.py | """Singleton logging for the language.
When verbose mode is enabled, logged messages are written to stdout or
stderr, depending on the type of message. Otherwise non-error messages
are suppressed.
Attributes
----------
LoggingLevelEnum : Enum
Logging levels - available levels are DEBUG, INFO, WARN, and ERROR.
""... | Python | 0.000004 | @@ -648,16 +648,170 @@
tEnum):%0A
+ %22%22%22Enum for different logging levels.%0A%0A Attributes%0A ----------%0A DEBUG : int%0A Debug level.%0A INFO : int%0A Info level.%0A %22%22%22%0A%0A
DEBU
@@ -3708,17 +3708,16 @@
%22%22Create
-s
a defau
@@ -4251,17 +4251,16 @@
%22%22Creat... |
cdbd7b4ebb2190dc7e7067378d6b009d773c6537 | Create reverseCompliment.py | reverseCompliment.py | reverseCompliment.py | Python | 0.000001 | @@ -0,0 +1,774 @@
+#Python Problem 1%0A#reverseComplement.py%0A#Introduction to Bioinformatics Assignment 2%0A#Purpose: Reverse Compliment %0A#Your Name: Michael Thomas%0A#Date: 10/10/15%0A%0A#s1 is the string you should use to generate a reverse complement sequence%0A#Note that your result needs to be presented in the... | |
54c5f4f476cebec063652f5e4c6acd30bf2dee2e | Add test for nova-compute and nova-network main database blocks | nova/tests/unit/cmd/test_cmd_db_blocks.py | nova/tests/unit/cmd/test_cmd_db_blocks.py | Python | 0.999999 | @@ -0,0 +1,1714 @@
+# Copyright 2016 Red Hat%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 appl... | |
86c13905a616fe74ea1264b3e462ada3ca7b4e04 | Add a test for clickthrough | tests/test_clickthrough.py | tests/test_clickthrough.py | Python | 0 | @@ -0,0 +1,1259 @@
+import openliveq as olq%0Aimport os%0A%0Aclass TestClickthrough(object):%0A%0A def test_load(self):%0A filepath = os.path.join(os.path.dirname(__file__),%0A %22fixtures%22, %22sample_clickthrough.tsv%22)%0A cs = %5B%5D%0A with open(filepath) as f:%0A for... | |
3c110d3eacf9f67df520a6e3f99f005c43894889 | Remove print statements | udata/core/organization/views.py | udata/core/organization/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from flask import request, g, jsonify
from flask.ext.security import current_user
from udata.forms import OrganizationForm, OrganizationMemberForm, OrganizationExtraForm
from udata.frontend import nav
from udata.frontend.views import DetailView, CreateVi... | Python | 0.001543 | @@ -4018,35 +4018,8 @@
m):%0A
- print form.pk.data%0A
@@ -4517,90 +4517,8 @@
rgs%0A
- print request.form, ',', request.environ.get('CONTENT_TYPE', 'NO'), 'end'%0A
|
731e102ed1faee07128979655f4eaca9bd4818ba | Create analyse.py | analyse.py | analyse.py | Python | 0 | @@ -0,0 +1,711 @@
+%22%22%22%0A analysis of an array%0A %0A%22%22%22%0Aimport sys, math%0Afrom numpy import *%0A%0Amissing_value = -9999%0Aelev = loadtxt(sys.stdin)%0Amaxi = elev.shape%5B0%5D%0Amaxj = elev.shape%5B1%5D%0A%0Amissing = 0%0Amin = 999999999999%0Amax = -99999999999%0Afor i in range(0, maxi-1) :%0A for j... | |
3f1b477c7e51fdafa44f090104fbf0f2ae10ccdf | Create Train.py | Train.py | Train.py | Python | 0.000001 | @@ -0,0 +1,2502 @@
+from templates import *%0A%0A# Parameters (path to observations file, output file, model, weights file)%0A_, infile, outprefix, model, weights_file = sys.argv%0A%0A# Load data%0Astate_names, transitions, emissions, starting_probabilities, weights = make_hmm_from_file(model, weights_file) %0Aobs = re... | |
844e1a66efc59ad56573ee570ffed5766228d915 | Remove stray print statement | wagtail/wagtailimages/views/images.py | wagtail/wagtailimages/views/images.py | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib.auth.decorators import permission_required
from django.core.exceptions import PermissionDenied
from django.utils.translation i... | Python | 0.998913 | @@ -5276,30 +5276,8 @@
d)%0A%0A
- print dir(image)%0A%0A
|
39ceccd8fe3d3a91c2975dac33e3c70dd07ce10e | add example deafult_reprocess_summaries_func | crosscat/utils/summary_utils.py | crosscat/utils/summary_utils.py | Python | 0.000651 | @@ -0,0 +1,1628 @@
+import numpy%0A#%0Aimport crosscat.utils.convergence_test_utils%0A%0A%0Adef get_logscore(p_State):%0A return p_State.get_marginal_logp()%0A%0Adef get_num_views(p_State):%0A return len(p_State.get_X_D())%0A%0Adef get_column_crp_alpha(p_State):%0A return p_State.get_column_crp_alpha()%0A%0Ade... | |
866daca6e25e41ef35aee0539e737e33e8275645 | Create photoTweet.py | Twitter/photoTweet.py | Twitter/photoTweet.py | Python | 0 | @@ -0,0 +1,832 @@
+# -*- coding: utf-8 -*-%0A#!/usr/bin/env python2.7 %0Aimport tweepy %0Afrom subprocess import call %0Afrom datetime import datetime %0A %0A# Date-Time stamps%0Atm = datetime.now() %0Anow = tm.strftime('%25Y%25m%25d-%25H%25M%25S') %0Aphoto_name = now + '.jpg' %0Acmd = 'sudo rasp... | |
a9a4befe88b35a50470c5c48062c8f56c643203d | Create metatest.py | metatest.py | metatest.py | Python | 0 | @@ -0,0 +1,1509 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Afrom unittest import TestCase%0Aimport itertools%0Aimport sys%0A%0Adef mix_params(args_kwargs):%0A args, kwargs = args_kwargs%0A args_len = len(args)%0A for i in itertools.product(*itertools.chain(args, kwargs.values())):%0A yield ... | |
e351b88ecbc0a75f6945abf5e1f745760b22ea2b | Delete non-primary images | ynr/apps/people/migrations/0036_delete_non_primary_images.py | ynr/apps/people/migrations/0036_delete_non_primary_images.py | Python | 0.000013 | @@ -0,0 +1,520 @@
+# Generated by Django 3.2.4 on 2022-02-15 10:51%0A%0Afrom django.db import migrations%0A%0A%0Adef delete_non_primary_images(apps, schema_editor):%0A PersonImage = apps.get_model(%22people%22, %22PersonImage%22)%0A PersonImage.objects.filter(is_primary=False).delete()%0A%0A%0Aclass Migration(mig... | |
5607b6fe168f4142dc2c1f343e782f232206ddee | Create apps.py | reversion/apps.py | reversion/apps.py | Python | 0.000001 | @@ -0,0 +1,149 @@
+from django.apps import AppConfig%0A%0Aclass ReversionConfig(AppConfig):%0A name = 'reversion'%0A default_auto_field = 'django.db.models.BigAutoField'%0A
| |
905aba6e79e5ec0d2087b30b60002f475234cfe4 | Make `sat.ext` a package | salt/ext/__init__.py | salt/ext/__init__.py | Python | 0.000018 | @@ -0,0 +1,20 @@
+# coding: utf-8 -*-%0A
| |
8c4e58fac4d1d020ac2da38441067959100690a5 | Add expectation that all Python code is correct | yunity/tests/integration/test_python.py | yunity/tests/integration/test_python.py | Python | 0.999996 | @@ -0,0 +1,2115 @@
+from importlib import import_module, reload%0Afrom os.path import join as join_path, dirname%0Afrom os import walk%0Afrom sys import modules%0A%0Afrom yunity.utils.tests.abc import BaseTestCase%0Aimport yunity%0A%0A%0Adef _path_to_module(path, root_module_path, pysuffix='.py'):%0A path = path%5Bl... | |
a7cc097497164b36513874c74828d00fc1d42b0b | Add stack example | data-structures/stacks/stack.py | data-structures/stacks/stack.py | Python | 0.000002 | @@ -0,0 +1,490 @@
+ex_strs = %5B%0A %22(())%22,%0A %22(%5B%5B%5D%5D)%22,%0A %22(%5D%22,%0A %22(((())))%5B%22,%0A %22()%22%0A %5D%0A%0Adef check_balanced(s):%0A stack = %5B%5D%0A for char in s:%0A if char in %5B'(', '%5B'%5D:%0A stack.append(char)%0A else:%0A i... | |
e349f976de289219978afa807e2f177e404a1182 | add mdbsi distributions | dit/example_dists/mdbsi.py | dit/example_dists/mdbsi.py | Python | 0 | @@ -0,0 +1,369 @@
+%22%22%22%0AThe two distributions studied in Multivariate Dependencies Beyond Shannon Information.%0A%22%22%22%0A%0Afrom ..distconst import uniform%0A%0A__all__ = %5B'dyadic', 'triadic'%5D%0A%0Adyadic = uniform(%5B'000', '021', '102', '123', '210', '231', '312', '333'%5D)%0Adyadic.set_rv_names('XYZ')... | |
95d23d7c68ff03acc7d854cd91fa3eaabfaf1a4f | add a unit tests | tests/test_utils.py | tests/test_utils.py | Python | 0.000001 | @@ -0,0 +1,628 @@
+from debile.utils.commands import run_command%0Afrom debile.utils.commands import safe_run%0Afrom debile.utils.deb822 import Changes%0A%0Adef test_run_command():%0A run_command(%22ls%22)%0A run_command(%22cat%22,%22foo%22)%0A (output, output_stderr, exit_status) = run_command(%22ls2%22)%0A ... | |
50803718c2629c53503ca6831dc97e2b263fe526 | add login script | notes/code/selenium/login.py | notes/code/selenium/login.py | Python | 0.000001 | @@ -0,0 +1,416 @@
+from Tkinter import *%0A%0Amaster = Tk()%0ALabel(master, text=%22Username%22).grid(row=0)%0ALabel(master, text=%22Password%22).grid(row=1)%0A%0Auser = Entry(master)%0Apassword = Entry(master, show=%22*%22)%0A%0Auser.grid(row=0, column=1)%0Apassword.grid(row=1, column=1)%0A%0Adef login():%0A print ... | |
87fdc8ab59baa989d57c482085d67fb139573313 | Test - Trigger AttributeError with an get_name call in daemonlinks | test/test_get_name.py | test/test_get_name.py | Python | 0 | @@ -0,0 +1,2294 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A#%0A# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors%0A#%0A# This file is part of Alignak.%0A#%0A# Alignak is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.