commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
f45b31b9d242ec85f66508f19b7b3561fb5ee165 | Set development status: Production/Stable | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import codecs
extra = {}
tests_require = ["nose", "nose-cover3"]
if sys.version_info >= (3, 0):
extra.update(use_2to3=True)
elif sys.version_info <= (2, 6):
tests_require.append("unittest2")
elif sys.version_info <= (2, 5):
tests_require.ap... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import codecs
extra = {}
tests_require = ["nose", "nose-cover3"]
if sys.version_info >= (3, 0):
extra.update(use_2to3=True)
elif sys.version_info <= (2, 6):
tests_require.append("unittest2")
elif sys.version_info <= (2, 5):
tests_require.ap... | Python | 0 |
81418934093eb1eb20862e7fb9f97d6bfbc3cf10 | add setup.py | setup.py | setup.py | #!/usr/bin/python
"""Multiple dispatcher on arguments values."""
from setuptools import setup
long_description = """
# dispatk
## Description
This function is inspired by singledispatch of Python 3.4+ (PEP 443),
but the dispatch happens on the key extracted fro the arguments values.
```
from dispatk import dispatk
... | Python | 0.000001 | |
0350dcce8a95df0c04748529b82c1a486d2d4148 | Add setup script, to automatically produce distributable packages | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
import sys, os, os.path
version = "0.5.1"
### this manifest enables the standard Windows XP-looking theme
##manifest = """
##<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
##<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
##manifestVersion... | Python | 0.000004 | |
af76038a7cbaa076b3fe0b57145a2fc72bc50b7b | Add basic setup script | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='Numspell',
version='0.9',
description='A Python module for spelling numbers',
author='Alexei Sholik',
author_email='alcosholik@gmail.com',
url='https://github.com/alco/numspell',
license="MIT",
packages=['nums... | Python | 0.000001 | |
4bf0cdffbdd7b5e86ef52e48209d5cb510c38722 | Add tests for the plugin | ckanext/oauth2/tests/test_plugin.py | ckanext/oauth2/tests/test_plugin.py | import unittest
import ckanext.oauth2.plugin as plugin
from mock import MagicMock, ANY
from nose_parameterized import parameterized
class PluginTest(unittest.TestCase):
def setUp(self):
self._plugin = plugin.OAuth2Plugin()
# Save functions and mock them
self._config = plugin.config
... | Python | 0.000001 | |
b05ede554c403bb3d03dbe65b02baa2a879f3310 | Add pretty-printers for qi::Buffer | tools/printers.py | tools/printers.py | """Pretty printers for libqi.
Add python execfile("/path/to/this/file") in your ~/.gdbinit or /etc/gdb/gdbinit
Your gdb need to be compile with python and version > 7.0
"""
import gdb
import gdb.types
class QiBufferPrinter:
def __init__(self, val):
self.val = val
def to_string(self):
buf = se... | Python | 0.00001 | |
9df8506f86c1f6e95b6c9d0bda2dd8001dc0459b | Disable maxAudioWithBaselineShift test (works locally but not on travis) | test/client/dynamic_energy_test.py | test/client/dynamic_energy_test.py | import unittest
import audioop
from speech_recognition import AudioSource
from mycroft.client.speech.mic import ResponsiveRecognizer
__author__ = 'seanfitz'
class MockStream(object):
def __init__(self):
self.chunks = []
def inject(self, chunk):
self.chunks.append(chunk)
def read(self, c... | import unittest
import audioop
from speech_recognition import AudioSource
from mycroft.client.speech.mic import ResponsiveRecognizer
__author__ = 'seanfitz'
class MockStream(object):
def __init__(self):
self.chunks = []
def inject(self, chunk):
self.chunks.append(chunk)
def read(self, c... | Python | 0 |
8cdf49b093e6fe95570fe4f8c9c488bc8755d83f | Create dust_gp2y1010.py | apps/dust/dust_gp2y1010.py | apps/dust/dust_gp2y1010.py | import time
import sys
#import adc_mcp3008
sys.path.append("../adc")
sys.path.append("../../../../thingsweb/weblib/recv")
sys.path.append("../../../log_lib")
from adc_mcp3008 import *
from lastvalue import *
from raspi_log import *
import requests, json
import fcntl, socket, struct
import RPi.GPIO as GPIO
# Please ch... | Python | 0.000223 | |
84ae11ed02eabcc9c00167c710d9eb4e8462e7b0 | Create router.py | router.py | router.py | import jnettool.tool.elements.NetworkElements
import jnettool.tool.Routing
import jnettool.tool.RouteInspector
ne = jnettool.tools.elements.NetworkElements('ip')
try
routing_tableb = ne.getRoutingTable()
except jnettool.tools.elements.MissingVar:
logging.exception('No routing_tableb found')
ne.cleanup... | Python | 0.000002 | |
5662e4277c77dc3be308934a1e389cf24259037a | Create remap.py | remap.py | remap.py | #!/usr/bin/env python
#Licence LGPL v2.1
#Creates copy of map db, leaving only specified(filtered) blocks.
#Can also be used for map backup, may-be even online backup.
import sqlite3
import mt_block_parser
import re
def getIntegerAsBlock(i):
x = unsignedToSigned(i % 4096, 2048)
i = int((i - x) / 4096)
y... | Python | 0 | |
a049ecd3c3d46f42d145d6d02a9f4f100ab3f4d9 | Create rules_cc.bzl for TSL | tensorflow/tsl/platform/rules_cc.bzl | tensorflow/tsl/platform/rules_cc.bzl | """Provides an indirection layer to bazel cc_rules"""
load(
"//tensorflow/tsl/platform/default:rules_cc.bzl",
_cc_binary = "cc_binary",
_cc_import = "cc_import",
_cc_library = "cc_library",
_cc_shared_library = "cc_shared_library",
_cc_test = "cc_test",
)
cc_binary = _cc_binary
cc_import = _cc... | Python | 0 | |
6d5f1afdfe963a927e510a9a2e044fbd4796184f | add tests for cliff, arete, ridge, valley | test/601-cliff-arete-ridge-valley.py | test/601-cliff-arete-ridge-valley.py | #cliff in Yosemite
assert_has_feature(
13, 1374, 3166, "earth",
{"kind": "cliff", "id": 291684864,
"sort_key": 227})
#arete in Yosemite
assert_has_feature(
13, 1379, 3164, "earth",
{"kind": "arete", "id": 375271242,
"sort_key": 228})
#ridge with name in Santa Cruz Mountains, California
asser... | Python | 0.000008 | |
918723bb1cbaea66358bd0701728bfb89fa6f00c | add servo_SG90.py | code/servo_SG90.py | code/servo_SG90.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# servo_SG90.py
# author: Kentaro Wada <www.kentaro.wada@gmail.com>
import time
from RPi import GPIO
def move_pos(pin, deg, speed):
"""
(int) deg: 0 - 60 [deg]
(float) speed: -1 - 1
"""
t_start = time.time()
duration = 0.1 * deg / 60
wh... | Python | 0.000006 | |
d31ee1207292e1b6c9f874b500837f91e477728c | Create sender.py | sender.py | sender.py | """IMAGE_ID="" #Paste image ID here
FLAVOR_ID="" #Paste Flavor_ID here
SSH_KEY="" #Paste key name here - Assuming key already exists"""
from wsgiref.simple_server import make_server
import json
def createvm(ip,instance_name,image_id,flavor_id,ssh_key=None):
"""Creates an instance remotely"""
if ssh_key==None:
pri... | Python | 0.000004 | |
ff8c866675d8eece3c527a245ec17520f357203e | test the `fastfood` command | tests/functional/test_entry_point.py | tests/functional/test_entry_point.py | """Functional tests for command line use."""
import subprocess
import unittest
class TestFastfoodCLI(unittest.TestCase):
def test_fastfood_command_is_there(self):
cmd = ['fastfood', '--help']
try:
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except (subprocess.Call... | Python | 0.999995 | |
ff151c8ea04268d2060cf8d281294a0d500ecbba | Test that data volumes now survive a crash when recreating | tests/integration/resilience_test.py | tests/integration/resilience_test.py | from __future__ import unicode_literals
from __future__ import absolute_import
import mock
from compose.project import Project
from .testcases import DockerClientTestCase
class ResilienceTest(DockerClientTestCase):
def test_recreate_fails(self):
db = self.create_service('db', volumes=['/var/db'], comman... | Python | 0 | |
588d2627dee336efdf44862ab31bbbd896aad912 | Add basic tests for several permission types | tests/sentry/api/test_permissions.py | tests/sentry/api/test_permissions.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from sentry.api.permissions import has_perm
from sentry.constants import MEMBER_USER, MEMBER_ADMIN
from sentry.testutils import TestCase
class TeamPermissionTest(TestCase):
def test_basic_user(self):
user = self.create_user(is_superuser=Fals... | Python | 0 | |
4606d80a6103fd7d358e0a8fb5a537c2a1e3f72b | Tweak doc generation script a bit. | script/generate_docs.py | script/generate_docs.py | #!/usr/bin/env python
import glob
import markdown
import os
import shutil
import sys
import time
from datetime import datetime
def is_up_to_date(path, out_path):
# See if it's up to date.
source_mod = os.path.getmtime(path)
source_mod = max(source_mod, os.path.getmtime('doc/site/template.html'))
dest_mod = 0... | #!/usr/bin/env python
import glob
import markdown
import os
import shutil
import sys
import time
from datetime import datetime
def compare_modification_times(path, out_path):
# See if it's up to date.
source_mod = os.path.getmtime(path)
source_mod = max(source_mod, os.path.getmtime('doc/site/template.html'))
... | Python | 0 |
bb48a8a9a763e594efa06b397d7731f25cedd65d | add parallel perceptron | src/learn/spark_perceptron.py | src/learn/spark_perceptron.py | from __future__ import division
import logging
import multiprocessing
from hvector._mycollections import mydefaultdict
from hvector.mydouble import mydouble
from weight.weight_vector import *
# Time accounting and control
import debug.debug
import time
import sys
from pyspark import SparkContext
logging.basicConfig(... | Python | 0.999907 | |
33a0b48ec475ec02f60ed27e572709136515763a | Create maxdiff.py | maxdiff.py | maxdiff.py | __author__ = 'sebastiengenty'
import numpy as np
import pandas as pd
# This program is made to take the utilities from a MaxDiff estimation and compute the relative importances for
# the attributes tested. Input for now is .csv though also working on a .xlsx solution.
def avg_imp(utilities_file, filter_var='none', ... | Python | 0 | |
1902351fc88c1e18b4d8de032ff2aa8da547dac0 | Bump nydus testing requirement to 0.9.0 | setup.py | setup.py | #!/usr/bin/env python
"""
Sentry
======
Sentry is a realtime event logging and aggregation platform. It specializes
in monitoring errors and extracting all the information needed to do a proper
post-mortem without any of the hassle of the standard user feedback loop.
Sentry is a Server
------------------
The Sentry ... | #!/usr/bin/env python
"""
Sentry
======
Sentry is a realtime event logging and aggregation platform. It specializes
in monitoring errors and extracting all the information needed to do a proper
post-mortem without any of the hassle of the standard user feedback loop.
Sentry is a Server
------------------
The Sentry ... | Python | 0 |
3d5787cd860b1b3baaa041e49efe6d4af09396ac | Add migrations package to setup.py | setup.py | setup.py | from distutils.core import setup
setup(
name='django-auditlog',
version='0.2.1',
packages=['auditlog', 'auditlog.migrations'],
package_dir={'': 'src'},
url='https://github.com/jjkester/django-auditlog',
license='MIT',
author='Jan-Jelle Kester',
author_email='janjelle@jjkester.nl',
d... | from distutils.core import setup
setup(
name='django-auditlog',
version='0.2.1',
packages=['auditlog',],
package_dir={'': 'src'},
url='https://github.com/jjkester/django-auditlog',
license='MIT',
author='Jan-Jelle Kester',
author_email='janjelle@jjkester.nl',
description='Audit log ... | Python | 0.000001 |
5515fc7207404013ea9ba655b29bc414320971d9 | add setup.py | setup.py | setup.py | from setuptools import setup
setup(name='optimizely',
version='0.1',
description='An interface to Optimizely\'s REST API.',
url='https://github.com/optimizely/optimizely-client-python',
author='Optimizely',
packages=['optimizely'],
install_requires=[
'requests',
],
... | Python | 0.000001 | |
3ca6447572f165a2de59d8420d7b853158b0ed66 | Add test cases for segment. | tests/test/xie/graphics/segment.py | tests/test/xie/graphics/segment.py | import unittest
import copy
from xie.graphics.segment import BeelineSegment
from xie.graphics.segment import QCurveSegment
from xie.graphics.segment import StrokePath
from xie.graphics.segment import SegmentFactory
class SegmentTestCase(unittest.TestCase):
def setUp(self):
self.segmentFactory = SegmentFactory()
... | Python | 0 | |
6f7abe8ea3e08ad15adab85c947ad4667e3dd3ab | Add simplejson requirement to setup | setup.py | setup.py | #!/usr/bin/env python
"""
Installation script:
To release a new version to PyPi:
- Ensure the version is correctly set in oscar.__init__.py
- Run: python setup.py sdist upload
"""
from setuptools import setup, find_packages
from oscar import get_version
setup(name='django-oscar',
version=get_version().replac... | #!/usr/bin/env python
"""
Installation script:
To release a new version to PyPi:
- Ensure the version is correctly set in oscar.__init__.py
- Run: python setup.py sdist upload
"""
from setuptools import setup, find_packages
from oscar import get_version
setup(name='django-oscar',
version=get_version().replac... | Python | 0 |
a5495900bdc273f59395d4283eb0b6c3700b9630 | add unit tests for annotations | tests/test_annotations.py | tests/test_annotations.py | import unittest
import os
import glob
from medleydb import ANNOT_PATH
from medleydb.utils import load_track_list
class TestFileNames(unittest.TestCase):
def setUp(self):
self.track_list = load_track_list()
self.folders = set(
glob.glob(os.path.join(ANNOT_PATH, "*_ANNOTATIONS"))
... | Python | 0 | |
b16f666af5e7dd1e2201e8e57c0590933b5b73e9 | Add setup script | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='gymz',
version='0.0.1',
author='Jakob Jordan, Philipp Weidel',
author_email='j.jordan@fz-juelich.de',
description=('A light-weight ZMQ wrapper for the OpenAI Gym.'),
license='MIT',
keywords='openai-gym reinforcement-learning ... | Python | 0.000001 | |
9dc0619d6528e9fbef328faf56a982d4af7379ba | Prepare for Jinja 2.5.3 | setup.py | setup.py | # -*- coding: utf-8 -*-
"""
Jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
`Django`_ inspired non-XML syntax but supports inline expressions and
an optional `sandboxed`_ environment.
Nutshell
--------
Here a small example of a Jinja template::
{% extends 'base.html' %}
{% b... | # -*- coding: utf-8 -*-
"""
Jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
`Django`_ inspired non-XML syntax but supports inline expressions and
an optional `sandboxed`_ environment.
Nutshell
--------
Here a small example of a Jinja template::
{% extends 'base.html' %}
{% b... | Python | 0 |
713e715fb3657a274f60c687eec60bad0d9c7da9 | Update synth.py yaml location (#6480) | container/synth.py | container/synth.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 |
8e175782c3b79e64d543fb478b146d308d2a2ad8 | Add small python script which calculates how much disk space we save by using CAS | bin/oneoffs/cas_statistic.py | bin/oneoffs/cas_statistic.py | import os
import pymongo
from collections import Counter
db_uri = os.getenv('SCITRAN_PERSISTENT_DB_URI', 'localhost:9001')
db = pymongo.MongoClient(db_uri).get_database('scitran')
COLLECTIONS = ['projects', 'acquisitions', 'analyses']
COLLECTIONS_WITH_EMBEDDED = [('sessions', 'subject')]
def files_of_collection(col... | Python | 0.000001 | |
04a24befbaba975720acf5533bc97e7b3d601672 | Install script. | setup.py | setup.py | #!/usr/bin/env python
# Copyright (c) 2012 SEOmoz
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge... | Python | 0 | |
9afb9954f5d58fe051f60bd336a39d794699d405 | add a demo that plots a comparison of threshold types | demo/plot_thresholds.py | demo/plot_thresholds.py | import numpy as np
import matplotlib.pyplot as plt
import pywt
s = np.linspace(-4, 4, 1000)
s_soft = pywt.threshold(s, value=0.5, mode='soft')
s_hard = pywt.threshold(s, value=0.5, mode='hard')
s_garotte = pywt.threshold(s, value=0.5, mode='garotte')
s_firm1 = pywt.threshold_firm(s, value_low=0.5, value_high=1)
s_fir... | Python | 0 | |
e1b32cdd95c8a11cb492d27d9ac11a46c4037f2e | Add setup.py | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import rdd
setup(name='rdd',
version=rdd.__version__,
author='Mathias Lafeldt',
author_email='mathias.lafeldt@gmail.com',
url='https://github.com/mlafeldt/rdd.py',
license='MIT',
description='Python implementation ... | Python | 0.000001 | |
d78e3ba37cb2c88300d1e96010e79c6e4329f720 | bump version to 0.3 | setup.py | setup.py | from setuptools import setup, find_packages
setup(name='hubstorage',
version='0.3',
license='BSD',
description='Client interface for Scrapinghub HubStorage',
author='Scrapinghub',
author_email='info@scrapinghub.com',
url='http://scrapinghub.com',
platforms = ['Any'],
pac... | from setuptools import setup, find_packages
setup(name='hubstorage',
version='0.2',
license='BSD',
description='Client interface for Scrapinghub HubStorage',
author='Scrapinghub',
author_email='info@scrapinghub.com',
url='http://scrapinghub.com',
platforms = ['Any'],
pac... | Python | 0 |
9238e229c63b32e35b46508959450e97901b46ab | Add package setup. | setup.py | setup.py | import glob
from distutils.core import setup
requires = ['pydicom']
setup(
name = 'qipipe',
version = '1.1.1',
author = 'Fred Loney',
author_email = 'loneyf@ohsu.edu',
packages = find_packages('lib'),
package_dir = {'':'lib'}
scripts = glob.glob('bin/*'),
url = 'http://quip1.ohsu.edu/... | Python | 0 | |
cd596bd419352d95fb31aab7116a1dddb061828c | add a setup.py for the trait_documenter package | setup.py | setup.py | #----------------------------------------------------------------------------
#
# Copyright (c) 2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in /LICENSE.txt and may be redistributed only
# under the conditions described in... | Python | 0 | |
d611af5a613e444c0c31c269aa382f0996c375d9 | Add setup.py from h3's fork | setup.py | setup.py | """
django-jquery-file-upload
"""
from setuptools import setup, find_packages
setup(
name = "django-jquery-file-upload",
version = "0.0.1",
url = "",
license = "The MIT License (MIT)",
description = "A minimal django project containing a minimal app with a working jquery file upload form based on ... | Python | 0 | |
5ce21100b42dad13815d21cd3fae9a2710756314 | add setup.py | setup.py | setup.py | #!/usr/bin/env python
"""
Created by: Lee Bergstrand (2018)
Description: Setup for installing pygenprop.
"""
from setuptools import setup
setup(name='pygenprop',
version='0.1',
description='A python library for programmatic usage of EBI InterPro Genome Properties.',
url='https://github.com/Microme... | Python | 0.000001 | |
b9a23638d4cf6cc692a2dce3d42268ca73343493 | Add setup.py | setup.py | setup.py | #!/usr/bin/env python
# coding=utf-8
from setuptools import setup
setup(
name='alfred-workflow-packager',
version='0.8b',
description='A CLI utility for packaging and exporting Alfred workflows',
url='https://github.com/caleb531/alfred-workflow-packager',
author='Caleb Evans',
author_email='ca... | Python | 0.000001 | |
8124ad701f11aad4e127e26fb34e850b80e03bdf | Add compare_to_sim | compare_to_sim.py | compare_to_sim.py | # -*- coding: utf-8 -*-
"""
Created on Thu May 21 17:55:00 2015
@author: weber
"""
import numpy as np
import matplotlib.pyplot as plt
from glob import glob
from pressure_traces import copy
simdata = np.genfromtxt('export.csv', delimiter=',', skip_header=1)
simtime = simdata[:, 0]
simvolume = simdata[:, 1]
simtemperat... | Python | 0.000007 | |
d952b1b42ad82d40b0eb741f189d2525b73e2d19 | add basic configuration | setup.py | setup.py | from distutils.core import setup
setup(name='distance_matrix',
author='Harrison Shoebridge',
author_email='harrison@theshoebridges.com',
description='A small wrapper around the google distance matrix api',
version='0.1',
py_modules=['distance_matrix'])
| Python | 0.000006 | |
39b27532e79f27612bbae0b748ef91d89a429b84 | Exclude buggy setuptools-scm version | setup.py | setup.py | # -*- coding: utf-8 -*-
'''
Vdirsyncer synchronizes calendars and contacts.
Please refer to https://vdirsyncer.pimutils.org/en/stable/packaging.html for
how to package vdirsyncer.
'''
from setuptools import Command, find_packages, setup
requirements = [
# https://github.com/mitsuhiko/click/issues/200
'clic... | # -*- coding: utf-8 -*-
'''
Vdirsyncer synchronizes calendars and contacts.
Please refer to https://vdirsyncer.pimutils.org/en/stable/packaging.html for
how to package vdirsyncer.
'''
from setuptools import Command, find_packages, setup
requirements = [
# https://github.com/mitsuhiko/click/issues/200
'clic... | Python | 0.000157 |
1805e9cc2e2aeb3770b03ebcb05ac189566fa165 | add setup.py | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='memozo',
version="0.1.0",
description='Memotize objects to desk easily',
author='sotetsuk',
url='https://github.com/sotetsuk/memozo',
author_email='sotetsu.koyamada@gmail.com',
license='MIT',
install_requires=[],
packages=find... | Python | 0.000001 | |
37dcd46678ca8f22640aa314b174fda78be5392d | Bump version number | setup.py | setup.py | """
Flask-MongoEngine
--------------
Flask support for MongoDB using MongoEngine.
Includes `WTForms`_ support.
Links
`````
* `development version
<https://github.com/sbook/flask-mongoengine/raw/master#egg=Flask-MongoEngine-dev>`_
"""
from setuptools import setup
setup(
name='Flask-MongoEngine',
version=... | """
Flask-MongoEngine
--------------
Flask support for MongoDB using MongoEngine.
Includes `WTForms`_ support.
Links
`````
* `development version
<https://github.com/sbook/flask-mongoengine/raw/master#egg=Flask-MongoEngine-dev>`_
"""
from setuptools import setup
setup(
name='Flask-MongoEngine',
version=... | Python | 0.000002 |
dbe16470f596ee53ec18975afca4aa0605b9b1bc | Add setup.py. | setup.py | setup.py | #!/usr/bin/env python3
try:
from setuptools.core import setup
except ImportError:
from distutils.core import setup
from pip.req import parse_requirements
from pip.download import PipSession
import os
def get_file_path(name):
return os.path.abspath(os.path.join(
os.path.dirname(__file__),
n... | Python | 0 | |
d8dd594c2ce0defa430f5a7e873c87491c7aab47 | Allow hyperframe 5 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Get the version
version_regex = r'__version__ = ["\']([^"\']*)["\']'
with open('h2/__init__.py', 'r') as f:
text = f.read()
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Get the version
version_regex = r'__version__ = ["\']([^"\']*)["\']'
with open('h2/__init__.py', 'r') as f:
text = f.read()
... | Python | 0.000022 |
5e98fe8b6ac368e29d739a2dfa690fdea01382ca | Bring back setup.py | setup.py | setup.py | from codecs import open
import os
import os.path
from setuptools import find_packages, setup
here = os.path.relpath(os.path.abspath(os.path.dirname(__file__)))
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as fd:
long_description = fd.read()
__version__ = '2.2.1'
setup(
name='ichnaea',
... | Python | 0 | |
95c8e291fe1f89e1d880deff34c6e0aa98f6fdf2 | Package description for setuptools. | setup.py | setup.py | # Copyright (c) 2009 Shrubbery Software
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... | Python | 0 | |
62439e5c8f174752cd5774c3f240b7cc8fa158ad | add packaging boilerplate | setup.py | setup.py | from setuptools import setup, find_packages
INFO = {'name': 'mecode',
'version': '0.0.1',
}
setup(
name=INFO['name'],
version=INFO['version'],
author='Jack Minardi',
packages=find_packages(),
zip_safe=False,
maintainer='Jack Minardi',
maintainer_email='jack@minardi.org',
)
| Python | 0.000001 | |
f6b9a0c75a3b5b37b74856226c8210717def606f | Implement astroid trajectory | src/trajectory/astroid_trajectory.py | src/trajectory/astroid_trajectory.py | #!/usr/bin/env python
from math import cos, pi, sin
from .trajectory import Trajectory
class AstroidTrajectory(object, Trajectory):
def __init__(self, radius, period):
Trajectory.__init__(self)
self.radius = radius
self.period = period
def get_position_at(self, t):
super(Astr... | Python | 0.000037 | |
a9091a140ff158b79b05da5c20e18a0f1368d3d9 | add missing package init file | backend/src/gosa/backend/plugins/two_factor/filter/__init__.py | backend/src/gosa/backend/plugins/two_factor/filter/__init__.py | # This file is part of the GOsa project.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
__import__('pkg_resources').declare_namespace(__name__)
| Python | 0.000001 | |
846ec085ff7bc1f5be250ac1ac2df87534bbc5c9 | add gunicorn.conf.py | deploy/gunicorn.conf.py | deploy/gunicorn.conf.py | import os
def numCPUs():
if not hasattr(os, "sysconf"):
raise RuntimeError("No sysconf detected.")
return os.sysconf("SC_NPROCESSORS_ONLN")
workers = numCPUs() * 2 + 1
bind = "127.0.0.1:8000"
pidfile = "/tmp/gunicorn-demo.pid"
backlog = 2048
logfile = "/home/linventifatelier/earthbuilding/log/gunicorn... | Python | 0.000003 | |
5574ddd6aaf6ab041bdb186b1455792bff803731 | Add range to ConditionFactory | src/oscar/test/factories/offer.py | src/oscar/test/factories/offer.py | import factory
from oscar.core.loading import get_model
__all__ = [
'RangeFactory', 'ConditionFactory', 'BenefitFactory',
'ConditionalOfferFactory',
]
class RangeFactory(factory.DjangoModelFactory):
name = factory.Sequence(lambda n: 'Range %d' % n)
slug = factory.Sequence(lambda n: 'range-%d' % n)
... | import factory
from oscar.core.loading import get_model
__all__ = [
'RangeFactory', 'ConditionFactory', 'BenefitFactory',
'ConditionalOfferFactory',
]
class RangeFactory(factory.DjangoModelFactory):
name = factory.Sequence(lambda n: 'Range %d' % n)
slug = factory.Sequence(lambda n: 'range-%d' % n)
... | Python | 0 |
710150538efcb56f2b8e968c58707ce2bbe8431b | add script to fill in ltr termini | bin/fillTermini.py | bin/fillTermini.py | #!/usr/bin/env python
#Copyright (C) 2014 by Glenn Hickey
#
#Released under the MIT license, see LICENSE.txt
import sys
import os
import argparse
import copy
from pybedtools import BedTool, Interval
"""
Stick a bed interval between pairs of lastz termini. Script written to be used
in conjunction with tsdFinder.py:
... | Python | 0 | |
eb8354c67e20aca10e0118efcbd8afb98bbb7dde | add missing kde.py | bomeba0/visualization/kde.py | bomeba0/visualization/kde.py | """One-dimensional kernel density estimate plots."""
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import gaussian, convolve, convolve2d # pylint: disable=no-name-in-module
from scipy.sparse import coo_matrix
from scipy.stats import entropy
def plot_kde(values, values2=None, contour=True, ax=N... | Python | 0.001515 | |
418a2104ec20a0b8f651320c1cbea10a533dc44d | Add tools/sys-tools/gdb/cmd_example.py | tools/sys-tools/gdb/cmd_example.py | tools/sys-tools/gdb/cmd_example.py | import gdb
class SavePrefixCommand (gdb.Command):
'''
Save the current breakpoints to a file.
This command takes a single argument, a file name.
The breakpoints can be restored using the 'source' command.
'''
def __init__(self):
super(SavePrefixCommand, self).__init__ ("save breakpoint... | Python | 0.000001 | |
61677566ce685379456e7853c69a78ea32353422 | Add auto fixture to make sure that output dir does not exists when tests are run | static_precompiler/tests/conftest.py | static_precompiler/tests/conftest.py | from static_precompiler.settings import ROOT, OUTPUT_DIR
import shutil
import os
import pytest
@pytest.fixture(autouse=True)
def _no_output_dir(request):
""" Make sure that output dir does not exists. """
path = os.path.join(ROOT, OUTPUT_DIR)
if os.path.exists(path):
shutil.rmtree(path)
def... | Python | 0 | |
6a6a76ff5274b01ae8570ae7b1a4153b8705100f | move worker func | streammorphology/freqmap/mpi_util.py | streammorphology/freqmap/mpi_util.py | # coding: utf-8
""" Utilities for running frequency mapping with MPI (map) """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os
from collections import OrderedDict
# Third-party
import numpy as np
from astropy.utils import isiterable
# Proj... | Python | 0.00002 | |
422b9458d26866b9f6692ddb0ccf2305c3ac6ea7 | Add an extra file to the surrogates experiments. | dev/surrogates/plots.py | dev/surrogates/plots.py | import darch.search_logging as sl
import darch.visualization as vi
import numpy as np
import seaborn as sns; sns.set()
# checking these across time.
log_lst = sl.read_search_folder('./logs/cifar10_medium/run-0')
xkey = 'epoch_number'
ykey = 'validation_accuracy'
num_lines = 8
time_plotter = vi.LinePlot(xlabel='time_in... | Python | 0 | |
2bcf71638dba9a252378c251bbd32e6f72f74028 | Add integration test | test/integration/smoke/test_pvlan.py | test/integration/smoke/test_pvlan.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 0 | |
0e2c7c255043d7ccc5042a8e4905557f2d43e2ca | Add Mandrill backend | templated_email/backends/mandrill.py | templated_email/backends/mandrill.py | import vanilla_django
from django.core.mail import EmailMessage
from django.conf import settings
from django.utils.translation import ugettext as _
# Make sure you have Mandrill as your email backend
class TemplateBackend(vanilla_django.TemplateBackend):
def __init__(self, *args, **kwargs):
vanilla_django... | Python | 0 | |
8da12f8f269746b086f5d208afb390e304f12e9b | Add stub for submit_glue.py | metal/mmtl/submit_glue.py | metal/mmtl/submit_glue.py | import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Evaluate a model and make glue submission bundle", add_help=False
)
parser.add_argument("-mf", "--model-file")
args = parser.parse_args()
| Python | 0 | |
e1f8358e09cd3299effc112544206361d5a6c7dd | Add migration for latest-ing | refugee_manager/migrations/0003_auto_20141108_1609.py | refugee_manager/migrations/0003_auto_20141108_1609.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('refugee_manager', '0002_volunteer_mailing_address'),
]
operations = [
migrations.AlterModelOptions(
name='assess... | Python | 0 | |
7bcc6b343d53830e52b466558e27137dc55b0472 | Allow field types in mezzanine.forms to be used in mezzanine.core without the forms app actually being installed. Closes #791. | mezzanine/forms/fields.py | mezzanine/forms/fields.py |
from django.core.exceptions import ImproperlyConfigured
from django import forms
from django.forms.extras import SelectDateWidget
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.forms import SplitSelectDateTimeWidget
from mezzanine.utils.importing import... |
from django.core.exceptions import ImproperlyConfigured
from django import forms
from django.forms.extras import SelectDateWidget
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.forms import SplitSelectDateTimeWidget
from mezzanine.utils.importing import... | Python | 0 |
660e0955979b7d11b7442a00747673700413bf1d | Add a test of spline filtering vs. matrix solving. | scipy/ndimage/tests/test_splines.py | scipy/ndimage/tests/test_splines.py | """Tests for spline filtering."""
from __future__ import division, print_function, absolute_import
import numpy as np
import pytest
from numpy.testing import assert_almost_equal
from scipy import ndimage
def get_spline_knot_values(order):
"""Knot values to the right of a B-spline's center."""
knot_values =... | Python | 0 | |
a49f4663bea796f5d496c849acb8cb99d6caf882 | Add pnf support for SVC_monitor | src/config/svc-monitor/svc_monitor/physical_machine_manager.py | src/config/svc-monitor/svc_monitor/physical_machine_manager.py | import uuid
from vnc_api.vnc_api import *
from instance_manager import InstanceManager
from config_db import ServiceApplianceSetSM, ServiceApplianceSM, PhysicalInterfaceSM
from cfgm_common import svc_info
class PhysicalMachineManager(InstanceManager):
def create_service(self, st, si):
if not self.validat... | Python | 0 | |
da0794fd63960fa8a836e27ab540cd9f8b8713d7 | Test program for issue #81 | unresolved_bugs/bug_81.py | unresolved_bugs/bug_81.py | # -*- coding: utf-8 -*-
"""
Aho-Corasick string search algorithm.
Author : Wojciech Muła, wojciech_mula@poczta.onet.pl
WWW : http://0x80.pl
License : public domain
"""
import os
import sys
import ahocorasick
try:
range = xrange # for Py2
except NameError:
pass
def get_memory_usa... | Python | 0 | |
1d4137d43f1b91400d1347d131f56b1698163337 | Create rockpaper.py | rockpaper.py | rockpaper.py | import players
def showdown(human_choice, computer_guess, h_obj, c_obj):
if (human_choice, computer_guess) == (1, 3):
print('Rock crushes scissors. Human Wins!')
print('-------------------------------------')
h_obj.add_to_score()
elif (human_choice, computer_guess) == (1, 2):
pr... | Python | 0.000159 | |
48fc7cad7eb4cec0b928aba3daca7e934d46d87c | Add unit tests for sdnvpn | functest/tests/unit/features/test_sdnvpn.py | functest/tests/unit/features/test_sdnvpn.py | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | Python | 0 | |
83265421a0de46860f181e04ac204a9579924ccf | Add tests for cdt types | test/new_tests/test_cdt_compators.py | test/new_tests/test_cdt_compators.py | # These fail if we don't have a new server
# -*- coding: utf-8 -*-
import pytest
import aerospike
from aerospike import exception as e
from aerospike_helpers.operations import list_operations as lo
from aerospike_helpers.operations import map_operations as map_ops
def get_list_result_from_operation(client, key, operat... | Python | 0 | |
35f19e61df4c14a2766709f6ab88f08e7fab9756 | add run_test | run_tests.py | run_tests.py | #!/usr/bin/env python
import sys
import pytest
if __name__ == '__main__':
# show output results from every test function
args = ['-v']
# show the message output for skipped and expected failure tests
args.append('-vrxs')
if len(sys.argv) > 1:
args.extend(sys.argv[1:])
print('pytest argu... | Python | 0.000001 | |
a91b633ba88a01b12305fdfafd570c0b3776b42d | Add a tool script to print errors statistics in output JSON files. | utils/print_num_errors.py | utils/print_num_errors.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make statistics on score files (stored in JSON files).
"""
import argparse
import json
import numpy as np
def parse_json_file(json_file_path):
with open(json_file_path, "r") as fd:
json_data = json.load(fd)
return json_data
def extract_data_list(j... | Python | 0 | |
4a06723a475fb6312196ea4e0a5ee47414a2c157 | add power_line, power_minor_line | integration-test/232-power-lines.py | integration-test/232-power-lines.py | from . import FixtureTest
class PowerLines(FixtureTest):
def test_power_line(self):
self.load_fixtures(['http://www.openstreetmap.org/way/29399873'])
self.assert_has_feature(
14, 2621, 6338, 'landuse',
{'id': 29399873, 'kind': 'power_line', 'min_zoom': 14, 'sort_rank': 27... | Python | 0.00001 | |
e2d72a20b241fe2dca1dad1eb391350460c06060 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/4efe74c2473de1220989199258b7a4924dd2a679. | 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 = "4efe74c2473de1220989199258b7a4924dd2a679"
TFRT_SHA256 = "76e8b79220d0d68362782b1877b279dacdaa0a9c4b3a80... | """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 = "ab36dc9c9829c8574b7760e98de18cc4d2b2eaf3"
TFRT_SHA256 = "afe45af9014fdf72e5a58cbfcea2c17522c7ce1a082c1a... | Python | 0.000003 |
e213d7e7ff026a88e5c54a67acce8c840db8465c | Add new ilightsln light support | homeassistant/components/light/ilightsln.py | homeassistant/components/light/ilightsln.py | """
Support for LimitlessLED bulbs.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.limitlessled/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.const import CONF_HOST, CONF_PORT, STATE_ON, STATE_UNAVAILABLE
from hom... | Python | 0 | |
0b47397b91fec94910f18ea1711184ecfd0f6bf0 | Add tests for file storage engine | jacquard/storage/tests/test_file.py | jacquard/storage/tests/test_file.py | from jacquard.storage.file import FileStore
def test_get_nonexistent_key():
# Just test this works without errors
store = FileStore(':memory:')
assert store.get('test') is None
def test_simple_write():
storage = FileStore(':memory:')
with storage.transaction() as store:
store['test'] = "... | Python | 0 | |
d56387ee3edb05aee87bb732fb60b9d3a5e8a94b | Add a simple setup.py script | setup.py | setup.py | #!/usr/bin/env python
USE_SETUPTOOLS = False
try:
from setuptools import setup, Extension
USE_SETUPTOOLS = True
except ImportError:
from distutils.core import setup, Extension
setup_kwargs = dict(
name='greendns',
description='''A module for providing greened DNS access via dnspython ''',
ver... | Python | 0.000001 | |
daf53c1d5564942651e5efac0d1daa9dbd7248f2 | Create setup.py | setup.py | setup.py | """Setup script for lechat."""
from setuptools import setup
setup()
| Python | 0.000001 | |
f02d51237443ce239ab44ef7bb38fb625cd0fac1 | Add generic main function setup to test env | setup.py | setup.py | #!/Applications/anaconda/envs/Python3/bin
def main():
print("Hello, World!")
if __name__ == '__main__':
main()
| Python | 0 | |
7938b647951bb83604c34ebf0932200e13913e35 | Bump version. | setup.py | setup.py | #!/usr/bin/env python
import sys
assert sys.version >= '2.5', "Requires Python v2.5 or above."
from distutils.core import setup
from setuptools import find_packages
setup(
name="django-loginas",
version="0.1.3",
author="Stochastic Technologies",
author_email="info@stochastictechnologies.com",
url=... | #!/usr/bin/env python
import sys
assert sys.version >= '2.5', "Requires Python v2.5 or above."
from distutils.core import setup
from setuptools import find_packages
setup(
name="django-loginas",
version="0.1.2",
author="Stochastic Technologies",
author_email="info@stochastictechnologies.com",
url=... | Python | 0 |
162c3cd9b12e559242215d395ae85fc75d8ba37d | Create pl_list.py | pl_list.py | pl_list.py | __author__ = "Dan C Williams"
__version__ = "0.2"
__date__ = "Jul-24-2016"
__email__ = "dan.c.williams@gmail.com"
__status__ = "Development"
__version__ = "Python 3.5"
import netaddr
import collections
raw_lines = [line.rstrip('\n') for line in open('TEST_PL_DATA.txt')]
blackList = ['0.0.0.0/0', 'description', '!']
s... | Python | 0.000002 | |
40e53a9198a9e7cf4f37651d6d085366a98fb921 | add python client for raw http interface | client_lib/riak.py | client_lib/riak.py | #!/usr/bin/env python
"""
Copyright 2010 Justin Sheehy <justin@basho.com>
Copyright 2009 Jay Baird <jay@mochimedia.com>
This file is provided to you 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:/... | Python | 0 | |
dc1d43acb5730bd9b555b63aa589b0eeceb14e52 | Add a test case to exercise the 'target stop-hook add' command without relying on pexpect to spawn an lldb child command. The test is not "correct" in that the '** Stop Hooks **' message emitted by the Target implementation is invoked asynchronously and is using a separate: | test/stop-hook/TestStopHookCmd.py | test/stop-hook/TestStopHookCmd.py | """
Test lldb target stop-hook command.
"""
import os
import unittest2
import lldb
import pexpect
from lldbtest import *
class StopHookCmdTestCase(TestBase):
mydir = "stop-hook"
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
def test_with_dsym(self):
"""Test a sequen... | Python | 0.000194 | |
250e0d2d0e2264b83a82548df3b30dbc784a4fe5 | Add some example client code | docker-registry-show.py | docker-registry-show.py | """
Copyright 2015 Red Hat, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
d... | Python | 0.000001 | |
e7cbd3e2d5a21b003c6ee392da5b8ebe70d279a8 | add lockfile dependency | setup.py | setup.py | #########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... | #########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... | Python | 0.000001 |
83bcb62c98c406e2aa6ce6a9a98750d0b565f750 | Add tests for generic hash | tests/unit/test_raw_generichash.py | tests/unit/test_raw_generichash.py | # Import nacl libs
import libnacl
# Import python libs
import unittest
class TestGenericHash(unittest.TestCase):
'''
Test sign functions
'''
def test_keyless_generichash(self):
msg1 = b'Are you suggesting coconuts migrate?'
msg2 = b'Not at all, they could be carried.'
chash1 =... | Python | 0 | |
ff814e3dff10ffa54a0569868f32056d37babff6 | Create test1.py | test1.py | test1.py | import this
| Python | 0.000018 | |
064124d09973dc58a444d22aa7c47acf94f8fa81 | Add a script to generate JSON bigram frequencies for English | data/bigramfreq.py | data/bigramfreq.py | import json
import lxml.html
from lxml.cssselect import CSSSelector
import requests
import sys
def main():
raw = requests.get("http://norvig.com/mayzner.html")
if not raw:
print >>sys.stderr, "Request failed with code %d" % (raw.status_code)
return 1
tree = lxml.html.fromstring(raw.text)
... | Python | 0.000003 | |
b9b6b8a9337888fdcfcf15af1dedc758d0662dd0 | add nexted evalute=False test | sympy/core/tests/test_evaluate.py | sympy/core/tests/test_evaluate.py | from sympy.abc import x, y
from sympy.core.evaluate import evaluate
from sympy.core import Mul, Add
def test_add():
with evaluate(False):
expr = x + x
assert isinstance(expr, Add)
assert expr.args == (x, x)
assert isinstance(x + x, Mul)
def test_nested():
with evaluate(False):
... | Python | 0.000049 | |
6330db1c6d3261d7a22046fa11cc1c661ba57484 | Add basic code for uploading videos to youtube. | yt.py | yt.py | """ Parse messages and post links to youtube. """
from __future__ import print_function
import email
import logging
from os.path import join
import re
def configure_logger():
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler('yt.log')
fh.setLevel(logging.DEB... | Python | 0 | |
9f551b236a5d4052f2371cc11613e84808f43dee | Add setup.py | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(
name='pyvk',
version='2016.08',
packages=['pyvk'],
url='https://github.com/sgaynetdinov/pyvk',
license='MIT License',
author='Sergey Gaynetdinov',
author_email='s.gaynetdinov@gmail.com',
description='Python API wrapper around... | Python | 0.000001 | |
6a084ec30374c5010b6373eff663e28d3b81a832 | Initialize ANN module | ANN.py | ANN.py | import math
from random import seed as srand, random as rand
import sys
from time import time
srand(time())
def sigmoid(x):
return (1.0 / (1.0 + math.exp(-x)))
def sigmoidDeriv(x):
return (x * (1.0 - x))
class ANN:
def __init__(self, layers, learnRate, weights=[]):
self.inp = [ None for i ... | Python | 0 | |
fcd027a115fd3c690f042468c303eeedc74774fa | Use setuptools instead of distribute. | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='facebook-sdk',
version='0.4.0',
description='This client library is designed to support the Facebook '
'Graph API and the official Facebook JavaScript SDK, which '
'is the canonical way to implement Facebook aut... | #!/usr/bin/env python
from distutils.core import setup
setup(
name='facebook-sdk',
version='0.4.0',
description='This client library is designed to support the Facebook '
'Graph API and the official Facebook JavaScript SDK, which '
'is the canonical way to implement Facebook... | Python | 0 |
923c6b5a4181dfd9ae3f3c26ba411a63e27a79fe | add test for custom argument parser | tests/test_custom_argument_parser.py | tests/test_custom_argument_parser.py | import pytest
from python_utility.custom_argument_parser import CustomArgumentParser
def test_custom_argument_parser() -> None:
parser = CustomArgumentParser()
with pytest.raises(SystemExit):
parser.error(message='test')
| Python | 0 | |
220671d4bc2300983cf200cc6f7834efef458ff1 | add a new factors module | modules/factors.py | modules/factors.py | # finding all factors for a given number
def find_factors(x): # define a function
print ("The factors of ", x, " are: ")
for i in range(1, x + 1):
if x % i == 0:
print(i)
def print_factors():
# ask the user to input a number
num = input("Enter a number to print its factors: ")
if num >= 0: # check ... | Python | 0 | |
291117e0c56fb00fd27c93a95b883784cf69c9bc | add dataset parser | apps/paper/dataset.py | apps/paper/dataset.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on March 7, 2014
@author: Chunwei Yan @ PKU
@mail: yanchunwei@outlook.com
'''
from __future__ import division
class DUC(object):
def __init__(self, path):
self.path = path
def get_text(self):
'''
get lines of the TEXT
... | Python | 0.000083 | |
070d3f780ffab6e866fb3d1d7fc21bd77fb31ae6 | Add momento pattern | momento-pattern.py | momento-pattern.py | #!/usr/bin/python
import copy
class Originator(object):
class Memento(object):
def __init__(self, mstate):
self.mstate = mstate
def rollback_state(self):
return self.mstate
def set_state(self, state):
print ('Originator: setup state to: {0}'.format(state))
... | Python | 0.000052 | |
8e3e1883b9aa25091b6a9a1b4684128bd56659f7 | Add new test | setup.py | setup.py | """
Finix Python client library.
See ``README.md`` for usage advice.
"""
import os
import re
try:
import setuptools
except ImportError:
import distutils.core
setup = distutils.core.setup
else:
setup = setuptools.setup
PACKAGE = next((str(s) for s in setuptools.find_packages('.', exclude=("tests", "t... | Python | 0.000004 | |
0fe1d3eb78ef3d2c5dbbd5a662829309ab808a6f | Add setup.py | setup.py | setup.py | from setuptools import setup
treeano_version = '0.0.1'
setup(
name="treeano",
version=treeano_version,
packages=["treeano", "canopy"]
)
| Python | 0.000001 | |
529d9328570febd037077cfe865feedb841a1162 | Create setup.py | setup.py | setup.py | from distutils.core import setup
setup(
name = 'autoD', # How you named your package folder (MyLib)
packages = ['autoD'], # Chose the same as "name"
version = '3.7.0', # Start with a small number and increase it with every change you make
license='MIT', # Chose a license from here: https:/... | Python | 0.000001 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.