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 |
|---|---|---|---|---|---|---|---|
724bc46c85e6ea75ac8d786f4d1706b74df8f330 | Create dictid.py | dictid.py | dictid.py | Python | 0.000001 | @@ -0,0 +1,85 @@
+a = (1,2)%0Ab = %5B1,2%5D%0Ac = %7Ba: 1%7D # outcome: c= %7B(1,2): 1%7D %0Ad = %7Bb: 1%7D # outcome: error%0A
| |
7d574c1f6d194df1f2b2009fb2e48fbaacaca873 | Add migration for_insert_base | oedb_datamodels/versions/6887c442bbee_insert_base.py | oedb_datamodels/versions/6887c442bbee_insert_base.py | Python | 0.000002 | @@ -0,0 +1,1098 @@
+%22%22%22Add _insert_base%0A%0ARevision ID: 6887c442bbee%0ARevises: 3886946416ba%0ACreate Date: 2019-04-25 16:09:20.572057%0A%0A%22%22%22%0Afrom alembic import op%0Aimport sqlalchemy as sa%0A%0A%0A# revision identifiers, used by Alembic.%0Arevision = '6887c442bbee'%0Adown_revision = '3886946416ba'%0... | |
2ef707337adc3d0abc33ca638b2adb70a681bd12 | update for new API | doc/examples/filters/plot_denoise.py | doc/examples/filters/plot_denoise.py | """
====================
Denoising a picture
====================
In this example, we denoise a noisy version of the picture of the astronaut
Eileen Collins using the total variation and bilateral denoising filter.
These algorithms typically produce "posterized" images with flat domains
separated by sharp edges. It i... | Python | 0 | @@ -1618,21 +1618,21 @@
, sigma_
-range
+color
=0.05, s
@@ -1883,13 +1883,13 @@
gma_
-range
+color
=0.1
|
9e6a016c5a59b25199426f6825b2c83571997e68 | Refactor buildbot tests so that they can be used downstream. | build/android/buildbot/tests/bb_run_bot_test.py | build/android/buildbot/tests/bb_run_bot_test.py | #!/usr/bin/env python
# Copyright (c) 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 os
import subprocess
import sys
BUILDBOT_DIR = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(BUILDBOT_DIR)
... | Python | 0.000099 | @@ -346,29 +346,29 @@
nBot
-sWithTesting(bot_step
+Processes(bot_process
_map
@@ -387,249 +387,40 @@
0%0A
-procs = %5B%0A (
+for
bot,
-sub
proc
-ess.Popen(%0A %5Bos.path.join(BUILDBOT_DIR, 'bb_run_bot.py'), '--bot-id', bot,%0A '--testing'%5D, stdout=subprocess.PIPE, stderr=subprocess.PIP... |
eb9f9d8bfa5ea278e1fb39c59ed660a223b1f6a9 | Add flask api app creation to init | api/__init__.py | api/__init__.py | Python | 0.000001 | @@ -0,0 +1,393 @@
+from flask_sqlalchemy import SQLAlchemy%0Aimport connexion%0A%0Afrom config import config%0A%0Adb = SQLAlchemy()%0A%0A%0Adef create_app(config_name):%0A app = connexion.FlaskApp(__name__, specification_dir='swagger/')%0A app.add_api('swagger.yaml')%0A application = app.app%0A application.... | |
48cc03558fcd1debf4d2453f26716839acba9e58 | Add output sanity checks for called commands | tests/test_integration.py | tests/test_integration.py | import os
import tempfile
import vimrunner
from tasklib.task import TaskWarrior, Task
server = vimrunner.Server()
class IntegrationTest(object):
input = None
output = None
def add_plugin(self, name):
plugin_base = os.path.expanduser('~/.vim/bundle/')
plugin_path = os.path.join(plugin_ba... | Python | 0.000003 | @@ -3,16 +3,26 @@
port os%0A
+import re%0A
import t
@@ -1637,17 +1637,73 @@
vimwiki'
-)
+, silent=False) # TODO: fix these vimwiki loading errors
%0A%0A de
@@ -1777,16 +1777,53 @@
command
+, silent=True, regex=None, lines=None
):%0A
@@ -1819,36 +1819,38 @@
one):%0A re
-turn
+sult =
self.client... |
c10eb3861daf48c13ec854bd210db5d5e1163b11 | Add LotGroupAutocomplete | livinglots_lots/autocomplete_light_registry.py | livinglots_lots/autocomplete_light_registry.py | Python | 0 | @@ -0,0 +1,525 @@
+from autocomplete_light import AutocompleteModelBase, register%0A%0Afrom livinglots import get_lotgroup_model%0A%0A%0Aclass LotGroupAutocomplete(AutocompleteModelBase):%0A autocomplete_js_attributes = %7B'placeholder': 'lot group name',%7D%0A search_fields = ('name',)%0A%0A def choices_for_r... | |
a5081ac307e037caee6bbd1add49d4c0d9424353 | Fix wake_on_lan for german version of Windows 10 (#6397) (#6398) | homeassistant/components/switch/wake_on_lan.py | homeassistant/components/switch/wake_on_lan.py | """
Support for wake on lan.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.wake_on_lan/
"""
import logging
import platform
import subprocess as sp
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHE... | Python | 0 | @@ -2717,36 +2717,41 @@
sp.
-getstatusoutput(ping_cmd)%5B0%5D
+call(ping_cmd, stdout=sp.DEVNULL)
%0A
|
1e316332889bcb46ce52b70603c1028f7614c2a0 | Support Unicode request_id on Python 3 | glance/tests/unit/test_context_middleware.py | glance/tests/unit/test_context_middleware.py | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | Python | 0.000006 | @@ -5273,32 +5273,129 @@
with 'req-req-'%0A
+ if isinstance(resp_req_id, bytes):%0A resp_req_id = resp_req_id.decode('utf-8')%0A
self.ass
@@ -5418,33 +5418,32 @@
q_id.startswith(
-b
'req-req-'))%0A
@@ -5478,33 +5478,32 @@
q_id.startswith(
-b
'req-'))%0A%0A%0Aclass
@@ -6440,32 +6440,12... |
2527683522394c823bc100c75f1ce4885949136e | add paths module for other modules to find paths from one place | glim/paths.py | glim/paths.py | Python | 0 | @@ -0,0 +1,1058 @@
+import os%0Afrom termcolor import colored%0A%0APROJECT_PATH = os.getcwd()%0AAPP_PATH = os.path.join(PROJECT_PATH, 'app')%0AEXT_PATH = os.path.join(PROJECT_PATH, 'ext')%0AGLIM_ROOT_PATH = os.path.dirname(os.path.dirname(__file__))%0APROTO_PATH = os.path.join(os.path.dirname(__file__), 'prototype')%0A... | |
24f21146b01ff75a244df40d1626c54883abeb1a | Add helper-lib for json object conversion and split dicts | lib/helpers.py | lib/helpers.py | Python | 0 | @@ -0,0 +1,297 @@
+#! /usr/bin/env python2.7%0A%0Aimport datetime%0A%0Adef typecast_json(o):%0A%09if isinstance(o, datetime.datetime) or isinstance(o, datetime.date):%0A%09%09return o.isoformat()%0A%09else:%0A%09%09return o%0A%0Adef split_dict(src, keys):%0A%09result = dict()%0A%09for k in set(src.keys()) & set(keys):%... | |
2321603eb706745e20e70d156a3894a7f3ac38eb | Add the Gamerscore and Tier of the account (#12867) | homeassistant/components/sensor/xbox_live.py | homeassistant/components/sensor/xbox_live.py | """
Sensor for Xbox Live account status.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.xbox_live/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATF... | Python | 0 | @@ -2135,16 +2135,73 @@
ertag')%0A
+ self._gamerscore = profile.get('gamerscore')%0A
@@ -2261,16 +2261,61 @@
ePath')%0A
+ self._tier = profile.get('tier')%0A
@@ -2979,24 +2979,117 @@
ibutes = %7B%7D%0A
+ attributes%5B'gamerscore'%5D = self._gamerscore%0A attrib... |
0f5c0168b257436882f837e5d521cce46a740ad6 | Add symbol translator to make utf-8 variables compilable | finat/greek_alphabet.py | finat/greek_alphabet.py | Python | 0 | @@ -0,0 +1,1500 @@
+%22%22%22Translation table from utf-8 to greek variable names, taken from:%0Ahttps://gist.github.com/piquadrat/765262#file-greek_alphabet-py%0A%22%22%22%0A%0A%0Adef translate_symbol(symbol):%0A %22%22%22Translates utf-8 sub-strings into compilable variable names%22%22%22%0A name = symbol.decod... | |
6a7f9fe9063b651489839734b92b3f58cf5b50a2 | Fix denied commands still triggering | src/decorators.py | src/decorators.py | import fnmatch
from collections import defaultdict
import botconfig
from oyoyo.parse import parse_nick
from src import settings as var
from src import logger
adminlog = logger(None)
COMMANDS = defaultdict(list)
HOOKS = defaultdict(list)
class cmd:
def __init__(self, *cmds, raw_nick=False, admin_only=False, owne... | Python | 0 | @@ -3714,105 +3714,71 @@
if
-not self.admin_only:%0A return self.func(*largs)%0A%0A if var.is_admin(nick, cloak):%0A
+var.is_admin(nick, cloak):%0A if self.admin_only:%0A
@@ -4634,32 +4634,84 @@
OUNTS%5Bpattern%5D:%0A
+ if self.admin_only:%0A
... |
03951a227bfafb0b1017354bdbf3a1247322fc9b | Fix cycler tests | axelrod/tests/unit/test_cycler.py | axelrod/tests/unit/test_cycler.py | """Test for the Cycler strategies."""
import itertools
import axelrod
from .test_player import TestPlayer, test_four_vector
C, D = 'C', 'D'
class TestAntiCycler(TestPlayer):
name = "AntiCycler"
player = axelrod.AntiCycler
expected_classifier = {
'memory_depth': float('inf'),
'stochastic... | Python | 0 | @@ -843,9 +843,18 @@
h':
-1
+len(cycle)
,%0A
|
ca2269c5ae568cd63253af7bc614a79d26f7f8ac | Add ns_drop_indexes command. | needlestack/management/commands/ns_drop_indexes.py | needlestack/management/commands/ns_drop_indexes.py | Python | 0 | @@ -0,0 +1,660 @@
+# -*- coding: utf-8 -*-%0A%0Afrom __future__ import print_function, absolute_import, unicode_literals%0A%0Afrom django.core.management.base import BaseCommand, CommandError%0Afrom needlestack import commands%0A%0A%0Aclass Command(BaseCommand):%0A help = 'Sync all defined indexes with a current bac... | |
b8a84e612d67f7948d6dec8c202ac8a73390f9dc | make sure all protein ids are unique in a genbank file | proteins/unique_protein_ids.py | proteins/unique_protein_ids.py | Python | 0 | @@ -0,0 +1,1102 @@
+%22%22%22%0ATest a genbank file and make sure all the protein_ids are unique%0A%22%22%22%0A%0Aimport os%0Aimport sys%0Aimport argparse%0Afrom Bio import SeqIO%0A%0A__author__ = 'Rob Edwards'%0A__copyright__ = 'Copyright 2020, Rob Edwards'%0A__credits__ = %5B'Rob Edwards'%5D%0A__license__ = 'MIT'%0A_... | |
61fa404da3eeb3b695b12f398c27f641e1e681e2 | add codegen script for fname.pyf.src -> _fnamemodule.c | tools/generate_f2pymod.py | tools/generate_f2pymod.py | Python | 0 | @@ -0,0 +1,1474 @@
+%22%22%22%0AProcess f2py template files (%60filename.pyf.src%60 -%3E %60filename.pyf%60)%0A%0AUsage: python generate_pyf.py filename.pyf.src -o filename.pyf%0A%22%22%22%0A%0Aimport os%0Aimport sys%0Aimport subprocess%0Aimport argparse%0A%0Afrom numpy.distutils.from_template import process_file%0A%0A... | |
0f94251c7cc844042c9e3ce160d78e4d81d895ea | add log module | src/log.py | src/log.py | Python | 0.000002 | @@ -0,0 +1,995 @@
+import logging%0Aimport os%0Afrom datetime import datetime%0A%0Aclass LOG(object):%0A logger = None%0A def __init__(self, log_dir):%0A if log_dir:%0A if not os.path.exists(log_dir):%0A os.makedirs(log_dir)%0A self.logger = logging.getLogger('simple-db... | |
bc567eda01abcaf23717f5da5f494c1be46f47da | Create ValAnagram_001.py | leetcode/242-Valid-Anagram/ValAnagram_001.py | leetcode/242-Valid-Anagram/ValAnagram_001.py | Python | 0.000002 | @@ -0,0 +1,581 @@
+class Solution:%0A # @param %7Bstring%7D s%0A # @param %7Bstring%7D t%0A # @return %7Bboolean%7D%0A def anaRepresentation(self, s):%0A p = %7B%7D%0A for c in s:%0A if c in p:%0A p%5Bc%5D += 1%0A else:%0A p%5Bc%5D = 1%0A ... | |
682d6b3ca9c4a0dd49f9762ddd20ac746971e3eb | Create solution.py | leetcode/easy/find_the_difference/py/solution.py | leetcode/easy/find_the_difference/py/solution.py | Python | 0.000018 | @@ -0,0 +1,437 @@
+class Solution(object):%0A def findTheDifference(self, s, t):%0A %22%22%22%0A :type s: str%0A :type t: str%0A :rtype: str%0A %22%22%22%0A import collections%0A import itertools%0A %0A c1 = collections.Counter(s)%0A c2 = collecti... | |
9e128fdd5af0598a233416de5a1e8f2d3a74fdc0 | Enforce unique paths and names | spaces/migrations/0006_unique_space_document.py | spaces/migrations/0006_unique_space_document.py | Python | 0.00002 | @@ -0,0 +1,756 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.9 on 2015-12-15 02:12%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('spaces', '0005_document_space_doc'),%0A %5D%0A%0A ... | |
0256868a3b261e598689eebdf5ac5f939ea20a0d | add test cases for mni module | lib/neuroimaging/reference/tests/test_mni.py | lib/neuroimaging/reference/tests/test_mni.py | Python | 0 | @@ -0,0 +1,381 @@
+import unittest%0Aimport numpy as N%0A%0Aimport neuroimaging.reference.mni as mni%0A%0Aclass MNITest(unittest.TestCase):%0A%0A def testMNI(self):%0A %22%22%22 ensure all elementes of the interface exist %22%22%22%0A m = mni.MNI%0A g = mni.generic%0A m_v = mni.MNI_voxel%... | |
a0789a4bad7747073257d8976534b33ab9862ec4 | Add unit test for IssueRegister view | feed/tests/test_issueregisterview.py | feed/tests/test_issueregisterview.py | Python | 0 | @@ -0,0 +1,3102 @@
+from django.contrib.auth.models import User%0Afrom django.test import TestCase%0Afrom rest_framework.test import APIRequestFactory%0A%0Afrom feed.views import IssueRegisterViewSet%0Afrom workflow.models import IssueRegister, Organization, TolaUser%0A%0A%0Aclass IssueRegisterViewsTest(TestCase):%0A ... | |
05e8f84356c63ab953f5c2a3d3d06ee1760008d0 | Add list_queue plugin | flexget/plugins/filter/list_queue.py | flexget/plugins/filter/list_queue.py | Python | 0.000002 | @@ -0,0 +1,1373 @@
+import logging%0A%0Afrom flexget import plugin%0Afrom flexget.event import event%0A%0Alog = logging.getLogger('list_queue')%0A%0A%0Aclass ListQueue(object):%0A schema = %7B%0A 'type': 'array',%0A 'items': %7B%0A 'allOf': %5B%0A %7B'$ref': '/schema/plugins?g... | |
f7a69e24912c3b9ed52201b52c79be4407884c3a | add module util for trying to resolve an ipv6 netmask to cidr. not perfect, but not meant to be either. | library/module_utils/network/f5/ipaddress.py | library/module_utils/network/f5/ipaddress.py | Python | 0 | @@ -0,0 +1,1147 @@
+# -*- coding: utf-8 -*-%0A#%0A# Copyright (c) 2018 F5 Networks Inc.%0A# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)%0A%0Afrom __future__ import absolute_import, division, print_function%0A__metaclass__ = type%0A%0A%0Adef ipv6_netmask_to_cidr(mask):%0A ... | |
8922f9430ec2844a3a14621ad0625aa45999c92a | fix args order | lixian_hash.py | lixian_hash.py | #!/usr/bin/env python
import hashlib
import lixian_hash_ed2k
import lixian_hash_bt
import os
def lib_hash_file(h, path):
with open(path, 'rb') as stream:
while True:
bytes = stream.read(1024*1024)
if not bytes:
break
h.update(bytes)
return h.hexdigest()
def sha1_hash_file(path):
return lib_hash_fil... | Python | 0.999403 | @@ -1432,16 +1432,30 @@
ify-bt':
+ lambda f, t:
lixian_h
@@ -1471,24 +1471,30 @@
rify_bt_file
+(t, f)
,%0A%09%09%09%09 %7D%5Bo
|
0814bbf6867a4bdd9d92c63e467f237b6129ee28 | add solution for palindrome number | leetcode/palindrome-number/sol.py | leetcode/palindrome-number/sol.py | Python | 0.999935 | @@ -0,0 +1,969 @@
+#!/usr/bin/env python%0Aclass Solution:%0A # @return a boolean%0A def isPalindrome(self, x):%0A if x == -1:%0A return True%0A def ll(x):%0A return 0 if x == 0 or x == -1 else ll(x/10)+1%0A %0A p = x %3E= 0%0A l = ll(x)%0A print %22... | |
d2a92c5d628f426c26374dea6cb37bd35ba18812 | print variables | bin/basenji_variables.py | bin/basenji_variables.py | Python | 0.000103 | @@ -0,0 +1,2067 @@
+#!/usr/bin/env python%0A# Copyright 2017 Calico LLC%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# https://www.apache.org/licenses/LICENSE-2.0%0A#... | |
0598e61d9bcef2217f22cce2deeec08ed6868575 | Add rmd.py | scripts/rmd.py | scripts/rmd.py | Python | 0.000002 | @@ -0,0 +1,2548 @@
+#!/usr/bin/env python%0A%0Aimport argparse%0Aimport sys%0Aimport logging%0Aimport os%0Aimport os.path as pt%0Aimport shutil%0A%0A%0Aclass App(object):%0A%0A def run(self, args):%0A name = pt.basename(args%5B0%5D)%0A parser = self.create_parser(name)%0A opts = parser.parse_arg... | |
30a8e40efee241dd6aa3b534814655b9f70cfffe | Add 020-valid-parentheses.py, but missed case "([])", the description is confused | 020-valid-parentheses.py | 020-valid-parentheses.py | Python | 0.998825 | @@ -0,0 +1,1075 @@
+%22%22%22%0AQuestion:%0A Valid Parentheses My Submissions Question Solution%0A%0A Given a string containing just the characters '(', ')', '%7B', '%7D', '%5B' and '%5D', determine if the input string is valid.%0A%0A The brackets must close in the correct order, %22()%22 and %22()%5B%5D%7B%7D... | |
8249d33898500d9d39e8bee3d44d39c2a6034659 | Add script to create overlays | scripts/create_overlays.py | scripts/create_overlays.py | Python | 0.000001 | @@ -0,0 +1,712 @@
+%22%22%22Varcan smart tool.%22%22%22%0A%0Aimport click%0A%0Afrom dtoolcore import DataSet%0A%0A%0A@click.command()%0A@click.argument('dataset_uri')%0A@click.option('--config-path', type=click.Path(exists=True))%0Adef main(dataset_uri, config_path=None):%0A%0A dataset = DataSet.from_uri(dataset_uri... | |
5510f90565809471e545584419b22980b63a1864 | Add metadata | bids_writer/_metadata.py | bids_writer/_metadata.py | Python | 0.000044 | @@ -0,0 +1,249 @@
+# -*- coding: utf-8 -*-%0Aversion = %220.1.0%22%0Aauthor = %22Nathan Vack%22%0Aauthor_email = %22njvack@wisc.edu%22%0Alicense = %22MIT%22%0Acopyright = %22Copyright 2015 Boards of Regent of the University of Wisconsin System%22%0Aurl = %22https://github.com/njvack/bids-json-writer%22%0A
| |
65f574973bbde545c1c815d0ad21e4a8d3f3b59d | Add initial cbio client | bioagents/cbio_client.py | bioagents/cbio_client.py | Python | 0 | @@ -0,0 +1,1237 @@
+import os%0Aimport json%0Aimport logging%0Aimport requests%0Afrom collections import defaultdict%0A%0A%0Alogger = logging.getLogger(__name__)%0A%0Abase_url = 'https://www.cbioportal.org/api'%0A%0Aresources_dir = os.path.join(os.path.dirname(%0A os.path.abspath(__file__)), os.pardir, 'resources')%... | |
bf60d3c48a30863571a8700fa5a843be48e7646b | add vat_reckoner | components/vat_reckoner/vat_reckoner.py | components/vat_reckoner/vat_reckoner.py | Python | 0.000284 | @@ -0,0 +1,1003 @@
+#! /usr/bin/env python%0A%0Afrom json import loads, dumps%0Afrom pika import BlockingConnection, ConnectionParameters%0A%0ARABBIT_MQ_HOST = '54.76.183.35'%0ARABBIT_MQ_PORT = 5672%0A%0Adef vat(ch, method, properties, body):%0A product = loads(body)%0A sku, price = product%5B'sku'%5D, product%5B... | |
77d90ec03eff1946a422e5471cc1a64708eff0f4 | Test dramatis personae | shakespearelang/tests/unit/test_dramatis_personae.py | shakespearelang/tests/unit/test_dramatis_personae.py | Python | 0.000007 | @@ -0,0 +1,1130 @@
+from shakespearelang import Shakespeare%0Afrom shakespearelang.errors import ShakespeareRuntimeError%0Aimport pytest%0A%0AMANY_CHARACTERS_PLAY = %22%22%22%0AA lot of people.%0A%0AAchilles, a test.%0AChristopher Sly, a test.%0ADemetrius, a test.%0AJohn of Lancaster, a test.%0AJuliet, a test.%0AMistre... | |
0ba11dd47dac04f3f7a314cf320558ccbc9eb148 | Add test for water polygon name dropping. | integration-test/1477-water-layer-too-big.py | integration-test/1477-water-layer-too-big.py | Python | 0 | @@ -0,0 +1,1731 @@
+# -*- encoding: utf-8 -*-%0Afrom . import FixtureTest%0A%0A%0Aclass WaterLayerTooBigTest(FixtureTest):%0A%0A def test_drop_label(self):%0A from tilequeue.tile import calc_meters_per_pixel_area%0A from shapely.ops import transform%0A from tilequeue.tile import reproject_mercat... | |
865dc29421c1e9ef4bf340bf32164863cc5f2006 | Add management command to list installed spiders | app/raw/management/commands/list_spiders.py | app/raw/management/commands/list_spiders.py | Python | 0 | @@ -0,0 +1,252 @@
+from django.core.management import BaseCommand%0Afrom raw.utils import list_spiders%0A%0A%0Aclass Command(BaseCommand):%0A help = 'List installed spiders'%0A%0A def handle(self, *args, **options):%0A for spider in list_spiders():%0A print spider%0A
| |
77966f7f993e526467b2e54e0d12241354efec16 | add spec for re2 | build/fbcode_builder/specs/re2.py | build/fbcode_builder/specs/re2.py | Python | 0 | @@ -0,0 +1,372 @@
+#!/usr/bin/env python%0Afrom __future__ import absolute_import%0Afrom __future__ import division%0Afrom __future__ import print_function%0Afrom __future__ import unicode_literals%0A%0A%0Adef fbcode_builder_spec(builder):%0A return %7B%0A 'steps': %5B%0A builder.github_project_wor... | |
ec5e7171c454c17c62bb2d8364902d287586cb6c | Fix qibuild open when default toolchain is undefined | python/qibuild/actions/open.py | python/qibuild/actions/open.py | ## Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
"""Open a project with an IDE
"""
import os
import sys
import glob
import subprocess
from qibuild import ui
import qibuild
SUPPORTED_IDES = ["QtCreat... | Python | 0.000001 | @@ -2282,55 +2282,63 @@
-qibuild.run_action(%22qibuild
+args = %5Bproject.name%5D%0A if toc
.acti
-ons.
+ve_
config
-ure%22,
+:
%0A
@@ -2352,25 +2352,21 @@
- %5Bproject.name,
+args.extend(%5B
%22--c
@@ -2392,16 +2392,82 @@
config%5D)
+%0A qibuild.run_action(%22qibuild.actions... |
15388e09ab537d3731891353c54f53105c4a7ee4 | add files | weixin_pay.py | weixin_pay.py | Python | 0.000002 | @@ -0,0 +1,63 @@
+#!/usr/bin/env python%0A# coding=utf-8%0A__author__ = 'youqingkui'%0A
| |
b7360d6ba397f8654f4e051227aa86a1ebe693f7 | Add main program | follow.py | follow.py | Python | 0.000002 | @@ -0,0 +1,964 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport sys%0A%0Afrom github import Github%0A%0A%0A# usage%0Adef usage():%0A print 'Follow GitHub user%5C's starred, watching and following.'%0A print%0A print 'Usage: python follow.py %3Ctoken%3E %3Cuser%3E'%0A print%0A print 'token:... | |
9080d20bd61ac66a534c834a17a9825808416512 | Add pre-stage hook for FrostNumberModel | metadata/FrostNumberModel/hooks/pre-stage.py | metadata/FrostNumberModel/hooks/pre-stage.py | Python | 0 | @@ -0,0 +1,611 @@
+%22%22%22A hook for modifying parameter values read from the WMT client.%22%22%22%0A%0Aimport os%0Aimport shutil%0A%0Afrom wmt.utils.hook import find_simulation_input_file%0Afrom topoflow_utils.hook import assign_parameters%0A%0A%0Afile_list = %5B%5D%0A%0A%0Adef execute(env):%0A %22%22%22Perform p... | |
70849edc52acc1c559b35a55c7f1925c1cbf57ad | add new tagcount plugin for yawt rewrite | yawtext/tagcount.py | yawtext/tagcount.py | Python | 0 | @@ -0,0 +1,2049 @@
+from flask import current_app, g, Blueprint%0Aimport jsonpickle%0Afrom yawt.utils import save_file, load_file%0Aimport os%0A%0Atagcountsbp = Blueprint('tagcounts', __name__)%0A%0A@tagcountsbp.app_context_processor%0Adef tagcounts():%0A tagcountfile = current_app.config%5B'YAWT_TAGCOUNT_FILE'%5D%0... | |
d19aaf0fd3c88c08b2b8563030dd38c0cea3631b | Add unit test for `parse_cluster_info` (#22205) | dashboard/modules/job/tests/test_sdk.py | dashboard/modules/job/tests/test_sdk.py | Python | 0 | @@ -0,0 +1,3046 @@
+import pytest%0Afrom typing import Dict, Optional, Tuple%0Afrom unittest.mock import Mock, patch%0A%0Afrom ray.dashboard.modules.job.sdk import parse_cluster_info%0A%0A%0A@pytest.mark.parametrize(%0A %22address_param%22,%0A %5B%0A (%22ray://1.2.3.4:10001%22, %22ray%22, %221.2.3.4:10001%... | |
3c685922756a582030980f319014ba308735ee2c | add nextlaunch command | src/tenyksscripts/scripts/rockets.py | src/tenyksscripts/scripts/rockets.py | Python | 0.000001 | @@ -0,0 +1,578 @@
+import datetime%0Aimport requests%0Aimport time%0A%0A%0Adef run(data, settings):%0A if data%5B%22payload%22%5D != %22nextlaunch%22:%0A return%0A%0A launches = requests.get(%22https://launchlibrary.net/1.2/launch%22, params=%7B%22next%22: 1, %22mode%22: %22verbose%22%7D).json()%0A if n... | |
ba3e2a81a5e89c010473820732835d8bf7ccc39a | Create morningstar.py | morningstar.py | morningstar.py | Python | 0.000007 | @@ -0,0 +1,1332 @@
+import os%0Aimport sys%0Aimport threading%0Aimport thread%0Aimport time%0Aimport settings%0Aimport subprocess%0Aimport psutil%0A%0Aclass watchman(threading.Thread):%0A%09def __init__(self):%0A%09%09threading.Thread.__init__(self)%0A%09def run(self):%0A%09%09badwinprocs = %5B'taskmgr', 'regedit', 'mb... | |
7d546ca0ce8e2e8ef4f71abda50764817ce83c0b | add mouse_click.py | mouse_click.py | mouse_click.py | Python | 0.000006 | @@ -0,0 +1,242 @@
+from pymouse import PyMouse%0Afrom time import sleep%0A%0Am = PyMouse()%0Asleep(5)%0Ax=969%0Ay=581%0Aa = 1%0Awhile a == 1:%0A m.click(x,y)#%E7%A7%BB%E5%8B%95%E5%88%B0(x,y)%E4%B8%A6%E4%B8%94%E9%BB%9E%E6%93%8A%0A sleep(0.1)%0A p = m.position() #%E7%8D%B2%E5%8F%96%E7%9B%AE%E5%89%8D%E4%BD%8D%E7%... | |
9ef3260ba5d27a3274fa6d3112e36091f04989f9 | add file | resource-4/permutations/permutationToInteger.py | resource-4/permutations/permutationToInteger.py | Python | 0.000001 | @@ -0,0 +1,220 @@
+def permutationToInteger(perm):%0A%09permLen = len(perm)%0A%09elts = range(permLen)%0A%09num = 0%0A%09for i in range(permLen):%0A%09%09digit = elts.index(perm%5Bi%5D)%0A%09%09num += digit * math.factorial(permLen - i - 1)%0A%09%09del elts(digit)%0A%09return num%0A
| |
4c5d45f5af83cc2af3a9f29d10b4b2d00f60bbec | Update __init__.py | tendrl/commons/flows/expand_cluster/__init__.py | tendrl/commons/flows/expand_cluster/__init__.py | import etcd
import gevent
import json
import uuid
from tendrl.commons import flows
from tendrl.commons.event import Event
from tendrl.commons.message import Message
from tendrl.commons.flows.create_cluster import \
utils as create_cluster_utils
from tendrl.commons.flows.expand_cluster import ceph_help
from tendrl.... | Python | 0.000072 | @@ -2013,32 +2013,41 @@
us in all_status
+.values()
if status == %22f
|
dafa0060460a2d4e820fbdafd33e51363bac0259 | Create 01.Mean.py | 01.Python/01.Mean.py | 01.Python/01.Mean.py | Python | 0 | @@ -0,0 +1,230 @@
+import numpy as np%0A A = np.array(%5B%5B10,14,11,7,9.5,15,19%5D,%5B8,9,17,14.5,12,18,15.5%5D,%0A %5B15,7.5,11.5,10,10.5,7,11%5D,%5B11.5,11,9,12,14,12,7.5%5D%5D)%0A B = A.T%0A print B%0A print(np.mean(B))%0A print(np.mean(B,axis=0))%0A print(np.mean(A,axis=1))%0A
| |
9570da3427121628d4e144c1092da155583a496d | Add Python benchmark | lib/node_modules/@stdlib/math/base/special/asinh/benchmark/python/benchmark.py | lib/node_modules/@stdlib/math/base/special/asinh/benchmark/python/benchmark.py | Python | 0.000138 | @@ -0,0 +1,1520 @@
+#!/usr/bin/env python%0A%22%22%22Benchmark asinh.%22%22%22%0A%0Aimport timeit%0A%0Aname = %22asinh%22%0Arepeats = 3%0Aiterations = 1000000%0A%0A%0Adef print_version():%0A %22%22%22Print the TAP version.%22%22%22%0A%0A print(%22TAP version 13%22)%0A%0A%0Adef print_summary(total, passing):%0A ... | |
d1ba1a02385581375831fd4b394f68ade4cbb101 | Create RX_TX.py | home/hairygael/RX_TX.py | home/hairygael/RX_TX.py | Python | 0.000295 | @@ -0,0 +1,463 @@
+arduino = Runtime.createAndStart(%22arduino%22,%22Arduino%22)%0Aarduino.setBoardMega()%0Aarduino.connect(%22COM7%22)%0Aarduino1 = Runtime.createAndStart(%22arduino1%22,%22Arduino%22)%0Aarduino1.setBoardAtmega328()%0A %0A#connecting arduino1 to arduino Serial1 instead to a COMX%0Aarduino1.connect(ardu... | |
c760c3387b6dcf5bd171960a3e64306c7f2519d0 | add a rotating colored triangle | pynodegl-utils/pynodegl_utils/examples/misc.py | pynodegl-utils/pynodegl_utils/examples/misc.py | Python | 0.000003 | @@ -0,0 +1,738 @@
+import math%0A%0Afrom pynodegl import Texture, Shader, TexturedShape, Rotate, AnimKeyFrameScalar, Triangle%0A%0Afrom pynodegl_utils.misc import scene%0A%0A@scene()%0Adef triangle(cfg):%0A frag_data = '''%0A#version 100%0Aprecision mediump float;%0Avarying vec2 var_tex0_coords;%0Avoid main(void)%0A... | |
3e9fc08e096ddb212cf40a285887b7ed5dd8897b | Fix running coverage for nose tests (PY-14869) | python/helpers/coverage_runner/run_coverage.py | python/helpers/coverage_runner/run_coverage.py | """Coverage.py's main entrypoint."""
import os
import sys
bundled_coverage_path = os.getenv('BUNDLED_COVERAGE_PATH')
if bundled_coverage_path:
sys_path_backup = sys.path
sys.path = [p for p in sys.path if p != bundled_coverage_path]
from coverage.cmdline import main
sys.path = sys_path_backup
else:
... | Python | 0 | @@ -401,16 +401,69 @@
_FILE')%0A
+%0Acoverage_file = coverage_file%5B0:-len(%22.coverage%22)%5D%0A%0A
run_cov
@@ -707,30 +707,58 @@
age_file
-, new_cov_file
+ + %22.coverage%22, new_cov_file + %22.coverage%22
))%0A p
@@ -928,16 +928,25 @@
cov_file
+ + %22.cov%22
%0A%0Aif cov
@@ -1004,16 +1004,31 @@
age_file
... |
fd5ba7ad61a8c7c9aad6b3f1404d819ae21085d1 | Add 'calc_pb_flux.py' to calculate the particle background | bin/calc_pb_flux.py | bin/calc_pb_flux.py | Python | 0.000024 | @@ -0,0 +1,1627 @@
+#!/usr/bin/env python3%0A#%0A# Copyright (c) 2017 Weitian LI %3Cliweitianux@live.com%3E%0A# MIT license%0A%0A%22%22%22%0ACalculate the particle background flux (e.g., 9.5-12.0 keV) of the spectra.%0A%0Aflux = counts / exposure / area%0Awhere 'counts' is the total photon counts within the specified e... | |
0f2f4df45ea96551c09358f33f3d33f682b42e8d | add Hydra integration | test.py | test.py | import csv
import os
import subprocess
import threading
# Gather the packages to test.
PREFIX = './packages/node_modules/'
CISCOSPARK = os.path.join(PREFIX, '@ciscospark')
WEBEX = os.path.join(PREFIX, '@webex')
PROD_ENV_VARS = {
# 'ACL_SERVICE_URL': 'https://acl-a.wbx2.com/acl/api/v1', ?
'ATLAS_SERVICE_URL': 'ht... | Python | 0.000001 | @@ -724,16 +724,33 @@
ARS = %7B%0A
+ # Environments%0A
'ACL_S
@@ -1059,16 +1059,79 @@
pi/v1',%0A
+ 'HYDRA_SERVICE_URL': 'https://hydra-intb.ciscospark.com/v1',%0A
'IDBRO
|
6fb6e67792085b6ee910f1d0b8ed3e89f15dd60d | add script to datamine the reports via nltk | smelly_london/all_reports_smell_search_final.py | smelly_london/all_reports_smell_search_final.py | Python | 0 | @@ -0,0 +1,2605 @@
+%0Afrom map import mapping%0A# walk through the os and get all files%0A# read each file in tern and go through line by line%0A# print lines that contain smell and the report name%0Afrom os import listdir%0Aimport nltk.data%0Aimport json%0A%0ASMELL_WORDS = %5B'smell', 'stench', 'stink', 'odour', 'sni... | |
5b31e63043e3c3652f751d4a85e6bcdf925f797e | Create q3.py | work/q3.py | work/q3.py | Python | 0.000019 | @@ -0,0 +1,161 @@
+def fibonacci_number(n, m, count):%0A if count %3C= 10:%0A print(n, end=%22 %22)%0A return fibonacci_number(m, n + m, count + 1)%0A%0Afibonacci_number(0, 1, 0)%0A
| |
0383796cb681404e6c4794f1321ad62a9945b572 | add script to output all leagues of users | checkLeagues.py | checkLeagues.py | Python | 0 | @@ -0,0 +1,339 @@
+import settings as settings%0A%0Aimport funcs%0A%0AaccountMaps = funcs.readAccountsFile(%22accounts.txt%22)%0Adef getLeagueForAccountMap(accountMap):%0A league = funcs.getLeague(settings.regions%5BaccountMap%5B'region'%5D%5D, accountMap%5B'bnet'%5D)%0A return (accountMap%5B'redditName'%5D, league)%... | |
c20cde04d1a5a2939e7f5c0953725fd043c5b849 | add media migration | molo/core/migrations/0067_media_migration.py | molo/core/migrations/0067_media_migration.py | Python | 0.000001 | @@ -0,0 +1,977 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Adef convert_media_to_molo_media(apps, schema_editor):%0A from molo.core.models import MoloMedia, ArticlePage%0A from wagtailmedia.models import Media%0A%0A for media in Med... | |
77b6c86359376af5eb8de63ae89d9316776b26bc | Add missing migration | tracpro/polls/migrations/0034_auto_20170323_1315.py | tracpro/polls/migrations/0034_auto_20170323_1315.py | Python | 0.000008 | @@ -0,0 +1,501 @@
+# -*- 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 ('polls', '0033_auto_20170307_1338'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterFiel... | |
255c7ff91bc4918ce13d32cba2b871e3d0befad8 | revert that url change | polio/urls.py | polio/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'polio.views.home', name='home'),
url(r'^uf04/datapoints/', include('datapoints.app_urls.urls', namespace="datapoints")),
url(r'^uf04/datapoints/... | Python | 0.000005 | @@ -197,37 +197,32 @@
'),%0A%0A url(r'%5E
-uf04/
datapoints/', in
@@ -284,37 +284,32 @@
%22)),%0A url(r'%5E
-uf04/
datapoints/indic
@@ -400,21 +400,16 @@
url(r'%5E
-uf04/
datapoin
@@ -504,13 +504,8 @@
(r'%5E
-uf04/
admi
|
5f12ada7fe0ddb44274e18decbaea0d05ab4471f | Solve Code Fights lineup problem | CodeFights/lineUp.py | CodeFights/lineUp.py | Python | 0.0007 | @@ -0,0 +1,840 @@
+#!/usr/local/bin/python%0A# Code Fights Lineup Problem%0A%0A%0Adef lineUp(commands):%0A aligned, tmp = 0, 0%0A com_dict = %7B%22L%22: 1, %22A%22: 0, %22R%22: -1%7D%0A for c in commands:%0A tmp += com_dict%5Bc%5D%0A if tmp %25 2 == 0:%0A aligned += 1%0A return alig... | |
8deb0dc2743d1d85899cb636b88ed831c05838a9 | Make machine action button translatable | DiscoverUM3Action.py | DiscoverUM3Action.py | from cura.MachineAction import MachineAction
from UM.Application import Application
from PyQt5.QtCore import pyqtSignal, pyqtProperty, pyqtSlot
class DiscoverUM3Action(MachineAction):
def __init__(self):
super().__init__("DiscoverUM3Action", "Discover printers")
self._qml_url = "DiscoverUM3Action... | Python | 0.000016 | @@ -140,16 +140,79 @@
qtSlot%0A%0A
+from UM.i18n import i18nCatalog%0Acatalog = i18nCatalog(%22cura%22)%0A%0A
class Di
@@ -317,27 +317,54 @@
n%22,
-%22Discover printers%22
+catalog.i18nc(%22@action%22,%22Connect via Network%22)
)%0A
|
c486b8df5861fd883b49ea8118d40d73f5b4e7b8 | Add download apikey test case | tardis/tardis_portal/tests/test_download_apikey.py | tardis/tardis_portal/tests/test_download_apikey.py | Python | 0 | @@ -0,0 +1,1661 @@
+# -*- coding: utf-8 -*-%0A%0Afrom django.core.urlresolvers import reverse%0Afrom django.test import TestCase%0Afrom tastypie.test import ResourceTestCase%0Afrom django.test.client import Client%0A%0Afrom django.conf import settings%0Afrom django.contrib.auth.models import User%0A%0Aclass ApiKeyDownl... | |
af67d052fc78e56ac7f934f4c90f00d2eb097bb3 | Add StarFinder tests | photutils/detection/tests/test_starfinder.py | photutils/detection/tests/test_starfinder.py | Python | 0 | @@ -0,0 +1,2799 @@
+# Licensed under a 3-clause BSD style license - see LICENSE.rst%0A%22%22%22%0ATests for StarFinder.%0A%22%22%22%0A%0Afrom astropy.modeling.models import Gaussian2D%0Afrom astropy.tests.helper import catch_warnings%0Aimport numpy as np%0Aimport pytest%0A%0Afrom ..starfinder import StarFinder%0Afrom .... | |
72203e529f083cbc9427b02348cc178e4443031c | Add new package: libuser (#18916) | var/spack/repos/builtin/packages/libuser/package.py | var/spack/repos/builtin/packages/libuser/package.py | Python | 0 | @@ -0,0 +1,883 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other%0A# Spack Project Developers. See the top-level COPYRIGHT file for details.%0A#%0A# SPDX-License-Identifier: (Apache-2.0 OR MIT)%0A%0Afrom spack import *%0A%0A%0Aclass Libuser(AutotoolsPackage):%0A %22%22%22A user and group ... | |
605baa80dfbf5028eb9924818c2f1d609a1d8c7a | Use private non-static method | py/selenium/webdriver/remote/errorhandler.py | py/selenium/webdriver/remote/errorhandler.py | # Copyright 2010 WebDriver committers
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | Python | 0 | @@ -4404,16 +4404,17 @@
self.
+_
value_or
@@ -4421,17 +4421,16 @@
_default
-_
(zeroeth
@@ -4635,34 +4635,16 @@
e)%0A%0A
- @staticmethod%0A
def
valu
@@ -4639,16 +4639,17 @@
def
+_
value_or
@@ -4656,17 +4656,16 @@
_default
-_
(obj, ke
|
ac09970129df9c5292344287b04a1be143fac681 | add diag openmp | tests/examples/openmp/diagnostics.py | tests/examples/openmp/diagnostics.py | Python | 0.000146 | @@ -0,0 +1,1409 @@
+# coding: utf-8%0A%0Aimport numpy as np%0Afrom matplotlib import pyplot as plt%0A%0Adef matrix_product():%0A procs = %5B1, 4, 8, 16, 28%5D%0A times = %5B1194.849, 305.231, 69.174,37.145, 22.731%5D%0A%0A n_groups = len(procs)%0A%0A #%C2%A0...%0A fig, ax = plt.subplots()%0A index = n... | |
65f6f78008d4f961c9ebe5d8047b0f2c742fe15f | Add unittest for QInputDialog.getXXX() methods | tests/qtgui/qinputdialog_get_test.py | tests/qtgui/qinputdialog_get_test.py | Python | 0 | @@ -0,0 +1,677 @@
+import unittest%0A%0Afrom PySide import QtCore, QtGui%0Afrom helper import UsesQApplication, TimedQApplication%0A%0Aclass TestInputDialog(TimedQApplication):%0A%0A def testGetDouble(self):%0A QtGui.QInputDialog.getDouble(None, %22title%22, %22label%22)%0A%0A def testGetInt(self):%0A ... | |
52189e2161e92b36df47a04c2150dff38f81f5e9 | Add mocked tests for activation | tests/unit/tests/test_activations.py | tests/unit/tests/test_activations.py | Python | 0 | @@ -0,0 +1,1399 @@
+from unittest import mock%0Afrom django.test import TestCase%0A%0Afrom viewflow import activation, flow%0Afrom viewflow.models import Task%0A%0A%0Aclass TestActivations(TestCase):%0A def test_start_activation_lifecycle(self):%0A flow_task_mock = mock.Mock(spec=flow.Start())%0A%0A ac... | |
e0df929e07e30c514b2b39f515bfd3102d1ebfe7 | Add annotate experiment | Source/Git/Experiments/git_annotate.py | Source/Git/Experiments/git_annotate.py | Python | 0.000007 | @@ -0,0 +1,340 @@
+#!/usr/bin/python3%0Aimport sys%0A%0Aimport git%0A%0Ar = git.Repo( sys.argv%5B1%5D )%0A%0A%0Anum = 0%0A%0Afor info in r.blame( 'HEAD', sys.argv%5B2%5D ):%0A num += 1%0A commit = info%5B0%5D%0A all_lines = info%5B1%5D%0A print( '%25s %256d:%25s' %25 (commit, num, all_lines%5B0%5D) )%0A%0A ... | |
51d581c7bca0fcacf8604b898f96394847865e15 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/e1e64a45b138980a6d8c125bacc81f22142d2b53. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "0dcdcc3f57a96bc354e66f3805dff4f619e2b93f"
TFRT_SHA256 = "940edcaf656cbbfee314689fd7e5... | Python | 0.000001 | @@ -228,133 +228,133 @@
= %22
-0dcdcc3f57a96bc354e66f3805dff4f619e2b93f%22%0A TFRT_SHA256 = %22940edcaf656cbbfee314689fd7e52aaa02bd07197bd4139f24aec64eee74c7a8
+e1e64a45b138980a6d8c125bacc81f22142d2b53%22%0A TFRT_SHA256 = %225afd4500e88c75188e29e68273438b849d57d800ed982bbe292325148ad3e016
%22%0A%0A
|
5dd31aa3cfacb6bd157d50ac3d310b8064a46b80 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/5f6e52142a3592d0cfa058dbfd140cad49ed451a. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "736eeebfb56c6d0de138f4a29286140d8c26d927"
TFRT_SHA256 = "b584ee5ce5ecaadf289b0997987d... | Python | 0 | @@ -228,133 +228,133 @@
= %22
-736eeebfb56c6d0de138f4a29286140d8c26d927%22%0A TFRT_SHA256 = %22b584ee5ce5ecaadf289b0997987dfb5eec6cf3623f30b83028923cad20914e61
+5f6e52142a3592d0cfa058dbfd140cad49ed451a%22%0A TFRT_SHA256 = %228e1efbd7df0fdeb5186b178d7c8b90c33ba80cef54999e988097bd1ff0f4e8fe
%22%0A%0A
|
0c13207eeda65754532bab5888cc33693fb06834 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/b87ea071c60db54775b92da8e0eed8477ab96a6a. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "75318fbce7817886508abd18dd5ea3b35d552372"
TFRT_SHA256 = "233d123e6287e105acb2b464db68b753624dfe5c27f299... | Python | 0.000003 | @@ -210,132 +210,132 @@
= %22
-75318fbce7817886508abd18dd5ea3b35d552372%22%0A TFRT_SHA256 = %22233d123e6287e105acb2b464db68b753624dfe5c27f299ff6b2dbe29ef40e9e
+b87ea071c60db54775b92da8e0eed8477ab96a6a%22%0A TFRT_SHA256 = %2261b8951d9236a82c54be8db871cd427013ec24ae17b0e681829a634e4f0388b
3%22%0A%0A
|
1eb980caefcbaaa4b29f7c3d92f27e490003e208 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/9562f24de39c95b4a076f7e0a0eb79cb980a9c72. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "de22adc4126843c3cf142e0a829d153dc94cdd73"
TFRT_SHA256 = "e345d2ae1d385ebaf41531c831bb1025cab260fe20daa5... | Python | 0.000006 | @@ -210,133 +210,133 @@
= %22
-de22adc4126843c3cf142e0a829d153dc94cdd73%22%0A TFRT_SHA256 = %22e345d2ae1d385ebaf41531c831bb1025cab260fe20daa5b6024c1d07c1ebfd0c
+9562f24de39c95b4a076f7e0a0eb79cb980a9c72%22%0A TFRT_SHA256 = %226fda4b556e5100e83ba292b8907c82f152740bb9eb157dc64e9c01ed2c4536e8
%22%0A%0A
|
fd01a25c0f5cb9ba75b2a659d47d1d3902242c5e | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/c3e082762b7664bbc7ffd2c39e86464928e27c0c. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "5a604f55b0d725eb537fd1a7cb6a88fcc6fd9b73"
TFRT_SHA256 = "004f312a2c65165e301b101add21... | Python | 0.000003 | @@ -228,133 +228,133 @@
= %22
-5a604f55b0d725eb537fd1a7cb6a88fcc6fd9b73%22%0A TFRT_SHA256 = %22004f312a2c65165e301b101add213013603c8822e479b4be63e2f95a3f972ebd
+c3e082762b7664bbc7ffd2c39e86464928e27c0c%22%0A TFRT_SHA256 = %229b7fabe6e786e6437bb7cd1a4bed8416da6f08969266e57945805017092900c6
%22%0A%0A
|
06cfa4c7055ec997dcb3aec11732ee1be5330b75 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/285e48bc47db23a479637fd1e2767b9a35dc2c9b. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "962d1c7a123f01ccdb39e0d1959794f432b0ffeb"
TFRT_SHA256 = "ce0f2f86d19850e8951514b0e3f76950d07a8dc79d053d... | Python | 0.000004 | @@ -210,133 +210,133 @@
= %22
-962d1c7a123f01ccdb39e0d1959794f432b0ffeb%22%0A TFRT_SHA256 = %22ce0f2f86d19850e8951514b0e3f76950d07a8dc79d053de3d7a4cf402389351a
+285e48bc47db23a479637fd1e2767b9a35dc2c9b%22%0A TFRT_SHA256 = %226f0067d0cb7bb407caeef060603b6e33f1231cddf1ce4ce2ebce027dc418764f
%22%0A%0A
|
27cb9279670bd513a1559f4865500d84869bb9f0 | Test module for Predictor class. | tests/test_predictor.py | tests/test_predictor.py | Python | 0 | @@ -0,0 +1,2002 @@
+#! /usr/env/bin python%0Aimport numpy as np%0A%0Afrom pyboas import predictor, models%0A%0A# Build random 3-parameter normal posterior.%0Aposterior = np.random.randn(100, 3)%0A%0A%0Adef toy_model(param, time):%0A time = np.atleast_1d(time)%5B:, np.newaxis%5D%0A%0A a = param%5B:, 0%5D%0A b =... | |
34d5b5cdc058f1c9055b82151b518251fa3b4f74 | Add tool to create combined smart contract files | tools/join-contracts.py | tools/join-contracts.py | Python | 0 | @@ -0,0 +1,1749 @@
+import os%0A%0Aimport click%0Aimport re%0Afrom click.types import File%0A%0AIMPORT_RE = re.compile(r'%5Eimport +%5B%22%5C'%5D(?P%3Ccontract%3E%5B%5E%22%5C'%5D+.sol)%5B%22%5C'%5D;$')%0A%0A%22%22%22%0AUtility to join solidity contracts into a single output file by recursively%0Aresolving imports.%0A%0... | |
e06416a61826229ebd0cccdc519b6dc39d8a0fd9 | Add migration to remove models. | server/migrations/0088_auto_20190304_1313.py | server/migrations/0088_auto_20190304_1313.py | Python | 0 | @@ -0,0 +1,1371 @@
+# Generated by Django 2.1.4 on 2019-03-04 18:13%0A%0Afrom django.db import migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('server', '0087_auto_20190301_1424'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterUniqueTogether(%0A ... | |
04a4d7887664753f87d6ccd0921c87160d8ced26 | Create 002_gen.py | 002/002_gen.py | 002/002_gen.py | Python | 0.000005 | @@ -0,0 +1,216 @@
+#!/usr/bin/env python %0A%0Adef fibonatti(n_max=4000000):%0A f1, f2 = 1, 1%0A while f2 %3C= n_max:%0A yield f2%0A f2 += f1%0A f1 = f2 - f1%0A%0Aanswer = sum(f for f in fibonatti() if f %25 2 == 0)%0Aprint(answer)%0A
| |
92f88fb9021094f1429f5175d01a354c4ad35880 | add initial gyp to build freetype lib (problems with cflags not showing up in xcode) | gyp/freetype.gyp | gyp/freetype.gyp | Python | 0.000002 | @@ -0,0 +1,2359 @@
+%7B%0A# 'includes': %5B%0A# 'common.gypi',%0A# %5D,%0A 'targets': %5B%0A %7B%0A 'target_name': 'skfreetype',%0A 'type': 'static_library',%0A 'sources': %5B%0A '../third_party/freetype/src/base/ftbbox.c',%0A '../third_party/freetype/src/base/ftbitmap.c',%0A ... | |
66137a8710bf3b778c860af8d6278ee0c97bbab4 | Add script to delete unused users on JupyterHub | scripts/delete-unused-users.py | scripts/delete-unused-users.py | Python | 0 | @@ -0,0 +1,1831 @@
+#!/usr/bin/env python3%0A%22%22%22%0ADelete unused users from a JupyterHub.%0A%0AJupyterHub performance sometimes scales with *total* number%0Aof users, rather than running number of users. While that should%0Abe fixed, we can work around it by deleting unused users once in%0Aa while. This script wi... | |
ad6aa623bbd8f316ab7fb8c389d1c9c74b17ae8c | add util module for converting an update job into xml | rpath_repeater/utils/update_job_formatter.py | rpath_repeater/utils/update_job_formatter.py | Python | 0 | @@ -0,0 +1,3128 @@
+#!/usr/bin/python%0A#%0A# Copyright (c) 2012 rPath, Inc.%0A#%0A# This program is distributed under the terms of the Common Public License,%0A# version 1.0. A copy of this license should have been distributed with this%0A# source file in a file called LICENSE. If it is not present, the license%0A# is... | |
7b14028f3796981974b6d01b98277326123c0395 | add get_flatpage template tag | core/templatetags/get_flatpage.py | core/templatetags/get_flatpage.py | Python | 0 | @@ -0,0 +1,1709 @@
+from django import template%0Afrom django.core.exceptions import ObjectDoesNotExist%0Afrom django.conf import settings%0Afrom django.contrib.flatpages.models import FlatPage%0Afrom django.contrib.sites.models import get_current_site%0A%0A%0Aregister = template.Library()%0A%0A%0Aclass FlatpageNode(te... | |
b8a07ce36cfeb2679ace05b26d6adc1e525d6044 | Add feature computation module | husc/features.py | husc/features.py | Python | 0.000001 | @@ -0,0 +1,2796 @@
+import functools as fun%0Aimport numpy as np%0Afrom scipy.stats.mstats import mquantiles%0Afrom scipy import ndimage as nd%0Afrom skimage import feature, color, io as imio, img_as_float, %5C%0A morphology as skmorph%0Afrom skimage import filter as imfilter, measure%0A%0A%0A%0Adef lab_hist(rgb_ima... | |
f16a7e43ce4d9dc82fd4bfca34d80f0447bd57db | add isStaffOrReadOnly permissions | treeherder/webapp/api/permissions.py | treeherder/webapp/api/permissions.py | Python | 0.00003 | @@ -0,0 +1,466 @@
+from rest_framework.permissions import BasePermission%0Afrom rest_framework.permissions import SAFE_METHODS%0A%0A%0Aclass IsStaffOrReadOnly(BasePermission):%0A %22%22%22%0A The request is authenticated as an admin staff (eg. sheriffs), or is a read-only request.%0A %22%22%22%0A%0A def has... | |
5a77678a44ec9838e943b514a586dbd96b8bdfdc | Add migration for license change | modelview/migrations/0042_auto_20171215_0953.py | modelview/migrations/0042_auto_20171215_0953.py | Python | 0 | @@ -0,0 +1,659 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.5 on 2017-12-15 08:53%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('modelview', '0041_merge_20171211_1420'),%0A %5D%... | |
5522285af9179441e56f65405037bb3a4c1c1274 | Revert "Important fixes" | soccer/gameplay/plays/testing/triangle_pass.py | soccer/gameplay/plays/testing/triangle_pass.py | Python | 0 | @@ -0,0 +1,3063 @@
+import robocup%0Aimport play%0Aimport behavior%0Aimport skills.move%0Aimport skills.capture%0Aimport tactics.coordinated_pass%0Aimport constants%0Aimport main%0Aimport enum%0A%0A%0A## A demo play written during a teaching session to demonstrate play-writing%0A# Three robots form a triangle on the fi... | |
0a4c100f9fb6e7540320fb7c55aeebdffe91c6d1 | add primenumber.py | primenumber.py | primenumber.py | Python | 0.998844 | @@ -0,0 +1,251 @@
+lower = int(input(%22Enter lower range: %22))%0Aupper = int(input(%22Enter upper range: %22))%0A%0Afor num in range(lower,upper + 1):%0A if num %3E 1:%0A for i in range(2,num):%0A if (num %25 i) == 0:%0A break%0A else:%0A print(num)%0A
| |
64ced324f05de20f839782913cfb13d147d49dd6 | create a scheduler example file to test on live | code-samples/web_scraper/jared/scheduling_script.py | code-samples/web_scraper/jared/scheduling_script.py | Python | 0 | @@ -0,0 +1,1000 @@
+from time import sleep%0Afrom apscheduler.schedulers.background import BackgroundScheduler as Scheduler%0Aimport logging%0Aimport datetime%0A%0A# create a scheduler%0As = Scheduler()%0A%0A# This is what I want to happen%0Adef job():%0A%0A%09logging.basicConfig(filename='scheduled_task.log',level=log... | |
a9a6a3dafc8901ffeeb89862fdc79f7099ba311a | Add UTF-8 test | test/test_utf8.py | test/test_utf8.py | Python | 0.000569 | @@ -0,0 +1,919 @@
+# -*- coding: utf-8 -*-%0A# Monary - Copyright 2011-2014 David J. C. Beach%0A# Please see the included LICENSE.TXT and NOTICE.TXT for licensing information.%0A%0Aimport pymongo%0A%0Aimport monary%0A%0Adef setup():%0A with pymongo.Connection(%22127.0.0.1%22) as c:%0A c.drop_database(%22monar... | |
6740c6192ab9bf37767230981b86e446486d4c43 | implement basic plugin loader for laser | mythril/laser/ethereum/plugins/plugin_loader.py | mythril/laser/ethereum/plugins/plugin_loader.py | Python | 0 | @@ -0,0 +1,1092 @@
+from mythril.laser.ethereum.svm import LaserEVM%0Afrom mythril.laser.ethereum.plugins.plugin import LaserPlugin%0A%0A%0Aclass LaserPluginLoader:%0A %22%22%22%0A The LaserPluginLoader is used to abstract the logic relating to plugins.%0A Components outside of laser thus don't have to be awar... | |
a01f4d47410ee1bf164d8b962f6337f8c39f0d16 | add quicksort recursive | sort/quick_sort/python/quicksort-recusive.py | sort/quick_sort/python/quicksort-recusive.py | Python | 0.000114 | @@ -0,0 +1,449 @@
+%0Adef quickSort(arr):%0A sort(arr,0,len(arr)-1) %0A%0Adef sort(arr, low, high):%0A if (low %3C high):%0A p = partition(arr, low, high)%0A sort(arr, low, p - 1)%0A sort(arr, p + 1, high)%0A%0Adef partition(arr, low, high):%0A pivot = arr%5Bhigh%5D%0A i = (low - 1) %0A... | |
e6b381a617808c500e115d5e3715dc2ae454e896 | Add command line tool | src/psd_tools2/__main__.py | src/psd_tools2/__main__.py | Python | 0.00002 | @@ -0,0 +1,1856 @@
+from __future__ import unicode_literals%0Aimport logging%0Aimport docopt%0A%0Afrom psd_tools2 import PSDImage%0Afrom psd_tools2.version import __version__%0A%0Atry:%0A from IPython.lib.pretty import pprint%0Aexcept ImportError:%0A from pprint import pprint%0A%0Alogger = logging.getLogger(__nam... | |
bce910100fe0c3970b82d4f5544f11ce3392bc3c | Remove NoQueueMinCycleTime nonsense from sync worker | sync_worker.py | sync_worker.py | from datetime import datetime, timedelta
import os
print("Sync worker %s booting at %s" % (os.getpid(), datetime.now()))
from tapiriik.requests_lib import patch_requests_with_default_timeout, patch_requests_source_address
from tapiriik import settings
from tapiriik.database import db, close_connections
import time
imp... | Python | 0.000001 | @@ -482,125 +482,8 @@
ent.
-%0ANoQueueMinCycleTime = timedelta(seconds=30) # No need to hammer the database given the number of sync workers I have
%0A%0Aol
@@ -2100,16 +2100,41 @@
ings()%0A%0A
+sync_heartbeat(%22ready%22)%0A%0A
while Ru
@@ -2339,16 +2339,16 @@
ersion)%0A
+
Recy
@@ -2387,545 +2387,8 @@
unt%0... |
6d134c2a870150477ecc41edbab272e75462bbcd | Add benchmark script | tests/bench.py | tests/bench.py | Python | 0.000001 | @@ -0,0 +1,1260 @@
+%0Aimport os%0Aimport re%0Aimport time%0A%0Aroot = os.path.dirname(__file__)%0A%0Aknown = %5B%5D%0A%0A%0Adef listdir(folder):%0A folder = os.path.join(root, folder)%0A files = os.listdir(folder)%0A files = filter(lambda o: o.endswith('.text'), files)%0A return files%0A%0A%0Adef mistune_r... | |
f5970d1488d28f27c5f20dd11619187d0c13c960 | Add simple windows registry read/write functions | os/win_registry.py | os/win_registry.py | Python | 0.000001 | @@ -0,0 +1,706 @@
+import _winreg%0A%0AkeyName = %22myKey%22%0A%0A%0Adef write_to_registry():%0A try:%0A key = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, %22Software%5C%5C%22 + keyName)%0A _winreg.SetValueEx(key, %22myVal%22, 0, _winreg.REG_SZ, %22This is a value.%22)%0A print(%22value created... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.