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 |
|---|---|---|---|---|---|---|---|---|
68ee23dd0f145e82ce0f3c0c66109ee435eadc25 | Add programs button element | NejcZupec/ggrc-core,VinnieJohns/ggrc-core,jmakov/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,edofic/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,kr41/ggrc-core,jmakov/ggrc-core,jmakov/ggrc-core,NejcZupec/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,selahssea/ggrc-co... | src/lib/constants/element/page_header/lhn_menu/button_programs.py | src/lib/constants/element/page_header/lhn_menu/button_programs.py | SELECTOR = '[data-model-name="Program"]'
| apache-2.0 | Python | |
23f626ddaabfa799da48ee35c29db05f95f8a732 | Add import script for Rhondda Cynon Taff | andylolz/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,andylolz/UK-Polling-Stations,chris48s/UK-Polling-Stations,andylolz/UK-Polling-Stations,chris48s/UK-Polling-Stations | polling_stations/apps/data_collection/management/commands/import_rct.py | polling_stations/apps/data_collection/management/commands/import_rct.py | """
Import Rhondda Cynon Taf
note: this script takes quite a long time to run
"""
from time import sleep
from django.contrib.gis.geos import Point
from data_collection.management.commands import BaseAddressCsvImporter
from data_finder.helpers import geocode
from data_collection.google_geocoding_api_wrapper import (
... | bsd-3-clause | Python | |
f257f788287080dfef42aeb18de62531a9c7d3df | add a Twisted executor, using twisted.web.client.Agent | ducksboard/libsaas,livingbio/libsaas,80vs90/libsaas,CptLemming/libsaas | libsaas/executors/twisted_executor.py | libsaas/executors/twisted_executor.py | try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import logging
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from twisted.internet import defer, protocol, reactor
from twisted.web import client, http, http_headers
from twi... | mit | Python | |
93fb79bfc3242f991c03f59f0f6991a09e9421d9 | Create insert.py | joshavenue/python_notebook | insert.py | insert.py | x = [1,2,3]
x.insert(1, 1) // Insert 1 into the list 1 //
x = [1,1,2,3]
| unlicense | Python | |
f6c11bf0d3b8960561ce0f2433193543c1f63609 | Add Assignment_1 | KaiYan0729/nyu_python,KaiYan0729/nyu_python,KaiYan0729/nyu_python | programming_with_python/assignment_1/refactored_random_walk.py | programming_with_python/assignment_1/refactored_random_walk.py | #!/usr/bin/env python3
import random
import sys
import math
def get_random_direction():
direction = ""
probability = random.random()
if probability < 0.25:
direction = "west"
displacements = (-1, 0)
elif probability >= 0.25 and probability < 0.5:
direction = "east"
displacements = (1, 0)
elif probabilit... | mit | Python | |
db7534a83986e404d7f8ed02d42dfa76918d5126 | Create regExpTest.py | stephaneAG/Python_tests,stephaneAG/Python_tests,stephaneAG/Python_tests,stephaneAG/Python_tests | regExpTest.py | regExpTest.py | #!/usr/bin/python
#import the necessary modules
import re # the regexp module
# define the necessary fcns
def lookForCmd( theCommand ):
for commandIndex, commandAgainst in enumerate( commandsToMatchList ): # works > but the above is used to fetch the index AND the item (..)
#for commandAgainst in commandsToMatchL... | mit | Python | |
6a47701ea874e657475542809ac0f9320063cb9b | Add script to help create release zip | james91b/ida_ipython,james91b/ida_ipython,tmr232/ida_ipython,james91b/ida_ipython | releasezip.py | releasezip.py | import os
import sys
import zipfile
def zipdir(path, ziph):
# ziph is zipfile handle
for root, dirs, files in os.walk(path):
for file in files:
ziph.write(os.path.join(root, file))
def main(version) :
release = zipfile.ZipFile('release-{}.zip'.format(version), 'w')
zipd... | mit | Python | |
ce5187d060978021f71f4045642665448ace72f7 | Add plotly based grapher tool as Jupyter notebook cell | CiscoSystems/os-sqe,CiscoSystems/os-sqe,CiscoSystems/os-sqe | jupyter/plot.py | jupyter/plot.py | # to be executed as Jupyter notebook
get_ipython().system('pip install plotly --upgrade')
from plotly import __version__
from plotly.offline import download_plotlyjs, init_notebook_mode, iplot
import json
import plotly.graph_objs as go
print(__version__) # requires version >= 1.9.0
init_notebook_mode() # run at t... | apache-2.0 | Python | |
d1166b9e28920a7303802cb80ff06bcb7c1d074f | Add BEST model to examples. | evidation-health/pymc3,Anjum48/pymc3,tyarkoni/pymc3,evidation-health/pymc3,clk8908/pymc3,wanderer2/pymc3,jameshensman/pymc3,MichielCottaar/pymc3,superbobry/pymc3,CVML/pymc3,jameshensman/pymc3,CVML/pymc3,JesseLivezey/pymc3,Anjum48/pymc3,hothHowler/pymc3,hothHowler/pymc3,MCGallaspy/pymc3,MichielCottaar/pymc3,dhiapet/PyMC... | pymc3/examples/best.py | pymc3/examples/best.py | """
Bayesian Estimation Supersedes the T-Test
This model replicates the example used in:
Kruschke, John. (2012) Bayesian estimation supersedes the t test. Journal of Experimental Psychology: General.
The original pymc2 implementation was written by Andrew Straw and can be found here: https://github.com/strawlab/best
... | apache-2.0 | Python | |
85eaf2b86aefc7697af78f457888652f8a2bbd3d | Add tx.origin check | b-mueller/mythril,b-mueller/mythril,b-mueller/mythril,b-mueller/mythril | mythril/analysis/modules/tx_origin.py | mythril/analysis/modules/tx_origin.py | from z3 import *
from mythril.analysis.report import Issue
import re
'''
MODULE DESCRIPTION:
Check for constraints on tx.origin (i.e., access to some functionality is restricted to a specific origin).
'''
def execute(statespace):
issues = []
for k in statespace.nodes:
node = statespace.nodes[k]
... | mit | Python | |
0995c204e5e05b0a1ee5f8c00dbae58f1f114386 | Add integrations credentials manager | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/integrations/credentials/manager.py | dbaas/integrations/credentials/manager.py | import models
import logging
LOG = logging.getLogger(__name__)
class IntegrationCredentialManager(object):
@classmethod
def get_credentials(cls, environment, integration):
return models.IntegrationCredential.objects.filter(environments=environment, integration_type=integration)[0] | bsd-3-clause | Python | |
2dfc4fcc61c0f9d00860168d44da5e03db8e61eb | Add a class to get a random photo of a folder | MarkusAmshove/Photobox | photobox/cheesefolder.py | photobox/cheesefolder.py | import random
class Cheesefolder():
def __init__(self, folder):
self.directory = folder
pass
def getrandomphoto(self):
files = self.directory.getfiles_fullpath()
filecount = len(files)
randomindex = random.randint(0, filecount - 1)
return files[randomindex]
| mit | Python | |
5ed3e15f200fbec3a5e2aa284e044206a71d5ed4 | Create frus_pdf_urls.py | thomasgpadilla/webscraping | frus_pdf_urls.py | frus_pdf_urls.py | from urllib.request import urlopen
from bs4 import BeautifulSoup
import requests
html = urlopen("http://digicoll.library.wisc.edu/cgi-bin/FRUS/FRUS-idx?type=header&id=FRUS.FRUS1932v05")
soup = BeautifulSoup(html, 'html.parser')
with open("fdr_pdf_urls.txt", "w") as file:
for itemlinks in soup.find_all("p", {"class"... | cc0-1.0 | Python | |
50b3396ef0df860531fe05778767cfd8a5be32c3 | Solve for ini5 | DanZBishop/Rosalind | ini5/ini5.py | ini5/ini5.py | #!/usr/bin/python
import argparse
parser = argparse.ArgumentParser(description="Outputs even numbered lines from input file")
parser.add_argument("--input", "-i", required=True, help="Input file name")
parser.add_argument("-o", "--output", required=True, help="Output file name")
args = parser.parse_args()
inFile = ... | apache-2.0 | Python | |
2180ff5c7576100300898099a2316c66a8e56eb6 | add parser for inline lang ignore comments | myint/rstcheck,myint/rstcheck | src/rstcheck/inline_config.py | src/rstcheck/inline_config.py | """Inline config comment functionality."""
import re
import typing
RSTCHECK_COMMENT_REGEX = re.compile(r"\.\. rstcheck:")
class RstcheckCommentSyntaxError(Exception):
"""Syntax error for rstcheck inline config comments."""
def __init__(self, message: str, line_number: int) -> None:
"""Initialize th... | mit | Python | |
fb9bbe0a57e1dc083d25d28c7f7fc0b4633c96e0 | add Wikipedia plugin | spaceone/tehbot,tehron/tehbot | plugins/wiki/__init__.py | plugins/wiki/__init__.py | import plugins
import urllib
import urllib2
import json
import lxml.html
url = "https://en.wikipedia.org/w/api.php?%s"
def get_text(tree, xpath):
return "\n".join(e.text_content() for e in tree.xpath(xpath))
def wiki(connection, channel, nick, cmd, args):
"""Looks up a search term on Wikipedia"""
if not... | mit | Python | |
6b3ab0cf35f20168d072d1df30dd8c4360385209 | disable paths | wathsalav/xos,zdw/xos,open-cloud/xos,zdw/xos,cboling/xos,xmaruto/mcord,xmaruto/mcord,open-cloud/xos,jermowery/xos,wathsalav/xos,xmaruto/mcord,wathsalav/xos,zdw/xos,cboling/xos,cboling/xos,opencord/xos,opencord/xos,zdw/xos,open-cloud/xos,xmaruto/mcord,jermowery/xos,cboling/xos,jermowery/xos,jermowery/xos,wathsalav/xos,c... | plstackapi/planetstack/views/api_root.py | plstackapi/planetstack/views/api_root.py | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
@api_view(['GET'])
def api_root(request, format=None):
return Response({
'roles': reverse('role-list', request=request, format=format),
#'nodes': reverse('node-list... | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
@api_view(['GET'])
def api_root(request, format=None):
return Response({
'nodes': reverse('node-list', request=request, format=format),
'sites': reverse('site-list'... | apache-2.0 | Python |
0bef4682c6a81464fd6e72fddd6f0b5957f4d566 | Add a script to calculate paried roi bbox emean and std. | myfavouritekk/TPN | tools/data/calculate_paired_bbox_mean_std.py | tools/data/calculate_paired_bbox_mean_std.py | #!/usr/bin/env python
import argparse
import scipy.io as sio
import sys
import os.path as osp
import numpy as np
import cPickle
this_dir = osp.dirname(__file__)
sys.path.insert(0, osp.join(this_dir, '../../external/py-faster-rcnn/lib'))
from fast_rcnn.bbox_transform import bbox_transform
if __name__ == '__main__':
... | mit | Python | |
c6951374eba137614744928c18fa4d34de5c5d89 | Add a script to generate data sets for testing sorting algorithms. | vikash-india/ProgrammingProblems,vikash-india/ProgrammingProblems | src/algorithms/sorting/dataset_generator.py | src/algorithms/sorting/dataset_generator.py | # Description: Script to Generate Data Sets For Sorting Algorithms
import random
import logging
# Global Configuration
TOTAL_ROWS = 10
SORTED = False # Overrides REVERSE_SORTED and RANDOM_NUMBERS
REVERSE_SORTED = False # Overrides RANDOM_NUMBERS
RANDOM_NUMBERS = True # Least Precedence
WRITE_TO_FILE... | mit | Python | |
45917087377adef01a4d4ce829013a7958a3afe5 | Add PC / DWPC test | dhimmel/hetio | test/pathtools_test.py | test/pathtools_test.py | import os
import pytest
import hetio.readwrite
from hetio.pathtools import paths_between, DWPC
directory = os.path.dirname(os.path.abspath(__file__))
def test_disease_gene_example_dwpc():
"""
Test the DWPC computation from
https://doi.org/10.1371/journal.pcbi.1004259.g002
"""
path = os.path.joi... | cc0-1.0 | Python | |
5e8e48895778d8a55b010320dec6befbdaf85af0 | add tests for types.enums | NoMoKeTo/choo,NoMoKeTo/transit | src/tests/types/test_enums.py | src/tests/types/test_enums.py | import pytest
from choo.types import LineType, LineTypes, PlatformType, POIType, WalkSpeed, WayEvent, WayType
class TestEnums:
def test_serialize(self):
assert WayType.walk.serialize() == 'walk'
def test_unserialize(self):
assert WayType.unserialize('walk') is WayType.walk
with pytes... | apache-2.0 | Python | |
ab8fefb20256a9d800804a0465a4cac7d47019dd | add test_alignment script | cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware | test/test_alignment.py | test/test_alignment.py | #!/usr/bin/env python3
import time
from litex.soc.tools.remote import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver
wb = RemoteClient()
wb.open()
# # #
DVISAMPLER_DELAY_RST = 0x1
DVISAMPLER_DELAY_INC = 0x2
DVISAMPLER_DELAY_DEC = 0x4
DVISAMPLER_TOO_LATE = 0x1
DVISAMPLER_TOO_EA... | bsd-2-clause | Python | |
a3305a53d1007ee48b4dadd37c11efb2d78da7f9 | Add unittests for utils.ichunked() | eht16/python-logstash-async | tests/ichunked_test.py | tests/ichunked_test.py | # -*- coding: utf-8 -*-
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
from random import randint
import unittest
from logstash_async.utils import ichunked
CHUNK_SIZE_SMALL = 1
CHUNK_SIZE_NORMAL = 100
CHUNK_SIZE_BIG = 750
CHUNK_ITERATIONS = ... | mit | Python | |
5d67f1873994990b3c63820ec85476d9ed7c7303 | Add from_frames | pynayzr/pynayzr | scripts/from_frames.py | scripts/from_frames.py | #!/usr/bin/python
import argparse
import glob
import os
import pathlib
import statistics
import pynayzr
import imgcompare
from PIL import Image, ImageDraw
# Based on 240p
REFERENCE_BOX = {
'tvbs': (50, 50, 150, 63),
'ftv': (80, 43, 89, 63),
}
def get_time(t):
return f'{t // 60:02d}:{t % 60:02d}'
def ... | mit | Python | |
35676a61b6fef366d30733dd32211adde9572209 | Add runmailer management command | pinax/django-mailer,pinax/django-mailer | src/mailer/management/commands/runmailer.py | src/mailer/management/commands/runmailer.py | import sys
from datetime import datetime
from django.core.management import BaseCommand
from mailer.engine import send_loop
class Command(BaseCommand):
"""Start the django-mailer send loop"""
def handle(self, *args, **options):
self.stdout.write(datetime.now().strftime('%B %d, %Y - %X'))
se... | mit | Python | |
824f99b5d0a0c5d4b3076d0a5a8991e9fe93ceb1 | Initialize time table data. | malaonline/Android,malaonline/iOS,malaonline/Server,malaonline/Server,malaonline/Android,malaonline/iOS,malaonline/Server,malaonline/Android,malaonline/iOS,malaonline/Server | server/app/migrations/0008_timetable.py | server/app/migrations/0008_timetable.py | import os
from datetime import time
from django.db import migrations
def add_timetable(apps, schema_editor):
TimeTable = apps.get_model('app', 'TimeTable')
for weekday in range(1, 8):
for start in (8, 10, 13, 15, 17, 19):
end = start + 2
time_table = TimeTable(weekday=weekday,... | mit | Python | |
676164caf2e498bef0294a7fe2ad0daf94da33bf | Put import statements into __init__ | abigailStev/stingray,pabell/stingray,evandromr/stingray,StingraySoftware/stingray | stingray/modeling/__init__.py | stingray/modeling/__init__.py | # Licensed under MIT license - see LICENSE.rst
"""
Library of Time Series Methods For Astronomical X-ray Data.
"""
# Affiliated packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from .._astropy_in... | mit | Python | |
0875ddf7966ed0ca4ac336ac4f52c282c8ceb021 | create lookup function to assist with player specific queries | jldbc/pybaseball | pybaseball/playerid_lookup.py | pybaseball/playerid_lookup.py | import pandas as pd
import requests
import io
# dropped key_uuid. looks like a has we wouldn't need for anything.
# TODO: allow for typos. String similarity?
# TODO: allow user to submit list of multiple names
def get_lookup_table():
print('Gathering player lookup table. This may take a moment.')
url = "https://r... | mit | Python | |
a42f97104d2332f367041592b9ac05291c3b0240 | Add scorekeeper plugin | jk0/pyhole,jk0/pyhole,jk0/pyhole | pyhole/plugins/scorekeeper.py | pyhole/plugins/scorekeeper.py | # Copyright 2015 Rick Harris
#
# 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 ... | apache-2.0 | Python | |
73a9fb37479f3b4009f8f69f1c83c739479bee6f | Add index route (git hash) | cgwire/zou | zou/app/resources/index.py | zou/app/resources/index.py | from flask_restful import Resource
from zou.app.utils import git
class IndexResource(Resource):
def get(self):
git_hash = git.get_git_revision_hash()
return {
'api': 'Unit Image Pipeline Server',
'git_hash': git_hash.decode("utf-8")
}
| agpl-3.0 | Python | |
81d7588a3a79c5962d99dea6764a2c1675ce9665 | test token method | CartoDB/cartodb-python,CartoDB/carto-python | tests/test_do_token.py | tests/test_do_token.py | import os
import pytest
from carto.do_token import DoTokenManager
@pytest.fixture(scope="module")
def do_token_manager(api_key_auth_client):
"""
Returns a do token manager that can be reused in tests
:param api_key_auth_client: Fixture that provides a valid
APIKeyAuthClien... | bsd-3-clause | Python | |
1523066235f47450dd88d334061ec31d0c78551a | add migration to update field choices and migrate data | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/legalaid/migrations/0013_auto_20160414_1429.py | cla_backend/apps/legalaid/migrations/0013_auto_20160414_1429.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def update_eod_categories(apps, schema_editor):
EODDetailsCategory = apps.get_model("legalaid", "EODDetailsCategory")
for eod in EODDetailsCategory.objects.filter(category='scope_or_means'):
eod.c... | mit | Python | |
8091fc062541a0fb97ae556ea52927303b5bc73d | Add debug mode support to dokx-build-search index | deepmind/torch-dokx,Gueust/torch-dokx,deepmind/torch-dokx,yozw/torch-dokx,yozw/torch-dokx,deepmind/torch-dokx,Gueust/torch-dokx,yozw/torch-dokx,Gueust/torch-dokx | dokx-search/dokx-build-search-index.py | dokx-search/dokx-build-search-index.py | """
Create and populate a minimal PostgreSQL schema for full text search
"""
import sqlite3
import glob
import os
import re
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--output", type=str, help="Path to write SQLite3 search index")
parser.add_argument("--debug", type=bool, help="Debug mod... | """
Create and populate a minimal PostgreSQL schema for full text search
"""
import sqlite3
import glob
import os
import re
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--output", type=str, help="Path to write SQLite3 search index")
parser.add_argument('input', type=str, help="Path to inpu... | bsd-3-clause | Python |
a2dfa00b8a3b5ef9b969b0848ff3c933365a2eed | add transitional submodule | oesteban/mriqc,poldracklab/mriqc,oesteban/mriqc,poldracklab/mriqc,poldracklab/mriqc,poldracklab/mriqc,oesteban/mriqc,oesteban/mriqc | mriqc/interfaces/transitional.py | mriqc/interfaces/transitional.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function, division, absolute_import, unicode_literals
from nipype.interfaces.base import File, traits, CommandLine, TraitedSpec, ... | apache-2.0 | Python | |
242f7d6ea3d733b08f60ad1f43fc490984989d30 | add import script for Swale | DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations | polling_stations/apps/data_collection/management/commands/import_swale.py | polling_stations/apps/data_collection/management/commands/import_swale.py | from data_collection.management.commands import BaseShpStationsShpDistrictsImporter
class Command(BaseShpStationsShpDistrictsImporter):
srid = 27700
council_id = 'E07000113'
districts_name = 'shp/Swale Polling Districts'
stations_name = 'shp/Swale Polling Stations.shp'
elections = ['local.kent.2017... | bsd-3-clause | Python | |
eceaf20ec82eebec70d1314f74c54eea8f51158c | Add TestShell class | DigitalPandacoin/pandacoin,DigitalPandacoin/pandacoin,peercoin/peercoin,peercoin/peercoin,DigitalPandacoin/pandacoin,peercoin/peercoin,peercoin/peercoin,DigitalPandacoin/pandacoin,peercoin/peercoin,DigitalPandacoin/pandacoin,peercoin/peercoin,DigitalPandacoin/pandacoin | test/functional/test_framework/test_shell.py | test/functional/test_framework/test_shell.py | #!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
class TestShell:
"""Wrapper Class for Bitc... | mit | Python | |
3a2349cf86ed4562a911f3609f9b8c039d228989 | test for phones and address done | holi87/PythonSzkolenie | test/test_addresses.py | test/test_addresses.py | from model.contact import Contact
from random import randrange
__author__ = "Grzegorz Holak"
def test_phones_on_home_page(app):
# when there is no contact - make one for test
if app.contact.count() == 0:
app.contact.create(Contact(first_name="jakies losowe", last_name="nazwisko siakie", address="""ad... | apache-2.0 | Python | |
a8bded67a92632fd6d2d8791dd245dc82c773c8d | Add an integration folder for tests that are beyond the unittest scope | markrwilliams/tectonic | integration/basic_server.py | integration/basic_server.py | """
This is a basic test which allows you to setup a server and listen to it.
For example, running:
python integration/basic_server.py localhost 8040
Sets up a server.
Running curl against it generates the following reponse:
curl 'http://localhost:8040/'
<html><body><h1>ok</h1><br/>from 28330
And in server output... | bsd-3-clause | Python | |
c34eb62d19c4216aa54199a083a06c2c45318cea | Add missing migration for IMEI db validation. | akatsoulas/feedthefox,akatsoulas/feedthefox,mozilla/feedthefox,mozilla/feedthefox,akatsoulas/feedthefox,mozilla/feedthefox,akatsoulas/feedthefox,mozilla/feedthefox | feedthefox/devices/migrations/0006_auto_20151110_1355.py | feedthefox/devices/migrations/0006_auto_20151110_1355.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import feedthefox.devices.models
class Migration(migrations.Migration):
dependencies = [
('devices', '0005_auto_20151105_1048'),
]
operations = [
migrations.AlterField(
m... | mpl-2.0 | Python | |
3d30708839236e65e7e83ce2baf8dd0364451fb5 | add test_lastgenre.py | shanemikel/beets,madmouser1/beets,Wen777/beets,ruippeixotog/beets,kareemallen/beets,shanemikel/beets,drm00/beets,Freso/beets,Dishwishy/beets,LordSputnik/beets,PierreRust/beets,lengtche/beets,drm00/beets,imsparsh/beets,arabenjamin/beets,jcoady9/beets,randybias/beets,asteven/beets,YetAnotherNerd/beets,sampsyo/beets,arabe... | test/test_lastgenre.py | test/test_lastgenre.py | # This file is part of beets.
# Copyright 2014, Fabrice Laporte.
#
# 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,... | mit | Python | |
5f01a1e6c8fe7230eaf9f72f27911537cda28647 | add tender document views for stage2 UA, EU | gorserg/openprocurement.tender.competitivedialogue,openprocurement/openprocurement.tender.competitivedialogue | openprocurement/tender/competitivedialogue/views/stage2/tender_document.py | openprocurement/tender/competitivedialogue/views/stage2/tender_document.py | # -*- coding: utf-8 -*-
from openprocurement.api.utils import opresource
from openprocurement.tender.openeu.views.tender_document import TenderEUDocumentResource
from openprocurement.tender.openua.views.tender_document import TenderUaDocumentResource
from openprocurement.tender.competitivedialogue.models import STAGE_2... | apache-2.0 | Python | |
93b16422d29243280c8553236afaf77516f3466f | test parseLayoutFeatures function | moyogo/ufo2ft,jamesgk/ufo2ft,jamesgk/ufo2fdk,googlei18n/ufo2ft,googlefonts/ufo2ft | tests/featureCompiler_test.py | tests/featureCompiler_test.py | from __future__ import (
print_function,
division,
absolute_import,
unicode_literals,
)
from textwrap import dedent
import logging
from fontTools.feaLib.error import IncludedFeaNotFound
from ufo2ft.featureCompiler import (
FeatureCompiler,
MtiFeatureCompiler,
parseLayoutFeatures,
)
import py... | mit | Python | |
b3b7e2fcbff5cd0ec2d2b4457b7a46d1846d55a8 | Implement a generic Vispy widget | PennyQ/glue-3d-viewer,PennyQ/astro-vispy,glue-viz/glue-vispy-viewers,glue-viz/glue-3d-viewer,astrofrog/glue-vispy-viewers,astrofrog/glue-3d-viewer | glue_vispy_viewers/common/vispy_viewer.py | glue_vispy_viewers/common/vispy_viewer.py | from __future__ import absolute_import, division, print_function
import sys
from vispy import scene
from glue.external.qt import QtGui, get_qapp
class VispyWidget(QtGui.QWidget):
def __init__(self, parent=None):
super(VispyWidget, self).__init__(parent=parent)
# Prepare Vispy canvas
s... | bsd-2-clause | Python | |
5883232eed25cf96ca275af6904d284201306c0a | Add an __init__.py that exposes all the modules from the package. | nanaze/jsdoctor,Prachigarg1/Prachi,nanaze/jsdoctor,nanaze/jsdoctor,Prachigarg1/Prachi,Prachigarg1/Prachi | __init__.py | __init__.py | # Expose the modules of the package.
import flags
import generator
import jsdoc
import linkify
import namespace
import scanner
import source
import symboltypes
| apache-2.0 | Python | |
10e4c82f0d3440ffd4737589870b85c61a83d1b8 | add init for import | yupbank/no_csrf | __init__.py | __init__.py | from no_csrf import nicer_get
| mit | Python | |
5beae4a29f973ab3980f00cf180c0d571e84a79e | Create __init__.py | Knowlege/tiledtmxloader | __init__.py | __init__.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
TileMap loader for python for Tiled, a generic tile map editor
from http://mapeditor.org/ .
It loads the \*.tmx files produced by Tiled.
"""
__all__ = ["tmxreader"]
from . import tmxreader
try:
from . import helperspygame
__all__.append("helperspygame")
except:
... | bsd-3-clause | Python | |
1c12cd1811afb21e44a295d42be24169d042bfcb | Create __init__.py | kelceydamage/sherpa,kelceydamage/sherpa | __init__.py | __init__.py | apache-2.0 | Python | ||
5e370df87e4846e6673d4566cef0291a43cde883 | Create __init__.py | jasongwartz/PyEmailWatcher | __init__.py | __init__.py | mit | Python | ||
3c9a6b871011dfed53c8c5c820aee62c90d04344 | add new parser class to computer's cortex | IanDCarroll/xox | OnStage/parser_abilities.py | OnStage/parser_abilities.py | class Parser(object):
def get_empty_square(self, options, code):
row_1 = [0, [0,1,2]]
row_2 = [1, [3,4,5]]
row_3 = [2, [6,7,8]]
col_1 = [3, [0,3,6]]
col_2 = [4, [1,4,7]]
col_3 = [5, [2,5,8]]
diag1 = [6, [0,4,8]]
diag2 = [7, [2,4,6]]
if code == row_1[0]... | mit | Python | |
d025d862a357eb99490133cc25f27e52a6573015 | add image module | anqxyr/jarvis | jarvis/images.py | jarvis/images.py | #!/usr/bin/env python3
"""Commands for the Image Team."""
###############################################################################
# Module Imports
###############################################################################
import collections
import pyscp
import re
from . import core, parser, lexicon
###... | mit | Python | |
e7879fa6a123013501e6cddabc073d17d643e42b | Create EPICLocSearch_size.py | RetelC/PDra_Phylogeography,RetelC/PDra_Phylogeography | EPICLocSearch_size.py | EPICLocSearch_size.py | " " " this file was created in november 2014
as part of a de novo search for EPIC loci in
the chaetognath species Pterosagitta draco
property of dr. Ferdinand Marlétaz
" " "
#!/usr/bin/env python
import sys
from collections import defaultdict
flanks=defaultdict(list)
for line in open(sys.argv[1]):
bline=line.rstr... | mit | Python | |
8994f69f23271aa93d83e81032542f17b38423fd | Add custom IPython configuration ✨ | reillysiemens/dotfiles,reillysiemens/dotfiles | .ipython/profile_default/ipython_config.py | .ipython/profile_default/ipython_config.py | """
IPython configuration with custom prompt using gruvbox colors.
- https://github.com/reillysiemens/ipython-style-gruvbox
Thanks to @petobens for their excellent dotfiles.
- https://github.com/petobens/dotfiles
"""
from typing import List, Optional, Tuple
import IPython.terminal.prompts as prompts
from prompt_toolk... | isc | Python | |
12428f3aebc8ef54b8308f676b3d7b7d7e3077e7 | add ingestion of tar files form SNEX | svalenti/lcogtsnpipe | trunk/bin/ingesttar.py | trunk/bin/ingesttar.py | #/usr/bin/env python
import lsc
import sys
import os
import re
import string
import tarfile
from optparse import OptionParser
_dir = os.environ['LCOSNDIR']
def ingesttar(_tarfile,force=False):
_targetid = re.sub('.tar.gz','',string.split(_tarfile,'_')[-1])
my_tar = tarfile.open(_tarfile)
imglist = my_tar.... | mit | Python | |
c42f891b8d11efba950876b9c4eb7a77cc08c743 | move to correct directory | r3dact3d/tweeter | tweepy/urbanTwitBot.py | tweepy/urbanTwitBot.py | #!/usr/bin/env python
from bs4 import BeautifulSoup
import requests
import tweepy
from config import *
url = 'http://www.urbandictionary.com/'
page = requests.get(url)
soup = BeautifulSoup(page.text, "lxml")
data = dict()
data['def'] = soup(class_ = 'meaning')[0].text
data['word'] = soup(class_ = 'word')[0].text
word ... | unlicense | Python | |
b3b5337ddcc5984602eab46a085e976028ff2a77 | Add initial implementation of the LayerNormalizationLayer | erfannoury/capgen-lasagne | LayerNormalization.py | LayerNormalization.py | import numpy as np
import theano
import theano.tensor as T
import lasagne
__all__ = [
"LayerNormalizationLayer"
]
class LayerNormalizationLayer(Layer):
"""
LayerNormalizationLayer(incoming, feat_dims,
alpha=lasagne.init.Constant(1.0), beta=lasagne.init.Constant(0.0),
**kwargs)
A Layer Normali... | mit | Python | |
dfeca2aea76f226cfcf3ed06bbcfdcdf7f7d2f44 | Add member event | brantje/captain_hook,brantje/telegram-github-bot,brantje/telegram-github-bot,brantje/captain_hook,brantje/captain_hook,brantje/telegram-github-bot | captain_hook/services/github/events/member.py | captain_hook/services/github/events/member.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from . import GithubEvent
class MemberEvent(GithubEvent):
def process(self, request, body):
sender_link = body['sender']['html_url'].replace('https://github.com/', '')
user_link = body['member']['html_url'].replace('https://github.com... | apache-2.0 | Python | |
f01600491717c46103b27668e5d43e44a7dfa3b8 | Add customer tests | paramono/amocrm | tests/test_customer.py | tests/test_customer.py | import unittest
from unittest import skip
from unittest.mock import patch
from amocrm.exceptions import MissingArgument
from amocrm.entities import Customer
from .base_mocksettings import BaseMockSettingsTest
class TestCustomer(BaseMockSettingsTest):
def test_Customer_todict_returns_dict(self):
amocust... | bsd-3-clause | Python | |
1c7f6a6c44af9c2de372fb2c07469da29bc11764 | Add tests for encoding subsystem | prophile/libdiana | tests/test_encoding.py | tests/test_encoding.py | from diana.encoding import encode, decode
from nose.tools import eq_
DECODE_TESTS = [ ('', (), ()),
('b', (0x00,), (0,)),
('BB', (0x12, 0xfe), (0x12, 0xfe)),
('bb', (0x12, 0xfe), (0x12, -2)),
('s', (0x12, 0x34), (0x3412,)),
('s', (0xf... | mit | Python | |
93a1ff67e62d0508744420cab8263a8cc893b119 | Add example listing backup counts | uroni/urbackup-server-python-web-api-wrapper | test/list_backup_counts.py | test/list_backup_counts.py | import urbackup_api
server = urbackup_api.urbackup_server("http://127.0.0.1:55414/x", "admin", "foo")
clients = server.get_status()
for client in clients:
file_backups = server.get_clientbackups(client["id"])
incr_file = 0
full_file = 0
for file_backup in file_backups:
... | apache-2.0 | Python | |
eafd611428c4206ba15bada0996b362ee74e0d3a | Create app.py | EricSchles/alert_system,EricSchles/alert_system | server/app.py | server/app.py | #server
from flask import Flask, render_template, request
import requests
import pickle
from mapper import Mapper
from multiprocessing import Process
import json
import time
from subprocess import call
app = Flask(__name__)
@app.route("/remove/<website>",methods=["GET","POST"])
def remove(website):
websites = jso... | apache-2.0 | Python | |
16f0ec2d0e5c33126ddb01604213c6a14115e605 | Add basic test of pocket_parser. | salilab/cryptosite,salilab/cryptosite,salilab/cryptosite | test/test_pocket_parser.py | test/test_pocket_parser.py | import unittest
import utils
import os
import sys
import re
import subprocess
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(TOPDIR)
import pocket_parser
class Tests(unittest.TestCase):
def test_get_cnc(self):
"""Test get_cnc() function"""
res = pocket_par... | lgpl-2.1 | Python | |
4f722f576f2e14da5373b0a2da3e6ba5d94e37d9 | add simple dumb script to find XOR keys that are revealed by padding | armijnhemel/binaryanalysis | src/scripts/findxor.py | src/scripts/findxor.py | #!/usr/bin/python
## Binary Analysis Tool
## Copyright 2015 Armijn Hemel for Tjaldur Software Governance Solutions
## Licensed under Apache 2.0, see LICENSE file for details
'''
Find XOR key using some very superdumb methods.
The idea is to exploit the idea that padding is used in firmwares. Usually padding
consists... | apache-2.0 | Python | |
7021806e9e510286424dae696c2f4eee0a70b630 | Define default crispy form helper | nigma/djutil | src/forms.py | src/forms.py | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
import crispy_forms.helper
class DefaultFormHelper(crispy_forms.helper.FormHelper):
def __init__(self, form=None):
super(DefaultFormHelper, self).__init__(form=form)
self.form_class = "form-horizontal"
self.html5_required = T... | mit | Python | |
a7820c3a317c9d6ff2f3585eecd3e05c47364afe | Create A_Okubo_weiss_results.py | Herpinemmanuel/Oceanography | Cas_6/Okubo_Weiss/A_Okubo_weiss_results.py | Cas_6/Okubo_Weiss/A_Okubo_weiss_results.py | # First iteration
![alt tab]()
# Last iteration
![alt tab]()
# Movie
![alt tab]()
| mit | Python | |
49db30bdb872d88c343a2ab480c294d1802b301b | Create trash.py | Programmeerclub-WLG/Agenda-App | gui/trash.py | gui/trash.py | apache-2.0 | Python | ||
a8848ccb72c2513b7c42809d43359023ff158db6 | Add sync file, not using it yet though | phdesign/flickr-rsync | modules/sync.py | modules/sync.py | # -*- coding: utf-8 -*-
import operator
class Sync(object):
def __init__(self):
pass
def run(self, from_storage, to_storage):
self._from_storage = from_storage
self._to_storage = to_storage
self._from_folders = sorted(from_storage.list_folders(), key=lambda x: x.name)
... | mit | Python | |
08ee789d0dc6b4b29e25dc23683d6874c886a69d | Include generate-credentials.py from ga-collector | alphagov/performanceplatform-collector,alphagov/performanceplatform-collector,alphagov/performanceplatform-collector | tools/generate-credentials.py | tools/generate-credentials.py | """
Generate required credentials files from a downloaded client_secret.json.
When setting up a Google API account you are provided with a
client_secret.json. You need to generate refresh and access tokens to use the
API.
For more information see:
http://bit.ly/py-oauth-docs
Call this tool with the path to your down... | mit | Python | |
8919cf7171d7a659c0b90c41f2520029bab1423e | Add tool to extract build process from .travis.yml | advancedtelematic/sota_client_cpp,advancedtelematic/aktualizr,advancedtelematic/aktualizr,advancedtelematic/aktualizr,advancedtelematic/aktualizr,advancedtelematic/sota_client_cpp | scripts/run_travis.py | scripts/run_travis.py | #!/usr/bin/env python3
import argparse
import sys
import pprint
import shlex
import yaml
from pathlib import Path
def gen_test_script(ty, job, output):
output.write('#!/usr/bin/env bash\n\n')
output.write('set -ex\n')
# extract environment variables
e_str = ty['env'][job]
for v_assign in shlex.... | mpl-2.0 | Python | |
015291b5d894d0d7a74725bf0846ad88e5c85522 | Add a setup file | yakovenkodenis/websockets_secure_chat,yakovenkodenis/websockets_secure_chat,yakovenkodenis/websockets_secure_chat,yakovenkodenis/websockets_secure_chat | PythonClient/setup.py | PythonClient/setup.py | from distutils.core import setup
setup(name='PythonClient',
version='1.0',
description='Python Distribution Utilities',
author='Denis Yakovenko',
author_email='yakovenko.denis.a@gmail.com',
url='https://www.github.com/yakovenkodenis/websockets_secure_chat',
packages=['diffie_hellman... | mit | Python | |
d186c80feb7dee875a1a7debfd115e100dc3fca1 | Add a cronjob script for sending studentvoice notifications. | enjaz/enjaz,osamak/student-portal,osamak/student-portal,osamak/student-portal,enjaz/enjaz,enjaz/enjaz,enjaz/enjaz,osamak/student-portal,enjaz/enjaz,osamak/student-portal | send_studentvoices.py | send_studentvoices.py | import os
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "studentportal.settings")
from django.core.urlresolvers import reverse
from django.conf import settings
from post_office import mail
from studentvoice.models import Voice
for voice in Voice.objects.filter(was_sent=False, parent... | agpl-3.0 | Python | |
f43b9e44d30c9ac2800ca7559bdff84d06d64bc5 | Add LDAP code | oscharvard/Flask-CAS | flask_cas/osc_ldap.py | flask_cas/osc_ldap.py | import json
import ldap
import sys
import hashlib
from flask import current_app, session
ldap.set_option(ldap.OPT_DEBUG_LEVEL, 0)
# turn off referrals
ldap.set_option(ldap.OPT_REFERRALS, 0)
# version 3
ldap.set_option (ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3)
# allow self-signed cert
ldap.set_option(ldap.OPT_X_TLS_RE... | bsd-3-clause | Python | |
102f10b680335c970a8322cda35cccd347a76baf | define template for performing mashup | rfaulkner/Flickipedia,rfaulkner/Flickipedia,rfaulkner/Flickipedia,rfaulkner/Flickipedia,rfaulkner/Flickipedia | flickipedia/mashup.py | flickipedia/mashup.py | """
Author: Ryan Faulkner
Date: October 19th, 2014
Container for mashup logic.
"""
def get_article_count():
"""
Fetch total article count
:return: int; total count of articles
"""
pass
def get_max_article_id():
"""
Fetch the maximum article ID
:return: int; maxim... | bsd-2-clause | Python | |
b3161dce27574146ccb2df509a4846b51e67dfb4 | check a request for a still-not-closed MUC channel fails | Ziemin/telepathy-gabble,mlundblad/telepathy-gabble,mlundblad/telepathy-gabble,jku/telepathy-gabble,jku/telepathy-gabble,mlundblad/telepathy-gabble,Ziemin/telepathy-gabble,jku/telepathy-gabble,Ziemin/telepathy-gabble,Ziemin/telepathy-gabble | tests/twisted/muc/presence-before-closing.py | tests/twisted/muc/presence-before-closing.py | """
Test for fd.o#19930.
"""
import dbus
from twisted.words.xish import domish
from gabbletest import exec_test, make_result_iq
from servicetest import (EventPattern, assertEquals, assertLength,
assertContains, sync_dbus, call_async)
import constants as cs
import ns
from mucutil import join_muc, echo_muc_pr... | """
Test for fd.o#19930.
"""
import dbus
from twisted.words.xish import domish
from gabbletest import exec_test, make_result_iq
from servicetest import (EventPattern, assertEquals, assertLength,
assertContains, sync_dbus, call_async)
import constants as cs
import ns
from mucutil import join_muc, echo_muc_pr... | lgpl-2.1 | Python |
d30e019459d1ef026b95739716d2d3a7d791575e | Add bytearray basic tests. | methoxid/micropystat,blmorris/micropython,blazewicz/micropython,rubencabrera/micropython,jlillest/micropython,toolmacher/micropython,ahotam/micropython,emfcamp/micropython,methoxid/micropystat,mpalomer/micropython,vitiral/micropython,orionrobots/micropython,firstval/micropython,kerneltask/micropython,alex-march/micropy... | tests/basics/bytearray1.py | tests/basics/bytearray1.py | a = bytearray([1, 2, 200])
print(a[0], a[2])
print(a[-1])
a[2] = 255
print(a[-1])
a.append(10)
print(len(a))
s = 0
for i in a:
s += i
print(s)
| mit | Python | |
d8df1ca5d4c0c346496e2a190be8a63a7249e578 | Add sort code. | doggan/code-dump,doggan/code-dump,doggan/code-dump,doggan/code-dump,doggan/code-dump,doggan/code-dump,doggan/code-dump,doggan/code-dump | sort/sort.py | sort/sort.py | #!/path/to/python
def merge_sort(items):
if items is None:
return
helper = []
merge_sort_impl(items, helper, 0, len(items))
def merge_sort_impl(items, helper, start, end):
if (end - start) <= 1:
return
mid = (end - start) / 2 + start
merge_sort_impl(items, helper, start, mid)
... | unlicense | Python | |
a9f1ccaeae554ccc3515e1fc28e1bc4b3822b856 | Add base code for all examples | mohan3d/PyOpenload | examples/base.py | examples/base.py | from __future__ import print_function
from openload import OpenLoad
username = 'FTP Username/API Login'
key = 'FTP Password/API Key'
ol = OpenLoad(username, key)
| mit | Python | |
c5e83b84f490544c99bf119cc1fca0efee83e665 | Add test for manager.py | NeutronUfscarDatacom/DriverDatacom | dcclient/tests/test_manager.py | dcclient/tests/test_manager.py | import testtools
import dcclient.xml_manager.manager as mg
import dcclient.xml_manager.data_structures as ds
class main_test(testtools.TestCase):
def test_findVlan(self):
# tests if none type is return when vlan is not found
xml = mg.ManagedXml()
answer = xml.findVlan(61)
self.ass... | apache-2.0 | Python | |
eb9ba88177ce23ef259b1731f02c38d0ccaa8318 | Add new script to build Dogecoin | rnicoll/robodoge | run_build.py | run_build.py | #!/usr/bin/python3
import re
import os
import string
import sys
import subprocess
import auto_merge
def compile_dogecoin():
path = os.getcwd()
subprocess.check_output([path + os.path.sep + 'autogen.sh'])
subprocess.check_output([path + os.path.sep + 'configure'])
subprocess.check_output(['make', 'clean'], std... | mit | Python | |
07e1dfcc4c76490a888eb1e93b649962d60a78fb | add unittest | hhatto/poyonga | test/test_poyonga.py | test/test_poyonga.py | import struct
import unittest
from mock import patch, Mock
from poyonga import Groonga, GroongaResult
class PoyongaHTTPTestCase(unittest.TestCase):
def setUp(self):
self.g = Groonga()
@patch('poyonga.client.urlopen')
def test_json_result_with_http(self, mock_urlopen):
m = Mock()
... | mit | Python | |
9bb3e11a4a983d9e9215bcd8805360968e9afa7f | Add improved decorator | TwilioDevEd/webhooks-example-django | webhooks/decorators.py | webhooks/decorators.py | from django.conf import settings
from django.http import HttpResponseForbidden
from functools import wraps
from twilio.util import RequestValidator
import os
def validate_twilio_request(f):
"""Validates that incoming requests genuinely originated from Twilio"""
@wraps(f)
def decorated_function(request, *... | mit | Python | |
2d2dabc82f2787b6c0a1bc6a5373daa891db4ce7 | Create command line file | ucaptmh/GreenGraph | greengraph/command.py | greengraph/command.py | __author__ = 'third'
from argparse import ArgumentParser
from greengraph.PlotGraph import PlotGraph
def process():
parser = ArgumentParser(
description="Produce a graph of number of green pixels in satellite images between two locations")
parser.add_argument("--start", required=True,
... | mit | Python | |
7691c9a886d76d6051b2ae3cb6e5750b2ba9c617 | add simple/dubiously effective tests for leg profile view | mileswwatkins/billy,openstates/billy,loandy/billy,sunlightlabs/billy,loandy/billy,sunlightlabs/billy,loandy/billy,openstates/billy,openstates/billy,sunlightlabs/billy,mileswwatkins/billy,mileswwatkins/billy | billy/web/public/tests/legislator_detail.py | billy/web/public/tests/legislator_detail.py |
import requests
from billy.models import db
def test_gets(states):
for leg in db.legislators.find({}, ['_id']):
requests.get('http://127.0.0.1:8000/ca/legislator/%s/' % leg['_id'])
if __name__ == '__main__':
import sys
test_gets(sys.argv[1:])
| bsd-3-clause | Python | |
3f95fd7174f740600c8c11dd2693a7775d06b945 | add missing file | xlqian/navitia,Tisseo/navitia,Tisseo/navitia,kadhikari/navitia,xlqian/navitia,kinnou02/navitia,kinnou02/navitia,Tisseo/navitia,CanalTP/navitia,CanalTP/navitia,Tisseo/navitia,kadhikari/navitia,pbougue/navitia,kadhikari/navitia,kadhikari/navitia,patochectp/navitia,CanalTP/navitia,xlqian/navitia,patochectp/navitia,xlqian/... | source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_service.py | source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_service.py | # Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | agpl-3.0 | Python | |
aff107497d202da3d41541cf0cd24e2c29c6ddbf | Add TCL executor; #58 | DMOJ/judge,DMOJ/judge,buhe/judge,buhe/judge,buhe/judge,buhe/judge,buhe/judge,buhe/judge,DMOJ/judge | executors/TCL.py | executors/TCL.py | from .resource_proxy import ResourceProxy
from .utils import test_executor
from cptbox import SecurePopen, CHROOTSecurity, PIPE
from judgeenv import env
from subprocess import Popen, PIPE as sPIPE
from cptbox.syscalls import *
import errno
TCL_FS = ['.*\.(so|tcl)', '/etc/nsswitch\.conf$', '/etc/passwd$']
class Execut... | agpl-3.0 | Python | |
46eaacef6240a72089bda049214640c50ec353ec | Add tests for robots APIs | vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks | backend/globaleaks/tests/handlers/test_robots.py | backend/globaleaks/tests/handlers/test_robots.py | # -*- coding: utf-8 -*-
import json
from twisted.internet.defer import inlineCallbacks
from globaleaks.handlers import robots
from globaleaks.models import config
from globaleaks.rest import requests
from globaleaks.settings import GLSettings
from globaleaks.tests import helpers
class TestRobotstxtHandlerHandler(hel... | agpl-3.0 | Python | |
4fc115d4297f645177854347e32c36128140caf6 | Create blastx_filter.py | stajichlab/localizaTE | scripts/blastx_filter.py | scripts/blastx_filter.py | # -*- coding: utf-8 -*-
##############################################################################################
# Prints the best hit of the blastx along with the alignment lenght and e value.
#############################################################################################
import collections
fro... | mit | Python | |
ae14f171ea6538bef026f1d1e3441194132eef28 | Add challenge 5 | gcavallo/Python-Challenge | 5.py | 5.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import urllib2, pickle, re
source = pickle.loads(urllib2.urlopen('http://www.pythonchallenge.com/pc/def/banner.p').read())
text = ''.join(x*y for i in source for x,y in i)
print re.sub("(.{95})", "\\1\n", text, 0, re.DOTALL)
| bsd-3-clause | Python | |
3e3e5bb92b1d9e0e1981a6deba41152826c3fce0 | Add script to plot population vs distinct hashtags. | chebee7i/twitter,chebee7i/twitter,chebee7i/twitter | scripts/popvsdistinct.py | scripts/popvsdistinct.py | """
Plot and calculate county population size to number of distinct hashtags.
"""
import matplotlib.pyplot as plt
import seaborn
import pandas
import twitterproj
import scipy.stats
import numpy as np
def populations():
# Grab demographic info
data = {}
df = pandas.read_csv('../census/county/PEP_2013_PEPAN... | unlicense | Python | |
483076d12e8eb7adec46a59c7ea65ad772de3fe5 | Create __init__.py | coryjog/anemoi,coryjog/anemoi,coryjog/anemoi | anemoi/analysis/__init__.py | anemoi/analysis/__init__.py | mit | Python | ||
d67a74508da9d2cdd384b823a863799655e1f087 | Add users_helper.py | lc-soft/GitDigger,lc-soft/GitDigger,lc-soft/GitDigger,lc-soft/GitDigger | app/helpers/users_helper.py | app/helpers/users_helper.py | from config import site
from random import random
from app.models.user import User
from werkzeug.security import generate_password_hash
class UsersHelper(object):
def __init__(self, app):
self.app = app
def get_user(self, github_id):
return User.query.filter_by(github_id=github_id).first()
... | agpl-3.0 | Python | |
03e94f804243eed1f434994cfb5a404dbe410ce3 | Add profiles/gdef test | moyogo/fontbakery,moyogo/fontbakery,graphicore/fontbakery,googlefonts/fontbakery,googlefonts/fontbakery,googlefonts/fontbakery,graphicore/fontbakery,graphicore/fontbakery,moyogo/fontbakery | tests/profiles/gdef_test.py | tests/profiles/gdef_test.py | from fontTools.ttLib import TTFont, newTable
from fontTools.ttLib.tables import otTables
from fontbakery.utils import TEST_FILE
from fontbakery.checkrunner import (WARN, PASS)
def get_test_font():
import defcon
import ufo2ft
test_ufo = defcon.Font(TEST_FILE("test.ufo"))
glyph = test_ufo.newGlyph("acute")
gl... | apache-2.0 | Python | |
695ad7229c5ff1355549ac0e22a498b6fac25947 | add reuse port test | hirolovesbeer/sekiwake,hirolovesbeer/sekiwake | syslog-forwarder/reuseport_forwarder.py | syslog-forwarder/reuseport_forwarder.py | #!/usr/bin/env python
import sys, socket, time
from multiprocessing import Process
PORT = 514
NR_LISTENERS = 2
SO_REUSEPORT = 15
BUFSIZE = 1025
#DST_HOST = "10.206.116.22"
DST_HOST = "192.168.11.13"
def listener_work(num):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# s.setsockopt(socket.SOL_SOCKET... | mit | Python | |
465a604547e1438e650c8b4142816e2330363767 | Add a test for storing iterable to a list slice. | alex-robbins/micropython,adafruit/circuitpython,PappaPeppar/micropython,adafruit/micropython,SHA2017-badge/micropython-esp32,swegener/micropython,Timmenem/micropython,henriknelson/micropython,adafruit/micropython,TDAbboud/micropython,SHA2017-badge/micropython-esp32,deshipu/micropython,deshipu/micropython,deshipu/microp... | tests/cpydiff/types_list_store_noniter.py | tests/cpydiff/types_list_store_noniter.py | """
categories: Types,list
description: List slice-store with non-iterable on RHS is not implemented
cause: RHS is restricted to be a tuple or list
workaround: Use ``list(<iter>)`` on RHS to convert the iterable to a list
"""
l = [10, 20]
l[0:1] = range(4)
print(l)
| mit | Python | |
d6d4f175330638f35d4eb0512ef14f82eab74f50 | Add a debug tool to show advertising broadcasts | tjguk/networkzero,tjguk/networkzero,tjguk/networkzero | show-adverts.py | show-adverts.py | # -*- coding: utf-8 -*-
import os, sys
print(sys.version_info)
import marshal
import select
import socket
import time
def _unpack(message):
return marshal.loads(message)
def _pack(message):
return marshal.dumps(message)
PORT = 9999
MESSAGE_SIZE = 256
#
# Set the socket up to broadcast datagrams over... | mit | Python | |
4ae0d59ae2e1c190a87e7561b73f1ce93696f4ab | Sort of start a real project structure | rschuetzler/over-bot | app/__init__.py | app/__init__.py | from flask import Flask
app = Flask(__name__)
from app import views
| mit | Python | |
b5c156fc8023e2752a659ea661c66973f612d753 | add tiny logger | michaelimfeld/adapo | logger.py | logger.py | #!/usr/bin/python
class Logger(object):
"""
tiny logger
"""
SUCCESS = '\033[92m'
ERROR = '\033[91m'
WARN = '\033[93m'
ENDC = '\033[0m'
def info(self, message):
"""
print info message
"""
print "info: %s" % message
def warn(self, message):
... | mit | Python | |
663f7b2fd3db928c33674a32112ed6741e699ded | Add some missing migrations | w0rp/w0rpzone,w0rp/w0rpzone,w0rp/w0rpzone,w0rp/w0rpzone | blog/migrations/0006_auto_20170307_1943.py | blog/migrations/0006_auto_20170307_1943.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2017-03-07 19:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_20150705_1607'),
]
operations = [
... | bsd-2-clause | Python | |
11f878977e6e6db9bf8f248e00cc2742835fc75e | add nextproginstr tests | pwndbg/pwndbg,pwndbg/pwndbg,pwndbg/pwndbg,pwndbg/pwndbg | tests/test_commands_next.py | tests/test_commands_next.py | import gdb
import pwndbg.gdblib.regs
import tests
REFERENCE_BINARY = tests.binaries.get("reference-binary.out")
def test_command_nextproginstr_binary_not_running():
out = gdb.execute("nextproginstr", to_string=True)
assert out == "nextproginstr: The program is not being run.\n"
def test_command_nextprogin... | mit | Python | |
4ff639b397d157aba25f83d4f497260d5ffe9e86 | fix optional reports (also needs to run install_views command) | fragaria/BorIS,fragaria/BorIS,fragaria/BorIS | boris/reporting/migrations/0001_initial.py | boris/reporting/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='SearchEncounter',
fields=[
('id', models.AutoFi... | mit | Python | |
bf259361d38a61b4f3248602356dfc4f85b7c3dd | add glim commands | aacanakin/glim | glim/commands.py | glim/commands.py | from command import GlimCommand
from termcolor import colored
from utils import copytree
import os
import traceback
class NewCommand(GlimCommand):
name = 'new'
description = 'generates a new glim app'
def run(self, app):
proto_path = 'glim/proto/project'
currentpath = os.path.dirname(os.path.dirname(os.path.r... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.