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 |
|---|---|---|---|---|---|---|---|
bffa61da4576c088c081daea3833142af58fef1d | Add in some tests for cities | tests/test_cities.py | tests/test_cities.py | import testtools
import cities
class TestCities(testtools.TestCase):
def test_largest(self):
largest = 'Sydney'
self.assertEqual(largest, cities.largest(cities.get_cities()).name)
| Python | 0.000019 | |
102a1c57763c646962eb62569e1f7b57793142f3 | fix test_step test | tests/test_client.py | tests/test_client.py | try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
import pytest
from mock import patch, Mock
from plaid.client import Client, require_access_token
def test_require_access_token_decorator():
class TestClass(object):
access_token = 'foo'
@require_access... | try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
import pytest
from mock import patch, Mock
from plaid.client import Client, require_access_token
def test_require_access_token_decorator():
class TestClass(object):
access_token = 'foo'
@require_access... | Python | 0.000005 |
91d24f62505462e5009cd5e0fb1176824d7c57d9 | Test config | tests/test_config.py | tests/test_config.py | from changes import config
from . import BaseTestCase
class ConfigTestCase(BaseTestCase):
arguments = {
'--debug': True,
'--dry-run': False,
'--help': False,
'--major': False,
'--minor': False,
'--new-version': '0.0.1',
'new_version': '0.0.1',
'--noi... | Python | 0.000001 | |
71fda989816e1848c99b801c133171216abe0df5 | Add test for setting scheduler parameters | tests/test_domain.py | tests/test_domain.py |
import unittest
import libvirt
class TestLibvirtDomain(unittest.TestCase):
def setUp(self):
self.conn = libvirt.open("test:///default")
self.dom = self.conn.lookupByName("test")
def tearDown(self):
self.dom = None
self.conn = None
def testDomainSchedParams(self):
... | Python | 0 | |
726ae01462c8945df1b7d3f32d56fc54ed9b6fa2 | Write hub initialization tests | tests/test_bicycle_wheel.py | tests/test_bicycle_wheel.py | import pytest
from bikewheelcalc import BicycleWheel, Rim, Hub
# -------------------------------------------------------------------------------
# Test fixtures
#------------------------------------------------------------------------------
@pytest.fixture
def std_radial():
'Return a Standard Bicycle Wheel with r... | Python | 0.000001 | |
d05a2a7504bf8e6adf6d5d94d0b810060f66a9ec | Create test_it_all.py | tests/test_it_all.py | tests/test_it_all.py | #soon TM
| Python | 0.000009 | |
afe2cac782f2578e610137891566d862f62375c6 | Create uds18.py | uds18.py | uds18.py | """
Custom fits for the lens in UDS-18
"""
import unicorn
import pyfits
import emcee
| Python | 0.000002 | |
df26dc408dc629e4802716ace5d0b3879c2b110b | Create factories.py | trendpy/factories.py | trendpy/factories.py | # factory.py
# MIT License
# Copyright (c) 2017 Rene Jean Corneille
# 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, c... | Python | 0.000001 | |
df7cf8ef2bdba9f50e21f4a7fc96904122fde311 | Add gunicorn config file | gunicorn_cfg.py | gunicorn_cfg.py | """
This file contains gunicorn settings.
To run sqmpy with gunicorn run the following command:
gunicorn -c gunicorn_cfg.py run:app
In order to daemonize gunicorn add -D flag:
gunicorn -c gunicorn_cfg.py run:app -D
"""
import multiprocessing
# Gunicorn will listen on the given host:port
bind = '0.0.0.0:30... | Python | 0 | |
cb875f2043a1c3a9ec5201336d1b577655612279 | move utility methods into their own module as functions, clean up type lookup | utils.py | utils.py | def bytes_to_unicode(data):
return data.decode("UTF-8")
def unicode_to_bytes(data):
return data.encode("UTF-8")
def pretty_print(self, user, msg_type, destination, message):
if isinstance(message, list):
message = " ".join(message)
print("%s %s %s :%s" % (user, msg_type, destination, mes... | Python | 0 | |
568fe1ff8c4ef27f93751f53a27707f045f19037 | update core api module | simphony_paraview/core/api.py | simphony_paraview/core/api.py | from .iterators import iter_cells, iter_grid_cells
from .cuba_data_accumulator import CUBADataAccumulator
from .cuba_utils import (
supported_cuba, cuba_value_types, default_cuba_value, VALUETYPES)
from .constants import points2edge, points2face, points2cell, dataset2writer
from .paraview_utils import (
write_t... | from .iterators import iter_cells, iter_grid_cells
from .cuba_data_accumulator import CUBADataAccumulator
from .cuba_utils import (
supported_cuba, cuba_value_types, default_cuba_value, VALUETYPES)
from .constants import points2edge, points2face, points2cell, dataset2writer
from .paraview_utils import write_to_file... | Python | 0 |
f418e9e68d1f2a7f6a0ad5060a1ed5a7ed74664f | Add YCM configuration | _vim/ycm_global_extra_conf.py | _vim/ycm_global_extra_conf.py | # Copied from https://gist.github.com/micbou/f8ed3f8bd6bd24e9f89bef286437306b. Kudos to micbou
import os
import ycm_core
SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
def IsHeaderFile( filename ):
extension = os.path.splitext( filename )[ 1 ]
return extension in [ '.h', '.hxx', '.hpp', '.hh'... | Python | 0 | |
be4374fd50d0c1148e3a734cc53391e15d4bbdc4 | Create wksp5.py | wksp5.py | wksp5.py | """Rx Workshop: Event Processing.
Part 2 - Grouping.
Usage:
python wksp5.py
"""
from __future__ import print_function
import rx
class Program:
@staticmethod
def main():
src = rx.Observable.from_iterable(get_input(),
rx.concurrency.Scheduler.new_thread... | Python | 0.000003 | |
e789579c77d2d96d098f4b46f1dfec4d54c843e5 | move AbstractProductCategory and AbstractNestedProductCategory | eca_catalogue/categorization/abstract_models.py | eca_catalogue/categorization/abstract_models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from treebeard.mp_tree import MP_Node
class AbstractProductCategory(models.Model):
name = models.CharField(_("Name"), max_length=128, unique=True)
description = models.TextField(_("Description"), blank=True, null=True)
... | Python | 0.000006 | |
3bbaf37193fe147f66b17d848f646f4400aa6278 | Fix lights issue #8098 (#8101) | homeassistant/components/light/vera.py | homeassistant/components/light/vera.py | """
Support for Vera lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.vera/
"""
import logging
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_RGB_COLOR, ENTITY_ID_FORMAT,
SUPPORT_BRIGHTNESS, SUPPORT_RGB_COLOR, Lig... | """
Support for Vera lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.vera/
"""
import logging
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_RGB_COLOR, ENTITY_ID_FORMAT,
SUPPORT_BRIGHTNESS, SUPPORT_RGB_COLOR, Lig... | Python | 0 |
000239e4f838f6514f6e902510d70fdc41b196d5 | Add wordpress_post | wordpress_post.py | wordpress_post.py | import os
import time
from base64 import b64encode
import json
import requests
from wordpresspushmedia import *
#
# publish the image as a media in wordpress, and return the HTML to include into the post
#
def wordpress_publish_image(blogid,title,imageurl,bearer_key):
url = "https://public-api.wordpres... | Python | 0.000006 | |
2fdbd208ee6db593df6f8b7c171a716ea3716920 | Add a checks module | doc8/checks.py | doc8/checks.py | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Ivan Melnikov <iv at altlinux dot org>
#
# Author: Joshua Harlow <harlowja@yahoo-inc.com>
#
# 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
#
# ... | Python | 0 | |
32a441c74c39cf1528c9980910e684dacef261d4 | Add a project in the 'incubator'. | incubation/clean_filename_py/rename.py | incubation/clean_filename_py/rename.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Jérémie DECOCK (http://www.jdhp.org)
# 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 witho... | Python | 0.000001 | |
44ef28ee6272c1b65b64ec2f1d54d8fbc592664c | Add script to match instrument IDs to MIMO and Wikidata | scripts/match_mimoInstruments.py | scripts/match_mimoInstruments.py | # !/usr/local/bin/python3.4.2
# ----Copyright (c) 2017 Carnegie Hall | The MIT License (MIT)----
# ----For the full license terms, please visit https://github.com/CarnegieHall/linked-data/blob/master/LICENSE----
## Argument[0] is script to run
## Argument[1] is path to csv of Wikidata query results w/MIMO and MBZ IDs
... | Python | 0 | |
6c21cab0bc08fcce83b35b4f51a2d7f369af3af6 | Build RequestContext in webhook middleware | senlin/api/middleware/webhook.py | senlin/api/middleware/webhook.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | # 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
# distributed unde... | Python | 0.000207 |
000a952d38badc8ee245f26e13a5fb38838e68ec | Add datamigration for django-parler-1.0git | fluent_contents/plugins/sharedcontent/migrations/0005_upgrade_to_django_parler10.py | fluent_contents/plugins/sharedcontent/migrations/0005_upgrade_to_django_parler10.py | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# The automatically generated model name was changed, table layout remains the same.
# This migration only u... | Python | 0.000001 | |
dbcaa9f2cda37269cd5dfca1166394f71bb3adfc | Create Example5.py | Example5.py | Example5.py | # Carlos Pedro Gonçalves (2015), Game Theory with Python
# Game Theory and Applied A.I. Classes
# Instituto Superior de Ciências Sociais e Políticas (ISCSP)
# University of Lisbon
# cgoncalves@iscsp.ulisboa.pt
#
# New Entrant vs Market Leader (payoffs correspond to strategic value)
#
# For more details see the user man... | Python | 0 | |
f0e1fc1751b20019e87cc50085c1350806b02f9f | Add missing visualizer module | thinc/extra/visualizer.py | thinc/extra/visualizer.py | ''' A visualizer module for Thinc '''
import seaborn
import matplotlib.pyplot as plt
def visualize_attention(x, y, weights, layer='Encoder', self_attn=True):
'''
Visualize self/outer attention
Args:
x: sentence
y: sentence
weights: (nH, nL, nL)
'''
def h... | Python | 0.000001 | |
0a23dddae52c861ef8f359affc71c082e970c9a5 | Create WhatsApp.py | WhatsApp.py | WhatsApp.py | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time
# Replace below path with the absolute path
# to chromedriver ... | Python | 0.000003 | |
927c9bcb0beab4f8fd6c2003573316906ad9dee3 | add init file | __init__.py | __init__.py | #!-*- coding:utf-8 -*- | Python | 0.000002 | |
1ab69075e39ad52674ffa52b86f64839f24d9016 | Update merge person tool | project/apps/api/management/commands/merge_persons.py | project/apps/api/management/commands/merge_persons.py | from optparse import make_option
from django.core.management.base import (
BaseCommand,
CommandError,
)
from apps.api.models import (
Person,
Singer,
Director,
Arranger,
)
class Command(BaseCommand):
help = "Merge selected singers by name"
option_list = BaseCommand.option_list + (
... | Python | 0.000001 | |
fee0bf6ab2fdeab8e81ca3f0381cdcc76454ee28 | Add openai environment viewer | openai/environments_viewer.py | openai/environments_viewer.py | import gym
# LunarLanderContinuous-v2
# BipedalWalker-v2
env = gym.make('BipedalWalker-v2')
n_epsiodes = 20
n_timesteps = 100
for i_episode in range(n_epsiodes):
observation = env.reset()
for t in range(n_timesteps):
env.render()
print(observation)
action = env.action_space.sample()
observation, reward, do... | Python | 0 | |
17173e7688c7a544678086eb5081051e90b3510b | Make gui.util a package. | Cura/gui/util/__init__.py | Cura/gui/util/__init__.py | # coding=utf-8
| Python | 0 | |
fd03d3c8a032e06ff2a84af48f6d23e3b3365695 | Integrate LLVM at llvm/llvm-project@f011d32c3a62 | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "f011d32c3a625eb86d1e33a70100b0a031f5fcd4"
LLVM_SHA256 = "b3ec1a2253da80c473df9addacc6ff5b7cfc3a788043a1c59480a93fd0d6fe0e"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "3cd5696a33095fe41c8c63f933d239f2c0dbb36e"
LLVM_SHA256 = "5d6e9211f9886586b20fc4c88e9c72833fa686212df82957f3d0b67a5c090d23"
tf_http_archive(
... | Python | 0.000001 |
8d473ee89ea43e5004b78314c0ca49cde0049980 | Integrate LLVM at llvm/llvm-project@961fd77687d2 | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "961fd77687d27089acf0a09ea29a87fb8ccd7522"
LLVM_SHA256 = "7c225e465ae120daa639ca68339fe7f43796ab08ff0ea893579a067b8f875078"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "4004fb6453d9cee1fc0160d6ebac62fa8e898131"
LLVM_SHA256 = "faec068929d9f039b3f65d8f074bfbee4d9bdc0829b50f7848b110f2bf7c3383"
tf_http_archive(
... | Python | 0.000001 |
0869a26cc061b86b31e7e5144bf90c276fa8c786 | Add numpy_checkwiki.py | numpy_checkwiki.py | numpy_checkwiki.py | #!/usr/bin/env python
import subprocess
import os, shutil, tempfile
from numpy_towiki import *
PATCH = os.path.join(DIR, 'wiki.patch')
def main():
regenerate_base_xml()
os.chdir(DIR)
new_xml = tempfile.NamedTemporaryFile()
if not os.path.isdir(SITE_PTH):
raise RuntimeError("directory %s ... | Python | 0.000427 | |
728c4db461bdf22a668436ac25ca1cb9afb80e81 | add argparse01.py | trypython/stdlib/argparse01.py | trypython/stdlib/argparse01.py | """
argparse モジュールのサンプルです。
基本的な使い方について。
参考: http://bit.ly/2UXDCIG
"""
import argparse
import sys
from common.commoncls import SampleBase
from common.commonfunc import pr
class Sample(SampleBase):
def exec(self):
#
# argparse モジュールを使う場合の基本は以下の手順
#
# (1) argparse.ArgumentParser オブジ... | Python | 0.004268 | |
1fd85ad3741f985eb29aa16b4445ed658b3292d0 | Add existing pyupp.py | pyupp.py | pyupp.py | """
Read and write unity player preferences data with python
Implementation based on description of .upp files here:
http://answers.unity3d.com/questions/147431/how-can-i-view-a-webplayer-playerprefs-file.html
File structure:
16Byte header
[Saved Prefs]
for each saved pref:
1 byte: length of pre... | Python | 0.000041 | |
64921ef6d8aafe505efdc30d070c138c741eb38f | Create __init__.py | bigbench/benchmark_tasks/meta_hello_world/__init__.py | bigbench/benchmark_tasks/meta_hello_world/__init__.py | Python | 0.000429 | ||
d0ef6fbf836e124693ddafe0aeabf61c6b5ce1ae | add reader module | compiler/eLisp2/eLisp/reader.py | compiler/eLisp2/eLisp/reader.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2015 ASMlover. 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 copyrig... | Python | 0.000001 | |
ef70a530e9827e96f4984a9c51424cd50b2000cf | Create numbersinlists.py | udacity/numbersinlists.py | udacity/numbersinlists.py | # Numbers in lists by SeanMc from forums
# define a procedure that takes in a string of numbers from 1-9 and
# outputs a list with the following parameters:
# Every number in the string should be inserted into the list.
# If a number x in the string is less than or equal
# to the preceding number y, the number x shoul... | Python | 0.000004 | |
ba09b09e7315cafa96e162a8186abe14c51c8128 | Add a script to download files from url | python/download_file_from_url.py | python/download_file_from_url.py | import urllib2
'''
Script to download pdf from a url, you need specify the website URL, and change the
filename in the loop, it mostly useful to download a sequence of files with the
filename only differ by a sequence number, e.g. CH1.PDF, CH2.PDF, CH3.PDF ...
'''
def download_file(download_url, output_name):
''... | Python | 0 | |
69c01499e92808f2a513e695d09e58f55dcd569b | Update implement-rand10-using-rand7.py | Python/implement-rand10-using-rand7.py | Python/implement-rand10-using-rand7.py | # Time: O(1.189), counted by statistics, limit would be O(log10/log7) = O(1.183)
# Space: O(1)
# Given a function rand7 which generates a uniform random integer in the range 1 to 7,
# write a function rand10 which generates a uniform random integer in the range 1 to 10.
#
# Do NOT use system's Math.random().
#
# Exam... | # Time: O(1.199), counted by statistics, limit would be O(log10/log7) = O(1.183)
# Space: O(1)
# Given a function rand7 which generates a uniform random integer in the range 1 to 7,
# write a function rand10 which generates a uniform random integer in the range 1 to 10.
#
# Do NOT use system's Math.random().
#
# Exam... | Python | 0.000002 |
a83282f43fdf87bad8abc63c5a0b41f8c9053a5f | Add setup script | setup.py | setup.py | #!/usr/bin/python
from setuptools import setup
import sys
sys.path.insert(0, 'src')
from hszinc import __version__
setup (name = 'hszinc',
package_dir = {'': 'src'},
version = __version__,
packages = [
'hszinc',
],
)
| Python | 0.000001 | |
60f6a83964b70700883121afb7aed22a7ffe7acc | Add setup.py | setup.py | setup.py | from setuptools import setup
setup(
name='bfd',
version='0.1',
description='ML w/ Concord',
url='https://github.com/adi-labs/bfd',
author='Andrew Aday, Alan Du, Carlos Martin, Dennis Wei',
author_email='alanhdu@gmail.com',
license='Apache',
packages=['bcd', 'data'],
install_requires... | Python | 0.000001 | |
68c0dd9d21a1de7c78f7df39d250f1714ff7c445 | Deal with more cases of durations set in headers | apps/videos/types/htmlfive.py | apps/videos/types/htmlfive.py | # Amara, universalsubtitles.org
#
# Copyright (C) 2013-2015 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at ... | # Amara, universalsubtitles.org
#
# Copyright (C) 2013-2015 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at ... | Python | 0 |
525e0656f57b67744dfa5529687c5d40d3f43327 | Add address/serializers.py | address/serializers.py | address/serializers.py | # file: address/serializers.py
from rest_framework import serializers
from address.models import ipv6_address, ipv4_address
class Ipv6AddressSerializer(serializers.ModelSerializer):
class Meta:
model = ipv6_address
fields = ('__all__')
class Ipv6AddressSerializer(serializers.ModelSerializer):
... | Python | 0.000001 | |
66bb6c75017eddd952d43e7dc72004a05c9659b1 | add test for kvmha_manager | nova/tests/kvmha/test_kvmha_manager.py | nova/tests/kvmha/test_kvmha_manager.py | #
# KVM HA in OpenStack (Demo Version)
#
# Copyright HP, Corp. 2014
#
# Authors:
# Lei Li <li.lei2@hp.com>
#
# 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
#
# ht... | Python | 0 | |
e08a1f1db582f34e36d695b32b2377fd7b73d9fe | Fix relative path handling in setup.py | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from os.path import join, dirname
from setuptools import setup, find_packages
RE_REQUIREMENT = re.compile(r'^\s*-r\s*(?P<filename>.*)$')
PYPI_RST_FILTERS = (
# Replace code-blocks
(r'\.\.\s? code-block::\s*(\w|\+... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from os.path import join
from setuptools import setup, find_packages
RE_REQUIREMENT = re.compile(r'^\s*-r\s*(?P<filename>.*)$')
PYPI_RST_FILTERS = (
# Replace code-blocks
(r'\.\.\s? code-block::\s*(\w|\+)+', '::... | Python | 0.000002 |
c05210b4557c56e7b7585ec22b27dd0f34f69f09 | add a setup.py to make this a nice official package | setup.py | setup.py | #!/usr/bin/python2.4
#
# Copyright 2006 Google Inc. All Rights Reserved.
from distutils.core import setup
setup(name="google-mysql-tools",
description="Google MySQL Tools",
url="http://code.google.com/p/google-mysql-tools",
version="0.1",
packages=["gmt"],
scripts=["mypgrep.py", "compact... | Python | 0 | |
4a92b178d6fe2138a70e5f4f9833d7697437561b | Add setup.py | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='django_plim',
version='0.0.1',
author='iMom0',
author_email='mobeiheart@gmail.com',
description=('Introduce plim to django'),
license='BSD',
keywords='plim mako django slim',
url='https://github.com/imom0/django-plim',
... | Python | 0.000001 | |
ba0e4042e25ec007df5766da16902cbeb55388f4 | add setup.py | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
def main():
setup(name = 'pyhpi',
version = '1.00',
description = 'Pure python HPI library',
author_email = 'michael.walle@kontron.com',
packages = [ 'pyhpi',
],
)
if __name__ == '__main__':
mai... | Python | 0 | |
63faa61c35aafd658ced61ee95ed857a33eb398b | Add setup.py file | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-bcrypt',
description="bcrypt password hash support for Django.",
version='0.1',
url='http://code.playfire.com/django-bcrypt',
author='Playfire.com',
author_email='tech@playfire.com',
license='BSD',
... | Python | 0.000001 | |
f830307dc9a904de7791fcdd8cb54020fa1c4977 | update scipy version (#691) | setup.py | setup.py | # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | Python | 0 |
52792b7a963af9c593e61c78c7f0c7f62550a85b | Update setup.py extra_requires | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import logging
import os
import re
import sys
import pkg_resources
from setuptools import find_packages
from setuptools import setup
def read(*parts):
path = os.path.join(os... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import logging
import os
import re
import sys
import pkg_resources
from setuptools import find_packages
from setuptools import setup
def read(*parts):
path = os.path.join(os... | Python | 0 |
b97cdbb63923ef3e28bbd329df1afb140f3a349f | add setup.py | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = 'mobula',
version = '1.0',
description = 'A Lightweight & Flexible Deep Learning (Neural Network) Framework in Python',
author = 'wkcn',
author_email = 'wkcn@live.cn',
url = 'https://github.com/wkcn/mobula',
... | Python | 0.000001 | |
0cd5bba6bddbc7b057ff18268e31d7eac50b2d2c | update setup.py | setup.py | setup.py | import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyPackageTest(TestCommand):
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ['tests', '--strict', '-s']
def finalize_options(self):
TestCommand.f... | from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyPackageTest(TestCommand):
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ['--strict']
def finalize_options(self):
TestCommand.finalize_options(self)
... | Python | 0.000001 |
29c2f663556d762167499d23921007f025738188 | update setup.py | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Thanks to Kenneth Reitz, I stole the template for this
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
PYTHON3 = sys.version_info[0] > 2
required = ['requests>=2.12', 'websocket-client==0.40.0',
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Thanks to Kenneth Reitz, I stole the template for this
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
PYTHON3 = sys.version_info[0] > 2
required = ['requests>=2.9', 'websocket-client==0.35.0',
... | Python | 0.000001 |
a6e4f8bf2716eda79a27ec025399b18c76b3356a | Fix url | setup.py | setup.py | #!/usr/bin/env python
from graphitepager import __version__
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def open_file(fname):
return open(os.path.join(os.path.dirname(__file__), fname))
def run_setup():
setup(
name='graphitepager',
... | #!/usr/bin/env python
from graphitepager import __version__
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def open_file(fname):
return open(os.path.join(os.path.dirname(__file__), fname))
def run_setup():
setup(
name='graphitepager',
... | Python | 0.999531 |
b8c739f8befca266544d41d9ace34ae680fe5170 | add setup.py | setup.py | setup.py | #!/usr/bin/env python
import os
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
BIN_DIR = os.path.expanduser("~/bin")
def symlink_to_bin():
ln_src = os.path.join(THIS_DIR, "webnull.py")
ln_dest = os.path.join(BIN_DIR, "webnull")
if os.path.isfile(ln_dest):
os.remove(ln_dest)
os.symlink... | Python | 0.000001 | |
a03ddd7dc0aa1166e88f71910ece2cd909d7b6c7 | Add setup.py to executably document package requirements | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='remoteobjects',
version='1.0',
description='an Object RESTational Model',
packages=['remoteobjects'],
package_dir={'remoteobjects': '.'},
install_requires=['simplejson>=2.0.0', 'httplib2>=0.4.0'],
provides=['remoteobjects'],
... | Python | 0 | |
7046a54abc31ecc919c628bd197600ac09437989 | Make dependency versions consistent. | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 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... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 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... | Python | 0.000008 |
6d0f54db9654ffa02accb5c557e4d4a5952d0ba0 | Add a setup.py | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Import python libs
import os
import sys
if 'USE_SETUPTOOLS' in os.environ or 'setuptools' in sys.modules:
from setuptools import setup
else:
from distutils.core import setup
NAME = 'pkgcmp'
DESC = ('Automate the creation of a normalized cross distribution packa... | Python | 0.000006 | |
9aabb59303d59287f1f29119a03c979ca0aeaefc | Bump version number to 0.10.1 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='idalink',
description='An interface to the insides of IDA!',
long_description=open('README.md').read(),
version='0.10.1',
url='https://github.com/zardus/idalink',
license='GNU General Public License v3',
packages=find_packages(),
... | from setuptools import setup, find_packages
setup(
name='idalink',
description='An interface to the insides of IDA!',
long_description=open('README.md').read(),
version='0.10',
url='https://github.com/zardus/idalink',
license='GNU General Public License v3',
packages=find_packages(),
pa... | Python | 0.00014 |
2894db47391d055978a0bbde485fd06ce59a4fa1 | Add setup.py for the project's package management | setup.py | setup.py | # !/usr/bin/env python
#
# setup.py script
#
# copyright 2016 anirban roy das <anirban.nick@gmail.com>
#
#
# Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
import codecs
import os
# ############## general config ##############
NAME = "ci_testing_python"
VERSION... | Python | 0 | |
72e907ade08aa92f2a816c7a1d6511d125204dbc | Update package description | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import re
import os
import sys
name = 'djangorestframework-jwt'
package = 'rest_framework_jwt'
description = 'JSON Web Token based authentication for Django REST framework'
url = 'https://github.com/GetBlimp/django-rest-framework-jwt'
author ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import re
import os
import sys
name = 'djangorestframework-jwt'
package = 'rest_framework_jwt'
description = ''
url = 'https://github.com/GetBlimp/django-rest-framework-jwt'
author = 'Jose Padilla'
author_email = 'jpadilla@getblimp.com'
licen... | Python | 0.000001 |
4646873ec80076759c02deac7ff3c50665e31415 | Update the PyPI version to 0.2.12 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.12',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.11',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | Python | 0 |
7efc61175c540a56b03e829ec917ce9efc1f06f9 | Fix incorrect get_link_flags on Mac | tensorflow/python/platform/sysconfig.py | tensorflow/python/platform/sysconfig.py | # Copyright 2015 The TensorFlow Authors. 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 applica... | # Copyright 2015 The TensorFlow Authors. 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 applica... | Python | 0 |
14a96a82209f21ca468a4f765c514ffd68f30f31 | add my little test script, 'cuz why not | plugins/python/test.py | plugins/python/test.py | #!/usr/bin/env python
#
# Copyright (C) 2005 David Trowbridge
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This... | Python | 0 | |
d22abe4ede958779a64c190bdd54451253eb2778 | Add to model only if part of bunsen xxx | bunsenscrapper/spiders/bunsen.py | bunsenscrapper/spiders/bunsen.py | # -*- coding: utf-8 -*-
import scrapy
from bunsenscrapper.items import BunsenscrapperItem
from scrapy.http.request import Request
class BunsenSpider(scrapy.Spider):
name = "bunsen"
allowed_domains = ["bunsencomics.com"]
start_urls = (
'http://www.bunsencomics.com/?category=Bunsen+C%C3%B3mics',
... | # -*- coding: utf-8 -*-
import scrapy
from bunsenscrapper.items import BunsenscrapperItem
from scrapy.http.request import Request
class BunsenSpider(scrapy.Spider):
name = "bunsen"
allowed_domains = ["bunsencomics.com"]
start_urls = (
'http://www.bunsencomics.com/?category=Bunsen+C%C3%B3mics',
... | Python | 0 |
23df7b77cde8b5351cf2902b8b11ee07e4b478f4 | Add a basic smoke test to check for exceptions and programming errors. | tests/smoke_test.py | tests/smoke_test.py | # -*- coding: utf-8 -*-
import unittest
import sys
sys.path.insert(0, '../mafia')
from game import Game
from game import Player
class TestMessenger:
def message_all_players(self, message: str):
print ('public: {message}'.format(message=message))
def message_player(self, player, message: str):
... | Python | 0 | |
a1f1efe712205b3bd4702a7ae3d06aa3171ad32f | add missing file... | simuvex/plugins/uc_manager.py | simuvex/plugins/uc_manager.py |
import logging
l = logging.getLogger('simuvex.plugins.uc_manager')
from .plugin import SimStatePlugin
class SimUCManager(SimStatePlugin):
def __init__(self, man=None):
SimStatePlugin.__init__(self)
if man:
self._uc_region_base = man._uc_region_base
self._uc_pos = man._uc... | Python | 0 | |
e33ce5f613c2a7bb9c2c42fba695ee37d3bb66ce | Add integration tests | tests/test_flask.py | tests/test_flask.py | from main import app
import pytest
import json
@pytest.fixture
def client():
client = app.test_client()
yield client
sites = [
"/kwejk",
"/jbzd",
"/9gag",
"/9gagnsfw",
"/demotywatory",
"/mistrzowie",
"/anonimowe",
]
# This test could fail if the site changes it's schema or is ... | Python | 0 | |
36a85fac06fd1bfe6934883f98b60edcbf3814be | Add test for scuba.utils.format_cmdline() | tests/test_utils.py | tests/test_utils.py | from __future__ import print_function
from nose.tools import *
from unittest import TestCase
import logging
import shlex
from itertools import chain
from .utils import *
import scuba.utils
class TestUtils(TestCase):
def _parse_cmdline(self, cmdline):
# Strip the formatting and whitespace
line... | Python | 0 | |
424db0df3c8be8538d551bd6974a8eccee6e53cc | add tenki.py | tenki.py | tenki.py | import urllib.request
import sys
import numpy as np
url="http://weather.is.kochi-u.ac.jp/sat/gms.fareast/"
a=1
b=0
x = input("Please Enter Year You Want: ")
y = input("And Enter Folder You Save File: ") + "/"
c=[]
for ii in range(1,13):
for i in range(1,32):
if i<10:
url="http://we... | Python | 0.000162 | |
d5250790d3509dfe4cbd1f507c83a92bef9614fe | Test cache instance. | tests.py | tests.py | # -*- coding: utf-8 -*-
import pytest
from flask import Flask
from flask.ext.cacheobj import FlaskCacheOBJ, Msgpackable
app = Flask(__name__)
cache = FlaskCacheOBJ()
cache.init_app(app)
@pytest.fixture
def app(request):
app = Flask(__name__)
ctx = app.app_context()
ctx.push()
request.addfinalizer(c... | Python | 0 | |
e87fb6fc09e70dbcd9c65d183c0addb1b290ffcf | Add test cases for Tradfri sensor platform (#64165) | tests/components/tradfri/test_sensor.py | tests/components/tradfri/test_sensor.py | """Tradfri sensor platform tests."""
from unittest.mock import MagicMock, Mock
from .common import setup_integration
def mock_sensor(state_name: str, state_value: str, device_number=0):
"""Mock a tradfri sensor."""
dev_info_mock = MagicMock()
dev_info_mock.manufacturer = "manufacturer"
dev_info_mock... | Python | 0 | |
5938881e939ce5088974489a943bd7d86925732f | Add unittest for inception | tests/functions_tests/test_inception.py | tests/functions_tests/test_inception.py | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
if cuda.available:
cuda.init()
class TestInception(unittest.TestCase):
i... | Python | 0 | |
92a911a53158a89f0bd7f7e989de47f1854268ff | make ogvs for just one episode | dj/scripts/dv2ogv.py | dj/scripts/dv2ogv.py | #!/usr/bin/python
# makes .ogv for all dv in a show
import os
import subprocess
from process import process
from main.models import Client, Show, Location, Episode, Raw_File, Cut_List
class mkpreview(process):
def one_dv(self,loc_dir,dv):
print dv.filename,
src = os.path.join(loc_dir,dv.fil... | #!/usr/bin/python
# makes .ogv for all dv in a show
import os
import subprocess
from process import process
from main.models import Client, Show, Location, Episode, Raw_File, Cut_List
class mkpreview(process):
def one_dv(self,loc_dir,dv):
src = os.path.join(loc_dir,dv.filename)
dst = os.path... | Python | 0 |
36756dbd6b287f8dc6d5629027a8fe75d0f4bb09 | Add Chuck Norris bot to the team | NorrisIsSoFunny_bot.py | NorrisIsSoFunny_bot.py | import telegram
LAST_UPDATE_ID = None
def main():
''' This is the main function that has to be called '''
global LAST_UPDATE_ID
# Telegram Bot Authorization Token
bot = telegram.Bot('put your token here')
# This will be our global variable to keep the latest update_id when requesting
# f... | Python | 0 | |
924ef1395214c2f71b96c21f41e240c88f0570a1 | Add project_security.xml file entry in update_xml section | addons/project/__terp__.py | addons/project/__terp__.py | {
"name" : "Project Management",
"version": "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_project.html",
"category" : "Generic Modules/Projects & Services",
"depends" : ["product", "account", 'mrp', 'sale', 'base'],
"description": "Project management module that track multi-level projects, tas... | {
"name" : "Project Management",
"version": "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_project.html",
"category" : "Generic Modules/Projects & Services",
"depends" : ["product", "account", 'mrp', 'sale', 'base'],
"description": "Project management module that track multi-level projects, tas... | Python | 0.000001 |
c1a378adcfd4ccccc44b0c9272e84a765f61f88a | add import script for Selby | polling_stations/apps/data_collection/management/commands/import_selby.py | polling_stations/apps/data_collection/management/commands/import_selby.py | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = 'E07000169'
addresses_name = 'SelbyDemocracy_Club__04May2017.tsv'
stations_name = 'SelbyDemocracy_Club__04May2017.tsv'
elections = ['local.north-yorkshire.2... | Python | 0 | |
76ea699d9b9ffd119f080e79b60d664133bfadbe | Fix trusts initliazation problem | senlin/api/middleware/trust.py | senlin/api/middleware/trust.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | # 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
# distributed unde... | Python | 0.000011 |
c92fbe2d0d40d3fa1339bf9e2a645c0c8d36bdc3 | Add a tool to be able to diff sln files | tools/pretty_sln.py | tools/pretty_sln.py | #!/usr/bin/python2.5
# Copyright 2009 Google Inc.
# All Rights Reserved.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependencies.
Then it outputs a possible build order.
"""
__author__ = 'nsylvain (Nicolas Sylvain)'
import re
... | Python | 0 | |
b01b2757e5bfd9835ce28e6d5e27137c7aa5075b | Add a small test script to call individual methods of a driver | tools/testdriver.py | tools/testdriver.py | # -*- Mode: Python; coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2007 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Sof... | Python | 0 | |
fb08ad77a821d86a3049628d907577949d525dac | Add unittests to test environment.py methods | toolium/test/behave/test_environment.py | toolium/test/behave/test_environment.py | # -*- coding: utf-8 -*-
u"""
Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lic... | Python | 0.000001 | |
032876577fa94e2d9ca668d6fe108d725696088b | add 20newsgroups/ml.py | 20newsgroups/ml.py | 20newsgroups/ml.py | from __future__ import division, print_function, unicode_literals
import numpy
from sklearn.datasets import fetch_20newsgroups_vectorized
from sklearn.preprocessing import StandardScaler
from sklearn.naive_bayes import MultinomialNB
from sklearn.linear_model import SGDClassifier
from sklearn.svm import LinearSVC
from s... | Python | 0 | |
63a0a0347272b2ae19f9caa5200aca5c03d67bab | add userselfinfo | api/user.py | api/user.py | #coding:utf-8
from flask import Flask
from . import app, jsonrpc
import json
from auth import auth_login
@jsonrpc.method('user.getinfo')
@auth_login
def userselfinfo(auth_info, **kwargs):
username = auth_info['username']
fields = ['id','username','name','email','mobile','is_lock','r_id']
try:
use... | Python | 0 | |
c43000d2f9ec20a1c0cdbbec86270d88acb36104 | Add implementation of more generic store calls | bench_examples/sparqlstore.py | bench_examples/sparqlstore.py | from ktbs_bench.graph_store import GraphStore
import rdflib
rdflib.plugin.register('BN', rdflib.store.Store, 'ktbs_bench.bnsparqlstore', 'SPARQLUpdateStore')
def get_sparqlstore(query_endpoint, update_endpoint, identifier="http://localhost/generic_sparqlstore/"):
triple_store = GraphStore(store='BN', identifier=... | Python | 0 | |
a6c96caa1392868402be9f89db034ef664a12bda | Add open time range support. | utils.py | utils.py | import datetime
import flask
import functools
from app import app
# Use dateutil if available
try:
from dateutil import parser as dateutil
except ImportError:
dateutil = None
class GameTime(object):
@classmethod
def setup(cls):
"""Get start and end time."""
cls.start, cls.end = app.config.get('GAME_T... | Python | 0 | |
135645a91d08267a0cc04b5c5840ac9c84af03b5 | Add pytorch_CAM.py file for Lecture 05 | 05_Image_recognition_and_classification/pytorch_CAM.py | 05_Image_recognition_and_classification/pytorch_CAM.py | # simple implementation of CAM in PyTorch for the networks such as ResNet, DenseNet, SqueezeNet, Inception
import io
import requests
from PIL import Image
from torchvision import models, transforms
from torch.autograd import Variable
from torch.nn import functional as F
import numpy as np
import cv2
# input image
LAB... | Python | 0 | |
a11a32f754a356dfc008e69b62d930af3754aec4 | Add : LFI Exploit tool | exploit-lfi.py | exploit-lfi.py | #!/usr/bin/python
import argparse
import base64
import re
import requests
import sys
def scrap_results (content):
# regexp
regexp_start = re.compile ('.*STARTSTART.*')
regexp_end = re.compile ('.*ENDEND.*')
# results
results = list()
# result start and end
found_start = False
found_end... | Python | 0.000001 | |
70f48f8b72a49929ddba7908fd47175fd4c1685d | add yarn support (test failing) | autoload/thesaurus_query/backends/yarn_synsets_lookup.py | autoload/thesaurus_query/backends/yarn_synsets_lookup.py | # Thesaurus Lookup routine for local synsets.csv file.
# Author: HE Chong [[chong.he.1989@gmail.com][E-mail]]
'''
Lookup routine for local mthesaur.txt file. When query_from_source is called, return:
[status, [[def_0, [synonym_0, synonym_1, ...]], [def_1, [synonym_0, synonym_1, ...]], ...]]
status:
0: no... | Python | 0 | |
b036acb164bc0efce18299341b04a7acf226c7db | solve pep_745 | pe-solution/src/main/python/pep_745.py | pe-solution/src/main/python/pep_745.py | from collections import defaultdict
from math import sqrt
MODULO = 1_000_000_007
def g_naive(n: int) -> int:
"""maximum perfect square that divides n."""
upper = int(sqrt(n))
for i in range(0, upper):
sq = (upper - i) ** 2
if n % sq == 0:
return sq % MODULO
def s_naive(nn: ... | Python | 0.999978 | |
a59d07a5bfb9f32c37242fd8ffb06d0409896485 | add a welch periodogram tool | welch.py | welch.py | #!/bin/env python
import numpy as np
import scipy.signal as ss
import astropy.io.fits as fits
import matplotlib.pyplot as plt
inpt = str(raw_input("Nome do Arquivo: "))
lc = fits.open(inpt)
bin = float(raw_input("bin size (or camera resolution): "))
# Convert to big-endian array is necessary to the lombscargle func... | Python | 0 | |
f204c881aabb07dbe6f04008e0637dc4430ae8c8 | Add jon submission for problem 01 | problem-01/submissions/jon.py | problem-01/submissions/jon.py | from submission import Submission
import collections
import random
class JonSubmission(Submission):
def author(self):
return 'jon'
def run(self, input):
class Traveler(object):
def __init__(self, graph, start_point):
if start_point not in graph:
... | Python | 0 | |
9999c27f5a6121d8488c14dd4a2b9843eef9cec9 | Add merge migration | events/migrations/0030_merge.py | events/migrations/0030_merge.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-09-27 09:05
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0029_make_api_key_non_nullable'),
('events', '0028_add_photographer_name'),
]
... | Python | 0.000001 | |
aa0e10116580ab013e911c2b14cf216a19716abd | Add schedule to static renderers | wafer/schedule/renderers.py | wafer/schedule/renderers.py | from django_medusa.renderers import StaticSiteRenderer
class ScheduleRenderer(StaticSiteRenderer):
def get_paths(self):
paths = ["/schedule/", ]
return paths
renderers = [ScheduleRenderer, ]
| Python | 0 | |
51d3dee22c3c563b486038edcd9f18fa02b46448 | Add new admin views to show how to use RBAC system | project/admin/views.py | project/admin/views.py | from werkzeug.exceptions import HTTPException
from flask import Response, redirect
from flask_admin import BaseView, expose
from flask_admin.contrib.sqla import ModelView as DefaultModelView
from flask_login import login_required
from project.home.decorators import roles_required
class BasicAuthException(HTTPExceptio... | Python | 0 | |
46074336a9ffc8a566a88a8e70c37ca56635ff7d | Create app2.py | python/pla.rix/app2.py | python/pla.rix/app2.py | #!C:/Python35/python.exe
# -*- coding: UTF-8 -*-
#
# belmih 2016
#
from multiprocessing import Process, Queue, Lock
import os
import xml.etree.cElementTree as ET
import shutil
import zipfile
import time
import csv
import argparse
abspath = os.path.abspath(__file__)
workdir = os.path.dirname(abspath)
os.chdir(workdi... | Python | 0.000002 | |
68babe2de9a8204c46ad23e1c82dd0ff8fe44c94 | Add a unittest on plot_figs module. | pyarm/tests/test_plot_figs.py | pyarm/tests/test_plot_figs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Jérémie DECOCK (http://www.jdhp.org)
import unittest
import os
import sys
dirname = os.path.dirname(__file__)
if dirname == '':
dirname = '.'
dirname = os.path.realpath(dirname)
updir = os.path.split(dirname)[0]
if updir not in sys.path:
sys... | Python | 0 | |
f34fb2b060c7fd977ca50753c8c1c9d5beaf0516 | return index at which acf drops below thresh | agent_model/acfanalyze.py | agent_model/acfanalyze.py | __author__ = 'richard'
import os
import numpy as np
import pandas as pd
from glob import glob
import statsmodels.tsa
import statsmodels.graphics.tsaplots
import matplotlib.pyplot as plt
plt.style.use('ggplot')
TRAJECTORY_DATA_DIR = "experimental_data/control_trajectories/"
def make_csv_name_list():
# TODO expor... | Python | 0 | |
96ca06b93aa33fbe779a6e7c6c85439e5b62b1a8 | Add `pysymoro/screw6.py` | pysymoro/screw6.py | pysymoro/screw6.py | # -*- coding: utf-8 -*-
"""
This module contains the Screw6 data structure.
"""
from sympy import zeros
from sympy import ShapeError
class Screw6(object):
"""
Data structure:
Represent the data structure (base class) to hold a 6x6 matrix
which in turn contains four 3x3 matrices.
"""
... | Python | 0 | |
e3b5f7b0f47b1e7ad4ab024c76a270ba9e88aa02 | add impala sqlalchemy resource function | blaze/sql.py | blaze/sql.py | from __future__ import absolute_import, division, print_function
from .compute.sql import select
from .data.sql import SQL, dispatch, first
from .expr import Expr, TableExpr, Projection, Column, UnaryOp
from .expr.scalar.core import Scalar
from .compatibility import basestring
from .api.resource import resource
impo... | from __future__ import absolute_import, division, print_function
from .compute.sql import select
from .data.sql import SQL, dispatch, first
from .expr import Expr, TableExpr, Projection, Column, UnaryOp
from .expr.scalar.core import Scalar
from .compatibility import basestring
from .api.resource import resource
impo... | Python | 0.000002 |
d952776a78901ecd20cb8e79cd00f5498e4b04be | Add generate anagrams | algo/generate_anagrams.py | algo/generate_anagrams.py | import sys
import shuffle from random
word = list(sys.argv[1])
anagrams = []
for i in range(10):
anagrams.append(''.join(shuffle(word)))
print anagrams
| Python | 0.999999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.