code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import datetime
import pytest
from django.core.exceptions import ValidationError
from treeherder.perf.models import (PerformanceAlert,
PerformanceAlertSummary,
PerformanceSignature)
def test_summary_modification(test_repository, test_perf_signa... | edmorley/treeherder | tests/perfalert/test_alert_modification.py | Python | mpl-2.0 | 3,921 |
import happyforms
from django import forms
from django.contrib import messages
from remo.base.forms import BaseEmailUsersForm
from remo.base.tasks import send_remo_mail
from remo.profiles.models import FunctionalArea, UserProfile
class EmailRepsForm(BaseEmailUsersForm):
"""Generic form to send email to multiple... | tsmrachel/remo | remo/dashboard/forms.py | Python | bsd-3-clause | 1,405 |
# Copyright 2015 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 applica... | ghchinoy/tensorflow | tensorflow/python/ops/image_grad_test.py | Python | apache-2.0 | 18,282 |
#===============================================================================
# Copyright 2010 Matt Chaput
#
# 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/li... | archatas/whoosh | whoosh/qparser/__init__.py | Python | apache-2.0 | 919 |
import requests
import json
import spotipy
import spotipy.util as util
import math
import operator
import config
def main():
playlist_name = "Will squared Playlist"
image_file_name = "will&will.jpg"
maximum = 20
token = util.prompt_for_user_token(
config.username, config.scope, client_id=config.... | hasanbanna/partyplaylist | main.py | Python | mit | 3,712 |
# -*- encoding: utf-8 -*-
"""A utility that tries saved genetic tests and removes those failing"""
import asyncio
import yaml
from pathlib import Path
from logzero import logger
from rizza import entity_tester
from rizza import genetic_tester
def genetic_prune(conf, entity='All'):
"""Check all saved genetic_teste... | JacobCallahan/rizza | rizza/helpers/prune.py | Python | gpl-3.0 | 2,971 |
from __future__ import unicode_literals
import frappe
def get_context(context):
context.read_only = 1
def get_list_context(context):
context.row_template = "erpnext/templates/includes/healthcare/lab_test_row_template.html"
context.get_list = get_lab_test_list
def get_lab_test_list(doctype, txt, filters, limit_st... | ovresko/erpnext | erpnext/healthcare/web_form/lab_test/lab_test.py | Python | gpl-3.0 | 775 |
import decimal
import os
import json
import logging
import time
import traceback
import types
import arrow
from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.engine import Engine
from sqlalchemy.ext.declarative import declarative_base as real_declarative_base
from sqlalchemy.o... | rEtSaMfF/ffrk-bottle | models/base.py | Python | gpl-3.0 | 5,917 |
from django.conf.urls import url
from .views import chooser, endnotes
app_name = 'content_notes'
urlpatterns = [
url(r'^choose/$', chooser.choose, name='choose'),
url(r'^choose/(\d+)/$', chooser.chosen, name='chosen'),
url(r'^$', endnotes.list, name='list'),
]
| CIGIHub/greyjay | greyjay/content_notes/urls.py | Python | mit | 277 |
import multiprocessing
bind = ['0.0.0.0:8200']
workers = multiprocessing.cpu_count() * 2 + 1
logfile = 'logs/gunicorn.log'
timeout = 30
backlog = 2048
graceful_timeout = 30
limit_request_field_size = 8000
preload_app = False
user = None
pidfile = None
umask = 0
user = None
group = None
tmp_upload_dir = None
debug = Fa... | Aplopio/document-converter | gunicorn.conf.py | Python | mit | 339 |
# -*- coding: utf-8 -*-
#
# Used when Staging a NNTP Post
#
# Copyright (C) 2017 Chris Caron <lead2gold@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of th... | caronc/newsreap | newsreap/objects/post/StagedArticle.py | Python | gpl-3.0 | 3,097 |
# -*- coding: utf-8 -*-
from Screens.Screen import Screen
from Components.BlinkingPixmap import BlinkingPixmapConditional
from Components.config import config, ConfigInteger
from Components.Label import Label
from Components.ServiceEventTracker import ServiceEventTracker
from enigma import eDVBSatelliteEquipmentControl... | Ophiuchus1312/enigma2-master | lib/python/Screens/Dish.py | Python | gpl-2.0 | 4,880 |
# This file is part of ucgrad, Copyright 2008 David M. Rogers.
#
# ucgrad 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.
#
# ... | frobnitzem/forcesolve | cg_topol/ucgrad/array_io.py | Python | gpl-3.0 | 5,121 |
# Copyright (C) 2010 Canonical
#
# Authors:
# Gary Lasker
# Natalia Bidart
#
# 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; version 3.
#
# This program is distributed in the hope that it will... | ceibal-tatu/software-center | softwarecenter/ui/gtk3/widgets/spinner.py | Python | lgpl-3.0 | 4,857 |
#!/usr/bin/env python
from astrodata.AstroDataType import *
from optparse import OptionParser
from astrodata import Descriptors as ds
import os
import re
try:
import pydot
from pydot import *
except:
print "couldn't import pydot, type graphs will not be drawn"
sys.exit(0)
cl = get_classification_l... | pyrrho314/recipesystem | trunk/astrodata/scripts/typelib.py | Python | mpl-2.0 | 5,571 |
from queue import Empty
from .exceptions.processor_errors import KernelClientStartingError, ExecutionTimeoutError
from .results_processor import ResultsProcessor
class ClientWrapper:
"""Wrapper for Jupyter Client"""
def __init__(self, client, language, document_language, execution_timeout):
"""Initi... | jablonskim/jupyweave | jupyweave/client_wrapper.py | Python | mit | 3,082 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from chain.core import resources
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^', include(resources.urls)),
# Examples:
# url(r'^$', 'chain.views.home', name='home'),
# ... | ResEnv/chain-api | chain/urls.py | Python | mit | 829 |
__author__ = 'abird' | ooici/coi-services | ion/services/eoi/__init__.py | Python | bsd-2-clause | 20 |
import os
import sys
import logging
import asyncio
import hashlib
import json
import re
import aiohttp
import cssutils
import yarl
from bs4 import BeautifulSoup
from asyncio import Queue
from collections import defaultdict
animation = "|/-\\"
class Cloner(object):
def __init__(self, root, max_depth, css_validate... | mushorg/snare | snare/cloner.py | Python | gpl-3.0 | 7,680 |
from __future__ import unicode_literals
from .helpers import (
compose,
non_string,
format_tags,
single_result,
language_codes,
element_to_dict,
oai_process_uris,
build_properties,
datetime_formatter,
doe_process_contributors,
oai_process_contributors,
dif_process_contri... | CenterForOpenScience/scrapi | scrapi/base/schemas.py | Python | apache-2.0 | 3,782 |
from . import AppCase
from app.models.comment import Comment
class CommentTest(AppCase):
def setUp(self):
self.setup_app()
self.create_user()
self.create_issue()
self.comment = Comment(
body='foo bar',
issue=self.test_issue,
author=se... | publicscience/hive | app/tests/comment_test.py | Python | mit | 1,086 |
# -*- coding: utf-8 -*-
"""
Author: @gabvaztor
StartDate: 04/03/2017
With this class you can pre-process your data. For example,
you can add statistical information or order your data.
Style: "Google Python Style Guide"
https://google.github.io/styleguide/pyguide.html
"""
"""
# -------------------------------------... | Gabvaztor/TFBoost | src/services/ccboost/TFDataMining.py | Python | apache-2.0 | 1,840 |
# ***** BEGIN LICENSE BLOCK *****
# 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/.
# ***** END LICENSE BLOCK *****
# This is a template config file for web-platfor... | walac/build-mozharness | configs/web_platform_tests/prod_config_windows.py | Python | mpl-2.0 | 1,460 |
#!/usr/bin/python
#
# Copyright 2008 Qumranet, Inc. All rights reserved.
# Use is subject to license terms.
#
import sys, getopt
import os
import subprocess
import logging, logging.config
import traceback
import string
import random
import re
SUPPORTED_PLATFORMS = [ "RedHatEnterpriseServer", "Fedora" ]
HYPERVISOR_PLA... | raksha-rao/gluster-ovirt | backend/manager/conf/vds_installer.py | Python | apache-2.0 | 15,169 |
from nose import SkipTest
from nose.tools import eq_, assert_raises
from dxr.indexers import (unsparsify, by_line, group_needles, span_to_lines,
key_object_pair, Extent, Position, split_into_lines,
FileToSkim)
KV1 = ('x', 'v1')
KV2 = ('y', 'v2')
KV3 = ('z', 'v3')
... | pombredanne/dxr | tests/test_indexers.py | Python | mit | 2,910 |
import argparse
from wsqa import create_app
# Create the flask app.
app = create_app()
# Run the app
if __name__ == '__main__':
# Define the arguments.
parser = argparse.ArgumentParser()
parser.add_argument(
'--host',
default='0.0.0.0',
help='Host to bind to: [%(default)s].')
... | opendatakosovo/water-surface-quality-api | runserver.py | Python | gpl-2.0 | 745 |
"""
Modules created by others. Versioned and distributed by One Codex
"""
__all__ = ['potion_client']
| onecodex/onecodex | onecodex/vendored/__init__.py | Python | mit | 103 |
# Building inheritance
class MITPerson(Person):
nextIdNum = 0 #next ID number to assing
def __init__(self, name):
Person.__init__(self, name) #initialize Person attributes
# new MITPerson atrribute: a unique ID number
self.idNum = MITPerson.nextIdNum
MITPerson.nextIdNum += ... | teichopsia-/python_practice | old_class_material/MITPerson_class.py | Python | mpl-2.0 | 903 |
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response as render
from django.template import RequestContext
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
import re, time, urllib
import openid
if openid.__version__ < '2.0... | agiliq/Django-Socialauth | openid_consumer/views.py | Python | gpl-3.0 | 7,943 |
import claripy
import logging
import time
from ... import sim_options as o
l = logging.getLogger("angr.engines.vex.dirty")
#####################
# Dirty calls
#####################
# they return retval, constraints
# Reference:
# http://www-inteng.fnal.gov/Integrated_Eng/GoodwinDocs/pdf/Sys%20docs/PowerPC/PowerP... | tyb0807/angr | angr/engines/vex/dirty.py | Python | bsd-2-clause | 14,622 |
import logging
import unittest
from ds.vortex.core import baseNode
from ds.vortex.core import graph
from ds.vortex.core import plug as plugs
from ds.vortex.nodes.math.basic import sum
logger = logging.getLogger(__name__)
class TestGraph(unittest.TestCase):
def setUp(self):
self.graph = grap... | dsparrow27/vortex | src/ds/vortex/tests/testGraph.py | Python | mit | 6,846 |
from __future__ import print_function
from os import system, path as os_path
import sys
import re
import six
from six.moves import range
if sys.version_info[0] < 3:
from string import maketrans, strip
from enigma import eConsoleAppContainer
from Components.config import config, ConfigYesNo, NoSave, ConfigSubsection... | openatv/enigma2 | lib/python/Plugins/SystemPlugins/WirelessLan/Wlan.py | Python | gpl-2.0 | 14,667 |
from saylua import app
from flask_wtf import FlaskForm
from saylua.utils.form import sl_validators, UserCheck
from saylua.utils.form.fields import SlField, SlTextAreaField
recipient_check = UserCheck()
class ConversationForm(FlaskForm):
recipient = SlField('Recipient Name', [
sl_validators.Required(),
... | LikeMyBread/Saylua | saylua/modules/messages/forms.py | Python | agpl-3.0 | 1,013 |
"""
A Python Singleton mixin class that makes use of some of the ideas
found at http://c2.com/cgi/wiki?PythonSingleton. Just inherit
from it and you have a singleton. No code is required in
subclasses to create singleton behavior -- inheritance from
Singleton is all that is needed.
Singleton creation is threadsafe.
U... | brentpayne/celery-geolocator | celery_geolocator/helpers/singleton.py | Python | mit | 17,689 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
url="https://github.com/OctavianLee/Pywechat"
VERSION = "0.0.2"
setup(
name="pywechat",
version=VERSION,
license='MIT',
description="A python SDK for the wechat public platform.",
author="Octavian Lee",
author_email="octavianl... | OctavianLee/Pywechat | setup.py | Python | mit | 557 |
# Invert gray image
import cv2
from . import print_image
from . import plot_image
def invert(img, device, debug=None):
"""Inverts grayscale images.
Inputs:
img = image object, grayscale
device = device number. Used to count steps in the pipeline
debug = None, print, or plot. Print = save ... | AntonSax/plantcv | plantcv/invert.py | Python | mit | 794 |
#
# otopi -- plugable installer
# Copyright (C) 2012-2013 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any late... | alonbl/otopi | src/otopi/__init__.py | Python | lgpl-2.1 | 1,397 |
import rhinoscriptsyntax as rs
from math import*
for i in range(0,20):
if (i%2==0): #i modular 2 (checks for remainder; what if we divide i by 2, is there a remainder
rs.AddPoint([i,0,0])
else:
rs.AddSphere([i,0,0],0.3)
| FRMlab/Jenny_Sabin_Workshop | Python2/2conditional_if else.py | Python | gpl-2.0 | 278 |
#
# Helpers related to setup.
#
import logging
import os
import sys
import shlex
try:
import json
except ImportError, e:
import simplejson as json
sys.path.append(os.path.abspath('plugins/actions/nfsdirs'))
from hypnotoad.core import hypnofs
from base_classes import *
LOG = logging.getLogger('root')
FS = h... | hpc/hypnotoad | hypnotoad/plugins/actions/nfsdirs/setup_helper.py | Python | bsd-3-clause | 4,679 |
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | esparta/logilab_common3 | table.py | Python | gpl-2.0 | 31,337 |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^(\d+)/$', 'lists.views.view_list', name='view_list'),
url(r'^new$', 'lists.views.new_list', name='new_list'),
url(r'^(\d+)/add_item$', 'lists.views.add_item', name='add_item'),
)
| carlosgoce/superlists | lists/urls.py | Python | mit | 278 |
# coding=utf-8
# !/usr/bin/env python
# !/usr/bin/python
# author : decaywood
import sys
import os
import re
import fileinput
def cur_file_dir():
path = sys.path[0]
if os.path.isdir(path):
return path
elif os.path.isfile(path):
return os.path.dirname(path)
PATTERN = re.compile(r'.*\[(.*)\]\((.*... | chaoyangqq/chaoyangqq.github.io | shell/linkChecker.py | Python | mit | 2,373 |
import getopt
import traceback
import sys
from pathlib import Path
import logging
logger = logging.getLogger('root')
class Arguments:
verbose = 'normal'
receiver = False
sender = False
input_file = None
output_file = None
input_string = None
queue_number = 10
time_shifter = False
... | albuic/stegProject | stegfy/Arguments.py | Python | gpl-3.0 | 22,977 |
import os
import time
import rospy
import argparse
from numpy import array, save, zeros, ones
from fishing import FishingBaxter
REPEAT = 5
DURATION = 10 * 60
NTIMES = 10
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--log', type=str, required=True)
args = parser.par... | flowersteam/fishing-baxter | run-dmp.py | Python | gpl-3.0 | 1,135 |
from django import template
register = template.Library()
def distribute_entrys(inboxentry):
boxentrys = inboxentry.box_set.all()
return {'boxentrys': boxentrys}
| arsenalstriker14/imagetraccloud | imagetrac_docker/taskmanager/templatetags/taskbox_tags.py | Python | mit | 173 |
#!/usr/bin/env python
# initial translation from the tcl by VTK/Utilities/tcl2py.py
# further cleanup and fixes to the translation by Charl P. Botha
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# This example demonstrates how to use the vtkImageTracerWidget
# to trace on a sli... | HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Examples/GUI/Python/ImageTracerWidget.py | Python | gpl-3.0 | 7,773 |
"""
How to use this file:
have the data, main_data.csv, and the machine learning model file,
house_price_model_2.py, in the same folder with this file
change data path follow instructions in the house_price_model_2.py file:
for windows user -
os.environ["SALES_DATA_PATH"] = r'the path where Merged_Data.csv is saved', ... | sliwhu/UWHousingTeam | UWHousingTeam/Scripts/part1_predict_price.py | Python | mit | 6,926 |
def resample_to_1km( x, template_raster_mask ):
'''
template_raster_mask should be a mask in in the res/extent/origin/crs of the
existing TEM IEM products.
'''
import rasterio, os
from rasterio.warp import RESAMPLING, reproject
import numpy as np
fn = os.path.basename( x )
fn_split = fn.split( '.' )[0].split... | ua-snap/downscale | snap_scripts/old_scripts/tem_iem_older_scripts_april2018/tem_inputs_iem/old_code/crop_mask_resample_to_iem.py | Python | mit | 6,482 |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
from iptest.assert_util import *
add_clr_assemblies("loadorder_5")
# namespace NS {
# public class T... | slozier/ironpython2 | Tests/interop/net/loadorder/t5b.py | Python | apache-2.0 | 1,181 |
import Queue
import time, sys, threading
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol
twitchRepeatTimeout = 30
twitchDelayMod = 0.05
twitchDelayNonMod = 1.7
twitchRateLimitMod = 90
twitchRateLimitNonMod = 15
twitchRateLimitPeriod = 30
class MessageQueue:
... | Dabomstew/goldenrod | messagequeue.py | Python | mit | 2,718 |
import pybedtools
import os
testdir = os.path.dirname(__file__)
test_tempdir = os.path.join(os.path.abspath(testdir), 'tmp')
unwriteable = os.path.join(os.path.abspath(testdir), 'unwriteable')
def setup():
if not os.path.exists(test_tempdir):
os.system('mkdir -p %s' % test_tempdir)
pybedtools.set_temp... | jos4uke/getSeqFlankBlatHit | lib/python2.7/site-packages/pybedtools/test/tfuncs.py | Python | gpl-2.0 | 462 |
#!/usr/bin/env python
import argparse
import kaboom.api
import kaboom.compiler
import kaboom.constants
import kaboom.vm
def create(api, infile):
bytecode = kaboom.compiler.compile(infile)
print "Contract bytecode:", bytecode
contract = api.create(bytecode, kaboom.constants.DEFAULT_KEY)
print "Contr... | Cpt-Obvious/kaboom | create.py | Python | mit | 749 |
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | yang-g/grpc | tools/run_tests/python_utils/comment_on_pr.py | Python | apache-2.0 | 1,224 |
"""
Python 富文本XSS过滤类
@package XssHtml
@version 0.1
@link http://phith0n.github.io/python-xss-filter
@since 20150407
@copyright (c) Phithon All Rights Reserved
Based on native Python module HTMLParser purifier of HTML, To Clear all javascript in html
You can use it in all python web framework
Written by Phithon <root@le... | ultmaster/eoj3 | utils/xss_filter.py | Python | mit | 6,450 |
from Foundation import *
import objc
from PyObjCTools.TestSupport import *
class TestNSLockProtocols (TestCase):
def testLockIsLock(self):
# Test for bug #1735937
lock = NSLock.alloc().init()
self.assert_(lock.conformsToProtocol_(objc.protocolNamed("NSLocking")))
self.assert_(lo... | albertz/music-player | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nslock.py | Python | bsd-2-clause | 994 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | iagcl/data_pipeline | data_pipeline/extractor/exceptions.py | Python | apache-2.0 | 1,263 |
import unittest
from scripttest import TestFileEnvironment
SCRIPT='../ldap2zabbix.py'
class CLITest(unittest.TestCase):
def setUp(self):
self.env = TestFileEnvironment('./.scratch')
def tearDown(self):
pass
def test_can_run_script_without_arguments(self):
result = self.env.run('... | s-i-tech/py-ldap2zabbix | tests/functional_tests.py | Python | lgpl-3.0 | 738 |
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_users(host):
user = host.user('owner1')
assert user.exists
assert user.home == '/home/owner1'
user = host.user('devuser... | FiaasCo/fiaas | playbooks/roles/createresources/molecule/fiaas01/tests/test_users.py | Python | mit | 582 |
# GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at you... | manojklm/pywinauto-x64 | pywinauto/controls/__init__.py | Python | lgpl-2.1 | 2,175 |
"""
@todo Clean up the LimitTreeMaker python file to not depend on these extra variables in cuts.py
"""
import os
from .. import Load, DirFromEnv
newLimitTreeMaker = Load('LimitTreeMaker')
def SetupFromEnv(ltm):
"""A function that sets up the LimitTreeMaker after sourcing a config file
@param ltm The Limit... | dabercro/CrombieTools | python/CrombieTools/AnalysisTools/LimitTreeMaker.py | Python | mit | 1,169 |
"""Test StructuredQuadGraph."""
from numpy.testing import assert_array_equal
from pytest import approx
from landlab.graph import DualStructuredQuadGraph, DualUniformRectilinearGraph
def test_create():
"""Test creating a quad graph."""
y = [0, 1, 3, 0, 1, 3, 0, 1, 3]
x = [3, 3, 3, 4, 4, 4, 6, 6, 6]
gr... | cmshobe/landlab | tests/graph/structured_quad/test_dual_quad.py | Python | mit | 7,341 |
import os
from ehive.runnable.IGFBaseProcess import IGFBaseProcess
from igf_data.utils.tools.fastp_utils import Fastp_utils
from igf_data.utils.fileutils import get_datestamp_label
class RunFastp(IGFBaseProcess):
def param_defaults(self):
params_dict=super(RunFastp,self).param_defaults()
params_dict.update({... | imperial-genomics-facility/data-management-python | ehive/runnable/process/alignment/RunFastp.py | Python | apache-2.0 | 5,251 |
from ctypes import *
import sys, unittest
import os
from ctypes.util import find_library
from ctypes.test import is_resource_enabled
libc_name = None
if os.name == "nt":
libc_name = find_library("c")
elif os.name == "ce":
libc_name = "coredll"
elif sys.platform == "cygwin":
libc_name = "cygwin1.dll"
else:
... | svanschalkwyk/datafari | windows/python/Lib/ctypes/test/test_loading.py | Python | apache-2.0 | 4,399 |
class ConnectionError(Exception):
pass
class DownloadError(Exception):
pass
class LoginError(Exception):
pass | minadyn/lftppy | lftppy/exc.py | Python | gpl-2.0 | 130 |
import random
import uuid
from flask import g
from newparp.model import Chat
from newparp.model.connections import NewparpRedis, redis_chat_pool
from newparp.model.user_list import UserListStore, PingTimeoutException
def get_userlist(client, chat: Chat) -> UserListStore:
client.get("/" + chat.url)
user_list ... | MSPARP/newparp | tests/web/test_userlist.py | Python | agpl-3.0 | 3,520 |
"""Define and instantiate the configuration class for Robottelo."""
import logging
import os
import sys
from logging import config
from nailgun import entities, entity_mixins
from nailgun.config import ServerConfig
from robottelo.config import casts
from six.moves.urllib.parse import urlunsplit, urljoin
from six.moves... | Ichimonji10/robottelo | robottelo/config/base.py | Python | gpl-3.0 | 35,889 |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | plaid/plaid-python | plaid/model/institutions_search_payment_initiation_options.py | Python | mit | 6,819 |
# 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... | phenoxim/nova | nova/objects/tag.py | Python | apache-2.0 | 2,514 |
from JumpScale import j
import os
import time
import socket
base = j.tools.cuisine._getBaseClass()
class CuisineBootMediaInstaller(base):
def __init__(self, executor, cuisine):
self._executor = executor
self._cuisine = cuisine
def _downloadImage(self, url, redownload=False):
base =... | Jumpscale/jumpscale_core8 | lib/JumpScale/tools/cuisine/tools/CuisineBootMediaInstaller.py | Python | apache-2.0 | 9,198 |
from .. utils import TranspileTestCase, BuiltinTwoargFunctionTestCase
from unittest import expectedFailure
class FilterTests(TranspileTestCase):
base_code = """
#placeholder while list()s etc aren't fully implemented
class ListLike:
x = %s
index = 0
... | gEt-rIgHt-jR/voc | tests/builtins/test_filter.py | Python | bsd-3-clause | 7,021 |
shuffles = []
with open('input.txt') as f:
for line in f:
if line.startswith('deal with'):
inc = int(line.strip().split(' ')[-1])
shuffles.append((2, inc))
elif line.startswith('cut'):
d = int(line.strip().split(' ')[-1])
shuffles.append((1, d))
... | marcosfede/algorithms | adventofcode/2019/d22/d22.py | Python | gpl-3.0 | 2,144 |
"""
Generates protein-ligand docked poses.
"""
import platform
import logging
import os
import tempfile
import tarfile
import numpy as np
from subprocess import call
from subprocess import check_output
from typing import List, Optional, Tuple, Union
from deepchem.dock.binding_pocket import BindingPocketFinder
from dee... | lilleswing/deepchem | deepchem/dock/pose_generation.py | Python | mit | 13,071 |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | jonparrott/gcloud-python | bigquery/tests/unit/test_magics.py | Python | apache-2.0 | 12,950 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/autotvm/graph_tuner/utils/utils.py | Python | apache-2.0 | 3,524 |
#!/usr/bin/env python
###############################################################################
# $Id: rel.py 18195 2009-12-06 20:24:39Z rouault $
#
# Project: GDAL Python samples
# Purpose: Script to produce a shaded relief image from elevation data
# Author: Andrey Kiselev, dron@remotesensing.org
#
########... | AsherBond/MondocosmOS | gdal/swig/python/samples/rel.py | Python | agpl-3.0 | 7,548 |
"""
Google Code Wiki translator.
Syntax defined by http://code.google.com/p/support/wiki/WikiSyntax
Here called gwiki to make the dialect clear (g for google).
"""
import re, os, commands, sys
from common import default_movie, plain_exercise, insert_code_and_tex, \
fix_ref_section_chapter
from plaintext import p... | dragly/doconce | lib/doconce/gwiki.py | Python | bsd-3-clause | 9,341 |
# ========================================================================
# Copyright (c) 2015 The University of Washington
#
# 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
#
# ht... | mattjmuw/iam-messaging | messagetools.old/dao_implementation/ms_azure.py | Python | apache-2.0 | 4,755 |
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc.
#
# 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 2 of the License, or
# (at your option) any later... | kawamuray/ganeti | lib/rapi/rlib2.py | Python | gpl-2.0 | 41,238 |
# -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__release__ = '2.0rc4'
__version__ = '$Id: e26392a530582f286edf2d99e729218b2e93405e $'
import datetime
imp... | hperala/kontuwikibot | pywikibot/__init__.py | Python | mit | 26,829 |
"""
Copyright 2016 Peter Beard
Distributed under the GNU GPL v2. For full terms, see the LICENSE file.
Problem #14
The following iterative sequence is defined for the set of positive integers:
n → n/2 (n is even)
n → 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13... | PeterBeard/project-euler | python/problem-014.py | Python | gpl-2.0 | 1,490 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Author: Wellington Silva a.k.a. Well
Date: July 2017
Name: how2decode-html.py
Purpose: Decode data with HTML Escape.
Description: Script Based on script CAL9000 by Chris Loomis from OWASP Project, posted at:
<https://www.owasp.org/index.php/Categor... | how2security/how2convert | how2decode-html.py | Python | gpl-3.0 | 1,973 |
from django import forms
from django.forms.models import inlineformset_factory
from starwars.models import Movie, Episode
class MovieForm(forms.ModelForm):
class Meta:
"""
As I have to use : "exclude" or "fields"
As I'm very lazy, I dont want to fill the list in the "fields"
... | foxmask/tracking-starwars | starwars/forms.py | Python | mit | 624 |
#!/usr/bin/python
import boto3
import botocore
import fcntl
import json
import re
import socket
import struct
import sys
import time
from datetime import datetime
from optparse import OptionParser
ZONE_ID = 'MYROUTE53-ZONEID'
DEF_DOMAIN = ".myroute53domain"
REGION = "us-east-1"
TTL = 600
RTYPE = "A"
COMMENT ... | rkferreira/tools | aws-route53-hostsmgmt/dnsmgmt.py | Python | gpl-2.0 | 5,470 |
# Generated by Django 2.2.6 on 2020-01-24 04:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user_profile', '0015_auto_20200116_1116'),
]
operations = [
migrations.AddField(
model_name='user',
name='starred_th... | daily-bruin/meow | meow/user_profile/migrations/0016_user_starred_themes.py | Python | agpl-3.0 | 442 |
from time import clock
def timer(function):
def wrapper(*args, **kwargs):
start = clock()
print(function(*args, **kwargs))
print("Solution took: %f seconds." % (clock() - start))
return wrapper
@timer
def find_answer():
words = []
with open("words.txt") as f:
for ite... | Igglyboo/Project-Euler | 1-99/40-49/Problem42.py | Python | unlicense | 743 |
#!python
"""
VMController Host - a general purpose host-side virtual machine controller via exposed hypervisors apis.
"""
try:
import os
import sys
import logging
import warnings
import multiprocessing
import time
import inject
from twisted.internet import reactor
from pkg_resource... | dgquintas/vmcontroller.unstable | src/vmcontroller.host/vmcontroller/host/__main__.py | Python | bsd-3-clause | 8,090 |
from pymoveit_core.robot_model import *
| ros-planning/moveit | moveit_core/python/src/moveit/core/robot_model/__init__.py | Python | bsd-3-clause | 40 |
REDIS_URL = 'redis://redis/0'
ERROR_NO_IMAGE = 'Please provide an image'
ERROR_NO_TEXT = 'Please provide some text'
MAX_SIZE = (512, 512)
# Where to store the models weights
# (except for Keras' that are stored in ~/.keras)
WEIGHT_PATH = './weights'
# Original model source: https://drive.google.com/drive/folders/0B... | EliotAndres/pretrained.ml | containers/tensorflow_models/config.py | Python | mit | 644 |
from argparse import ArgumentParser
from snapchat_bots import SnapchatBot
class ReflectorBot(SnapchatBot):
def on_snap(self, sender, snap):
self.send_snap([sender], snap)
def on_friend_add(self, friend):
self.add_friend(friend)
def on_friend_delete(self, friend):
self.delete_frie... | Gendreau/SnapchatBot | examples/reflectorbot.py | Python | mit | 754 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import abc
import sys
import pprint
import datetime
from python_utils import converters
import six
from .... | dennerlager/sepibrews | sepibrews/progressbar/widgets.py | Python | gpl-3.0 | 31,775 |
import visa
__all__ = ['TempStage', 'TMS91', 'TMS94']
# Original code kindly contributed by Filip Dominec <dominecf@fzu.cz>
# See http://www.fzu.cz/~dominecf/python/FDLabInstruments.py
class TempStage(object, visa.SerialInstrument):
"""Base class for Linkam temperature stages."""
def __init__(self, *args, ... | ptomato/REP-instrumentation | rep/linkam/tms.py | Python | gpl-3.0 | 2,599 |
# Copyright (c) 2017 Civic Knowledge. This file is licensed under the terms of the
# MIT License, included in this distribution as LICENSE.txt
""" """
from rowgenerators.source import Source
##
## FIXME This is probably broken
## But it's Socrata, so who really cares?
class SocrataSource(Source):
"""Iterates a ... | CivicKnowledge/rowgenerators | rowgenerators/generator/socrata.py | Python | mit | 1,962 |
# coding: utf-8
from PyQt4.QtGui import QDialog, QFormLayout
from qgis.gui import (QgsFieldComboBox, QgsMapLayerComboBox,
QgsMapLayerProxyModel)
# Create dialog
new_dialog = QDialog()
# Add combobox for layer and field
map_layer_combo_box = QgsMapLayerComboBox()
map_layer_combo_box.setCurrentInd... | webgeodatavore/pyqgis-samples | gui/qgis-sample-QgsMapLayerComboBox.py | Python | gpl-2.0 | 966 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Matt Martz <matt@sivel.net>, and others
#
# This file is part of Ansible
#
# Ansible 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 t... | bjolivot/ansible | lib/ansible/modules/windows/win_msi.py | Python | gpl-3.0 | 2,526 |
# Copyright 2013 Josh Durgin
# 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 a... | maelnor/cinder | cinder/tests/api/v2/test_volumes.py | Python | apache-2.0 | 42,339 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-research/pyreach | pyreach/ikfast/ikfast_test.py | Python | apache-2.0 | 52,224 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009-2010 Zuza Software Foundation
#
# This file is part of translate.
#
# 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 versio... | jagg81/translate-toolkit | translate/convert/web2py2po.py | Python | gpl-2.0 | 2,573 |
# Copyright 2013 OpenStack Foundation
# 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 requ... | paninetworks/neutron | neutron/tests/api/base_routers.py | Python | apache-2.0 | 2,857 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from specparser import get_settings_from_file
import csv
def main():
settings = get_settings_from_file("spec.json")
print(settings)
# TODO: Add your code here
pivot = int(settings.Param.split_index)
foutput1 = open(settings.Output.output1,"... | dkuner/example-modules | modules/data_transmation/column_splitter/main.py | Python | bsd-3-clause | 943 |
# rhn_register.py - GUI front end code for firstboot screen resolution
#
# Copyright 2003 Red Hat, Inc.
# Copyright 2003 Brent Fox <bfox@redhat.com>
#
# 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 Foundat... | xkollar/spacewalk | client/debian/packages-already-in-debian/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_login_gui.py | Python | gpl-2.0 | 3,554 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.