commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
b1815075ac1a1697c99a6293c8cc7719060ab9b2 | Add cpuspeed sensor | oandrew/home-assistant,hmronline/home-assistant,emilhetty/home-assistant,molobrakos/home-assistant,ct-23/home-assistant,Julian/home-assistant,srcLurker/home-assistant,GenericStudent/home-assistant,titilambert/home-assistant,ma314smith/home-assistant,ct-23/home-assistant,aoakeson/home-assistant,adrienbrault/home-assista... | homeassistant/components/sensor/cpuspeed.py | homeassistant/components/sensor/cpuspeed.py | """
homeassistant.components.sensor.cpuspeed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shows the current CPU speed.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.cpuspeed.html
"""
import logging
from homeassistant.helpers.entity import Entity
RE... | mit | Python | |
43605bd5340374a3a62e91cf544b2ba16edb320e | Add a tf-serving example for KerasBERT. | tombstone/models,tombstone/models,tombstone/models,tombstone/models,tombstone/models,tombstone/models | official/nlp/bert/serving.py | official/nlp/bert/serving.py | # Lint as: python3
# Copyright 2020 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 ... | apache-2.0 | Python | |
abd41ea78f2962f0b8b7166f0540727538d56471 | ajoute la state get_object | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Get_Object.py | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Get_Object.py | #!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import requests
import json
from geometry_msgs.msg import Pose, Point
from tf.transformations import quaternion_from_euler
class GetObject(EventState):
'''
Get an
># id int id of the object
># name string ... | bsd-3-clause | Python | |
272031cfbef13a5a3edbf3cf3c6fe5f00608d650 | add test for importcuedmembers command | cuedpc/edpcmentoring,cuedpc/edpcmentoring,cuedpc/edpcmentoring,cuedpc/edpcmentoring | edpcmentoring/cuedmembers/tests/test_managementcommands.py | edpcmentoring/cuedmembers/tests/test_managementcommands.py | import os
import shutil
import tempfile
from django.core.management import call_command
from django.test import TestCase
from ..models import Member
class TemporaryDirectoryTestCase(TestCase):
"""A TestCase which creates a temporary directory for each test whose path
is available as the "tmpdir" attribute.
... | mit | Python | |
0ba15652a5624cf8fa42f4caf603d84c09a0698b | Add kata: 6 kyu | nkapliev/codewars,nkapliev/codewars,nkapliev/codewars,nkapliev/codewars | 6_kyu/Decode_the_Morse_code.py | 6_kyu/Decode_the_Morse_code.py | # @see: https://www.codewars.com/kata/decode-the-morse-code
def decodeMorse(morseCode):
return ' '.join(
map(lambda m_word: ''.join(
map(lambda m_symbol: MORSE_CODE[m_symbol],
m_word.split())),
morseCode.strip().split(' ')))
| mit | Python | |
6837bbf2a1816d97b6c517bcb244aa51cf1eb7ba | Create robots_txt.py | HeyIamJames/Crawlers | robots_txt.py | robots_txt.py | import urlib.request
import io
def ger_robots_txt(url):
if url.endswith('/')
path = url
else:
path - url + '/'
# https://reddit.com/
| mit | Python | |
b36192eec53664f9178bfc4000d89b8ca9be1544 | Add merge migration | Johnetordoff/osf.io,TomBaxter/osf.io,sloria/osf.io,caseyrollins/osf.io,saradbowman/osf.io,leb2dg/osf.io,baylee-d/osf.io,caneruguz/osf.io,monikagrabowska/osf.io,sloria/osf.io,laurenrevere/osf.io,mattclark/osf.io,mfraezz/osf.io,caseyrollins/osf.io,chennan47/osf.io,hmoco/osf.io,brianjgeiger/osf.io,felliott/osf.io,adlius/o... | osf/migrations/0030_merge.py | osf/migrations/0030_merge.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-24 18:57
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0029_merge'),
('osf', '0029_externalaccount_date_last_refreshed'),
]
operations... | apache-2.0 | Python | |
6abf2f993813142ea685bc48a7a5a266d1905f1a | build indices qsub for bowtie or star with rsem | idbedead/RNA-sequence-tools,idbedead/RNA-sequence-tools,iandriver/RNA-sequence-tools,iandriver/RNA-sequence-tools,iandriver/RNA-sequence-tools,idbedead/RNA-sequence-tools | rsem_build.py | rsem_build.py | #/usr/bin/env python
import commands
import os
from subprocess import call
def write_file(filename, contents):
"""Write the given contents to a text file.
ARGUMENTS
filename (string) - name of the file to write to, creating if it doesn't exist
contents (string) - contents of the file to be written
"""
# Open th... | mit | Python | |
db41bce3d90cfada9916baa8f9267cd9e6160a94 | Add an example for opening a file. | MrTheodor/pyh5md,khinsen/pyh5md | examples/open_file.py | examples/open_file.py | import numpy as np
import pyh5md
f = pyh5md.H5MD_File('poc.h5', 'r')
at = f.trajectory('atoms')
at_pos = at.data('position')
r = at_pos.v.value
print r
f.f.close()
| bsd-3-clause | Python | |
2cd57876c72d5c941bcb1ae497df48dbbc943ba9 | Create new package. (#6213) | krafczyk/spack,matthiasdiener/spack,mfherbst/spack,skosukhin/spack,skosukhin/spack,iulian787/spack,iulian787/spack,tmerrick1/spack,iulian787/spack,krafczyk/spack,matthiasdiener/spack,LLNL/spack,iulian787/spack,tmerrick1/spack,mfherbst/spack,LLNL/spack,EmreAtes/spack,krafczyk/spack,EmreAtes/spack,matthiasdiener/spack,Em... | var/spack/repos/builtin/packages/r-forecast/package.py | var/spack/repos/builtin/packages/r-forecast/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python | |
10eb703867fd10df543a141837c2a57d1052ba2c | Rename file with correct pattern | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | ideascube/conf/kb_civ_babylab.py | ideascube/conf/kb_civ_babylab.py | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
from django.utils.translation import ugettext_lazy as _
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'BabyLab'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'bsfcampus',
... | agpl-3.0 | Python | |
f31fcd789254f95b311f4fa4009a04ad919c2027 | add url update migration | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/migrations/0049_update_fluent_redirect_url.py | accelerator/migrations/0049_update_fluent_redirect_url.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-04-11 11:35
from __future__ import unicode_literals
from django.db import migrations
from accelerator.sitetree_navigation.sub_navigation import (
create_directory_subnav,
create_events_subnav,
create_home_subnav,
create_judging_subnav,
... | mit | Python | |
f21ff91cb3c70a150eca68dc03c51577ff343f18 | Solve challenge 8 | HKuz/PythonChallenge | Challenges/chall_8.py | Challenges/chall_8.py | #!/Applications/anaconda/envs/Python3/bin
# Python challenge - 8
# http://www.pythonchallenge.com/pc/def/integrity.html
# http://www.pythonchallenge.com/pc/return/good.html
import bz2
def main():
'''
Hint: Where is the missing link?
<area shape="poly" coords="179,284,214,311,255,320,281,226,319,224,363,30... | mit | Python | |
96ba88c74a77f3b71ef4a8b51c29013d16e23973 | Create tofu/plugins/MISTRAL/Inputs with empty __init__.py | Didou09/tofu,ToFuProject/tofu,ToFuProject/tofu | tofu/plugins/MISTRAL/Inputs/__init__.py | tofu/plugins/MISTRAL/Inputs/__init__.py | mit | Python | ||
35317e778b2fe1d238e21954df1eac0c5380b00b | Add corpus fetch from database | greenify/zodiacy,greenify/zodiacy | generate_horoscope.py | generate_horoscope.py | #!/usr/bin/env python3
# encoding: utf-8
import argparse
import sqlite3
import sys
"""generate_horoscope.py: Generates horoscopes based provided corpuses"""
__author__ = "Project Zodiacy"
__copyright__ = "Copyright 2015, Project Zodiacy"
_parser = argparse.ArgumentParser(description="Awesome SQLite importer")
_pars... | mit | Python | |
0b03dd638dd5ac3358d89a5538c707d5412b84ae | Add basic network broker state machine | WesleyAC/raft | broker/network.py | broker/network.py | from hypothesis.stateful import GenericStateMachine
class NetworkBroker(GenericStateMachine):
"""
Broker to coordinate network traffic
nodes = A map of node ids to node objects.
network = An adjacency list of what nodes can talk to each other. If a is
in network[b] than b -> a communcation is ... | mit | Python | |
3ab61b1e9cc155868108e658ad7e87fac9569e10 | add run script for bulk loader. | daewon/incubator-s2graph,jongwook/incubator-s2graph,SteamShon/incubator-s2graph,SteamShon/incubator-s2graph,jongwook/incubator-s2graph,daewon/incubator-s2graph,SteamShon/incubator-s2graph | loader/loader.py | loader/loader.py | #!/usr/bin/python
import os, sys, urllib2, urllib
def cleanup(args):
cmd = "hadoop fs -rm -r /tmp/%s" % args["htable_name"]
print cmd
ret = os.system(cmd)
print cmd, "return", ret
return ret
def hfile(args):
cmd = """spark-submit --class "subscriber.TransferToHFile" \
--name "TransferToHFile@shon" \
--conf "s... | apache-2.0 | Python | |
c48be39a1f04af887349ef7f19ecea4312425cf9 | initialize for production | kwantopia/shoppley-migrate,kwantopia/shoppley-migrate,kwantopia/shoppley-migrate,kwantopia/shoppley-migrate,kwantopia/shoppley-migrate,kwantopia/shoppley-migrate,kwantopia/shoppley-migrate | shoppley.com/shoppley/apps/offer/management/commands/initialize.py | shoppley.com/shoppley/apps/offer/management/commands/initialize.py | from django.core.management.base import NoArgsCommand
from shoppleyuser.models import Country, Region, City, ZipCode, ShoppleyUser
import os, csv
from googlevoice import Voice
FILE_ROOT = os.path.abspath(os.path.dirname(__file__))
class Command(NoArgsCommand):
def handle_noargs(self, **options):
f = open(FILE_ROOT... | mit | Python | |
00f3e74387fc7a215af6377cb90555d142b81d74 | Add acoustics module with class AcousticMaterial. | emtpb/pyfds | pyfds/acoustics.py | pyfds/acoustics.py | class AcousticMaterial:
"""Class for specification of acoustic material parameters."""
def __init__(self, sound_velocity, density,
shear_viscosity=0, bulk_viscosity=0,
thermal_conductivity=0, isobaric_heat_cap=1, isochoric_heat_cap=1):
"""Default values for optional pa... | bsd-3-clause | Python | |
75ffc049d021e88fed37dc009376761661452cbe | Add unit tests for heat.scaling.template | srznew/heat,pratikmallya/heat,dims/heat,gonzolino/heat,jasondunsmore/heat,pshchelo/heat,pshchelo/heat,cryptickp/heat,steveb/heat,takeshineshiro/heat,rdo-management/heat,jasondunsmore/heat,rdo-management/heat,srznew/heat,rh-s/heat,dragorosson/heat,noironetworks/heat,NeCTAR-RC/heat,takeshineshiro/heat,maestro-hybrid-clou... | heat/tests/test_scaling_template.py | heat/tests/test_scaling_template.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
# d... | apache-2.0 | Python | |
3d8ef3b0f31575354f03583a5f053fad6838084d | add `YouCompleteMe` config file. | DO-CV/sara,DO-CV/sara,DO-CV/sara,DO-CV/sara,DO-CV/sara,DO-CV/sara | .ycm_extra_conf.py | .ycm_extra_conf.py | import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-Wno-long-long',
'-Wno-variadic-macros',
'-f... | mpl-2.0 | Python | |
3e723f3419468654c9606b27d2127c94054b4bed | Add YouCompleteMe config for vim autocompletion | AbeelLab/phasm,AbeelLab/phasm | .ycm_extra_conf.py | .ycm_extra_conf.py | # This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... | mit | Python | |
b25a172cd89e8811e5cb38414bdf86ef5a5afaee | fix ABC for py2.7 | cfelton/rhea,cfelton/rhea,NickShaffner/rhea,NickShaffner/rhea | rhea/system/cso.py | rhea/system/cso.py |
from __future__ import absolute_import
from abc import ABCMeta, abstractclassmethod
from myhdl import Signal, SignalType, always_comb
class ControlStatusBase(object):
__metaclass__ = ABCMeta
def __init__(self):
""" Base class for control and status classes
Many complex digital block have c... |
from __future__ import absolute_import
from abc import ABCMeta, abstractclassmethod
from myhdl import Signal, SignalType, always_comb
class ControlStatusBase(metaclass=ABCMeta):
def __init__(self):
self._isstatic = False
@property
def isstatic(self):
return self._isstatic
@isstati... | mit | Python |
c0ab9b755b4906129988348b2247452b6dfc157f | Add a module to set the "display name" of a dedicated server | synthesio/infra-ovh-ansible-module | plugins/modules/dedicated_server_display_name.py | plugins/modules/dedicated_server_display_name.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from ansible.module_utils.basic import AnsibleModule
__metaclass__ = type
DOCUMENTATION = '''
---
module: dedicated_server_display_name
short_description: Modify the server display name in ovh manager
descri... | mit | Python | |
ffdee2f18d5e32c2d0b4f4eb0cebe8b63ee555f7 | Document tools/mac/dump-static-initializers.py more. | M4sse/chromium.src,patrickm/chromium.src,patrickm/chromium.src,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,Chilledheart/chromium,fujunwei/chromium-crosswalk,littlstar/chromium.src,anirudhSK/chromium,Chill... | tools/mac/dump-static-initializers.py | tools/mac/dump-static-initializers.py | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Dumps a list of files with static initializers. Use with release builds.
Usage:
tools/mac/dump-static-initializers.py out/Re... | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import re
import subprocess
import sys
# Matches for example:
# [ 1] 000001ca 64 (N_SO ) 00 0000 ... | bsd-3-clause | Python |
8fbc5877fa97b6b8df621ff7afe7515b501660fc | Convert string to camel case | SelvorWhim/competitive,SelvorWhim/competitive,SelvorWhim/competitive,SelvorWhim/competitive | LeetCode/ConvertStringToCamelCase.py | LeetCode/ConvertStringToCamelCase.py | def to_camel_case(text):
if len(text) < 2:
return text
capped_camel = "".join([word.title() for word in text.replace('-','_').split('_')])
return capped_camel if text[0].isupper() else capped_camel[0].lower()+capped_camel[1:]
| unlicense | Python | |
6dd1545ae9ff3ac10586144494f763bcc1bea1d8 | Add script to verify that image files exist for every actual_result checksum | HalCanary/skia-hc,TeamExodus/external_skia,sigysmund/platform_external_skia,wildermason/external_skia,Hikari-no-Tenshi/android_external_skia,AsteroidOS/android_external_skia,zhaochengw/platform_external_skia,AOSPU/external_chromium_org_third_party_skia,suyouxin/android_external_skia,Fusion-Rom/external_chromium_org_thi... | tools/verify_images_for_gm_results.py | tools/verify_images_for_gm_results.py | #!/usr/bin/python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Look through skia-autogen, searching for all checksums which should have
corresponding files in Google Storage, and verify that t... | bsd-3-clause | Python | |
98abb69d2c5cd41e9cdf9decc1180fe35112bc28 | Add initial base for the feed handler | tobbez/lys-reader | backend/feed_daemon.py | backend/feed_daemon.py | import feedparser
import psycopg2
import sys
import configparser
import logging
class FeedHandler():
def __init__(self):
self.config = configparser.ConfigParser(interpolation=None)
self.config.read(('config.ini',))
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', lev... | isc | Python | |
c684ab17fc83242ee32db4b4c4bf57a7798acae4 | Add ordering prefix | cprogrammer1994/ModernGL,cprogrammer1994/ModernGL,cprogrammer1994/ModernGL | examples/00_empty_window.py | examples/00_empty_window.py | import ModernGL
from ModernGL.ext.examples import run_example
class Example:
def __init__(self, wnd):
self.wnd = wnd
self.ctx = ModernGL.create_context()
def render(self):
self.ctx.viewport = self.wnd.viewport
self.ctx.clear(0.2, 0.4, 0.7)
run_example(Example)
| mit | Python | |
35a683738f00a67b88f26fdc2453a29777fe7f82 | Add raw outputter | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/output/raw.py | salt/output/raw.py | '''
Print out the raw python data, the original outputter
'''
def ouput(data):
'''
Rather basic....
'''
print(data)
| apache-2.0 | Python | |
ad284dfe63b827aaa1ca8d7353e1bf1a54ea4fdf | Change arduino board from first example from mega to nano | Scheik/ROS-Workspace,Scheik/ROS-Groovy-Workspace,Scheik/ROS-Workspace,Scheik/ROS-Groovy-Workspace | src/arduino_sourcecodes/src/arduino_serial_nodes/connect_arduino_nano1.py | src/arduino_sourcecodes/src/arduino_serial_nodes/connect_arduino_nano1.py | #!/usr/bin/env python
#####################################################################
# Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that th... | bsd-3-clause | Python | |
07528bd828c28a18f3118481d1cdb9cf1287fd0b | Revert "don't track django.wsgi". It is part of the documentation. | marineam/nagcat,marineam/nagcat,marineam/nagcat | railroad/sample/django.wsgi | railroad/sample/django.wsgi | # Copyright 2010 ITA Software, 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 wr... | apache-2.0 | Python | |
e7dd12377a5f3a46019c5244de08a5cfc00f44db | add Anscombe's Quartet example | percyfal/bokeh,saifrahmed/bokeh,bsipocz/bokeh,srinathv/bokeh,schoolie/bokeh,rothnic/bokeh,ahmadia/bokeh,carlvlewis/bokeh,PythonCharmers/bokeh,dennisobrien/bokeh,mutirri/bokeh,aavanian/bokeh,paultcochrane/bokeh,ericdill/bokeh,msarahan/bokeh,jakirkham/bokeh,daodaoliang/bokeh,khkaminska/bokeh,ChristosChristofidis/bokeh,ms... | examples/glyphs/anscombe.py | examples/glyphs/anscombe.py |
import os
import numpy as np
import pandas as pd
from bokeh.objects import (
ColumnDataSource, GlyphRenderer, Grid, GridPlot, LinearAxis, Plot, Range1d
)
from bokeh.glyphs import Circle, Line
from bokeh import session
from StringIO import StringIO
data = """
I I II II III III IV ... | bsd-3-clause | Python | |
2d65862d77338dc503e34f389de1dc3bc553b6cd | Add DomainCaseRuleRun to admin site | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/data_interfaces/admin.py | corehq/apps/data_interfaces/admin.py | from django.contrib import admin
from corehq.apps.data_interfaces.models import DomainCaseRuleRun
class DomainCaseRuleRunAdmin(admin.ModelAdmin):
list_display = [
'domain',
'started_on',
'finished_on',
'status',
'cases_checked',
'num_updates',
'num_closes',... | bsd-3-clause | Python | |
017f276bb9544578417444c34ce2c04d87bb5852 | Fix zds #323 | zestedesavoir/Python-ZMarkdown,Situphen/Python-ZMarkdown,zestedesavoir/Python-ZMarkdown,Situphen/Python-ZMarkdown,zestedesavoir/Python-ZMarkdown,Situphen/Python-ZMarkdown | markdown/extensions/emoticons.py | markdown/extensions/emoticons.py | # Emoticon extension for python-markdown
# Original version :
# https://gist.github.com/insin/815656/raw/a68516f1ffc03df465730b3ddef6de0a11b7e9a5/mdx_emoticons.py
#
# Patched by cgabard for supporting newer python-markdown version and extend for support multi-extensions
import re
import markdown
from markdown.inlinepa... | # Emoticon extension for python-markdown
# Original version :
# https://gist.github.com/insin/815656/raw/a68516f1ffc03df465730b3ddef6de0a11b7e9a5/mdx_emoticons.py
#
# Patched by cgabard for supporting newer python-markdown version and extend for support multi-extensions
import re
import markdown
from markdown.inlinepa... | bsd-3-clause | Python |
56ee8843c355ffa56f7c2583d8d524e1ecfd29c3 | Create __init__.py | ShifuML/pyshifu,ShifuML/pyshifu | module/submodule/tests/__init__.py | module/submodule/tests/__init__.py | apache-2.0 | Python | ||
5e1d5644b2279b31191870b4a8099f3f6f31e851 | Enable admin for Project, Platform, Dataset | nguyenduchien1994/django-ncharts,nguyenduchien1994/django-ncharts,nguyenduchien1994/django-ncharts,nguyenduchien1994/django-ncharts,nguyenduchien1994/django-ncharts | ncharts/admin.py | ncharts/admin.py | from django.contrib import admin
from ncharts.models import Project, Platform, Dataset
class ProjectAdmin(admin.ModelAdmin):
pass
class PlatformAdmin(admin.ModelAdmin):
pass
class DatasetAdmin(admin.ModelAdmin):
pass
admin.site.register(Project,ProjectAdmin)
admin.site.register(Platform,PlatformAdmin)
... | bsd-2-clause | Python | |
23808a3d65db23163969aeb08adaa29f6403e720 | Fix a test | RianFuro/vint,Kuniwak/vint,Kuniwak/vint,RianFuro/vint | test/lib/lint/policy/test_abstract_policy.py | test/lib/lint/policy/test_abstract_policy.py | import unittest
from lib.lint.policy.abstract_policy import AbstractPolicy
class ConcretePolicy(AbstractPolicy):
def __init__(self):
super().__init__()
self.description = 'Found something invalid'
self.reference = 'http://example.com'
self.level = 0
class TestAbstractPolicy(unitt... | import unittest
from lib.lint.policy.abstract_policy import AbstractPolicy
class ConcretePolicy(AbstractPolicy):
def __init__(self):
super().__init__()
self.description = 'Found something invalid'
self.reference = 'http://example.com'
self.level = 0
class TestAbstractPolicy(unitt... | mit | Python |
e1c6f344e804f0d972dbc685b9492a126d74a7d3 | Create new management app | usingnamespace/usingnamespace | usingnamespace/management/__init__.py | usingnamespace/management/__init__.py | from pyramid.config import Configurator
from pyramid.session import SignedCookieSessionFactory
from pyramid.settings import asbool
from pyramid.wsgi import wsgiapp2
default_settings = (
('route_path', str, '/management'),
('domain', str, ''),
)
# Stolen from pyramid_debugtoolbar
def parse_settings(settings):
... | isc | Python | |
4fbb9ca1b055b040214c82dc307f69793947b800 | Add handler for syncing wallets to server | habibmasuro/omniwallet,VukDukic/omniwallet,dexX7/omniwallet,FuzzyBearBTC/omniwallet,Nevtep/omniwallet,OmniLayer/omniwallet,arowser/omniwallet,FuzzyBearBTC/omniwallet,ripper234/omniwallet,achamely/omniwallet,FuzzyBearBTC/omniwallet,arowser/omniwallet,OmniLayer/omniwallet,OmniLayer/omniwallet,maran/omniwallet,maran/omniw... | api/sync_wallet.py | api/sync_wallet.py | import urlparse
import os, sys
import json
tools_dir = os.environ.get('TOOLSDIR')
lib_path = os.path.abspath(tools_dir)
sys.path.append(lib_path)
from msc_apps import *
data_dir_root = os.environ.get('DATADIR')
def sync_wallet_response(request_dict):
if not request_dict.has_key('type'):
return (None, 'No field ... | agpl-3.0 | Python | |
eefa26090a4ff8fc23908afa83c87c2d54568929 | add pager duty sample alert plugin, closes #249 | mozilla/MozDef,DarkPrince304/MozDef,jeffbryner/MozDef,triplekill/MozDef,serbyy/MozDef,DarkPrince304/MozDef,mpurzynski/MozDef,triplekill/MozDef,gsssrao/MozDef,jeffbryner/MozDef,netantho/MozDef,gdestuynder/MozDef,eXcomm/MozDef,eXcomm/MozDef,mozilla/MozDef,DarkPrince304/MozDef,netantho/MozDef,serbyy/MozDef,mpurzynski/MozD... | alerts/plugins/pagerDutyTriggerEvent.py | alerts/plugins/pagerDutyTriggerEvent.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
#
# Contributors:
# Jeff Bryner jbryner@mozilla.com
import requests
import json... | mpl-2.0 | Python | |
32ea116ff172da3e7f0eeb7d9dea6b9a0378be08 | Add persistance | jmercier/Codebench | persistance.py | persistance.py | import numpy as np
import os
from itertools import izip
T_FILE = "t.npy"
C_FILE = "c.npy"
K_FILE = "k.npy"
U_FILE = "u.npy"
FP_FILE = "fp.npy"
IER_FILE = "ier.npy"
MSG_FILE = "msg.txt"
def saveSplines(directory, splines):
((t, c, k), u), fp, ier, msg = splines[0]
tlst = []
clst = []
klst = []
ulst = []
fplst ... | mit | Python | |
a34318312199e6dab8ca3db92f247f0bda369e17 | Add missing testcase file | wger-project/wger,rolandgeider/wger,rolandgeider/wger,kjagoo/wger_stark,wger-project/wger,wger-project/wger,DeveloperMal/wger,kjagoo/wger_stark,kjagoo/wger_stark,rolandgeider/wger,petervanderdoes/wger,rolandgeider/wger,DeveloperMal/wger,DeveloperMal/wger,DeveloperMal/wger,kjagoo/wger_stark,petervanderdoes/wger,wger-pro... | exercises/tests/testcase.py | exercises/tests/testcase.py | # This file is part of Workout Manager.
#
# Workout Manager 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 your option) any later version.
#
# Workout Manage... | agpl-3.0 | Python | |
b36ef2473c70ff16f4033f24ffc69a3b30b0ce26 | add edit-prowjobs.py | cjwagner/test-infra,dims/test-infra,monopole/test-infra,fejta/test-infra,kubernetes/test-infra,monopole/test-infra,cjwagner/test-infra,kubernetes/test-infra,fejta/test-infra,cblecker/test-infra,kubernetes/test-infra,BenTheElder/test-infra,michelle192837/test-infra,cjwagner/test-infra,cblecker/test-infra,kubernetes/test... | experiment/edit-prowjobs.py | experiment/edit-prowjobs.py | #!/usr/bin/env python3
# Copyright 2021 The Kubernetes Authors.
#
# 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 appl... | apache-2.0 | Python | |
ac8c78682e77d77be44910c36057e0217477b0a4 | Test OAI endpoint model | WSULib/combine,WSULib/combine,WSULib/combine,WSULib/combine | tests/test_models/test_oai_endpoint.py | tests/test_models/test_oai_endpoint.py | from django.test import TestCase
from core.models import OAIEndpoint
class OAIEndpointTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.attributes = {
'name': 'Test OAI Endpoint',
'endpoint': 'http://oai.example.com',
'verb': 'ListRecords',
'm... | mit | Python | |
613a0056e12a28232542aaf561831d276868e413 | Add parametric map generator, good for wrinkles | roboticslab-uc3m/xgnitive,roboticslab-uc3m/xgnitive,roboticslab-uc3m/xgnitive | programs/kinbody-creator/openraveMapGenerator.py | programs/kinbody-creator/openraveMapGenerator.py | #!/usr/bin/python
#import lxml.etree
#import lxml.builder
from lxml import etree
#E = lxml.builder.ElementMaker()
#KINBODY=E.KinBody
#BODY=E.Body
#GEOM=E.Geom
#EXTENTS=E.Extents
#TRANSLATION=E.Translation
#DIFUSSECOLOR=E.diffuseColor
# User variables
nX = 3
nY = 2
boxHeight = 1.0
resolution = 2.0 # Just to make s... | lgpl-2.1 | Python | |
668c28fd55daa93e0024e14e7137f78919e93e2c | Add python client script | chuckmitchell/basement-weather-server,chuckmitchell/basement-weather-server,chuckmitchell/basement-weather-server | docs/basement_weather.py | docs/basement_weather.py | #!/usr/bin/python
import sys
import commands
import Adafruit_DHT
import twitter
import requests
import json
date = commands.getoutput('TZ=":Canada/Atlantic" date')
#Get temp and humidity
humidity, temperature = Adafruit_DHT.read_retry(11, 4)
message = 'Temp: {0:0.1f} C Humidity: {1:0.1f} %'.format(temperature, humid... | mit | Python | |
5a221296e9e7cc59e4fe4c85b178db06c1376f13 | Add product streamfield migrations | pgovers/oscar-wagtail-demo,pgovers/oscar-wagtail-demo | demo/apps/catalogue/migrations/0012_auto_20160617_1115.py | demo/apps/catalogue/migrations/0012_auto_20160617_1115.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
import wagtail.wagtailcore.blocks
import wagtail.wagtailimages.blocks
class Migration(migrations.Migration):
dependencies = [
('catalogue', '0011_auto_20160616_1335'... | mit | Python | |
a9b35aff92c099aa52ce9e1ca1cb0df169a54ef5 | Add author to header. | juhasch/euroscipy_proceedings,mikaem/euroscipy_proceedings,euroscipy/euroscipy_proceedings,mjklemm/euroscipy_proceedings,euroscipy/euroscipy_proceedings,dotsdl/scipy_proceedings,michaelpacer/scipy_proceedings,chendaniely/scipy_proceedings,mikaem/euroscipy_proceedings,Stewori/euroscipy_proceedings,springcoil/euroscipy_p... | publisher/writer.py | publisher/writer.py | __all__ = ['writer']
import docutils.core as dc
import docutils.writers
from docutils import nodes
from docutils.writers.latex2e import (Writer, LaTeXTranslator,
PreambleCmds)
class Translator(LaTeXTranslator):
def __init__(self, *args, **kwargs):
LaTeXTranslator.__i... | __all__ = ['writer']
import docutils.core as dc
import docutils.writers
from docutils import nodes
from docutils.writers.latex2e import (Writer, LaTeXTranslator,
PreambleCmds)
class Translator(LaTeXTranslator):
def __init__(self, *args, **kwargs):
LaTeXTranslator.__i... | bsd-2-clause | Python |
6fb3c87f0f9b238eab71df6880568005e3a2b461 | add DuckDuckGo Instant Answer plugin | Rouji/Yui,Rj48/ircbot | plugins/ddg.py | plugins/ddg.py | # coding=utf-8
import json
import urllib.request
@yui.threaded
@yui.command('duckduckgo', 'ddg')
def ddg(argv):
'''Returns the Instant Answer for a given query. Usage: ddg -lang <query>'''
lang = 'en_US'
if len(argv) < 1:
return
# check if a language was given
argv = argv[1:]
if len(a... | mit | Python | |
e8576b67f8a3778c43a85e24d1cbc0e1985fe2ca | Add float.is_integer() example | devlights/try-python | trypython/basic/builtinfunc/float01.py | trypython/basic/builtinfunc/float01.py | """
組み込みクラス float のサンプルです.
float.is_integer() について
"""
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr
class Sample(SampleBase):
def exec(self):
num = 1.00
pr('type(num)', type(num))
pr('is_integer', num.is_integer()) # ==> True (整数に出来るので)
... | mit | Python | |
3b41e3bcc721d47ce5a7314af2ac4d9006598164 | add word class | alexbhandari/webParser,alexbhandari/webParser,alexbhandari/webParser | pythonfiles/word.py | pythonfiles/word.py |
#Comtains models for storing words and data returned from parsing websites
#
class word(object):
def __init__(self,name=None,part_of_speech=None,definition=None,context=None,subwords=None,count=None,rating=None):
self.name=name
self.part_of_speech=part_of_speech
self.definition=definition
se... | apache-2.0 | Python | |
4cedd5cf992c180da7d778a9a8adc225a7d8c496 | test various odd characters in the filenames, including some UTF-8 | owncloud/smashbox,switch-ch/smashbox,mrow4a/smashbox,nickv-oc/smashbox,mrow4a/smashbox,cernbox/smashbox,cernbox/smashbox,mrow4a/smashbox,owncloud/smashbox,labkode/smashbox,cernbox/smashbox,owncloud/smashbox,labkode/smashbox,nickv-oc/smashbox,switch-ch/smashbox,cernbox/smashbox,labkode/smashbox,switch-ch/smashbox,nickv-... | lib/test_filenames.py | lib/test_filenames.py | from smashbox.utilities import *
from smashbox.utilities.hash_files import count_files
__doc__ = """ Test various characters in the file names.
bug #104648: add UTF-8 escaping in PROPFIND response body (https://savannah.cern.ch/bugs/?104648)
Notes:
- unescaped % characters in propfind response crashes csync
"""
... | agpl-3.0 | Python | |
6ac6202837cade41b1dad5af9a474be171255993 | Check that Constant is given Moments instance, not class | jluttine/bayespy,bayespy/bayespy,SalemAmeen/bayespy,fivejjs/bayespy | bayespy/inference/vmp/nodes/constant.py | bayespy/inference/vmp/nodes/constant.py | ################################################################################
# Copyright (C) 2011-2012,2014 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
import numpy as np
from .node import Node, Moments
class C... | ################################################################################
# Copyright (C) 2011-2012,2014 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
import numpy as np
from .node import Node
class Constant(N... | mit | Python |
435004cebce00510db3bf36ae21b2cbf37020f32 | add petpvc specs file | mick-d/nipype,FCP-INDI/nipype,FCP-INDI/nipype,mick-d/nipype,carolFrohlich/nipype,FCP-INDI/nipype,carolFrohlich/nipype,carolFrohlich/nipype,FCP-INDI/nipype,sgiavasis/nipype,mick-d/nipype,sgiavasis/nipype,carolFrohlich/nipype,mick-d/nipype,sgiavasis/nipype,sgiavasis/nipype | nipype/interfaces/tests/test_auto_PETPVC.py | nipype/interfaces/tests/test_auto_PETPVC.py | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ...testing import assert_equal
from ..petpvc import PETPVC
def test_PETPVC_inputs():
input_map = dict(alpha=dict(argstr='-a %.4f',
),
args=dict(argstr='%s',
),
debug=dict(argstr='-d',
usedefault=True,
),
environ=dict(nohash=Tru... | bsd-3-clause | Python | |
99e531ec0e86d7c1d34de154cc49584821f85904 | Make all metavars uppercased | lukw00/powerline,prvnkumar/powerline,wfscheper/powerline,seanfisk/powerline,firebitsbr/powerline,xfumihiro/powerline,firebitsbr/powerline,IvanAli/powerline,IvanAli/powerline,bezhermoso/powerline,bartvm/powerline,s0undt3ch/powerline,darac/powerline,russellb/powerline,s0undt3ch/powerline,EricSB/powerline,s0undt3ch/powerl... | powerline/commands/config.py | powerline/commands/config.py | # vim:fileencoding=utf-8:noet
from __future__ import (division, absolute_import, print_function)
import argparse
import powerline.bindings.config as config
class StrFunction(object):
def __init__(self, function, name=None):
self.name = name or function.__name__
self.function = function
def __call__(self, *ar... | # vim:fileencoding=utf-8:noet
from __future__ import (division, absolute_import, print_function)
import argparse
import powerline.bindings.config as config
class StrFunction(object):
def __init__(self, function, name=None):
self.name = name or function.__name__
self.function = function
def __call__(self, *ar... | mit | Python |
c94653382a5a8aa2ec9af94f3aaa02ed5cae9b4c | Create test_send_sms.py | nksheridan/elephantAI,nksheridan/elephantAI | test_send_sms.py | test_send_sms.py | import serial
from curses import ascii
# since we need ascii code from CTRL-Z
import time
# here we are testing sending an SMS via virtual serial port ttyUSB0 that was created by a USB serial modem
phonenumber = #enter phone number to send SMS to e.g. "+441234123123"
SMS = "here's your SMS!"
ser = serial.Serial('/dev... | mit | Python | |
5e723223b5206e6e92a6140f184d41f1abfdbb3d | Create candy-crush.py | tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode | Python/candy-crush.py | Python/candy-crush.py | # Time: O((R * C)^2)
# Space: O(1)
# This question is about implementing a basic elimination algorithm for Candy Crush.
#
# Given a 2D integer array board representing the grid of candy,
# different positive integers board[i][j] represent different types of candies.
# A value of board[i][j] = 0 represents that the ce... | mit | Python | |
e262d176ecd7d8871a9e06ebc542cf473acf0925 | Add migration for transnational weights | Code4SA/gmmp,Code4SA/gmmp,Code4SA/gmmp | reports/migrations/0004_transnational_weights.py | reports/migrations/0004_transnational_weights.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django_countries import countries
def populate_weights(apps, schema_editor):
Weights = apps.get_model("reports", "Weights")
db_alias = schema_editor.connection.alias
for item in COUNTRY_WEIGHTS:
... | apache-2.0 | Python | |
6ff99aa939bf07d18595507efeca6ada7fc267a5 | add a test thing for wilk | rcbops/opencenter,rcbops/opencenter | tools/ast-env.py | tools/ast-env.py | #!/usr/bin/env python
if __name__ == '__main__':
import os
import sys
import copy
import json
sys.path.append(os.path.dirname(__file__))
import logging
logging.basicConfig(level=logging.DEBUG)
import roush.db.database
from roush.db import api as db_api
from roush.db.database... | apache-2.0 | Python | |
b0577ce3b8b162ce3702430b189905f9beaae8d5 | Add script to clean up all FD phone and fax numbers. | FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares | firecares/firestation/management/commands/cleanup_phonenumbers.py | firecares/firestation/management/commands/cleanup_phonenumbers.py | from django.core.management.base import BaseCommand
from firecares.firestation.models import FireDepartment
from phonenumber_field.modelfields import PhoneNumber
import re
"""
This command is for cleaning up every phone and fax number in the
database. It removes all non-numeric characters, such as parenthesis,
hyphens... | mit | Python | |
370fa8682b09de76af36129817e412270c8206c8 | add a new mgmt command for data analysis: compute the intersections of every pair of boundaries | datamade/represent-boundaries,opencorato/represent-boundaries,opencorato/represent-boundaries,datamade/represent-boundaries,opencorato/represent-boundaries,datamade/represent-boundaries | boundaries/management/commands/compute_intersections.py | boundaries/management/commands/compute_intersections.py | from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import MultiPolygon, Polygon
from boundaries.models import BoundarySet, Boundary
class Command(BaseCommand):
help = 'Create a report of the area of intersection of every... | mit | Python | |
7a75174716ecbc0757c84f29ebbb3fd309521936 | add management command to fire all repeaters in a domain | qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/cleanup/management/commands/fire_repeaters.py | corehq/apps/cleanup/management/commands/fire_repeaters.py | import datetime
from django.core.management.base import BaseCommand, CommandError
from corehq.apps.receiverwrapper.models import RepeatRecord
from dimagi.utils.post import simple_post
class Command(BaseCommand):
args = '<domain>'
help = 'Fire all repeaters in a domain.'
def handle(self, *args, **options)... | bsd-3-clause | Python | |
d5d3fcfb331c1486acbfb004705b94b1923a0db8 | Add code to dump features into libsvm file format | erfannoury/SuperEdge,erfannoury/SuperEdge,erfannoury/SuperEdge,erfannoury/SuperEdge,erfannoury/SuperEdge | Codes/SuperEdge/SuperEdge/dump_libsvm.py | Codes/SuperEdge/SuperEdge/dump_libsvm.py | import numpy as np
from datetime import datetime
from sklearn.datasets import dump_svmlight_file
import os.path as path
def main():
cache_path = 'largecache/'
feat_name = 'feat.dat'
lbl_name = 'lbl.dat'
feat_len = 4224 #1088
now = datetime.now()
lbl_memmap = np.memmap(path.join(cache_path, lbl_... | mit | Python | |
269f1b743583609ecdc7658e35073db9b985634c | rename http.py | hhatto/poyonga | examples/http_example.py | examples/http_example.py | from poyonga.client import Groonga
g = Groonga()
cmds = [("status", {}),
("log_level", {"level": "warning"}),
#("table_create", {"name": "Site", "flags": "TABLE_HASH_KEY"}),
("select", {"table": "Site"})]
for cmd, kwargs in cmds:
ret = g.call(cmd, **kwargs)
print(ret.status)
print(... | mit | Python | |
fef9b29a9072ce6bc184592c240558ba01fbeb6b | Copy to github | timhughes/git-credential-libsecret | git-credential-libsecret.py | git-credential-libsecret.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Tim Hughes <thughes@thegoldfish.org>
#
# Distributed under terms of the MIT license.
"""
Handles storing and providing usernames and passwords to Git using libsecret.
"""
import os
import sys
if __name__ == '__main__':
githelper... | mit | Python | |
95b304d2f0a9dc851926506795310f96c3312682 | Add SQL example. | yask123/rockstar,ghuntley/rockstar,GrimDerp/rockstar,georgemarshall/rockstar,danielbruns-wf/rockstar,RobertWang/rockstar,Hitman666/rockstar,jessiejea/rockstar,dkfiresky/rockstar,monsterwater/rockstar,ActuallyACat/rockstar,intermezzo-fr/rockstar,bechurch/rockstar,tyrchen/rockstar,jehb/rockstar,Endika/rockstar,haosdent/r... | examples/sql_rockstar.py | examples/sql_rockstar.py | from RockStar import RockStar
sql_code = "SELECT 'Hello World!';"
rock_it_bro = RockStar(days=400, file_name='hello_world.sql', code=sql_code)
rock_it_bro.make_me_a_rockstar()
| mit | Python | |
d5cf05e40b638afbf12fd95cf721a22ad0f3281d | Create appointments.py | Programmeerclub-WLG/Agenda-App | backend/appointments.py | backend/appointments.py | apache-2.0 | Python | ||
b017c43c9bf46cd2e1fd7380904a1b022b6930ba | Create __init__.py | ant6/beprof,DataMedSci/beprof,grzanka/beprof,DataMedSci/beprof,ant6/beprof | beprof/__init__.py | beprof/__init__.py | pass
| mit | Python | |
bb462e78221344d71a2605d4af042e5037db3e79 | add colorize.py script | richzhang/colorization,richzhang/colorization,richzhang/colorization | colorize.py | colorize.py | import numpy as np
import os
import skimage.color as color
import matplotlib.pyplot as plt
import scipy.ndimage.interpolation as sni
import caffe
import argparse
def parse_args():
parser = argparse.ArgumentParser(description='iColor: deep interactive colorization')
parser.add_argument('-img_in',dest='img_in',h... | bsd-2-clause | Python | |
753388550e4ea7a8b09ddb22189021be3585a5e5 | Clean PlexUpdate plugin | randybias/beets,Freso/beets,lengtche/beets,asteven/beets,m-urban/beets,imsparsh/beets,moodboom/beets,mosesfistos1/beetbox,jmwatte/beets,jackwilsdon/beets,mathstuf/beets,PierreRust/beets,tima/beets,mathstuf/beets,lightwang1/beets,ibmibmibm/beets,sadatay/beets,arabenjamin/beets,kareemallen/beets,tima/beets,mathstuf/beets... | beetsplug/plexupdate.py | beetsplug/plexupdate.py | """Updates an Plex library whenever the beets library is changed.
Put something like the following in your config.yaml to configure:
plex:
host: localhost
port: 32400
"""
import requests
from urlparse import urljoin
import xml.etree.ElementTree as ET
from beets import config
from beets.plugins impo... | """Updates an Plex library whenever the beets library is changed.
Put something like the following in your config.yaml to configure:
plex:
host: localhost
port: 32400
"""
import requests
from urlparse import urljoin
import xml.etree.ElementTree as ET
from beets import config
from beets.plugins impo... | mit | Python |
e5bdbfb075bf95b7834f2db8c7d6ffa69cb03bc0 | Create convnet_basic.py | AdityaSoni19031997/Machine-Learning,AdityaSoni19031997/Machine-Learning | Classifying_datasets/statoil/convnet_basic.py | Classifying_datasets/statoil/convnet_basic.py | adi
| mit | Python | |
6f3bb73dd387fd73022a20c3a45adf05213339cf | add new package (#20109) | iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/py-rosinstall-generator/package.py | var/spack/repos/builtin/packages/py-rosinstall-generator/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyRosinstallGenerator(PythonPackage):
"""A tool for generating rosinstall files."""
homepage = "https://wi... | lgpl-2.1 | Python | |
0cbb114a70bcbef266c6df776681d1c664d8bdae | Create superClock.py | jimfinoc/superClock | superClock.py | superClock.py | #This is My Nest but it will slowly be converted to superClock!
import urllib
import urllib2
import sys
import json
import time
# Make sure your higher level directory has the JSON file called passwordFile.json
# The file should contain the information in the JSON format. See below for an example
# {"username": "email... | apache-2.0 | Python | |
a2516d28c86fd23efcb893e59de42b33526bfe6f | Add a Python Tkinter example showing how to map a scale widget. | davidhernon/libmapper,johnty/libmapper,davidhernon/libmapper,radarsat1/libmapper,malloch/libmapper,malloch/libmapper,radarsat1/libmapper,libmapper/libmapper,radarsat1/libmapper,davidhernon/libmapper-admin2,johnty/libmapper,johnty/libmapper,malloch/libmapper,johnty/libmapper,radarsat1/libmapper,radarsat1/libmapper,libma... | swig/tkgui.py | swig/tkgui.py | #!/usr/bin/env python
import Tkinter
import sys
import mapper
def on_gui_change(x):
# print 'on_gui_change',x,x.__class__
sig_out.update_scalar(int(x))
def on_mapper_change(sig, x):
# print 'on_mapper_change', x, x.__class__
w.set(int(x))
dev = mapper.device("tkgui", 9000)
sig_in = mapper.signal(1, "... | lgpl-2.1 | Python | |
99578401585435c08aed6f29e090fbde955423fd | Create good2d.py | hpssjellis/easy-tensorflow-on-cloud9,hpssjellis/easy-tensorflow-on-cloud9,hpssjellis/easy-tensorflow-on-cloud9 | rocksetta-examples/good2d.py | rocksetta-examples/good2d.py | import tensorflow as tf
import numpy as np
# Create 100 phony x, y data points in NumPy, y = x * 0.1 + 0.3
x_data = np.random.rand(100).astype("float32")
y_data = x_data * 0.1 + 0.3
# Try to find values for W and b that compute y_data = W * x_data + b
# (We know that W should be 0.1 and b 0.3, but Tensorflow will
# f... | mit | Python | |
35e51f55adfbe8383bfb3d34688eb7aee89a8351 | add shuffle_by_year script, to toss messages into yearly folders | rtucker/imap2maildir,rtucker/imap2maildir | shuffle_by_year.py | shuffle_by_year.py | #!/usr/bin/env python
# Q&D script to sort mail into subfolders by year.
# Reduces the burden upon the filesystem gnomes.
DIRPATH = "/stor0/backups/imapbak/rtucker/Fastmail-rey_fmgirl_com"
import email
import mailbox
import imap2maildir
import sys
import time
import os
def main():
db = imap2maildir.open_sql_ses... | mit | Python | |
7423de8d2222e81693fe380a6b4c8638a96a9db8 | Create urls.py | arbin/pysoldev,arbin/pysoldev,arbin/pysoldev | urls.py | urls.py | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from pysoldev import settings
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^$', 'pysoldev.views.home', name='home'),
... | bsd-2-clause | Python | |
0079676729fa8023bea93fcf03bb48c4ff24a495 | add partition | dragonwolverines/DataStructures,dragonwolverines/DataStructures,dragonwolverines/DataStructures | resource-4/combinatorics/integer-partitions/partition1.py | resource-4/combinatorics/integer-partitions/partition1.py | # counting partitions
def partition1(n,k=-1):
if (k == -1):
return sum([partition1(n,i) for i in range(1,n+1)])
if (n < k):
return 0
if((n==0) or (n==1)):
return 1
if((k==1) or (n==k)):
return 1
return sum([partition1(n-k,i) for i in range(1,min(k,n-k)+1)])
| bsd-2-clause | Python | |
a787ceea91abf1c0fbeb3b97e063d3ec1aa61b57 | Create implement-rand10-using-rand7.py | tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015 | Python/implement-rand10-using-rand7.py | Python/implement-rand10-using-rand7.py | # Time: O(1)
# 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().
#
# Example 1:
#
# Input: 1
# Output: [7]
# Example 2:
#
# Input: 2
# Output... | mit | Python | |
b659dd572bd92e10bde8899540792bdb26529a45 | add qdb_test | mequanta/z-dyno,mequanta/z-dyno | scripts/qdb_test.py | scripts/qdb_test.py | from qdb import set_trace, RemoteCommandManager
def f():
in_f = True
return 'getting out of f'
def main():
set_trace(
uuid='qdb',
host='localhost',
port=8001,
cmd_manager=RemoteCommandManager(),
)
mutable_object = {}
print 'Hello world!'
f()
print mutabl... | mit | Python | |
5c02d7ccb9721e0b02cdd31edc36be095a4568e2 | test the Meta and the MetaMixin classes | samgiles/slumber,ministryofjustice/slumber,s-block/slumber,zongxiao/slumber,CloudNcodeInc/slumber,IAlwaysBeCoding/slumber,futurice/slumber,IAlwaysBeCoding/More,jannon/slumber,infoxchange/slumber | tests/meta.py | tests/meta.py | import unittest
import slumber
class MetaTestCase(unittest.TestCase):
def test_init_kwargs_to_attributes(self):
m = slumber.Meta(item1="test", item2=41, item3="example")
self.assertEqual(m.item1, "test")
self.assertEqual(m.item2, 41)
self.assertEqual(m.item3, "example")
class M... | bsd-2-clause | Python | |
4c3c9c6929ebc3f439ccf3bb7d3696f484b154bc | Add missing noop-migrations for PositiveIntegerField | Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet | karspexet/ticket/migrations/0017_positive_integers_20180322_2056.py | karspexet/ticket/migrations/0017_positive_integers_20180322_2056.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2018-03-22 19:56
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ticket', '0016_add_voucher_note_20180213_2307'),
]
op... | mit | Python | |
af508daaf016b824c7518a36f9b92f571f0f65af | Implement management command for creating demo records of balance history (NC-842) | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/structure/management/commands/init_balance_history.py | nodeconductor/structure/management/commands/init_balance_history.py | from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from nodeconductor.structure.models import BalanceHistory
from nodeconductor.structure.models import Customer
class Command(BaseCommand):
help = """ Initialize demo records of balance history """... | mit | Python | |
7f1883275e9aa0b489de99947db7daf87f616ed4 | solve k58 | WatsonDNA/nlp100,WatsonDNA/nlp100,wtsnjp/nlp100,wtsnjp/nlp100 | chap06/k58.py | chap06/k58.py | #
# usage: python k58.py {file name} {number}
#
import sys
from xml.etree import ElementTree as ET
def get_tuple(nll, dll):
return [[p, [n[1] for n in nl if n[0] == p][0],
[d[1] for d in dl if d[0] == p][0]]
for nl, dl in zip(nll, dll)
for p in list({n[0] for n in nl} & {d[... | unlicense | Python | |
a9d0a3dcc5221adbca5142a0cd7548ef874afd45 | add script to make matrix | nishio/learning_alloy,nishio/learning_alloy,nishio/learning_alloy | matrix/build_maxrix.py | matrix/build_maxrix.py | WIDTH = 10
HEIGHT = 10
HORIZONTAL_NEXT = "hnext"
VERTICAL_NEXT = "vnext"
BASE = "Cell"
print """
abstract sig %(BASE)s {
%(HORIZONTAL_NEXT)s: lone %(BASE)s,
%(VERTICAL_NEXT)s: lone %(BASE)s
}
""" % globals()
for x in range(WIDTH):
for y in range(HEIGHT):
print "one sig Cell_%d_%d extends %s {}" % (x, ... | mit | Python | |
98cbb29d008fc7abf1a066d9ecf7b3399395aefe | add users api | fkmclane/MCP,fkmclane/MCP,fkmclane/MCP,fkmclane/MCP | mcp/interface/users.py | mcp/interface/users.py | import json
from mcp import users
from mcp.interface import common
class UsersHandler(common.AuthorizedHandler):
def forbidden(self):
return True
def do_get(self):
return 200, json.dumps(list(iter(users.user_db)))
class UserHandler(common.AuthorizedHandler):
def __init__(self, request, response, groups):
c... | mit | Python | |
6e165165974f99a30ba6dce528d97c03152eeab6 | Add tracegraph script | rix0rrr/tracegraph | tracegraph.py | tracegraph.py | #!/usr/bin/python
import sys
import re
class Host(object):
def __init__(self, step, name, ip):
self.step = step
self.name = name
self.ip = ip
self.pings = []
def add_ping(self, ping):
self.pings.append(ping)
def max_ping(self):
return max(self.pings) if self.pings else 0
def min_ping... | mit | Python | |
8bc3c2c82b1b8f7e4582fe401c05c4c4f34cc345 | create structure for python | Southampton-Maritime-Robotics/autonomous-sailing-robot,smaria/autonomous-sailing-robot | src/boat_servo_sail/setup.py | src/boat_servo_sail/setup.py | ## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
## http://docs.ros.org/api/catkin/html/howto/format2/installing_python.html
## pdf download of the page in sources folder:
## docs-ros_installing_python.pdf
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetc... | bsd-2-clause | Python | |
dc3df810c3c6ffea429e43ec0f8e6f006a9c1c6f | Create tensorCase.py | saurabhrathor/Tensorflow_Practice | tensorCase.py | tensorCase.py | import tensorflow as tf
sess = tf.InteractiveSession()
x = tf.random_uniform([])
y = tf.random_uniform([])
out1 = tf.cond(tf.greater(x,y), lambda:tf.add(x,y), lambda:(tf.subtract(x,y)))
print(x.eval(), y.eval(), out1.eval())
x = tf.random_uniform([],-1,1)
y = tf.random_uniform([],-1,1)
def f1(): return tf.cast(tf.add... | bsd-2-clause | Python | |
6584d9e71c82097f65f316bf85b2f019350cfa58 | Add run_aiotest.py | overcastcloud/aioeventlet | run_aiotest.py | run_aiotest.py | import aioeventlet
import aiotest.run
import eventlet
config = aiotest.TestConfig()
config.new_event_pool_policy = aioeventlet.EventLoopPolicy
config.sleep = eventlet.sleep
aiotest.run.main(config)
| apache-2.0 | Python | |
50983c0a6d18e1ec8fcaed076f3c82b5935fe913 | Solve problem 23 | mazayus/ProjectEuler | problem023.py | problem023.py | #!/usr/bin/env python3
from itertools import *
def divisors(n):
for d in takewhile(lambda d: d * d <= n, count(1)):
if n % d == 0:
yield d
if n // d != d:
yield n // d
def is_abundant_number(n):
return n < sum(divisors(n)) - n
all_abundant = set(filter(is_abun... | mit | Python | |
8db65dc2a6a99a0e6287b12f7bfdcd423a62e515 | Add test running harness | hexahedria/gated-graph-transformer-network,hexahedria/gated-graph-transformer-network | run_harness.py | run_harness.py | import sys
import os
import subprocess
import shutil
import shlex
import collections
from babi_train import TrainExitStatus
from graceful_interrupt import GracefulInterruptHandler
TaskSpec = collections.namedtuple("TaskSpec", ["task_name", "variant_name", "run_params"])
def run(tasks_dir, output_dir, base_params, spe... | mit | Python | |
a423b0eb6277c260a16dc11f37088e496964cc0c | Create count-neighbours.py | aureooms/checkio | home/count-neighbours.py | home/count-neighbours.py | def checkio ( data ) :
if len( data ) < 10 : return False
if not any( c in data for c in "abcdefghijklmnopqrstuvwxyz" ) : return False
if not any( c in data for c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) : return False
if not any( c in data for c in "1234567890" ) : return False
return True
... | agpl-3.0 | Python | |
557d21ffbbbf5cb8a452d6bc0b4c013daf8eabdc | Add new migration | GoogleCloudPlatform/avocano,GoogleCloudPlatform/avocano,GoogleCloudPlatform/avocano,GoogleCloudPlatform/avocano | server/store/migrations/0003_alter_testimonial_reviewer_location.py | server/store/migrations/0003_alter_testimonial_reviewer_location.py | # Generated by Django 4.1.3 on 2022-11-14 02:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("store", "0002_initial"),
]
operations = [
migrations.AlterField(
model_name="testimonial",
name="reviewer_location",... | apache-2.0 | Python | |
0df48d7159841f66cc4e8dac8e9a52727c69091e | add testcase for settings() | 9nix00/cliez | test/model.py | test/model.py | # -*- coding: utf-8 -*-
import unittest
from cliez.conf import settings, Settings
class Model(object):
config_none = settings()
def __init__(self):
self.config = settings()
pass
pass
class ModelTestCase(unittest.TestCase):
def setUp(self):
Settings.bind('cliez.conf')
... | mit | Python | |
bb0e8032d325d2fd015a53d4513d632d12e8afb3 | Create pset2part3.py | somabc/6.00.1x,freckleboy/6.00.1x | pset2part3.py | pset2part3.py | balance = 270472
annualInterestRate = 0.21
# test case 1
# balance = 320000
# annualInterestRate = 0.2
# Lowest Payment: 29157.09
# test case 2
# balance = 999999
# annualInterestRate = 0.18
# Lowest Payment: 90325.03
epsilon = 0.01
lower = balance / 12
upper = balance * ((1 + annualInterestRate / 12.0) ** 12) / 12.0
... | mit | Python | |
3f64c94f51698ab69fc1996d73a04bde58da9052 | Update build script. | qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv | client/scripts/build-plugin.py | client/scripts/build-plugin.py | import os, sys
import ue4config
import ue4util, gitutil, shutil, uploadutil
plugin_version = gitutil.get_short_version('.')
plugin_output_folder = os.path.abspath('./unrealcv-%s' % plugin_version)
plugin_output_folder = ue4util.get_real_path(plugin_output_folder)
def build_plugin():
UAT_script = ue4config.conf['U... | import os, sys
import ue4config
import ue4util, gitutil, shutil, uploadutil
plugin_version = gitutil.get_short_version('.')
plugin_output_folder = os.path.abspath('./unrealcv-%s' % plugin_version)
def build_plugin():
UAT_script = ue4config.conf['UATScript']
if not os.path.isfile(UAT_script):
print('Ca... | mit | Python |
1765ac3a12ea2a56b4e25e05cf1f1b531de5b2cf | Add External Temperature Probe from OpenWeather | mattcongy/piprobe | pyexternal.py | pyexternal.py | #!/usr/bin/env python
# Get External Temperature from OpenWeatherMap
# External informations are :
# - temperature
# - humidity
# - pressure
# - precipitation volume (each 3h)
import urllib.request
import json
import pyowm
from datetime import datetime
from pyserial import pySerial
from imports.pyTemperature import p... | mit | Python | |
9a37f573aa985b3bd876c2df4c3f83670fddab42 | add script to set script permissions | SublimeText/NSIS | chmod.py | chmod.py | import os, stat, sublime, sublime_plugin
# Configuration
pkg = 'NSIS'
script = sublime.packages_path() + '/' + pkg + '/nsis_build.sh'
def plugin_loaded():
from package_control import events
# chmod +x <script>
if (events.install(pkg) or events.post_upgrade(pkg)) and os.name is 'posix' or 'mac':
s... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.