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
f0b5b6a84f9b217376b54361b2afaeb19af24380
Add containers
timothycrosley/blox,timothycrosley/blox,timothycrosley/blox
blox/containers.py
blox/containers.py
'''blox/containers.py Contains containers that aid in group bloxs together in a logical way Copyright (C) 2015 Timothy Edmund Crosley 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 res...
mit
Python
2c174eeafa48302951e743ed2b9bbe91a1992899
make sure that the file you are trying to import actually exists
felliott/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,icereval/scrapi,alexgarciac/scrapi,fabianvf/scrapi,mehanig/scrapi,erinspace/scrapi,ostwald/scrapi,CenterForOpenScience/scrapi,jeffreyliu3230/scrapi,felliott/scrapi,fabianvf/scrapi
tests/utils.py
tests/utils.py
from __future__ import unicode_literals RAW_DOC = { 'doc': str('{}'), 'docID': 'someID', 'timestamps': { 'consumeFinished': '2012-11-30T17:05:48+00:00', 'consumeStarted': '2012-11-30T17:05:48+00:00', 'consumeTaskCreated': '2012-11-30T17:05:48+00:00' }, 'filetype': 'json', ...
apache-2.0
Python
3b06894ba1aadb3460ed60e47e931065484976ee
Add a command to undo results imports for specified projects
akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr
akvo/rsr/management/commands/undo_results_import.py
akvo/rsr/management/commands/undo_results_import.py
# -*- coding: utf-8 -*- # Akvo Reporting is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. """Undo results framework import...
agpl-3.0
Python
5dde9f6aca671440253729c29530e93974921ea0
Add a migration to add the 'Other' field to QueuedImage.why_allowed
mysociety/yournextrepresentative,YoQuieroSaber/yournextrepresentative,mysociety/yournextmp-popit,neavouli/yournextrepresentative,datamade/yournextmp-popit,mysociety/yournextrepresentative,openstate/yournextrepresentative,YoQuieroSaber/yournextrepresentative,mysociety/yournextrepresentative,neavouli/yournextrepresentati...
moderation_queue/migrations/0007_auto_20150303_1420.py
moderation_queue/migrations/0007_auto_20150303_1420.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('moderation_queue', '0006_auto_20150303_0838'), ] operations = [ migrations.AlterField( model_name='queuedimage',...
agpl-3.0
Python
065b8ec2865b0746393a427d1d078c655905241c
Add renaming PDF files
UO-SPUR/misc
rename-pdf.py
rename-pdf.py
#!/usr/bin/env python __author__ = 'Jacob Bieker' import os DATA_DIRECTORY = os.path.join("test_file") DATA = os.listdir(DATA_DIRECTORY) file_name_dict = {} for file_name in DATA: split_name = file_name.split("_") print split_name file_name_dict.setdefault(split_name[0], []) # Name has the extra _NUM e...
apache-2.0
Python
57b396177854636257ad5884b0deeca6a79d207a
Add libpfm4 package. (#3667)
krafczyk/spack,TheTimmy/spack,EmreAtes/spack,iulian787/spack,EmreAtes/spack,skosukhin/spack,lgarren/spack,iulian787/spack,mfherbst/spack,skosukhin/spack,LLNL/spack,TheTimmy/spack,lgarren/spack,lgarren/spack,tmerrick1/spack,matthiasdiener/spack,skosukhin/spack,lgarren/spack,krafczyk/spack,iulian787/spack,matthiasdiener/...
var/spack/repos/builtin/packages/libpfm4/package.py
var/spack/repos/builtin/packages/libpfm4/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
d4f498db7c2cb5da0ad0202d7a4b6a919ac896b3
add new package (#24989)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/py-rply/package.py
var/spack/repos/builtin/packages/py-rply/package.py
# Copyright 2013-2021 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 PyRply(PythonPackage): """A pure Python Lex/Yacc that works with RPython.""" homepage...
lgpl-2.1
Python
f627f04ebe0186b19d58619cab8b7098f5ca2e4c
Add plugin for Nova server state metrics
giorgiosironi/sensu-community-plugins,Squarespace/sensu-community-plugins,zerOnepal/sensu-community-plugins,lfdesousa/sensu-community-plugins,maoe/sensu-community-plugins,aryeguy/sensu-community-plugins,royalj/sensu-community-plugins,lenfree/sensu-community-plugins,new23d/sensu-community-plugins,tuenti/sensu-community-...
plugins/openstack/nova/nova-server-state-metrics.py
plugins/openstack/nova/nova-server-state-metrics.py
#!/usr/bin/env python from argparse import ArgumentParser import socket import time from novaclient.v3 import Client DEFAULT_SCHEME = '{}.nova.states'.format(socket.gethostname()) def output_metric(name, value): print '{}\t{}\t{}'.format(name, value, int(time.time())) def main(): parser = ArgumentParser() ...
mit
Python
c0cd62af0ee29743430156eda613665dd58a97c3
Apply SA naming convention
indico/indico-plugins,ThiefMaster/indico-plugins,ThiefMaster/indico-plugins,indico/indico-plugins,indico/indico-plugins,indico/indico-plugins,ThiefMaster/indico-plugins,ThiefMaster/indico-plugins
chat/indico_chat/migrations/201503101131_35badbd96474_apply_naming_convention.py
chat/indico_chat/migrations/201503101131_35badbd96474_apply_naming_convention.py
"""Apply naming convention Revision ID: 35badbd96474 Revises: 1bd6c5129d29 Create Date: 2015-03-10 11:31:42.850496 """ from alembic import op from indico.core.db.sqlalchemy.util.bulk_rename import bulk_rename # revision identifiers, used by Alembic. revision = '35badbd96474' down_revision = '1bd6c5129d29' mappin...
mit
Python
46c1a39041d89325d849339ebab0854a91f520d4
Create rtl-config.py
pyreflos/RasPi-Rattle
rtl-config.py
rtl-config.py
## ## User configuration file - edit these settings to suit your own project ## file_path = '/home/pi/RPi-RTL/images/' ## path to save images file_prefix = 'img_' ## prefix before timestamp.jpg, if needed - e.g. a project number use_timestamp = True ## True = timestamp in filename, False = incremental numbering
mit
Python
9ad5d9668c3faf85c38d5655054b8530d2e14444
set up migration for meta_data ingest
unicef/rhizome,unicef/rhizome,unicef/rhizome,unicef/rhizome
datapoints/migrations/0002_populate_initial_data.py
datapoints/migrations/0002_populate_initial_data.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields import django.db.models.deletion from django.conf import settings import pandas as pd from datapoints.models import IndicatorTag from django.db.models import get_app, get_models def popula...
agpl-3.0
Python
5ef00907efd5502ee3de38030f23a16ccc3a41be
Add script to create a prunable checkpoint of a densely trained model.
mrcslws/nupic.research,numenta/nupic.research,numenta/nupic.research,mrcslws/nupic.research,subutai/nupic.research,subutai/nupic.research
projects/transformers/create_prunable_checkpoint.py
projects/transformers/create_prunable_checkpoint.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2021, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
Python
9aeb9d35cd49ccd7ab1ede87d70666e34b80320c
Add tests for run docker mgmt command
Tazer/readthedocs.org,rtfd/readthedocs.org,soulshake/readthedocs.org,davidfischer/readthedocs.org,takluyver/readthedocs.org,sid-kap/readthedocs.org,sunnyzwh/readthedocs.org,pombredanne/readthedocs.org,laplaceliu/readthedocs.org,takluyver/readthedocs.org,espdev/readthedocs.org,sils1297/readthedocs.org,wijerasa/readthedo...
readthedocs/rtd_tests/tests/test_core_management.py
readthedocs/rtd_tests/tests/test_core_management.py
from StringIO import StringIO from django.test import TestCase from mock import patch from core.management.commands import run_docker from projects.models import Project from builds.models import Version class TestRunDocker(TestCase): '''Test run_docker command with good input and output''' fixtures = ['te...
mit
Python
7df706d8727064275aeccf04f5411661b33f9250
Create show_vlans.py
rbatist/HPN-Scripting,networkingdvi/HPN-Scripting
show_vlans.py
show_vlans.py
__version__ = '0.9' __author__ = 'Remi Batist' # Overview of vlans including ip-addresses in procurve-style # An example below # VLAN-ID | IP Address IP Subnet NAME # ------- | --------------- --------------- --------------- # 1 | VLAN 0001 # 6 | ...
mit
Python
66831279407e7a6626b8fe0ea06c886d5191f699
Create q24telnetexec.py
jmio/Q24,jmio/Q24
q24telnetexec.py
q24telnetexec.py
# # Q24 Util. for Pythonista # 2014/12/23 : First Release # ############################################################################################################## import sys import telnetlib import time import os #import subprocess from ftplib import FTP #######################################################...
mit
Python
991d40c62a7a44fc94ebd83e6726e5beaf867728
Add exercise Chuck Norris
AntoineAugusti/katas,AntoineAugusti/katas,AntoineAugusti/katas
codingame/easy/chuck_norris.py
codingame/easy/chuck_norris.py
def writeSegment(type, length): out = "" if (type == 1): out += "0 " else: out += "00 " out += '0' * length return out def inputToBits(text): out = "" for ch in text: chBin = bin(ord(ch))[2:] while len(chBin) < 7: chBin = '0' + chBin out += chBin return out bits = inputToBits(raw_input()) ans...
mit
Python
1d1a95261c5dc057e1e739a459bbf7d1574ce808
add all files into repo
mark14wu/qqbot_config
plugins/ordersong.py
plugins/ordersong.py
# -*- coding: utf-8 -*- import pycurl from io import BytesIO from urllib.parse import urlencode import sys group_list = ["596776383", "513096350", "54840756", "662936261"] # 596776383 = EFZers_2020! # 513096350 = 1/2EFZers # 54840756 = EFZ # 662936261 = 2020届6班 order_keywords = ['点歌', '来一首', '来首'] rank_keywords = ['点歌'...
mit
Python
e4cde9db9f9b99622cac8fa88f4acab1fce41d80
add myrename
jamesp9/dotfiles,jamesp9/dotfiles
bin/myrename.py
bin/myrename.py
#!/usr/bin/env python3 import sys import shutil import re import os if len(sys.argv) > 1: src_filename = sys.argv[1] else: print("Please supply filename") sys.exit() if not os.path.exists(src_filename): print("{} does't exist".format(src_filename)) sys.exit() dst_filename, dst_extension = os.pat...
mit
Python
92ec039cdecffd7ec03f5954dfe5c69499921ba7
Make consonants
itfoundry/hindkit,itfoundry/hindkit
lib/hindkit/_lab.py
lib/hindkit/_lab.py
#!/usr/bin/env AFDKOPython # encoding: UTF-8 from __future__ import division, absolute_import, print_function, unicode_literals import collections import pytoml enum = collections.namedtuple p = enum( "Property", """ Vowel Consonant Stop Nasal Approximant Fricative Guttural Palatal Ret...
mit
Python
ab553873c782a7975e6b2cb3d240d5b9751c7a44
Add API for RepositoryLayout.
jelmer/subvertpy,jelmer/subvertpy
layout.py
layout.py
# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # This p...
lgpl-2.1
Python
cbaf4e86c4409735a8f011f5a8f801a34278c21c
Increase text index property size
VinnieJohns/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,plamut/ggrc-core
src/ggrc/migrations/versions/20170112013716_421b2179c02e_update_fulltext_index.py
src/ggrc/migrations/versions/20170112013716_421b2179c02e_update_fulltext_index.py
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Update fulltext index. Create Date: 2017-01-12 01:37:16.801973 """ # disable Invalid constant name pylint warning for mandatory Alembic variables. # pylint: disable=invalid-name import sqlalchemy as sa ...
apache-2.0
Python
fa5a570af022404d7a68f2d58851033c75a60920
add import script for Hartlepool
chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations
polling_stations/apps/data_collection/management/commands/import_hartlepool.py
polling_stations/apps/data_collection/management/commands/import_hartlepool.py
from data_collection.management.commands import BaseXpressWebLookupCsvImporter class Command(BaseXpressWebLookupCsvImporter): council_id = 'E06000001' addresses_name = 'HartlepoolProperty Post Code New.csv' stations_name = 'HartlepoolProperty Post Code New.csv' elections = ['mayor.tees-va...
bsd-3-clause
Python
241ac6d844febf829f6442897ebf547a291e5db4
Add Summarization API code for blog post
IndicoDataSolutions/SuperCell
summarization/summarization.py
summarization/summarization.py
import indicoio import csv indicoio.config.api_key = 'YOUR_API_KEY' def clean_article(article): return article.replace("\n", " ").decode('cp1252').encode('utf-8', 'replace') def clean_articles(article_list): # data processing: clean up new lines and convert strings into utf-8 so the indico API can read the d...
mit
Python
8e7e269a9d898d93fc93e666f09114dbf14d73ef
Add script to enhance CSV files with Presto API
mbeckett7/mars-reports-project
mars_enhance_csv.py
mars_enhance_csv.py
#!/usr/bin/env python ''' Script for enhancing MARS reports with data from the HOLLIS Presto API and the MARS transactions reports. Created for the Harvard Library ITS MARS Reports Pilot Project, 2014. ''' import csv import glob import requests import time from lxml import html bib_dict = {} # Dictionary of HOLLIS bib...
mit
Python
49b8d12e03088950d960105414294af8a56e1393
Create get_genome_size.py
KarrLab/kinetic_datanator,KarrLab/kinetic_datanator
kinetic_datanator/data_source/array_express_tools/get_genome_size.py
kinetic_datanator/data_source/array_express_tools/get_genome_size.py
import numpy as np from ete3 import NCBITaxa def get_genome_size(organism_name): domain = get_taxonomic_lineage(organism_name)[-3:-2][0] if domain == "Bacteria": file = open('number_of_prokaryote_genes.txt') if domain == 'Eukaryota': file = open('number_of_eukaryote_genes.txt') lines = file.readlines() lines...
mit
Python
4efe6903ac54cefd9871965853f63ec8841b6e4b
add new splitted countries and remove old ones
geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info
osmaxx/excerptexport/migrations/0039_update_countries_20160528_2049.py
osmaxx/excerptexport/migrations/0039_update_countries_20160528_2049.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-28 18:49 from __future__ import unicode_literals from django.db import migrations from osmaxx.utils.polyfile_helpers import get_polyfile_names_to_file_mapping def update_excerpt(excerpt, polyfile_path): from osmaxx.utils.polyfile_helpers import poly...
mit
Python
6612fffdb5d45b3752851d6d1c692753d6827795
Update user module URLS
vignanl/Plinth,kkampardi/Plinth,jvalleroy/plinth-debian,jvalleroy/plinth-debian,kkampardi/Plinth,kkampardi/Plinth,kkampardi/Plinth,harry-7/Plinth,jvalleroy/plinth-debian,freedomboxtwh/Plinth,freedomboxtwh/Plinth,freedomboxtwh/Plinth,vignanl/Plinth,harry-7/Plinth,jvalleroy/plinth-debian,harry-7/Plinth,freedomboxtwh/Plin...
plinth/modules/users/urls.py
plinth/modules/users/urls.py
# # This file is part of Plinth. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
# # This file is part of Plinth. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
agpl-3.0
Python
bb43a2e63f7f7c337b01ef855d426a84b73eeee5
Add a command prototype to list all items from a playlist
Parisson/Telemeta,Parisson/Telemeta,Parisson/Telemeta,Parisson/Telemeta
telemeta/management/commands/telemeta-export-items-from-user-playlists.py
telemeta/management/commands/telemeta-export-items-from-user-playlists.py
from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.template.defaultfilters import slugify from django.utils import translation from telemeta.models import Playlist, MediaCollection, ...
agpl-3.0
Python
811b51c9d3003dc156f8d7ea005182a0be875e32
add utils for sorting functionality with missing values
markovianhq/bonspy
bonspy/utils.py
bonspy/utils.py
def compare_vectors(x, y): for x_i, y_i in zip(x, y): comparison = _compare(x_i, y_i) if comparison == 0: continue else: return comparison return 0 def _compare(x, y): if x is not None and y is not None: return int(x > y) - int(x < y) elif x is n...
bsd-3-clause
Python
b3e1b721d6439cf8ba69f40536b4fb4e6be0b1ec
fix beaker.py for python3, add that as new file in beaker3.py. next need to make it dynamically choose which to load.
brosander/beaker-notebook,mattyb149/beaker-notebook,vital-ai/beaker-notebook,gef756/beaker-notebook,sirinath/beaker-notebook,maxyeg/beaker-notebook,Chasego/beaker-notebook,Chasego/beaker-notebook,maxyeg/beaker-notebook,mattyb149/beaker-notebook,sirinath/beaker-notebook,sirinath/beaker-notebook,codeaudit/beaker-notebook...
plugin/ipythonPlugins/src/dist/ipython/beaker3.py
plugin/ipythonPlugins/src/dist/ipython/beaker3.py
# Copyright 2014 TWO SIGMA OPEN SOURCE, 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 agre...
apache-2.0
Python
f9331db039dc549bf9e1d149338f67c455f29bea
add manage.py
jlaine/django-timegraph,jlaine/django-timegraph
manage.py
manage.py
#!/usr/bin/python from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run ...
bsd-2-clause
Python
a62dc18745f952b3fcb05ddf4768758e25883698
Add datamigration to create staff clearances
masschallenge/django-accelerator,masschallenge/django-accelerator
accelerator/migrations/0058_grant_staff_clearance_for_existing_staff_members.py
accelerator/migrations/0058_grant_staff_clearance_for_existing_staff_members.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-06-12 19:38 from __future__ import unicode_literals from django.db import migrations STAFF = "Staff" # don't import from models in migrations. def grant_staff_clearances_for_role_grantees(apps, program_role): Clearance = apps.get_model('accelerator', ...
mit
Python
ed514214967f4f9dde252070993f519db67057c3
add tests for intermittent water
mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource
test/668-intermittent-water.py
test/668-intermittent-water.py
#http://www.openstreetmap.org/way/107817218 # Arizona Canal Diversion Channel (ACDC) assert_has_feature( 16, 12353, 26272, 'water', { 'kind': 'river', 'intermittent': 'yes' }) #http://www.openstreetmap.org/way/96528126 # 10th Street Wash assert_has_feature( 16, 12368, 26272, 'water', { 'kind': 'drain'...
mit
Python
2d18583309a189e263bda13e19f7a05ba832c14d
Add file to write templates to json
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
backend/scripts/templates/templates2file.py
backend/scripts/templates/templates2file.py
#!/usr/bin/env python import rethinkdb as r from optparse import OptionParser import json import os if __name__ == "__main__": parser = OptionParser() parser.add_option("-P", "--port", dest="port", type="int", help="rethinkdb port", default=30815) (options, args) = parser.parse_args(...
mit
Python
72a851829a2190adc240bff3a62f4f03526a5e39
add basic checks
simomarsili/ndd
ndd/check.py
ndd/check.py
# -*- coding: utf-8 -*- """Basic distribution tests.""" # pylint: disable=missing-docstring import pytest import ndd COUNTS = [4, 12, 4, 5, 3, 1, 5, 1, 2, 2, 2, 2, 11, 3, 4, 12, 12, 1, 2] K = 100 def rounded(*args, **kwargs): result = ndd.entropy(COUNTS, *args, **kwargs) return round(result, 3) def test_b...
bsd-3-clause
Python
10d020cc7b91257b74e63c0579788c0f9435857f
add loadTestData.py
GluuFederation/community-edition-setup,GluuFederation/community-edition-setup,GluuFederation/community-edition-setup
templates/test/loadTestData.py
templates/test/loadTestData.py
import os if not os.path.exists('setup.py'): print "This script should be run from /install/community-edition-setup/" sys.exit() if not os.path.exists('/install/community-edition-setup/setup.properties.last'): print "setup.properties.last is missing can't continue" sys.exit() f=open('setup.py').r...
mit
Python
6df873a26ff71b07e68dcb2e9fa9c4b1725a70ce
Add migration for expert bid [WAL-976]
opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur
src/nodeconductor_assembly_waldur/experts/migrations/0003_expertbid.py
src/nodeconductor_assembly_waldur/experts/migrations/0003_expertbid.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-07-07 15:09 from __future__ import unicode_literals from decimal import Decimal import django.core.validators from django.db import migrations, models import django.db.models.deletion import nodeconductor.core.fields class Migration(migrations.Migration): ...
mit
Python
8e983472134817c1312e3713ca45c7359300dedf
Set students current flag based on enrolled and attending
rectory-school/rectory-apps,rectory-school/rectory-apps,rectory-school/rectory-apps,rectory-school/rectory-apps,rectory-school/rectory-apps
academics/management/commands/set_student_current.py
academics/management/commands/set_student_current.py
#!/usr/bin/python import logging from datetime import date from django.core.management.base import BaseCommand, CommandError from django.db import transaction from academics.models import Student, Enrollment, AcademicYear logger = logging.getLogger(__name__) class Command(BaseCommand): help = "Import reset stu...
mit
Python
c812f283762f18cdf9107b2b7fd679c6b57e32d7
Create coins.py
gappleto97/Senior-Project
common/coins.py
common/coins.py
mit
Python
091fa458c4b1553bbd8e253b5e794850c3470cc9
JOIN command
Heufneutje/txircd,ElementalAlchemist/txircd,DesertBus/txircd
txircd/modules/cmd_join.py
txircd/modules/cmd_join.py
from txircd.modbase import Command class JoinCommand(Command): def onUse(self, user, data): if "targetchan" not in data or not data["targetchan"]: return for chan in data["targetchan"]: user.join(chan) def processParams(self, user, params): channels = params[0].split(",") keys = params[1].split(",") ...
bsd-3-clause
Python
1190ae0f9f926db3b6969700a8a2b3ca67d7631c
Add google analytics script
fcooper8472/useful_scripts,fcooper8472/useful_scripts,fcooper8472/useful_scripts
query_google_analytics.py
query_google_analytics.py
import json import random data = { 'unique_users': random.randint(11, 99), 'number_of_cats': random.randint(11, 99), } with open('/fs/website/people/fergus.cooper/google_analytics_data.json', 'w') as outfile: json.dump(data, outfile)
bsd-3-clause
Python
145b84b8ad2ba2568a3ca3044a551c042496cb9c
Fix ordered dict rendering for task templates
openstack/rally,openstack/rally,openstack/rally,yeming233/rally,openstack/rally,yeming233/rally
rally/common/yamlutils.py
rally/common/yamlutils.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
6e4be2c3c082ea8551c1eee9fc792511a043f1a7
Fix bug when using unix sockets.
carltongibson/django-redis-cache,carltongibson/django-redis-cache,chripede/django-redis-cache,maikelwever/django-redis-cache,maikelwever/django-redis-cache,chripede/django-redis-cache
redis_cache/connection.py
redis_cache/connection.py
from redis.connection import UnixDomainSocketConnection, Connection class CacheConnectionPool(object): def __init__(self): self._clients = {} self._connection_pools = {} def __contains__(self, server): return server in self._clients def __getitem__(self, server): return ...
from redis.connection import UnixDomainSocketConnection, Connection class CacheConnectionPool(object): def __init__(self): self._clients = {} self._connection_pools = {} def __contains__(self, server): return server in self._clients def __getitem__(self, server): return ...
bsd-3-clause
Python
7e65f4da82cb9176247c1aa9ab72f40116cc6a8e
Add the Caliper package
mfherbst/spack,lgarren/spack,krafczyk/spack,iulian787/spack,matthiasdiener/spack,skosukhin/spack,iulian787/spack,tmerrick1/spack,mfherbst/spack,lgarren/spack,matthiasdiener/spack,skosukhin/spack,skosukhin/spack,skosukhin/spack,TheTimmy/spack,TheTimmy/spack,TheTimmy/spack,tmerrick1/spack,EmreAtes/spack,EmreAtes/spack,ma...
var/spack/repos/builtin/packages/caliper/package.py
var/spack/repos/builtin/packages/caliper/package.py
from spack import * class Caliper(Package): """ Caliper is a generic context annotation system. It gives programmers the ability to provide arbitrary program context information to (performance) tools at runtime. """ homepage = "https://github.com/LLNL/Caliper" url = "" version('...
lgpl-2.1
Python
c67b8173e33ed619d9601654a71c47d67fb82fe3
add package py-rope (#3314)
skosukhin/spack,lgarren/spack,skosukhin/spack,EmreAtes/spack,TheTimmy/spack,matthiasdiener/spack,mfherbst/spack,tmerrick1/spack,iulian787/spack,TheTimmy/spack,EmreAtes/spack,tmerrick1/spack,krafczyk/spack,krafczyk/spack,LLNL/spack,TheTimmy/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,lgarren/spack,matthi...
var/spack/repos/builtin/packages/py-rope/package.py
var/spack/repos/builtin/packages/py-rope/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
cdcf814003694b86df6abee8f24af9b8609ea9a6
Add py-zipp package (#12656)
iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/py-zipp/package.py
var/spack/repos/builtin/packages/py-zipp/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 PyZipp(PythonPackage): """Backport of pathlib-compatible object wrapper for zip files.""" ...
lgpl-2.1
Python
a206d2aebd5ae6f084377b4b7f2261a83afe4e70
Add new package: rsyslog (#18304)
LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack
var/spack/repos/builtin/packages/rsyslog/package.py
var/spack/repos/builtin/packages/rsyslog/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 Rsyslog(AutotoolsPackage): """The rocket-fast Syslog Server.""" homepage = "https://w...
lgpl-2.1
Python
05f794499997a1097bf625e3bd202eaaf06fe373
Add exec module
ihorlaitan/poet,mossberg/poet,khanhnnvn/poet
common/modules/exec.py
common/modules/exec.py
import module import re REGEX = re.compile('^exec(\s+-o(\s+[\w.]+)?)?\s+(("[^"]+")\s+)+$') MODNAME = 'exec' USAGE = """Execute commands on target. usage: exec [-o [filename]] "cmd1" ["cmd2" "cmd3" ...] \nExecute given commands and optionally log to file with optional filename. \noptions: -h\t\tshow help -o filename\t...
mit
Python
8a6fdc7c79f9038c1b89ba90d60555f3dcbbfdb9
Add migration
dbinetti/barberscore-django,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore
project/api/migrations/0016_selection_competitor.py
project/api/migrations/0016_selection_competitor.py
# Generated by Django 2.1.5 on 2019-02-12 14:15 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('api', '0015_auto_20190211_2028'), ] operations = [ migrations.AddField( model_name='selection',...
bsd-2-clause
Python
646e8cc87b4bb0d032f6f725a0fc2fbc8dfe5a1f
add a command exporting field with their locales to XLS
Parisson/Telemeta,Parisson/Telemeta,ANR-kamoulox/Telemeta,Parisson/Telemeta,ANR-kamoulox/Telemeta,Parisson/Telemeta,ANR-kamoulox/Telemeta,ANR-kamoulox/Telemeta
telemeta/management/commands/telemeta-export-fields.py
telemeta/management/commands/telemeta-export-fields.py
from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.template.defaultfilters import slugify from django.utils import translation from telemeta.models import * from telemeta.util.unaccen...
agpl-3.0
Python
d5e77eba7cb7fe5c3235d1e59612e4c32fbe658f
Add test for Flags
ysekky/chainer,niboshi/chainer,sinhrks/chainer,keisuke-umezawa/chainer,tkerola/chainer,minhpqn/chainer,keisuke-umezawa/chainer,wkentaro/chainer,benob/chainer,okuta/chainer,kikusu/chainer,niboshi/chainer,kikusu/chainer,rezoo/chainer,t-abe/chainer,jnishi/chainer,AlpacaDB/chainer,sinhrks/chainer,ktnyt/chainer,cupy/cupy,kt...
tests/cupy_tests/test_flags.py
tests/cupy_tests/test_flags.py
import unittest from cupy import flags class TestFlags(unittest.TestCase): def setUp(self): self.flags = flags.Flags(1, 2, 3) def test_c_contiguous(self): self.assertEqual(1, self.flags['C_CONTIGUOUS']) def test_f_contiguous(self): self.assertEqual(2, self.flags['F_CONTIGUOUS']...
mit
Python
990b452e8c142d6ada840026e80cbc15ebff895c
add csv test runner
manz/python-mapnik,yohanboniface/python-mapnik,whuaegeanse/mapnik,tomhughes/python-mapnik,Airphrame/mapnik,sebastic/python-mapnik,yiqingj/work,tomhughes/python-mapnik,jwomeara/mapnik,mapnik/python-mapnik,mapnik/mapnik,davenquinn/python-mapnik,Uli1/mapnik,sebastic/python-mapnik,yiqingj/work,garnertb/python-mapnik,qianwe...
tests/python_tests/csv_test.py
tests/python_tests/csv_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import glob from nose.tools import * from utilities import execution_path import os, mapnik2 def setup(): # All of the paths used are relative, if we run the tests # from another directory we need to chdir() os.chdir(execution_path('.')) if 'csv' in mapnik2...
lgpl-2.1
Python
033809cbc96e380bdd657fd4f10d1ca60b0aa9af
Create Graphingcalc.py
Aqkotz/Final-Project
Graphingcalc.py
Graphingcalc.py
mit
Python
2f0db6df4dd835903bf5f5a0e0da31f30c3bc56f
Add manage.py fixschools command
rohitdatta/pepper,rohitdatta/pepper,rohitdatta/pepper
scripts/rename_schools.py
scripts/rename_schools.py
from pepper.users.models import User from flask_script import Command import operator from pepper.app import DB class FixUsersSchoolNames(Command): def run(self): all_colleges = [] all_users = User.query.filter_by(school_id=None).all() edu_groups = {} non_edus = [] for user in all_users: if user.typ...
agpl-3.0
Python
b0d50f52f45d8f1c7de261c7fe8d15e621d0e641
Add a script to "untie" tied model weights.
lmjohns3/theanets,devdoer/theanets,chrinide/theanets
scripts/theanets-untie.py
scripts/theanets-untie.py
#!/usr/bin/env python import climate import cPickle as pickle import gzip import numpy as np logging = climate.get_logger('theanets-untie') @climate.annotate( source='load a saved network from FILE', target='save untied network weights to FILE', ) def main(source, target): opener = gzip.open if source.en...
mit
Python
cb403c3934f2401b6b337a19c8f5fd2c1f77805d
Solve 31.
klen/euler
031/solution.py
031/solution.py
# coding: utf-8 """ Project Euler problem #31. """ def problem(): u""" Solve the problem. In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation: 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p). It is possible to make £2 in the followin...
mit
Python
1774794c448d13a20891454a79f664406b364e4c
add cdr_serieshelper
cdr-stats/cdr-stats,areski/cdr-stats,Star2Billing/cdr-stats,cdr-stats/cdr-stats,cdr-stats/cdr-stats,cdr-stats/cdr-stats,Star2Billing/cdr-stats,areski/cdr-stats,Star2Billing/cdr-stats,areski/cdr-stats,areski/cdr-stats,Star2Billing/cdr-stats
cdr_stats/call_analytic/cdr_serieshelper.py
cdr_stats/call_analytic/cdr_serieshelper.py
# # CDR-Stats License # http://www.cdr-stats.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2014 Star2Billing S.L. # # The Initial Develope...
mpl-2.0
Python
fdf3df4154411652b340a38e901c52d678dbd92e
Replace get_user_profile_by_email with get_user.
punchagan/zulip,showell/zulip,tommyip/zulip,shubhamdhama/zulip,vabs22/zulip,showell/zulip,andersk/zulip,hackerkid/zulip,kou/zulip,vabs22/zulip,tommyip/zulip,rht/zulip,jackrzhang/zulip,jackrzhang/zulip,eeshangarg/zulip,eeshangarg/zulip,mahim97/zulip,zulip/zulip,synicalsyntax/zulip,vaidap/zulip,amanharitsh123/zulip,timab...
zerver/management/commands/bulk_change_user_name.py
zerver/management/commands/bulk_change_user_name.py
from __future__ import absolute_import from __future__ import print_function from typing import Any from argparse import ArgumentParser from django.core.management.base import CommandError from zerver.lib.actions import do_change_full_name from zerver.lib.management import ZulipBaseCommand class Command(ZulipBaseCo...
from __future__ import absolute_import from __future__ import print_function from typing import Any from argparse import ArgumentParser from django.core.management.base import BaseCommand from zerver.lib.actions import do_change_full_name from zerver.models import UserProfile, get_user_profile_by_email class Comman...
apache-2.0
Python
7f7feb676ad8ee29dda08ef18e16093c099e912b
sort reports by the first column
puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/userreports/reports/data_source.py
corehq/apps/userreports/reports/data_source.py
from corehq.apps.reports.sqlreport import SqlData from corehq.apps.userreports.sql import get_table_name from dimagi.utils.decorators.memoized import memoized class ConfigurableReportDataSource(SqlData): def __init__(self, domain, table_id, filters, aggregation_columns, columns): self.table_name = get_ta...
from corehq.apps.reports.sqlreport import SqlData from corehq.apps.userreports.sql import get_table_name from dimagi.utils.decorators.memoized import memoized class ConfigurableReportDataSource(SqlData): def __init__(self, domain, table_id, filters, aggregation_columns, columns): self.table_name = get_ta...
bsd-3-clause
Python
7e4803db10f0cd2ccb6d54117bc68dd999023908
Create __init__.py
vortex610/mos,vortex610/mos,vortex610/mos,vortex610/mos
run_tests/__init__.py
run_tests/__init__.py
apache-2.0
Python
339fdd927f9da0f7e15726d087c9916301aef935
Add soft margin SVM and added kernels and class
a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms
softMarginSVMwithKernels/howItWorksSoftMarginSVM.py
softMarginSVMwithKernels/howItWorksSoftMarginSVM.py
# -*- coding: utf-8 -*- """Soft Margin SVM classification with kernels for machine learning. Soft margin SVM is basically an SVM (see folder **supportVectorMachine**) which has some 'slack' and allows features to be 'wrongly' classified to avoid overfitting the classifier. This also includes kernels. Kernels use the i...
mit
Python
b89a98f0a5b6d4af94b5c52ff4baf4e7c10f2b53
Create PrintExpScalingFactors.py
enjin/contracts
solidity/python/constants/PrintExpScalingFactors.py
solidity/python/constants/PrintExpScalingFactors.py
from math import exp MIN_PRECISION = 32 for n in [1,2,3]: print ' uint256 constant SCALED_EXP_{} = 0x{:x};'.format(n,int(exp(n)*(1<<MIN_PRECISION))) print ' uint256 constant SCALED_VAL_{} = 0x{:x};'.format(n,int( (n)*(1<<MIN_PRECISION)))
apache-2.0
Python
171283cc2dee67eed8469fac08f531268a21c780
add influxdb_user salt state to manage influxdb users
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/states/influxdb_user.py
salt/states/influxdb_user.py
# -*- coding: utf-8 -*- ''' Management of InfluxDB users ============================ ''' def present(name, passwd, database, user=None, password=None, host=None, port=None): ''' Ensure that the user is present name The name of the user to manage passwd The password of th...
apache-2.0
Python
8601790648a17dd1794be4f88d61e4af01349a80
Test for the chipseq pipeline code
Multiscale-Genomics/mg-process-fastq,Multiscale-Genomics/mg-process-fastq,Multiscale-Genomics/mg-process-fastq
tests/test_pipeline_chipseq.py
tests/test_pipeline_chipseq.py
""" .. Copyright 2017 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 License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applic...
apache-2.0
Python
8cb665e107cb33b5ff3825e5ffb3bde919d36cff
Add cache runner as per #2897
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/runners/cache.py
salt/runners/cache.py
''' Return cached data from minions ''' # Import python libs import os # Import salt libs import salt.output import salt.payload def _cdata(): ''' Return the cached data from the minions ''' ret = {} serial = salt.payload.Serial(__opts__) mdir = os.path.join(__opts__['cachedir'], 'minions') ...
apache-2.0
Python
78ab60f9a0d7251effc238b98dc110706876da8e
add migration for new queue_empty field
Bitergia/allura,heiths/allura,heiths/allura,apache/allura,Bitergia/allura,heiths/allura,lym/allura-git,lym/allura-git,heiths/allura,apache/allura,heiths/allura,apache/incubator-allura,Bitergia/allura,apache/incubator-allura,lym/allura-git,Bitergia/allura,apache/incubator-allura,apache/allura,apache/allura,Bitergia/allu...
scripts/migrations/029-set-mailbox-queue_empty.py
scripts/migrations/029-set-mailbox-queue_empty.py
import logging from allura import model as M log = logging.getLogger(__name__) def main(): M.Mailbox.query.update({'queue': []}, {'$set': {'queue_empty': True}}, multi=True) M.Mailbox.query.update({'queue': {'$ne': []}}, {'$se...
apache-2.0
Python
1519f6be1d888f107a3b747e17cb1bd9d89c976f
Add SciPy benchmark
stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib
lib/node_modules/@stdlib/math/base/special/beta/benchmark/python/benchmark.scipy.py
lib/node_modules/@stdlib/math/base/special/beta/benchmark/python/benchmark.scipy.py
#!/usr/bin/env python """Benchmark scipy.special.beta.""" from __future__ import print_function import timeit NAME = "beta" REPEATS = 3 ITERATIONS = 1000000 def print_version(): """Print the TAP version.""" print("TAP version 13") def print_summary(total, passing): """Print the benchmark summary. ...
apache-2.0
Python
f93e29f52a59d5f545faf8fd94e950f50383c7fc
Integrate LLVM at llvm/llvm-project@9c8f950a0400
tensorflow/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-Corporation/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,Intel-Corporation/tens...
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "9c8f950a04004736bddb5093eda15f9a1c4f2eea" LLVM_SHA256 = "9dc64e4b455908f00d47b52d8a195b1e8dc98dd6337d16c85f3eda0ca37a1c8e" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "3019898e0d1b494b7e7e76790adb3d83eff4aca1" LLVM_SHA256 = "cb37f53299af16bc7e196c9dadd1e3fa889583d966b5d3e9adde7dc18d3094c5" tf_http_archive( ...
apache-2.0
Python
f902202b5e7f2473a7ce22505a4cc8b4f39377e0
Add scantailor package (#12833)
iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/scantailor/package.py
var/spack/repos/builtin/packages/scantailor/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 Scantailor(CMakePackage): """Scan Tailor is an interactive post-processing tool for scanne...
lgpl-2.1
Python
4155d6ca5db149d8b213cc4078580fc2e85d7f4d
Migrate database for model changes.
rcutmore/vinotes-api,rcutmore/vinotes-api
vinotes/apps/api/migrations/0002_auto_20150325_1104.py
vinotes/apps/api/migrations/0002_auto_20150325_1104.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('api', '0001_initial'), ] operations = [ migrations.AddField( model_name='wine', name='description', ...
unlicense
Python
983877d050dea6c962037815ee5a2b36725ad26f
Add problem66.py
mjwestcott/projecteuler,mjwestcott/projecteuler,mjwestcott/projecteuler
euler_python/problem66.py
euler_python/problem66.py
""" problem66.py Consider quadratic Diophantine equations of the form: x**2 – Dy**2 = 1. For example, when D=13, the minimal solution in x is 6492 – 13×1802 = 1. It can be assumed that there are no solutions in positive integers when D is square. By finding minimal solutions in x for D = {2, 3, 5, 6, 7}, we obtain the...
mit
Python
253acd0afd532e8fa431ab140856fe0c4ba41684
make the plugins directory a package, so that plugins can depend on each other.
alexex/alebot
plugins/__init__.py
plugins/__init__.py
# keep this to be able to access plugins from other plugins
mit
Python
7ab37e931a836faa78a78f5d8358d845f72cdf49
Add low level Gemini serial command script
bgottula/point
point/gemini_cmd.py
point/gemini_cmd.py
#!/usr/bin/env python3 """ A simple script for sending raw serial commands to Gemini. """ import time import serial import readline def main(): ser = serial.Serial('/dev/ttyACM0', baudrate=9600) while True: cmd = input('> ') if len(cmd) == 0: continue # losmandy native...
mit
Python
f65789fb705b43b446d1fc4b899074a66685a420
add missed file
djtotten/workbench,SuperCowPowers/workbench,SuperCowPowers/workbench,djtotten/workbench,SuperCowPowers/workbench,djtotten/workbench
workbench/clients/workbench_client.py
workbench/clients/workbench_client.py
''' This encapsulates some boilerplate workbench client code ''' import ConfigParser import argparse import os def grab_server_args(): ''' Grab server info from configuration file ''' workbench_conf = ConfigParser.ConfigParser() config_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'confi...
mit
Python
f203136772cfdca96a44a848d646426a42111698
Solve 20.
klen/euler
020/solution.py
020/solution.py
""" Project Euler problem #20. """ import math as mt def problem(): """ Solve the problem. Find the sum of the digits in the number 100! Answer: 648 """ num = mt.factorial(100) return sum(map(int, str(num))) if __name__ == '__main__': print problem()
mit
Python
fe88269d03915e06cba0d0d228e2f4e78592d172
Create 0007_ssoaccesslist.py
marbindrakon/eve-wspace,mmalyska/eve-wspace,mmalyska/eve-wspace,mmalyska/eve-wspace,mmalyska/eve-wspace,evewspace/eve-wspace,evewspace/eve-wspace,evewspace/eve-wspace,marbindrakon/eve-wspace,marbindrakon/eve-wspace,evewspace/eve-wspace,marbindrakon/eve-wspace
evewspace/API/migrations/0007_ssoaccesslist.py
evewspace/API/migrations/0007_ssoaccesslist.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ('API', '0006_auto_20161223_1751'), ] operations = [ migrations.CreateModel( nam...
apache-2.0
Python
5b67f6ddea05cb301a317e500657cb1cd0949bff
Create solution.py
lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges
hackerrank/algorithms/sorting/easy/running_time_of_quicksort/py/solution.py
hackerrank/algorithms/sorting/easy/running_time_of_quicksort/py/solution.py
#!/bin/python class QuickSort(object): def __init__(self, debugMode = False): self._debugMode = debugMode self._swapCount = 0 def partition(self, L, lo, hi): if hi - lo < 2: return lo i = j = lo v = hi - 1 while i < v: if L[i] < L[v]:...
mit
Python
5fc58dbb3dbb379eee332e0a96704a1ddecb71c2
move file
kaczmarj/neurodocker,kaczmarj/neurodocker
src/docker/utils.py
src/docker/utils.py
"""Utility functions.""" from __future__ import absolute_import, division, print_function import http.client # This should have been backported to Python2. from ..utils import logger, load_yaml, save_yaml def indent(instruction, cmd, line_suffix=' \\'): """Add Docker instruction and indent command. Paramete...
apache-2.0
Python
844d94619f2cf221ab5bd550f3136be4d164155b
add working dir
icyblade/aleph,icyblade/aleph,icyblade/aleph,icyblade/aleph,icyblade/aleph
working_dir/diff.py
working_dir/diff.py
#! /usr/bin/env python #! coding: utf8 import os, argparse, re, glob db_user = 'aleph' db_pass = 'swbrIcu3Iv4cEhnTzmJL' # parse args parser = argparse.ArgumentParser(description='') parser.add_argument('--locale', '-l', default='zhCN', help='Locale to extract, eg. zhCN, default zhCN') parser.add_a...
mit
Python
bb0178d0b97f52bb163cf13be3bd763840426f32
Add API tests
FreeMusicNinja/freemusic.ninja,FreeMusicNinja/freemusic.ninja
django/artists/tests/test_api.py
django/artists/tests/test_api.py
import json from django.core.urlresolvers import reverse from mock import patch from rest_framework import status from rest_framework.test import APITestCase from artists.models import Artist from echonest.models import SimilarResponse class ArtistTest(APITestCase): @patch('echonest.utils.get_similar_from_api'...
bsd-3-clause
Python
36beb6ae8bc41e5d131dbbdc65d6716d498375c7
add script to diff bonferonni & benjamini-whitney p-value corrections
terraswat/hexagram,terraswat/hexagram,ucscHexmap/hexagram,ucscHexmap/hexagram,ucscHexmap/hexagram,terraswat/hexagram
server/diffBHvsBon.py
server/diffBHvsBon.py
#!/usr/bin/env python2.7 """ diffBHvsBon.py This reports differnences between the BenjaminiWhitney-FDR p-value correction vs. the Bonferroni """ import sys, os, csv, traceback, glob def diffBHvsBon(): #basePath = '/Users/swat/data/mcrchopra/first/' #tmpBase = '/Users/swat/tmp/' tmpBase = '/cluster/home/sw...
mit
Python
55fa30c236095006e6f9c970ef668598c4348a96
Add microservice plugin for adding static attributes to responses.
irtnog/SATOSA,irtnog/SATOSA,SUNET/SATOSA,its-dirg/SATOSA,SUNET/SATOSA
src/satosa/micro_service/attribute_modifications.py
src/satosa/micro_service/attribute_modifications.py
import os import yaml from satosa.internal_data import DataConverter from satosa.micro_service.service_base import ResponseMicroService class AddStaticAttributes(ResponseMicroService): """ Add static attributes to the responses. The path to the file describing the mapping (as YAML) of static attributes...
apache-2.0
Python
b72dd1c890491ccfe2de66f89f5adc035e862acb
Create HtmlParser.py
MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab
service/HtmlParser.py
service/HtmlParser.py
######################################### # HtmlParser.py # description: html parser # categories: [document] # possibly more info @: http://myrobotlab.org/service/HtmlParser ######################################### # start the service htmlparser = Runtime.start("htmlparser","HtmlParser")
apache-2.0
Python
9c8402bdadb4860a3876aa2ab0f94b9ddac8cfd5
Add offboard_sample.py
uenota/px4_simulation_stack,uenota/px4_simulation_stack,uenota/px4_simulation_stack
script/offboard_sample.py
script/offboard_sample.py
#!/usr/bin/env python import rospy from geometry_msgs.msg import PoseStamped from mavros_msgs.msg import State from mavros_msgs.srv import CommandBool, CommandBoolRequest from mavros_msgs.srv import SetMode, SetModeRequest current_state = State() def state_cb(msg): global current_state current_state = msg d...
mit
Python
b883b3066848957376d841cb4ffdf2d5646315c8
add quick-testlist.py
chenxianqin/intel-gpu-tools,tiagovignatti/intel-gpu-tools,mv0/intel-gpu-tools,tiagovignatti/intel-gpu-tools,tiagovignatti/intel-gpu-tools,chenxianqin/intel-gpu-tools,tiagovignatti/intel-gpu-tools,mv0/intel-gpu-tools,mv0/intel-gpu-tools,mv0/intel-gpu-tools,chenxianqin/intel-gpu-tools,chenxianqin/intel-gpu-tools
scripts/quick-testlist.py
scripts/quick-testlist.py
#!/usr/bin/env python # # Copyright 2015 Intel Corporation # # 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, modif...
mit
Python
718379eea1e0c58ba76ada08d64512d9f4904c07
add new package (#10060)
LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,iulian787/spack
var/spack/repos/builtin/packages/eztrace/package.py
var/spack/repos/builtin/packages/eztrace/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 Eztrace(AutotoolsPackage): """EZTrace is a tool to automatically generate execution traces...
lgpl-2.1
Python
cfe9550bfe7d8659c06892af8a32662cb372bea9
add new package : sysstat (#13907)
LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,iulian787/spack
var/spack/repos/builtin/packages/sysstat/package.py
var/spack/repos/builtin/packages/sysstat/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 Sysstat(AutotoolsPackage): """The sysstat package contains various utilities, common to ma...
lgpl-2.1
Python
da6f3bbb10537da5e88340016fa84ea5bcc359b0
Add support for route 53 dns record manipulation
CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge
actions/cloudbolt_plugins/aws/route_53_dns_plugin/route_53_dns_record_manipulation.py
actions/cloudbolt_plugins/aws/route_53_dns_plugin/route_53_dns_record_manipulation.py
''' http://boto3.readthedocs.io/en/latest/reference/services/route53.html http://boto3.readthedocs.io/en/latest/reference/services/route53.html#Route53.Client.change_resource_record_sets ''' from resourcehandlers.aws.models import AWSHandler from common.methods import set_progress #dns zone friendly name -- no traili...
apache-2.0
Python
56592b10e25cd1f2cf8d122df389268ab24b3729
refactor and use OOMMF_PATH environment variable to locate oommf.tcl
fangohr/oommf-python,ryanpepper/oommf-python,ryanpepper/oommf-python,ryanpepper/oommf-python,fangohr/oommf-python,fangohr/oommf-python,ryanpepper/oommf-python
oommfmif/__init__.py
oommfmif/__init__.py
import os import subprocess # Environment variable OOMMF_PATH should point to the directory which # contains 'oommf.tcl' oommf_path = os.environ['OOMMF_PATH'] def call_oommf(argstring): """Convenience function to call OOMMF: Typicallusage p = call_oommf("+version") p.wait() stdout, stderr = p.stdout...
import subprocess def get_version(): p = subprocess.Popen("~/git/oommf/oommf/oommf.tcl +version", shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE) p.wait() stdout, stderr = p.stdout.read(), p.stderr.read() # version is returned in stderr print(stderr.split()[0:...
bsd-2-clause
Python
94f5f630c315bc6951c98cd2a9f4908ce05d59a4
Test float precision in json encoding.
cicku/fedmsg,mathstuf/fedmsg,fedora-infra/fedmsg,maxamillion/fedmsg,fedora-infra/fedmsg,chaiku/fedmsg,vivekanand1101/fedmsg,pombredanne/fedmsg,chaiku/fedmsg,pombredanne/fedmsg,vivekanand1101/fedmsg,maxamillion/fedmsg,mathstuf/fedmsg,fedora-infra/fedmsg,cicku/fedmsg,mathstuf/fedmsg,chaiku/fedmsg,cicku/fedmsg,pombredanne...
fedmsg/tests/test_encoding.py
fedmsg/tests/test_encoding.py
import unittest import fedmsg.encoding from nose.tools import eq_ class TestEncoding(unittest.TestCase): def test_float_precision(self): """ Ensure that float precision is limited to 3 decimal places. """ msg = dict(some_number=1234.123456) json_str = fedmsg.encoding.dumps(msg) pr...
lgpl-2.1
Python
dfb4c5422c79fcd413d0d9a028cb5548e2678454
Add script for generating test certificates
datatheorem/TrustKit,datatheorem/TrustKit,datatheorem/TrustKit,datatheorem/TrustKit
generate_test_certificates.py
generate_test_certificates.py
import trustme # Create a CA ca = trustme.CA() # Issue a cert signed by this CA server_cert = ca.issue_cert(u"www.good.com") # Save the PEM-encoded data to a file ca.cert_pem.write_to_path("GoodRootCA.pem") server_cert.private_key_and_cert_chain_pem.write_to_path("www.good.com.pem")
mit
Python
89a78e09ee52c27df8cd548839b240984b13d61d
add client exception
duanhongyi/kakfa
kafka/exception/client.py
kafka/exception/client.py
class FailedPayloadsException(Exception): pass class ConnectionError(Exception): pass class BufferUnderflowError(Exception): pass class ChecksumError(Exception): pass class ConsumerFetchSizeTooSmall(Exception): pass class ConsumerNoMoreData(Exception): pass
apache-2.0
Python
05004f8dc48fe15268bc2d0146e5788f0bdf463e
Add missing migration
5monkeys/djedi-cms,5monkeys/djedi-cms,5monkeys/djedi-cms
djedi/migrations/0002_auto_20190722_1447.py
djedi/migrations/0002_auto_20190722_1447.py
# Generated by Django 2.2.3 on 2019-07-22 14:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djedi', '0001_initial'), ] operations = [ migrations.AlterField( model_name='node', name='is_published', ...
bsd-3-clause
Python
2bbca64af8089433e5e9a1a3a57439286affaabb
Create a macro to set metadata to routed stories from desk's default template. [SDCP-375] (#2017)
superdesk/superdesk-core,petrjasek/superdesk-core,petrjasek/superdesk-core,superdesk/superdesk-core,petrjasek/superdesk-core,superdesk/superdesk-core,petrjasek/superdesk-core,superdesk/superdesk-core
superdesk/macros/set_default_template_metadata.py
superdesk/macros/set_default_template_metadata.py
import logging from flask import current_app as app from flask_babel import lazy_gettext from superdesk import get_resource_service logger = logging.getLogger(__name__) def get_default_content_template(item, **kwargs): if 'dest_desk_id' in kwargs: desk = None desk_id = kwargs['dest_desk_id'] ...
agpl-3.0
Python
f74c20ae5a35eb66b48b1dbc219d00db674bf995
Add tests for StudentsInfoList component of GCI dashboard.
rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son
tests/app/soc/modules/gci/views/test_dashboard.py
tests/app/soc/modules/gci/views/test_dashboard.py
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange 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 applic...
apache-2.0
Python
c201245a01ded92bec91f1f34320e87666330c44
add mbtiles command
consbio/seedsource-core,consbio/seedsource-core
seedsource_core/django/seedsource/management/commands/create_vector_tiles.py
seedsource_core/django/seedsource/management/commands/create_vector_tiles.py
from django.core.management import BaseCommand from seedsource_core.django.seedsource.models import SeedZone import subprocess class Command(BaseCommand): help = 'Facilitates converting of vector data into vector tiles.' def handle(self, *args, **options): def write_out(output): self.stdou...
bsd-3-clause
Python
08364dae50a68b5d053eadc836c02b51873df250
Add dog_cat
aidiary/keras_examples,aidiary/keras_examples
cnn/dog_cat/dog_cat.py
cnn/dog_cat/dog_cat.py
from keras.models import Sequential from keras.layers import Convolution2D, MaxPooling2D from keras.layers import Activation, Dropout, Flatten, Dense from keras.preprocessing.image import ImageDataGenerator def save_history(history, result_file): loss = history.history['loss'] acc = history.history['a...
mit
Python
fa7a24493e6e8029ea2dd7f3bf244b08353c50a3
create run commnd
ojengwa/gfe
manage.py
manage.py
import os from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from app import app, db app.config.from_object(os.getenv('APP_SETTINGS', 'config.DevelopmentConfig')) migrate = Migrate(app, db) manager = Manager(app) manager.add_command('db', MigrateCommand) if __name__ == '__main__':...
mit
Python
6bd35a2df0dbeca2668999dafbbd05779911cca7
add directory for state
boyjimeking/paintown,boyjimeking/paintown,Sevalecan/paintown,Sevalecan/paintown,boyjimeking/paintown,boyjimeking/paintown,Sevalecan/paintown,boyjimeking/paintown,boyjimeking/paintown,Sevalecan/paintown,Sevalecan/paintown,Sevalecan/paintown,boyjimeking/paintown,Sevalecan/paintown,Sevalecan/paintown,boyjimeking/paintown
src/mugen/state/serialize.py
src/mugen/state/serialize.py
#!/usr/bin/env python # This script reads a specification of a datastructure with fields in it and writes # out a class that contains those fields and a way to serialize/deserialize them # to a stream. This is similar to google's protobuf but using a much simpler # implementation. # TODO: grammar of specification
bsd-3-clause
Python
d5aae9d0a770cad05c76c30754f5fcc57be5bd9b
Solve Fuel Spent in python
deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr...
solutions/uri/1017/1017.py
solutions/uri/1017/1017.py
h = float(input()) s = float(input()) print(f"{h * s / 12.0:.3f}")
mit
Python