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 |
|---|---|---|---|---|---|---|---|---|
5e42ed2908f6186db4da92f283ca9b9b30ac9e31 | Add executable file | XENON1T/pax,XENON1T/pax | bin/paxit.py | bin/paxit.py | #!/usr/bin/env python
from pax import pax
if __name__ == '__main__':
pax.Processor(input='DumbExample.DumbExampleInput',
transform='DumbExample.DumbExampleTransform',
output='DumbExample.DumbExampleOutput')
| bsd-3-clause | Python | |
74c2563f55c71ff8d3d2cbb7ff2b69a4be8767ec | Create client.py | dissembledstar/covertcomms | client.py | client.py | #!/usr/bin/env python
# TODO take user choice for c2 method
# TODO start with pipe delimited HTTP POST data to test
# TODO loop and output to STDOUT
| mit | Python | |
6693c02315ba16c8a849c7a1892397bf819a2efd | Add meshDisplay commands | minoue/miExecutor | app/module/polygon/meshDisplay.py | app/module/polygon/meshDisplay.py | import maya.cmds as cmds
import maya.mel as mel
# class name must be 'Commands'
class Commands(object):
commandDict = {}
def _applyColor(self):
mel.eval("polyColorPerVertex -r 0.5 -g 0.5 -b 0.5 -a 1 -cdo;")
commandDict['applyColor'] = "polyApplyColor.png"
def _paintVertexColorT... | mit | Python | |
65df19a82df1432f72674eb35765937aa6c889eb | Add migration removing database columns following removal of FileUpload fields (#16035) | mozilla/olympia,mozilla/addons-server,wagnerand/addons-server,mozilla/olympia,mozilla/addons-server,wagnerand/addons-server,mozilla/addons-server,diox/olympia,bqbn/addons-server,wagnerand/addons-server,mozilla/olympia,bqbn/addons-server,diox/olympia,diox/olympia,mozilla/olympia,bqbn/addons-server,wagnerand/addons-serve... | src/olympia/files/migrations/0005_auto_20201120_0926.py | src/olympia/files/migrations/0005_auto_20201120_0926.py | # Generated by Django 2.2.17 on 2020-11-20 09:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('files', '0004_auto_20200923_1808'),
]
operations = [
migrations.RemoveIndex(
model_name='fileupload',
name='file_uploads_af... | bsd-3-clause | Python | |
48d7fc87c51cb15829e9cf161b38dc004affee9e | ADD example_sequential | automl/auto-sklearn,automl/auto-sklearn | example/example_sequential.py | example/example_sequential.py | import sklearn.cross_validation
import sklearn.datasets
import sklearn.metrics
import autosklearn.classification
def main():
digits = sklearn.datasets.load_digits()
X = digits.data
y = digits.target
X_train, X_test, y_train, y_test = \
sklearn.cross_validation.train_test_split(X, y, random_st... | bsd-3-clause | Python | |
3246873aad0482b9087663f452c2fe32c37daa36 | Add new migration | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/icds_reports/migrations/0101_auto_20190227_1801.py | custom/icds_reports/migrations/0101_auto_20190227_1801.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-02-27 18:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0100_add_supervisor_id'),
]
operations = [
migrations.Alte... | bsd-3-clause | Python | |
d7cd9951581df833ac3e6eecd099035f2d30df0e | Add initial Starling mapping | reubano/csv2ofx,reubano/csv2ofx | csv2ofx/mappings/starling.py | csv2ofx/mappings/starling.py | from __future__ import (
absolute_import, division, print_function, unicode_literals)
from operator import itemgetter
def fixdate(ds):
dmy = ds.split('/')
# BUG (!?): don't understand but stolen from ubs-ch-fr.py
return '.'.join((dmy[1], dmy[0], dmy[2]))
mapping = {
'has_header': True,
'date... | mit | Python | |
67a5e2797e362bb5a38b8af5b05cf72d1e28a262 | add import script for Wokingham (closes #795) | chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | polling_stations/apps/data_collection/management/commands/import_wokingham.py | polling_stations/apps/data_collection/management/commands/import_wokingham.py | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = 'E06000041'
addresses_name = 'parl.2017-06-08/Version 1/merged.tsv'
stations_name = 'parl.2017-06-08/Version 1/merged.tsv'
elections = ['parl.2017-06-08']
... | bsd-3-clause | Python | |
6972c0c7050bc68c10361dce02fb227df6426fe9 | convert LUNA16 to jpg and png | ALISCIFP/tensorflow-resnet-segmentation,ALISCIFP/tensorflow-resnet-segmentation | convert_mhd2jpg_png_LUNA16.py | convert_mhd2jpg_png_LUNA16.py | #!/usr/bin/env python
# This script belongs to https://github.com/
import os,glob
import argparse
import numpy as np
import SimpleITK as sitk
from PIL import Image
import cv2
import scipy.misc
DATA_DIRECTORY = '/home/zack/Data/LUNA16/'
OUT_DIRECTORY = "/home/zack/Data/LUNA16/"
def mhd2ndarray(data_file):
itk... | mit | Python | |
c86b61a23ad9b3a152bb6644cb5dde5a4b42fbc9 | Add Management Command to Dump Project and RemoteRepository Relationship in JSON format | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | readthedocs/projects/management/commands/dump_project_remote_repo_relation.py | readthedocs/projects/management/commands/dump_project_remote_repo_relation.py | import json
from django.core.management.base import BaseCommand
from readthedocs.projects.models import Project
class Command(BaseCommand):
help = "Dump Project and RemoteRepository Relationship in JSON format"
def handle(self, *args, **options):
data = []
queryset = Project.objects.filter... | mit | Python | |
03733ada2ec1ea7b9aeca76d9dc1a0ebfc1c0db7 | Add script to mask out a region of interest in an image | aguijarro/SelfDrivingCar | FindingLaneLines/ColorRegionCombined.py | FindingLaneLines/ColorRegionCombined.py | # Code uses to mask out a region of interest in an image
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
# Read in the image and print out some stats
# Note: in the previous example we were reading a .jpg
# Here we read a .png and convert to 0,255 bytescale
image = (mpimg.imread('t... | mit | Python | |
64c7bb3d9e924c5651e85229ea5451c8a808bf04 | add show_graph.py | rb-roomba/music | goldberg/show_graph.py | goldberg/show_graph.py | #! /usr/bin/python
# -*- coding: utf-8 -*-
import cPickle as pickle
import matplotlib.pyplot as plt
import numpy as np
import seaborn
import pandas as pd
import matplotlib.cm as cm
def pitch(height):
""" Calculate pitch of given height. """
cde_list = ["c","d","e","f","g","a","b"]
return cde_list[height %... | mit | Python | |
0f92843ec20007dc4379ff88d2e711bdad5e9125 | Add ftp module, the backend for salt-ftp | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/cli/ftp.py | salt/cli/ftp.py | '''
The ftp module is used to execute the logic used by the salt-ftp command
line application, salt-ftp is NOT intended to broadcast large files, it is
intened to handle text files.
Salt-ftp can be used to distribute configuration files
'''
# Import python modules
import os
import stat
import sys
# Import salt modules
... | apache-2.0 | Python | |
b6e0daa9ee06961743ad5a5f728f3385bfdb0b4c | Add a helper script to apply changes in zuul | EntropyWorks/bifrost,bcornec/bifrost,juliakreger/bifrost,devananda/bifrost,openstack/bifrost,openstack/bifrost,EntropyWorks/bifrost,devananda/bifrost,bcornec/bifrost,juliakreger/bifrost | playbooks/roles/ironic-install/files/parse_zuul_changes.py | playbooks/roles/ironic-install/files/parse_zuul_changes.py | #!/usr/bin/env python
# (c) 2015, Hewlett-Packard Development Company, L.P.
#
# This module 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 3 of the License, or
# (at your option) any later ver... | apache-2.0 | Python | |
855fe9e95651626c2737c65424ad1067f253e28a | Implement invisible user mode | Heufneutje/txircd,ElementalAlchemist/txircd | txircd/modules/rfc/umode_i.py | txircd/modules/rfc/umode_i.py | from twisted.plugin import IPlugin
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class InvisibleMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "InvisibleMode"
core = True
affe... | bsd-3-clause | Python | |
cfec967be4602dff636adb951b582d1db114f578 | Add single dataset doc gen | tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets | tensorflow_datasets/scripts/document_dataset_version.py | tensorflow_datasets/scripts/document_dataset_version.py | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 | |
ba5a251896e51bab70fa6b664e6974d3c42ff7b4 | add asciidoctor gem (#9905) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack | var/spack/repos/builtin/packages/asciidoctor/package.py | var/spack/repos/builtin/packages/asciidoctor/package.py | # Copyright 2013-2018 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)
from spack import *
class Asciidoctor(Package):
"""Modern asciidoc tool based on ruby"""
homepage = "https://as... | lgpl-2.1 | Python | |
a189203bf2dc7ddd925ed8cfbeb191ee52d43711 | Add Python script to investigate s3 speeds | AcidLeroy/OpticalFlow,AcidLeroy/OpticalFlow,AcidLeroy/OpticalFlow,AcidLeroy/OpticalFlow | src/aws_scripts/benchmark_s3.py | src/aws_scripts/benchmark_s3.py | from __future__ import print_function
import boto3
import subprocess
import os
import pandas as pd
import time
def DownloadFile(local_file, bucket, bucket_path):
print("Downloading file...", end="")
s3 = boto3.resource('s3')
s3.Bucket(bucket).download_file(bucket_path, local_file)
print("Done!")
def U... | mit | Python | |
a78e2566d26b229192e94fecb3c89801afbdce02 | Create MQTT.py | sstocker46/pyrobotlab,mecax/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,mecax/pyrobotlab,sstocker46/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,sstocker46/pyrobotlab,MyRobotLab/pyrobotlab | service/MQTT.py | service/MQTT.py | from time import sleep
topic = "mrl"
qos = 2
broker = "tcp://iot.eclipse.org:1883" //if you have your own just change the hostname/IP
clientID = "MRL MQTT python"
mqtt1 = Runtime.createAndStart("mqtt", "MQTT")
mqtt1.startService()
print mqtt1.getDescription()
mqtt1.startClient(topic, qos, broker, clientID)
sleep(1)
... | apache-2.0 | Python | |
40907535fcae6771dad5f4ee5825fef56bfe7fa0 | Add test for teuthology.suite.build_email_body() | dreamhost/teuthology,dreamhost/teuthology,michaelsevilla/teuthology,SUSE/teuthology,robbat2/teuthology,ktdreyer/teuthology,zhouyuan/teuthology,dmick/teuthology,tchaikov/teuthology,ceph/teuthology,ivotron/teuthology,zhouyuan/teuthology,ktdreyer/teuthology,t-miyamae/teuthology,caibo2014/teuthology,caibo2014/teuthology,t-... | teuthology/test/test_suite.py | teuthology/test/test_suite.py | #!/usr/bin/env python
from nose.tools import (
eq_ as eq,
assert_equal,
assert_raises,
with_setup,
)
import os
import shutil
import random
import yaml
from .. import suite
archive_base_dir = 'test_archive'
def get_random_metadata(name, hung=False):
"""
Generate a random info dict for a fake... | mit | Python | |
2f0be29357a8b649b59cd685eb6dea646813feac | Add discovery example (#361) | balloob/pychromecast,dominikkarall/pychromecast,balloob/pychromecast | examples/discovery_example.py | examples/discovery_example.py | """
Example that shows how to receive updates on discovered chromecasts.
"""
import argparse
import logging
import time
import pychromecast
parser = argparse.ArgumentParser(description="Example on how to receive updates on discovered chromecasts.")
parser.add_argument("--show-debug", help="Enable debug log", action="... | mit | Python | |
182d4229f6293eec791a5eba716917ace3bcfaca | Make looking for outliers easier | e-koch/canfar_scripts,e-koch/canfar_scripts | cal_pipe/manual_outlier_flag.py | cal_pipe/manual_outlier_flag.py |
import sys
'''
Check for garbage points in a MS by SPW.
'''
try:
vis_name = sys.argv[1]
corrstring = sys.argv[2]
starting_spw = int(sys.argv[3])
except IndexError:
vis_name = raw_input("MS Name? : ")
corrstring = raw_input("Corrstring? : ")
starting_spw = int(raw_input("SPW to start at? : "))... | mit | Python | |
0c6ce9d5752dfe1f4306c87c2b25a529175ff106 | Add comicpull. A basic comic pull-list manager. | xchewtoyx/comicmgt,xchewtoyx/comicmgt | comicpull.py | comicpull.py | #!/usr/bin/python
# Copyright 2013 Russell Heilling
# pylint: disable=C0103
'''Comic pull-list management.
Manage titles on pull-list and add new titles to toread list.
'''
import logging
import os
import sqlite3
import sys
import args
from calibredb import CalibreDB, set_log_level
ARGS = args.ARGS
args.add_argumen... | mit | Python | |
9f6c1306e443f74dbf108def2a25c44c33f2bec1 | Add a serial test | simotek/tanko-bot,simotek/tanko-bot,simotek/tanko-bot | src/test-serial.py | src/test-serial.py | # RobotMain - Simon Lees simon@simotek.net
# Copyright (C) 2015 Simon Lees
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any l... | lgpl-2.1 | Python | |
8bf7b5ae2464721be8270b159b99cd728109f000 | Create __init__.py | jrbadiabo/Coursera-Stanford-ML-Class | Python_Version/Ex7.K-Means_PCA_-_Clustering/__init__.py | Python_Version/Ex7.K-Means_PCA_-_Clustering/__init__.py | mit | Python | ||
13056d362fceb0aa20487a440c7347ad4231ea97 | Add tiltoc.py | raycon/til | tiltoc.py | tiltoc.py | import os
from datetime import datetime
# Directory
root = os.getcwd()
# Exclude
excludes = (root, "drafts")
def relative(root, path):
return '/'.join(path.replace(root, '').split(os.path.sep)[1:])
def tils(root):
for (path, dirs, files) in os.walk(root):
dirs[:] = [d for d in dirs if d not in exclu... | mit | Python | |
7fa62ea8374c839f8f188f34505de4d3114e6b56 | Create app.py | Fillll/reddit2telegram,Fillll/reddit2telegram,nsiregar/reddit2telegram,nsiregar/reddit2telegram | channels/r_BetterEveryLoop/app.py | channels/r_BetterEveryLoop/app.py | #encoding:utf-8
from utils import get_url, weighted_random_subreddit
# Subreddit that will be a source of content
subreddit = weighted_random_subreddit({
'BetterEveryLoop': 1.0,
# If we want get content from several subreddits
# please provide here 'subreddit': probability
# 'any_other_subreddit': 0.... | mit | Python | |
7a8c6520beb7dfb086d1c9b5254e7083d694f35c | check for globals in the lib that are not prefixed with toku. addresses #74 | percona/PerconaFT,ollie314/server,davidl-zend/zenddbi,davidl-zend/zenddbi,ottok/PerconaFT,flynn1973/mariadb-aix,percona/PerconaFT,ollie314/server,BohuTANG/ft-index,kuszmaul/PerconaFT-tmp,kuszmaul/PerconaFT,ollie314/server,flynn1973/mariadb-aix,kuszmaul/PerconaFT,ollie314/server,ottok/PerconaFT,davidl-zend/zenddbi,david... | src/tokuglobals.py | src/tokuglobals.py | #!/usr/bin/python
import sys
import os
import re
def checkglobals(libname, exceptsymbols, verbose):
badglobals = 0
nmcmd = "nm -g " + libname
f = os.popen(nmcmd)
b = f.readline()
while b != "":
match = re.match("^([0-9a-f]+)\s(.?)\s(.*)$", b)
if match == None:
match = r... | agpl-3.0 | Python | |
f709f00e5c4e112774cebbc7ab3f546354290da8 | Create human_readable_time.py | Kunalpod/codewars,Kunalpod/codewars | human_readable_time.py | human_readable_time.py | #Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Human Readable Time
#Problem level: 5 kyu
def make_readable(seconds):
s = '{:0>2}'.format(seconds%60)
m = '{:0>2}'.format((seconds//60)%60)
h = '{:0>2}'.format(seconds//3600)
return ':'.join([h,m,s])
| mit | Python | |
56e51e48de854c83870549c1cab2893c24116734 | add tests | brennerm/check-mk-web-api | check_mk_web_api/test_WebApi.py | check_mk_web_api/test_WebApi.py | import os
import pytest
from check_mk_web_api import WebApi, CheckMkWebApiException
api = WebApi(
os.environ['CHECK_MK_URL'],
os.environ['CHECK_MK_USER'],
os.environ['CHECK_MK_SECRET']
)
def setup():
api.delete_all_hosts()
def test_add_host():
api.add_host('host00')
assert 'host00' in api... | mit | Python | |
bb638c49f0a73289392e63dff7bec6e9b49b8199 | Add a simple wrapper around losetup | robertbreker/ffs,xapi-project/ffs,djs55/ffs,franciozzy/ffs | datapath/raw+file/losetup.py | datapath/raw+file/losetup.py | #!/usr/bin/env python
import xapi
import commands
def log(txt):
print >>sys.stderr, txt
# [run dbg cmd] executes [cmd], throwing a BackendError if exits with
# a non-zero exit code.
def run(dbg, cmd):
code, output = commands.getstatusoutput(cmd)
if code <> 0:
log("%s: %s exitted with code %d: %s"... | lgpl-2.1 | Python | |
79f7a947d9fbf1903957aea0ef459bee53d2ba82 | use subnet_service_types extension from neutron-lib | mahak/neutron,openstack/neutron,mahak/neutron,openstack/neutron,openstack/neutron,mahak/neutron | neutron/extensions/subnet_service_types.py | neutron/extensions/subnet_service_types.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... | # 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 |
cd8110b0ca4d53477b8331af2317e267da057df6 | add example 'audit' where chat is replicated in a secondary space | bernard357/shellbot | examples/audit.py | examples/audit.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, ... | apache-2.0 | Python | |
0229c868a8f204759c76ecae92cecc4e7a6312b5 | Add link module + Link class stub | thisissoon/Flask-HAL,thisissoon/Flask-HAL | flask_hal/link.py | flask_hal/link.py | #!/usr/bin/env python
# encoding: utf-8
"""
flask_hal.link
==============
Implements the ``HAL`` Link specification.
"""
class Link(object):
"""
"""
def __init__(
self,
href,
name=None,
title=None,
link_type=None,
deprecation=None,... | unlicense | Python | |
34206ab96b5546e617b1478f59357a6a3f7ed8b6 | Add a custom gunicorn Sync worker implementation which works around some issues which occur when eventlet monkey patching is used with sync worker. | nzlosh/st2,emedvedev/st2,StackStorm/st2,peak6/st2,tonybaloney/st2,lakshmi-kannan/st2,lakshmi-kannan/st2,punalpatel/st2,Plexxi/st2,nzlosh/st2,Plexxi/st2,peak6/st2,lakshmi-kannan/st2,Plexxi/st2,StackStorm/st2,tonybaloney/st2,pixelrebel/st2,StackStorm/st2,punalpatel/st2,nzlosh/st2,punalpatel/st2,pixelrebel/st2,pixelrebel/... | st2common/st2common/util/gunicorn_workers.py | st2common/st2common/util/gunicorn_workers.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 | Python | |
1650824ef5886a12715bd0004e95ab3bf4dc5dfd | Add new package: phoenix (#18143) | LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack | var/spack/repos/builtin/packages/phoenix/package.py | var/spack/repos/builtin/packages/phoenix/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)
from spack import *
class Phoenix(Package):
"""Apache Phoenix is a SQL skin over HBase delivered as a client-embedde... | lgpl-2.1 | Python | |
7b688747a02f9ac29d4f119bf142f7ef0ad805e9 | Test for COM collections; IEnumVariant so far only. | denfromufa/comtypes,denfromufa/comtypes,denfromufa/comtypes,denfromufa/comtypes,denfromufa/comtypes | comtypes/test/test_collections.py | comtypes/test/test_collections.py | import unittest
from comtypes.client import CreateObject, GetModule #, Constants
from find_memleak import find_memleak
from ctypes import ArgumentError
class Test(unittest.TestCase):
def test_IEnumVARIANT(self):
# The XP firewall manager.
fwmgr = CreateObject('HNetCfg.FwMgr')
# apps has a ... | mit | Python | |
f45848477043d933119180e1229b841372b86240 | Add sensor for Dweet.io | Zyell/home-assistant,oandrew/home-assistant,jaharkes/home-assistant,fbradyirl/home-assistant,tboyce1/home-assistant,happyleavesaoc/home-assistant,miniconfig/home-assistant,ewandor/home-assistant,Zac-HD/home-assistant,leoc/home-assistant,robbiet480/home-assistant,ma314smith/home-assistant,philipbl/home-assistant,morphis... | homeassistant/components/sensor/dweet.py | homeassistant/components/sensor/dweet.py | """
homeassistant.components.sensor.dweet
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Displays values from Dweet.io..
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.dweet/
"""
from datetime import timedelta
import logging
import homeassistant.util as u... | mit | Python | |
c0cc954686c7ababe2d3fba6e563e955e85d9caf | add individual migration script | macarthur-lab/xbrowse,macarthur-lab/xbrowse,ssadedin/seqr,ssadedin/seqr,macarthur-lab/seqr,macarthur-lab/seqr,macarthur-lab/seqr,ssadedin/seqr,macarthur-lab/xbrowse,ssadedin/seqr,macarthur-lab/xbrowse,macarthur-lab/xbrowse,macarthur-lab/seqr,ssadedin/seqr,macarthur-lab/seqr,macarthur-lab/xbrowse | xbrowse_server/base/management/commands/transfer_missing_family_individuals_to_different_project.py | xbrowse_server/base/management/commands/transfer_missing_family_individuals_to_different_project.py | from django.core.management.base import BaseCommand
from seqr.views.apis.pedigree_image_api import update_pedigree_images
from xbrowse_server.base.models import Project as BaseProject, Family as BaseFamily, Individual as BaseIndividual
from xbrowse_server.base.model_utils import create_xbrowse_model, update_xbrowse_mo... | agpl-3.0 | Python | |
e055cc963eb5eb05c2685ae75d1614c81ef3c59a | load qld data into elasticsearch | uq-eresearch/eheritage,uq-eresearch/eheritage,uq-eresearch/eheritage | injest/search_index.py | injest/search_index.py | # -*- coding: utf-8 -*-
"""
This module contains the code for putting heritage places into a search index.
"""
from elasticsearch import Elasticsearch
ES_HOST = "192.168.10.200"
es = Elasticsearch(ES_HOST)
def add_heritage_place(place):
"""Add a heritage place to the search index
:param place: Dictionar... | bsd-3-clause | Python | |
7cc0f1cc461d6ccd4c191ec243184deab7f1028f | Create strings.py | delimitry/python_utils | strings/strings.py | strings/strings.py | mit | Python | ||
6917e3b8689ace77bda912f82163f0f91a1a881b | Solve conflict in DB schema for circle CI | sonicyang/chiphub,sonicyang/chiphub,sonicyang/chiphub | digikey/migrations/0022_merge.py | digikey/migrations/0022_merge.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('digikey', '0019_merge'),
('digikey', '0021_auto_20151125_1353'),
]
operations = [
]
| mit | Python | |
2067c07cf1dc9029bf3cea372d7cc70297c7743e | Add jsonable_boundaries module | sprin/jsonable-boundaries | jsonable_boundaries.py | jsonable_boundaries.py | """
`jsonable` is just a cute shortening of JSON-serializable,
but it also means that the object is pure data, and does not
drag any (publicly-accessible) behavior with it.
Anything that can be serialized by the default simplejson
http://simplejson.readthedocs.org/en/latest/#encoders-and-decoders
serializer would cou... | mit | Python | |
875ca73c4cab4c3d036f824c3942589f0ced935f | Test password update | m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps | tests/services/authentication/test_update_password_hash.py | tests/services/authentication/test_update_password_hash.py | """
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.authentication.password.models import Credential
from byceps.services.authentication.password import service as password_service
from byceps.services.user import event_service
from tests.base impor... | bsd-3-clause | Python | |
4b040fd365c2a8609b2943525b87c2e27924eb19 | add novaclient sample | li-ma/homework,li-ma/homework,li-ma/homework | test-novaclient.py | test-novaclient.py | from novaclient.v1_1.client import Client
context = {
'user': 'admin',
'auth_token': '22b07d939fa544769bf625753ecaec18',
'tenant': '7dfd3b6a98664f7cb78808f57b7984da',
}
# nova_compute_url
url = 'http://192.168.242.10:8774/v2/7dfd3b6a98664f7cb78808f57b7984da'
PROXY_AUTH_URL = 'http://192.168.242.10:5000/v2... | apache-2.0 | Python | |
1d355343700bd74ebc2944053e5086a22c1c0b5c | add post-commit.py | arssivka/rrc,arssivka/rrc,arssivka/rrc,arssivka/rrc | git/post-commit.py | git/post-commit.py | #!/usr/bin/python
import os
import re
import subprocess as sp
def up_version(ver, idx):
ver[idx] += 1
return ver[:idx + 1] + [0] * (3 - idx)
commands = {
'#vtwe++': lambda ver: up_version(ver, 3),
'#vpat++': lambda ver: up_version(ver, 2),
'#vmin++': lambda ver: up_version(ver, 1),
'#vmaj++':... | apache-2.0 | Python | |
2b5500154b8be9ee7760bb1cb883775a604a2d8f | Create appleproduct_checker.py | darrenfu/bigdata | tools/scripts/python/appleproduct_checker.py | tools/scripts/python/appleproduct_checker.py | #!/usr/bin/python
import sys
import os
class IParser:
def __init__():
pass
def parse(self, doc, out_file):
self._doc = doc
self._out_file = out_file
class JSONParser(IParser):
def __init__(self):
pass
def parse(self, doc, out_file, model):
import json
out_arr = []
IParser.parse... | apache-2.0 | Python | |
b778e3438909d290ce88bbb0d187aa793652ff5e | Create euler2.py | Dovydas-Kr/dt211c-cloud-repo | euler2.py | euler2.py | mit | Python | ||
fe7e82257703e3c5773d3e321435cb4443eed46d | Add gunicorn configuration file | hombit/olgart,hombit/olgart,hombit/olgart,hombit/olgart | gunicorn_config.py | gunicorn_config.py | import multiprocessing, os.path
command = '/usr/local/bin/gunicorn'
pythonpath = os.path.dirname( os.path.abspath(__file__) )
bind = '127.0.0.1:9000'
workers = multiprocessing.cpu_count() * 2 + 1
user = 'nobody'
| mit | Python | |
91370b54e4a974fe51f563edda75e2738d3fb00c | Add noise sensor | pvizeli/ha-ffmpeg | haffmpeg/sensor.py | haffmpeg/sensor.py | """For HA camera components."""
from .core import HAFFmpegQue
class SensorNoise(HAFFmpegQue):
"""Implement a noise detection on a autio stream."""
def __init__(self, ffmpeg_bin):
"""Init CameraMjpeg."""
HAFFmpegQue.__init__(self, ffmpeg_bin=ffmpeg_bin)
self._peak = -30
self._... | bsd-3-clause | Python | |
65f05e93edc2e9a7033edb8d54bd25b04c32d084 | test script.. | pymad/cpymad,pymad/jpymad,pymad/jpymad,pymad/jpymad,pymad/cpymad | test_elemaccess.py | test_elemaccess.py | from cern import cpymad
lhc=cpymad.model('lhc')
print lhc.get_sequences()
all_elements=lhc.get_element_list('lhcb1')
print lhc.get_element('lhcb1',all_elements[3])
| apache-2.0 | Python | |
10ac7ea7a67b7a15146ae7c9c0ba9ba74876df81 | Add a testcase for RubyGems | lilydjwg/nvchecker | tests/test_gems.py | tests/test_gems.py | from tests.helper import ExternalVersionTestCase
class RubyGemsTest(ExternalVersionTestCase):
def test_gems(self):
self.assertEqual(self.sync_get_version("example", {"gems": None}), "1.0.2")
| mit | Python | |
e9115cb3c52386dc7b74b4d06070b44697725811 | Add manage.py | glegoux/django-settings-startup | tests/manage.py | tests/manage.py | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| mit | Python | |
9eaf735bcdba9f3fd8a51219d0eebb61f8b2f166 | add 20.6.7 | LLNL/spack,tmerrick1/spack,matthiasdiener/spack,tmerrick1/spack,EmreAtes/spack,lgarren/spack,EmreAtes/spack,iulian787/spack,lgarren/spack,TheTimmy/spack,LLNL/spack,mfherbst/spack,mfherbst/spack,TheTimmy/spack,iulian787/spack,tmerrick1/spack,LLNL/spack,matthiasdiener/spack,matthiasdiener/spack,krafczyk/spack,mfherbst/sp... | var/spack/repos/builtin/packages/py-setuptools/package.py | var/spack/repos/builtin/packages/py-setuptools/package.py | from spack import *
class PySetuptools(Package):
"""Easily download, build, install, upgrade, and uninstall Python packages."""
homepage = "https://pypi.python.org/pypi/setuptools"
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-11.3.tar.gz"
version('20.6.7', '45d6110f3ec14... | from spack import *
class PySetuptools(Package):
"""Easily download, build, install, upgrade, and uninstall Python packages."""
homepage = "https://pypi.python.org/pypi/setuptools"
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-11.3.tar.gz"
version('20.5', 'fadc1e1123ddbe3... | lgpl-2.1 | Python |
bcc48ecba38450bd77b5dcce7ae60d2966cbd7d2 | Migrate object_sections to relationships | kr41/ggrc-core,uskudnik/ggrc-core,kr41/ggrc-core,NejcZupec/ggrc-core,prasannav7/ggrc-core,andrei-karalionak/ggrc-core,NejcZupec/ggrc-core,jmakov/ggrc-core,hasanalom/ggrc-core,jmakov/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,uskudnik/ggrc-core,hasanalom/ggrc-core,uskudnik/ggrc-core,AleksNeStu/gg... | src/ggrc/migrations/versions/20150521150652_23880aa43323_migrate_object_sections_to_relationships.py | src/ggrc/migrations/versions/20150521150652_23880aa43323_migrate_object_sections_to_relationships.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""Migrate object_sections to relationships
Revision ID: 23880aa43323
Revises: ... | apache-2.0 | Python | |
2f0bf45ec747778d38801892e97d5a902443841d | Define "Assessment updated" notification type | VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core | src/ggrc/migrations/versions/20170207134238_562ec606ff7c_add_assessment_updated_notification_type.py | src/ggrc/migrations/versions/20170207134238_562ec606ff7c_add_assessment_updated_notification_type.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add Assessment updated notification type
Create Date: 2017-02-07 13:42:38.921370
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from ... | apache-2.0 | Python | |
3ec80d1a0de750af7831cca5a29294558600e88f | Add python_bootstrap.py | GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-pl... | xunit-autolabeler-v2/ast_parser/python/python_bootstrap.py | xunit-autolabeler-v2/ast_parser/python/python_bootstrap.py | # Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python | |
3ccc8357d5d5466acc97f1b065f500e9b096eeb7 | add exception for cursor | havt/odoo,xujb/odoo,shaufi10/odoo,omprakasha/odoo,lgscofield/odoo,dariemp/odoo,colinnewell/odoo,alqfahad/odoo,Eric-Zhong/odoo,Gitlab11/odoo,fdvarela/odoo8,Gitlab11/odoo,ShineFan/odoo,hanicker/odoo,abdellatifkarroum/odoo,papouso/odoo,doomsterinc/odoo,dgzurita/odoo,nagyistoce/odoo-dev-odoo,SerpentCS/odoo,idncom/odoo,mmbt... | addons/mrp/wizard/wizard_procurement.py | addons/mrp/wizard/wizard_procurement.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | agpl-3.0 | Python |
f1145fc98f825b20452dd924d287349b4a8ae628 | Update templates.py | googlefonts/oss-fuzz,google/oss-fuzz,ssbr/oss-fuzz,FeliciaLim/oss-fuzz,skia-dev/oss-fuzz,skia-dev/oss-fuzz,robertswiecki/oss-fuzz,googlefonts/oss-fuzz,skia-dev/oss-fuzz,ssbr/oss-fuzz,oliverchang/oss-fuzz,robertswiecki/oss-fuzz,google/oss-fuzz,vitalybuka/oss-fuzz,kcc/oss-fuzz,ssbr/oss-fuzz,ssbr/oss-fuzz,google/oss-fuzz,... | infra/templates.py | infra/templates.py | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 | Python |
4efc039389b9aab3813a3815a58281c898f1acfd | Create user_exceptions.py | ahhh/SPSE,thedarkcoder/SPSE | user_exceptions.py | user_exceptions.py | #/bin/python
# Python program for playing around with user defined exceptions
class TooSmallError(Exception):
message = "Too small! Try again ;)"
class TooBigError(Exception):
message = "Too big! Try again ;)"
class ExactError(Exception):
def __init__(self):
print "HAHAHA You hit the trap"
class unhand... | mit | Python | |
fe11a1b638b1779e51da87eaa30f1f12b2d0911c | Add a module for known data models: CDS, ECMWF, etc. | ecmwf/cfgrib | cf2cdm/datamodels.py | cf2cdm/datamodels.py | #
# Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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 | |
b6303a18051f5bc050c141b72935b9a87c752a59 | move into separate module | hdm-dt-fb/rvt_model_services,hdm-dt-fb/rvt_model_services | utils/rms_paths.py | utils/rms_paths.py | import pathlib
from collections import namedtuple
def get_paths(prj_root):
"""
Maps path structure into a namedtuple.
:return:dict: namedtuple paths
"""
root_dir = pathlib.Path(prj_root).absolute().parent
RMSPaths = namedtuple("RMSPaths", "root logs warnings commands journals com_warnings com_... | mit | Python | |
1a1ee9eff1f04d6e40c9288e15dc3fad7515c2b8 | Make a unittest for CArray class | rezoo/chainer,keisuke-umezawa/chainer,ronekko/chainer,ktnyt/chainer,chainer/chainer,wkentaro/chainer,wkentaro/chainer,okuta/chainer,ktnyt/chainer,chainer/chainer,wkentaro/chainer,aonotas/chainer,pfnet/chainer,kashif/chainer,jnishi/chainer,hvy/chainer,okuta/chainer,niboshi/chainer,keisuke-umezawa/chainer,niboshi/chainer... | tests/cupy_tests/core_tests/test_carray.py | tests/cupy_tests/core_tests/test_carray.py | import unittest
import cupy
from cupy import testing
class TestCArray(unittest.TestCase):
def test_size(self):
x = cupy.arange(3).astype('i')
y = cupy.ElementwiseKernel(
'raw int32 x', 'int32 y', 'y = x.size()', 'test_carray_size',
)(x, size=1)
self.assertEqual(int(y[... | mit | Python | |
2cf5f7baf115511c9dd8a8a0333a9b579455b9a3 | Add file for rule's symbol tests | PatrikValkovic/grammpy | tests/rules_tests/FromSymbolComputeTest.py | tests/rules_tests/FromSymbolComputeTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromSymbolComputeTest(TestCase):
pass
if __name__ == '__main__':
main()
| mit | Python | |
3f63b647d9f1e3c0ea8c83a869db8fc0028127c5 | Create 05.FibonacciNumbers.py | stoyanov7/SoftwareUniversity,stoyanov7/SoftwareUniversity,stoyanov7/SoftwareUniversity,stoyanov7/SoftwareUniversity | TechnologiesFundamentals/ProgrammingFundamentals/MethodsAndDebugging-Excercises/05.FibonacciNumbers.py | TechnologiesFundamentals/ProgrammingFundamentals/MethodsAndDebugging-Excercises/05.FibonacciNumbers.py | def fibonacci(n):
if n == 0 or n == 1:
return 1
else:
return fibonacci(n - 1) + fibonacci(n - 2)
if __name__ == '__main__':
number = int(input())
print(fibonacci(number))
| mit | Python | |
f5a0227042b64c6e8a8d85b9e0bc9cf437dc11b8 | resolve migration conflict | OpenVolunteeringPlatform/django-ovp-users,OpenVolunteeringPlatform/django-ovp-users | ovp_users/migrations/0012_merge_20170112_2144.py | ovp_users/migrations/0012_merge_20170112_2144.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-01-12 21:44
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ovp_users', '0011_auto_20170111_1633'),
('ovp_users', '0011_auto_20170112_1417'),
]
... | agpl-3.0 | Python | |
0145c8e9c3c528fb3870e6367ee630d58786203b | Add files via upload | samkit-jain/Handwriting-Recognition,samkit-jain/Handwriting-Recognition | extract_font.py | extract_font.py | import Image, ImageFont, ImageDraw
import time
import os
from scipy import ndimage
import Image, ImageDraw
import matplotlib.image as mpimg
import numpy as np
import math
def convert_im(code, image1):
image1 = image1.crop(image1.getbbox())
w1, h1 = image1.size
image2 = Image.new("RGB", (28, 28), (255, 255, 255))... | apache-2.0 | Python | |
3247ff26cbe63d875a493382c3f567f112de8b58 | Add maintenance script to fix missing menu links | DirkHoffmann/indico,mic4ael/indico,mic4ael/indico,indico/indico,mvidalgarcia/indico,ThiefMaster/indico,OmeGak/indico,DirkHoffmann/indico,mvidalgarcia/indico,pferreir/indico,OmeGak/indico,pferreir/indico,indico/indico,mvidalgarcia/indico,ThiefMaster/indico,mvidalgarcia/indico,ThiefMaster/indico,mic4ael/indico,ThiefMaste... | bin/maintenance/update_menus.py | bin/maintenance/update_menus.py | from __future__ import division
from collections import Counter
from indico.core.db import DBMgr
from indico.util.console import conferenceHolderIterator, success
from MaKaC.conference import ConferenceHolder
from MaKaC.webinterface.displayMgr import ConfDisplayMgrRegistery
def update_menus(dbi):
links = ('coll... | mit | Python | |
1324ae9a6ba9d57841df3f7b729036120eee3d47 | delete easyui | wufengwhu/my_blog,wufengwhu/my_blog,wufengwhu/my_blog | exercise/file/somecript.py | exercise/file/somecript.py | import sys
text = sys.stdin.read()
words = text.split()
wordcount = len(words)
print() | apache-2.0 | Python | |
b333deae9db90a193d274bf235dca8d6dddff5c2 | Add script for getting milestone contributors (#4396) | nishantmonu51/druid,implydata/druid,knoguchi/druid,solimant/druid,winval/druid,implydata/druid,monetate/druid,michaelschiff/druid,pjain1/druid,implydata/druid,pjain1/druid,deltaprojects/druid,praveev/druid,andy256/druid,metamx/druid,dkhwangbo/druid,Fokko/druid,michaelschiff/druid,lizhanhui/data_druid,noddi/druid,michae... | docs/_bin/get-milestone-contributors.py | docs/_bin/get-milestone-contributors.py | #!/usr/bin/env python3
import json
import sys
import requests
# tested with python 3.6 and requests 2.13.0
if len(sys.argv) != 2:
sys.stderr.write('usage: program <milestone-number>\n')
sys.stderr.write('Provide the github milestone number, not name. (e.g., 19 instead of 0.10.1)\n')
sys.exit(1)
milestone_num... | apache-2.0 | Python | |
28377ff5ac680cb5c97997f01b6300debe1abd80 | add missing migration. fix #118 | mgaitan/waliki,OlegGirko/waliki,mgaitan/waliki,OlegGirko/waliki,mgaitan/waliki,OlegGirko/waliki | waliki/migrations/0006_auto_20170326_2008.py | waliki/migrations/0006_auto_20170326_2008.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-26 20:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waliki', '0005_auto_20141124_0020'),
]
operations = [
migrations.AlterField... | bsd-3-clause | Python | |
648c51c41b51fe7919798de755ab1f04f40502a7 | Add Simple File Example | CybOXProject/python-cybox | examples/simple_file_instance.py | examples/simple_file_instance.py | #!/usr/bin/env python
"""Creates the CybOX content for CybOX_Simple_File_Instance.xml
"""
from cybox.common import Hash
from cybox.core import Observable, Observables
from cybox.objects.file_object import File
def main():
h = Hash("a7a0390e99406f8975a1895860f55f2f")
f = File()
f.file_name = "bad_file24.e... | bsd-3-clause | Python | |
47e7d9fc28214e69ed9b0a36104feed80422a5b7 | Create molecule.py | Shirui816/FTinMS | molecule.py | molecule.py | import numpy as np
def grab_iter_dual(i, bond_hash, mol_used, body_hash=None):
s = [i]
r = []
while s:
v = s.pop()
if not mol_used[v]:
r.append(v)
mol_used[v] = True
# for w in bond_hash[v]:
# s.append(w)
s.extend(bond_hash[v])... | bsd-3-clause | Python | |
7cdeb30d5beefbed8d44e3b8eb5384ff05a1f09e | change logg buff, but no save | daveg999/automation_class | class4/class4_ex2.py | class4/class4_ex2.py | #!/usr/bin/env python
import paramiko
import time
from getpass import getpass
def prevent_paging(remote_conn):
''' stop pagination '''
remote_conn.send("\n")
remote_conn.send("term len 0\n")
time.sleep(1)
''' clear output buffer '''
output = remote_conn.recv(1000)
return output
def cl... | apache-2.0 | Python | |
dfb4b3ab679a5c8767bd7571da0fdd40850d2d84 | Add __main__.py | gustavla/crox | crox/__main__.py | crox/__main__.py | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import os
import sys
sys.path = [os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")] + sys.path
from crox.core import main
if __name__ == '__main__':
main()
| bsd-3-clause | Python | |
2a81e39a843e31181af455a89ad2b200b7d2f024 | Add migrations for session changes | stencila/hub,stencila/hub,stencila/hub,stencila/hub,stencila/hub | director/sessions_/migrations/0005_auto_20160316_2124.py | director/sessions_/migrations/0005_auto_20160316_2124.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-16 21:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sessions_', '0004_auto_20160124_0931'),
]
operations = [
migrations.AddField... | apache-2.0 | Python | |
6a5efced71110c49f8866a09b94e2a4c335fed13 | Copy ompt test into its own file. | geopm/geopm,geopm/geopm,cmcantalupo/geopm,geopm/geopm,geopm/geopm,cmcantalupo/geopm,geopm/geopm,cmcantalupo/geopm,cmcantalupo/geopm,cmcantalupo/geopm | integration/test/test_ompt.py | integration/test/test_ompt.py | #!/usr/bin/env python
#
# Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, Intel Corporation
#
# 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... | bsd-3-clause | Python | |
48eb8de9a10b870aa3d0f26386a67c9d8f5e47c1 | Add basic extruder implementation | ynotstartups/Wanhao,hmflash/Cura,senttech/Cura,totalretribution/Cura,Curahelper/Cura,fieldOfView/Cura,hmflash/Cura,fieldOfView/Cura,totalretribution/Cura,ynotstartups/Wanhao,Curahelper/Cura,senttech/Cura | cura/Extruder.py | cura/Extruder.py | # Copyright (c) 2016 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import re #To parse container registry names to increment the duplicates-resolving number.
import UM.Settings.ContainerRegistry #To search for nozzles, materials, etc.
import UM.Settings.ContainerStack #To create a contain... | agpl-3.0 | Python | |
43d2045611320bbe78c1167e6505135425bf9499 | Add customfilters.py to theme | osuosl/dougfir-pelican-theme,osuosl/dougfir-pelican-theme,osuosl/dougfir-pelican-theme,osuosl/dougfir-pelican-theme | customfilters.py | customfilters.py | #!/usr/bin/env python
import bs4
def menu_filter(pelican_pages, direct_templates):
"""
Jinja filter for Pelican page object list
Structures pages into a three-level menu that can be parsed by Jinja2
templating. Reads page metadata of the form:
:menu: <parent>, <name>, <weight>; <parent2>, <name2>,... | apache-2.0 | Python | |
9968aad924fee0c80b895bc24e1452f5c525ee9e | add invite sender | webrecorder/webrecorder,webrecorder/webrecorder,webrecorder/webrecorder,webrecorder/webrecorder | invite.py | invite.py | from auth import init_manager_for_invite
import sys
def main():
m = init_manager_for_invite()
res = m.send_invite(sys.argv[1],
email_template='templates/emailinvite.html',
host='http://localhost:8088')
if res:
print('Success')
else:
print(... | apache-2.0 | Python | |
1780ea557d8b01804bf716887d820b340eff3931 | Create split-array-into-fibonacci-sequence.py | kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode | Python/split-array-into-fibonacci-sequence.py | Python/split-array-into-fibonacci-sequence.py | # Time: O(n^3)
# Space: O(n)
# Given a string S of digits, such as S = "123456579",
# we can split it into a Fibonacci-like sequence [123, 456, 579].
#
# Formally, a Fibonacci-like sequence is a list F of non-negative
# integers such that:
#
# 0 <= F[i] <= 2^31 - 1,
# (that is, each integer fits a 32-bit signed integ... | mit | Python | |
5d789bc0829f46fd3bf86c923e2f53280c7ee530 | add a library for dealing fastq files | jason-weirather/Au-public,jason-weirather/Au-public,jason-weirather/Au-public,jason-weirather/Au-public | iron/pythonlib/FASTQBasics.py | iron/pythonlib/FASTQBasics.py | import re, sys
import subprocess
import FileBasics
import math
class QualityFormatConverter:
def __init__(self,type):
self.observed_to_Q = {}
self.observed_to_probability = {}
self.type = type
if type == 'S':
start = 33
for i in range(0,41):
self.observed_to_Q[i+33] = i
for... | apache-2.0 | Python | |
b7fd9a4bbb78e99a939322fc8cd373a6b16dd9a4 | Update and rename Python to Python/Applications/TSP/tsp.py | krzyszti/my_projects,krzyszti/my_projects,krzyszti/my_projects,krzyszti/my_projects | Python/Applications/TSP/tsp.py | Python/Applications/TSP/tsp.py | """
This application will solve TSP problem with simple evolution algorithm.
The result will be shown in pyglet window.
"""
import pyglet
import random
import sys
import math
class Evolution(object):
def __init__(self):
self.file_path = 'example.dat'
self.base = []
self.iterations = 100
... | mit | Python | |
e16043547bb43476f56195d5652881ebeb684e57 | Add new create_realm management command. | kou/zulip,zulip/zulip,kou/zulip,andersk/zulip,rht/zulip,rht/zulip,kou/zulip,zulip/zulip,zulip/zulip,zulip/zulip,kou/zulip,rht/zulip,andersk/zulip,andersk/zulip,zulip/zulip,rht/zulip,andersk/zulip,andersk/zulip,kou/zulip,rht/zulip,zulip/zulip,rht/zulip,rht/zulip,zulip/zulip,kou/zulip,kou/zulip,andersk/zulip,andersk/zuli... | zerver/management/commands/create_realm.py | zerver/management/commands/create_realm.py | import argparse
from typing import Any
from django.core.management.base import CommandError
from zerver.lib.actions import do_create_realm, do_create_user
from zerver.lib.management import ZulipBaseCommand
from zerver.models import UserProfile
class Command(ZulipBaseCommand):
help = """\
Create a new Zulip orga... | apache-2.0 | Python | |
059a29aede4fb1b4db914131b0aad9ca581201fe | Create followers.py | ppaulojr/atp-followers | followers.py | followers.py | from twython import Twython
import datetime
print datetime.datetime.now()
players = ["fabiofogna",
"richardgasquet1",
"JohnIsner",
"keinishikori",
"andy_murray",
"milosraonic",
"GrigorDimitrov",
"delpotrojuan",
"DavidFerrer87",
"t... | mit | Python | |
0c775a1bb685ff5a77f7f4fb3bbde58d0f1f4334 | add missing catalogo app migration | ibamacsr/indicar_process,ibamacsr/indicar-process,ibamacsr/indicar-process,ibamacsr/indicar_process,ibamacsr/indicar_process | indicarprocess/catalogo/migrations/0002_catalogorapideye.py | indicarprocess/catalogo/migrations/0002_catalogorapideye.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
('catalogo', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | agpl-3.0 | Python | |
c994cfda927353c195048b7c5ac42ed557d8ac0a | Create setup.py | bestupefy/openstack-plugin | swift/setup.py | swift/setup.py | apache-2.0 | Python | ||
ffa99e9ae77a2b651e29dcdbf6abf7a2c9c142a6 | Create DP_Coin_Change_Problem_ctci.py | jcchuks/Hackerrank,jcchuks/Hackerrank,jcchuks/MiscCodes,jcchuks/MiscCodes,jcchuks/MiscCodes | DP_Coin_Change_Problem_ctci.py | DP_Coin_Change_Problem_ctci.py | #!/bin/python
'''Given a number of dollars, N, and a list of dollar values for C = {C0,C1,C2,...CM} distinct coins, M, find
and print the number of different ways you can make change for N dollars if each coin is available in an infinite quantity.'''
import sys
def make_change(coins, n):
result = dfs(coins,n) ... | mit | Python | |
67ee018391df9682e5fe96dd0beba687517f1bf1 | Create autoclearbuf.py | TingPing/plugins,TingPing/plugins | HexChat/autoclearbuf.py | HexChat/autoclearbuf.py | import hexchat
__module_name__ = 'autoclearbuf'
__module_author__ = 'fladd & TingPing'
__module_version__ = '1.0'
__module_description__ = 'Auto clear buffer of closed queries with znc'
# TODO:
# Don't run on non-znc networks
# Actually check for channel type (currently crashes)
recently_cleared = []
def privms... | mit | Python | |
fdc1145b91175673552d21abbfb7ba41c034c426 | Add blaze css | miyakogi/wdom,miyakogi/wdom,miyakogi/wdom | wdom/themes/blaze.py | wdom/themes/blaze.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from wdom.tag import NewTagClass as NewTag
from wdom.tag import *
css_files = [
'//cdn.jsdelivr.net/blazecss/latest/blaze.min.css',
]
Button = NewTag('Button', bases=Button, class_='button')
DefaultButton = NewTag('DefaultButton', 'button', Button, class_='button--... | mit | Python | |
3caa3f617e493ec0e6226e2553ff785f53aa849d | Add monitor scripts to check pods status on compute node | blrm/openshift-tools,blrm/openshift-tools,blrm/openshift-tools,blrm/openshift-tools,blrm/openshift-tools,blrm/openshift-tools | scripts/monitoring/cron-send-node-pods-status.py | scripts/monitoring/cron-send-node-pods-status.py | #!/usr/bin/env python
""" Check all the customer pods status on every compute node, send status code "1" if all pods on a compute node are not running status """
# Adding the ignore because it does not like the naming of the script
# to be different than the class name
# pylint: disable=invalid-name
# pylint: disable... | apache-2.0 | Python | |
0c44e2527004bbb3000c2f3cbe06648ff04f0c92 | Fix python 2.6 'zero length field name in format' error | stripe/stripe-python,uploadcare/stripe-python,alexmic/stripe-python,NahomAgidew/stripe-python,koobs/stripe-python,woodb/stripe-python,zenmeso/stripe-python | stripe/error.py | stripe/error.py | # Exceptions
class StripeError(Exception):
def __init__(self, message=None, http_body=None, http_status=None,
json_body=None, headers=None):
super(StripeError, self).__init__(message)
if http_body and hasattr(http_body, 'decode'):
try:
http_body = http_... | # Exceptions
class StripeError(Exception):
def __init__(self, message=None, http_body=None, http_status=None,
json_body=None, headers=None):
super(StripeError, self).__init__(message)
if http_body and hasattr(http_body, 'decode'):
try:
http_body = http_... | mit | Python |
ece35f891ffd976a7ecfd191e9fbad1e416650d2 | TEST added for phantom | samuelstjean/dipy,nilgoyyou/dipy,maurozucchelli/dipy,matthieudumont/dipy,FrancoisRheaultUS/dipy,beni55/dipy,mdesco/dipy,Messaoud-Boudjada/dipy,JohnGriffiths/dipy,oesteban/dipy,JohnGriffiths/dipy,matthieudumont/dipy,sinkpoint/dipy,mdesco/dipy,samuelstjean/dipy,jyeatman/dipy,rfdougherty/dipy,samuelstjean/dipy,beni55/dipy... | dipy/sims/tests/test_phantom.py | dipy/sims/tests/test_phantom.py | import numpy as np
import nose
import nibabel as nib
from nose.tools import assert_true, assert_false, assert_equal, assert_almost_equal
from numpy.testing import assert_array_equal, assert_array_almost_equal
from dipy.core.geometry import vec2vec_rotmat
from dipy.data import get_data
from dipy.viz import fvtk
from... | bsd-3-clause | Python | |
1b0207786bdc5488790d971c3772ff4825d49a00 | add kmeans | ntduong/ML | kmeans.py | kmeans.py | '''
Simple k-means with random initial starting points (ver 0)
(c) Duong Nguyen nguyen@sg.cs.titech.ac.jp
'''
import math
import random
from collections import defaultdict
import matplotlib.pyplot as plt
def edist(p, q):
"""
Compute the Euclidean distance between two points p, q.
"""
if len(p) != len(q):
raise ... | mit | Python | |
4f2cd5d857c00c5b2f4d4aed5fff42a00a003cac | add directory | Mellcap/MellPlayer | MellPlayer/directory.py | MellPlayer/directory.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Netease Music Player
Created on 2017-02-23
@author: Mellcap
'''
import os
DIRECTORY = '~/.MellPlayer'
def create_directory(directory):
if not os.path.exists(directory):
os.makedirs(directory)
| mit | Python | |
6bf066dff1cd88a56d228e73b5eabcaee55e534f | Add unit tests for deterministic annealing gradients | jluttine/bayespy,fivejjs/bayespy,SalemAmeen/bayespy,bayespy/bayespy | bayespy/inference/vmp/tests/test_annealing.py | bayespy/inference/vmp/tests/test_annealing.py | ######################################################################
# Copyright (C) 2015 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################################
####################... | mit | Python | |
2d9122adc0e12b00f29bca321979dc2ecc428ddc | Create proxy_scan.py | kelath/Burp-Extensions | proxy_scan.py | proxy_scan.py | from burp import IBurpExtender
from burp import IHttpListener
from burp import IScannerListener
from java.net import URL
from java.io import File
import datetime
import time
class BurpExtender(IBurpExtender, IHttpListener, IScannerListener):
def registerExtenderCallbacks(self, callbacks):
self._callbacks =... | mit | Python | |
19c0183e6e23195aef479553c018718565925585 | Add new regex based features | Rostlab/nalaf | nala/features/regex.py | nala/features/regex.py | import re
from nala.features import FeatureGenerator
class RegexNLFeatureGenerator(FeatureGenerator):
def __init__(self):
self.patterns = [
re.compile('[g]\.[0-9]+_[0-9]+(del)[0-9]+'),
re.compile('deletion of( (the|a))?.* region'),
re.compile('deletion of( (the|a))?( \... | apache-2.0 | Python | |
0259d9a361fa49966977f958b8222f977616713f | Add SRIM energy histogram vacancy analysis script (#31) | idaholab/mytrim,idaholab/mytrim,idaholab/mytrim,idaholab/mytrim,idaholab/mytrim | analysis/SRIMVacEnergyCount.py | analysis/SRIMVacEnergyCount.py | #!/usr/bin/python
#
# Tool to parse a SRIM COLLISION.txt file and produce an output comparable
# to TrimVacEnergyCount (output.type = 'vaccount')
#
import fileinput
import math
import re
recoil = re.compile('^\xdb')
# read file header
header = [''] * 4
for i in range(4) :
header[i] = fileinput.input()
# parse re... | lgpl-2.1 | Python | |
620e568b59d8e811a6457be251dfa7d5bf0f8a3d | implement stack using the linked list | enlighter/algorithms | utils/stack.py | utils/stack.py | try:
from .linkedlist import LinkedList, Element
except ModuleNotFoundError as e:
from linkedlist import LinkedList, Element
class Stack(object):
def __init__(self, top=None):
self.ll = LinkedList(top)
def push(self, new_element):
"""Push (add) a new element onto the top of the stack"... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.