commit
stringlengths
40
40
subject
stringlengths
1
1.49k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
new_contents
stringlengths
1
29.8k
old_contents
stringlengths
0
9.9k
lang
stringclasses
3 values
proba
float64
0
1
0ba2b5f63aeb39a1d1faf6d0f9eb2626bcc86d3e
Create urls.py
urls.py
urls.py
from django.conf.urls import url from django.contrib import admin from django.conf.urls.static import static from django.conf import settings from likes import * urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', index), url(r'^like', uri_manager, name='likes'), url(r'^auth', authorize, name=...
Python
0.000017
5f7dfe4b83f318cc712bc1a7ed955d6c6374f7f5
Create es4_windows.py
04-work-with-multiple-windows/python/es4_windows.py
04-work-with-multiple-windows/python/es4_windows.py
# http://elementalselenium.com/tips/4-work-with-multiple-windows import os import unittest from selenium import webdriver from selenium.webdriver.common.keys import Keys # for send_keys class ES4_Windows(unittest.TestCase): def setUp(self): self.driver = webdriver.Firefox() def test_example_1(sel...
Python
0.000001
8c0612232a79c55b3c58a6230f590e5d6d4e36f9
Implement taking info parser
backend/core/parser.py
backend/core/parser.py
def parse_credit(text): semester_name = { 'U000200001U000300001': '1', 'U000200001U000300002': 'S', 'U000200002U000300001': '2', 'U000200002U000300002': 'W', } lines = text.split('\n')[:-1] columns = [] infos = [] for line in lines: line = line.split('\t')...
Python
0.000006
e895050634f5161d93520aaea7c7e54e329fadbe
add oncotator
bam/exome_oncotator.py
bam/exome_oncotator.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from multiprocessing import Pool import subprocess import shlex import logging import argparse import datetime import os from subprocess import call parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", help="VCF file") parser.add_argument("-t", "--tar...
Python
0.000003
8e16ac329d459d11b971216b0eab032e81b5557e
Add flowline benchmarks (#489)
benchmarks/flowline.py
benchmarks/flowline.py
# Write the benchmarking functions here. # See "Writing benchmarks" in the asv docs for more information. import os import shutil import numpy as np import oggm from oggm.tests.funcs import init_hef, get_test_dir from oggm import utils, tasks from oggm.core import massbalance, flowline testdir = os.path.join(get_test...
Python
0
59c173bf4179fc77eacf97f3f08359498d35a635
Add switch class for good utility
util.py
util.py
# coding=utf-8 """ The switch class refers to PEP 275 (Marc-André Lemburg <mal at lemburg.com>) (https://www.python.org/dev/peps/pep-0275/) """ class switch(object): def __init__(self,value): self.value = value self.fall = False def __iter__(self): """Return the match method once, then...
Python
0
ef5260a53773bdc024702ca804b128ba9b12698b
566. Reshape the Matrix. C matrix
p566_c_matrix.py
p566_c_matrix.py
import unittest class Solution(object): def matrixReshape(self, nums, r, c): """ :type nums: List[List[int]] :type r: int :type c: int :rtype: List[List[int]] """ if not nums or len(nums) * len(nums[0]) != r * c: return nums result = [] ...
Python
0.999999
3cb47114dc40ebbbcc946c79946ec59813a7af7f
add email module
emails.py
emails.py
import smtplib from config import MAIL_SERVER from config import MAIL_PORT from config import MAIL_USERNAME from config import MAIL_PASSWORD from config import DEFAULT_MAIL_SENDER def send_email(recipient, subject, body, sender=None): if sender is None: FROM = DEFAULT_MAIL_SENDER else: FROM ...
Python
0.000006
c08ebde007b0c57780d8d63c1f925c1d6a8bfc7c
Append 'grpc' to the C++ service namespaces for google APIs
third_party/googleapis/build_rules.bzl
third_party/googleapis/build_rules.bzl
# Copyright 2020 The TensorFlow Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# Copyright 2020 The TensorFlow Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
Python
0.000021
b3959854da150cf734cda3521efd14ee0565d352
Create Rotor.py
EnigmaMachine/Rotor.py
EnigmaMachine/Rotor.py
class Rotor(object): def __init__(self, rotor_config, starting_position, config_file): # If starting_position is not between 0 and 25, a ValueError is raised. if starting_position < 0 or starting_position > 25: raise ValueError( "starting_position in Rotor must be between 0 and 25" ) # If rotor_conf...
Python
0.000001
f301aa5ecdc3f9d821a72bb6a03d9857c43e72fc
add missing file
app/fields/auth.py
app/fields/auth.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask_restplus import fields from app import api auth_fields_get = api.model('AuthGet', { 'access_token': fields.String }) auth_fields_post = api.model('AuthPost', { 'username': fields.String(required=True), 'password': fields.String(required=True) } )
Python
0.000003
2785b8d5b1338126b6887b23fefec106ed877601
Add first 16 hexagrams
hexagrams.py
hexagrams.py
# -*- coding: utf-8 -*- hexagrams = { "Ch'ien": (1, 1, 1, 1, 1, 1), "K'un": (0, 0, 0, 0, 0, 0), "Chun": (0, 1, 0, 0, 0, 1), "Mêng": (1, 0, 0, 0, 1, 0), "Hsü": (0, 1, 0, 1, 1, 1 ), "Sung": (1, 1, 1, 0, 1, 0), "Shih": (0, 0, 0, 0, 1, 0), "Pi": (0, 1, 0, 0, 0, 0), "Hsiao Ch'u": (1, 1, ...
Python
0.999999
11cc94f4a6545b49317042df4edf1804ccc3bdd8
add a python script to export the links
export.py
export.py
#!/usr/bin/env python """ A quick script to turn the database into KML showing pairs of point-to-point links """ import sys import sqlite3 from xml.sax.saxutils import escape conn = sqlite3.connect("prism.sqlite3") c = conn.cursor() sql = open("getpairs.sql").read() c.execute(sql) print """<?xml version="1.0" encodin...
Python
0
2d7d4b533999c029a33d7802d7ddfba631e07604
Add Django 1.4 style wsgi app settings file
wsgi.py
wsgi.py
""" WSGI application settings for FST instance The default setup at Domstolsverket assumes every instance of FST is running under it's own virtualenv. """ import os import sys import site #VIRTUALENV_PATH = '/path/of/your/virtualenv' PYTHON_SITE_PACKAGES = 'lib/python2.6/site-packages' # Specify the site-packages...
Python
0
c131e6108a72c57af4d3bdbe67d182d6c0ddb1eb
Add migration to modify on_delete
geotrek/feedback/migrations/0008_auto_20200326_1252.py
geotrek/feedback/migrations/0008_auto_20200326_1252.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2020-03-26 12:52 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('feedback', '0007_auto_20200324_1412'), ] operatio...
Python
0.000001
a8f3cb864b39ef3178af652bfee4dcb6775baa71
Make sure tags/attributes are converted correctly
evennia/typeclasses/migrations/0009_rename_player_cmdsets_typeclasses.py
evennia/typeclasses/migrations/0009_rename_player_cmdsets_typeclasses.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-07-09 21:33 from __future__ import unicode_literals import re from django.db import migrations CASE_WORD_EXCEPTIONS = [] def _case_sensitive_replace(string, old, new): """ Replace text, retaining exact case. Args: string (str): String...
Python
0.000001
b42c13de01a49e7fe3fb7caa22089ea1cd87f7bf
Add sanity tests for baremetal power state commands
ironicclient/tests/functional/osc/v1/test_baremetal_node_power_states.py
ironicclient/tests/functional/osc/v1/test_baremetal_node_power_states.py
# Copyright (c) 2016 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
0.999226
f0b5b6a84f9b217376b54361b2afaeb19af24380
Add containers
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...
Python
0.000005
2c174eeafa48302951e743ed2b9bbe91a1992899
make sure that the file you are trying to import actually exists
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', ...
Python
0
3b06894ba1aadb3460ed60e47e931065484976ee
Add a command to undo results imports for specified projects
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...
Python
0.000121
cf3c2ee83bec780081a161420101209b7add16e5
Clean the old apps that can cause problems due to the namespace issue
alembic/versions/36274f13329a_clean_the_database.py
alembic/versions/36274f13329a_clean_the_database.py
"""Clean the database Revision ID: 36274f13329a Revises: 9aea6784a701 Create Date: 2019-01-03 23:46:35.648015 """ # revision identifiers, used by Alembic. revision = '36274f13329a' down_revision = '9aea6784a701' import time from alembic import op import sqlalchemy as sa import sqlalchemy.sql as sql metadata = sa.M...
Python
0.000002
5dde9f6aca671440253729c29530e93974921ea0
Add a migration to add the 'Other' field to QueuedImage.why_allowed
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',...
Python
0.000001
065b8ec2865b0746393a427d1d078c655905241c
Add renaming PDF files
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...
Python
0
57b396177854636257ad5884b0deeca6a79d207a
Add libpfm4 package. (#3667)
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...
Python
0
d4f498db7c2cb5da0ad0202d7a4b6a919ac896b3
add new package (#24989)
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...
Python
0
f627f04ebe0186b19d58619cab8b7098f5ca2e4c
Add plugin for Nova server state metrics
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() ...
Python
0
c0cd62af0ee29743430156eda613665dd58a97c3
Apply SA naming convention
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...
Python
0
07db0cda509adac3d3fcbeb3368fd15c19023310
Add flattener
flatten.py
flatten.py
#! /usr/local/bin/python import argparse import os import shutil import sys import tempfile import git IGNORE_PATTERNS = ('.git', ".DS_Store") SAFE_CHARS = ["-", "_", "."] MAX_LENGTH = 100 STUDENT = "student" DEVELOP = "develop-" DEVELOP_DEFAULT = "all develop branches" DIFF_FORMAT = """ You can download a zip of...
Python
0.000023
46c1a39041d89325d849339ebab0854a91f520d4
Create rtl-config.py
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
Python
0.000001
9ad5d9668c3faf85c38d5655054b8530d2e14444
set up migration for meta_data ingest
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...
Python
0
5ef00907efd5502ee3de38030f23a16ccc3a41be
Add script to create a prunable checkpoint of a densely trained model.
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...
Python
0
9aeb9d35cd49ccd7ab1ede87d70666e34b80320c
Add tests for run docker mgmt command
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...
Python
0.000001
7df706d8727064275aeccf04f5411661b33f9250
Create show_vlans.py
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 | ...
Python
0
66831279407e7a6626b8fe0ea06c886d5191f699
Create q24telnetexec.py
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 #######################################################...
Python
0.000014
1745b040b7e89f6d0793e7b744752ae5345b68b8
Create hongbao2.py
hongbao2.py
hongbao2.py
#!/usr/bin python # -*- coding: utf-8 -*- import time import argparse from naoqi import ALProxy, ALBroker, ALModule defaultIP = '127.0.0.1' class Hongbao(ALModule): def __init__(self, handle, ip, port): ALModule.__init__(self, handle) self._handle = handle self._ip = ip self._port...
Python
0.000006
991d40c62a7a44fc94ebd83e6726e5beaf867728
Add exercise Chuck Norris
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...
Python
0.000205
1d1a95261c5dc057e1e739a459bbf7d1574ce808
add all files into repo
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 = ['点歌'...
Python
0.000001
e4cde9db9f9b99622cac8fa88f4acab1fce41d80
add myrename
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...
Python
0.000001
92ec039cdecffd7ec03f5954dfe5c69499921ba7
Make consonants
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...
Python
0.999999
ab553873c782a7975e6b2cb3d240d5b9751c7a44
Add API for RepositoryLayout.
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...
Python
0
cbaf4e86c4409735a8f011f5a8f801a34278c21c
Increase text index property size
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 ...
Python
0
fa5a570af022404d7a68f2d58851033c75a60920
add import script for Hartlepool
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...
Python
0
241ac6d844febf829f6442897ebf547a291e5db4
Add Summarization API code for blog post
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...
Python
0
8e7e269a9d898d93fc93e666f09114dbf14d73ef
Add script to enhance CSV files with Presto API
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...
Python
0
0c305fac7138fe0354d220cdee69c995cbd73eda
Include gstreamer in pyinstaller
kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py
kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py
''' Kivy hook for PyInstaller ========================= Kivy load itself in a complete dynamic way. PyImported don't see most of the import cause of the Factory and Core. In addition, the data and missing module are not copied automatically. With this hook, everything needed for running kivy is correctly copied. Che...
''' Kivy hook for PyInstaller ========================= Kivy load itself in a complete dynamic way. PyImported don't see most of the import cause of the Factory and Core. In addition, the data and missing module are not copied automatically. With this hook, everything needed for running kivy is correctly copied. Che...
Python
0
49b8d12e03088950d960105414294af8a56e1393
Create get_genome_size.py
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...
Python
0.000003
4efe6903ac54cefd9871965853f63ec8841b6e4b
add new splitted countries and remove old ones
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...
Python
0.000002
6612fffdb5d45b3752851d6d1c692753d6827795
Update user module URLS
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...
Python
0
bb43a2e63f7f7c337b01ef855d426a84b73eeee5
Add a command prototype to list all items from a playlist
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, ...
Python
0
811b51c9d3003dc156f8d7ea005182a0be875e32
add utils for sorting functionality with missing values
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...
Python
0
b3e1b721d6439cf8ba69f40536b4fb4e6be0b1ec
fix beaker.py for python3, add that as new file in beaker3.py. next need to make it dynamically choose which to load.
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...
Python
0
f9331db039dc549bf9e1d149338f67c455f29bea
add manage.py
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 ...
Python
0.000001
a62dc18745f952b3fcb05ddf4768758e25883698
Add datamigration to create staff clearances
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', ...
Python
0
ed514214967f4f9dde252070993f519db67057c3
add tests for intermittent water
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'...
Python
0.000002
2d18583309a189e263bda13e19f7a05ba832c14d
Add file to write templates to json
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(...
Python
0
72a851829a2190adc240bff3a62f4f03526a5e39
add basic checks
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...
Python
0
10d020cc7b91257b74e63c0579788c0f9435857f
add loadTestData.py
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...
Python
0.000003
6df873a26ff71b07e68dcb2e9fa9c4b1725a70ce
Add migration for expert bid [WAL-976]
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): ...
Python
0
8e983472134817c1312e3713ca45c7359300dedf
Set students current flag based on enrolled and attending
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...
Python
0
c812f283762f18cdf9107b2b7fd679c6b57e32d7
Create coins.py
common/coins.py
common/coins.py
Python
0.000005
1190ae0f9f926db3b6969700a8a2b3ca67d7631c
Add google analytics script
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)
Python
0.000001
145b84b8ad2ba2568a3ca3044a551c042496cb9c
Fix ordered dict rendering for task templates
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...
Python
0.000019
6e4be2c3c082ea8551c1eee9fc792511a043f1a7
Fix bug when using unix sockets.
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 ...
Python
0
dca63050b7832723f6b85fca1f28379ab8c06cba
Implement ObservationPlanning node
supersaop/src/observation_planning.py
supersaop/src/observation_planning.py
#!/usr/bin/env python3 # Copyright (c) 2018, CNRS-LAAS # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list...
Python
0
7e65f4da82cb9176247c1aa9ab72f40116cc6a8e
Add the Caliper package
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('...
Python
0
c67b8173e33ed619d9601654a71c47d67fb82fe3
add package py-rope (#3314)
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...
Python
0
cdcf814003694b86df6abee8f24af9b8609ea9a6
Add py-zipp package (#12656)
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.""" ...
Python
0
a206d2aebd5ae6f084377b4b7f2261a83afe4e70
Add new package: rsyslog (#18304)
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...
Python
0
239c74343fa1bb1eb7134cf701986d9487daf5ce
Create strategies.py
strategies.py
strategies.py
# MIT License # Copyright (c) 2017 Rene Jean Corneille # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, m...
Python
0.000001
7426e4b0568febc1d137390a8df0cacb1f2b8ca8
Add get_api_classes and get_api_class methods for dynamically loading oscarapi classes
oscarapi/loading.py
oscarapi/loading.py
import traceback import sys from django.conf import settings from oscar.core.exceptions import (ModuleNotFoundError, ClassNotFoundError, AppNotFoundError) def get_api_class(module_label, classname): """ Dynamically import a single class from the given module. This is ...
Python
0
05f794499997a1097bf625e3bd202eaaf06fe373
Add exec module
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...
Python
0.000001
8a6fdc7c79f9038c1b89ba90d60555f3dcbbfdb9
Add migration
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',...
Python
0.000002
646e8cc87b4bb0d032f6f725a0fc2fbc8dfe5a1f
add a command exporting field with their locales to XLS
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...
Python
0
d5e77eba7cb7fe5c3235d1e59612e4c32fbe658f
Add test for Flags
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']...
Python
0
990b452e8c142d6ada840026e80cbc15ebff895c
add csv test runner
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...
Python
0.000001
737991c8e7d72b92ee0d746b3f62e062faa017fc
Include apipkg module
python/skytools/apipkg.py
python/skytools/apipkg.py
""" apipkg: control the exported namespace of a python package. see http://pypi.python.org/pypi/apipkg (c) holger krekel, 2009 - MIT license """ import os import sys from types import ModuleType __version__ = '1.2.dev6' def initpkg(pkgname, exportdefs, attr=dict()): """ initialize given package from the export ...
Python
0
033809cbc96e380bdd657fd4f10d1ca60b0aa9af
Create Graphingcalc.py
Graphingcalc.py
Graphingcalc.py
Python
0
2f0db6df4dd835903bf5f5a0e0da31f30c3bc56f
Add manage.py fixschools command
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...
Python
0.000001
b0d50f52f45d8f1c7de261c7fe8d15e621d0e641
Add a script to "untie" tied model weights.
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...
Python
0
cb403c3934f2401b6b337a19c8f5fd2c1f77805d
Solve 31.
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...
Python
0.999942
e3068793107e6c004a11a9e70ea5dc3867f4ee9d
Add helper class for OAI imports
demetsiiify/oai.py
demetsiiify/oai.py
import logging from datetime import datetime from urllib.parse import urlencode import lxml.etree as ET import requests NS = {'oai': 'http://www.openarchives.org/OAI/2.0/', 'mets': 'http://www.loc.gov/METS/'} class OaiException(Exception): pass class OaiRepository: def __init__(self, endpoint): ...
Python
0
1774794c448d13a20891454a79f664406b364e4c
add cdr_serieshelper
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...
Python
0.000002
eb9fde03dd7b650c59db7a64389bdf1231844407
use get_by_name to benefit from caching
corehq/apps/users/middleware.py
corehq/apps/users/middleware.py
from redis_cache.exceptions import ConnectionInterrumped from django.conf import settings import django.core.exceptions from dimagi.utils.couch.cache import cache_core rcache = cache_core.get_redis_default_cache() #######################################################################################################...
from redis_cache.exceptions import ConnectionInterrumped from django.conf import settings import django.core.exceptions from dimagi.utils.couch.cache import cache_core rcache = cache_core.get_redis_default_cache() #######################################################################################################...
Python
0
fdf3df4154411652b340a38e901c52d678dbd92e
Replace get_user_profile_by_email with get_user.
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...
Python
0
7e4803db10f0cd2ccb6d54117bc68dd999023908
Create __init__.py
run_tests/__init__.py
run_tests/__init__.py
Python
0.000429
339fdd927f9da0f7e15726d087c9916301aef935
Add soft margin SVM and added kernels and class
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...
Python
0
b89a98f0a5b6d4af94b5c52ff4baf4e7c10f2b53
Create PrintExpScalingFactors.py
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)))
Python
0
171283cc2dee67eed8469fac08f531268a21c780
add influxdb_user salt state to manage influxdb users
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...
Python
0
8601790648a17dd1794be4f88d61e4af01349a80
Test for the chipseq pipeline code
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...
Python
0
8cb665e107cb33b5ff3825e5ffb3bde919d36cff
Add cache runner as per #2897
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') ...
Python
0
93bb4703205166d49ced19c621bf120298018ddc
Fix yaml-hl to use the new API.
examples/yaml-hl/yaml_hl.py
examples/yaml-hl/yaml_hl.py
#!/usr/bin/python import yaml, codecs, sys, optparse #yaml.add_resolver(u'!Config', []) #yaml.add_resolver(u'!TokensConfig', [u'tokens']) #yaml.add_resolver(u'!EventsConfig', [u'events']) #yaml.add_resolver(u'!StartEndConfig', [u'tokens', None]) #yaml.add_resolver(u'!StartEndConfig', [u'events', None]) class YAMLHig...
#!/usr/bin/python import yaml, codecs, sys, optparse yaml.add_resolver(u'!Config', []) yaml.add_resolver(u'!TokensConfig', [u'tokens']) yaml.add_resolver(u'!EventsConfig', [u'events']) yaml.add_resolver(u'!StartEndConfig', [u'tokens', None]) yaml.add_resolver(u'!StartEndConfig', [u'events', None]) class YAMLHighli...
Python
0
78ab60f9a0d7251effc238b98dc110706876da8e
add migration for new queue_empty field
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...
Python
0
1519f6be1d888f107a3b747e17cb1bd9d89c976f
Add SciPy benchmark
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. ...
Python
0
f93e29f52a59d5f545faf8fd94e950f50383c7fc
Integrate LLVM at llvm/llvm-project@9c8f950a0400
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( ...
Python
0.000002
f902202b5e7f2473a7ce22505a4cc8b4f39377e0
Add scantailor package (#12833)
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...
Python
0
4155d6ca5db149d8b213cc4078580fc2e85d7f4d
Migrate database for model changes.
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', ...
Python
0
983877d050dea6c962037815ee5a2b36725ad26f
Add problem66.py
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...
Python
0.000057
253acd0afd532e8fa431ab140856fe0c4ba41684
make the plugins directory a package, so that plugins can depend on each other.
plugins/__init__.py
plugins/__init__.py
# keep this to be able to access plugins from other plugins
Python
0
7ab37e931a836faa78a78f5d8358d845f72cdf49
Add low level Gemini serial command script
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...
Python
0.000003
f65789fb705b43b446d1fc4b899074a66685a420
add missed file
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...
Python
0.000001