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 |
|---|---|---|---|---|---|
"""Align reads with STAR aligner."""
import gzip
import shutil
from pathlib import Path
from plumbum import TEE
from resolwe.process import (
BooleanField,
Cmd,
DataField,
FileField,
FloatField,
GroupField,
IntegerField,
Process,
SchedulingClass,
StringField,
)
SPECIES = [
... | genialis/resolwe-bio | resolwe_bio/processes/alignment/star.py | Python | apache-2.0 | 29,098 |
# -*- coding: utf-8 -*-
#
# 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
#... | Fokko/incubator-airflow | airflow/models/errors.py | Python | apache-2.0 | 1,159 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Product Variant Multi Advanced module for OpenERP
# Copyright (C) 2010-2012 Akretion (http://www.akretion.com)
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# @author Alexis de Lattre <alexi... | oihane/product-variant | __unported__/product_variant_multi_advanced/__openerp__.py | Python | agpl-3.0 | 1,912 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-10-21 18:03
from __future__ import unicode_literals
import common.mixins
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrati... | sigmapi-gammaiota/sigmapi-web | sigmapiweb/apps/PartyListV2/migrations/0009_auto_20181021_1803.py | Python | mit | 1,789 |
import unittest
from translationstring import text_type
from translationstring.compat import u
class TestTranslationString(unittest.TestCase):
def _getTargetClass(self):
from translationstring import TranslationString
return TranslationString
def _makeOne(self, msgid, **kw):
kl... | anakinsolo/backend | Lib/site-packages/translationstring-1.3-py2.7.egg/translationstring/tests/test__init__.py | Python | mit | 19,477 |
#!/usr/bin/env python
"""
@file rebuildSchemata.py
@author Michael Behrisch
@date 2011-07-11
@version $Id: rebuildSchemata.py 22608 2017-01-17 06:28:54Z behrisch $
Let all SUMO binaries write the schema for their config
SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
Copyright (C) 2011-2017 DLR (ht... | 702nADOS/sumo | tools/xml/rebuildSchemata.py | Python | gpl-3.0 | 1,279 |
import pytest
from cnfgen.clitools.graph_args import parse_graph_argument as P
def test_empty_args():
with pytest.raises(ValueError):
P('simple', ' ')
def test_consume_args():
r = P('simple', 'grid 10 10 10')
assert r['args'] == ['10', '10', '10']
def test_consume_args2():
r = P(
... | MassimoLauria/cnfgen | tests/test_parse_graph_args.py | Python | gpl-3.0 | 1,501 |
import os
from instances import xlog
import yaml
from distutils.version import LooseVersion
current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath( os.path.join(current_path, os.pardir))
data_path = os.path.join(root_path, 'data')
config_path = os.path.join(data_path, 'launcher', 'conf... | hexlism/xx_net | launcher/config.py | Python | bsd-2-clause | 2,432 |
# test builtin range type
# print
print(range(4))
# bool
print(bool(range(0)))
print(bool(range(10)))
# len
print(len(range(0)))
print(len(range(4)))
print(len(range(1, 4)))
print(len(range(1, 4, 2)))
print(len(range(1, 4, -1)))
print(len(range(4, 1, -1)))
print(len(range(4, 1, -2)))
# subscr
print(range(4)[0])
pri... | mhoffma/micropython | tests/basics/builtin_range.py | Python | mit | 984 |
#!/usr/bin/env python3.2
import os
obj=os.walk(r"/home/ryder/Файлы/Документы/Работа/UnitCoin/unitcoin")
xlist={}
s=input("Введите список для замены имён:\n").split(" ")
while len(s)>1 and len(s)<3:
xlist[s[0]]=s[1]
s=input().split(" ")
for x in obj:
if not "/home/ryder/Файлы/Документы/Работа/UnitCoin/unitcoin/.git"... | Ryder95/unitcoin | RenameScript.py | Python | mit | 810 |
#!/usr/bin/env python
from six import print_
from pprint import pprint
import argparse
from crashreporter.crash_report_pb2 import CrashReport
CRASH_REPORT_HEADER_LENGTH = 8
def load_crash_report(data):
#load the crash report data
cr = CrashReport()
cr.ParseFromString(data)
return cr
def pb_fields... | jlujan/python-crashreporter | crashreporter/main.py | Python | unlicense | 1,961 |
#
# To test this, first have a running local zookeeper installation
# (See http://zookeeper.apache.org/)
# Next, open a couple of shells
# Run this in the first one, watch the output. It will create a lock and hold it for 20 seconds.
# Run it again in the second one, watch that it doesn't acquire the lock until the f... | tinyogre/zklock | zklocktest.py | Python | lgpl-3.0 | 1,271 |
# Copyright 2015, Rob Lyon <nosignsoflifehere@gmail.com>
#
# 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 la... | rlyon/pigs | pigs/__init__.py | Python | apache-2.0 | 704 |
from photoapp.models import UserProfile
def get_profile_details(backend, user, response, *args, **kwargs):
# Save Facebook profile photo into the user profile
if backend.name == "facebook":
img_url = "http://graph.facebook.com/{0}/picture".format(
response['id'])
# Query the userprofi... | andela-ooshodi/django-photo-application | djangophotoapp/photoapp/pipeline.py | Python | gpl-2.0 | 441 |
from google.appengine.ext import db
from agent import Agent
import logging
class ManualPaOrder(db.Expando):
orderCreated = db.DateTimeProperty(auto_now_add = True)
orderIsGenerated = db.BooleanProperty(default=False)
orderOwner = db.StringProperty(default='')
orderPromoCode = db.StringPropert... | Kenneth-Posey/kens-old-projects | smokin-goldshop/models/manualpaorder.py | Python | gpl-2.0 | 980 |
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | Tigerwhit4/taiga-back | taiga/projects/signals.py | Python | agpl-3.0 | 4,418 |
"""SCons.Tool.dvips
Tool-specific initialization for dvips.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge... | dezelin/scons | scons-local/SCons/Tool/dvips.py | Python | mit | 3,441 |
# -*- coding: utf-8 -*-
#
# Copyright 2012 - 2013 Brian R. D'Urso
#
# This file is part of Python Instrument Control System, also known as Pythics.
#
# Pythics 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 Foundati... | dursobr/Pythics | pythics/examples/decay_simulator.py | Python | gpl-3.0 | 2,017 |
import json
import routing
from werkzeug.local import LocalProxy
from flask import Blueprint, request, current_app
blueprint = Blueprint('journal-api', __name__)
logging = LocalProxy(lambda: current_app.config['logging'])
@blueprint.errorhandler(404)
def return_404(e):
return {
'err': 'Page not found.'
},... | mrcrilly/Journal | journal/api.py | Python | mit | 1,370 |
import time
import meilisearch
from django.core.management.base import BaseCommand
from django.utils.functional import cached_property
from hav.apps.media.models import Media
from hav.apps.sets.models import Node
from ...client import get_client, get_index
from ...indexer.media import index as index_media
from ...in... | whav/hav | src/hav/apps/search/management/commands/build_fts_index.py | Python | gpl-3.0 | 2,972 |
"""
Generates list of current authors
Run the script in the main sympy repo.
Copy authors.tex in the tutorial repo.
"""
def generate_authors_list():
authors = []
with open('AUTHORS') as f:
for line in f:
if line.strip().endswith('>'):
aut = line.split('<')[0].strip() + '\\\... | leosartaj/scipy-2016-tutorial | slides/authors.py | Python | bsd-3-clause | 1,404 |
import operator
code = dict({})
occurence = dict({})
with open("input.txt") as textFile:
for line in textFile:
values = line.strip().split(' -> ')
code.update({values[1]:values[0]})
occurence.update({values[1]:0})
y = 0
def search(n):
global y
y+=1
if (y>(2**288+1000)):
return "HERE"
if n.isdigit():
... | marcolivierarsenault/AdventOfCode2015 | 7/firstTry.py | Python | mit | 1,185 |
# -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy Command Line Client}.
"""
import os
import sys
import argparse
from entropy.const import etpConst, const_isstring, \
const_convert_to_uni... | Sabayon/entropy | client/solo/commands/ugc.py | Python | gpl-2.0 | 32,703 |
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be u... | mulkieran/storage_alerts | tests/sources/journal/by_line/multipath_test.py | Python | gpl-2.0 | 9,851 |
#!/usr/bin/python2.7
# encoding: utf-8
import datetime
import subprocess
class C:
"""
Commandes chainées. Permet d'éxécuter une suite de commandes Unix à la suite les unes des
autres, journalisées dans un fichier texte dont le nom est défini dans le constructeur.
"""
def __init__(self, lo... | remipassmoilesel/python_scripts | monitoring/command.py | Python | gpl-3.0 | 1,953 |
"""Support for Climate devices of (EMEA/EU-based) Honeywell evohome systems."""
from datetime import datetime, timedelta
import logging
import requests.exceptions
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
STATE_AUTO, STATE_ECO, STATE_MANUAL, SU... | jnewland/home-assistant | homeassistant/components/evohome/climate.py | Python | apache-2.0 | 20,045 |
import os
import sys
import math
import logging
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import numpy as NP
import pandas as PD
from pyglow.pyglow import Point
from geomagio.StreamConverter import get_obs_from_geo, get_geo_from_obs
from obspy.core.stream import Stream
from obspy.core.utcdatet... | butala/pyrsss | pyrsss/mag/iaga2hdf.py | Python | mit | 10,261 |
"""Hello World API implemented using Google Cloud Endpoints.
Defined here are the ProtoRPC messages needed to define Schemas for methods
as well as those methods defined in an API.
"""
import endpoints
from protorpc import messages
from protorpc import message_types
from protorpc import remote
# TODO: Replace the ... | googlearchive/appengine-endpoints-helloendpoints-python | helloworld_api.py | Python | apache-2.0 | 3,160 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'PluginVersion.create_date'
db.add_column('developer_plugi... | bioinformatics-ua/montra | emif/developer/migrations/0005_auto__add_field_pluginversion_create_date__add_field_pluginversion_lat.py | Python | gpl-3.0 | 6,257 |
# -*- coding: utf-8 -*-
""" S3 Synchronization
@author: Dominic König <dominic[at]aidiq[dot]com>
@copyright: 2011-12 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (... | madhurauti/Map-Polygon | modules/s3/s3sync.py | Python | mit | 39,034 |
import codecs
from os import path
from setuptools import find_packages, setup
def read(*parts):
filename = path.join(path.dirname(__file__), *parts)
with codecs.open(filename, encoding="utf-8") as fp:
return fp.read()
setup(
author="",
author_email="",
description="",
name="pinax-{{... | rizumu/pinax-starter-app | setup.py | Python | mit | 1,127 |
"""
Given: An RNA string s of length at most 80 bp having the same number of occurrences of 'A' as 'U'
and the same number of occurrences of 'C' as 'G'.
Return: The total possible number of perfect matchings of basepair edges in the bonding graph of s.
"""
from collections import defaultdict
from math import factoria... | tsh/Rosalind-solutions-python | bioinformatics-stronghold/pmch-perfect_matchings_and_rna_secondary_structures.py | Python | gpl-3.0 | 712 |
from modeltranslation.translator import translator, TranslationOptions
from contact_form.models import Subject
class SubjectTranslationOptions(TranslationOptions):
fields = ('title', 'description')
fallback_languages = {'default': ('en',)}
translator.register(Subject, SubjectTranslationOptions)
| dlancer/django-crispy-contact-form | contact_form/translation.py | Python | bsd-3-clause | 308 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to convert an ICCD TRC file to CSV format.
The input file is assumed to be UTF-8 with UNIX line ending.
"""
#
# (C) Federico Leva, 2016
#
# Distributed under the terms of the MIT license.
#
__version__ = '0.1.0'
import codecs
import unicodecsv as csv
from collectio... | nemobis/bots | iccd-trc2csv.py | Python | gpl-3.0 | 4,621 |
############################################################################
##
## Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
## 2010, 2011 BalaBit IT Ltd, Budapest, Hungary
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General... | kkovaacs/zorp | pylib/Zorp/Auth.py | Python | gpl-2.0 | 40,127 |
# 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 the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | zrs233/ursula | plugins/callbacks/timestamp.py | Python | mit | 3,585 |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | meejah/AutobahnPython | examples/twisted/websocket/echo_service/setup.py | Python | mit | 1,892 |
#!/usr/bin/env python
import subprocess
import socket
import ssl
import sys
import time
if sys.version < '2.7':
print("WARNING: SSL not supported on Python 2.6")
exit(0)
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realp... | telefonicaid/fiware-IoTAgent-Cplusplus | third_party/mosquitto-1.4.4/test/broker/08-ssl-connect-cert-auth-revoked.py | Python | agpl-3.0 | 1,456 |
import datetime
from sheets import Registrant, Registrations
DATE_FORMAT = "%m/%d/%Y"
def test_rows_returns_registrants(registrations: Registrations, test_registrants):
"""rows() should return a list of Registrant objects"""
all_registrations = registrations.rows()
assert isinstance(all_registrations, l... | looker-open-source/sdk-examples | python/hackathon_app/tests/integration/test_registrations.py | Python | mit | 1,976 |
# -*- coding: utf-8 -*-
'''
bootstrap methods
.. codeauthor:: Hung-Hsin Chen <chenhh@par.cse.nsysu.edu.tw>
'''
import numpy as np
def _series_validation(series):
# validation
series = np.asarray(series)
if series.ndim == 1:
n_period = series.shape[0]
elif series.ndim == 2:
n_period =... | chrinide/PyFV | pyfv/sampling/bootstrap.py | Python | gpl-2.0 | 2,109 |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | onshape-public/onshape-clients | python/onshape_client/oas/models/callback.py | Python | mit | 4,774 |
import os
from distutils.core import setup
from distutils.extension import Extension
from Pyrex.Distutils import build_ext
kernel = "/lib/modules/" + os.uname()[2] + "/build/include"
incs = [kernel]
setup(
name="python-dvb3", version="0.0.4",
author="Paul Clifford", author_email="paul@clifford.cx",
licens... | sparkslabs/kamaelia_ | Sketches/MH/python-dvb3/setup.py | Python | apache-2.0 | 838 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | rackerlabs/horizon | openstack_dashboard/dashboards/admin/projects/urls.py | Python | apache-2.0 | 1,755 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-11-27 21:34
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mailinglist', '0010_auto_20161127_2134'),
]
operations = [
migrations.RemoveField(
... | joehalloran/fact-of-the-week | factoftheweek/mailinglist/migrations/0011_remove_mailcontact_delete_key.py | Python | gpl-3.0 | 404 |
# Generated by Django 3.0.7 on 2020-12-23 16:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('photos', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='photo',
name='star_rating',
... | damianmoore/photo-manager | photonix/photos/migrations/0002_crt_star_rating_fld.py | Python | agpl-3.0 | 442 |
#encoding:utf-8
"""
Control(es) la parte medular del proyecto, tiene como objetivo
determinar las incidencias de cada uno de los trabajadores re-
gistrados para llevar el control de sus asistencias.
Ver fundamento legal.
-> Condiciones Generales de Trabajo
->
"""
from datetime import datetime
from django.test import... | developerlbas/relabs | relabs/controles/tests.py | Python | mit | 5,669 |
'''
Created on Jan 30, 2014
@author: daniel
'''
class Word(object):
def __init__(self, id, lang, word):
self.__id = id
self.__lang = lang
self.__word = word
def __str__(self):
return "ID=" + str(self.id) + " Lang=" + self.lang + " Word=" + self.word
def get_id(self):
... | leyyin/university | fundamentals-of-programming/exam/exam-final/src/domain/word.py | Python | mit | 966 |
import sys
import os
import logging
import unittest
#logging.basicConfig(level=logging.DEBUG)
sys.path.insert(0, os.path.abspath("../"))
testsuite = unittest.TestLoader().discover(start_dir='.', pattern='test_*.py')
runner=unittest.TextTestRunner(verbosity=2).run(testsuite)
| ingwinlu/simpleMediaCenter | test/runtests.py | Python | gpl-2.0 | 278 |
import os
import tempfile
import unittest
from nose.tools import raises
from nose.tools import timed
from ansible import errors
from ansible.module_common import ModuleReplacer
from ansible.utils import checksum as utils_checksum
TEST_MODULE_DATA = """
from ansible.module_utils.basic import *
def get_module():
... | jody-frankowski/ansible | test/units/TestModuleUtilsBasic.py | Python | gpl-3.0 | 13,044 |
"""Base configuration of Parameter Calibration.
@author : Liangjun Zhu
@changelog:
- 18-01-20 - lj - initial implementation.
- 18-02-09 - lj - compatible with Python3.
"""
from __future__ import absolute_import, unicode_literals
from configparser import ConfigParser
import os
import sys
if os.pat... | lreis2415/SEIMS | seims/calibration/config.py | Python | gpl-3.0 | 3,223 |
#!/usr/bin/env python3
#
# PLASMA : Generate an indented asm code (pseudo-C) with colored syntax.
# Copyright (C) 2015 Joel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | chubbymaggie/reverse | plasma/lib/api.py | Python | gpl-3.0 | 23,979 |
#!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@license:
'''
SPELL=u'juéyīnshù'
CN=u'厥阴俞'
NAME=u'jueyinshu214'
CHANNEL='bladder'
CHANNEL_FULLNAME='BladderChannelofFoot-Taiyang'
SEQ='BL14'
if __name__ == '__main__':
pass
| sinotradition/meridian | meridian/acupoints/jueyinshu214.py | Python | apache-2.0 | 244 |
#!/usr/bin/env python
import os, resource, sys
import argparse
import networkx as nx
import numpy as np
import neurokernel.core_gpu as core
from neurokernel.pattern import Pattern
from neurokernel.tools.logging import setup_logger
from neurokernel.tools.timing import Timer
from neurokernel.LPU.LPU import LPU
import... | neurokernel/retina-lamina | examples/retlam_multiworker_demo/retlam_multiworker_demo.py | Python | bsd-3-clause | 11,965 |
# -*- coding: utf-8 -*-
#
""" Chargeback reports are supported for all infra and cloud providers.
Chargeback reports report costs based on 1)resource usage, 2)resource allocation
Costs are reported for the usage of the following resources by VMs:
memory, cpu, network io, disk io, storage.
Costs are reported for the al... | lkhomenk/integration_tests | cfme/tests/intelligence/reports/test_validate_chargeback_report.py | Python | gpl-2.0 | 27,748 |
#!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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... | liosha2007/temporary-groupdocs-python3-sdk | groupdocs/models/StorageProviderInfo.py | Python | apache-2.0 | 1,455 |
import numpy as np
from sklearn import cross_validation
from sklearn import svm
from sklearn.svm import LinearSVC
from sklearn.datasets import load_svmlight_file
from sklearn.pipeline import make_pipeline
from sklearn.feature_selection import SelectFromModel
from sklearn.feature_selection import RFE
from sklearn.cross_... | narendrameena/featuerSelectionAssignment | crossValidation.py | Python | cc0-1.0 | 3,370 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Provides the web interface for adding and editing stored configs."""
from __future__ import print_function
from __future__ import division
from __future__... | catapult-project/catapult | dashboard/dashboard/edit_site_config.py | Python | bsd-3-clause | 5,181 |
"""Implements Hardware Models CRUD in UI"""
from robottelo.ui.base import Base, UINoSuchElementError
from robottelo.ui.locators import common_locators, locators
from robottelo.ui.navigator import Navigator
class HardwareModel(Base):
"""Provides the CRUD functionality for Hardware-Models."""
def create(self,... | abalakh/robottelo | robottelo/ui/hardwaremodel.py | Python | gpl-3.0 | 2,739 |
from urlparse import urlparse, parse_qs
from pyLibrary.dot import Null, coalesce, wrap
from pyLibrary.dot.dicts import Dict
_convert = None
_Log = None
def _late_import():
global _convert
global _Log
from pyLibrary import convert as _convert
from pyLibrary.debugs.logs import Log as _Log
_ = _con... | mozilla/ChangeDetector | pyLibrary/parsers.py | Python | mpl-2.0 | 3,025 |
'''
Created on 09.12.2015
@author: fabian
'''
import abc
import os
import pyvcsshark.utils
class BaseStore(metaclass=abc.ABCMeta):
"""
Abstract class for the datastores. One must inherit from this class and implement
the methods to create a new datastore.
Based on pythons abc: :py:mod:`abc`
... | smartshark/vcsSHARK | pyvcsshark/datastores/basestore.py | Python | apache-2.0 | 3,133 |
import unittest
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import spectra_cluster.ui.mgf_search_result_annotator as mgf_search_result_annotator
class XTandemImportTest(unittest.TestCase):
def setUp(self):
self.testfile = os.path.join(os.path.dirname(__file__), "testfiles", "test_xtand... | spectra-cluster/spectra-cluster-py | tests/test_xtandem_import.py | Python | apache-2.0 | 938 |
from tqdm import tqdm
import lzma
import myio.myio as myio
import sys
index = int(sys.argv[1])
table = myio.load_pickle("tmp/recipe_table")
recipes = table.get_recipes()
recipe = recipes[index]
ingredients = recipe.get_ingredients_list()
text = recipe.get_text()
print("Ingredients: " + str(ingredients))
print("Recipe ... | MaxStrange/swedish_chef | check.py | Python | apache-2.0 | 1,069 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.core.files.storage import default_storage
from django.db import migrations
from temba.assets.models import AssetType
def migrate_export_tasks(apps, schema_editor):
task_model = apps.get_model('flows', 'ExportFlowResultsTask')
... | reyrodrigues/EU-SMS | temba/flows/migrations/0016_reorganize_exports.py | Python | agpl-3.0 | 1,539 |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
'''
Created on 26 juil. 2013
@author: Aristote Diasonama
'''
from google.appengine.ext import ndb
from operator import attrgetter
class Attendance(ndb.Model):
"""
Class modeling an attendance.
"""
attendee = ndb.KeyProperty(required=True)
status = ... | EventBuck/EventBuck | shop/models/attendance.py | Python | mit | 636 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
import numbers
from datetime import date, datetime, time, timedelta, tzinfo as tzinfo_class
from fractions import Fraction
from _common import (MICROSECONDS_IN_SECOND, MICROSECONDS_IN_MINUTE,
MICROSECONDS_IN_HOUR, MICROSECO... | amyodov/python-datetimeex | datetimeex/_timeex.py | Python | bsd-3-clause | 7,651 |
# Copyright 2001-2012 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | teeple/pns_server | work/install/Python-2.7.4/Lib/logging/__init__.py | Python | gpl-2.0 | 60,276 |
# Copyright (c) 2015 OpenStack Foundation
#
# 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 ... | ekcs/congress | congress/tests/api/test_driver_model.py | Python | apache-2.0 | 3,604 |
# -*- coding: utf-8 -*-
# Copyright (c) 2007 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the Subversion configuration page.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import pyqtSlot
from Preferences.ConfigurationPages.ConfigurationPageBase import \
Configura... | testmana2/test | Plugins/VcsPlugins/vcsPySvn/ConfigurationPage/SubversionPage.py | Python | gpl-3.0 | 1,959 |
import random
import ini
import var
import irc
from tools import is_identified, is_number
from tools import trim, nsfw_check
# Action strings lists.
add_strings = [
"-a", "-add", "--add",
"-s", "-set", "--set"
]
del_strings = [
"-rm", "-remove", "--remove",
"-del", "-delete", "--delete"
]
rep_strings = [
"-re",... | skewerr/deskbot | modules/urldb.py | Python | bsd-3-clause | 11,852 |
# 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
# distributed under th... | openstack/nova | nova/db/main/migrations/env.py | Python | apache-2.0 | 4,189 |
"""gunicorn WSGI server configuration."""
# Based on https://github.com/rdegges/django-skel/blob/master/gunicorn.py.ini.
import os
from multiprocessing import cpu_count
def max_workers():
return cpu_count()
bind = '0.0.0.0:' + os.environ.get('PORT', '8000')
max_requests = 1000
worker_class = 'gevent'
workers =... | PrecisionMojo/pm-www | www/settings/gunicorn.py | Python | mit | 335 |
# wspy_libws.py
#
# $Id: wspy_libws.py 39647 2011-10-28 06:18:59Z etxrab $
#
# Wireshark Protocol Python Binding
#
# Copyright (c) 2009 by Sebastien Tandel <sebastien [AT] tandel [dot] be>
# Copyright (c) 2001 by Gerald Combs <gerald@wireshark.org>
#
# This program is free software; you can redistribute it and/or
# mod... | Abhi9k/wireshark-dissector | epan/wspython/wspy_libws.py | Python | gpl-2.0 | 1,919 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-09 17:21
from __future__ import unicode_literals
import enum
from moneyed import Money
from django.db import migrations, models
class TrxType(enum.Enum):
INCOMING = 0
OUTGOING = 1
class TrxStatus(enum.Enum):
PENDING = 0
FINALIZED = 1
... | uppsaladatavetare/foobar-api | src/wallet/migrations/0004_auto_20160309_1721.py | Python | mit | 1,294 |
# -*- coding: utf-8 -*-
"""
This module provides the neccessary defintions for VSGDemo's shared settings.
"""
import os
class VSGDemoSettings(object):
"""
VSGDemoSettings provides a class for all static settings values in vsgendemo.vsgen.
"""
# Directory Information
LocalDir = os.path.dirname(os.p... | dbarsam/python-vsgen | tests/data/vsgendemo/settings.py | Python | mit | 716 |
# Copyright (C) 2015 Mouloud AIT-KACI
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Th... | plasmak/kar3a-jwt | kar3a/__init__.py | Python | gpl-3.0 | 1,048 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Instance.uuid'
db.alter_column('odk_logger_instance', 'uuid', self.gf('django.db.models.... | SEL-Columbia/formhub | odk_logger/migrations/0020_auto__chg_field_instance_uuid.py | Python | bsd-2-clause | 8,325 |
#!/usr/bin/env python3
print("Hello, world!")
| angus/demonstrations | demo-hello-world.py | Python | gpl-2.0 | 46 |
import os
import csv
import urllib
from urlparse import urlparse
def get_raw_urls(csv_file):
raw_urls = [ ]
with open(csv_file, 'rb') as link_file:
content = csv.reader(link_file)
for link in content:
if len(link) != 0:
raw_urls.append(link[0])
return raw_urls
d... | Eshavish/TwitterAPIwithZip | python_scripts/image_crawler.py | Python | mit | 1,160 |
# -*- coding: utf-8 -*-
'''For running command line executables with a timeout'''
from __future__ import absolute_import
import subprocess
import threading
import salt.exceptions
from salt.ext import six
class TimedProc(object):
'''
Create a TimedProc object, calls subprocess.Popen with passed args and **kwa... | smallyear/linuxLearn | salt/salt/utils/timed_subprocess.py | Python | apache-2.0 | 2,509 |
#!/usr/bin/env python
from __future__ import absolute_import, print_function
import json
import optparse
import sys
import time
from . import DecodeError, __package__, __version__, decode, encode
def main():
usage = '''Encodes or decodes JSON Web Tokens based on input.
%prog [options] input
Decoding examp... | argeweb/start | argeweb/libs/jwt/__main__.py | Python | mit | 3,448 |
"""
============
pysillywalks
============
This is an example project for learning about git and python.
**It is very silly**
Installation
============
Use the standard ``python setup.py install``
Quick Usage
===========
The constructor expects the following keyword arguments:
- **walk**: A string of the wa... | mrallen1/pysillywalks | setup.py | Python | mit | 2,396 |
# coding=utf-8
# This file is part of SickRage.
#
# URL: https://sickrage.github.io
# Git: https://github.com/SickRage/SickRage.git
#
# SickRage 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... | Maximilian-Reuter/SickRage-1 | sickrage/providers/GenericProvider.py | Python | gpl-3.0 | 23,100 |
# -*- coding: utf-8 -*-
from openerp import api, fields, models
from openerp.addons.bus.models.bus_presence import AWAY_TIMER
from openerp.addons.bus.models.bus_presence import DISCONNECTION_TIMER
class ResPartner(models.Model):
_inherit = 'res.partner'
im_status = fields.Char('IM Status', compute='_compute... | laslabs/odoo | addons/bus/models/res_partner.py | Python | agpl-3.0 | 2,885 |
import sys
from os.path import join, abspath, dirname
# PATH vars
here = lambda *x: join(abspath(dirname(__file__)), *x)
PROJECT_ROOT = here("..")
root = lambda *x: join(abspath(PROJECT_ROOT), *x)
sys.path.insert(0, root('apps'))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = ()
MANAGERS = ADMINS
DATABASES = {
... | nemesisdesign/django-foss-dashboard | django-foss-dashboard/settings/base.py | Python | bsd-3-clause | 4,885 |
#!/usr/bin/env python3
#
# Copyright (c) 2017 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import argparse
import struct
import sys
import os
from elftools.elf.elffile import ELFFile
from elftools.elf.sections import SymbolTableSection
ISR_FLAG_DIRECT = (1 << 0)
# The below few hardware independent magi... | punitvara/zephyr | arch/common/gen_isr_tables.py | Python | apache-2.0 | 10,217 |
from autofocus import AFSession, AutoFocusException, AutoFocusAPI
# AutoFocusAPI.api_key = "<my API key>"
######################################################
# Look for email session data for the Rodecap sample #
######################################################
query = """
{
"operator":"all",
"childr... | PaloAltoNetworks-BD/autofocus-client-library | examples/session_searching.py | Python | isc | 1,074 |
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from aws import Action
service_name = 'AWS Elastic Beanstalk'
prefix = 'elasticbeanstalk'
CheckDNSAvailability = Action(prefix, 'CheckDNSAvailability')
CreateApplication = Action(prefix, 'CreateApplicat... | craigbruce/awacs | awacs/elasticbeanstalk.py | Python | bsd-2-clause | 2,208 |
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import optparse
import sys
import os
import re
import StringIO
from tvcm import js_utils
from tvcm import module as module_module
from tvc... | bpsinc-native/src_third_party_trace-viewer | third_party/tvcm/tvcm/generate.py | Python | bsd-3-clause | 4,797 |
# -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP
#
# 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 limi... | andreadean5/python-hpOneView | hpOneView/resources/storage/storage_volume_attachments.py | Python | mit | 6,229 |
from __future__ import unicode_literals
from ..conversions import *
from ..func_utils import *
def Number(this, args):
if len(args) == 0:
return 0.
return to_number(args[0])
def NumberConstructor(args, space):
temp = space.NewObject()
temp.prototype = space.NumberPrototype
temp.Class = ... | alfa-jor/addon | plugin.video.alfa/lib/js2py/internals/constructors/jsnumber.py | Python | gpl-3.0 | 591 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
try:
from django.conf import settings
User = settings.AUTH_USER_MODEL
except (ImportError, AttributeError):
from django.contrib.auth.models import User
try:
f... | angvp/django-changuito | changuito/models.py | Python | lgpl-3.0 | 4,000 |
#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | wbchen99/bitcoin-hnote0 | contrib/spendfrom/spendfrom.py | Python | mit | 10,047 |
from radical.ensemblemd import Kernel
from radical.ensemblemd import Pipeline
from radical.ensemblemd import EnsemblemdError
from radical.ensemblemd import SingleClusterEnvironment
#Used to register user defined kernels
from radical.ensemblemd.engine import get_engine
#Import our new kernel
from new_kernel import MyU... | radical-cybertools/ExTASY | doc/scripts/user_script.py | Python | mit | 1,886 |
import h2o
from h2o.expr import ExprNode
from tests import pyunit_utils
def pubdev_5180():
frame = h2o.create_frame(binary_fraction=1, binary_ones_fraction=0.5, missing_fraction=0, rows=1, cols=1)
exp_str = ExprNode("assign", 123456789123456789123456789, frame)._get_ast_str()
assert exp_str.find('123456... | h2oai/h2o-3 | h2o-py/tests/testdir_jira/pyunit_pubdev_5180.py | Python | apache-2.0 | 440 |
# -*- coding: utf-8 -*-
"""
debug.py - Functions to aid in debugging
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
"""
import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile
import ptime
from numpy import ndarray
from PyQt4 import QtCore, Qt... | WeCase/WeCase | utils/debug.py | Python | gpl-3.0 | 29,079 |
# Copyright (c) 2014 Kontron Europe GmbH
#
# 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 later version.
#
# This library is... | kontron/python-ipmi | pyipmi/sdr.py | Python | lgpl-2.1 | 22,865 |
try:
set
except NameError:
from sets import Set as set
from django.core.paginator import Paginator, Page, InvalidPage
from django.db.models import F
from django.http import Http404
from coffin import template
from jinja2 import nodes
from jinja2.ext import Extension
from jinja2.exceptions import TemplateSynta... | pterk/django-tcc | tcc/templatetags/autopaginator.py | Python | mit | 9,909 |
import json
from twisted.internet import defer
from cyclone import web
from oonib.test.handler_helpers import HandlerTestCase
from oonib.main.api import mainAPI
class GlobalHandler(HandlerTestCase):
app = web.Application(mainAPI, name='mainAPI')
@defer.inlineCallbacks
def test_global_handler(self):
... | dstufft/ooni-backend | oonib/test/test_global_handler.py | Python | bsd-2-clause | 488 |
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | CeltonMcGrath/TACTIC | src/tactic/ui/panel/manage_view_panel_wdg.py | Python | epl-1.0 | 56,034 |
# -*- coding: utf-8 -*-
from ckan.controllers.user import UserController
import ckanext.accessrequests.utils as utils
class AccessRequestsController(UserController):
def request_account(self, data=None, errors=None, error_summary=None):
"""GET to display a form for requesting a user account or POST the
... | DataShades/ckanext-accessrequests | ckanext/accessrequests/controller.py | Python | agpl-3.0 | 734 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.