text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet._sigchld}, an alternate, superior SIGCHLD
monitoring API.
"""
import os, signal, errno
from twisted.python.log import msg
from twisted.trial.unittest import TestCase
from twisted.internet.fdesc import setNonBlock... | waseem18/oh-mainline | vendor/packages/twisted/twisted/internet/test/test_sigchld.py | Python | agpl-3.0 | 6,400 | 0.002344 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | rwl/PyCIM | CIM15/IEC61970/Generation/Production/FossilFuel.py | Python | mit | 7,612 | 0.004992 |
# A Test Program for pipeTestService.py
#
# Install and start the Pipe Test service, then run this test
# either from the same machine, or from another using the "-s" param.
#
# Eg: pipeTestServiceClient.py -s server_name Hi There
# Should work.
from win32pipe import *
from win32file import *
from win32event import *
... | sserrot/champion_relationships | venv/Lib/site-packages/win32/Demos/service/pipeTestServiceClient.py | Python | mit | 4,134 | 0.008224 |
class Config:
# specific (for this development instance)
# SERVER_NAME = 'localhost:5000'
SQLALCHEMY_DATABASE_URI = "sqlite:///data.db"
ANTIVIRUS_CHECK_REQUIRED = False
SECRET_KEY = "toto"
# develop settings
DEBUG = True
ASSETS_DEBUG = True
DEBUG_TB_ENABLED = True
# TEMPLATE_DEB... | abilian/abilian-core | demo/config.py | Python | lgpl-2.1 | 1,105 | 0 |
#!/usr/bin/env python
import functools
import itertools
import contextlib
import weakref
import logging
l = logging.getLogger("angr.sim_state")
import claripy
import ana
from archinfo import arch_from_id
from .misc.ux import deprecated
def arch_overrideable(f):
@functools.wraps(f)
def wrapped_f(self, *args,... | f-prettyland/angr | angr/sim_state.py | Python | bsd-2-clause | 30,608 | 0.003921 |
########## recombination.py parameters
class Recombination_Parameters(object):
# Change these two values to the folders you prefer - use an absolute path e.g. /Users/Harry/fastq-data and
# /Users/Harry/csv-data or a path relative to the tools directory.
# You may use the same folder for input and output.
... | addgene/research | toolkit/parameters.py | Python | gpl-3.0 | 2,405 | 0.003742 |
# Copyright 2017 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... | frreiss/tensorflow-fred | tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py | Python | apache-2.0 | 16,160 | 0.008168 |
#!/usr/bin/env python3
# 574A_bear.py - Codeforces.com/problemset/problem/574/A Bear program by Sergey 2015
import unittest
import sys
###############################################################################
# Bear Class
###############################################################################
class Be... | snsokolov/contests | codeforces/574A_bear.py | Python | unlicense | 2,847 | 0.000702 |
#!/usr/bin/python -O
#
# /usr/sbin/webapp-config
# Python script for managing the deployment of web-based
# applications
#
# Originally written for the Gentoo Linux distribution
#
# Copyright (c) 1999-2007 Authors
# Released under v2 of the GNU GPL
#
# Author(s) Stuart Herbert
# ... | gentoo/webapp-config | WebappConfig/ebuild.py | Python | gpl-2.0 | 6,937 | 0.010379 |
##################################################################
# Code for testing the variational Multi-Stage Generative Model. #
##################################################################
# basic python
import numpy as np
import numpy.random as npr
import cPickle
# theano business
import theano
import th... | capybaralet/Sequential-Generation | TestImpGPSI_MNIST.py | Python | mit | 18,331 | 0.004582 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-12-09 01:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("hordak", "0007_auto_20161209_0111")]
operations = [
migrations.RenameField("Account", "has_state... | adamcharnock/django-hordak | hordak/migrations/0008_auto_20161209_0129.py | Python | mit | 353 | 0 |
#!/usr/bin/python
''' Python API for YouTube
Copyright (C) 2013 nagev
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 la... | sadolit/pafy | pafy.py | Python | gpl-3.0 | 8,660 | 0.000577 |
"""
Markup class allows the use of easy-to-write characters to style the text
instead of using escape codes.
==text== --> reverse video
'''text''' --> bold
~~text~~ --> strikethrough
Copyright (c) 2015
makos <https://github.com/makos>, chibi <http://neetco.de/chibi>
under GNU GPL v3, see LICENSE for details
"""
impo... | makos/sshchan-oop | chan_mark.py | Python | gpl-3.0 | 1,058 | 0.004726 |
from django.utils.six.moves.builtins import str
#
# django-atompub by James Tauber <http://jtauber.com/>
# http://code.google.com/p/django-atompub/
# An implementation of the Atom format and protocol for Django
#
# For instructions on how to use this module to generate Atom feeds,
# see http://code.google.com/p/django-... | nharsch/django-scheduler | schedule/feeds/atom.py | Python | bsd-3-clause | 22,525 | 0.002042 |
# Copyright (C) 2016
# Jakub Krajniak (jkrajniak at gmail.com)
#
# This file is part of ChemLab
#
# ESPResSo++ 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
# (... | cgchemlab/chemlab | src/tests/test_topology_reader.py | Python | gpl-3.0 | 2,938 | 0.003744 |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | samn/spectral-workbench | webserver/public/lib/bespin-0.9a2/lib/dryice/path.py | Python | gpl-3.0 | 33,721 | 0.000919 |
# Copyright 2014-2015 Rumma & Ko Ltd
#
# License: GNU Affero General Public License v3 (see file COPYING for details)
"""Defines "parency links" between two "persons", and a user interface
to manage them.
This module is probably useful in combination with
:mod:`lino_xl.lib.households`.
.. autosummary::
:toctree:
... | lino-framework/xl | lino_xl/lib/humanlinks/__init__.py | Python | bsd-2-clause | 1,211 | 0.004129 |
from investor_lifespan_model.investor import Investor
from investor_lifespan_model.market import Market
from investor_lifespan_model.insurer import Insurer
from investor_lifespan_model.lifespan_model import LifespanModel
from investor_lifespan_model.mortality_data import π, G, tf
| moehle/investor_lifespan_model | investor_lifespan_model/__init__.py | Python | mit | 282 | 0 |
RegObj.dll is an ActiveX server--and, hence, has an automation interface--that is available with documentation in
the distribution file known as RegObji.exe, from the following page:
http://msdn.microsoft.com/vbasic/downloads/addins.asp
To provide early binding for RegObj use
>>> from win32com.client impo... | ActiveState/code | recipes/Python/137551_Using_RegObj_Automatiaccess_MSW/recipe-137551.py | Python | mit | 1,024 | 0.03125 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH (<http://www.camptocamp.at>)
#
# Thi... | VitalPet/c2c-rd-addons | hr_timesheet_product/__openerp__.py | Python | agpl-3.0 | 1,555 | 0.020579 |
from django.core.management.base import BaseCommand, CommandError
from geography.models import Place
class Command(BaseCommand):
help = u"""Add new places"""
usage_str = 'USAGE: ./manage.py add_places map_name STATE|CITY|RIVER|LAKE|... [difficulty]'
def handle(self, *args, **options):
if len(args... | slaweet/autoskola | main/geography/management/commands/add_places.py | Python | mit | 985 | 0.00203 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_nyt', '0006_auto_20141229_1630'),
('wiki', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ArticleSubscription',
fields=[
... | floemker/django-wiki | src/wiki/plugins/notifications/migrations/0001_initial.py | Python | gpl-3.0 | 881 | 0.00227 |
"""
Support for Vera cover - curtains, rollershutters etc.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.vera/
"""
import logging
from homeassistant.components.cover import CoverDevice
from homeassistant.components.vera import (
VeraDevice, V... | Smart-Torvy/torvy-home-assistant | homeassistant/components/cover/vera.py | Python | mit | 1,970 | 0 |
# -*- coding: utf-8 -*-
"""
@file costMemory.py
@author Jakob Erdmann
@author Michael Behrisch
@date 2012-03-14
@version $Id: costMemory.py 22608 2017-01-17 06:28:54Z behrisch $
Perform smoothing of edge costs across successive iterations of duaIterate
SUMO, Simulation of Urban MObility; see http://sumo.dlr.d... | 702nADOS/sumo | tools/assign/costMemory.py | Python | gpl-3.0 | 7,283 | 0.00151 |
#<ImportSpecificModules>
import ShareYourSystem as SYS
#</ImportSpecificModules>
#print(SYS.SumClass().insert('Parameter').hdfview().HdformatedConsoleStr)
#print(SYS.SumClass().insert('Result').hdfview().HdformatedConsoleStr)
#print(SYS.Sum.attest_insert())
#print(SYS.Sum.attest_retrieve())
#print(SYS.Sum.attest_find(... | Ledoux/ShareYourSystem | Pythonlogy/ShareYourSystem/Standards/Tutorials/Sumer/Test.py | Python | mit | 388 | 0.025773 |
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2012 The Chromium OS Authors.
#
"""Tests for the dtb_platdata module
This includes unit tests for some functions and functional tests for the dtoc
tool.
"""
import collections
import os
import struct
import sys
import tempfile
import unittest... | Digilent/u-boot-digilent | tools/dtoc/test_dtoc.py | Python | gpl-2.0 | 28,025 | 0.000178 |
import codecs
import mock
import os
import tempfile
import unittest
from time import strftime
import six
from kinto import config
from kinto import __version__
class ConfigTest(unittest.TestCase):
def test_transpose_parameters_into_template(self):
self.maxDiff = None
template = "kinto.tpl"
... | monikagrabowska/osf.io | kinto/tests/test_config.py | Python | apache-2.0 | 6,371 | 0 |
def max_rectangle(heights):
res = 0
heights.append(0)
stack = [0]
for i in range(1, len(heights)):
while stack and heights[i] < heights[stack[-1]]:
h = heights[stack.pop()]
w = i if not stack else i - stack[-1] - 1
res = max(res, h * w)
stack.append(i... | shenfei/oj_codes | leetcode/python/n85_Maximal_Rectangle.py | Python | mit | 1,123 | 0.001781 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2017:
# Frederic Mohier, frederic.mohier@alignak.net
#
"""
Alignak - Checks pack for NRPE monitored Linux hosts/services
"""
| Alignak-monitoring-contrib/alignak-checks-nrpe | alignak_checks_nrpe/__init__.py | Python | agpl-3.0 | 200 | 0 |
from sqlagg.columns import SimpleColumn
from sqlagg.filters import BETWEEN, IN, EQ
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
from corehq.apps.reports.sqlreport import SqlData, DataFormatter, TableDataFormat, DatabaseColumn
from custom.tdh.reports import UNNECESSARY_FIELDS, CHILD_HEAD... | puttarajubr/commcare-hq | custom/tdh/sqldata.py | Python | bsd-3-clause | 25,506 | 0.004822 |
import numpy as np
import copy
import datetime as dt
import QSTK.qstkutil.qsdateutil as du
import QSTK.qstkutil.DataAccess as da
import QSTK.qstkstudy.EventProfiler as ep
from bollinger import Bollinger
"""
Accepts a list of symbols along with start and end date
Returns the Event Matrix which is a pandas Datamatrix
E... | RoyNexus/python | homework6.py | Python | unlicense | 3,193 | 0.003758 |
# This file is part of pybliographer
#
# Copyright (C) 1998-2004 Frederic GOBRY
# Email : gobry@pybliographer.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of t... | matthew-brett/pyblio | Pyblio/Style/Generic.py | Python | gpl-2.0 | 5,843 | 0.023105 |
from PyQt5 import QtCore, QtWidgets
from ngspiceSimulation.pythonPlotting import plotWindow
from ngspiceSimulation.NgspiceWidget import NgspiceWidget
from configuration.Appconfig import Appconfig
from modelEditor.ModelEditor import ModelEditorclass
from subcircuit.Subcircuit import Subcircuit
from maker.makerchip impor... | FOSSEE/eSim | src/frontEnd/DockArea.py | Python | gpl-3.0 | 13,847 | 0 |
# coding=utf-8
"""Clip and mask a hazard layer."""
import logging
from qgis.core import (
QgsGeometry,
QgsFeatureRequest,
QgsWkbTypes,
QgsFeature,
)
from safe.definitions.fields import hazard_class_field, aggregation_id_field
from safe.definitions.hazard_classifications import not_exposed_class
from... | ismailsunni/inasafe | safe/gis/vector/union.py | Python | gpl-3.0 | 12,362 | 0 |
import os
import glob
import subprocess
def expand_path(path):
return os.path.abspath(os.path.expandvars(os.path.expanduser(path)))
def is_file(path):
if not path:
return False
if not os.path.isfile(path):
return False
return True
def arg_is_file(path):
try:
if not is_file(path):
raise
... | cwlinkem/linkuce | modeltest_runner.py | Python | gpl-2.0 | 2,993 | 0.033077 |
# coding=utf-8
import random
lista = []
for x in range(10):
numero = random.randint(1, 100)
if x == 0:
maior, menor = numero, numero
elif numero > maior:
maior = numero
elif numero < menor:
menor = numero
lista.append(numero)
lista.sort()
print(lista)
print("Maior: %d" % maio... | renebentes/Python4Zumbis | Exercícios/Lista IV/questao01.py | Python | mit | 350 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-04-26 12:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('codenerix_products', '0011_auto_20180202_0826'),
]
operations = [
migration... | centrologic/django-codenerix-products | codenerix_products/migrations/0012_productunique_caducity.py | Python | apache-2.0 | 516 | 0.001938 |
#!/usr/bin/env python
# Copyright (c) 2014 Cloudera, Inc. All rights reserved.
#
# This script provides help with parsing and reporting of perf results. It currently
# provides three main capabilities:
# 1) Printing perf results to console in 'pretty' format
# 2) Comparing two perf result sets together and displaying c... | gistic/PublicSpatialImpala | tests/benchmark/report-benchmark-results.py | Python | apache-2.0 | 35,471 | 0.013307 |
# Copyright 2017 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... | mdrumond/tensorflow | tensorflow/contrib/eager/python/network_test.py | Python | apache-2.0 | 3,454 | 0.002606 |
from datetime import timedelta
from requests.auth import HTTPBasicAuth
from django.core.exceptions import ValidationError
from django.utils import timezone
from django.core.cache import cache
from ..settings import (
WFRS_GATEWAY_COMPANY_ID,
WFRS_GATEWAY_ENTITY_ID,
WFRS_GATEWAY_API_HOST,
WFRS_GATEWAY_CO... | thelabnyc/django-oscar-wfrs | src/wellsfargo/connector/client.py | Python | isc | 6,228 | 0.000963 |
import pandas as pd
from pandas import DataFrame
from matplotlib import pyplot as plt
from matplotlib import style
style.use('ggplot')
df = pd.read_csv('sp500_ohlc.csv', index_col = 'Date', parse_dates=True)
#print df.head()
df['STD'] = pd.rolling_std(df['Close'], 25, min_periods=1)
ax1 = plt.subplot(2, 1, 1)
df[... | PythonProgramming/Pandas-Basics-with-2.7 | pandas 8 - Standard Deviation.py | Python | mit | 486 | 0.010288 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ProcessingPlugin.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**********************... | camptocamp/QGIS | python/plugins/processing/ProcessingPlugin.py | Python | gpl-2.0 | 5,606 | 0.004281 |
from django.contrib import admin
import models
# Register your models here.
admin.site.register(models.UserProfile)
admin.site.register(models.Event)
| zhaogaolong/oneFinger | alarm/admin.py | Python | apache-2.0 | 150 | 0 |
#!/usr/bin/python
import sys
import pyxbackup as pxb
import pytest
def test__parse_port_param():
assert(pxb._parse_port_param('27017,27019')) == True
assert(pxb.xb_opt_remote_nc_port_min) == 27017
assert(pxb.xb_opt_remote_nc_port_max) == 27019
assert(pxb._parse_port_param('27017, 27019')) == True
... | dotmanila/pyxbackup | tests/all_test.py | Python | gpl-2.0 | 835 | 0.019162 |
# 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 the... | sileht/pifpaf | pifpaf/drivers/ceph.py | Python | apache-2.0 | 5,134 | 0 |
#!/usr/bin/env python3
# ReText
# Copyright 2011-2012 Dmitry Shachnev
# 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 version.
... | codemedic/retext | retext.py | Python | gpl-3.0 | 1,988 | 0.017606 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | SKIRT/PTS | modeling/build/construct.py | Python | agpl-3.0 | 25,266 | 0.00661 |
# -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import unicode_literals, absolute_import
import json
import logging
from modules.oauthlib import common
from modules.oauthlib.uri_validate import is_absolute_uri
from .base import GrantTypeBase
fr... | insiderr/insiderr-app | app/modules/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py | Python | gpl-3.0 | 19,942 | 0.001254 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 24 11:30:24 2013
@author: Sat Kumar Tomer
@email: satkumartomer@gmail.com
@website: www.ambhas.com
"""
import numpy as np
import h5py
import os
import datetime as dt
def extract_smc(h5_file, lat, lon):
"""
Extract Soil Moisture Content fro... | andreas-koukorinis/ambhas | ambhas/amsr2.py | Python | lgpl-2.1 | 3,408 | 0.010857 |
# Copyright 2016, IBM US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | open-power-ref-design/opsmgr | plugins/devices/powernode/opsmgr/plugins/devices/powernode/PowerNodePlugin.py | Python | apache-2.0 | 5,846 | 0.002737 |
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
TEST_ROOT = os.path.join(os.path.dirname(PROJECT_ROOT), "tests")
SINGLE_ORCA_RUN_FILE = os.path.join(PROJECT_ROOT, "code", "single_core_run_orca.py")
SINGLE_RUN_MOB_KMC_FILE = os.path.join(
PROJECT_ROOT, "code", "single_core_run_mob_KMC.py"
)
SING... | matty-jones/MorphCT | morphct/definitions.py | Python | gpl-3.0 | 419 | 0.002387 |
import math
import config
import utils
import packets
import logbot
import fops
import blocks
import behavior_tree as bt
from axisbox import AABB
log = logbot.getlogger("BOT_ENTITY")
class BotObject(object):
def __init__(self):
self.velocities = utils.Vector(0.0, 0.0, 0.0)
self.direction = ut... | lukleh/TwistedBot | twistedbot/botentity.py | Python | mit | 16,437 | 0.000973 |
import Decimal_pb2
import Log_pb2
import uRPC_pb2
import client
import server | npalko/uRPC | python/urpc/__init__.py | Python | bsd-3-clause | 78 | 0.012821 |
# 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/.
"""
Test cases for the TAAR Hybrid recommender
"""
from taar.recommenders.hybrid_recommender import CuratedRecommender
... | maurodoglio/taar | tests/test_hybrid_recommender.py | Python | mpl-2.0 | 3,508 | 0.000285 |
import unittest
import os
from flow.benchmarks.baselines.bottleneck0 import bottleneck0_baseline
from flow.benchmarks.baselines.bottleneck1 import bottleneck1_baseline
from flow.benchmarks.baselines.bottleneck2 import bottleneck2_baseline
from flow.benchmarks.baselines.figureeight012 import figure_eight_baseline
from ... | cathywu/flow | tests/slow_tests/test_baselines.py | Python | mit | 2,809 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('api', '0009_dummyprovider'),
]
o... | h2020-westlife-eu/VRE | api/migrations/0010_auto_20160121_1536.py | Python | mit | 4,758 | 0.002102 |
#Equals and hash
class Eq(object):
def __init__(self, data):
self.data = data
def __eq__(self, other):
return self.data == other.data
class Ne(object):
def __init__(self, data):
self.data = data
def __ne__(self, other):
return self.data != other.data
class Hash(obj... | github/codeql | python/ql/test/3/query-tests/Classes/equals-hash/equals_hash.py | Python | mit | 1,147 | 0.012206 |
# -*- coding: utf-8 -*-
# #
# #
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; ei... | pferreir/indico-backup | bin/utils/db_log.py | Python | gpl-3.0 | 5,979 | 0.004014 |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
import config
from install_package import InstallPackage
import os
import re
import shutil
import sys
import utils
BASENAME = "VTK"
GIT_REPO = "http://vtk.org/VTK.git"
GIT_TAG = "v5.8.0"
VTK_BASE_VERSION = "vtk-5.8"
# this... | nagyistoce/devide.johannes | install_packages/ip_vtk58.py | Python | bsd-3-clause | 9,776 | 0.004603 |
# Copyright 2015, 2018 IBM Corp.
#
# 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 require... | rahulunair/nova | nova/tests/unit/virt/powervm/test_mgmt.py | Python | apache-2.0 | 7,781 | 0 |
# This file is formatted with black.
# https://github.com/psf/black
import os
import json
import subprocess
import sys
import simplekml
ALT_MODE = simplekml.AltitudeMode.absolute # Absolute altitude means from sea floor
# Current commit
if os.environ.get("TRAVIS"):
COMMIT = os.environ["TRAVIS_COMMIT"]
else:
... | tomeshnet/node-list | ci/scripts/kml/main.py | Python | gpl-3.0 | 3,457 | 0.001736 |
#! /usr/bin/python
import sys, localconfig, platform, time
#OS Runtime comments
if platform.system() == "Windows":
sys.path.append(localconfig.winpath)
print "You are running the AnkitBot UAA Module for Windows. Sponsored by DQ. :)"
else:
sys.path.append(localconfig.linuxpath)
print "You... | QEDK/AnkitBot | UAA/UAA.py | Python | epl-1.0 | 680 | 0.010294 |
from unittest import TestCase
from django.template import Context, Template, VariableNode
from django.test import override_settings
class NodelistTest(TestCase):
def test_for(self):
template = Template('{% for i in 1 %}{{ a }}{% endfor %}')
vars = template.nodelist.get_nodes_by_type(VariableNode... | oscaro/django | tests/template_tests/test_nodelist.py | Python | bsd-3-clause | 2,315 | 0.00216 |
"""Test cases for STEREO Map subclasses.
This particular test file pertains to CORMap.
@Author: Pritish C. (VaticanCameos)
"""
import os
import glob
from sunpy.map.sources.stereo import CORMap
from sunpy.map import Map
import sunpy.data.test
path = sunpy.data.test.rootdir
fitspath = glob.glob(os.path.join(path, "cor... | Alex-Ian-Hamilton/sunpy | sunpy/map/sources/tests/test_cor_source.py | Python | bsd-2-clause | 977 | 0.004094 |
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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.... | Sodki/ansible | lib/ansible/plugins/filter/core.py | Python | gpl-3.0 | 17,081 | 0.003396 |
from sa_tools.base.magic import MagicMixin
from sa_tools.inbox import Inbox
from sa_tools.session import SASession
from sa_tools.index import Index
import os
import pickle
import sys
def py_ver() -> str:
return str(sys.version_info.major)
class APSession(object):
def __init__(self, username: str, passwd: s... | thismachinechills/awful.py | awful.py | Python | gpl-3.0 | 1,950 | 0.004103 |
# Authors: Aaron Qiu <zqiu@ulg.ac.be>,
# Antonio Sutera <a.sutera@ulg.ac.be>,
# Arnaud Joly <a.joly@ulg.ac.be>,
# Gilles Louppe <g.louppe@ulg.ac.be>,
# Vincent Francois <v.francois@ulg.ac.be>
#
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
... | orlandi/connectomicsPerspectivesPaper | participants_codes/aaagv/directivity.py | Python | mit | 2,853 | 0 |
# Copyright 2011 Kyriakos Zarifis
# Copyright 2008 (C) Nicira, Inc.
#
# This file is part of POX.
#
# POX 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) ... | lewischeng-ms/pox | pox/forwarding/l2_ofcommand_learning.py | Python | gpl-3.0 | 5,023 | 0.014334 |
import _plotly_utils.basevalidators
class DeltaValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="delta", parent_name="indicator", **kwargs):
super(DeltaValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/indicator/_delta.py | Python | mit | 1,527 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-11-06 11:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rdrf', '0081_clinicaldata_active'),
]
operations = [
migrations.AlterField(... | muccg/rdrf | rdrf/rdrf/migrations/0082_auto_20181106_1100.py | Python | agpl-3.0 | 461 | 0 |
import os
import chardet
from humanfriendly import format_size
import pygments
import pygments.lexers
import pygments.lexers.special
import pygments.formatters
from pygments.util import ClassNotFound
from mako.lookup import TemplateLookup
from mfr.core import extension
from mfr.extensions.codepygments import settings... | CenterForOpenScience/modular-file-renderer | mfr/extensions/codepygments/render.py | Python | apache-2.0 | 3,749 | 0.0008 |
import sys
from math import ceil
def main():
AREA = 1.76
w = float(input())
h = float(input())
print(ceil(w * h / AREA))
if __name__ == "__main__":
sys.exit(int(main() or 0)) | ttitto/python | Basics/SampleExam/MostCommonCharacter/paint_bottles.py | Python | mit | 196 | 0.015306 |
#!/usr/bin/env python
import json
import sys
import argparse
from clingo import Control, Number
class App:
def __init__(self, args):
self.control = Control()
self.args = args
self.horizon = 0
self.objects = 0
self.end = None
def show(self, model):
if not s... | potassco/clingo | examples/clingo/expansion/main.py | Python | mit | 3,702 | 0.006483 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | inspirehep/inspire-dojson | inspire_dojson/cds/__init__.py | Python | gpl-3.0 | 1,112 | 0 |
"""
Django settings for detest project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | tahpee/detest | detest/detest/settings.py | Python | mit | 2,968 | 0.000337 |
from application import CONFIG, app
from .models import *
from flask import current_app, session
from flask.ext.login import login_user, logout_user, current_user
from flask.ext.principal import Principal, Identity, AnonymousIdentity, identity_changed, identity_loaded, RoleNeed
import bcrypt
import re
import sendgrid
i... | hackBCA/missioncontrol | application/mod_user/controllers.py | Python | mit | 3,822 | 0.026688 |
from django.apps import AppConfig
class UserregistrationConfig(AppConfig):
name = 'userregistration'
| Emilv2/mandarinrecording | registration/apps.py | Python | agpl-3.0 | 107 | 0 |
import utils
from flask import render_template, redirect, request, session, url_for, json, jsonify
from . import murmurbp
from .User import User
# User Views
@murmurbp.route("/users", methods = ['GET'])
def get_all_users():
u = User()
ul = utils.obj_to_dict(u.get_all())
data = [{'UserId': k, 'UserName': v... | aqisnotliquid/minder2 | app/murmur/views.py | Python | mit | 2,492 | 0.014045 |
#
# This file is part of TSmells
#
# TSmells 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 version.
#
# TSmells is distributed in the hope ... | carvalhomb/tsmells | src/viz/gui/TDockable.py | Python | gpl-2.0 | 1,659 | 0.007836 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | TheTimmy/spack | var/spack/repos/builtin/packages/py-wrapt/package.py | Python | lgpl-2.1 | 1,546 | 0.000647 |
#encoding: utf-8
from __future__ import unicode_literals
TITLE_TO_SLUG = {
'איגוד הביטקוין': 'bitcoin-org-il',
'אליאב': 'eliav',
'* בדיקות פרודקשיין *': 'production-test',
'בי״ס עמית': 'amit',
'הבר קיימא': 'barkayma',
'הסדנא לידע ציבורי': 'hasadna',
'הפורום לממשל פתוח': 'open-government',
'התנועה לאיכות השלטון... | nonZero/OpenCommunity | src/communities/legacy_mapping.py | Python | bsd-3-clause | 574 | 0.002227 |
#!/usr/bin/env python2.7
import numpy as np
import matplotlib.pyplot as plt
Freq=np.array([30,40,45,50,53,55,60,65,70,80,90,95,98,100,110,120])
Db=np.array([70.5,78.6,83.2,88.4,87.5,86.7,85.2,83.9,85.1,88,95.7,100.4,100.4,99.2,94.7,94.9])
plt.xlabel('Frecuencia')
plt.ylabel('Decibel')
plt.title('DecibelvsFreq a 0.1vol... | P1R/cinves | TrabajoFinal/tubo350cm/2-DbvsFreq/tubo2huecos/DbvsFreq-Ampde0.1v-2huequitos.py | Python | apache-2.0 | 511 | 0.078278 |
#import os
import pickle
import glob
#import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
#from data_control_no_images.read import Read
listing = glob.glob('F:/Project_Cars_Data/1lap-fullspeed/Watkins Glen International - Short Circuit' + '/*.pkl')
x = []
y = []
throttle = []
raw_throttle = []
... | ThisIsSoSteve/Project-Tensorflow-Cars | plot_course_data.py | Python | mit | 2,616 | 0.006116 |
"""
Dec 10, 2015 Developed by Y.G.@CHX
yuzhang@bnl.gov
This module is for the necessary packages for the XPCS analysis
"""
from IPython.core.magics.display import Javascript
from skbeam.core.utils import multi_tau_lags
from skimage.draw import line_aa, line, polygon, ellipse, circle
from modest_image import Modes... | yugangzhang/chxanalys | chxanalys/chx_libs.py | Python | bsd-3-clause | 9,246 | 0.025741 |
#!/usr/bin/env python
import sys,re,time,argparse
def main(args):
# print >>sys.stdout, "Start analysis: " + time.strftime("%a,%d %b %Y %H:%M:%S")
convert(args.input,args.output)
# print >>sys.stdout, "Finish analysis: " + time.strftime("%a,%d %b %Y %H:%M:%S")
def extract_exon_length_from_cigar(cigar):
cigar_m = ["... | yunhaowang/IDP-APA | utilities/py_idpapa_sam2gpd.py | Python | apache-2.0 | 3,045 | 0.042365 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ecp.py part of cellery (ceRNAs linking inference)
#
# Copyright 2016 Oscar Bedoya Reina <obedoya@igmm-linux-005>
#
# 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
# th... | oscarcbr/cellery | cellery/ecp.py | Python | gpl-3.0 | 11,283 | 0.042808 |
#!/usr/bin/env python
"""
Copyright (c) 2019 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merg... | alexforencich/verilog-ethernet | tb/test_ptp_clock_cdc_64.py | Python | mit | 5,957 | 0.000671 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-19 06:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('condensed_urls', '0001_initial'),
]
operations = [
migrations.AddField(
... | ezarowny/url-condenser | url_condenser/condensed_urls/migrations/0002_condensedurl_visited_count.py | Python | mit | 456 | 0 |
# Copyright 2017 Huawei Technologies Co.,LTD.
# 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
#
# Unl... | openstack/nomad | cyborg/objects/base.py | Python | apache-2.0 | 6,515 | 0 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Nick Hall
#
# 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)... | pmghalvorsen/gramps_branch | gramps/gui/editors/edittaglist.py | Python | gpl-2.0 | 4,483 | 0.003792 |
from unittest import TestCase
import pandas as pd
import pandas.util.testing as tm
import numpy as np
import trtools.core.topper as topper
import imp
imp.reload(topper)
arr = np.random.randn(10000)
s = pd.Series(arr)
df = tm.makeDataFrame()
class TestTopper(TestCase):
def __init__(self, *args, **kwargs):
... | dalejung/trtools | trtools/core/tests/test_topper.py | Python | mit | 8,499 | 0.004118 |
from flask import render_template, redirect, request, url_for, flash
from flask_login import login_user, logout_user, login_required, \
current_user
from . import auth
from .. import db
from ..models import User
from ..email import send_email
from .forms import LoginForm, RegistrationForm, ChangePasswordForm,\
... | RTHMaK/RPGOne | circleci-demo-python-flask-master/app/auth/views.py | Python | apache-2.0 | 6,044 | 0 |
#!/usr/bin/python
import sys
from LAPS.MsgBus.Bus import Bus
# Create queue with a unique name
# insert message
# receive msg
# delete queue
if __name__ == "__main__":
# If invoked directly, parse command line arguments for logger information
# and pass the rest to the run() metho... | jjdmol/LOFAR | SubSystems/LAPS_CEP/test/startPythonFromMsg.py | Python | gpl-3.0 | 725 | 0.015172 |
"""distutils.cmd
Provides the Command class, the base class for the command classes
in the distutils.command package.
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id: cmd.py,v 1.34 2003/02/20 02:10:08 gvanrossum Exp $"
import sys, os, string, re
from types import *
from distutils.... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.3/Lib/distutils/cmd.py | Python | mit | 19,279 | 0.004201 |
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2010 (ita)
"""
ConfigSet: a special dict
The values put in :py:class:`ConfigSet` must be lists
"""
import copy, re, os
from waflib import Logs, Utils
re_imp = re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$', re.M)
class ConfigSet(object):
"""
A dict that honor ... | evancich/apm_motor | modules/waf/waflib/ConfigSet.py | Python | gpl-3.0 | 8,007 | 0.037842 |
# Copyright 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.
from telemetry import test
from measurements import smoothness
import page_sets
@test.Disabled('linux') # crbug.com/368767
class SchedulerToughSchedulingC... | TeamEOS/external_chromium_org | tools/perf/benchmarks/scheduler.py | Python | bsd-3-clause | 1,116 | 0.006272 |
import numpy as np
import pylab as pl
import sys
sys.path.append('../../lablib')
import ourgui
def smoothList(list,strippedXs=False,degree=10):
if strippedXs==True: return Xs[0:-(len(list)-(len(list)-degree+1))]
smoothed=[0]*(len(list)-degree+1)
for i in range(len(smoothed)):
smoothed[i]=sum(list[i... | UltracoldAtomsLab/labhardware | projects/gwmultilog/quickplot.py | Python | mit | 1,511 | 0.023825 |
"""passlib.bcrypt -- implementation of OpenBSD's BCrypt algorithm.
TODO:
* support 2x and altered-2a hashes?
http://www.openwall.com/lists/oss-security/2011/06/27/9
* deal with lack of PY3-compatibile c-ext implementation
"""
#=============================================================================
# imports
... | ioram7/keystone-federado-pgid2013 | build/passlib/passlib/handlers/bcrypt.py | Python | apache-2.0 | 13,180 | 0.003794 |
import collections
import jinja2
import requests
from flask import (
current_app,
Blueprint,
render_template,
request,
jsonify,
abort
)
frontend = Blueprint('frontend', __name__, template_folder='templates')
headers = {"Content-type": "application/json"}
@jinja2.contextfilter
@frontend.app_t... | openregister/food-premises-demo | fsa_approved_premises/frontend/views.py | Python | mit | 4,293 | 0.002795 |
from math import log10, floor
# N = 12
N = 101
# N = 1000001
def n_squares(n):
return [i**2 for i in range(2, n)]
# print(n_squares(11))
# print(n_squares(100))
##### This block from stackoverflow:
# https://stackoverflow.com/questions/37023774/all-ways-to-partition-a-string
import itertools
memo = {}
def mu... | kylebegovich/ProjectEuler | Python/Progress/Problem719.py | Python | gpl-3.0 | 1,757 | 0.007968 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.