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 |
|---|---|---|---|---|---|---|---|---|
f68a8ed6f1d59bf9a66bcbfb6d84718b9970a5ef | add a tentative example file examples/ROOT/test_std_vector.py | alphatwirl/alphatwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl | examples/ROOT/test_std_vector.py | examples/ROOT/test_std_vector.py | #!/usr/bin/env python
# Tai Sakuma <tai.sakuma@cern.ch>
##__________________________________________________________________||
import os, sys
import timeit
import array
import ROOT
from AlphaTwirl.Events import Events, BEvents
##__________________________________________________________________||
inputPath = 'tree.ro... | bsd-3-clause | Python | |
80195bf438144493937fb651e15da61d2ed87da2 | Create ica_demo_uniform.py (#497) | probml/pyprobml,probml/pyprobml,probml/pyprobml,probml/pyprobml | scripts/ica_demo_uniform.py | scripts/ica_demo_uniform.py | # Comparing ICA and PCA on data from a 2d uniform distribution
# Author : Aleyna Kara
# This file is based on https://github.com/probml/pmtk3/blob/master/demos/icaDemoUniform.m
from sklearn.decomposition import PCA, FastICA
import numpy as np
import matplotlib.pyplot as plt
import pyprobml_utils as pml
def plot_sampl... | mit | Python | |
d6e2d94e8f086fa73c429cb50b848b71b3ae4683 | ADd weather | vishalkuo/FridgeMagnet | weather_man.py | weather_man.py | import Keys.client_secret_weather as key
import requests
api_url = 'http://api.openweathermap.org/data/2.5/'
main_endpoint = 'weather'
city = 'Toronto'
def main():
req_url = api_url + main_endpoint
api_params= {'q': city, 'APPID': key.weather_secret}
resp = requests.get(req_url, params=api_params)
if (resp.statu... | mit | Python | |
795b92793b429eacfdee362732cc5e4f1a83981a | Add c4_ql_mlp_fixed | davidrobles/mlnd-capstone-code | examples/c4_ql_mlp_fixed.py | examples/c4_ql_mlp_fixed.py | '''
The Q-learning algorithm is used to learn a function approximator
for the state-action values of Connect-4 positions.
'''
from capstone.game.games import Connect4
from capstone.game.players import RandPlayer
from capstone.rl import Environment, FixedGameMDP
from capstone.rl.learners import ApproximateQLearning
from... | mit | Python | |
1b7d3cf0180dc579ba950b28878d4d88259f5411 | Add tests for B22 | fedspendingtransparency/data-act-broker-backend,fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_b22_object_class_program_activity.py | tests/unit/dataactvalidator/test_b22_object_class_program_activity.py | from tests.unit.dataactcore.factories.domain import SF133Factory
from tests.unit.dataactcore.factories.job import SubmissionFactory
from tests.unit.dataactcore.factories.staging import ObjectClassProgramActivityFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'b22_object_c... | cc0-1.0 | Python | |
df10289a387e10a2428c1e53f8fda70d2fac9133 | Add script to decrypt the second stage of Linux/ChachaDDoS | eset/malware-research,eset/malware-research,eset/malware-research,eset/malware-research | chachaddos/decrypt_second_stage.py | chachaddos/decrypt_second_stage.py | #!/usr/bin/env python
#
# This script decrypt the 2nd stage of Linux/ChachaDDoS by emulating the
# decryption function (ChaCha) in first stage samples.
#
# For feedback or questions contact us at: github@eset.com
# https://github.com/eset/malware-research/
#
# Author: Hugo Porcher <hugo.porcher@eset.com>
#
# This code ... | bsd-2-clause | Python | |
64afc3f8ad847de5c53766b74f311568df9d22c0 | add senna interface to nltk, still not mature enough | nltk/nltk,nltk/nltk,nltk/nltk | nltk/tag/senna.py | nltk/tag/senna.py | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Interface to the Senna tagger
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Rami Al-Rfou' <rmyeid@gmail.com>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
#
# $Id: senna.py $
"""
A module for interfacing with the SENNA tagger.
"""
imp... | apache-2.0 | Python | |
011c1701813c3107433d261581189c57e3b3302f | Create DoFn to group and batch data based on Execution equality | google/megalista,google/megalista | megalist_dataflow/utils/group_by_execution_dofn.py | megalist_dataflow/utils/group_by_execution_dofn.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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python | |
bea638362493ee59fe3e5fce3ea4399a8ebad6ad | Add multi_var | muddyfish/PYKE,muddyfish/PYKE | node/multi_var.py | node/multi_var.py |
from nodes import Node
class MultiVar(Node):
char = "'"
args = 0
results = None
contents = -1
def __init__(self, node_1: Node.NodeSingle, node_2: Node.NodeSingle):
self.node_1 = node_1
self.node_2 = node_2
self.args = max([node_1.args, node_2.args])
def pr... | mit | Python | |
15879e87f5543d98722fd8146a92b066dd0d276f | Bump version 0.15.2rc3 --> 0.16.0rc1 | zestyr/lbry,zestyr/lbry,zestyr/lbry,lbryio/lbry,lbryio/lbry,lbryio/lbry | lbrynet/__init__.py | lbrynet/__init__.py | import logging
__version__ = "0.16.0rc1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.15.2rc3"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| mit | Python |
fbe2b05d6d60753260510ca7d0fa58bd76807294 | add simstore __init__ | choderalab/openpathsampling,openpathsampling/openpathsampling,dwhswenson/openpathsampling,dwhswenson/openpathsampling,choderalab/openpathsampling,dwhswenson/openpathsampling,openpathsampling/openpathsampling,choderalab/openpathsampling,openpathsampling/openpathsampling,openpathsampling/openpathsampling,dwhswenson/openp... | openpathsampling/experimental/simstore/__init__.py | openpathsampling/experimental/simstore/__init__.py | from . import tools
from .storage import (
GeneralStorage, MixedCache, StorageTable, PseudoTable, universal_schema
)
from .class_info import ClassInfoContainer, ClassInfo
from .sql_backend import SQLStorageBackend
from . import dict_serialization_helpers
| mit | Python | |
6ecf6e25ac421e29146c398adc9b83cfe949cb91 | Add compile_defs.py | libris/librisxl,libris/librisxl,libris/librisxl | datatools/scripts/compile_defs.py | datatools/scripts/compile_defs.py | import json
from rdflib import *
from rdflib.namespace import SKOS
def deref(iri):
return Graph().parse(iri).resource(iri)
def get_languages():
base = "/def/%s/" % dataset
with open('whelk-core/src/main/resources/langcodes.json') as f:
lang_code_map = json.load(f)
source = Graph().parse('http:... | apache-2.0 | Python | |
30b725202d23cfdc3030d4562af6ab8193db8a36 | Add version module that was forgotten | mesonbuild/wrapweb,mesonbuild/wrapweb,mesonbuild/wrapweb | mesonwrap/version.py | mesonwrap/version.py | from distutils import version
from typing import Tuple
def version_key(version_tuple: Tuple[str, int]):
return (version.LooseVersion(version_tuple[0]), version_tuple[1])
| apache-2.0 | Python | |
303378eaa31da7ad9978cb2c6fff89cd99312773 | Add merge migration. | brianjgeiger/osf.io,mattclark/osf.io,brianjgeiger/osf.io,aaxelb/osf.io,pattisdr/osf.io,Johnetordoff/osf.io,adlius/osf.io,baylee-d/osf.io,saradbowman/osf.io,mattclark/osf.io,CenterForOpenScience/osf.io,baylee-d/osf.io,mfraezz/osf.io,CenterForOpenScience/osf.io,CenterForOpenScience/osf.io,saradbowman/osf.io,felliott/osf.... | osf/migrations/0160_merge_20190408_1618.py | osf/migrations/0160_merge_20190408_1618.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-04-08 16:18
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0159_merge_20190331_2301'),
('osf', '0156_abstractnode_article_doi'),
]
ope... | apache-2.0 | Python | |
0de12be52a0a3672cc2e3268e3048c65865ba950 | add gaussian-view (#16890) | iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack | var/spack/repos/builtin/packages/gaussian-view/package.py | var/spack/repos/builtin/packages/gaussian-view/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 *
import os
class Gauss... | lgpl-2.1 | Python | |
287cc9cf1d5327d8439369151a0203270b887acc | update auth token created by script | Ziggeo/ZiggeoPythonSdk,Ziggeo/ZiggeoPythonSdk | demos/update_server_auth_token.py | demos/update_server_auth_token.py | import sys
from Ziggeo import Ziggeo
if(len(sys.argv) < 4):
print "Error\n"
print "Usage: $>python update_server_auth_token.py YOUR_API_TOKEN YOUR_PRIVATE_KEY AUTHTOKEN\n"
sys.exit()
api_token = sys.argv[1]
private_key = sys.argv[2]
auth_token = sys.argv[3]
arguments={}
arguments["session_limit"] = 1
arguments["... | apache-2.0 | Python | |
10c7d2f33d34e5a158795701b2d9bc71bbb1c120 | Add RTM v2 client example too | slackapi/python-slackclient,slackapi/python-slackclient,slackhq/python-slackclient,slackapi/python-slackclient | integration_tests/samples/rtm_v2/rtm_v2_proxy_app.py | integration_tests/samples/rtm_v2/rtm_v2_proxy_app.py | # ------------------
# Only for running this script here
import sys
from os.path import dirname
sys.path.insert(1, f"{dirname(__file__)}/../../..")
# ------------------
import logging
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s.%(msecs)03d %(levelname)s %(filename)s (%(lineno)s): %(message)... | mit | Python | |
1ea7f9283fedbfc33b2056a450bae4c772c1b108 | add basic Policy object. | enthought/depsolver,enthought/depsolver | depsolver/solver/policy.py | depsolver/solver/policy.py | import collections
class Policy(object):
"""Policy classes implement a specific policy to deal with multiple
solutions to the SAT problem (which version to select when multiple are
available, etc...)."""
def _compute_prefered_packages_installed_first(self, pool, installed_map, package_ids):
"""... | bsd-3-clause | Python | |
0b9087cc3959a558aca407565f17d197669585bf | rename test | ProgVal/irctest | irctest/server_tests/test_channel_rename.py | irctest/server_tests/test_channel_rename.py | from irctest import cases
from irctest.numerics import ERR_CHANOPRIVSNEEDED
MODERN_CAPS = ['server-time', 'message-tags', 'batch', 'labeled-response', 'echo-message', 'account-tag']
RENAME_CAP = 'draft/channel-rename'
class ChannelRename(cases.BaseServerTestCase):
"""Basic tests for channel-rename."""
@cases... | mit | Python | |
e0a11af9a469d778fd4c13a2fc7a2212d9574f03 | Create primes-in-a-range.py | isabellemao/Hello-World,isabellemao/Hello-World,isabellemao/Hello-World | python/primes-in-a-range.py | python/primes-in-a-range.py | -#Find all prime numbers in a specified range.
-#Note, this will take long for big numbers.
-
-import math
-start = int(input("Start?"))
-end = int(input("End?"))
-
-for num in range(start,end):
- root = round(math.sqrt(num))
- prime = True
- for looper in range(2, root+1):
- if num % looper ... | apache-2.0 | Python | |
a0f5fd1390dd292e06877b5f5746af973890db2b | Add a snippet. | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | python/pyqt/pyqt5/button.py | python/pyqt/pyqt5/button.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... | mit | Python | |
fb091a13030ec66eacbe9b73489e9807707b926c | support slow loading synonyms to MongoDB | OpenBEL/rest-api,OpenBEL/rest-api,OpenBEL/rest-api | python/src/load/__main__.py | python/src/load/__main__.py | #!/usr/bin/env python3
# coding: utf-8
'''
This script pushes namespace value synonyms into MongoDB for the BEL REST API.
'''
import os
import re
import sys
import bson
import pymongo
conn = None
restapi_db = None
# maps namespace prefix to the doc _id representing it
prefix_map = None
def out(msg):
sys.stdout.w... | apache-2.0 | Python | |
2e0148420e9aff180294b3df51de28270cb5516a | Add beginnings of qiprofile update. | ohsu-qin/qipipe | qipipe/helpers/qiprofile.py | qipipe/helpers/qiprofile.py | """
This module provides helper methods for updating the qiprofile
REST database.
"""
import qixnat
from qiprofile-rest import qiprofile
def sync():
"""
Updates the qiprofile database from the XNAT database.
The subjects, sessions and modeling results in the
:meth:`qiutil.project.project` are added, i... | bsd-2-clause | Python | |
c6db8d7d97eb6fb5e5d48663528614ca2c0b3045 | test kddcup_1999.data | vbelakov/h2o,h2oai/h2o-2,calvingit21/h2o-2,111t8e/h2o-2,calvingit21/h2o-2,rowhit/h2o-2,h2oai/h2o,h2oai/h2o-2,calvingit21/h2o-2,111t8e/h2o-2,rowhit/h2o-2,100star/h2o,vbelakov/h2o,calvingit21/h2o-2,111t8e/h2o-2,eg-zhang/h2o-2,h2oai/h2o,vbelakov/h2o,h2oai/h2o-2,eg-zhang/h2o-2,calvingit21/h2o-2,111t8e/h2o-2,h2oai/h2o,h2oai... | py/testdir_hosts/test_rf_kddcup_1999.py | py/testdir_hosts/test_rf_kddcup_1999.py | import unittest, sys, time
sys.path.extend(['.','..','py'])
import h2o_cmd, h2o, h2o_hosts
import h2o_browse as h2b, h2o_import as h2i
# Uses your username specific json: pytest_config-<username>.json
# copy pytest_config-simple.json and modify to your needs.
class Basic(unittest.TestCase):
def tearDown(self):
... | apache-2.0 | Python | |
28d1c6fd4fa3669904a8435f2625b45e254f1928 | add spyglass module | flumotion-mirror/flumotion,flumotion-mirror/flumotion,Flumotion/flumotion,Flumotion/flumotion,timvideos/flumotion,Flumotion/flumotion,timvideos/flumotion,Flumotion/flumotion,timvideos/flumotion | flumotion/admin/spyglass.py | flumotion/admin/spyglass.py | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a video streaming server
#
# flumotion/admin/spyglass.py: MVC for spyglass
#
# Copyright (C) 2004 Fluendo
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | lgpl-2.1 | Python | |
0b3366f3c1860e0fd5f34be995024c6765d26dbe | add benchmark of switch between np.array and np.matrix | jcarpent/eigenpy,stack-of-tasks/eigenpy,stack-of-tasks/eigenpy,jcarpent/eigenpy,jcarpent/eigenpy | benchmarks/bench-switch.py | benchmarks/bench-switch.py | from __future__ import print_function
import eigenpy
import numpy as np
import time
import timeit
from IPython import get_ipython
ipython = get_ipython()
quat = eigenpy.Quaternion()
a = [0., 0., 0.]
cmd1 = "timeit np.array(a)"
print("\n")
print(cmd1)
ipython.magic(cmd1)
print("\n")
cmd2 = "timeit np.matrix(a)"
pr... | bsd-2-clause | Python | |
bf90ab72a1ab83d33766e8a97604dd617be1e02d | create the Spider for Italy of McDonalds | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | locations/spiders/mcdonalds_it.py | locations/spiders/mcdonalds_it.py | import json
import re
import scrapy
from locations.items import GeojsonPointItem
class McDonaldsITSpider(scrapy.Spider):
name = "mcdonalds_it"
allowed_domains = ["mcdonaldsstoreplatform.adattivo.com"]
def start_requests(self):
url = 'https://mcdonaldsstoreplatform.adattivo.com/v2/sites'
he... | mit | Python | |
0b1c32f003a7c8e05f9c9e9f7f58b48150c15180 | Create query_creds.py | ifrguy/NHWG-MIMS,ifrguy/NHWG-MIMS,ifrguy/NHWG-MIMS,ifrguy/NHWG-MIMS | src/Queries/query_creds.py | src/Queries/query_creds.py | """
MongoDB Query only credentials.
Fill in MongoDB userID USER and password PASS for authentication.
"""
USER='Query'
PASS=''
| apache-2.0 | Python | |
3140152d1c50cdde1940f8d195cf3b3a48d17b31 | add script for adding keys | keenondrums/sovrin-node,TechWritingWhiz/indy-node,keenondrums/sovrin-node,spivachuk/sovrin-node,TechWritingWhiz/indy-node,TechWritingWhiz/indy-node,spivachuk/sovrin-node,spivachuk/sovrin-node,spivachuk/sovrin-node,TechWritingWhiz/indy-node,keenondrums/sovrin-node | scripts/add_keys.py | scripts/add_keys.py | #! /usr/bin/env python3
"""
This script registers new sponsor (client key)
To add new key you need to use existing Steward and its seed
"""
import sys
from itertools import groupby
from plenum.common.looper import Looper
from plenum.common.signer_simple import SimpleSigner
from plenum.common.types import HA
from ple... | apache-2.0 | Python | |
a20d015cefe6c4dad63dec51c266f05ac5993a94 | add method for finding 2nd occurrence of a string | enlighter/simple-crawler-in-python | baby-steps/findSecondOccurrence.py | baby-steps/findSecondOccurrence.py | # Define a procedure, find_second, that takes
# two strings as its inputs: a search string
# and a target string. It should return a
# number that is the position of the second
# occurrence of the target string in the
# search string.
def find_second(target, search):
second = target.find(search, target.find(search)... | mit | Python | |
5367b40e7dec274cb36df6e5dfdd53fca986345b | Add script to annotate allele frequencies. | PROSIC/prosic-evaluation,PROSIC/prosic-evaluation | scripts/annotate-true-allele-freqs.py | scripts/annotate-true-allele-freqs.py | from cyvcf2 import VCF, Writer
def subclone_vaf(gt):
"""Calculate subclone allele frequency"""
if np.all(gt[:2] == [1, 1]):
return 1.0
elif np.all(gt[:2] == [0, 1]) or np.all(gt[:2] == [1, 0]):
return 0.5
else:
return 0.0
# Reader
vcf_in = VCF(snakemake.input.vcf)
# Setup su... | mit | Python | |
7b1df70419bba9fda34383ca00274c56d4feb941 | Add mnist_deep_autoencoder.py | aidiary/keras_examples,aidiary/keras_examples | mnist_deep_autoencoder.py | mnist_deep_autoencoder.py | import numpy as np
from keras.layers import Input, Dense
from keras.models import Model
from keras.datasets import mnist
import matplotlib.pyplot as plt
# https://blog.keras.io/building-autoencoders-in-keras.html
if __name__ == "__main__":
# create model
input_img = Input(shape=(784, ))
encoded = Dense(12... | mit | Python | |
cf7fd8a8ba0943303dd5baaee831e7070460c0a0 | Add script to import activities | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | lowfat/management/commands/addactivities.py | lowfat/management/commands/addactivities.py | import pandas as pd
from django.core.management.base import BaseCommand
from lowfat.models import Fund
class Command(BaseCommand):
help = "Add activities"
def add_arguments(self, parser):
parser.add_argument('csv', nargs='?', default='activities.csv')
# pylint: disable=too-many-branches,too-man... | bsd-3-clause | Python | |
5a641395fb336313f091d28ffb17625df836d2a3 | Create script that helps to create an admin user. | Computiva/carbono,Computiva/carbono,Computiva/carbono,Computiva/carbono | create_admin.py | create_admin.py | from getpass import getpass
from md5 import md5
from redis import Redis
def main():
database = Redis()
database.set("user:admin:password", md5(getpass()).hexdigest())
database.delete("user:admin:profiles")
database.rpush("user:admin:profiles", "admin")
if __name__ == "__main__":
main()
| mit | Python | |
dfac20b8b2d378c233c4ecaeb142e458ca121979 | Fix add missing tests/fixtures.py | hoh/Billabong,hoh/Billabong | diss/tests/fixtures.py | diss/tests/fixtures.py |
import pytest
from diss import add_file
from diss.settings import inventory, storage
@pytest.fixture
def record(request):
record = add_file('hello.txt', key=b'0'*32)
def fin():
inventory.delete(record['id'])
storage.delete(record['blob'])
request.addfinalizer(fin)
return record
| agpl-3.0 | Python | |
ddfb508fdbd7e16b525ac8077376b3f4488b32e1 | Add reset_location_services | clburlison/scripts,clburlison/scripts,clburlison/scripts | clburlison_scripts/reset_location_services/reset_location_services.py | clburlison_scripts/reset_location_services/reset_location_services.py | #!/usr/bin/python
"""Reset location services to factory settings. Requires FoundationPlist
which is installed by default with munki - https://github.com/munki/munki/releases"""
import sys, os, platform, subprocess, objc
from Foundation import NSRunLoop, NSDate, NSObject
from Foundation import NSBundle
try:
sys.pat... | mit | Python | |
81a80a6cc94a8d872dcb91975f75f15ff79eddbc | create dataset.py, the new version of stars.py | annayqho/TheCannon,annayqho/TheCannon | Code/dataset.py | Code/dataset.py | import numpy as np
"""Class and methods for a Dataset of stars.
Provides the ability to initialize the dataset, modify it by adding or
removing spectra, changing label names, adding or removing labels.
Also enables the user to perform Dataset operations, like join two Datasets
or retrieve some subset of the Datase... | mit | Python | |
c65d05d832a01e9103b96380c6fa326c4eb8f852 | Add module that returns random selection of common user agent strings | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | d1_test_utilities_python/src/d1_test/utilities/generate_user_agent.py | d1_test_utilities_python/src/d1_test/utilities/generate_user_agent.py | # -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache License, Version 2.0 ... | apache-2.0 | Python | |
6d29545c88ddba76c803422d6c5029b47476dbab | Implement random walk algorithm | erwin00776/copy_ml_implements,tobegit3hub/ml_implementation | others/random_walk/random_walk.py | others/random_walk/random_walk.py | #!/usr/bin/env python
import os
import random
import matplotlib
import matplotlib.pyplot as plt
def main():
value = 100
values = [value]
steps = 10000
for i in xrange(steps):
if random.randint(0, 1) == 1:
choose = 1
else:
choose = -1
value += choose
values.append(value)
plt.plo... | mit | Python | |
0cf345490b789f0162bd6b130fa925fe139c7beb | add error module | jab1982/opennsa,NORDUnet/opennsa,jeroenh/OpenNSA,jeroenh/OpenNSA,jab1982/opennsa,NORDUnet/opennsa,NORDUnet/opennsa,jeroenh/OpenNSA | opennsa/error.py | opennsa/error.py | """
Various generic errors (exceptions) for OpenNSA.
Author: Henrik Thostrup Jensen <htj@nordu.net>
Copyright: NORDUnet (2011)
"""
class TimeoutError(Exception):
pass
class ReservationError(Exception):
pass
class CancelReservationError(Exception):
pass
class ProvisionError(Exception):
pass
cl... | bsd-3-clause | Python | |
025193cf6adc4908d358daf7d78908ba2df7e9b5 | add Binary Search algorithm | pranavj1001/LearnLanguages,pranavj1001/LearnLanguages,pranavj1001/LearnLanguages,pranavj1001/LearnLanguages,pranavj1001/LearnLanguages,pranavj1001/LearnLanguages,pranavj1001/LearnLanguages | python/SearchAlgorithms/BinarySearch/BinarySearch.py | python/SearchAlgorithms/BinarySearch/BinarySearch.py | # method to search for an element using binary search
def binary_search(array, element):
first = 0
last = len(array) - 1
found = False
while first <= last and not found:
mid = int((first + last) / 2)
if array[mid] == element:
found = True
else:
# con... | mit | Python | |
ab905b9b2110a9518ee59be2ae202a30d8956fc3 | Create easy_NumberAddition.py | GabrielGhe/CoderbyteChallenges,GabrielGhe/CoderbyteChallenges | easy_NumberAddition.py | easy_NumberAddition.py | """
Traverse a string,
add up all the numbers
and return the final result
ex: '55blah 4' = 55 + 4 = 59
"""
def NumberAddition(str):
sum = 0
temp = '0'
for x in str:
if x.isdigit():
temp += x
else:
sum += int(temp)
temp = '0'
return sum + int(temp)
print NumberAddition(raw_input(... | mit | Python | |
f49c28e5685f39167d353a0143b5ded343d39b4e | Fix comment. | mitsuhiko/sentry,mitsuhiko/sentry,fotinakis/sentry,jean/sentry,jean/sentry,ifduyue/sentry,mvaled/sentry,BuildingLink/sentry,fotinakis/sentry,JamesMura/sentry,alexm92/sentry,BuildingLink/sentry,beeftornado/sentry,zenefits/sentry,fotinakis/sentry,gencer/sentry,JackDanger/sentry,JackDanger/sentry,mvaled/sentry,gencer/sent... | src/sentry/utils/warnings.py | src/sentry/utils/warnings.py | from __future__ import absolute_import
import collections
import warnings
class WarningManager(object):
"""
Transforms warnings into a standard form and invokes handlers.
"""
def __init__(self, handlers, default_category=Warning):
self.__handlers = handlers
self.__default_category = d... | from __future__ import absolute_import
import collections
import warnings
class WarningManager(object):
"""
Transforms warnings into a standard form and invokes handlers.
"""
def __init__(self, handlers, default_category=Warning):
self.__handlers = handlers
self.__default_category = d... | bsd-3-clause | Python |
1b19f700ed388e7d7e6185c4fca4715d441fb0eb | decrypt AES ECB working in python 3 | bruteforce1/cryptopals | set1/ch7/decrypt_aes_ecb.py | set1/ch7/decrypt_aes_ecb.py | #!/usr/bin/python3
"""
The Base64-encoded content in this file has been encrypted via AES-128
in ECB mode under the key
"YELLOW SUBMARINE".
(case-sensitive, without the quotes; exactly 16 characters; I like
"YELLOW SUBMARINE" because it's exactly 16 bytes long, and now you do
too).
Decrypt it. You know the key, ... | mit | Python | |
1867707bd33bb4908e63f82f3d975fcf5d9e829a | Read ampstat -m -i <device> and print out the mac addresses on the powerline network | alanbertadev/plc_upo_alarm | plc-upo-alarm.py | plc-upo-alarm.py | import shlex
import sys
import re
from subprocess import Popen, PIPE
def extractMacAddress(ampStatLine):
macAddr = None
items = ampStatLine.split( " " )
for index in range(len(items)):
if (items[index] == "MAC") and ((index+1) < len(items)):
if re.match("[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1... | mit | Python | |
0c096299b4057ef425000be262cd84e341e192a8 | Create FinalProject.py | CriticalD20/Final-Project | FinalProject.py | FinalProject.py | mit | Python | ||
6eecd8fb72489d1f5ff79ed9da4770dd669bd035 | Add last command | Motoko11/MotoBot | plugins/modifiers/last.py | plugins/modifiers/last.py | from motobot import command, sink, Priority, split_response
from collections import defaultdict
lines = defaultdict(lambda: [])
@sink(priority=Priority.high)
def last_sink(bot, context, message):
global lines
max_lines = 25
lines[context.channel].append((context.nick, message))
while len(lines[cont... | mit | Python | |
f0f29594bc789c38b8974d0c163ce81fd7c859b1 | use hex instead of mnemonic example | RCasatta/ew-core,RCasatta/ewcore,RCasatta/ewcore,RCasatta/ew-core | ewcore/test/excluding_mnemonic.py | ewcore/test/excluding_mnemonic.py | from mnemonic import Mnemonic
from pycoin.key.BIP32Node import BIP32Node
import binascii
EW_DERIVATION = 4544288
mnemo = Mnemonic('english')
entropy_from_pass = mnemo.to_entropy('your passphrase')
entropy_hex = binascii.hexlify(entropy_from_pass)
print(entropy_hex) # save this in conf
######
entropy = binascii.unh... | mit | Python | |
000ceb19945af56a0196654fa2f4e924aaa1f4ae | Add new migrations with db indexes | mbourqui/django-publications-bootstrap,mbourqui/django-publications-bootstrap,mbourqui/django-publications-bootstrap | publications_bootstrap/migrations/0003_db_index.py | publications_bootstrap/migrations/0003_db_index.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-30 09:41
from __future__ import unicode_literals
from django.db import migrations, models
import echoices.fields
import publications_bootstrap.fields
import publications_bootstrap.models.publication
class Migration(migrations.Migration):
dependenci... | mit | Python | |
10c3c75374381aed1d153e7d3f1d56d33441abea | Add email backups | allanlei/rhinocloud-utils | rhinocloud/management/commands/send_email_backup.py | rhinocloud/management/commands/send_email_backup.py | from optparse import make_option
from subprocess import Popen, PIPE
from django.core.management.base import BaseCommand
from django.conf import settings
from django.core.mail import EmailMessage
from socket import gethostname
import logging
logger = logging.getLogger('rhinocloud')
class Command(BaseCommand):
DEF... | bsd-3-clause | Python | |
d420736862ea2797b15bd900788fb6c9f91dab57 | Rename Haircut.py to HaircutLarge.py | laichunpongben/CodeJam | HaircutLarge.py | HaircutLarge.py | # Google Code Jam
# Google Code Jam 2015
# Round 1A
# Problem B. Haircut
from functools import reduce
from fractions import gcd
class TestCase:
def __init__(self, p):
self.position = p
self.barbers = []
testCaseFile = open("Haircut_B-large-practice.in", "r")
lines = testCaseFile.read().sp... | apache-2.0 | Python | |
c0ddb62f8f21fb0c27cf844964b274ff800fb9b4 | Add missing constants for migration operations. | potatolondon/djangae,potatolondon/djangae,grzes/djangae,grzes/djangae,grzes/djangae | djangae/db/migrations/constants.py | djangae/db/migrations/constants.py | MIGRATION_TASK_MARKER_KIND = "_djangae_migration_task"
TASK_RECHECK_INTERVAL = 5
| bsd-3-clause | Python | |
f1c7072cfa41d3323d5499dce06f4bbcac495f37 | migrate database navitia | is06/navitia,xlqian/navitia,ballouche/navitia,ballouche/navitia,pbougue/navitia,thiphariel/navitia,CanalTP/navitia,kinnou02/navitia,TeXitoi/navitia,kinnou02/navitia,prhod/navitia,is06/navitia,antoine-de/navitia,thiphariel/navitia,thiphariel/navitia,francois-vincent/navitia,antoine-de/navitia,pbougue/navitia,VincentCATI... | source/sql/alembic/versions/12660cd87568_main_destination_for_route.py | source/sql/alembic/versions/12660cd87568_main_destination_for_route.py | """main destination for route
Revision ID: 12660cd87568
Revises: 29fc422c56cb
Create Date: 2015-05-05 13:47:06.507810
"""
# revision identifiers, used by Alembic.
revision = '12660cd87568'
down_revision = '29fc422c56cb'
from alembic import op
import sqlalchemy as sa
import geoalchemy2 as ga
from sqlalchemy.dialects... | agpl-3.0 | Python | |
86610fccf46e05b0fb4532edb0ece9f0e9456af6 | Add restart magic test | Calysto/metakernel | metakernel/magics/tests/test_restart_magic.py | metakernel/magics/tests/test_restart_magic.py | from metakernel.tests.utils import get_kernel, EvalKernel, get_log_text
def test_restart_magic():
kernel = get_kernel(EvalKernel)
kernel.do_execute('a=1')
kernel.do_execute("%restart")
kernel.do_execute('a')
text = get_log_text(kernel)
assert 'NameError' in text
| bsd-3-clause | Python | |
10df3cd5e4c8517652efdb8381155253aa6a8157 | Add test for file based configuration | betatim/osf-cli,betatim/osf-cli | osfclient/tests/test_cli.py | osfclient/tests/test_cli.py | from unittest.mock import call
from unittest.mock import Mock
from unittest.mock import patch
from osfclient import cli
@patch('osfclient.cli.os.path.exists', return_value=True)
@patch('osfclient.cli.configparser.ConfigParser')
def test_config_file(MockConfigParser, os_path_exists):
MockConfigParser().__getitem_... | bsd-3-clause | Python | |
5152ca2b6453101d67f51df7ec75eaaf6c4dead0 | Fix for finding account move lines without invoice (manual entries in receivables/payables) | OCA/bank-payment,OCA/bank-payment | account_payment_partner/wizard/payment_order_create.py | account_payment_partner/wizard/payment_order_create.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Partner module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Partner module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can... | agpl-3.0 | Python |
af5c987ebf46598a977e0d31f12ea0444082f566 | Add HAL gene liftover script | Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara | scripts/hal_alignment/hal_gene_liftover.py | scripts/hal_alignment/hal_gene_liftover.py | #!/usr/bin/env python3
# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
# Copyright [2016-2020] EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | apache-2.0 | Python | |
0a8ca89881c08c78816c47e5b54aa7f78fdb8cc0 | Create URL routes to the two server app views | Jonpro03/Minecrunch_Web,Jonpro03/Minecrunch_Web,Jonpro03/Minecrunch_Web | src/servers/urls.py | src/servers/urls.py | ''' Servers URL Configuration
'''
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name="servers"),
url(r'^(?P<slug>.+)/', views.server, name="server"),
]
| mit | Python | |
d6d12c3813361d3075f304b4920dca2e3b0d16b0 | Implement tree postorder traversal | arvinsim/hackerrank-solutions | all-domains/data-structures/trees/tree-postorder-traversal/solution.py | all-domains/data-structures/trees/tree-postorder-traversal/solution.py | # https://www.hackerrank.com/challenges/tree-postorder-traversal
# Python 2
"""
Node is defined as
self.left (the left child of the node)
self.right (the right child of the node)
self.data (the value of the node)
"""
def postOrder(tree):
if tree is None: return
postOrder(tree.left) or postOrder(tree.right)
... | mit | Python | |
309be84d3f58d1bc7c1d7970b7df5718d076b515 | add model for tests | byteweaver/django-eca-catalogue | eca_catalogue/text/tests/models.py | eca_catalogue/text/tests/models.py | from eca_catalogue.text.abstract_models import *
class SellingPoint(AbstractSellingPoint):
pass
| bsd-3-clause | Python | |
b96d62fb4797360e17bd7ffa2a22f9a89977605a | Add Q6 for Section II | skellykiernan/pylearn,skellykiernan/pylearn | excerises/src/II/q6.py | excerises/src/II/q6.py | D = {'a': 0, 'b': 1, 'c': 2}
# Attempting to access a key that does not exist
# will result in a KeyError Exception
try:
D['d']
except KeyError as err:
print('KeyError for', err)
# Assign to a non-existing key (will create entry)
D['d'] = 'spam'
print(D)
# For Lists cannot assign to a non-existing index
L = ['a... | bsd-3-clause | Python | |
ac9d87bf486f8062d1c2d8122e2dc5660546a22f | Add dummy wrapper for correlation filters | grigorisg9gr/menpofit,yuxiang-zhou/menpofit,yuxiang-zhou/menpofit,grigorisg9gr/menpofit | menpofit/clm/expert/base.py | menpofit/clm/expert/base.py | import numpy as np
from menpofit.math.correlationfilter import mccf, imccf
# TODO: document me!
class IncrementalCorrelationFilterThinWrapper(object):
r"""
"""
def __init__(self, cf_callable=mccf, icf_callable=imccf):
self.cf_callable = cf_callable
self.icf_callable = icf_callable
def... | bsd-3-clause | Python | |
557109768f4f298e6962aa674e962a11a0c65cea | Create config49.py | davidfergusonaz/davidtest,davidfergusonaz/davidtest | config49.py | config49.py | provider "aws" {
access_key = "AKIAJZ5N4IOJYDUF4E4Q"
secret_key = "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"
region = "${var.region}"
}
| mit | Python | |
c764355c15348622d92a8fe5d86038ffcf378450 | add a migration for previous staff edits | bcgov/gwells,bcgov/gwells,bcgov/gwells,bcgov/gwells | app/backend/wells/migrations/0090_auto_20190521_2033.py | app/backend/wells/migrations/0090_auto_20190521_2033.py | # Generated by Django 2.2.1 on 2019-05-21 20:33
import logging
from django.db import migrations
logger = logging.getLogger(__name__)
# NOTE: this migration only needs to run once.
def _getattr(submission, key, model_lookup):
if key in model_lookup:
model = model_lookup[key]
return model.object... | apache-2.0 | Python | |
eef6382ffbe5a9d69747fe98819af446c7aea661 | Add partial index for non-null external ids | tsotetsi/textily-web,pulilab/rapidpro,tsotetsi/textily-web,tsotetsi/textily-web,pulilab/rapidpro,pulilab/rapidpro,tsotetsi/textily-web,pulilab/rapidpro,pulilab/rapidpro,tsotetsi/textily-web | temba/msgs/migrations/0065_external_id_partial_index.py | temba/msgs/migrations/0065_external_id_partial_index.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('msgs', '0064_auto_20160908_1340'),
]
operations = [
migrations.RunSQL(
"CREATE INDEX msgs_msg_external_id_where_... | agpl-3.0 | Python | |
59484d1ae762b79941cd00cb7de714a74103e01a | Add kraken wrapper shell | BatedUrGonnaDie/salty_bot | modules/kraken.py | modules/kraken.py | #! /usr/bin/env python2.7
import modules.api_base as api
class Kraken(api.API):
def __init__(self, base_url, default_headers, oauth_token = None, check_token = True):
super(Kraken, self).__init__(base_url, default_headers)
self.oauth_token = oauth_token
if self.oauth_token and check_token... | mit | Python | |
3b11dfdca0ca36726f3e947dd0a89b025d9bb6b3 | Add py-jplephem package (#12819) | LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/py-jplephem/package.py | var/spack/repos/builtin/packages/py-jplephem/package.py | # Copyright 2013-2019 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 PyJplephem(PythonPackage):
"""This package can load and use a Jet Propulsion Laboratory (J... | lgpl-2.1 | Python | |
9f1e13596dcd37d175121476aa076ff678bf4c2e | add basic field validation functions - to be expanded | praekelt/jmbo-neo | neo/validation.py | neo/validation.py | from django.core.validators import RegexValidator, validate_email
from django.core.exceptions import ValidationError
def validate(fieldname, value):
validator_name = 'validate_%s' % fieldname
if validator_name in globals():
globals()[validator_name](value)
validate_mobile_number = RegexValidator(reg... | bsd-3-clause | Python | |
33a8e407bb0a026ba9787b04afa0165aaa89c53e | add basic logger module | agouil/deepgram-python | deepgram/log.py | deepgram/log.py | import logging
FORMAT = ""
logging.basicConfig()
def logger():
return logging.getLogger('deepgram')
| mit | Python | |
c2b9443bb84e61b27d89a73d385befa052453250 | add ASCII groupsize histogram | AndreasMadsen/bachelor-code,AndreasMadsen/bachelor-code,AndreasMadsen/bachelor-code,AndreasMadsen/bachelor-code | plot/groupsize-histogram.py | plot/groupsize-histogram.py |
import plot
import model
import sys
import numpy as np
import os.path as path
import matplotlib.pyplot as plt
group_size = model.load(path.realpath(sys.argv[1]))['group_size']
sizes = np.unique(group_size)
print("%7s | %3s" % ("size", "count"))
for size in sizes:
print("%7d | %3d" % (size, np.sum(group_size ==... | mit | Python | |
8286090cfa056cdd3302915dc655705fd9499a0f | Add initial bin_and_plot code | sot/aca_stats,sot/aca_stats,sot/aca_stats | bin_and_plot.py | bin_and_plot.py | import numpy as np
import astropy
import functions as f
import matplotlib.pyplot as plt
from astropy.time import Time
#Loading data from file
acq_data = np.load('../data/acq_table.npy')
#Adding fields required for analysis
acq_data = f.add_column(acq_data, 'tstart_jyear' , np.zeros(len(acq_data)))
acq_data = f.add_... | bsd-3-clause | Python | |
4dad3f21d35ebf8895232de50c5ef8a896150d58 | add mcscf density matrix | sunqm/pyscf,sunqm/pyscf,gkc1000/pyscf,gkc1000/pyscf,sunqm/pyscf,gkc1000/pyscf,gkc1000/pyscf,sunqm/pyscf,gkc1000/pyscf | future/mcscf/addons.py | future/mcscf/addons.py | #!/usr/bin/env python
import numpy
from pyscf import ao2mo
from pyscf.future.fci import direct_spin0 as fci_direct
def _make_rdm1_on_mo(casdm1, ncore, ncas, nmo):
nocc = ncas + ncore
dm1 = numpy.zeros((nmo,nmo))
idx = numpy.arange(ncore)
dm1[idx,idx] = 2
dm1[ncore:nocc,ncore:nocc] = casdm1
ret... | apache-2.0 | Python | |
3fd7033645399dc113bab054d5b7dc721e0d1a81 | Create candidates_by_party.py | Statistica/676-candidates | candidates_by_party.py | candidates_by_party.py | # Written by Jonathan Saewitz, released May 24th, 2016 for Statisti.ca
# Released under the MIT License (https://opensource.org/licenses/MIT)
import csv, plotly.plotly as plotly
from collections import Counter
c=Counter()
with open('presidential_candidates.csv', 'r') as f:
reader=csv.reader(f)
reader.next() #skip ... | mit | Python | |
b08e7fd64da5342508807420e5c9aa6c3686a68e | Add basic script without the ability to send the data anywhere | Johnetordoff/osf.io,hmoco/osf.io,laurenrevere/osf.io,mattclark/osf.io,baylee-d/osf.io,icereval/osf.io,laurenrevere/osf.io,sloria/osf.io,HalcyonChimera/osf.io,caseyrollins/osf.io,binoculars/osf.io,caseyrollins/osf.io,alexschiller/osf.io,acshi/osf.io,CenterForOpenScience/osf.io,cslzchen/osf.io,crcresearch/osf.io,felliott... | scripts/analytics/institutions.py | scripts/analytics/institutions.py | from modularodm import Q
from website.app import init_app
from website.models import User, Node, Institution
def get_institutions():
institutions = Institution.find(Q('_id', 'ne', None))
return institutions
def get_user_count_by_institutions():
institutions = get_institutions()
user_counts = []
... | apache-2.0 | Python | |
9b4176717958879ef5a252bbb0ef4083c024eb66 | Add missing omni_diff.py | mozilla-b2g/fxos-certsuite,Conjuror/fxos-certsuite,cr/fxos-certsuite,askeing/fxos-certsuite,ShakoHo/fxos-certsuite,cr/fxos-certsuite,ypwalter/fxos-certsuite,Conjuror/fxos-certsuite,cr/fxos-certsuite,ShakoHo/fxos-certsuite,mozilla-b2g/fxos-certsuite,Conjuror/fxos-certsuite,oouyang/fxos-certsuite,askeing/fxos-certsuite,o... | certsuite/omni_diff.py | certsuite/omni_diff.py | #!/usr/bin/env python
# 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/.
import argparse
import base64
import json
import os
import shutil
import subprocess
import sys
f... | mpl-2.0 | Python | |
3fcfd70ba39d0876a89ad5ca18455c86b6a4289e | clean up, make sure you dont send old builds | ess/dd-agent,relateiq/dd-agent,cberry777/dd-agent,benmccann/dd-agent,relateiq/dd-agent,GabrielNicolasAvellaneda/dd-agent,darron/dd-agent,manolama/dd-agent,yuecong/dd-agent,Shopify/dd-agent,PagerDuty/dd-agent,jshum/dd-agent,tebriel/dd-agent,jshum/dd-agent,mderomph-coolblue/dd-agent,amalakar/dd-agent,PagerDuty/dd-agent,i... | checks/build.py | checks/build.py | import os
import re
import time
import traceback
from collections import defaultdict
from datetime import datetime
from glob import glob
class Hudson(object):
datetime_format = '%Y-%m-%d_%H-%M-%S'
result_pattern = re.compile('\s*<result>(?P<result>[A-Za-z]*)</result>\s*')
def __init__(self):
self.high_watermar... | import os
import re
import time
from datetime import datetime
from glob import glob
class Hudson(object):
def check(self, logger, agentConfig):
hudson_home = agentConfig.get('hudson_home', '/Users/hudson/.hudson/')
jobs = glob(os.path.join(hudson_home, 'jobs', '*'))
for job in jobs:
job_name = os.path.ba... | bsd-3-clause | Python |
8d71348cd55f436920e19965e53faa0c08d7af3c | Fix bug 1506167: Remove TM entries of deleted Translations (#1129) | mathjazz/pontoon,mathjazz/pontoon,jotes/pontoon,jotes/pontoon,mozilla/pontoon,jotes/pontoon,mozilla/pontoon,mozilla/pontoon,mathjazz/pontoon,mozilla/pontoon,mathjazz/pontoon,jotes/pontoon,mathjazz/pontoon,mozilla/pontoon | pontoon/base/migrations/0137_delete_entries_of_deleted_translations.py | pontoon/base/migrations/0137_delete_entries_of_deleted_translations.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-12 18:55
from __future__ import unicode_literals
from django.db import migrations, models
def delete_tm_entries(apps, schema):
"""
Delete TranslationMemoryEntries that are linked to existing Entity instances
and aren't linked to any Transla... | bsd-3-clause | Python | |
fae89c5ff5aa84a684f89c10efb72ef9e196917f | Add compare_hkl.py which does the similar job as compare_hkl in CrystFEL | keitaroyam/yamtbx,keitaroyam/yamtbx,keitaroyam/yamtbx,keitaroyam/yamtbx | yamtbx/dataproc/crystfel/command_line/compare_hkl.py | yamtbx/dataproc/crystfel/command_line/compare_hkl.py | from yamtbx.dataproc import crystfel
import iotbx.phil
from cctbx.array_family import flex
import math
master_params_str = """\
pdb = None
.type = path
.help = Symmetry source
datout = shells_all.dat
.type = path
.help = Output dat file
dmin = None
.type = float
dmax = None
.type = float
nshells = 20
.type = i... | bsd-3-clause | Python | |
17c55f3d91cde8c0725c02b2c7294a99e9779916 | Add new package: mlocate (#18788) | iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/mlocate/package.py | var/spack/repos/builtin/packages/mlocate/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 Mlocate(AutotoolsPackage):
"""mlocate is a locate/updatedb implementation. The 'm' stands... | lgpl-2.1 | Python | |
f2f42b8e5a7e54d9c6de97d823d1437455d02401 | Create emon_AZURE_HA.py | ArtiomL/f5networks,ArtiomL/f5networks | azure/ha/emon_AZURE_HA.py | azure/ha/emon_AZURE_HA.py | #!/usr/bin/python
# External Monitor - Azure HA
# Artiom Lichtenstein
# v0.1, 31/07/2016
import os, signal, sys, requests
# Remove IPv6/IPv4 compatibility prefix (LTM passes addresses in IPv6 format)
strIP = sys.argv[1].strip(':f')
strPort = sys.argv[2]
# ILX / Node.js VS IP
strIPNjs = sys.argv[3]
# PID file
strPFile... | mit | Python | |
685eeaa9c8a5834d8ee92b5e408413e876f018b8 | bump version in __init__.py | 1flow/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.16.1.1'
|
VERSION = '0.16.1'
| agpl-3.0 | Python |
f79465a56f45aaa74593bf0176015dabd5845b25 | Send mass email Django command | project-lovelace/lovelace-website,project-lovelace/lovelace-website,project-lovelace/lovelace-website | src/lovelace/management/commands/send_mass_email.py | src/lovelace/management/commands/send_mass_email.py | import sys
import json
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand, CommandError
from users.models import UserProfile
from lovelace.settings import MAILGUN_API_URL, MAILGUN_API_KEY, LOVELACE_FROM_EMAIL
class Command(BaseCommand):
help = "Send a mass email to ... | mit | Python | |
80a6aadb539586975740e064f8d4ddede83427d4 | Create notes2half_period_cycles.py | reedb/notes2half_period_cycles | notes2half_period_cycles.py | notes2half_period_cycles.py | #!/usr/bin/python
#
# Build a table of half period cycle counts.
#
import sys
import os
import math
# Octive C C# D Eb E F F# G G# A Bb B
# 0 16.35 17.32 18.35 19.45 20.60 21.83 23.12 24.50 25.96 27.50 29.14 30.87
# 1 32... | mit | Python | |
cb991585c786d1c899da85a2abdf58cc9725d44a | Complete converter for VASP prototype | materials-data-facility/forge | prototypes/converters/autovasp_converter.py | prototypes/converters/autovasp_converter.py | import os
import json
import sys
from tqdm import tqdm
from parsers.utils import find_files
from parsers.ase_parser import parse_ase
from validator import Validator
# This is the converter for
# Arguments:
# input_path (string): The file or directory where the data resides. This should not be hard-coded in the func... | apache-2.0 | Python | |
4ba88b09039e074e581db00855505cf08deec10c | Create TimeFeatures.py | Nik0l/UTemPro,Nik0l/UTemPro | TimeFeatures.py | TimeFeatures.py | # aka Temporal features are calculated here. For example, how many questions a user asked last week, activity of a user on weekends.
| mit | Python | |
4ddefee6c612ca98797484e42bb4c19c982e66e9 | Add bubaak tool-info module | ultimate-pa/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec | benchexec/tools/bubaak.py | benchexec/tools/bubaak.py | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
# SPDX-FileCopyrightText: 2022 Marek Chalupa marek.chalupa@ista.ac.at
#
# SPDX-License-Identifier: Apache-2.0
import benchexec
imp... | apache-2.0 | Python | |
c48ce921b8c50224e17b231b26adb8fb35bfe98c | Add segment_curvature tests module | danforthcenter/plantcv,danforthcenter/plantcv,danforthcenter/plantcv | tests/plantcv/morphology/test_segment_curvature.py | tests/plantcv/morphology/test_segment_curvature.py | import cv2
from plantcv.plantcv import outputs
from plantcv.plantcv.morphology import segment_curvature
def test_segment_curvature(morphology_test_data):
# Clear previous outputs
outputs.clear()
skeleton = cv2.imread(morphology_test_data.skel_img, -1)
_ = segment_curvature(segmented_img=skeleton,
... | mit | Python | |
f2a0bd7611772b52d5fcdf2bff16a9d9fd3a2f2c | Create print_alt.py | DavisPoGo/Monocle,DavisPoGo/Monocle,DavisPoGo/Monocle | scripts/print_alt.py | scripts/print_alt.py | #!/usr/bin/env python3
from pickle import load
from pprint import PrettyPrinter
from pathlib import Path
pickle_path = Path(__file__).resolve().parents[1] / 'pickles' / 'altitudes.pickle'
with pickle_path.open('rb') as f:
altitudes = load(f)
pp = PrettyPrinter(indent=3)
pp.pprint(altitudes)
| mit | Python | |
e7ac4060ff309c429b0260bc4fdeed19caef9063 | Add RESTful router. | bueda/django-comrade | comrade/core/router.py | comrade/core/router.py | from django.http import Http404, HttpResponseNotAllowed
def get_handler_method(request_handler, http_method):
try:
handler_method = getattr(request_handler, http_method.lower())
if callable(handler_method):
return handler_method
except AttributeError:
pass
class RestfulReso... | mit | Python | |
f8ecc4d8f7ecbf356d2748ff0b8fb4463158f7b8 | Add grid_map | jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools | problem/pop_map/grid/grid_map.py | problem/pop_map/grid/grid_map.py | #! /usr/bin/env streamlit run
# Copyright 2020 John Hanley.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, mod... | mit | Python | |
43d5cacdc087e532e07118a80bc0869b51072588 | add machine.py | futurecore/pydgin,futurecore/pydgin,cornell-brg/pydgin,futurecore/pydgin,cornell-brg/pydgin,futurecore/pydgin,cornell-brg/pydgin,cornell-brg/pydgin | riscv/machine.py | riscv/machine.py | #=========================================================================
# machine.py
#=========================================================================
from pydgin.storage import RegisterFile
#-------------------------------------------------------------------------
# State
#-------------------------------... | bsd-3-clause | Python | |
3f6197f14de75fdb4c11fab259694c354b871373 | Implement cli | koji-kojiro/hylang-hycc | hy_compiler/cmdline.py | hy_compiler/cmdline.py | # -*- coding: utf-8 -*-
import argparse
from compiler import build
def main():
parser = argparse.ArgumentParser(usage='%(prog)s [options] file')
parser._optionals.title = 'options'
parser.add_argument('file', nargs=1, help=argparse.SUPPRESS)
parser.add_argument('--shared', action='store_true')
par... | mit | Python | |
ccf986954bfc4a5e56ed608aefbb416bf7acab3c | Add bitbucket identity creation tests | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | tests/test_sso/test_bitbucket_id_creation.py | tests/test_sso/test_bitbucket_id_creation.py | from urllib.parse import urlparse
from django.urls import reverse
from tests.utils import BaseViewTest
class BitbucketIdentityTest(BaseViewTest):
def test_wrong_provider_raises_404(self):
auth_path = reverse('sso:create_identity', kwargs={'provider': 'undefined'})
resp = self.client.get(auth_pat... | apache-2.0 | Python | |
a6bf20905adbd876469721f43191880d7011231c | Add fallback manual mongo->postgres duping script | pereztr5/cyboard,pereztr5/cyboard,pereztr5/cyboard,pereztr5/cyboard | setup/pg/dupe.py | setup/pg/dupe.py | #!/usr/bin/env python3
"""dupe.py mirrors a cyboard mongodb results collection into a postgres table,
for analysis in Grafana.
Spring 2018, by Butters
==============================================
WARNING: THIS SCRIPT WILL DELETE ALL DATA IN THE POSTGRES `cy.result` TABLE
!!! USE WITH CAUTION !!!
==============... | bsd-3-clause | Python | |
ed13319a4b368e99afc1fd7fe3021a3440d5bfdf | Add new Package: accumulo (#16148) | LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack | var/spack/repos/builtin/packages/accumulo/package.py | var/spack/repos/builtin/packages/accumulo/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 Accumulo(Package):
"""Apache Accumulo is a sorted, distributed key/value store that
pr... | lgpl-2.1 | Python | |
327de3b3d4b018c5c5732766aac62cc827744e56 | add new package : blktrace (#13872) | LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/blktrace/package.py | var/spack/repos/builtin/packages/blktrace/package.py | # Copyright 2013-2019 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 Blktrace(MakefilePackage):
"""
blktrace is a block layer IO tracing mechanism which pr... | lgpl-2.1 | Python | |
b028e99cac7b67aa5902e6c3b32941de3e1c4113 | add new package | LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/py-black/package.py | var/spack/repos/builtin/packages/py-black/package.py | # Copyright 2013-2019 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 PyBlack(PythonPackage):
"""Black is the uncompromising Python code formatter. By using it,... | lgpl-2.1 | Python | |
dfbe3278c45497faf98207a4369d1a35700e7d24 | add package py-lmfit (#3333) | tmerrick1/spack,EmreAtes/spack,iulian787/spack,tmerrick1/spack,mfherbst/spack,matthiasdiener/spack,mfherbst/spack,TheTimmy/spack,skosukhin/spack,LLNL/spack,krafczyk/spack,TheTimmy/spack,TheTimmy/spack,lgarren/spack,krafczyk/spack,iulian787/spack,TheTimmy/spack,iulian787/spack,lgarren/spack,krafczyk/spack,iulian787/spac... | var/spack/repos/builtin/packages/py-lmfit/package.py | var/spack/repos/builtin/packages/py-lmfit/package.py | ##############################################################################
# Copyright (c) 2013-2016, 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 | |
5519ccdeceffa72bd1822e2d6d42f9215ea7229e | Add a command that imports the 2013 election boundaries | patricmutwiri/pombola,geoffkilpin/pombola,ken-muturi/pombola,geoffkilpin/pombola,hzj123/56th,hzj123/56th,patricmutwiri/pombola,ken-muturi/pombola,ken-muturi/pombola,hzj123/56th,mysociety/pombola,hzj123/56th,patricmutwiri/pombola,hzj123/56th,patricmutwiri/pombola,ken-muturi/pombola,patricmutwiri/pombola,geoffkilpin/pomb... | mzalendo/core/management/commands/core_import_keynan_boundaries_2013.py | mzalendo/core/management/commands/core_import_keynan_boundaries_2013.py | # This script imports the boundaries for the 2013 Kenyan election into
# MapIt - it uses the generic mapit_import script.
import json
import os
import sys
import urllib
from tempfile import NamedTemporaryFile
from optparse import make_option
from django.core.management import call_command
from django.core.managemen... | agpl-3.0 | Python | |
9c8851ea159cd7ecb01c346cf40a707318f040b9 | add libguestfs utlity methods to reduce code duplication in plugins | redhat-imaging/imagefactory,jmcabandara/imagefactory,LalatenduMohanty/imagefactory,jmcabandara/imagefactory,LalatenduMohanty/imagefactory,redhat-imaging/imagefactory | imgfac/FactoryUtils.py | imgfac/FactoryUtils.py | #!/usr/bin/python
# A set of helpful utility functions
# Avoid imports that are too specific to a given cloud or OS
# We want to allow people to import all of these
# Add logging option
import guestfs
def launch_inspect_and_mount(diskfile):
g = guestfs.GuestFS()
g.add_drive(diskfile)
g.launch()
retur... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.