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 |
|---|---|---|---|---|---|---|---|
cb85810364a235426147a440da797d35d114c5a6 | Test Commit | raspberry/asip/RelationSemanticTag.py | raspberry/asip/RelationSemanticTag.py | Python | 0.000001 | @@ -0,0 +1,32 @@
+from SemanticTag import *%0A%0A#Test
| |
1d5ea05e42def0048c8ccd3e3d51b6511c190f57 | Update _test_utils.py | rhea/utils/test/_test_utils.py | rhea/utils/test/_test_utils.py |
import os
import shutil
from glob import glob
import argparse
from myhdl import traceSignals, Simulation
def run_testbench(bench, timescale='1ns', args=None):
if args is None:
args = tb_argparser().parse_args()
vcd = tb_clean_vcd(bench.__name__)
if args.trace:
# @todo: the following (tim... | Python | 0.000005 | @@ -152,24 +152,225 @@
args=None):%0A
+ %22%22%22 run (simulate) a testbench%0A The args need to be retrieved outside the testbench%0A else the test will fail with the pytest runner, if %0A no args are passed a default will be used%0A %22%22%22%0A
if args
@@ -393,27 +393,24 @@
args =
-tb_
argp... |
ea3cc841693b9adadb681349ac6cd79d985e7e7c | Handle case when there's no 'ids' key | rinoh/frontend/rst/__init__.py | rinoh/frontend/rst/__init__.py | # This file is part of RinohType, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
from functools import wraps
from docutils.core import p... | Python | 0 | @@ -4324,26 +4324,33 @@
= node.
-get(
+attributes%5B
'ids'
-)
+%5D
%0A
|
65c7d07636ea972113b2263b995eaa7eef10c590 | Remove short option string for cpu type | configs/common/Options.py | configs/common/Options.py | # Copyright (c) 2006-2008 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... | Python | 0.000006 | @@ -1607,14 +1607,8 @@
ion(
-%22-c%22,
%22--c
|
ef335362b5f601da41377984b8d9cc675d9ed669 | Create ddns_sync.py | ddns_sync.py | ddns_sync.py | Python | 0.000009 | @@ -0,0 +1,1346 @@
+#!/usr/bin/env python3%0A%0Aimport boto3%0Afrom get import getjson%0A%0Aquery = %22http://evolutiva.mx/getip/%22%0Adata = getjson(query)%0A%0Aif not data:%0A exit()%0A%0Anew_ip = dict(data)%5B'ip'%5D%0Aold_ip = None%0A%0Ar53 = boto3.client('route53') #.connect_to_region('us-west-2')%0A%0Atry:%0A ... | |
8821fd5e4678dd8a2baf78d3ed068b652a10d1cd | Add initial games unit | units/games.py | units/games.py | Python | 0 | @@ -0,0 +1,481 @@
+%0Aimport random%0A%0Adef eightball():%0A%09responses = %5B%22It is certain%22, %22It is decidedly so%22, %22Without a doubt%22, %22Yes, definitely%22, %22You may rely on it%22, %22As I see it, yes%22, %22Most likely%22, %22Outlook good%22, %22Yes%22, %22Signs point to yes%22, %22Reply hazy try again... | |
0420aa1bf7bb8027379de52de783da87ce253f62 | add batch upload script | uploadBatch.py | uploadBatch.py | Python | 0.000001 | @@ -0,0 +1,2183 @@
+# This is a python script for uploading batch data to Genotet server.%0A# The user may write a *.tsv file, with each line as:%0A# file_path data_name file_type description%0A# The command line would be:%0A# python uploadBatch.py username *.tsv%0A# And then enter your password for Genotet... | |
da373b924cf4dffe639e29543b5fc0e728be1ed9 | Add orgviz.randomnodes | orgviz/randomnodes.py | orgviz/randomnodes.py | Python | 0.001097 | @@ -0,0 +1,1728 @@
+import random%0Aimport datetime%0A%0A%0Aclass RandomDatetime(object):%0A%0A def __init__(self, datewidth=7):%0A self.datewidth = datewidth%0A self.now = datetime.datetime.now()%0A%0A def datetime(self):%0A delta = datetime.timedelta(random.randrange(- self.datewidth,%0A ... | |
a5bffdaa29d2f270a6f8781c34a2756a66a00a87 | Bump version | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | Python | 0 | @@ -439,12 +439,12 @@
'2.
-19.5
+20.0
.dev
|
6b5c46238975eb63b36f43eb79002946a744fd68 | Prepare v2.10.47.dev | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | Python | 0.000002 | @@ -443,7 +443,11 @@
10.4
-6
+7.dev
'%0A
|
ea41e4cdc515ca8514c3613a1f474fb3627b7dda | Remove autosynth / tweaks for 'README.rst' / 'setup.py'. (#5957) | tasks/synth.py | tasks/synth.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -809,16 +809,107 @@
plates()
+%0Aexcludes = %5B%0A 'README.rst',%0A 'setup.py',%0A 'docs/conf.py',%0A 'docs/index.rst',%0A%5D
%0A%0Afor ve
@@ -1090,42 +1090,16 @@
des=
-%5B'docs/conf.py', 'docs/index.rst'%5D
+excludes
)%0A%0A
@@ -1953,571 +1953,4 @@
%3C')%0A
-%0A# Set Release Status%0Arelease_statu... |
761ec2bd6492b041eb658ee836a63ffb877469d5 | Add management command to load all version fixtures | cbv/management/commands/load_all_django_versions.py | cbv/management/commands/load_all_django_versions.py | Python | 0.000003 | @@ -0,0 +1,834 @@
+import os%0Aimport re%0A%0Afrom django.conf import settings%0Afrom django.core.management import call_command, BaseCommand%0A%0A%0Aclass Command(BaseCommand):%0A %22%22%22Load the Django project fixtures and all version fixtures%22%22%22%0A%0A def handle(self, **options):%0A fixtures_dir... | |
5fc15bdf5bc1582764319a326fc383384963bffe | Add `argumentCollection` suggestion for function calls, closes #29 | src/basecompletions/basecompletions.py | src/basecompletions/basecompletions.py | import sublime
import json
from ..completions import CompletionList
from ..inline_documentation import Documentation
from .. import utils
COMPLETION_FILES = ["cfml_tags","cfml_functions","cfml_member_functions"]
DOC_STYLES = {
"side_color": "#4C9BB0",
"header_color": "#306B7B",
"header_bg_color": "#E4EEF1",
"text_... | Python | 0 | @@ -1449,24 +1449,248 @@
n_list = %5B%5D%0A
+%0A%09if view.match_selector(position, %22meta.function-call.parameters.cfml,meta.function-call.parameters.method.cfml%22):%0A%09%09completion_list.append((%22argumentCollection%5Ctparameter struct%22, %22argumentCollection = $%7B1:parameters%7D%22))%0A%0A
%09completion_
|
9e2fe5de082c736ec44dbf150d8350a0e164d2ae | Create beta_which_operator.py | Solutions/beta/beta_which_operator.py | Solutions/beta/beta_which_operator.py | Python | 0.000065 | @@ -0,0 +1,173 @@
+def whichOper(a, b, oper):%0A return %7B'a':lambda x,y: x+y,%0A 's':lambda x,y: x-y,%0A 'm':lambda x,y: x*y,%0A 'd':lambda x,y: x/y%7D%5Boper%5B0%5D%5D(a,b)%0A
| |
e3dcc7ef44bbc8772fd5ad4f0941e5d98bf1ccdd | add migration | scholarly_citation_finder/apps/tasks/migrations/0003_auto_20160224_1349.py | scholarly_citation_finder/apps/tasks/migrations/0003_auto_20160224_1349.py | Python | 0.000001 | @@ -0,0 +1,549 @@
+# -*- 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 ('tasks', '0002_task_starttime'),%0A %5D%0A%0A operations = %5B%0A migrations.RemoveField(%... | |
d60ffedf64269b85d40eda4caa01b548d27bd2a5 | clean up imports | tabular_predDB/python_utils/convergence_test_utils.py | tabular_predDB/python_utils/convergence_test_utils.py | import numpy, pdb
import tabular_predDB.python_utils.data_utils as du
import tabular_predDB.python_utils.xnet_utils as xu
import tabular_predDB.LocalEngine as LE
import tabular_predDB.cython_code.State as State
from sklearn import metrics
def truth_from_permute_indices(data_inverse_permutation_indices, num_rows,num_c... | Python | 0.000001 | @@ -9,207 +9,8 @@
umpy
-, pdb%0A%0Aimport tabular_predDB.python_utils.data_utils as du%0Aimport tabular_predDB.python_utils.xnet_utils as xu%0Aimport tabular_predDB.LocalEngine as LE%0Aimport tabular_predDB.cython_code.State as State
%0Afro
@@ -35,16 +35,17 @@
etrics%0A%0A
+%0A
def trut
|
0711b2eee10e5e48186d78144697a35640a33cb1 | Add a passthrough manager | mysql_fuzzycount/managers.py | mysql_fuzzycount/managers.py | Python | 0.000002 | @@ -0,0 +1,190 @@
+from model_utils.managers import PassThroughManager%0A%0Afrom mysql_fuzzycount.queryset import FuzzyCountQuerySet%0A%0A%0AFuzzyCountManager = PassThroughManager.for_queryset_class(FuzzyCountQuerySet)%0A
| |
56b2897655940962a8cfa06cc8a9fcfe22262412 | Create config_local.py | pgadmin4/config_local.py | pgadmin4/config_local.py | Python | 0.000003 | @@ -0,0 +1,2411 @@
+# -*- coding: utf-8 -*-%0A%0A##########################################################################%0A#%0A# pgAdmin 4 - PostgreSQL Tools%0A#%0A# Copyright (C) 2013 - 2016, The pgAdmin Development Team%0A# This software is released under the PostgreSQL Licence%0A#%0A# config_local.py - Core appli... | |
1de5b9746c33add889837e5e0feaf1796fb00eb8 | add script to generate breakseq index | scripts/breakseq2_gen_bplib.py | scripts/breakseq2_gen_bplib.py | Python | 0.000001 | @@ -0,0 +1,782 @@
+#!/usr/bin/env python%0A%0Aimport argparse%0Afrom breakseq2 import breakseq_index, _version%0A%0Aif __name__ == %22__main__%22:%0A parser = argparse.ArgumentParser(description=%22Generate breakpoint library FASTA from breakpoint GFF%22,%0A formatter_class=argpar... | |
33f455cba56c7ae557cfe9f5494b6a045c68f1d2 | add simple hello world | examples/hello.py | examples/hello.py | Python | 0.999998 | @@ -0,0 +1,220 @@
+from flower import run, schedule, tasklet%0A%0Adef say(s):%0A for i in range(5):%0A schedule()%0A print(s)%0A%0Adef main():%0A tasklet(say)(%22world%22)%0A say(%22hello%22)%0A%0A run()%0A%0Aif __name__ == '__main__':%0A main()%0A
| |
152dafeeb35647dbcfb25549f7f1e73a397428a0 | Add urls for the demo | demo_zinnia_bitly/urls.py | demo_zinnia_bitly/urls.py | Python | 0 | @@ -0,0 +1,1577 @@
+%22%22%22Urls for the zinnia-bitly demo%22%22%22%0Afrom django.conf import settings%0Afrom django.contrib import admin%0Afrom django.conf.urls import url%0Afrom django.conf.urls import include%0Afrom django.conf.urls import patterns%0Afrom django.views.generic.base import RedirectView%0A%0Afrom zinn... | |
64b14b64c00bc6885acc1ff4d9b76898f66a8a86 | add new package (#15737) | var/spack/repos/builtin/packages/opendx/package.py | var/spack/repos/builtin/packages/opendx/package.py | Python | 0 | @@ -0,0 +1,602 @@
+# 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%0A%0Aclass Opendx(AutotoolsPackage):%0A %22%22%22Open Visualization Data Explorer.%22%22%22%... | |
7c56318cb545011e64e3a491058054ad3d7cd9c0 | Create new package. (#5987) | var/spack/repos/builtin/packages/r-aims/package.py | var/spack/repos/builtin/packages/r-aims/package.py | Python | 0 | @@ -0,0 +1,1979 @@
+##############################################################################%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... | |
eb429be1fdc7335bec5ba036fcece309778b23f0 | Add an example that uses filterReactions AND pdep at the same time | examples/rmg/heptane-filterReactions/input.py | examples/rmg/heptane-filterReactions/input.py | Python | 0 | @@ -0,0 +1,1386 @@
+# Data sources%0Adatabase(%0A thermoLibraries = %5B'primaryThermoLibrary'%5D,%0A reactionLibraries = %5B%5D,%0A seedMechanisms = %5B%5D,%0A kineticsDepositories = %5B'training'%5D, %0A kineticsFamilies = 'default',%0A kineticsEstimator = 'rate rules',%0A)%0A%0A# Constraints on gene... | |
817f0e77802e09f1c101aa3773ad89341120e0f1 | Fix the crash when there is no initial settings created | accounting/apps/connect/steps.py | accounting/apps/connect/steps.py | import logging
from django.core.urlresolvers import reverse
from django.core.exceptions import ValidationError
from accounting.apps.books.utils import organization_manager
from accounting.apps.reports.models import BusinessSettings
logger = logging.getLogger(__name__)
class StepOptions(object):
"""
Meta cl... | Python | 0.000009 | @@ -210,16 +210,22 @@
import
+(%0A
Business
@@ -232,16 +232,60 @@
Settings
+,%0A FinancialSettings,%0A PayRunSettings)
%0A%0Alogger
@@ -4193,32 +4193,49 @@
return False%0A
+ try:%0A
settings
@@ -4265,33 +4265,24 @@
ngs%0A
- try:%0A
sett
@@ -4265,36 +4265,32... |
e5a14054e1e9e95b04baf5ec7c92a2fdde51703b | Update __openerp__.py | scanterra_modifcations/__openerp__.py | scanterra_modifcations/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': 'Scanterra Modifications',
'version': '8.0.1.0.0',
'category': 'Sales Management',
'sequence': 14,
'summary': 'Sales, Product, Category, Clasification',
'description': """
Scanterra Modifications
=======================
* Restringir que las tareas creadas por un... | Python | 0.000024 | @@ -80,17 +80,17 @@
'8.0.1.
-0
+1
.0',%0A
|
559ba309a72d277c3b5a78614889d19b8866b7ea | add parallel by Alexandre Gramford (mne-python) | scikits/statsmodels/tools/parallel.py | scikits/statsmodels/tools/parallel.py | Python | 0 | @@ -0,0 +1,1281 @@
+%22%22%22Parralle util function%0A%22%22%22%0A%0A# Author: Alexandre Gramfort %3Cgramfort@nmr.mgh.harvard.edu%3E%0A#%0A# License: Simplified BSD%0A%0A%0Adef parallel_func(func, n_jobs, verbose=5):%0A %22%22%22Return parallel instance with delayed function%0A%0A Util function to use joblib only... | |
2c6be657e0024a1a2e162a6a508d2d5716736121 | add wrapper class for adiabatic approximation | galpy/actionAngle_src/actionAngleAdiabatic.py | galpy/actionAngle_src/actionAngleAdiabatic.py | Python | 0 | @@ -0,0 +1,2500 @@
+###############################################################################%0A# actionAngle: a Python module to calculate actions, angles, and frequencies%0A#%0A# class: actionAngleAdiabatic%0A#%0A# wrapper around actionAngleAxi (adiabatic approximation) to do%0A# ... | |
3a240005142da25aa49938a15d39ddf68dd7cead | Add functional test to verify presence of policy | nova/tests/functional/api/openstack/placement/test_verify_policy.py | nova/tests/functional/api/openstack/placement/test_verify_policy.py | Python | 0.003609 | @@ -0,0 +1,1967 @@
+# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or a... | |
b416de22866f6ebc05fcb256d5ab97f391481ddc | Create CSVStreamReader.py | CSVStreamReader.py | CSVStreamReader.py | Python | 0.000004 | @@ -0,0 +1,3611 @@
+%0A# The MIT License (MIT)%0A# Copyright (c) 2016 Chris Webb%0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A# of this software and associated documentation files (the %22Software%22), to deal%0A# in the Software without restriction, including without limitation th... | |
da09de30b376f1ab9e687e8064423499b4cf8d50 | Add missing file | vispy/util/context.py | vispy/util/context.py | Python | 0.000006 | @@ -0,0 +1,3076 @@
+# -*- coding: utf-8 -*-%0A# Copyright (c) 2014, Vispy Development Team.%0A# Distributed under the (new) BSD License. See LICENSE.txt for more info.%0A%0A%22%22%22%0AFunctionality to deal with GL Contexts in vispy. This module is not in%0Aapp, because we want to make it possible to use parts of vispy... | |
30c2a0b681187180ca8228e0160962c6f25e794c | Update doc version. | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('..')... | Python | 0 | @@ -641,16 +641,48 @@
'sphinx'
+%0Aversion = %222%22%0Arelease = version
%0A%0A# -- O
|
783e7f644e2fc659d432d447bbbe6a01f2ac74c1 | Fix #390 #450 | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from .models import User
class MyUserChan... | Python | 0.000004 | @@ -269,17 +269,16 @@
ionForm%0A
-%0A
from .mo
@@ -712,17 +712,17 @@
ata%5B
-'
+%22
username
'%5D%0A
@@ -717,17 +717,17 @@
username
-'
+%22
%5D%0A
@@ -952,16 +952,18 @@
)%0Aclass
+My
UserAdmi
@@ -1026,24 +1026,212 @@
rm = MyUserCreationForm%0A
+ fieldsets = (%0A ('User Profile', %7B'fiel... |
471c36f309360396fa173ec3b75d3783d791f5f5 | string is powerful | src/strings.py | src/strings.py | Python | 0.999999 | @@ -0,0 +1,286 @@
+person = %22Harold Finch%22%0Aprint person%5B0%5D,person%5B1%5D; # H a%0Aprint person%5B0:6%5D # Harold%0Agreeting = %22Hello %22 + person; # Hello Harold Finch%0Aprint greeting%5B:6%5D + %22John Reese%22; # Hello John Reese%0Acontains = 'H' in person;%0Anotcontains = 'R' in person;%0Aprint contains,... | |
9d51e2ef626ce61dd3ae563681477b12a2352881 | Add test_sprint | test_sprint.py | test_sprint.py | Python | 0.000002 | @@ -0,0 +1,73 @@
+def inc(val):%0A return val - 1%0A%0Adef test_inc():%0A assert inc(5) == 6%0A
| |
3f078529e743db7450bdd3ad61983f1e4ee9fd35 | handle 2006 elections | openelex/us/nc/datasource.py | openelex/us/nc/datasource.py | """
North Carolina has CSV files containing precinct-level results for each county and all offices
for all years back to 2000, except for the 2000 primary. There is one zip file per election,
with additional text files for county and race-level summaries. For the 2000 primary, individual
Excel files are available for ... | Python | 0.000002 | @@ -2411,16 +2411,30 @@
-09-10',
+ '2006-05-02',
'2006-0
|
8f6db5945348879a7340f8a4c7da6111a06cd062 | Add new module to statically host an arbitrary directory | python/smqtk/web/search_app/modules/static_host.py | python/smqtk/web/search_app/modules/static_host.py | Python | 0 | @@ -0,0 +1,857 @@
+import flask%0A%0A%0A__author__ = 'paul.tunison@kitware.com'%0A%0A%0Aclass StaticDirectoryHost (flask.Blueprint):%0A %22%22%22%0A Module that will host a given directory to the given URL prefix (relative to%0A the parent module's prefix).%0A%0A Instances of this class will have nothing se... | |
fdb8f36fd4eed11d5d757d8477b3c2b8619aae8a | Add management command to populate last_modified fields | corehq/apps/commtrack/management/commands/product_program_last_modified.py | corehq/apps/commtrack/management/commands/product_program_last_modified.py | Python | 0.000001 | @@ -0,0 +1,1793 @@
+from django.core.management.base import BaseCommand%0Afrom corehq.apps.commtrack.models import Product, Program%0Afrom dimagi.utils.couch.database import iter_docs%0Afrom datetime import datetime%0Aimport json%0A%0Aclass Command(BaseCommand):%0A help = 'Populate last_modified field for products a... | |
cf6d2e732ab4b7131312323632761561f2aa3a86 | add field user_email to DynamicSaveInputs | webapp/apps/dynamic/migrations/0002_dynamicsaveinputs_user_email.py | webapp/apps/dynamic/migrations/0002_dynamicsaveinputs_user_email.py | Python | 0.000001 | @@ -0,0 +1,441 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('dynamic', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AddField(%0A ... | |
6118b05f0efd1c2839eb8bc4de36723af1fcc364 | Convert snake_case to camelCase or PascalCase (#7028) (#7034) | strings/snake_case_to_camel_pascal_case.py | strings/snake_case_to_camel_pascal_case.py | Python | 0.997846 | @@ -0,0 +1,1591 @@
+def snake_to_camel_case(input: str, use_pascal: bool = False) -%3E str:%0A %22%22%22%0A Transforms a snake_case given string to camelCase (or PascalCase if indicated)%0A (defaults to not use Pascal)%0A%0A %3E%3E%3E snake_to_camel_case(%22some_random_string%22)%0A 'someRandomString'%0A... | |
e581d41ded30aac220875c4e5f8fd41e56889742 | Fix googlehome alarm sensor platform (#20742) | homeassistant/components/googlehome/sensor.py | homeassistant/components/googlehome/sensor.py | """
Support for Google Home alarm sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.googlehome/
"""
import logging
from datetime import timedelta
from homeassistant.components.sensor import ENTITY_ID_FORMAT
from homeassistant.components.goog... | Python | 0 | @@ -222,69 +222,8 @@
ta%0A%0A
-from homeassistant.components.sensor import ENTITY_ID_FORMAT%0A
from
@@ -268,16 +268,16 @@
mport (%0A
+
CLIE
@@ -421,34 +421,8 @@
tity
-, async_generate_entity_id
%0Aimp
@@ -952,16 +952,192 @@
ponent%22)
+%0A return%0A%0A await hass.data%5BCLIENT%5D.update_info(discov... |
4a71e883a469f22995775cbc1eeb6489a2dd71d1 | add integration test | tests/integration_tests/test_contrib_wandb.py | tests/integration_tests/test_contrib_wandb.py | Python | 0.000001 | @@ -0,0 +1,1432 @@
+import logging%0Aimport os%0Aimport shutil%0Aimport sys%0A%0Aimport ludwig.contrib%0Afrom tests.integration_tests.test_experiment import run_experiment%0Afrom tests.integration_tests.utils import image_feature%0Afrom tests.integration_tests.utils import category_feature%0Afrom tests.integration_test... | |
bbc4351a5611a035bbee1f18cb55b74d9583cdcd | Create a state for add an object | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Add_Object.py | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Add_Object.py | Python | 0.000006 | @@ -0,0 +1,1951 @@
+#!/usr/bin/env python%0A# encoding=utf8%0A%0Aimport json%0Aimport requests%0Afrom flexbe_core import EventState, Logger%0A%0A%0Aclass Wonderland_Add_Object(EventState):%0A%09'''%0A%09Add an object to Wonderland.%0A%09For the room, enter only ID or Name, not both.%0A%09Return the ID of the added huma... | |
3ce9dcb1ae21ac35ddd97d648ae3ff4b5877adc5 | add script for downloading and conversion of bhuman dataset after conversion the dataset is in the same format as the berlin-united one | Utils/py/BallDetection/RegressionNetwork/generate_image_db_bhuman.py | Utils/py/BallDetection/RegressionNetwork/generate_image_db_bhuman.py | Python | 0 | @@ -0,0 +1,2405 @@
+%22%22%22%0AConverts the b-human 2019 dataset to the naoth format so we can run performance comparisons%0A%22%22%22%0Aimport pickle%0Aimport numpy as np%0Aimport h5py%0Afrom pathlib import Path%0Afrom urllib.request import urlretrieve%0Afrom urllib.error import HTTPError, URLError%0Afrom utility_fun... | |
78bc96307fb52d95e36eab1da6fa57a66af736e8 | Add script to delete couch phone numbers | corehq/apps/sms/management/commands/delete_messaging_couch_phone_numbers.py | corehq/apps/sms/management/commands/delete_messaging_couch_phone_numbers.py | Python | 0 | @@ -0,0 +1,2141 @@
+from corehq.apps.sms.mixin import VerifiedNumber%0Afrom corehq.apps.sms.models import PhoneNumber%0Afrom dimagi.utils.couch.database import iter_docs_with_retry, iter_bulk_delete_with_doc_type_verification%0Afrom django.core.management.base import BaseCommand%0Afrom optparse import make_option%0A%0A... | |
20c6f14d4cc76771290f7ce6fc4f3dd5abed07b4 | write symbol calculus with sympy. | cpp/src/DO/Sara/MultiViewGeometry/Estimators/five_point_algorithm.py | cpp/src/DO/Sara/MultiViewGeometry/Estimators/five_point_algorithm.py | Python | 0 | @@ -0,0 +1,418 @@
+from sympy import *%0A%0AX = Matrix(symbols(' '.join(%5B'X%7B%7D'.format(i) for i in range(9)%5D))).reshape(3, 3)%0AY = Matrix(symbols(' '.join(%5B'Y%7B%7D'.format(i) for i in range(9)%5D))).reshape(3, 3)%0AZ = Matrix(symbols(' '.join(%5B'Z%7B%7D'.format(i) for i in range(9)%5D))).reshape(3, 3)%0AW =... | |
25b0544c2f2c78dbc3bf971d955fda651d7ed5e9 | fix is_open_for_signup missing param | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/adapter.py | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/adapter.py | # -*- coding: utf-8 -*-
from django.conf import settings
from allauth.account.adapter import DefaultAccountAdapter
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
class AccountAdapter(DefaultAccountAdapter):
def is_open_for_signup(self, request):
return getattr(settings, 'ACCOUNT_ALL... | Python | 0.000021 | @@ -428,32 +428,45 @@
up(self, request
+, sociallogin
):%0A retur
|
c8143c9f3eca422e48625700aeef11e528131caf | add zeroOutDisk.py | zeroOutDisk.py | zeroOutDisk.py | Python | 0.000001 | @@ -0,0 +1,245 @@
+#!/usr/bin/env python %0A%0Adef zeroOutDisk():%0A %22%22%22Fill selected device (/dev/) with zeros.%22%22%22%0A%09pass=1 %0A%09for int in range(wipe):%0A%09%09print 'Wiping drives pass %25s of $s%22)%25(pass, count))%0A%09%09os.system((%22dd if=/dev/zero of=%25s%22)%25(device))%0A%09%09pass+=1... | |
8b26888dea4e825d06b6ebfed628a1762f6a5455 | Solve 48. | 048/solution.py | 048/solution.py | Python | 0.999984 | @@ -0,0 +1,429 @@
+# coding: utf-8%0A%0A%22%22%22 Project Euler problem #48. %22%22%22%0A%0A%0Adef problem():%0A u%22%22%22 Solve the problem.%0A%0A The series, 11 + 22 + 33 + ... + 1010 = 10405071317.%0A%0A Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.%0A%0A Answer: 9110846700%0A%0... | |
e0770c4a671c650f4569036350b4047fcf925506 | Add a demo app to illustrate the result | AnalysisDemo.py | AnalysisDemo.py | Python | 0 | @@ -0,0 +1,1461 @@
+import wx%0A#import matplotlib%0A%0Aclass AnalysisDemo(wx.Frame):%0A def __init__(self, *args, **kw):%0A super(AnalysisDemo, self).__init__(*args, **kw)%0A self.initMain()%0A%0A def initMain(self):%0A pn = wx.Panel(self)%0A%0A self.showPackage = wx.RadioButton(pn, l... | |
0d92a54f244b1d2ba3a0e6be5a2ff9ab0766171c | lab3 lab3 | Lab3/palindrome.py | Lab3/palindrome.py | Python | 0.999727 | @@ -0,0 +1,147 @@
+check=input(%22input word for testing%22)%0Adef del_space(word):%0A word = word.replace(%22 %22,%22%22)%0A word = word.lower()%0A print(word)%0A return word%0A
| |
b19d6a63d80919b3e7a2f3c40cd026085a526614 | Create Rehash.py | LintCode/Rehash.py | LintCode/Rehash.py | Python | 0 | @@ -0,0 +1,2477 @@
+'''%0AMedium Rehashing Show result %0A%0A25%25 Accepted%0AThe size of the hash table is not determinate at the very beginning. If the total size of keys is too large (e.g. size %3E= capacity / 10), we should double the size of the hash table and rehash every keys. Say you have a hash table looks lik... | |
af4a5e92dc7ef8bffa96c6e556671e1c49116a70 | Test commit | radproc.py | radproc.py | Python | 0 | @@ -0,0 +1,419 @@
+#-------------------------------------------------------------------------------%0D%0A# Name: module1%0D%0A# Purpose:%0D%0A#%0D%0A# Author: heistermann%0D%0A#%0D%0A# Created: 26.10.2011%0D%0A# Copyright: (c) heistermann 2011%0D%0A# Licence: %3Cyour licence%3E%0D%0A#-------------... | |
217b95f7ecb42dd4a9a671703c86a2b83838bb28 | rename to .py | python_solutions/PENULTIMATE_WORD/PENULTIMATE_WORD.py | python_solutions/PENULTIMATE_WORD/PENULTIMATE_WORD.py | Python | 0.999999 | @@ -0,0 +1,583 @@
+%22%22%22%0AWrite a program which finds the next-to-last word in a string.%0A%0AINPUT SAMPLE:%0A%0AYour program should accept as its first argument a path to a filename. Input%0Aexample is the following:%0A%0Asome line with text%0Aanother line%0A%0AEach line has more than one word.%0A%0AOUTPUT SAMPLE... | |
bc10094ef6250558d713f3636dbd01f295503f15 | Create NovelAPI.py | NovelAPI.py | NovelAPI.py | Python | 0 | @@ -0,0 +1,2690 @@
+import aiohttp%0Afrom bs4 import BeautifulSoup%0A%0Aonlysession = aiohttp.ClientSession()%0Aclass NovelUpdatesAPI:%0A def __init__(self):%0A self.baseurl = 'http://www.novelupdates.com/'%0A%0A async def search_novel_updates(self, term: str):%0A term = term.replace(' ', '+')%0A ... | |
ea3f995775b42784d99ebc19effce949a700eb28 | Update blocks.py | Urutu/cl/blocks.py | Urutu/cl/blocks.py | ## OpenCL blocks are initialized here!
## Created by: Aditya Atluri
## Date: Mar 03 2014
def bx(blocks_dec, kernel):
if blocks_dec == False:
string = "int bx = get_group_id(0);\n"
kernel = kernel + string
blocks_dec = True
return kernel, blocks_dec
def by(blocks_dec, kernel):
if blocks_dec == False:
string... | Python | 0.000001 | @@ -157,28 +157,69 @@
nt bx =
+(
get_g
-roup_id
+lobal_id(0) - get_local_id(0)) / get_local_size
(0);%5Cn%22%0A
@@ -367,28 +367,69 @@
nt by =
+(
get_g
-roup_id
+lobal_id(1) - get_local_id(1)) / get_local_size
(1);%5Cn%22%0A
@@ -581,20 +581,61 @@
z =
+(
get_g
-roup_id
+lobal_id(2) - get_local_id(2)) / get_loc... |
f9bad030fffbf6b50ec5833c4024656c725c7679 | Rename and add item3. | Python/item3.py | Python/item3.py | Python | 0 | @@ -0,0 +1,416 @@
+#!/usr/local/bin/python%0A# -*- coding:utf-8 -*-%0Aimport sys%0A%0Adef to_unicode(unicode_or_str):%0A if isinstance(unicode_or_str,str):%0A v=unicode_or_str.decode('utf-8')%0A else:%0A v=unicode_or_str%0A return v%0A%0Adef to_str(unicode_or_str):%0A if isinstance(unicode_or_str,unicode):%0A... | |
a4fbaaa77673dfd68ea2a453a892ca7216ea6110 | fix traceback in write | addons/sale_timesheet/models/sale_timesheet.py | addons/sale_timesheet/models/sale_timesheet.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import models, api, fields
from openerp.tools.translate import _
from openerp.exceptions import UserError
class ResCompany(models.Model):
_inherit = 'res.company'
@api.model
def _get_uom_hour... | Python | 0 | @@ -3168,32 +3168,62 @@
(self, values):%0A
+ for line in self:%0A
values =
@@ -3215,36 +3215,36 @@
values =
-self
+line
._get_timesheet_
@@ -3261,38 +3261,35 @@
values)%0A
-return
+
super(AccountAn
@@ -3300,20 +3300,20 @@
icLine,
-self
+line
).write(
@@ -3319,16 +3319,36 ... |
2caf6ab1e43ad29864e4dc652a60e445adfa31bb | Add session merger tool | SessionTools/session_merger.py | SessionTools/session_merger.py | Python | 0 | @@ -0,0 +1,2459 @@
+import gzip%0Aimport os%0Aimport random%0Aimport time%0Aimport sys%0A%0AVERBOSE = True%0A%0Adef log(s):%0A if VERBOSE:%0A print (time.strftime(%22%25Y-%25m-%25d %25H:%25M:%25S%22) + %22 %22 + str(s))%0A%0Aif len(sys.argv) != 3:%0A print (%22Usage: python session_merger.py PathToInSessions PathT... | |
e9861532a3aa420b68bc797ee54f7429ea73c0e7 | fix #1 | rest.py | rest.py | Python | 0.000002 | @@ -0,0 +1,180 @@
+from flask import Flask%0Aapp = Flask(__name__)%0A%0A@app.route(%22/%22)%0Adef ping():%0A return %22python server received 'ping' request!%22%0A%0Aif __name__ == %22__main__%22:%0A app.run(debug=True)%0A%0A
| |
e40091a2105fc4e04bcce9b2c6ebcc7cf28f22ca | add module uwsgi | modules/uwsgi.py | modules/uwsgi.py | Python | 0.000001 | @@ -0,0 +1,993 @@
+%22%22%22uwsgi-for-Django module.%0A%0AWebsite: https://uwsgi-docs.readthedocs.io/en/latest/%0A%22%22%22%0Aimport os%0A%0Adef uwsgi(loader, *args):%0A loader.setup_virtualenv()%0A venv_dir = loader.get_virtualenv_dir()%0A binargs = %5Bos.path.join(venv_dir, 'bin', 'uwsgi')%5D + list(args)%0A... | |
a1d523c2daf563444761cb7315e18e1e0ee1b506 | Add ARM program (forgot to add) | ppci/arch/arm/program.py | ppci/arch/arm/program.py | Python | 0 | @@ -0,0 +1,870 @@
+from ppci.programs import MachineProgram%0A%0A%0Aclass ArmProgram(MachineProgram):%0A %22%22%22 Machine code for most mobile devices and e.g. the Raspberry Pi.%0A %22%22%22%0A %0A def _check_items(self, items):%0A return items%0A %0A def _copy(self):%0A raise NotImplem... | |
10af3d7ee13afda37e8ecf76927bc2fedfe22b6f | add expand module | biothings_explorer/expand/__init__.py | biothings_explorer/expand/__init__.py | Python | 0.000001 | @@ -0,0 +1,2230 @@
+from collections import defaultdict%0A%0Afrom ..smartapi_kg import MetaKG%0Afrom ..call_apis import APIQueryDispatcher%0Afrom ..query.utils import annotateEdgesWithInput%0A%0A%0Aclass Expander:%0A def __init__(self):%0A self.kg = MetaKG()%0A self.kg.constructMetaKG(source=%22local%2... | |
b55e27e7420443b4d9a48da7c4e5501e1de66f44 | Add some code | modules/descriptive_statistics/app.py | modules/descriptive_statistics/app.py | Python | 0.000013 | @@ -0,0 +1,109 @@
+class DescriptiveStatistics():%0A%09def __init__(self,data):%0A%09%09return self.main()%0A%0A%09def main(self):%0A%09%09return True
| |
10c1b98f42a57c1f6672207d8de4a39e1482caec | Fix on_change_party in sale | sale.py | sale.py | # -*- coding: utf-8 -*-
"""
sale
:copyright: (c) 2015 by Openlabs Technologies & Consulting (P) Limited
:license: see LICENSE for more details.
"""
from trytond.model import fields
from trytond.transaction import Transaction
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval, Or, Bool
... | Python | 0 | @@ -5432,16 +5432,28 @@
e in res
+.iteritems()
:%0A
|
c505b95c3affe3805bd9274c3aedd1c6640c5ff5 | Create solution.py | leetcode/medium/linked_list_cycle_ii/py/solution.py | leetcode/medium/linked_list_cycle_ii/py/solution.py | Python | 0.000018 | @@ -0,0 +1,781 @@
+# Definition for singly-linked list.%0A# class ListNode(object):%0A# def __init__(self, x):%0A# self.val = x%0A# self.next = None%0A%0Aclass Solution(object):%0A def detectCycle(self, head):%0A %22%22%22%0A :type head: ListNode%0A :rtype: ListNode%0A ... | |
2b7fffd3f6f358df5613b9aa304f9a70f9b04bc2 | add bloom filter script | cloud-computing-concepts-part1/scripts/bloom-filter.py | cloud-computing-concepts-part1/scripts/bloom-filter.py | Python | 0 | @@ -0,0 +1,251 @@
+__author__ = 'grokrz'%0A%0Am = 32%0A%0A%0Adef hash_function(x, i, m):%0A return ((pow(x, 2) * pow(x, 3)) * i) %25 m%0A%0A%0Adef show_bits_set_to_1(val):%0A for i in range(1, 4):%0A print %22Bit set to 1: %22 + str(hash_function(val, i, m))%0A%0A%0Ashow_bits_set_to_1(2013)
| |
c3a83ed6158fcd9335f9253417ca4b24e9ab7934 | Add test for fqdn thread leak | tests/pytests/unit/modules/test_network.py | tests/pytests/unit/modules/test_network.py | Python | 0.000002 | @@ -0,0 +1,898 @@
+import threading%0A%0Aimport pytest%0Aimport salt.modules.network as networkmod%0Afrom tests.support.mock import patch%0A%0A%0A@pytest.fixture%0Adef configure_loader_modules():%0A return %7Bnetworkmod: %7B%7D%7D%0A%0A%0A@pytest.fixture%0Adef socket_errors():%0A # Not sure what kind of errors co... | |
f58589f4bcb2aa233ebbd71831e31b1b9505e2c4 | Create wiki_img_extractor.py | wiki_img_extractor.py | wiki_img_extractor.py | Python | 0.000001 | @@ -0,0 +1,1665 @@
+##/**%0A## * xa2.js%0A## * @author Akshay Dahiya - @xadahiya%0A## * @description Typingeek's tutor script%0A## */%0A%0Aimport wikipedia, requests, lxml.html%0A%0A###images and caption from wikipedia%0A##%0A##main image from table@class=%22infobox%22%0A## img/@src,img/@alt%0A## %0A##wikipedia i... | |
f7328b96275bad6c3d8d9a4f844d47a65fe2bf4b | Create test_wrap.py | wordwrap/test_wrap.py | wordwrap/test_wrap.py | Python | 0.000007 | @@ -0,0 +1,904 @@
+import unittest%0Afrom wrap import wrap%0A%0A%0Aclass TestWW(unittest.TestCase):%0A def test_empty_string(self):%0A self.assertEqual('', wrap('', 1))%0A%0A def test_string_smaller_than_col(self):%0A self.assertEqual('ab', wrap('ab', 3))%0A%0A def test_string_without_spaces(self... | |
7922f168c1f844d7f1b69dfb383918d051cc312f | test when no server is present on the connection | tests/twisted/search/no-server-property.py | tests/twisted/search/no-server-property.py | """
Tests Contact Search channels to a simulated XEP-0055 service, without
passing the Server property
"""
import dbus
from twisted.words.xish import xpath
from gabbletest import exec_test, sync_stream, make_result_iq, acknowledge_iq, elem_iq, elem
from servicetest import EventPattern
from search_helper import call_... | Python | 0 | @@ -409,20 +409,33 @@
t'%0A%0Adef
-test
+server_discovered
(q, bus,
@@ -2026,51 +2026,1102 @@
R)%0A%0A
-if __name__ == '__main__':%0A exec_test(test
+def no_server_discovered(q, bus, conn, stream):%0A conn.Connect()%0A%0A _, iq_event, disco_event = q.expect_many(%0A EventPattern('dbus-signal', signa... |
0a02faf18fd3f05156df1b59dce83cee49a149f5 | set version in finstance | onadata/apps/fsforms/management/commands/save_version_in_finstance.py | onadata/apps/fsforms/management/commands/save_version_in_finstance.py | Python | 0 | @@ -0,0 +1,1057 @@
+from django.core.management.base import BaseCommand%0Afrom onadata.apps.fsforms.models import FInstance%0A%0Aclass Command(BaseCommand):%0A help = 'Set version in FInstance for given user'%0A %0A def add_arguments(self, parser):%0A parser.add_argument('username', type=str)%0A%0A d... | |
b7f9bbd7afd64c702a2ea296b9e47cb5f563a4a2 | Create valid-square.py | Python/valid-square.py | Python/valid-square.py | Python | 0.99833 | @@ -0,0 +1,1089 @@
+# Time: O(1)%0A# Space: O(1)%0A%0A# Given the coordinates of four points in 2D space,%0A# return whether the four points could construct a square.%0A#%0A# The coordinate (x,y) of a point is represented by an integer array with two integers.%0A#%0A# Example:%0A# Input: p1 = %5B0,0%5D, p2 = %5B1,1%5D... | |
9925f3a677b7a855a2242176139bde4ab9d62ba0 | Add script which will compute the number of 'bonnes boites' per rome | labonneboite/scripts/nb_hirings/rome_nb_bonne_boite.py | labonneboite/scripts/nb_hirings/rome_nb_bonne_boite.py | Python | 0.834097 | @@ -0,0 +1,273 @@
+import pandas as pd%0A%0Aif __name__ == '__main__':%0A%0A df = pd.read_csv('prediction_per_company_per_rome2019-11-08.csv')%0A df_rome_nb_bonne_boite = df.groupby(%5B'rome'%5D)%5B'is a bonne boite ?'%5D.sum()%0A df_rome_nb_bonne_boite.to_csv('nb_bonne_boite_per_rome2019-11-089.csv')%0A
| |
8f488365c9a4f14bf96eab089d6ac869b675c1b4 | Add system.version functional test | tests/functional/test_system.py | tests/functional/test_system.py | Python | 0.000002 | @@ -0,0 +1,989 @@
+import logging%0Aimport unittest%0A%0Aimport trovebox%0Afrom tests.functional import test_base%0A%0Aclass TestSystem(test_base.TestBase):%0A testcase_name = %22system%22%0A%0A def setUp(self):%0A %22%22%22%0A Override the default setUp, since we don't need a populated database%0A ... | |
234d53ed185976a65042c136426d7f05022a698d | add memnn test | tests/test_memnn.py | tests/test_memnn.py | Python | 0.000001 | @@ -0,0 +1,1496 @@
+from __future__ import print_function%0A%0Aimport unittest%0Afrom seya.layers.memnn2 import MemN2N%0Afrom keras.models import Sequential%0Afrom keras.layers.core import Lambda%0Afrom keras import backend as K%0A%0Aimport numpy as np%0A%0A%0Aclass TestMemNN(unittest.TestCase):%0A %22%22%22Test sey... | |
737ac4ddbc3d047fbf41e3d9f7cde20a53d8974a | add management command to decrypt eval data | evaluation/management/commands/decrypt_eval_data.py | evaluation/management/commands/decrypt_eval_data.py | Python | 0.000002 | @@ -0,0 +1,1368 @@
+from django.core.management.base import BaseCommand%0Aimport gnupg%0Aimport json%0Afrom django.conf import settings%0Aimport environ%0Aenv = environ.Env()%0A%0Afrom evaluation.models import EvalRow%0A%0Aclass Command(BaseCommand):%0A help='decrypts eval data. can only be run in local environments... | |
b977b1e6732255732843aaaad3e5c1f8e2b4d0e0 | add unit tests for openquake/utils/general.py | tests/utils_general_unittest.py | tests/utils_general_unittest.py | Python | 0.000004 | @@ -0,0 +1,901 @@
+# -*- coding: utf-8 -*-%0A# vim: tabstop=4 shiftwidth=4 softtabstop=4%0A%0A# Copyright (c) 2010-2011, GEM Foundation.%0A#%0A# OpenQuake is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Lesser General Public License version 3%0A# only, as published by the Free ... | |
e4e4a52318b857ce315a6f673e72b018e6501a83 | Add a plotting example. | Lib/sandbox/pyem/examples/plotexamples.py | Lib/sandbox/pyem/examples/plotexamples.py | Python | 0.999999 | @@ -0,0 +1,1049 @@
+#! /usr/bin/env python%0A# Last Change: Mon Jun 11 03:00 PM 2007 J%0A%0A# This is a simple test to check whether plotting ellipsoides of confidence and%0A# isodensity contours match%0Aimport numpy as N%0Afrom numpy.testing import set_package_path, restore_path%0A%0Aimport pylab as P%0A%0Aset_package... | |
0caef8ed3bcf369ffd61f83b06f971b31ae0fb70 | test unittest | bnw_core/test_delayed_global.py | bnw_core/test_delayed_global.py | Python | 0.000001 | @@ -0,0 +1,325 @@
+# coding: utf-8%0Afrom delayed_global import DelayedGlobal%0A%0Adef test_delayed_global():%0A a = DelayedGlobal()%0A b = dict(%7B100:200%7D)%0A%0A try:%0A c = a.get(100)%0A except AttributeError:%0A pass%0A else:%0A assert 0, %22Got result from empty DelayedGlobal%... | |
ae6f5556cc37d72fff49c76932b94ac8a65bcfbf | make an example python' | example.py | example.py | Python | 0.001311 | @@ -0,0 +1,1064 @@
+import time%0Aimport uuid%0Afrom datetime import datetime%0Afrom decimal import Decimal%0A%0Afrom json_util import dumps, loads%0A%0Ajson_ = %7B%22MyString%22: %22a%22,%0A %22num%22: 4,%0A %22MyBool%22: False,%0A %22my_dict%22: %7B%22my_date%22: datetime.utcnow()%7D,%0A ... | |
405d33789a70a04ebdcca491ca2a749e9e48ddfd | Add example | example.py | example.py | Python | 0.000003 | @@ -0,0 +1,1115 @@
+import pygame%0Aimport bluePoV%0A%0A# Varia el color regularmente%0Ax,y = (480,64)%0Apendiente = 4%0A%0A# Pygame inits & variables%0Apygame.init()%0Apygame.display.set_mode((x,y))%0A%0Adisp = pygame.display.get_surface()%0Aclock = pygame.time.Clock()%0A%0A# BluePoV init & variables%0Aprint (%22Port?... | |
3a200bbc447ee05c650bbd592a331b2817c9a498 | Update create_address_doc_from_address_field_in_company.py | erpnext/patches/v8_0/create_address_doc_from_address_field_in_company.py | erpnext/patches/v8_0/create_address_doc_from_address_field_in_company.py | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
# new field address_html is created in place of address field for the company's address in PR #8754 (without patch)
# so here is the patch for ... | Python | 0.000004 | @@ -508,16 +508,20 @@
ompany%60
+%0A%09%09%09
where ad
@@ -537,16 +537,34 @@
not null
+ and address != %22%22
''', as_
|
a6c8176e3f4602e846888293093fc64b7b20233b | Add cmd to force send of cancelled repeat records | corehq/motech/repeaters/management/commands/send_cancelled_records.py | corehq/motech/repeaters/management/commands/send_cancelled_records.py | Python | 0 | @@ -0,0 +1,3264 @@
+import csv%0Aimport datetime%0Aimport re%0Aimport time%0A%0Afrom django.core.management.base import BaseCommand%0A%0Afrom corehq.motech.repeaters.const import RECORD_CANCELLED_STATE%0Afrom corehq.motech.repeaters.dbaccessors import iter_repeat_records_by_domain%0A%0A%0Aclass Command(BaseCommand):%0A... | |
bf66372b2b5b49ba4a93d8ac4f573ceb7857f5b8 | Fix attach in case of multiple threads. | python/helpers/pydev/pydevd_attach_to_process/linux/lldb_threads_settrace.py | python/helpers/pydev/pydevd_attach_to_process/linux/lldb_threads_settrace.py | # This file is meant to be run inside lldb as a command after
# the attach_linux.dylib dll has already been loaded to settrace for all threads.
def __lldb_init_module(debugger, internal_dict):
# Command Initialization code goes here
print('Startup LLDB in Python!')
try:
show_debug_info = 0
... | Python | 0 | @@ -266,16 +266,32 @@
ython!')
+%0A import lldb
%0A%0A tr
@@ -319,17 +319,17 @@
_info =
-0
+1
%0A
@@ -494,16 +494,21 @@
for t
+hread
in proc
@@ -578,55 +578,351 @@
-frame = t.GetFrameAtIndex (t.GetNum
+print('Thread %25s, suspended %25s%5Cn'%25(thread, thread.IsStopped()))%0A%0A ... |
1f6595acc01c6dfda899886388b4309f3d8c855b | add index to fixed_ips | nova/db/sqlalchemy/migrate_repo/versions/139_add_indexes_to_fixed_ips.py | nova/db/sqlalchemy/migrate_repo/versions/139_add_indexes_to_fixed_ips.py | Python | 0.000001 | @@ -0,0 +1,1429 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4%0A%0A# Copyright 2012 OpenStack LLC.%0A# All Rights Reserved.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License... | |
5e8ce7c9fb31d76ec5f372bb0b62e7b846304966 | Create exerc-4.py | exerc-4.py | exerc-4.py | Python | 0.000001 | @@ -0,0 +1,503 @@
+arquivo = open(%22arquivo.txt%22,%22w%22)%0Afor i in range(1):%0A arquivo.write(%22Atividade 4 %22)%0Aarquivo.close()%0A%0A%0A%0Aarquivo = open(%22arquivo.txt%22,%22r%22)%0Afor linha in arquivo:%0A print(%22Texto: %22,linha)%0Aarquivo.close()%0A%0A%0A%0Aarquivo = open(%22arquivo.txt%22, %22r%22... | |
98a6a1dfe9b692cfde47e25a504d2a9ee80bcf29 | remove unnecessary import | planetstack/observer/event_manager.py | planetstack/observer/event_manager.py | import threading
import requests, json
from core.models import *
from planetstack.config import Config
from observer.deleters import deleters
import os
import base64
from fofum import Fofum
import json
# decorator that marks dispatachable event methods
def event(func):
setattr(func, 'event', func.__name__)
... | Python | 0.000037 | @@ -37,34 +37,8 @@
on%0A%0A
-from core.models import *%0A
from
|
a18ef3eb9128ee27d4f14e7952ba8545b510c4ac | add e2e test file | e2e_test.py | e2e_test.py | Python | 0.000001 | @@ -0,0 +1,778 @@
+# Copyright 2015, Google, Inc.%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may not use%0A# this file except in compliance with the License. You may obtain a copy of the%0A# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable%0A# law or a... | |
5695a468f8619ea6bb7c9a01857a375f827de6a1 | Add parser for 0.4.6 XML report. | libptp/tools/arachni/parser.py | libptp/tools/arachni/parser.py | Python | 0 | @@ -0,0 +1,1460 @@
+from libptp.exceptions import NotSupportedVersionError%0Afrom libptp.info import Info%0Afrom libptp.parser import AbstractParser%0A%0A%0Aclass ArachniXMLParser(AbstractParser):%0A%0A __tool__ = 'arachni'%0A __format__ = 'xml'%0A __version__ = %5B'0.4.6'%5D%0A%0A def __init__(self, *args,... | |
8e9c2a3c31184e789bf2788f5fa0ab06e0db988f | Add utilities module | sufam/utils.py | sufam/utils.py | Python | 0.000001 | @@ -0,0 +1,372 @@
+import errno%0Aimport os%0Aimport shutil%0Aimport sys%0A%0A%0Adef mkdir_p(path):%0A try:%0A os.makedirs(path)%0A except OSError as exc:%0A if exc.errno == errno.EEXIST and os.path.isdir(path):%0A pass%0A else:%0A raise%0A%0A%0Adef rm_rf(path):%0A if... | |
469d2bde4420017d2361ebcebfe9506517d041ae | fix typo in ir_cron | bin/addons/base/ir/ir_cron.py | bin/addons/base/ir/ir_cron.py | ##############################################################################
#
# Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
# Fabien Pinckaers <fp@tiny.Be>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of asse... | Python | 0.999802 | @@ -3689,15 +3689,15 @@
ttr(
+m,
func
-, m
):%0A%09
|
7d23360e8df0659cf506cae3ecd72eeddfb0adf6 | Fix local deploy (doesn't require it to be a git repo) and do proper fab_shared upload to s3. | fabfile.py | fabfile.py | #!/usr/bin/env python
import os
from fabric.api import env, abort, require, settings, runs_once, prompt, get
from fabric.contrib.console import confirm
from fab_shared import (_find_unit_root, _development, _production, _localhost,
_clone, _make_release, TIME_NOW, _make_archive,
_conditional_upload_to_s... | Python | 0 | @@ -315,16 +315,31 @@
d_to_s3,
+ _upload_to_s3,
S3_KEY,
@@ -2209,77 +2209,8 @@
-# TODO this will never happen, since it's not tagged%0A _conditional
_upl
|
efb6072e097a816bb46fdd83541c763e222816c9 | Add initial tests for the concordance view | clic/dickens/test_concordance.py | clic/dickens/test_concordance.py | Python | 0 | @@ -0,0 +1,1257 @@
+import unittest%0Afrom concordance_new import Concordancer_New%0A%0A%0Aclass TestConcordancerNewChapterIndex(unittest.TestCase):%0A %0A def test_create_concordance(self):%0A %22%22%22%0A This is a very naive test to run whilst reviewing the create %0A concordance code. It'... | |
915f94433171c9ee73fa5cf5941c695590e6ee16 | add fabric config file | fabfile.py | fabfile.py | Python | 0.000001 | @@ -0,0 +1,1550 @@
+import os, re%0Afrom datetime import datetime%0A%0Afrom fabric.api import *%0A%0A%0A#server user name%0Aenv.user = 'zhengnan'%0A%0A# sudo user%0Aenv.sudo_user = 'root'%0A%0A# server address%0Aenv.hosts = %5B'192.168.56.103'%5D%0A%0Adb_user = 'www-data'%0Adb_password = 'www-data'%0A%0A_TAR_FILE = 'di... | |
9f5bc55f7cfc5b6d0ee3ee9d6ad8a5317e1fa62b | Move all constants here | consts.py | consts.py | Python | 0.000003 | @@ -0,0 +1,144 @@
+## Constants%0A%0A# Lat / long bounding box of City of Portland%0A# (-123.0, 44.0, -122.0, 45.0) ??%0APDX_BOUNDING_BOX = (-122.9, 45.35, -122.4, 45.7)%0A%0A
| |
7185136cf4322397803eabe805ab4e818197edf8 | Add wsgi startup script | core.wsgi | core.wsgi | Python | 0.000001 | @@ -0,0 +1,235 @@
+import os%0Aimport sys%0A%0Aroot = os.path.dirname(__file__)%0Asys.path.insert(0, root)%0A%0Afrom core import app as application%0Afrom core import index%0Afrom core.handlers.search import *%0Afrom core.handlers.regulation import *%0A%0Aindex.init_schema()%0A
| |
a76f2bfea735f6b452785185ebc257d1da179ec4 | Add tests (#5451) | core/platform/taskqueue/gae_taskqueue_services_test.py | core/platform/taskqueue/gae_taskqueue_services_test.py | Python | 0 | @@ -0,0 +1,1744 @@
+# coding: utf-8%0A#%0A# Copyright 2018 The Oppia Authors. All Rights Reserved.%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.o... | |
e0085ac404e3c811b48e60e0acf088889dc72248 | Fix synth script | tasks/synth.py | tasks/synth.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0.000009 | @@ -901,22 +901,18 @@
pic.
-_generate_code
+py_library
(%0A
@@ -936,18 +936,8 @@
a2',
- 'python',
%0A
@@ -977,54 +977,8 @@
aml'
-,%0A artman_output_name='cloud-tasks-v2beta2'
)%0A%0As
|
f54168d54c36c6d1e7bac5432ac9f72bd0c19617 | Version bump to 0.8.1 | aliyun/__init__.py | aliyun/__init__.py | """
Aliyun API
==========
The Aliyun API is well-documented at `dev.aliyun.com <http://dev.aliyun.com/thread.php?spm=0.0.0.0.MqTmNj&fid=8>`_.
Each service's API is very similar: There are regions, actions, and each action has many parameters.
It is an OAuth2 API, so you need to have an ID and a secret. You can get the... | Python | 0 | @@ -2204,10 +2204,12 @@
_ = %220.8
+.1
%22%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.