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 |
|---|---|---|---|---|---|---|---|
009ac6b912a00191f69b32791cdb7e74fee83752 | Add config reader | src/config.py | src/config.py | Python | 0.000001 | @@ -0,0 +1,645 @@
+import configparser%0Aimport os%0A%0AConfig = configparser.ConfigParser()%0Afull_path = os.path.dirname(os.path.realpath(__file__))%0A%0Adef read_credentials():%0A%09Config.read(full_path + '/config/config_details.ini')%0A%09try:%0A%09%09username = Config%5B'Credentials'%5D%5B'username'%5D%0A%09%09pa... | |
f290dd020b2cb3e586c8de6c4e8e3c1bc80f3583 | Add new class to compute the colourmap and the node filters accordingly to did | evaluation/packages/colours.py | evaluation/packages/colours.py | Python | 0 | @@ -0,0 +1,1288 @@
+%22%22%22@package Colours%0AThis module provides the colourmaps used in globOpt to display primitives %0Aaccording to their gid%0A%0A%22%22%22%0A%0Aimport packages.primitive as primitive%0Aimport packages.orderedSet as orderedSet%0A%0Aclass Colours(object):%0A%0A def __init__(self):%0A sel... | |
e744a7ae80c0b707ad4de5160eb96ce303e2f098 | put more infromation in exception to help indicating problem source | src/diamond/metric.py | src/diamond/metric.py | # coding=utf-8
import time
import re
import logging
from error import DiamondException
class Metric(object):
_METRIC_TYPES = ['COUNTER', 'GAUGE']
def __init__(self, path, value, raw_value=None, timestamp=None, precision=0,
host=None, metric_type='COUNTER', ttl=None):
"""
Cr... | Python | 0 | @@ -877,32 +877,33 @@
iamondException(
+(
%22Invalid paramet
@@ -904,18 +904,225 @@
arameter
-.%22
+ when creating new %22%0A %22Metric with path: %25r value: %25r %22%0A %22metric_type: %25r%22)%0A %25 (path, val... |
833d114bd1bc396dc7c6b0434782f9e326319e88 | Add file to read .RAW images from Aptina | readAptinaRAW.py | readAptinaRAW.py | Python | 0 | @@ -0,0 +1,1127 @@
+import os%0Aimport numpy%0Aimport matplotlib.pyplot as plt%0A%0ADirectory = '/scratch/tmp/DevWareX/MT9M001/DSL949A-NIR/'%0AFolder = '1394629994_MT9M001_DSL949A-NIR_0.0_0.0f_040ms_090mm_to150mm'%0AFile = 'MT9M001_1280x1024_DSL949A-NIR_0.0_0.0f_040ms_090mm_to150mm_090mm.raw'%0ASize = %5Bint(File.split... | |
0755afbf47087aded357ca77c86e98f7243a53c7 | check that `{base_url}/nbextensions` page loads | tests/test_nbextensions_configurator.py | tests/test_nbextensions_configurator.py | Python | 0.000002 | @@ -0,0 +1,798 @@
+import requests%0A%0Afrom notebook.notebookapp import NotebookApp%0Afrom notebook.tests.launchnotebook import NotebookTestBase%0Afrom notebook.utils import url_path_join%0Afrom traitlets.config import Config%0A%0A%0Aclass ConfiguratorTest(NotebookTestBase):%0A%0A config = Config(log_level='DEBUG')... | |
b3aaa3c9e9eccd1f8be82316713a613d16412f36 | add files module (mostly for images at the moment) | wapiti/operations/files.py | wapiti/operations/files.py | Python | 0 | @@ -0,0 +1,2564 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom base import QueryOperation%0Afrom params import MultiParam, StaticParam%0Afrom models import PageInfo, ImageInfo%0Afrom utils import OperationExample%0A%0A%0ADEFAULT_IMAGE_PROPS = %5B'timestamp', 'user', 'userid', 'comment',... | |
56fd675e5bf0bd68a73e21c244807c39a87a3eee | Implement the command handler framework | heufybot/modules/util/commandhandler.py | heufybot/modules/util/commandhandler.py | Python | 0.003526 | @@ -0,0 +1,657 @@
+from twisted.plugin import IPlugin%0Afrom heufybot.moduleinterface import BotModule, IBotModule%0Afrom zope.interface import implements%0A%0A%0Aclass CommandHandler(BotModule):%0A implements(IPlugin, IBotModule)%0A%0A name = %22CommandHandler%22%0A%0A def hookBot(self, bot):%0A self.b... | |
378f98885fb7ea2eebb7307afded05cd3706647b | make server sleep 60s | hydra/server1.py | hydra/server1.py | Python | 0.000008 | @@ -0,0 +1,857 @@
+import os%0Aimport socket%0Aimport time%0A%0A%0ASERVER_ADDRESS = (HOST, PORT) = '', 8888%0AREQUEST_QUEUE_SIZE = 1%0A%0A%0Adef handle_request(client_connection):%0A request = client_connection.recv(1024)%0A print request.decode()%0A http_response = '''%5C%0AHTTP/1.1 200 OK%0A%0AHello World!%0... | |
26cad83ebb6466d66f1e9fd87e963af4b5247ecc | Add Heap sort implemented in python | sort/heap_sort/python/heap_sort_ccsc.py | sort/heap_sort/python/heap_sort_ccsc.py | Python | 0 | @@ -0,0 +1,1174 @@
+# Python program for implementation of heap Sort%0A%0A# To heapify subtree rooted at index i.%0A# n is size of heap%0Adef heapify(arr, n, i):%0A%09largest = i # Initialize largest as root%0A%09l = 2 * i + 1%09 # left = 2*i + 1%0A%09r = 2 * i + 2%09 # right = 2*i + 2%0A%0A%09# See if left child of ro... | |
ee9e31b8a8d93288009ee8d9a846dcaf930edb7a | Create solutions.py | unique-number-of-occurrences/solutions.py | unique-number-of-occurrences/solutions.py | Python | 0.000019 | @@ -0,0 +1,422 @@
+class Solution(object):%0A def uniqueOccurrences(self, arr):%0A %22%22%22%0A :type arr: List%5Bint%5D%0A :rtype: bool%0A %22%22%22%0A arr_dict = %7B%7D%0A for x in arr:%0A if x in arr_dict:%0A arr_dict%5Bx%5D += 1%0A el... | |
f4a4b0ed743b1c56b884d9364759adeca5d64479 | Change PRESUBMIT to allow COMPILE_ASSERT | cc/PRESUBMIT.py | cc/PRESUBMIT.py | # Copyright (c) 2012 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.
"""Top-level presubmit script for cc.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API built... | Python | 0.000008 | @@ -821,24 +821,26 @@
re.search(r%22
+%5Cb
ASSERT%5C(%22, c
|
072fd08dd89cc03aad0508c2e16e7551f5b27de0 | Create info.py | cgi-bin/info.py | cgi-bin/info.py | Python | 0 | @@ -0,0 +1,579 @@
+%0A#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A# Este arquivo pode ser salvo com qualquer extens%C3%A3o, tipo info.html%0A# A ser salvo em /usr/lib/cgi-bin no Debian/Ubuntu e %0A# em /var/www/cgi-bin no Fedora/RedHat/CentOS.%0A%0Aimport os%0A%0Aprint('Content-type: text/html')%0Aprint()%0A%... | |
5fa88fa503bb7e383fb0918beeef49c7802a8b43 | Why wasnt this already commited? heh | pyad2usb/panels.py | pyad2usb/panels.py | Python | 0.999491 | @@ -0,0 +1,233 @@
+%22%22%22%0ARepresentations of Panels and their templates.%0A%22%22%22%0A%0AVISTA20 = 0%0A%0ATEMPLATES = %7B%0A VISTA20: %7B%0A 'name': 'Vista 20',%0A # number of expanders, starting_address, number of channels%0A 'expanders': (5, 7, 7)%0A %7D%0A%7D%0A
| |
a5e35f1b19259addf325d5b2b3545e0f10fbf5b6 | Create string2.py | BaydakovaE/string2.py | BaydakovaE/string2.py | Python | 0.999992 | @@ -0,0 +1,1309 @@
+import math%0A# D. verbing%0Adef verbing(s):%0A if s.endswith('ing'):%0A st=s+%22ly%22%0A elif len(s) %3E 3:%0A st=s+%22ing%22%0A else:%0A st=s%0A return st%0A%0A# E. not_bad%0Adef not_bad(s):%0A if s.find('not') %3E 0 and s.find('bad') %3E 0 and s.find('not') %3C... | |
a12ced781c91b1d553a7e4e93d3df258cabbe63e | Add new package: jansi-native (#18547) | var/spack/repos/builtin/packages/jansi-native/package.py | var/spack/repos/builtin/packages/jansi-native/package.py | Python | 0 | @@ -0,0 +1,712 @@
+# 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 JansiNative(MavenPackage):%0A %22%22%22Jansi is a small ... | |
34853f9a99ef385b912c4fe7936594bb70008293 | Add asyncs.utils.CircuitBreaker | py/garage/garage/asyncs/utils.py | py/garage/garage/asyncs/utils.py | Python | 0.000005 | @@ -0,0 +1,821 @@
+__all__ = %5B%0A 'CircuitBreaker',%0A%5D%0A%0Aimport collections%0Aimport time%0A%0A%0Aclass CircuitBreaker:%0A %22%22%22Break (disconnect) when no less than %60count%60 errors happened%0A within last %60period%60 seconds.%0A %22%22%22%0A%0A class Disconnected(Exception):%0A ... | |
083957302452bdd966286bfd8d37d53dce8db7d3 | Add utility methods for facebook stuff. | pykeg/contrib/facebook/fbutil.py | pykeg/contrib/facebook/fbutil.py | Python | 0 | @@ -0,0 +1,646 @@
+import facebook%0A%0Adef profile_for_user(user):%0A profile = user.facebookprofile_set.all()%0A if not profile:%0A return None%0A return profile%5B0%5D%0A%0Adef session_for_user(user):%0A profile = profile_for_user(user)%0A if not profile:%0A return None%0A session = profile.session.all()... | |
5f2d0b5c9dbb288ee279e7158ad0e0aa2f5d4037 | Add config wrapper. | qipipe/staging/sarcoma_config.py | qipipe/staging/sarcoma_config.py | Python | 0 | @@ -0,0 +1,245 @@
+import os%0Aimport ConfigParser%0A%0A_CFG_FILE = os.path.join(os.path.dirname(__file__), '..', '..', 'conf', 'sarcoma.cfg')%0A_CONFIG = ConfigParser()%0A_CONFIG.read(_CFG_FILE)%0A%0Adef sarcoma_location(pt_id):%0A return _CONFIG.get('Tumor Location', pt_id)%0A
| |
a002a78843c6324df94790c6185064e9ac2fb08d | Add utils | src/utils.py | src/utils.py | Python | 0.000016 | @@ -0,0 +1,2302 @@
+import base64%0Aimport hashlib%0Aimport secrets%0Aimport struct%0A%0A%0Adef gen_data_len(mask_flag, data):%0A data_len = len(data)%0A if mask_flag:%0A if data_len %3C= 125:%0A data_len = data_len %7C 128%0A data_len = struct.pack('%3EB', data_len)%0A ret... | |
42114e5bb6a97202500e62ec0a147542257ce710 | Remove unused imports | Source/build/scripts/make_runtime_features.py | Source/build/scripts/make_runtime_features.py | #!/usr/bin/env python
# Copyright (C) 2013 Google Inc. 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 list ... | Python | 0.999999 | @@ -1556,54 +1556,12 @@
ort
-os.path%0Aimport sys%0A%0Afrom in_file import InFile
+sys%0A
%0Aimp
|
3699e8e412c637c9a36cb59e5647d8ff54782200 | Add an integration test for #480 | integration_tests/web/test_issue_480.py | integration_tests/web/test_issue_480.py | Python | 0 | @@ -0,0 +1,2189 @@
+import logging%0Aimport multiprocessing%0Aimport os%0Aimport threading%0Aimport unittest%0A%0Afrom integration_tests.env_variable_names import SLACK_SDK_TEST_USER_TOKEN%0Afrom integration_tests.helpers import async_test%0Afrom slack import WebClient%0A%0A%0Aclass TestWebClient(unittest.TestCase):%0A... | |
1609c5cd83fc99887ec45ff6beba2ee0dba712a8 | Create D_Velocity_components.py | Cas_1/D_Velocity_components.py | Cas_1/D_Velocity_components.py | Python | 0.000001 | @@ -0,0 +1,1719 @@
+import numpy as np %0Aimport matplotlib.pyplot as plt %0Afrom xmitgcm import open_mdsdataset %0A%0Aimport cartopy.crs as ccrs%0Afrom cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER%0Aplt.ion() %0A%0Adir1 = '/homedata/bderembl/runmit/test_southatlgyre'%0A%0Ads1 = open_mdsdata... | |
5977d5f01a740150eebd01d8aa110e864a92da95 | Create 3-temperature.py | Code/3-temperature.py | Code/3-temperature.py | Python | 0.007031 | @@ -0,0 +1,1488 @@
+# Import Libraries%0Aimport os%0Aimport glob%0Aimport time%0A%0A# Initialize the GPIO Pins%0Aos.system('modprobe w1-gpio') # Turns on the GPIO module%0Aos.system('modprobe w1-therm') # Turns on the Temperature module%0A%0A# Finds the correct device file that holds the temperature data%0Abase_dir = ... | |
d7854b71e778103ca14a488cc80e436aff46389b | Create Super_calculateur.py | Difficult/Super_calculateur.py | Difficult/Super_calculateur.py | Python | 0 | @@ -0,0 +1,298 @@
+%0An = int(input())%0Aliste=%5B%5D%0Afor i in range(n):%0A j, d = %5Bint(j) for j in input().split()%5D%0A liste.append(%5Bj,j+d-1%5D)%0A %0Aliste.sort(key=lambda x: x%5B0%5D)%0Aliste.sort(key=lambda x: x%5B1%5D)%0A%0AJ_max=0%0Acount=0%0A%0Afor el in liste:%0A if el%5B0%5D%3EJ_max:%0A ... | |
feb2ebbc03dd0cfb86e4eb700cf32bc2063493e0 | Fix AWS Lambda breakage after #5824 (#5935) | homeassistant/components/notify/aws_lambda.py | homeassistant/components/notify/aws_lambda.py | """
AWS Lambda platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.aws_lambda/
"""
import logging
import json
import base64
import voluptuous as vol
from homeassistant.const import (
CONF_PLATFORM, CONF_NAME)
from h... | Python | 0 | @@ -464,16 +464,61 @@
on as cv
+%0Afrom homeassistant.remote import JSONEncoder
%0A%0A_LOGGE
@@ -1402,16 +1402,33 @@
ONTEXT%5D%7D
+, cls=JSONEncoder
)%0A co
|
f0ac1914790e69fe786d6d3182cf15fd09302c28 | Add test for missing building part seen in production. | integration-test/912-missing-building-part.py | integration-test/912-missing-building-part.py | Python | 0 | @@ -0,0 +1,234 @@
+# http://www.openstreetmap.org/way/287494678%0Az = 18%0Ax = 77193%0Ay = 98529%0Awhile z %3E= 16:%0A assert_has_feature(%0A z, x, y, 'buildings',%0A %7B 'kind': 'building',%0A 'id': 287494678 %7D)%0A%0A z -= 1%0A x /= 2%0A y /= 2%0A
| |
95126bc5889e66ab7646e49f6ed773d3d4cd9a37 | save received fw in archive dir. Separate installer for new userpackage found | iottly-device-agent-py/install_userpackage.py | iottly-device-agent-py/install_userpackage.py | Python | 0 | @@ -0,0 +1,1495 @@
+import os, shutil, logging, tarfile%0A%0Afrom iottly.settings import settings%0A%0Alogging.basicConfig(level=logging.INFO,%0A format='%25(asctime)s %5B%25(levelname)s%5D (%25(processName)-9s) %25(message)s',)%0A%0Auserpackagepath = 'userpackage/'%0A%0A# check that iottly service... | |
c50029c2ece8d30a05816a6045f01663e0448837 | bump copyright year | plinth.py | plinth.py | #!/usr/bin/env python
import os, sys, argparse
#import logging
from gettext import gettext as _
import cfg
if not os.path.join(cfg.file_root, "vendor") in sys.path:
sys.path.append(os.path.join(cfg.file_root, "vendor"))
import cherrypy
from cherrypy import _cpserver
from cherrypy.process.plugins import Daemonizer
... | Python | 0.000002 | @@ -652,16 +652,21 @@
ght 2011
+-2013
, James
|
9f7296b34d1e65ac14cb9b98734e2a01aee345a2 | Add missing file | chargehound/models.py | chargehound/models.py | Python | 0.000006 | @@ -0,0 +1,280 @@
+from collections import namedtuple%0Afrom bunch import Bunch%0A%0A%0Aclass ChargehoundObject(Bunch):%0A pass%0A%0A%0Aclass List(ChargehoundObject):%0A pass%0A%0A%0Aclass Dispute(ChargehoundObject):%0A pass%0A%0A%0Aclass Product(ChargehoundObject):%0A pass%0A%0A%0AResponse = namedtuple('Re... | |
3c2d85b4b7a497ceffac3e562ac1a468f1f6a4b0 | add solution for First Bad Version | algorithms/firstBadVersion/firstBadVersion.py | algorithms/firstBadVersion/firstBadVersion.py | Python | 0 | @@ -0,0 +1,441 @@
+# The isBadVersion API is already defined for you.%0A# @param version, an integer%0A# @return a bool%0A# def isBadVersion(version):%0A%0Aclass Solution(object):%0A def firstBadVersion(self, n):%0A %22%22%22%0A :type n: int%0A :rtype: int%0A %22%22%22%0A l, r = 1,... | |
3ad0213e15e2ccb7894a1d0beb88bd86ae3d9e67 | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,264 @@
+#!/usr/bin/env python%0A%0Afrom distutils.core import setup%0A%0Asetup(name='pypixoto',%0A version='1.0',%0A description='Python SDK for Pixoto.com',%0A author='Daxeel Soni',%0A author_email='sayhi@daxeelsoni.in',%0A url='https://www.daxeelsoni.in',%0A )%0A
| |
775e5bb619a44a29703f7c09eaf91b780e35e8cf | Make it OK to have no assets. | django_assets/management/commands/assets.py | django_assets/management/commands/assets.py | """Manage assets.
Usage:
./manage.py assets build
Build all known assets; this requires tracking to be enabled: Only
assets that have previously been built and tracked are
considered "known".
./manage.py assets build --parse-templates
Try to find as many of the p... | Python | 0 | @@ -3155,36 +3155,26 @@
-raise CommandError('
+log.info(%22
No asset
@@ -3194,17 +3194,17 @@
found.
-'
+%22
%0D%0A
@@ -3213,17 +3213,17 @@
-'
+%22
If you a
@@ -3262,17 +3262,17 @@
in your
-'
+%22
%0D%0A
@@ -3281,17 +3281,17 @@
-'
+%22
template
@@ -3331,17 +3331,17 @@
... |
c5a7f18f3b97c40489f9b098e4822ba7ce3a5927 | Create ex4_3.py | First_course/ex4_3.py | First_course/ex4_3.py | Python | 0.00006 | @@ -0,0 +1,1979 @@
+#!/usr/bin/env python%0A%0A'''%0AIII. Create a program that converts the following uptime strings to a time in seconds.%0A%0Auptime1 = 'twb-sf-881 uptime is 6 weeks, 4 days, 2 hours, 25 minutes'%0Auptime2 = '3750RJ uptime is 1 hour, 29 minutes'%0Auptime3 = 'CATS3560 uptime is 8 weeks, 4 days, 18 hou... | |
d8b6cbc9703dbb3f3b7fed17a9594148aae1d75e | Create Magic8Ball.py | HexChat/Magic8Ball.py | HexChat/Magic8Ball.py | Python | 0.000001 | @@ -0,0 +1,1130 @@
+import hexchat%0Afrom random import choice%0A%0A__module_name__ = 'Magic8ball'%0A__module_version__ = '0.0.1'%0A__module_description__ = 'Allows one ask magic8ball questions with answers'%0A__module_author__ = 'Vlek'%0A%0A_8ball_answers = %5B%0A 'It is certain', 'It is decidedly so',%0A 'Witho... | |
5e81fca928862b1c9574f1092a131337735b63f4 | Add basic IAM integration test | tests/integration/iam/test_connection.py | tests/integration/iam/test_connection.py | Python | 0 | @@ -0,0 +1,1728 @@
+# Copyright (c) 2014 Amazon.com, Inc. or its affiliates.%0A# All rights reserved.%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining a%0A# copy of this software and associated documentation files (the%0A# %22Software%22), to deal in the Software without restriction, includ... | |
91102e233d3bd13e08015e5172ea0e638d3e8574 | Python 3: enable tests/unit/middleware/test_request_id.py | tests/unit/middleware/test_request_id.py | tests/unit/middleware/test_request_id.py | # Copyright (c) 2013 NEC Corporation
# 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 requi... | Python | 0.999801 | @@ -1243,16 +1243,17 @@
rtsWith(
+b
'req-'))
|
21f34851a88480cc2e060361ee3119bb0d1c79ea | bump to 0.4.1 | pupa/__init__.py | pupa/__init__.py | __version__ = '0.4.0-dev' # pragma: no cover
| Python | 0.000014 | @@ -16,13 +16,9 @@
0.4.
-0-dev
+1
'
|
1528ac33ae3bfb81645fb45dece72b0f6f69b431 | Create sample.py | sample.py | sample.py | Python | 0 | @@ -0,0 +1,1695 @@
+import webapp2%0Aimport urllib2%0Aimport urllib%0Aimport json%0A%0A## CHANGE THIS%0ACLIENT_ID = %22YOUR_CLIENT_ID%22%0ACLIENT_SECRET = %22YOUR_CLIENT_SECRET%22%0ADOMAIN = %22YOURS.auth0.com%22%0ACALLBACK_URL = %22http://localhost:8080/callback%22%0A%0AMAIN_PAGE_HTML = %22%22%22%5C%0A%3Chtml%3E%0A %... | |
1b610ec0dafdb299e1a04a9be90156fafc40c5ba | Create mainmenu2.py | mainmenu2.py | mainmenu2.py | Python | 0 | @@ -0,0 +1,1813 @@
+#Christina Hammer%0A#main menu Gui%0A%0Afrom tkinter import *%0Afrom tkinter import messagebox%0A%0A%0Adef addnew():%0A import newclientinter2%0A return%0A%0Adef quitprogram():%0A mmGui.destroy()%0A return%0A%0Adef logoff():%0A import logGui%0A mmGui.destory()%0A %0A return%0... | |
8613deaffe5de066075141e577faa578169d3b41 | add progress reporting module | openquake/utils/progress.py | openquake/utils/progress.py | Python | 0.000002 | @@ -0,0 +1,1095 @@
+# -*- coding: utf-8 -*-%0A# vim: tabstop=4 shiftwidth=4 softtabstop=4%0A%0A# Copyright (c) 2010-2012, GEM Foundation.%0A#%0A# OpenQuake is free software: you can redistribute it and/or modify it%0A# under the terms of the GNU Affero General Public License as published%0A# by the Free Software Founda... | |
06a0070bc20d18eec6d2b065a6e143c45323fbe6 | Implement sinus generation script | scripts/sin_gen.py | scripts/sin_gen.py | Python | 0.000002 | @@ -0,0 +1,1006 @@
+# twiddle.py%0A#%0A# Created on: 15 May 2017%0A# Author: Fabian Meyer%0A%0Aimport argparse%0Aimport math%0A%0AVERSION = '0.1.0'%0AN = 16%0A%0A%0Adef parse_args():%0A '''Parse command line arguments.'''%0A%0A parser = argparse.ArgumentParser(%0A description=%22Calculate twiddle facto... | |
5d22c6ddf0c2534df4bef02fbbf386a43c8f6203 | make some migrations yo | back-end/interface/migrations/0001_initial.py | back-end/interface/migrations/0001_initial.py | Python | 0.000031 | @@ -0,0 +1,561 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.1 on 2016-12-04 20:47%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A initial = True%0A%0A dependencies = %5B%0A %5D%0A%0A operations = %5B%0A ... | |
8dfb5792ef73d822b16dde55bb090c1e613cc2ed | add refresh_creds.py | refresh_creds.py | refresh_creds.py | Python | 0.000001 | @@ -0,0 +1,1125 @@
+#!/usr/bin/env python3%0A%0Aimport sys%0Aimport gimme_aws_creds.main%0Aimport gimme_aws_creds.ui%0A%0Aaccount_alias_id_map = %7B%0A %22master%22: %22123456789012%22,%0A %22shared-services%22: %22123456789012%22,%0A %22network%22: %22123456789012%22,%0A %22security%22: %22123456789012%22,... | |
c1c3624b1247bf6c7b939549059866165bf5776f | test case with expected murmur hashes from the original murmur hash library | test_hash.py | test_hash.py | Python | 0 | @@ -0,0 +1,682 @@
+import murmur%0Aimport string%0A%0Aexpected_dict = %7B'a': 2456313694, 'c': 754329161, 'b': 2260187636, 'e': 3115762238, 'd': 4163039750, 'g': 1545794298, 'f': 4226522672, 'i': 3451942824, 'h': 1069002520, 'k': 3288208012, 'j': 3131388162, 'm': 3020367812, 'l': 2169669117, 'o': 1720432690, 'n': 17856... | |
8d7f2b4dbdc64a28f6864e607b1a18e1f2018b11 | move to ini file and config parser | cfg.py | cfg.py | Python | 0 | @@ -0,0 +1,1078 @@
+from menu import Menu%0Aimport os%0A%0Afrom ConfigParser import SafeConfigParser%0Aparser = SafeConfigParser(%0A defaults=%7B%0A 'root':os.path.dirname(os.path.realpath(__file__)),%0A 'product_name':%22%22,%0A 'box_name':%22%22,%0A 'file_root':%22%22,%0A 'data_d... | |
c3d87e837c85284baa132104e4843c3fd8f429d3 | Complete day 4 part 2 | day-04-2.py | day-04-2.py | Python | 0.000005 | @@ -0,0 +1,442 @@
+import hashlib%0A%0A%0Apuzzle_input = b'iwrupvqb'%0Anumber = 100000%0A%0Awhile True:%0A key = puzzle_input + str(number).encode()%0A if hashlib.md5(key).hexdigest()%5B:6%5D == '000000':%0A break%0A number += 1%0A%0Aprint(number)%0A%0A# Now that I think about it, starting with 100,000 ... | |
d30b61a82533347f8ea2d0250e3d5346e4dcbc07 | Create variables | variables.py | variables.py | Python | 0.000031 | @@ -0,0 +1,620 @@
+LAYER_1 = (True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)%0ALAYER_2 = (False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)... | |
754b9d76e8a02040c423d7c15737073d48458eb0 | fix non-fastbuild chrome_split_dll | chrome/installer/mini_installer_syzygy.gyp | chrome/installer/mini_installer_syzygy.gyp | # Copyright (c) 2011 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.
{
'variables': {
'version_py': '<(DEPTH)/chrome/tools/build/version.py',
'version_path': '<(DEPTH)/chrome/VERSION',
'lastchange_path': '<(DE... | Python | 0.000002 | @@ -672,16 +672,40 @@
build==0
+ and chrome_split_dll==0
', %7B%0A
@@ -1216,24 +1216,53 @@
%7D,%0A %5D,%0A
+ %7D,%7B%0A 'targets': %5B%5D,%0A
%7D%5D,%0A
|
685347e9f7fbf629e09427d5c63c1e81dfe43446 | Create config file | shub_cli/config.py | shub_cli/config.py | Python | 0.000002 | @@ -0,0 +1,452 @@
+from prompt_toolkit.styles import style_from_dict%0Afrom pygments.token import Token%0A%0Aerror_style = style_from_dict(%7B%0A Token.ErrorMessage: '#ff0066',%0A Token.ShubFileModel: '#ccaa33',%0A%7D)%0A%0Atokens = %5B%0A (Token.ErrorMessage, 'You need to set up your .scrapinghub.yml with a d... | |
1dd1111bd1bab62ed900d74f347a7fe10d03eb03 | Test that changelog is not outdated | test/release.py | test/release.py | Python | 0.000002 | @@ -0,0 +1,801 @@
+from __future__ import absolute_import%0A%0Aimport user_agent%0Aimport re%0A%0A%0Adef test_changelog():%0A %22%22%22%0A Parse changelog and ensure that it contains%0A * unreleased version younger than release date%0A * release version has a date%0A %22%22%22%0A re_date = re.compile(... | |
fb02defe8ba3bb5d7a76cfd515ebe1a7369a02da | Add time unit and duration to string function | units/time.py | units/time.py | Python | 0.000001 | @@ -0,0 +1,1172 @@
+%0Aimport datetime%0A%0Afrom .errors import UnitExecutionError%0A%0Adef duration_to_string(duration, weeks = True, milliseconds = False, microseconds = False,%0A%09%09%09%09%09%09abbreviate = False, separator = ' '):%0A%09# TODO: Support colon format%0A%09if not isinstance(duration, datetime.timedel... | |
df87fde0862a2d3725505ca709367ae74faa53fd | Create Battleship.py | Battleship.py | Battleship.py | Python | 0.000022 | @@ -0,0 +1,58 @@
+#Text Based Battle Ship%0A%0APrint(%22 Are You Ready to Play?%22)%0A
| |
e9a37e7c4db4278c1fbdce3ec5041929910f9e3a | Add patterns module. | pattern_matcher/patterns.py | pattern_matcher/patterns.py | Python | 0 | @@ -0,0 +1,1945 @@
+class Node(object):%0A WILDCARD = '*'%0A%0A def __init__(self, value):%0A self.value = value%0A%0A def is_wildcard(self):%0A return self.value == self.WILDCARD%0A%0A def __str__(self):%0A return self.value%0A%0A def __repr__(self):%0A return '%3CNode: %5C'%... | |
52fdbe3ec3063ad512dea5abadcb5d055c073143 | Fix formatting of log and print statements [skip ci] | Brighter/brightmntr/brightmntr/worker.py | Brighter/brightmntr/brightmntr/worker.py | """
File : worker.py
Author : ian
Created : 06-20-2015
Last Modified By : ian
Last Modified On : 07-24-2015
***********************************************************************
The MIT License (MIT)
Copyright © 2014 Ian Cooper <ian_hammond_cooper@yahoo.co.uk>
Permission is hereby granted... | Python | 0 | @@ -2989,16 +2989,42 @@
ved at:
+%25s headers: %25s payload: %25s
%22, datet
@@ -3053,26 +3053,117 @@
(),
-%22 Event: %22,
+message.headers, message.payload)%0A now = datetime.utcnow().isoformat()%0A activity =
body
-)
%0A
@@ -3197,17 +3197,16 @@
ent%7D %5Cn%22
-)
.format(
@@ -3214,4... |
1b83a31090cd803d2eca0b9caed0f4cc9a149fbd | Raise ConfigurationError error that causes server to fail and dump whole stacktrace | cubes/stores.py | cubes/stores.py | from .errors import *
from .browser import AggregationBrowser
from .extensions import get_namespace, initialize_namespace
__all__ = (
"open_store",
"Store"
)
def open_store(name, **options):
"""Gets a new instance of a model provider with name `name`."""
ns = get_namespace("s... | Python | 0 | @@ -526,33 +526,34 @@
se C
-ubesError(%22Unable to find
+onfigurationError(%22Unknown
sto
@@ -953,12 +953,20 @@
se C
-ubes
+onfiguration
Erro
|
bd31cd36db0a2780047caee02076c6dd4e44cc3f | Create MinStack_001.py | leetcode/155-Min-Stack/MinStack_001.py | leetcode/155-Min-Stack/MinStack_001.py | Python | 0.000002 | @@ -0,0 +1,654 @@
+class MinStack:%0A # @param x, an integer%0A %0A def __init__(self):%0A self.stack = %5B%5D%0A self.min_stack = %5B%5D%0A %0A # @return an integer%0A def push(self, x):%0A self.stack.append(x)%0A %0A if len(self.min_stack) == 0 or self.min_stac... | |
d78c14cd8f6329f14628ac67345781c7eda6240c | add lists services script | list_services.py | list_services.py | Python | 0.000001 | @@ -0,0 +1,128 @@
+import services%0Afrom services import *%0A%0Aprint len(services.Service.plugins)%0Afor p in services.Service.plugins:%0A print p.name%0A
| |
5b8bf127ed7bbb3ea8e0bf05b9e4fc6d00962402 | add a script to use the data converter | data_convert.py | data_convert.py | Python | 0 | @@ -0,0 +1,479 @@
+# Copyright (c) 2012 The Pycroft Authors. See the AUTHORS file.%0A# This file is part of the Pycroft project and licensed under the terms of%0A# the Apache License, Version 2.0. See the LICENSE file for details.%0Afrom legacy import convert%0Afrom pycroft import model%0A%0Aif __name__ == %22__main__%... | |
d0ff03be32a7325f310237b49d06f622a751e448 | add easy-rdf.py | easy-rdf.py | easy-rdf.py | Python | 0.000696 | @@ -0,0 +1,2124 @@
+import itertools%0Aimport re%0Aimport os%0Aimport rdflib%0Afrom oaipmh.client import Client%0Afrom oaipmh.metadata import MetadataRegistry, oai_dc_reader%0A%0Adc11 = rdflib.Namespace('http://purl.org/dc/elements/1.1/')%0Ageo = rdflib.Namespace('http://www.w3.org/2003/01/geo/wgs84_pos#')%0Avirtrdf = ... | |
2234214adc252e37ff6e83776a32a2826a37f79f | add test for labelers | libact/labelers/tests/test_labelers.py | libact/labelers/tests/test_labelers.py | Python | 0 | @@ -0,0 +1,734 @@
+import unittest%0A%0Aimport numpy as np%0A%0Afrom libact.base.dataset import Dataset%0Afrom libact.labelers import IdealLabeler%0A%0A%0Aclass TestDatasetMethods(unittest.TestCase):%0A%0A initial_X = np.arange(15).reshape((5, 3))%0A initial_y = np.array(%5B1, 2, 3, 1, 4%5D)%0A%0A def setup_da... | |
dda0f1ba84feac1cf7cd54769efbb543defa173a | add epinions data reader | polara/datasets/epinions.py | polara/datasets/epinions.py | Python | 0 | @@ -0,0 +1,1684 @@
+import numpy as np%0Aimport scipy as sp%0Aimport pandas as pd%0A%0A%0Adef compute_graph_laplacian(edges, index):%0A all_edges = set()%0A for a, b in edges:%0A try:%0A a = index.get_loc(a)%0A b = index.get_loc(b)%0A except KeyError:%0A continue%0A ... | |
22382726fa69f40c74611a79b99845df1bd3076f | Add rackHd inventory script | contrib/inventory/rackhd.py | contrib/inventory/rackhd.py | Python | 0 | @@ -0,0 +1,2337 @@
+#!/usr/bin/python%0Aimport json%0Aimport requests%0Aimport os%0Aimport argparse%0Aimport types%0A%0AMONORAIL_URL = 'http://localhost:8080'%0A%0Aclass OnRackInventory(object):%0A def __init__(self, nodeids):%0A self._inventory = %7B%7D%0A for nodeid in nodeids:%0A self._lo... | |
4046c743323a4357864afcac482a5625ed71c184 | Add solution for problem 6 | euler006.py | euler006.py | Python | 0.001106 | @@ -0,0 +1,170 @@
+#!/usr/bin/python%0A%0Alimit = 100%0A%0Asum_sq = ((limit + 1) * limit) / 2%0Asum_sq *= sum_sq%0Asq_sum = (limit * (limit + 1) * ((limit * 2) + 1)) / 6%0A%0Aprint (int (sum_sq - sq_sum))%0A
| |
e9a7d806030fc87ce63554a96c485ecf197e9efd | Create Accel_to_Pos.py | control/PID/Accel_to_Pos.py | control/PID/Accel_to_Pos.py | Python | 0.000011 | @@ -0,0 +1,343 @@
+import time%0A%0A%0Aclass AccelConversion(object):%0A%0A def __init__(self):%0A self.time_start = time.time()%0A%0A def integration(self, accel):%0A delta_t = time.time() - self.time_start%0A pos = accel * (delta_t ** 2) # assumes the ROV has 0 velocity ... | |
66f5ec45798b21996bf5216cd9b8bce4d7d831fd | Add missing migration | core/migrations/0034_auto_20170124_1754.py | core/migrations/0034_auto_20170124_1754.py | Python | 0.0002 | @@ -0,0 +1,489 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.5 on 2017-01-24 17:54%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('core', '0033_auto_20170124_1300'),%0A %5D%0A%0A ... | |
a051b41773c5ea25b3ff5791544fa3b38bdfec4a | add test | awx/main/tests/unit/models/test_inventory.py | awx/main/tests/unit/models/test_inventory.py | Python | 0.000002 | @@ -0,0 +1,1212 @@
+import pytest%0Aimport mock%0Afrom awx.main.models import (%0A UnifiedJob,%0A InventoryUpdate,%0A Job,%0A)%0A%0A%0A@pytest.fixture%0Adef dependent_job(mocker):%0A j = Job(id=3, name='I_am_a_job')%0A j.cancel = mocker.MagicMock(return_value=True)%0A return %5Bj%5D%0A%0A%0Adef test_c... | |
17725f25fa8ecd235d3c9a0b08320af680e3b8fc | Create Networking.py | Networking.py | Networking.py | Python | 0 | @@ -0,0 +1,1773 @@
+import socket%0Aimport ast%0A%0Aclass Server(object):%0A%0A backlog = 5%0A client = None%0A%0A def __init__(self, host, port):%0A self.socket = socket.socket()%0A self.socket.bind((host, port))%0A self.socket.listen(self.backlog)%0A%0A def __del__(self):%0A self.close()%0A%0A def ac... | |
1c745d9414b0a734ede929cd6c2698a68dd014e5 | Add timeout the runner | scraper_sched.py | scraper_sched.py | from scraper import run_scraper
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.triggers.cron import CronTrigger
if __name__ == '__main__':
scheduler = BlockingScheduler()
scheduler.add_job(run_scraper, CronTrigger(minute=0))
scheduler.start()
| Python | 0.000061 | @@ -1,12 +1,77 @@
+from functools import wraps%0Aimport errno%0Aimport os%0Aimport signal%0A
from scraper
@@ -90,16 +90,16 @@
scraper%0A
-
%0Afrom ap
@@ -204,16 +204,643 @@
rigger%0A%0A
+%0Aclass TimeoutError(Exception):%0A pass%0A%0A%0Adef timeout(seconds=10, error_message=os.strerror(errno.ETIME)):%0A def d... |
b2d061113112634c34cb230090a97e25ef32c8b0 | Create scribe_level3.py | scribe_level3.py | scribe_level3.py | Python | 0.000008 | @@ -0,0 +1,2815 @@
+print %22Chapter 1: Breakin' Bad Habits%22 %0A%0Aprint %22You realize that you%E2%80%99re not cut out for a life on the run, %0Aso you decide to head back to the palace and stand trial. As the judge concludes your charges, you stand%0Aand defiantly plead %22Not Guilty%22%5Cn%22%0A%0Aaction = raw_inp... | |
54dc4155fc16d742edcd3ee4ea6df59fead84911 | Remove new flake in basic.py | scripts/basic.py | scripts/basic.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
An incomplete sample script.
This is not a complete bot; rather, it is a template from which simple
bots can be made. You can rename it to mybot.py, then edit it in
whatever way you want.
The following parameters are supported:
¶ms;
-dry If given, does... | Python | 0.000017 | @@ -4966,36 +4966,8 @@
gs()
-%0A site = pywikibot.Site()
%0A%0A
|
337e60c3d63b56b1237e3d5b052a96f3824cc6c2 | Add command to migrate SMSLog to SQL | corehq/apps/sms/management/commands/migrate_sms_to_sql.py | corehq/apps/sms/management/commands/migrate_sms_to_sql.py | Python | 0.000001 | @@ -0,0 +1,1700 @@
+from corehq.apps.sms.models import SMSLog, SMS%0Afrom custom.fri.models import FRISMSLog%0Afrom dimagi.utils.couch.database import iter_docs%0Afrom django.core.management.base import BaseCommand, CommandError%0Afrom optparse import make_option%0A%0A%0Aclass Command(BaseCommand):%0A args = %22%22%... | |
75f81ff20dc3953b3b7c2e064105da34dde2edbf | Add experiment job manager | polyaxon_cli/managers/experiment_job.py | polyaxon_cli/managers/experiment_job.py | Python | 0.998261 | @@ -0,0 +1,715 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import, division, print_function%0A%0Aimport sys%0A%0Afrom polyaxon_cli.managers.base import BaseConfigManager%0Afrom polyaxon_cli.utils.formatting import Printer%0Afrom polyaxon_schemas.experiment import ExperimentJobConfig%0A%0A%0Aclass Expe... | |
83bda2fbb116d46dc0f4e6eb2d63f3f90a6b9733 | fix bugs in travis ci | BioDesigner/settings.py | BioDesigner/settings.py | Python | 0 | @@ -0,0 +1,2518 @@
+%22%22%22%0ADjango settings for BioDesigner project.%0A%0AFor more information on this file, see%0Ahttps://docs.djangoproject.com/en/1.7/topics/settings/%0A%0AFor the full list of settings and their values, see%0Ahttps://docs.djangoproject.com/en/1.7/ref/settings/%0A%22%22%22%0A%0A# Build paths insi... | |
74764e9949de82d4623167e3604d313bc6cf850e | add rejidge | utils/rejudge.py | utils/rejudge.py | Python | 0.000232 | @@ -0,0 +1,2439 @@
+%22%22%22%0AThe MIT License (MIT)%0A%0ACopyright (c) 2014 NTHUOJ team%0A%0APermission is hereby granted, free of charge, to any person obtaining a copy%0Aof this software and associated documentation files (the %22Software%22), to deal%0Ain the Software without restriction, including without limitat... | |
d1588bdf0a672de8d7d4f4f9cddcc236f5b9026e | Add plot for color property combinations to examples. | examples/plotting/file/properties_alpha.py | examples/plotting/file/properties_alpha.py | Python | 0 | @@ -0,0 +1,1275 @@
+import bokeh.plotting as plt%0Afrom itertools import product%0A%0Aplt.output_file('properties_alpha.html')%0A%0Acats = %5B'RGB', 'RGBA', 'Alpha+RGB', 'Alpha+RGBA'%5D%0Ap = plt.figure(x_range=cats, y_range=cats,%0A title=%22Fill and Line Color Property Combinations%22)%0A%0Aalpha = 0.5%... | |
bbc08cc30837ba1ce505d346b67f5808aed628af | Create OverlapGraphs.py | strings/OverlapGraphs.py | strings/OverlapGraphs.py | Python | 0 | @@ -0,0 +1,643 @@
+# solution for http://rosalind.info/problems/grph/%0A%0Aimport re%0A%0AStrings = %7B%7D%0APrefixes = %7B%7D%0ASuffixes = %7B%7D%0Aindex = %22%22 %0A%0Af = open('fasta.txt', 'r')%0Afor line in f:%0A match = re.match(r%22%3E%22, line)%0A #match = str(line).find(%22%3E%22)%0A if match:%0A index = ... | |
090c73c20e3a57f5b2710c270b0dfc139633d623 | Add tests for GameNode module | test/test_gamenode.py | test/test_gamenode.py | Python | 0 | @@ -0,0 +1,2454 @@
+%22%22%22 Tests for the GameNode module %22%22%22%0A%0Afrom contextlib import contextmanager%0Afrom io import StringIO%0Aimport sys%0Aimport unittest%0A%0Afrom src import gamenode%0A%0A@contextmanager%0Adef captured_output():%0A %22%22%22 Redirects stdout to StringIO so we can inspect Print state... | |
2ee6c3c890f236eb7dff0a8094ca3207df119b49 | add new unittest for issue #28 | tests/test_issue28.py | tests/test_issue28.py | Python | 0 | @@ -0,0 +1,401 @@
+import pytest%0Afrom xenon import Path%0Afrom xenon.exceptions import NoSuchPathException%0A%0A%0Adef test_file_does_not_exist(local_filesystem, tmpdir):%0A tmpdir = Path(str(tmpdir))%0A with pytest.raises(NoSuchPathException):%0A filename = tmpdir / 'this-file-does-not-exist'%0A ... | |
6cd7bd0d304c751bd40ce292074a034676ce0a30 | Add setupeggscons script, to use scons build under setuptools. | setupeggscons.py | setupeggscons.py | Python | 0 | @@ -0,0 +1,154 @@
+#!/usr/bin/env python%0A%22%22%22%0AA setup.py script to use setuptools, which gives egg goodness, etc.%0A%22%22%22%0A%0Afrom setuptools import setup%0Aexecfile('setupscons.py')%0A
| |
163b29a07c4d25ee9d3157eb5c517f06a170f42c | Update autocons.py | misc/autocons.py | misc/autocons.py | Python | 0 | @@ -0,0 +1,1436 @@
+import os%0Aimport struct%0Aimport termios%0A%0Aaddrtoname = %7B%0A 0x3f8: '/dev/ttyS0',%0A 0x2f8: '/dev/ttyS1',%0A 0x3e8: '/dev/ttyS2',%0A 0x2e8: '/dev/ttyS3',%0A%7D%0Aspeedmap = %7B%0A 0: None,%0A 3: 9600,%0A 4: 19200,%0A 6: 57600,%0A 7: 115200,%0A%7D%0A%0Atermiobaud = %... | |
871405e3e4721ae4f31efb5add8dc0e6d48500df | add test cases for inference new X for bayesian GPLVM | GPy/testing/inference_tests.py | GPy/testing/inference_tests.py | Python | 0 | @@ -0,0 +1,1823 @@
+%0A%22%22%22%0AThe test cases for various inference algorithms%0A%22%22%22%0A%0Aimport unittest, itertools%0Aimport numpy as np%0Aimport GPy%0A%0A%0Aclass InferenceXTestCase(unittest.TestCase):%0A %0A def genData(self):%0A D1,D2,N = 12,12,50%0A np.random.seed(1234)%0A %0A ... | |
883cd30860d881a9d201c088210deb4ee0d6f6d0 | add an example file to show off colorbar types in vispy.plot | examples/basics/plotting/colorbar_types.py | examples/basics/plotting/colorbar_types.py | Python | 0 | @@ -0,0 +1,915 @@
+# -*- coding: utf-8 -*-%0A# Copyright (c) 2015, Vispy Development Team.%0A# Distributed under the (new) BSD License. See LICENSE.txt for more info.%0A# vispy: gallery 1%0A%22%22%22%0APlot different styles of ColorBar%0A%22%22%22%0A%0Aimport numpy as np%0Afrom vispy import plot as vp%0A%0Afig = vp.Fig... | |
e73b31fb03c42873ad553891d3b643c9c9196a62 | add migration file | evennia/typeclasses/migrations/0013_auto_20191015_1922.py | evennia/typeclasses/migrations/0013_auto_20191015_1922.py | Python | 0.000001 | @@ -0,0 +1,497 @@
+# Generated by Django 2.2.6 on 2019-10-15 19:22%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('typeclasses', '0012_attrs_to_picklev4_may_be_slow'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField... | |
d048d02cde1c4eea536bc6348757389e2ff0f994 | add test to load ophiuchus potential | ophiuchus/potential/tests/test_load.py | ophiuchus/potential/tests/test_load.py | Python | 0 | @@ -0,0 +1,366 @@
+# coding: utf-8%0A%0Afrom __future__ import division, print_function%0A%0A__author__ = %22adrn %3Cadrn@astro.columbia.edu%3E%22%0A%0A# Standard library%0Aimport os%0Aimport sys%0Aimport logging%0A%0A# Third-party%0Afrom astropy import log as logger%0Aimport matplotlib.pyplot as pl%0Aimport numpy as n... | |
18d4d5febb9143b764e53fabb3503b94836abbf5 | Create restricted-sum.py | CiO/restricted-sum.py | CiO/restricted-sum.py | Python | 0.000002 | @@ -0,0 +1,45 @@
+def checkio(d):%0A eval('+'.join(map(str,d)))%0A
| |
3063044995a14921fd0da2ebbbd57942bb5ca24d | Add the skeleton and docs | hubblestack/extmods/modules/safecommand.py | hubblestack/extmods/modules/safecommand.py | Python | 0.000004 | @@ -0,0 +1,1485 @@
+# -*- encoding: utf-8 -*-%0A'''%0ASafe Command%0A============%0A%0AThe idea behind this module is to allow an arbitrary command to be executed%0Asafely, with the arguments to the specified binary (optionally) coming from%0Athe fileserver.%0A%0AFor example, you might have some internal license auditi... | |
9c53e31af42bcf6a019bc8c7ed73af495dff291f | Reservation events for calendar | reservation/ReservationServiceEvents.py | reservation/ReservationServiceEvents.py | Python | 0.999928 | @@ -0,0 +1,1723 @@
+'''%0ACreated on Mar 6, 2014%0A%0A@author: oliver%0A'''%0A%0Aclass ReservationClient(object):%0A '''%0A This class contains all the events that the calendar supports%0A New events can be appended at the bottom%0A '''%0A%0A def __init__(self, serviceArg):%0A '''The init method t... | |
4a73c4faecf3584e6a18861fec8c7c97b1b72e1c | add initial migration | reservations/migrations/0001_initial.py | reservations/migrations/0001_initial.py | Python | 0 | @@ -0,0 +1,1705 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.dev20160603044730 on 2016-06-03 11:28%0Afrom __future__ import unicode_literals%0A%0Afrom django.conf import settings%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0A%0A%0Aclass Migration(migrations.Migration):%0A%0... | |
e7e8f28269e18aaabb0a2b56bd66c71e16f5bbf6 | Handle Ctrl-C more gracefully | tools/cr/cr/base/host.py | tools/cr/cr/base/host.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module for build host support."""
import os
import pipes
import subprocess
import cr
# Controls what verbosity level turns on command trail logging
_TR... | Python | 0.001469 | @@ -3065,24 +3065,37 @@
exit(1)%0A
+ try:%0A
output
@@ -3116,16 +3116,103 @@
icate()%0A
+ except KeyboardInterrupt:%0A p.terminate()%0A p.wait()%0A exit(1)%0A
if
|
4e1062ea02ccd99940da18a887e2092b0a9e5650 | add basic test | scripts/cli/test_service_mdns-repeater.py | scripts/cli/test_service_mdns-repeater.py | Python | 0.000001 | @@ -0,0 +1,1754 @@
+#!/usr/bin/env python3%0A#%0A# Copyright (C) 2020 VyOS maintainers and contributors%0A#%0A# This program is free software; you can redistribute it and/or modify%0A# it under the terms of the GNU General Public License version 2 or later as%0A# published by the Free Software Foundation.%0A#%0A# This ... | |
abac63b3ac4646af52ae7cc2a3cf90c180db9ff1 | Create views2.py | app/views2.py | app/views2.py | Python | 0 | @@ -0,0 +1,869 @@
+from flask import Flask%0Afrom flask import render_template%0Afrom flask import request, redirect%0Afrom flask import json, jsonify%0A%0Afrom flask import make_response%0A%0Aapp = Flask(__name__)%0Aglobal email%0A%0A#renders the main website using the index template.html template%0A@app.route('/')%0A... | |
f770299a4de9e18c84fe67c3235b82066a9a98c2 | Create boids_init.py | src/boids_init.py | src/boids_init.py | Python | 0.000366 | @@ -0,0 +1,494 @@
+def Agents_Init(n):%0A Boids_population=%5B%5D#agent population list%0A%0A for i in range(len(n)):%0A #instantiate the boid class%0A #float(u0)%0A #float(v0)%0A pos_init= n%5Bi%5D%0A t,u0,v0 = Terrain.ClosestPoint(pos_init)%0A pos_init = Terrain.PointAt... | |
53d0d5886670ba33a645fd8c82479fb4495d25d1 | Add new migrations (use "" as default for hash) | website/migrations/0002_auto_20150118_2210.py | website/migrations/0002_auto_20150118_2210.py | Python | 0.000001 | @@ -0,0 +1,881 @@
+# -*- 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 ('website', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AddField(%0A ... | |
b2f8575ae48aee6538f4f2dc73d33de0ddc094b1 | Change offline tester responses to 404 instead of 500. | openhtf/frontend/server/stations.py | openhtf/frontend/server/stations.py | # Copyright 2014 Google Inc. 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 agre... | Python | 0 | @@ -1849,32 +1849,83 @@
%0A if not data
+ or self.GetStationMap()%5Bstation_name%5D == 'OFFLINE'
:%0A return R
|
7e8f110610c6c4d02b042a1f47a7385c0d18c3bb | Create LeetCode-ReverseBits.py | LeetCode-ReverseBits.py | LeetCode-ReverseBits.py | Python | 0.000001 | @@ -0,0 +1,478 @@
+%22%22%22%0AReverse bits of a given 32 bits unsigned integer.%0A%0AFor example, given input 43261596 (represented in binary as 00000010100101000001111010011100), %0Areturn 964176192 (represented in binary as 00111001011110000010100101000000).%0A%22%22%22%0A%0Aclass Solution(object):%0A def reverse... | |
322a7907c6dbd6f742b19161869d46a13fb691d8 | convert pkl to raw | src/pkl_to_raw.py | src/pkl_to_raw.py | Python | 0.999999 | @@ -0,0 +1,865 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%22%22%22%0AModule is used for converting data from pkl format to raw.%0A%22%22%22%0Aimport argparse%0A%0Aimport misc%0Aimport qmisc%0A%0Adef main():%0A%0A parser = argparse.ArgumentParser(description=__doc__) # 'Simple VTK Viewer')%0A%0A parser... | |
a76a9bf10450eb7f5f69eb2264f75c0cd3a4d283 | Add example | examples/plt.py | examples/plt.py | Python | 0.000003 | @@ -0,0 +1,666 @@
+#!/usr/bin/python%0A%0Aimport matplotlib.pyplot as pyplot%0A%0Afrom pylatex import Document, Section, Plt%0A%0A%0A%0Aif __name__ == '__main__':%0A x = %5B0, 1, 2, 3, 4, 5, 6%5D%0A y = %5B15, 2, 7, 1, 5, 6, 9%5D%0A %0A pyplot.plot(x, y)%0A %0A doc = Document('matplolib_pdf')%0A do... | |
a57157352e40439ba4155eaa4a62ba7d62c793dc | Add ielex/lexicon/migrations/0090_issue_236.py | ielex/lexicon/migrations/0090_issue_236.py | ielex/lexicon/migrations/0090_issue_236.py | Python | 0 | @@ -0,0 +1,3063 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0Afrom django.db.models import Max%0A%0Afrom datetime import datetime%0A%0A%0Adef forwards_func(apps, schema_editor):%0A '''%0A Computes statistics for https://github.com/lingdb/CoBL/issues/... | |
d6e12d64341fbdc4fc0fdfc9792de9310ac6d2ff | Add "dsl" library. | src/puzzle/dsl.py | src/puzzle/dsl.py | Python | 0 | @@ -0,0 +1,164 @@
+%22%22%22This module is automatically imported into jupyter sessions.%22%22%22%0A%0Afrom puzzle.puzzlepedia import puzzlepedia%0A%0Asolve = puzzlepedia.parse%0Aparse = puzzlepedia.parse%0A
| |
05f9717d4f7ef1f2a4bfeec382cc30d311b1fd21 | Create cat_dog.py | Python/CodingBat/cat_dog.py | Python/CodingBat/cat_dog.py | Python | 0.999992 | @@ -0,0 +1,261 @@
+# http://codingbat.com/prob/p164876%0A%0Adef cat_dog(str):%0A cat_count = 0%0A dog_count = 0%0A %0A for i in range(len(str)-2):%0A if str%5Bi:i+3%5D == %22cat%22:%0A cat_count += 1%0A elif str%5Bi:i+3%5D == %22dog%22:%0A dog_count += 1%0A %0A return (cat_count == dog_count)%... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.