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 |
|---|---|---|---|---|---|---|
# coding: utf-8
"""
A simple module to fetch Cavelink values by parsing the HTML page of sensors.
"""
from setuptools import find_packages, setup
with open('README.rst', 'r') as f:
long_description = f.read()
setup(
name='cavelink',
version='1.1.1',
author='Sébastien Pittet',
author_email='sebast... | SebastienPittet/cavelink | setup.py | Python | mit | 1,270 | 0 |
#!/usr/local/bin/python3.4
"""
Simple example to send a WoL to a registared system on the ISY
if this script is call without any arg
we print a list of registared WoL systems
if we have any args we treat them as registared WoL Id's
and attempt to send a WoL packet
"""
__author__ = "Peter Shipley"
import sys
im... | fxstein/ISYlib-python | bin/isy_net_wol.py | Python | bsd-2-clause | 1,132 | 0.013251 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import platform
import shutil
import sys
sys.path.append('bin')
from autojump_argparse import ArgumentParser
SUPPORTED_SHELLS = ('bash', 'zsh', 'fish')
def cp(src, dest, dryrun=False):
print("copying file: %s -> %s" ... | mdlawson/autojump | install.py | Python | gpl-3.0 | 5,781 | 0.000346 |
## Code outside the data string, and the setup and action blocks is ignored
## If manually editing, you must reload the code. Delete the resource timestamp so kaithem knows it's new
__data__="""
{continual: false, enable: true, once: true, priority: interactive, rate-limit: 0.0,
resource-timestamp: 1645141613510257, ... | EternityForest/KaithemAutomation | kaithem/data/modules/Beholder/main.py | Python | gpl-3.0 | 787 | 0.01906 |
# Copyright 2009 Google Inc. Released under the GPL v2
"""This is a convenience module to import all available types of hosts.
Implementation details:
You should 'import hosts' instead of importing every available host module.
"""
from autotest_lib.client.common_lib import utils
import base_classes
Host = utils.imp... | clebergnu/autotest | client/common_lib/hosts/__init__.py | Python | gpl-2.0 | 435 | 0 |
'''
New Integration Test for resizing root volume.
@author: czhou25
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.ope... | zstackorg/zstack-woodpecker | integrationtest/vm/multihosts/volumes/test_snapshot_resize_vm.py | Python | apache-2.0 | 1,782 | 0.002806 |
# -*- coding: utf-8 -*-
"""
pytest fixtures
"""
import pytest
from django.contrib.auth.models import User
from orb.models import Category, Tag, UserProfile
from orb.peers.models import Peer
from orb.resources.tests.factory import resource_factory
pytestmark = pytest.mark.django_db
@pytest.fixture
def testing_user... | mPowering/django-orb | orb/fixtures/__init__.py | Python | gpl-3.0 | 2,306 | 0.000869 |
import os
import sys
import shutil
import errno
import time
import hashlib
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
if "TRAVIS_BUILD_NUMBER" in os.environ:
if "SAUCE_... | agrajaghh/duplicati | guiTests/guiTest.py | Python | lgpl-2.1 | 8,072 | 0.002602 |
data = {}
def setup():
global data
from .schema import Ship, Faction
xwing = Ship(id="1", name="X-Wing")
ywing = Ship(id="2", name="Y-Wing")
awing = Ship(id="3", name="A-Wing")
# Yeah, technically it's Corellian. But it flew in the service of the rebels,
# so for the purposes of this ... | graphql-python/graphene | examples/starwars_relay/data.py | Python | mit | 1,593 | 0.001255 |
import flickrapi
import csv
import sys
import datetime
import argparse
import os
# environment variable keys
ENV_KEY = 'FLICKR_API_KEY'
ENV_SECRET = 'FLICKR_API_SECRET'
MAX_PHOTOS_PER_PAGE = 500
# column headers for output file
columns = ['Title', 'Upload date', 'photo_id', 'url', 'Description',
'View cou... | jordanjoz1/flickr-views-counter | count_views.py | Python | mit | 4,590 | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class StockMoveLine(models.Model):
_inherit = 'stock.move.line'
@api.model_create_multi
def create(self, vals_list):
records = super(StockMoveLine, self).create(vals_li... | ygol/odoo | addons/mrp_subcontracting/models/stock_move_line.py | Python | agpl-3.0 | 1,039 | 0.002887 |
from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest
from PyQt4 import QtGui, QtCore
import urllib2
import logging
import os
import util
import warnings
logger= logging.getLogger(__name__)
VAULT_PREVIEW_ROOT = "http://content.faforever.com/faf/vault/map_previews/small/"
class downloadManager(QtCore.QOb... | Blackclaws/client | src/downloadManager/__init__.py | Python | gpl-3.0 | 3,779 | 0.00688 |
from __future__ import print_function
import logging
from twisted.internet import reactor, ssl
from txjsonrpc.web.jsonrpc import Proxy
from OpenSSL import SSL
from twisted.python import log
def printValue(value):
print("Result: %s" % str(value))
def printError(error):
print('error', error)
def shutDown(dat... | oubiwann/txjsonrpc | examples/ssl/client.py | Python | mit | 1,418 | 0.009168 |
"""
Support for LIFX Cloud scenes.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/scene.lifx_cloud/
"""
import asyncio
import logging
import voluptuous as vol
import aiohttp
import async_timeout
from homeassistant.components.scene import Scene
from h... | MungoRae/home-assistant | homeassistant/components/scene/lifx_cloud.py | Python | apache-2.0 | 2,931 | 0 |
#====================================================================================================
# C L A S S E S concerning the site description
#====================================================================================================
#----------------------------------------------------------------... | sidnarayanan/IntelROCCS | Detox/python/siteProperties.py | Python | mit | 12,964 | 0.011571 |
# -*- coding: utf-8 -*-
#
# Copyright 2013 - Mirantis, 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 requir... | TimurNurlygayanov/mistral | mistral/api/controllers/v1/workbook_definition.py | Python | apache-2.0 | 1,511 | 0 |
from warnings import warn
from beaker.crypto.pbkdf2 import PBKDF2, strxor
from beaker.crypto.util import hmac, sha1, hmac_sha1, md5
from beaker import util
keyLength = None
if util.jython:
try:
from beaker.crypto.jcecrypto import getKeyLength, aesEncrypt
keyLength = getKeyLength()
except Impo... | Arno-Nymous/pyload | module/lib/beaker/crypto/__init__.py | Python | gpl-3.0 | 1,233 | 0 |
import discord, os, logging
from discord.ext import commands
from .utils import checks
from .utils.dataIO import dataIO
from .utils.chat_formatting import pagify, box
#The Tasty Jaffa
#Requested by Freud
def get_role(ctx, role_id):
roles = set(ctx.message.server.roles)
for role in roles:
if role.id ==... | The-Tasty-Jaffa/Tasty-Jaffa-cogs | say/say.py | Python | gpl-3.0 | 6,218 | 0.008363 |
# coding: utf-8
from boto.s3.bucket import Bucket
from thumbor.utils import logger
from tornado.concurrent import return_future
import urllib2
import thumbor.loaders.http_loader as http_loader
from tc_aws.aws.connection import get_connection
def _get_bucket(url, root_path=None):
"""
Returns a tuple contain... | guilhermef/aws | tc_aws/loaders/s3_loader.py | Python | mit | 2,000 | 0.0025 |
import mock
from mock import call
import time
from typing import Any, Dict, Union, SupportsInt, Text
import gcm
from django.test import TestCase
from django.conf import settings
from zerver.models import PushDeviceToken, UserProfile, Message
from zerver.models import get_user_profile_by_email, receives_online_notifi... | dawran6/zulip | zerver/tests/test_push_notifications.py | Python | apache-2.0 | 17,956 | 0.001337 |
from ccswm.statApi.models import *
from rest_framework import serializers
class EpisodeSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Episode
fields = ('id', 'url', 'season', 'episodeNumber', 'location')
class StarterSerializer(serializers.HyperlinkedModelSerializer):
... | RussellRiesJr/CoupleComeStatWithMe | ccswm/statApi/serializers.py | Python | mit | 1,581 | 0.001898 |
from typing import Optional
from fastapi import FastAPI
from pydantic import BaseModel, EmailStr
app = FastAPI()
class UserBase(BaseModel):
username: str
email: EmailStr
full_name: Optional[str] = None
class UserIn(UserBase):
password: str
class UserOut(UserBase):
pass
class UserInDB(UserB... | tiangolo/fastapi | docs_src/extra_models/tutorial002.py | Python | mit | 824 | 0 |
__version__ = '0.1'
from geholproxy import *
from geholexceptions import *
| Psycojoker/geholparser | src/gehol/__init__.py | Python | mit | 76 | 0 |
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... | tempbottle/restcommander | play-1.2.4/python/Lib/_abcoll.py | Python | apache-2.0 | 13,666 | 0.000951 |
# Authors:
# Jason Gerard DeRose <jderose@redhat.com>
# Pavel Zuna <pzuna@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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
... | encukou/freeipa | ipaclient/plugins/user.py | Python | gpl-3.0 | 2,966 | 0 |
# -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansOldItalic-Regular'
native_name = ''
def glyphs(self):
chars = []
chars.append(0x0000) #uniFEFF ????
chars.append(0x0020) #uni00A0 SPACE
chars.append(0x00A0) #uni00A0 NO-BREAK SPACE
chars.appen... | davelab6/pyfontaine | fontaine/charsets/noto_chars/notosansolditalic_regular.py | Python | gpl-3.0 | 2,939 | 0.015652 |
from __future__ import division, absolute_import, print_function
import re
import os
import sys
import warnings
import platform
import tempfile
from subprocess import Popen, PIPE, STDOUT
from numpy.distutils.fcompiler import FCompiler
from numpy.distutils.exec_command import exec_command
from numpy.distutils.misc_uti... | maniteja123/numpy | numpy/distutils/fcompiler/gnu.py | Python | bsd-3-clause | 14,957 | 0.001872 |
# Copyright (c) 2016 Stratoscale, Ltd.
#
# 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 ... | ge0rgi/cinder | cinder/tests/unit/api/v3/test_volume_manage.py | Python | apache-2.0 | 8,439 | 0 |
"""
Tests for programs celery tasks.
"""
import json
import unittest
from celery.exceptions import MaxRetriesExceededError
import ddt
from django.conf import settings
from django.core.cache import cache
from django.test import override_settings, TestCase
from edx_rest_api_client.client import EdxRestApiClient
from edx... | TheMOOCAgency/edx-platform | openedx/core/djangoapps/programs/tasks/v1/tests/test_tasks.py | Python | agpl-3.0 | 14,729 | 0.00224 |
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# 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 res... | kumar303/rockit | vendor-local/boto/s3/bucket.py | Python | bsd-3-clause | 62,883 | 0.001749 |
"""Modern art."""
from galry import *
import numpy.random as rdn
figure(constrain_ratio=True, antialiasing=True)
# random positions
positions = .25 * rdn.randn(1000, 2)
# random colors
colors = rdn.rand(len(positions),4)
# TRIANGLES: three consecutive points = one triangle, no overlap
plot(primitive_type='TRIANGLES... | rossant/galry | examples/modern_art.py | Python | bsd-3-clause | 365 | 0.00274 |
from os import environ
AWS_ACCESS_KEY_ID = environ["AWS_ACCESS_KEY_ID"]
AWS_SECRET_ACCESS_KEY = environ["AWS_SECRET_ACCESS_KEY"]
BUCKET_NAME = "22board-captchas"
AWS_ROOT_URL = "https://s3-eu-west-1.amazonaws.com/{}/".format(BUCKET_NAME)
| volnt/22board | app/config.py | Python | mit | 240 | 0 |
import logging.config
logging.config.fileConfig("config/logging.conf")
logger = logging.getLogger("temp")
logger.info("Using temperature logger")
| cubiks/rpi_thermo_py | test/test_logging.py | Python | mit | 147 | 0 |
#!/usr/bin/env python3
import argparse
import os
import sys
from ucca.ioutil import get_passages_with_progress_bar, write_passage
desc = """Rename passages by a given mapping of IDs"""
def main(filename, input_filenames, outdir):
os.makedirs(outdir, exist_ok=True)
with open(filename, encoding="utf-8") as f:... | danielhers/ucca | scripts/set_external_id_offline.py | Python | gpl-3.0 | 1,091 | 0.003666 |
# encoding: utf-8
import os
import subprocess
import sys
from workflow import Workflow3 as Workflow, MATCH_SUBSTRING
from workflow.background import run_in_background
import brew_actions
import helpers
GITHUB_SLUG = 'fniephaus/alfred-homebrew'
def execute(wf, cmd_list):
brew_arch = helpers.get_brew_arch(wf)
... | fniephaus/alfred-homebrew | src/brew.py | Python | mit | 12,427 | 0.000644 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
PyPI interface (see http://wiki.python.org/moin/PyPiXmlRpc)
"""
from datetime import datetime
import itertools
import re
import xmlrpclib
from django.template.defaultfilters import slugify
from package.models import Category, Package, Version
from pypi.versioning im... | pythonchelle/opencomparison | apps/pypi/slurper.py | Python | mit | 2,191 | 0.010041 |
# Copyright 2004-2017 Tom Rothamel <pytom@bishoujo.us>
#
# 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, m... | kfcpaladin/sze-the-game | renpy/gl/glblacklist.py | Python | mit | 1,846 | 0 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | rizzatti/luigi | examples/elasticsearch_index.py | Python | apache-2.0 | 3,410 | 0.00176 |
""" heritago URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | TalatCikikci/heritago | heritago/heritago/urls.py | Python | mit | 1,796 | 0.000557 |
my_name='Zed A. Shaw'
my_age=35 #notalie
my_height=74 #inches
my_weight=180 #lbs
my_eyes='Blue'
my_teeth='White'
my_hair='Brown'
print "Let's talk about %s." % my_name
print "He's %d inches tall." % my_height
print "He's %d pounds heavy." % my_weight
print "Actually that's not too heavy."
print "He's got %s eyes and %... | Jumpers/MysoftAutoTest | Step1-PythonBasic/Practices/yuxq/1-5/ex5.py | Python | apache-2.0 | 570 | 0.033333 |
##
# \namespace cross3d.classes
#
# \remarks [desc::commented]
#
# \author Mikeh
# \author Blur Studio
# \date 06/08/11
#
from fcurve import FCurve
from exceptions import Exceptions
from dispatch import Dispatch
from clipboard import Clipboard
from valuerange import ValueRange
from framerange import... | blurstudio/cross3d | cross3d/classes/__init__.py | Python | mit | 434 | 0.016129 |
"""first commit
Revision ID: 97cd7f996752
Revises: 084658cb0aab
Create Date: 2017-05-20 06:49:09.431920
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '97cd7f996752'
down_revision = '084658cb0aab'
branch_labels = None
depends_on = None
def upgrade():
# #... | exleym/IWBT | alembic/versions/97cd7f996752_first_commit.py | Python | apache-2.0 | 552 | 0 |
# -*- coding: utf8 -*-
from __future__ import absolute_import
from django.conf.urls import url, include
from .views import MonitoringView
urlpatterns = [
url(r'^$', MonitoringView.as_view(), name="index"),
url(r'^info/', include('app.modules.monitoring_nodes.info.urls', namespace='info')),
url(r'^plugins/'... | netsuileo/sfu-cluster-dashboard | dashboard/app/modules/monitoring_nodes/urls.py | Python | lgpl-3.0 | 780 | 0.007692 |
# -*- coding: utf-8 -*-
import sys
import subprocess
import signal
import locale
from six import print_
from six.moves import urllib
import requests
class Color:
PURPLE = '\033[95m'
BLUE = '\033[94m'
GREEN = '\033[92m'
ORANGE = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\0... | selectnull/serverscope-benchmark | serverscope_benchmark/utils.py | Python | mit | 2,357 | 0.001273 |
from django.conf.urls.defaults import patterns
from django.conf import settings
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
( r'^$', 'statserver.stats.views.browse' ),
( r'^stats/addnode$', 'statserver.stats.views.addnode... | MiltosD/CEF-ELRC | misc/tools/statserver/urls.py | Python | bsd-3-clause | 427 | 0.032787 |
from __future__ import absolute_import
from .api import Request, Response
from .message import MessageSet
from .types import Int16, Int32, Int64, String, Array, Schema
class ProduceResponse_v0(Response):
API_KEY = 0
API_VERSION = 0
SCHEMA = Schema(
('topics', Array(
('topic', String('... | louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/kafka/protocol/produce.py | Python | mit | 3,232 | 0.001238 |
# -*- coding: utf-8 -*-
"""
* Copyright (C) 2010-2014 Loic BLOT <http://www.unix-experience.fr/>
*
* 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 op... | nerzhul/Z-Eye | service/WebApp/Z_Eye/engine/Switches/API/__init__.py | Python | gpl-2.0 | 3,146 | 0.020979 |
# -*- coding: utf-8 -*-
#
# ask-undrgz system of questions uses data from underguiz.
# Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... | nycholas/ask-undrgz | src/ask-undrgz/ask_undrgz/settings.py | Python | bsd-3-clause | 5,653 | 0.002653 |
#!/usr/bin/env python
# Copyright (c) 2008 Aldo Cortesi
# Copyright (c) 2011 Mounier Florian
# Copyright (c) 2012 dmpayton
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 roger
# Copyright (c) 2014 Pedro Algarvio
# Copyright (c) 2014-2015 Tycho Andersen
#
# Permission is hereby granted, free of charge, to any perso... | de-vri-es/qtile | setup.py | Python | mit | 5,466 | 0.000732 |
from osgeo import gdal, osr, ogr
import numpy as np
import scipy.misc
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("banner-generator")
def create_raster_from_band( red, green, blue, output_file):
logger.debug("Create big raster in output_file : %s"%output_file)
red_ds = gd... | yoms/sentinel-banner-generator | banner_generator.py | Python | apache-2.0 | 6,246 | 0.013289 |
import unittest
import day02.solution as solution
class TestDay02(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_part_one(self):
test_input = [
'abcdef',
'bababc',
'abbcde',
'abcccd',
'aabcdd'... | T-R0D/JustForFun | aoc2018/day02/test/test_solution.py | Python | gpl-2.0 | 1,946 | 0.001542 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name='agarnet',
packages=['agarnet'],
py_modules=['agarnet'],
version='0.2.4',
description='agar.io client and connection toolkit',
install_requires=['websocket-client>=0.32.0'],
aut... | Gjum/agarnet | setup.py | Python | gpl-3.0 | 1,095 | 0.001826 |
#!/usr/bin/env python
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import scipy.io.netcdf as netcdf
import spoisson
import def_radius
from scipy import interpolate
from scipy.interpolate import interp1d
import glob
#plt.ion()
binprec = '>f4'
flag_conf = 2 # 0: samelson, 1: gr... | bderembl/mitgcm_configs | test_pg_hr/input/mygendata.py | Python | mit | 8,360 | 0.035167 |
__author__ = 'ktisha'
def foo(x):
return x
class A():
@staticmethod
@accepts(int, int)
def my_<caret>method():
print "Smth" | IllusionRom-deprecated/android_platform_tools_idea | python/testData/quickFixes/PyMakeMethodStaticQuickFixTest/decoWithParams_after.py | Python | apache-2.0 | 148 | 0.040541 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from PyQt4.QtGui import QLabel
class StatusBar(QLabel):
def __init__(self, status, parent=None):
super(StatusBar, self).__init__(parent)
self.setToolTip("game status bar")
self.setText(status)
def setStatus(self, status):
self.setText(... | aelkikhia/pyduel_engine | pyduel_gui/widgets/game_status_widget.py | Python | apache-2.0 | 560 | 0.003571 |
# Copyright 2013 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... | bigswitch/tempest | tempest/scenario/test_security_groups_basic_ops.py | Python | apache-2.0 | 26,295 | 0 |
# -*- coding: utf-8 -*-
"""Get credentials from file or environment variables"""
from functools import reduce
def dpath(dict_, path):
"""Dig into dictionary by string path. e.g.
dpath({'a': {'b': {'c': 'd'}}}, 'a.b') -> {'c': 'd'}
"""
from operator import getitem
paths = path.split('.')
retu... | leiforion/t1-python | terminalone/utils/credentials.py | Python | bsd-3-clause | 1,971 | 0.000507 |
"""Grab the tips from Options.xml
$Id: extopts.py,v 1.1 2007/01/14 14:07:31 stephen Exp $
Originally ROX-Filer/src/po/tips.py by Thomas Leonard.
"""
from xml.sax import *
from xml.sax.handler import ContentHandler
import os, sys
class Handler(ContentHandler):
data = ""
def startElement(self, tag, attrs):
for x i... | nilsonmorales/Badass | Packages_POU/pre-paquetes/20140430/20140430.pet/usr/share/local/apps/VideoThumbnail/extopts.py | Python | gpl-3.0 | 1,009 | 0.038652 |
import numpy as np
np.set_printoptions(precision=6, suppress=True, linewidth=320)
from numpy import where, zeros, ones, mod, conj, array, dot, angle, complex128 #, complex256
from numpy.linalg import solve
# Set the complex precision to use
complex_type = complex128
def calc_W(n, npqpv, C, W):
"""
Calculatio... | SanPen/GridCal | src/research/power_flow/helm/old/helm_z_pq.py | Python | lgpl-3.0 | 6,030 | 0.002819 |
import platform
import socket
import sys
import os
from mule_local.JobGeneration import *
from mule.JobPlatformResources import *
from . import JobPlatformAutodetect
# Underscore defines symbols to be private
_job_id = None
def get_platform_autodetect():
"""
Returns
-------
bool
True if curren... | schreiberx/sweet | mule/platforms/50_himmuc/JobPlatform.py | Python | mit | 4,801 | 0.016038 |
# ====================================================================
# 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 re... | fnp/pylucene | samples/LuceneInAction/lia/analysis/keyword/KeywordAnalyzerTest.py | Python | apache-2.0 | 2,858 | 0.00035 |
import sys
import os
import unittest
try:
from _pydev_bundle import pydev_monkey
except:
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from _pydev_bundle import pydev_monkey
from pydevd import SetupHolder
from _pydev_bundle.pydev_monkey import pydev_src_dir
class TestCase(unittest.TestCase)... | Soya93/Extract-Refactoring | python/helpers/pydev/tests_pydevd_python/test_pydev_monkey.py | Python | apache-2.0 | 5,544 | 0.00487 |
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
__version__ = '0.1'
from .proxy import Proxy
| mardiros/apium | apium/__init__.py | Python | bsd-3-clause | 122 | 0 |
# -*- coding: utf-8 -*-
u"""
Created on 2015-8-8
@author: cheng.li
"""
from PyFin.Analysis.TechnicalAnalysis.StatelessTechnicalAnalysers import SecuritySignValueHolder
from PyFin.Analysis.TechnicalAnalysis.StatelessTechnicalAnalysers import SecurityAverageValueHolder
from PyFin.Analysis.TechnicalAnalysis.StatelessTec... | wegamekinglc/Finance-Python | PyFin/Analysis/TechnicalAnalysis/__init__.py | Python | mit | 6,089 | 0.007226 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | bswartz/manila | manila/api/middleware/fault.py | Python | apache-2.0 | 3,089 | 0 |
from statistics import mean
from datetime import datetime, timedelta
import calendar
from typing import NamedTuple
from typing import Iterable, Tuple, Dict
from energy_shaper import group_into_profiled_intervals
from .dayanalysis import Usage, get_daily_charges
class MonthUsage(NamedTuple):
""" Represen... | aguinane/qld-tariffs | qldtariffs/monthanalysis.py | Python | mit | 2,897 | 0.000345 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# <yamahata at valinux co jp>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with... | sileht/deb-openstack-quantum | quantum/plugins/ryu/nova/linux_net.py | Python | apache-2.0 | 2,786 | 0.000359 |
from distutils.core import setup
import py2exe
import os, sys
from glob import glob
import PyQt5
data_files=[('',['C:/Python34/DLLs/sqlite3.dll','C:/Python34/Lib/site-packages/PyQt5/icuuc53.dll','C:/Python34/Lib/site-packages/PyQt5/icudt53.dll','C:/Python34/Lib/site-packages/PyQt5/icuin53.dll','C:/Python34/Lib/site-pa... | dedichan/ChemDB | setup_win.py | Python | gpl-3.0 | 1,223 | 0.035159 |
# Copyright (c) 2018 PaddlePaddle 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 app... | QiJune/Paddle | python/paddle/fluid/op.py | Python | apache-2.0 | 10,014 | 0 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
__RCSID__ = "$Id$"
def VmB(vmKey):
__memScale = {"kB": 1024.0, "mB": 1024.0 * 1024.0, "KB": 1024.0, "MB": 1024.0 * 1024.0}
__vmKeys = [
"VmPeak:",
"VmSize:",
"VmLck:... | ic-hep/DIRAC | src/DIRAC/Core/Utilities/MemStat.py | Python | gpl-3.0 | 1,174 | 0.000852 |
#!/usr/bin/env python
from setuptools import setup
setup(
name='YourAppName',
version='1.0',
description='OpenShift App',
author='Your Name',
author_email='example@example.com',
url='http://www.python.org/sigs/distutils-sig/',
install_requires=['Django<=1.4'],
)
| laloxxx20/TiendaVirtual | setup.py | Python | apache-2.0 | 293 | 0 |
from django.db import models
from django.contrib.auth.models import User
from datetime import datetime
from django.utils.translation import ugettext_lazy as _
# relational databases are a terrible way to do
# multicast messages (just ask Twitter) but here you have it :-)
import re
reply_re = re.compile("^@(\w+)")
cl... | claytantor/grailo | feeds/models.py | Python | lgpl-3.0 | 6,456 | 0.006506 |
#!/usr/bin/python
from config import hostname, port, username, password
import carddav
import sogotests
import unittest
import webdavlib
import time
class JsonDavEventTests(unittest.TestCase):
def setUp(self):
self._connect_as_user()
def _connect_as_user(self, newuser=username, newpassword=passwor... | saydulk/sogo | Tests/Integration/test-carddav.py | Python | gpl-2.0 | 6,859 | 0.004228 |
#!/usr/bin/python
# 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.
# This program is distributed in th... | orlandov/parpg-game | local_loaders/xmlmap.py | Python | gpl-3.0 | 13,207 | 0.007496 |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.thermal_zones_and_surfaces import GlazedDoorInterzone
log = logging.getLogger(__name__)
class TestGlazedDoorInterzone(unittest.TestCase):
def setUp(self):
self.fd, ... | rbuffat/pyidf | tests/test_glazeddoorinterzone.py | Python | apache-2.0 | 2,670 | 0.003745 |
"""
Definition of the Prompt class, designed for editing Configuration
with a terminal prompt.
"""
from functools import partial
from prompt_toolkit import prompt
from prompt_toolkit.contrib.regular_languages.compiler import compile as pt_compile
from prompt_toolkit.contrib.completers import Word... | Aluriak/neural_world | neural_world/prompt.py | Python | gpl-2.0 | 4,845 | 0.009701 |
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
__license__ = 'Public Domain'
import codecs
import io
import os
import random
import sys
from .options import (
parseOpts,
)
from .compat import (
compat_expanduser,
compat_getpass,
compat_shlex_split,
workaround_optp... | jbuchbinder/youtube-dl | youtube_dl/__init__.py | Python | unlicense | 18,757 | 0.001546 |
#!/usr/bin/env python
#-*- coding: utf-8 -
import keystoneclient.v2_0.client as keystone
from keystoneauth1.identity import v2
from keystoneauth1 import session
import novaclient.client as nova
import cinderclient.client as cinder
from glanceclient.v1 import client as glance
import neutronclient.v2_0.client as neutron
... | juliend88/os_image_factory | test-tools/pytesting_os/openstackutils.py | Python | gpl-3.0 | 8,608 | 0.015335 |
import os, glob
__all__ = [os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__) + "/*.py")] | dana-i2cat/felix | msjp/module/common/__init__.py | Python | apache-2.0 | 108 | 0.027778 |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
clean_html,
ExtractorError,
determine_ext,
)
class XVideosIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?xvideos\.com/video(?P<id>[0-9]+)(?... | daineseh/kodi-plugin.video.ted-talks-chinese | youtube_dl/extractor/xvideos.py | Python | gpl-2.0 | 2,444 | 0.001227 |
# ===========================================================================
# eXe
# Copyright 2004-2005, University of Auckland
# Copyright 2004-2008 eXe Project, http://eXeLearning.org/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | kohnle-lernmodule/exe201based | exe/export/pages.py | Python | gpl-2.0 | 8,659 | 0.004735 |
# Copyright 2013 Red Hat, 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 agre... | gaolichuang/py-essential | tests/testmods/fbar_foo_opt.py | Python | apache-2.0 | 719 | 0 |
"""
Created on 4/18/17
@author: Numan Laanait -- nlaanait@gmail.com
"""
#MIT License
#Copyright (c) 2017 Numan Laanait
#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, i... | nlaanait/pyxrim | examples/hdf5_export.py | Python | mit | 1,439 | 0.014593 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-assured-workloads | samples/generated_samples/assuredworkloads_v1_generated_assured_workloads_service_create_workload_async.py | Python | apache-2.0 | 1,877 | 0.001598 |
import numpy as np
from skimage import io
def read_image(fn, normalize=True):
"""Read a CCD/CMOS image in .da format (Redshirt). [1_]
Parameters
----------
fn : string
The input filename.
Returns
-------
images : array, shape (nrow, ncol, nframes)
The images (normalized b... | jni/python-redshirt | redshirt/read.py | Python | mit | 2,123 | 0.000471 |
# -*- coding: utf-8 -*-
"""
Version code adopted from Django development version.
https://github.com/django/django
"""
VERSION = (0, 7, 2, 'final', 0)
def get_version(version=None):
"""
Returns a PEP 386-compliant version number from VERSION.
"""
if version is None:
from modeltranslation impor... | yaroslavprogrammer/django-modeltranslation | modeltranslation/__init__.py | Python | bsd-3-clause | 2,020 | 0 |
# ******************************************************************************
# Copyright 2014-2018 Intel Corporation
#
# 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.apa... | NervanaSystems/neon | examples/video-c3d/network.py | Python | apache-2.0 | 2,289 | 0.002184 |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import ntpath
import os
import posixpath
import re
import subprocess
import sys
import gyp.common
import gyp.easy_xml as easy_xml
import gyp.generator... | hkernbach/arangodb | 3rdParty/V8/v5.7.492.77/tools/gyp/pylib/gyp/generator/msvs.py | Python | apache-2.0 | 133,929 | 0.009796 |
"""
Generate simulated logs, placing new items into the queue.
Process the Queue, generating summary data and
appending entries to the log store
"""
import analyzer
import simulatedLogs
# simulate_logs
simulatedLogs.simulate()
# process queue
analyzer.complete()
| rgardler/acs-logging-test | src/runSimulation.py | Python | apache-2.0 | 269 | 0.003717 |
"""
03-delayed-calls.py - Calling a function once, after a given delay.
If you want to setup a callback once in the future, the CallAfter
object is very easy to use. You just give it the function name, the
time to wait before making the call and an optional argument.
"""
from pyo import *
s = Server().boot()
# A fo... | belangeo/pyo | pyo/examples/09-callbacks/03-delayed-calls.py | Python | lgpl-3.0 | 2,090 | 0.000478 |
import StkPortInterfaces.StkDATControlIf
import PortInterface.ProvidedPort
import re
import StkParser.StkPortCriteria
import Components.IComponent
import Parser.IPortCriteria
class StkCHeaderProvDATControlCriteria(StkParser.StkPortCriteria.StkPortCriteria):
"""STK C Header file provided DATControl criteria"""
... | dmanev/ArchExtractor | ArchExtractor/umlgen/Specific/STK/StkParser/StkCFileCriteria/StkCHeaderProvDATControlCriteria.py | Python | gpl-3.0 | 1,064 | 0.007519 |
# Copyright 2020 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | kubeflow/pipelines | sdk/python/kfp/compiler_cli_tests/test_data/two_step_pipeline.py | Python | apache-2.0 | 2,004 | 0 |
# License MIT (https://opensource.org/licenses/MIT).
from . import models
from . import controllers
| it-projects-llc/pos-addons | wechat/__init__.py | Python | mit | 100 | 0 |
"""
CherryPy implements a simple caching system as a pluggable Tool. This tool tries
to be an (in-process) HTTP/1.1-compliant cache. It's not quite there yet, but
it's probably good enough for most sites.
In general, GET responses are cached (along with selecting headers) and, if
another request arrives for the same r... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/cherrypy/cherrypy/lib/caching.py | Python | bsd-3-clause | 17,413 | 0.003963 |
# Copyright 2021 The SLOE Logistic Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | google-research/sloe-logistic | setup.py | Python | apache-2.0 | 1,690 | 0.001183 |
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.core.urlresolvers import reverse
from vkontakte_api.admin import VkontakteModelAdmin
from .models import Album, Video
class VideoInline(admin.TabularInline):
def image(self, instance):
return '<img src="%s" />' % (instance.photo_130,)
... | ramusus/django-vkontakte-video | vkontakte_video/admin.py | Python | bsd-3-clause | 1,566 | 0.002581 |
from ..daltools.util.full import init
Z = [8., 1., 1.]
Rc = init([0.00000000, 0.00000000, 0.48860959])
Dtot = [0, 0, -0.76539388]
Daa = init([
[ 0.00000000, 0.00000000, -0.28357300],
[ 0.15342658, 0.00000000, 0.12734703],
[-0.15342658, 0.00000000, 0.12734703],
])
QUc = init([-7.31176220, 0., 0., -5.432... | fishstamp82/loprop | test/h2o_data.py | Python | gpl-3.0 | 11,431 | 0.017234 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..mesh import MeshWarpMaths
def test_MeshWarpMaths_inputs():
input_map = dict(float_trait=dict(),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_surf=dict(mandatory=True,
),
operat... | mick-d/nipype | nipype/algorithms/tests/test_auto_MeshWarpMaths.py | Python | bsd-3-clause | 1,014 | 0.013807 |
"""
Sensor for checking the status of Hue sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.hue/
"""
import asyncio
import async_timeout
from datetime import timedelta
import logging
import homeassistant.util.dt as dt_util
from homeassistan... | shire210/Shire-HA | custom_components/hue_custom/device_tracker.py | Python | mit | 3,939 | 0.000508 |
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | gelab/mainr | tests/test_pooling.py | Python | gpl-2.0 | 14,346 | 0.00007 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.