code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
from sms import app
import twilio
def twilio_send(phone_number, message):
"""Sends an SMS via the Twilio service. """
data = {'From': app.config['CALLER_ID'],
'To': phone_number,
'Body': message}
account = twilio.Account(app.config['ACCOUNT_SID'],
ap... | akavlie/SMSr | sms/tw_send.py | Python | bsd-3-clause | 1,031 |
#!/usr/bin/env python
""" MAGeCK count module
Copyright (c) 2014 Wei Li, Han Xu, Xiaole Liu lab
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included with
the distribution).
@status: experimental
@version: $Revision$
@author: Wei Li
@c... | davidliwei/mageck | mageck/mageckCount.py | Python | bsd-3-clause | 14,299 |
import os
from PIL import Image
from vistas.core.graphics.overlay import BasicOverlayButton
from vistas.core.paths import get_resources_directory
class ExpandButton(BasicOverlayButton):
""" Expand/collapse button for the right panel """
def __init__(self):
self._expanded = False
self.image =... | VISTAS-IVES/pyvistas | source/vistas/ui/controls/expand_button.py | Python | bsd-3-clause | 748 |
from gooddataclient.dataset import Dataset
from gooddataclient.columns import ConnectionPoint, Label, Reference
class Employee(Dataset):
employee = ConnectionPoint(title='Employee', folder='Employee')
firstname = Label(title='First Name', reference='employee', folder='Employee')
lastname = Label(ti... | comoga/gooddata-python | tests/examples/employee.py | Python | bsd-3-clause | 6,397 |
import sys
from rpython.rlib.listsort import make_timsort_class
from rpython.rlib.objectmodel import specialize
from rpython.rlib.rstring import StringBuilder
from rpython.rlib.rsre.rsre_core import (
OPCODE_LITERAL, OPCODE_LITERAL_IGNORE, OPCODE_SUCCESS, OPCODE_ASSERT,
OPCODE_MARK, OPCODE_REPEAT, OPCODE_ANY, ... | topazproject/topaz | topaz/utils/regexp.py | Python | bsd-3-clause | 41,441 |
# Copyright (C) 2003-2005 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ... | liyongyue/dnsspider | dns/rdtypes/IN/NSAP_PTR.py | Python | isc | 889 |
#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTW... | SymbiFlow/icestorm | icebox/icebox_html.py | Python | isc | 26,039 |
# -*- coding: utf-8 -*-
"""
Contains data that initially get added to the database to bootstrap it.
"""
from __future__ import unicode_literals
# pylint: disable=invalid-name
prophet_muhammad = {
'title': u'Prophet',
'display_name': u'النبي محمد (صلى الله عليه وآله وسلم)'.strip(),
'full_name': u'محمد بن... | hadithhouse/hadithhouse | hadiths/initial_data.py | Python | mit | 5,391 |
import tests, debug
from common import TestCommon
from results import PassFailResult, RowResults
import sys, re, numpy, os, datetime
class AppelLiBench(TestCommon):
'''Benchmark GC primitives with Appel Li benchmark'''
bench_core = 4
def setup(self, build, machine, testdir):
# gracefully handle ... | kishoredbn/barrelfish | tools/harness/tests/mem_appel.py | Python | mit | 4,185 |
from unittest.mock import MagicMock, Mock
from unittest import TestCase
from PartyProblemSimulator.BooleanEquation.BooleanNode import BooleanNode
from PartyProblemSimulator.BooleanEquation.AndNode import AndNode
class aBooleanNode(BooleanNode): # pragma: no cover
""" This class is a boolean node. """
def say(... | Sciprios/SatisfiabilitySimulator | PartyProblemSimulator/BooleanEquation/unit_tests/test_nde_And.py | Python | mit | 1,504 |
"""Provides device triggers for sensors."""
import voluptuous as vol
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA
from homeassistant.components.device_automation.exceptions import (
InvalidDeviceAutomationConfig,
)
from homeassistant.components.homeassistant.triggers import (
... | rohitranjan1991/home-assistant | homeassistant/components/sensor/device_trigger.py | Python | mit | 7,736 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Jérémie DECOCK (http://www.jdhp.org)
# This script is provided under the terms and conditions of the MIT license:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | jdhp-sap/data-pipeline-standalone-scripts | datapipe/optimization/objectivefunc/tailcut_delta_psi.py | Python | mit | 6,676 |
import random
from djinn import *
import os
import sys
class ProceduralTerrain:
def __init__(self, heightmapList):
self.heightmapList = heightmapList
def generateHill(self):
count = 0
num = 1
randindex = random.randint(0,len(self.heightmapList)-1)
while ind < len(self.... | djeof-1/VOXINN | voxinn/procedural/ProceduralTerrain.py | Python | mit | 1,201 |
import sys, os
sys.path.insert(1, os.path.join(sys.path[0], '../../../'))
import script.rio as io
import script.initial_condition.noh1D as noh1D
# Domain properties
lx = 1.0
ly = 1.0
Nx = 4194304
Ny = 1
# Scheme execution options
T = 0.6
CFL = 0.5
gamma = 5./3.
BClayer = 1
quantityList = ['rho', 'rhou_x', 'rhou_y'... | will-iam/Variant | casepy/eulerRuO2/nNoh4194304x1/chars.py | Python | mit | 473 |
import pybullet as p
import time
p.connect(p.GUI)
fileIO = p.loadPlugin("fileIOPlugin")
if (fileIO >= 0):
p.executePluginCommand(fileIO, "pickup.zip", [p.AddFileIOAction, p.ZipFileIO])
objs = p.loadSDF("pickup/model.sdf")
dobot = objs[0]
p.changeVisualShape(dobot, -1, rgbaColor=[1, 1, 1, 1])
else:
print("fi... | MadManRises/Madgine | shared/bullet3-2.89/examples/pybullet/examples/fileIOPlugin.py | Python | mit | 457 |
#!/usr/bin/env python3
import sys
import numatuned
dryrun = False
if len(sys.argv) > 1:
if sys.argv[1] == '-n':
dryrun = True
numatuned.fire(60, dryrun)
| dionbosschieter/numatuned | numatuned.py | Python | mit | 167 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import sys
import fcntl
import subprocess
TESTS_DIR = os.path.dirname(os.path.realpath(__file__))
LOCKFILE ... | facebook/infer | infer/tests/testlock.py | Python | mit | 578 |
# http://deeplearning.net/tutorial/code/mlp.py
"""
This tutorial introduces the multilayer perceptron using Theano.
A multilayer perceptron is a logistic regressor where
instead of feeding the input to the logistic regression you insert a
intermediate layer, called the hidden layer, that has a nonlinear
activation fu... | cliffclive/neuromancy | neuromancy/theano_tutorials/tutorial_mlp.py | Python | mit | 13,906 |
"Interactions with the Juju environment"
# Copyright 2013 Canonical Ltd.
#
# Authors:
# Charm Helpers Developers <juju@lists.ubuntu.com>
import os
import json
import yaml
import subprocess
import sys
import UserDict
from subprocess import CalledProcessError
CRITICAL = "CRITICAL"
ERROR = "ERROR"
WARNING = "WARNING"
I... | chuckbutler/shoutcast-charm | lib/charmhelpers/core/hookenv.py | Python | mit | 14,883 |
#!/usr/bin/env python
version = "1.7"
version_info = (1,7,0,"rc-1")
__revision__ = "$Rev: 66 $"
"""
Python-Markdown
===============
Converts Markdown to HTML. Basic usage as a module:
import markdown
md = Markdown()
html = md.convert(your_text_string)
See http://www.freewisdom.org/projects/python-mark... | lethain/lifeflow | markdown/markdown.py | Python | mit | 60,664 |
import io
from django.test import TestCase
from explorer.actions import generate_report_action
from explorer.tests.factories import SimpleQueryFactory
from explorer.utils import csv_report
from zipfile import ZipFile
class testSqlQueryActions(TestCase):
def test_simple_query_runs(self):
expected_csv = ... | guilhermemaba/django-sql-explorer | explorer/tests/test_actions.py | Python | mit | 1,728 |
from .fitting import *
from .io import *
from .main import *
from .plotting import *
from .psf import *
from .utils import *
from .version import __version__
| kbarbary/cubefit | cubefit/__init__.py | Python | mit | 158 |
#!/usr/bin/env python
"""Server run file.
Run by './server.py'
Access properties as 'config.property'
"""
import pkgutil, sys
from flask import Flask, Blueprint, render_template, request
import config
app = Flask(__name__)
modules = pkgutil.iter_modules(path=[config.modules_directory_name])
for loader, mod_name, i... | rogerhoward/funcaas | server.py | Python | mit | 673 |
from fabric.api import env
from fabric.context_managers import cd
from fabric.operations import run, local, put
env.shell = '/bin/bash -l -c'
env.user = 'd'
env.roledefs.update({
'staging': ['staging.solebtc.com'],
'production': ['solebtc.com']
})
# Heaven will execute fab -R staging deploy:branch_name=master... | solefaucet/sole-server | fabfile.py | Python | mit | 1,674 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
utils
~~~~~
Provides miscellaneous utility methods
"""
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
import itertools as it
from termcolor import colored as color
underscor... | reubano/hdxscraper-unhabitat | app/utils.py | Python | mit | 1,855 |
#ImportModules
import ShareYourSystem as SYS
#figure
MyPyploter=SYS.PyploterClass(
).mapSet(
{
'-Charts':
{
'|a':{
'-Draws':[
('|0',{
'PyplotingDrawVariable':
[
(
'plot',
{
'#liarg':[
[1,2,3],
[2,6,3]
],
... | Ledoux/ShareYourSystem | Pythonlogy/build/lib/ShareYourSystem/Standards/Viewers/Pyploter/05_ExampleDoc.py | Python | mit | 925 |
import pytest
from spacy.attrs import LEMMA
from spacy.vocab import Vocab
from spacy.tokens import Doc, Token
def test_doc_retokenize_merge(en_tokenizer):
text = "WKRO played songs by the beach boys all night"
attrs = {
"tag": "NAMED",
"lemma": "LEMMA",
"ent_type": "TYPE",
"mor... | explosion/spaCy | spacy/tests/doc/test_retokenize_merge.py | Python | mit | 18,955 |
# CC150 8.1
# Design the data structure for a generic deck of cards.
class suit():
def __init__(self, v):
self.value = v
| cyandterry/Python-Study | Ninja/Concept_Implement/OOD.py | Python | mit | 134 |
### Simple IAN model for use with Neural Photo Editor
# This model is a simplified version of the Introspective Adversarial Network that does not
# make use of Multiscale Dilated Convolutional blocks, Ternary Adversarial Loss, or an
# autoregressive RGB-Beta layer. It's designed to be sleeker and to run on laptop GPUs ... | spellrun/Neural-Photo-Editor | gan/models/ian_simple.py | Python | mit | 8,119 |
from zope.interface import implements, classProvides
from twisted.internet import address
from nevow import inevow, rend, loaders, util, url
from webut.navi import inavi
from demoplugins import idemo
class FooPage(rend.Page):
implements(inavi.INavigationElement)
title = 'Foo!'
docFactory = loaders.xmlfil... | antong/webut | examples/navi/demoplugins/foo.py | Python | mit | 1,433 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display.py | Python | mit | 1,519 |
"""
Import utilities
Exported classes:
ImportManager Manage the import process
Importer Base class for replacing standard import functions
BuiltinImporter Emulate the import mechanism for builtin and frozen modules
DynLoadSuffixImporter
"""
from warnings import warnpy3k
warnpy3k(... | babyliynfg/cross | tools/project-creator/Python2.6.6/Lib/imputil.py | Python | mit | 26,744 |
# coding=utf-8
from __future__ import unicode_literals
import os
from hashlib import md5
import nose
from django.conf import settings
from kgb import SpyAgency
from reviewboard.diffviewer.diffutils import patch
from reviewboard.scmtools.core import (Branch, Commit, Revision, HEAD,
... | davidt/reviewboard | reviewboard/scmtools/tests/test_svn.py | Python | mit | 20,340 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/weapon/shared_wpn_seinar_ls1.iff"
result.attribute_... | anhstudios/swganh | data/scripts/templates/object/tangible/ship/components/weapon/shared_wpn_seinar_ls1.py | Python | mit | 473 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_tatooine_desert_demons_camp_medium.iff"
result.attribute... | anhstudios/swganh | data/scripts/templates/object/building/poi/shared_tatooine_desert_demons_camp_medium.py | Python | mit | 465 |
__author__ = 'tibi'
| Marwe/particlemap | sample.py | Python | mit | 20 |
import random
def random_data(points=50, maximum=100):
return [random.random() * maximum for a in xrange(points)]
def random_colour(min=20, max=200):
func = lambda: int(random.random() * (max-min) + min)
r, g, b = func(), func(), func()
return '%02X%02X%02X' % (r, g, b)
| kongji2008/genetify | pygooglechart/examples/helper.py | Python | mit | 290 |
from pandac.PandaModules import VBase4, VBase3
from direct.fsm import FSM
from direct.directnotify import DirectNotifyGlobal
from direct.gui.DirectButton import DirectButton
from toontown.toonbase import ToontownGlobals
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import *
from toontown.toonba... | ksmit799/Toontown-Source | toontown/toontowngui/NewsPageButtonManager.py | Python | mit | 10,708 |
#!/usr/bin/env python
# pylint: disable=R0903
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public L... | tzpBingo/github-trending | codespace/python/telegram/poll.py | Python | mit | 12,268 |
from __future__ import unicode_literals
from django.contrib.auth.models import (AbstractBaseUser, PermissionsMixin,
BaseUserManager)
from django.db import models
from django.utils import timezone
class EmailUserManager(BaseUserManager):
def _create_user(self, email, passwo... | migcruz/dota2analytics | backend/apps/users/models.py | Python | mit | 2,526 |
from django.test import LiveServerTestCase
class AdminTest(LiveServerTestCase):
def __init__(self, *args, **kwargs):
super(AdminTest, self).__init__(*args, **kwargs)
def setUp(self):
pass
def tearDown(self):
pass
def test_can_see_a_list(self):
pass
# Nasol i... | leehosung/writing_sandbox | functional_tests/test_admin.py | Python | mit | 815 |
"""Fetch official PATCO feed."""
import logging
import requests
from bs4 import BeautifulSoup
from FeedSource import FeedSource
DEVPAGE_URL = 'http://www.ridepatco.org/developers/'
FILE_NAME = 'PortAuthorityTransitCorporation.zip'
LOG = logging.getLogger(__name__)
class Patco(FeedSource):
"""Fetch official PA... | azavea/gtfs-feed-fetcher | feed_sources/Patco.py | Python | mit | 1,128 |
class Car:
def beep():
print('Beep')
car = Car()
Car.beep()
#https://pt.stackoverflow.com/q/482008/101
| bigown/SOpt | Python/OOP/Static.py | Python | mit | 117 |
###############################################################################
#
# 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 |
import io
import os
import re
import sys
from setuptools import setup
def restify():
if os.path.isfile('README.md'):
if os.system('pandoc -s README.md -o README.rst') != 0:
print('----------------------------------------------------------')
print('WARNING: pandoc command failed, could not restify R... | NiklasRosenstein/localimport | setup.py | Python | mit | 1,978 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import time
import functools
import random
import inspect
from ._compat import string_types
from .client import Client
from nsq import protocol
from . import async
logger = logging.getLogger(__name__)
class Writer(Client):
"""
A ... | virtuald/pynsq | nsq/writer.py | Python | mit | 7,774 |
import workflow
"""
PublishPerfectArticle workflow
"""
class workflow_PublishPerfectArticle(workflow.workflow):
def __init__(self, settings, logger, conn=None, token=None, decision=None,
maximum_page_size=100):
workflow.workflow.__init__(self, settings, logger, conn, token, decision, max... | jhroot/elife-bot | workflow/workflow_PublishPerfectArticle.py | Python | mit | 5,903 |
#
# Dissect a diagram by rendering it and accumulating invalid
# renderer calls to object selection.
#
# Copyright (c) 2014 Hans Breuer <hans@breuer.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 Soft... | Distrotech/dia | plug-ins/python/diadissect.py | Python | gpl-2.0 | 6,191 |
from MA_version import version as __version__
from MA_version import version_info as __version_info__
from MA import *
| fxia22/ASM_xf | PythonD/site_python/Numeric/MA/__init__.py | Python | gpl-2.0 | 119 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class AVSource(object):
def __init__(self, sbin_content):
self.tags = ["a_src", "v_src"]
#self.sbin = "%s ! queue ! tee name=%s_tee" %(sbin_content, self.tags[0])
self.sbin = sbin_content
class AudioSource(object):
def __init__(self, sbin_c... | lucasa/landell_gst-gengui | sltv/gstmanager/sbins/source.py | Python | gpl-2.0 | 601 |
#
# Copyright (c) 2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... | alikins/subscription-manager | src/subscription_manager/plugin/ostree/model.py | Python | gpl-2.0 | 19,775 |
"""This module contains tests that check priority of domains."""
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.automate.explorer.domain import DomainCollection
from cfme.automate.simulation import simulate
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.u... | nachandr/cfme_tests | cfme/tests/automate/test_domain_priority.py | Python | gpl-2.0 | 9,718 |
# This file is part of the Diamond cothread library.
#
# Copyright (C) 2007 James Rowland, 2007-2012 Michael Abbott,
# Diamond Light Source Ltd.
#
# The Diamond cothread library 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 Soft... | Araneidae/cothread | cothread/input_hook.py | Python | gpl-2.0 | 5,250 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
# 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... | tp81/openmicroscopy | components/tools/OmeroPy/src/omero/install/jvmcfg.py | Python | gpl-2.0 | 15,795 |
#!/usr/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
evaluate-gbsa.py
Evaluate the GBSA model on hydration free energies of small molec... | hainm/open-forcefield-group | ideas/bayesian-gbsa-parameterization/evaluate-gbsa.py | Python | gpl-2.0 | 24,285 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('aldryn_newsblog', '0004_auto_20150622_1606'),
]
operations = [
migrations.AlterField(
model_name='newsblogconfig... | Venturi/cms | env/lib/python2.7/site-packages/aldryn_newsblog/migrations/0005_auto_20150807_0207.py | Python | gpl-2.0 | 558 |
###############################################################################
# #
# Copyright 2019. Triad National Security, LLC. All rights reserved. #
# This program was produced under U.S. Government contract 89233218CNA000001 #
... | CSD-Public/stonix | src/stonix_resources/ui_dylan_pyqt5_main_listview.py | Python | gpl-2.0 | 25,596 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4; encoding:utf8 -*-
#
# Copyright 2014 Michael Terry <mike@mterry.name>
#
# This file is part of duplicity.
#
# Duplicity 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... | alanfranz/duplicity | testing/overrides/gettext.py | Python | gpl-2.0 | 1,496 |
from struct import pack, unpack
from datetime import datetime, date
import sys
from zkconst import *
def reverseHex(hexstr):
tmp = ''
for i in reversed( xrange( len(hexstr)/2 ) ):
tmp += hexstr[i*2:(i*2)+2]
return tmp
def zkRegevent(self):
"""register for live events"""
print "r... | AlSayedGamal/python_zklib | zklib/zkRegevent.py | Python | gpl-2.0 | 2,460 |
# -*- python -*-
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2011-2012 Serge Noiraud
#
# 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; eithe... | pmghalvorsen/gramps_branch | gramps/plugins/lib/maps/dummylayer.py | Python | gpl-2.0 | 2,350 |
# ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa 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, eithe... | blitzmann/Pyfa | eos/db/saveddata/databaseRepair.py | Python | gpl-3.0 | 11,132 |
""" Contains unit tests of NetworkAgent module
"""
import DIRAC.AccountingSystem.Agent.NetworkAgent as module
import unittest
from mock.mock import MagicMock
__RCSID__ = "$Id$"
MQURI1 = 'mq.dirac.net::Topic::perfsonar.summary.packet-loss-rate'
MQURI2 = 'mq.dirac.net::Queue::perfsonar.summary.histogram-owdelay'
ROO... | Andrew-McNab-UK/DIRAC | AccountingSystem/Agent/test/Test_NetworkAgent.py | Python | gpl-3.0 | 3,707 |
from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose, assert_array_equal
import os
setup_logging("debug")
# The test result data (threeptcf_sim_result.dat) is computed with
# Daniel Eisenstein's
# C++ implementation on the same input ... | bccp/nbodykit | nbodykit/algorithms/tests/test_threeptcf.py | Python | gpl-3.0 | 5,475 |
import json
import glob
from os import path
json_files = glob.glob(path.join(path.dirname(__file__), '../../joystick/data/evaluations/apt29', "*.json"))
vendor_list = []
for jf in json_files:
vendor = path.basename(jf).split(".")[0]
with open(jf,'r') as fi:
dict = json.load(fi)
for t in dict['T... | Cyb3rWard0g/ThreatHunter-Playbook | scripts/create_vendor_json.py | Python | gpl-3.0 | 1,040 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-20 00:54
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cs_core', '0006_auto_20160619_2151'),
]
operations = [
migrations.RemoveFiel... | wilkerwma/codeschool | src/cs_core/migrations/0007_auto_20160619_2154.py | Python | gpl-3.0 | 729 |
#! /usr/bin/env python
import socket
print "creating socket..."
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #ipv4, tcp
print "done."
print "looking up port number..."
port = socket.getservbyname('http', 'tcp')
print "done."
print "connecting to remote host on port %d..." % port
s.connect(("www.google.c... | qzxx-syzz/study | python/Net/connect.py | Python | gpl-3.0 | 446 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import re
tags = ['Satellite_5', 'Spacewalk']
name = 'Basic Cobbler settings are correct'
def etc_cobbler_settings(data):
"""
Verify settings in /etc/cobbler/settings:
redhat_management_type: "site"
redhat_management_server: "satellite.example.com"
server... | RedHatSatellite/satellite-sanity | satellite_sanity_lib/rules/sat5_cobbler_config.py | Python | gpl-3.0 | 3,726 |
# -*- coding: utf-8 -*-
'''
accpy.simulate.const
Felix Kramer (felix.kramer@physik.hu-berlin.de)
'''
# ratio of circumference to diameter of circle
pi = 3.141592653589793115997963468544185161590576171875
# speed of light----------------------------------------/ (m/s)
cl = 299792458.
# elementary charge----------------... | accpy/accpy | accpy/simulate/const.py | Python | gpl-3.0 | 1,881 |
import kivy
kivy.require('1.9.1')
from utils import kvFind
from kivy.core.window import Window
from kivy.properties import NumericProperty
from autosportlabs.racecapture.views.dashboard.widgets.gauge import CustomizableGauge
class GraphicalGauge(CustomizableGauge):
_gaugeView = None
gauge_size = NumericPropert... | ryandoherty/RaceCapture_App | autosportlabs/racecapture/views/dashboard/widgets/graphicalgauge.py | Python | gpl-3.0 | 864 |
'''
argparse.py - this file is part of S3QL.
Copyright © 2008 Nikolaus Rath <Nikolaus@rath.org>
This work can be distributed under the terms of the GNU GPLv3.
This module provides a customized ArgumentParser class. Differences
are:
* a --version argument is added by default
* convenience functions are availabl... | s3ql/main | src/s3ql/parse_args.py | Python | gpl-3.0 | 14,648 |
# CREATED:2013-08-13 12:02:42 by Brian McFee <brm2132@columbia.edu>
'''
Evaluation criteria for structural segmentation fall into two categories:
boundary annotation and structural annotation. Boundary annotation is the task
of predicting the times at which structural changes occur, such as when a verse
transitions to... | urinieto/hier_eval | segment_tree.py | Python | gpl-3.0 | 51,887 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('index', '0004_repository_public'),
]
operations = [
migrations.AddField(
model_name='project',
name=... | pombredanne/project_index | index/migrations/0005_project_related_project.py | Python | gpl-3.0 | 471 |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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 Licen... | cylc/cylc | cylc/flow/task_state.py | Python | gpl-3.0 | 18,047 |
# -*- coding: utf-8 -*-
"""
celery.local
~~~~~~~~~~~~
This module contains critical utilities that
needs to be loaded as soon as possible, and that
shall not load any third party modules.
Parts of this module is Copyright by Werkzeug Team.
"""
from __future__ import absolute_import
import im... | hubert667/AIR | build/celery/celery/local.py | Python | gpl-3.0 | 8,770 |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 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; either version 3 of the
# License, or (a... | belokop/indico_bare | indico/modules/attachments/controllers/compat.py | Python | gpl-3.0 | 3,649 |
import datetime
import logging
import os
import config
def setup_logging():
if not os.path.exists(config.log_path):
os.makedirs(config.log_path)
log_file_name = datetime.datetime.now().strftime("client_%Y-%m-%d_%H-%M-%S")
log_formatter = logging.Formatter("%(asctime)s [%(threadName)-12.12s] [%(... | StaszicCode/sMusic-core | smusicclient/logs.py | Python | gpl-3.0 | 864 |
import unittest2 as unittest
from jnpr.junos.utils.config import Config
from nose.plugins.attrib import attr
from mock import MagicMock, patch
import re
import sys
import os
from lxml import etree
import six
from jnpr.junos.console import Console
from jnpr.junos.transport.tty_netconf import tty_netconf
from jnpr.junos... | Collisio-Adolebitque/pfne-2017 | py-junos-eznc/tests/unit/test_console.py | Python | gpl-3.0 | 10,886 |
# -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansTamil-Regular'
native_name = ''
def glyphs(self):
chars = []
chars.append(0x0000) #uni0000 ????
chars.append(0x200B) #uniFEFF ZERO WIDTH SPACE
chars.append(0x200C) #uni200C ZERO WIDTH NON-JOINER
... | davelab6/pyfontaine | fontaine/charsets/noto_chars/notosanstamil_regular.py | Python | gpl-3.0 | 7,479 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Deepin, Inc.
# 2011 Wang Yong
# 2012 Reza Faiz A
#
# Author: Wang Yong <lazycat.manatee@gmail.com>
# Maintainer: Wang Yong <lazycat.manatee@gmail.com>
# Reza Faiz A <ylpmiskrad@gmail.com>
# Remixed : Reza Faiz A <ylpmi... | Zulfikarlatief/tealinux-software-center | src/updateView.py | Python | gpl-3.0 | 13,532 |
# Test Inform
# Imports {{{1
from inform import (
Inform, InformantFactory, Error, codicil, display, done, error,
errors_accrued, fatal, log, output, terminate, terminate_if_errors, warn,
set_culprit, add_culprit, get_culprit, join_culprit
)
from contextlib import contextmanager
from textwrap import dedent... | KenKundert/messenger | tests/test_inform.py | Python | gpl-3.0 | 29,357 |
from app import db
from app.model import DirectionStatistic
import random
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
def create_range_figure2(sender_id):
fig = Figure()
axis = fig.add_subplot(1, 1, 1)
xs = range(100)
ys = [random.randint(1, 50) for x in xs]... | glidernet/ogn-python | app/main/matplotlib_service.py | Python | agpl-3.0 | 1,400 |
# -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utlity functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import cookielib
import os
import random
import re
import zlib
import urllib
from urllib2 import parse_http_list ... | michal-ruzicka/archivematica | src/archivematicaCommon/lib/externals/requests/utils.py | Python | agpl-3.0 | 10,136 |
# Amara, universalsubtitles.org
#
# Copyright (C) 2014 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your opti... | eloquence/unisubs | apps/subtitles/workflows.py | Python | agpl-3.0 | 18,336 |
from __future__ import unicode_literals
import hashlib
import json
import requests
import six
import time
from django.conf import settings
from django.db import models
from smartmin.models import SmartModel
from temba.channels.models import Channel
from temba.contacts.models import Contact, TEL_SCHEME
from temba.orgs... | pulilab/rapidpro | temba/airtime/models.py | Python | agpl-3.0 | 10,395 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def install(country=None):
records = [
# address template
{'doctype':"Address Template", "country": count... | gangadharkadam/v5_erp | erpnext/setup/page/setup_wizard/install_fixtures.py | Python | agpl-3.0 | 12,019 |
from datetime import datetime
from sqlalchemy.orm import reconstructor, relationship, backref
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Integer, Unicode, Boolean, DateTime
from sqlalchemy import BigInteger
from sqlalchemy.sql.expression import false, or_
from sqlalchemy.ext.associati... | USStateDept/FPA_Core | openspending/model/dataorg.py | Python | agpl-3.0 | 5,452 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
from ludobox.content import read_content
from ludobox.routes.api import rest_api
# test helpers
from LudoboxTestCase import LudoboxTestCase
from helpers import delete_data_path, create_empty_data_path, add_samples_to_data_dir
class TestLudoboxWebSe... | ludobox/ludobox | server/tests/test_routes_api.py | Python | agpl-3.0 | 9,003 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.utils.translation import ugettext_lazy as _
PRODUCT_SORT_CHOI... | janusnic/shoop | shoop/front/utils/product_sorting.py | Python | agpl-3.0 | 1,352 |
from main import *
from django.utils import simplejson
class CsvView(CachedPage):
cacheName = "CsvView"
mimeType = "text/csv"
selfurl = "database.csv"
def generatePage(self):
output = []
output.append( """title, homepage, person, category, posts_url, comments_url, priority, fav... | mathblogging/mathblogging | dataexport.py | Python | agpl-3.0 | 4,361 |
# Generated by Django 2.2.5 on 2019-09-26 15:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("contacts", "0020_install_triggers")]
operations = [
migrations.AlterField(
model_name="contact",
name="gender",
field... | rapidpro/ureport | ureport/contacts/migrations/0021_auto_20190926_1554.py | Python | agpl-3.0 | 619 |
#!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
# 2017 Sebastian Meiling <s@mlng.net>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
imp... | MichelRottleuthner/RIOT | tests/driver_my9221/tests/01-run.py | Python | lgpl-2.1 | 560 |
#!/usr/bin/env python
# encoding: utf-8
"""
setup.py
Created by Cody Brocious on 2006-12-21.
Copyright (c) 2006 Falling Leaf Systems. All rights reserved.
"""
from distutils.core import setup
import py2app
setup(
app = ['Convert.py'],
options = dict(
py2app=dict(
argv_emulation=True
)
)
)
| callen/Alky-Reborn | Convertor/setup.py | Python | lgpl-3.0 | 303 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ArchMap documentation build configuration file, created by
# sphinx-quickstart on Sat Apr 19 11:17:53 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... | guyfawcus/ArchMap | docs/conf.py | Python | unlicense | 9,093 |
# -------------------------------------------------------------
#
# 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 unde... | apache/incubator-systemml | src/main/python/systemds/operator/algorithm/builtin/getAccuracy.py | Python | apache-2.0 | 1,549 |
# -*- coding: utf-8 -*-
import os
import sys
import fcntl
import signal
import logging
import logging.config
from ConfigParser import ConfigParser
from openprocurement.search.version import __version__
from openprocurement.search.engine import IndexEngine, logger
from openprocurement.search.utils import decode_bool_... | openprocurement/openprocurement.search | openprocurement/search/index_worker.py | Python | apache-2.0 | 4,585 |
# Copyright 2012 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 in... | openstack/keystone | keystone/tests/unit/test_sql_upgrade.py | Python | apache-2.0 | 22,985 |
#
# Copyright (c) 2013-2020 Contributors to the Eclipse Foundation
#
# See the NOTICE file distributed with this work for additional information regarding copyright
# ownership. All rights reserved. This program and the accompanying materials are made available
# under the terms of the Apache License, Version 2.0 whic... | locationtech/geowave | python/src/main/python/pygw/store/hbase/options.py | Python | apache-2.0 | 2,740 |
# Copyright (c) 2010-2012 OpenStack, 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 ... | Triv90/SwiftUml | swift/proxy/controllers/obj.py | Python | apache-2.0 | 50,946 |
# Copyright 2020 Red Hat, Inc.
# 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... | openstack/cinder | cinder/tests/unit/policies/test_default_volume_types.py | Python | apache-2.0 | 12,078 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# This file is auto-generated by h2o-3/h2o-bindings/bin/gen_python.py
# Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details)
#
from __future__ import absolute_import, division, print_function, unicode_literals
from h2o.estimators.estimator_base ... | h2oai/h2o-3 | h2o-py/h2o/estimators/glrm.py | Python | apache-2.0 | 45,329 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.