code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/python
import zmq
import sys, os
def main():
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect(os.environ["QP_RUN_ADDRESS"])
def send(msg,expected):
print "Send : ", msg
socket.send(msg)
reply = socket.recv()
print "Reply : ", ':'+reply+':'
if (reply !=... | TApplencourt/quantum_package | ocaml/tests/test_task_server.py | Python | gpl-3.0 | 3,246 |
# Copyright (C) 2005 Michael Urman
# -*- coding: utf-8 -*-
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
import warnings
from mutagen._util import DictMixin
from mutagen._com... | bbsan2k/nzbToMedia | libs/mutagen/_file.py | Python | gpl-3.0 | 7,621 |
#!/usr/bin/env python
'''
Applied Python Course, Class1, Exercise 2c
Note, you will need to update the IP and COMMUNITY_STRING to use this script.
'''
import snmp_helper
COMMUNITY_STRING = '********'
ip_addr = '10.10.10.10'
pynet_rtr1 = (ip_addr, COMMUNITY_STRING, 7961)
pynet_rtr2 = (ip_addr, COMMUNITY_STRING, 806... | Collisio-Adolebitque/pfne-2017 | pynet/appliedpy_ecourse/class1/ex2_simple_snmp.py | Python | gpl-3.0 | 694 |
#!/usr/bin/env python
##
# Tests the driver API for making connections and excercizes the networking code
###
from __future__ import print_function
import datetime, os, random, re, socket, sys, tempfile, threading, time, traceback, unittest
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)),... | urandu/rethinkdb | test/rql_test/connections/connection.py | Python | agpl-3.0 | 23,434 |
# -*- coding: utf-8 -*-
"""
Acceptance tests for CMS Video Editor.
"""
import ddt
from common.test.acceptance.pages.common.utils import confirm_prompt
from common.test.acceptance.tests.video.test_studio_video_module import CMSVideoBaseTest
@ddt.ddt
class VideoEditorTest(CMSVideoBaseTest):
"""
CMS Video Ed... | edx-solutions/edx-platform | common/test/acceptance/tests/video/test_studio_video_editor.py | Python | agpl-3.0 | 20,547 |
# -*- coding: utf-8 -*-
{ 'sequence': 500,
"name" : "ChriCar unique View ID"
, "version" : "0.2"
, "author" : "Network Gulf IT - India"
, "website" : "http://www.chricar.at/ChriCar/index.html"
, "description" : """
This module is funded by
| ChriCar Beteiligungs- und Beratungs- GmbH
| http://www.ch... | VitalPet/c2c-rd-addons | chricar_view_id/__openerp__.py | Python | agpl-3.0 | 1,460 |
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | gameduell/kythe | third_party/grpc/src/python/src/grpc/_adapter/_datatypes.py | Python | apache-2.0 | 2,884 |
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | ml-lab/neon | neon/datasets/synthetic.py | Python | apache-2.0 | 4,940 |
"""Support for getting information from Arduino pins."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components import arduino
from homeassistant.const import CONF_NAME
from homeassistant.helpers.entity import Entity
import homeassistant.helpe... | fbradyirl/home-assistant | homeassistant/components/arduino/sensor.py | Python | apache-2.0 | 1,767 |
# Copyright 2014 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | dhermes/gcloud-python | storage/google/cloud/storage/__init__.py | Python | apache-2.0 | 1,504 |
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | arenadata/ambari | ambari-server/src/main/resources/stacks/ADH/1.0/services/ZOOKEEPER/package/scripts/status_params.py | Python | apache-2.0 | 2,702 |
#!/usr/bin/python
#from openflow.optin_manager.sfa.util.sfalogging import logger
class RSpecVersion:
type = None
content_type = None
version = None
schema = None
namespace = None
extensions = {}
namespaces = dict(extensions.items() + [('default', namespace)])
elements = []
enabled =... | dana-i2cat/felix | optin_manager/src/python/openflow/optin_manager/sfa/rspecs/version.py | Python | apache-2.0 | 712 |
import httplib
import logging
#import traceback
from xml.etree.ElementTree import _escape_cdata
from pypes.component import Component
log = logging.getLogger(__name__)
class Solr(Component):
__metatype__ = 'PUBLISHER'
def __init__(self):
# initialize parent class
Component.__init__(self)
... | klyap/pypes | ui/pypesvds/plugins/solrpublisher/solrpublisher.py | Python | apache-2.0 | 8,171 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
# import needed classes/functions from Cocoa
from Foundation import *
from AppKit import *
# import Nib loading functionality from AppKit
from PyObjCTools import NibClassBuilder, AppHelper
from twisted.internet import _threadedselect
... | sorenh/cc | vendor/Twisted-10.0.0/doc/core/examples/threadedselect/Cocoa/SimpleWebClient/Twistzilla.py | Python | apache-2.0 | 2,737 |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | Mirantis/tempest | tempest/api/compute/keypairs/test_keypairs.py | Python | apache-2.0 | 5,296 |
# Copyright (c) 2015 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 ... | infobloxopen/neutron | neutron/agent/ovsdb/impl_idl.py | Python | apache-2.0 | 7,372 |
from queue import LifoQueue, Queue
import signal
from threading import current_thread, Lock, main_thread
from app.util import app_info, log, process_utils
from app.util.singleton import Singleton
class UnhandledExceptionHandler(Singleton):
"""
This class implements functionality to catch and log exceptions i... | nickzuber/ClusterRunner | app/util/unhandled_exception_handler.py | Python | apache-2.0 | 10,423 |
import logging
import os
import random
import luigi.hadoop
import luigi.hdfs
logger = logging.getLogger('luigi-interface')
def fix_paths(job):
"""Coerce input arguments to use temporary files when used for output.
Return a list of temporary file pairs (tmpfile, destination path) and
a list of arguments... | mortardata/luigi | luigi/hadoop_jar.py | Python | apache-2.0 | 2,852 |
# Copyright 2018 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... | gunan/tensorflow | tensorflow/python/training/tracking/data_structures_test.py | Python | apache-2.0 | 43,039 |
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2014, Ravi Sharma
#
# Distributed under the terms of the Lesser GNU General Public License (LGPL)
#-----------------------------------------------------------------------------
'''
Created on Jan 15, 2... | sahilsehgal81/python-api-library | src/kayako/objects/knowledgebase/knowledgebase_category.py | Python | bsd-2-clause | 6,763 |
"""
Comparison of Lomb-Scargle Methods
----------------------------------
This shows a comparison of the Lomb-Scargle periodogram
and the Modified Lomb-Scargle periodogram for a single star,
along with the multi-term results.
"""
# Author: Jake VanderPlas
# License: BSD
# The figure produced by this code is published... | nhuntwalker/astroML | book_figures/chapter10/fig_LS_comparison.py | Python | bsd-2-clause | 2,128 |
from twisted.internet.defer import inlineCallbacks
from txtwitter.tests.fake_twitter import FakeTwitter
from vumi.tests.utils import LogCatcher
from vumi.tests.helpers import VumiTestCase
from vumi.config import Config
from vumi.errors import ConfigError
from vumi.transports.twitter import (
ConfigTwitterEndpoints... | TouK/vumi | vumi/transports/twitter/tests/test_twitter.py | Python | bsd-3-clause | 16,928 |
#!/usr/bin/env python
import os
import sys
import envdir
if __name__ == "__main__":
if 'test' in sys.argv:
env_dir = os.path.join('tests', 'envdir')
else:
env_dir = 'envdir'
envdir.read(os.path.join(os.path.dirname(__file__), env_dir))
from django.core.management import execute_from_... | feedhq/feedhq | manage.py | Python | bsd-3-clause | 374 |
from __future__ import division, absolute_import, print_function
import warnings
import numpy.core.numeric as _nx
from numpy.core.numeric import (
asarray, zeros, outer, concatenate, isscalar, array, asanyarray
)
from numpy.core.fromnumeric import product, reshape
from numpy.core import vstack, atleast_3d
_... | WillieMaddox/numpy | numpy/lib/shape_base.py | Python | bsd-3-clause | 25,222 |
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | eleftherioszisis/NeuroM | neurom/check/tests/test_runner.py | Python | bsd-3-clause | 8,711 |
import numpy as np
import glob
dir2data = "/Volumes/HGST5/APS1504_AlCu/recon/D_Coarsening_2/recon_2/"
prefix = "recon_"
dir2out = "/Volumes/HGST5/APS1504_AlCu/recon/D_Coarsening_2/combine_test/"
flist = glob.glob(dir2data+prefix+"*.bin")
def parse_filename(filename):
t, z = filename.split('.')[0].split('_')[-... | decarlof/timbir | doc/collection/APS_32ID/non-interlaced/combine_bin.py | Python | bsd-3-clause | 889 |
#!/usr/bin/env python
""" Sincronizarea a doua directoare """
import os
import time
import shutil
# pylint: disable=too-many-locals
# pylint: disable=global-statement
OLD_FILESET = dict()
def copyfile(src, dest):
""" Copiaza fisiere cu metadate """
destinatie = os.path.split(dest)
dest = destinatie[0]
... | c-square/python-lab | python/solutii/iulian_bute/sync.py | Python | mit | 2,742 |
from qtpy.QtCore import QTimer
class Spin:
def __init__(self, parent_widget, interval=10, step=1):
self.parent_widget = parent_widget
self.interval, self.step = interval, step
self.info = {}
def _update(self, parent_widget):
if self.parent_widget in self.info:
tim... | daodaoliang/qtawesome | qtawesome/animation.py | Python | mit | 1,284 |
from toontown.coghq.SpecImports import *
GlobalEntities = {1000: {'type': 'levelMgr',
'name': 'LevelMgr',
'comment': '',
'parentEntId': 0,
'cogLevel': 0,
'farPlaneDistance': 1500,
'modelFilename': 'phase_12/models/bossbotHQ/BossbotGreenRoom_A',
'wantDoors': 1},
1... | ksmit799/Toontown-Source | toontown/coghq/BossbotCountryClubGreenRoom_Action00.py | Python | mit | 2,122 |
#! /usr/bin/env python
from asm_test import Asm_Test
class Test_PUSHPOP(Asm_Test):
TXT = '''
main:
MOV EBP, ESP
PUSH 0x11223344
POP EAX
CMP EBP, ESP
JNZ BAD
PUSHW 0x1122
POPW AX
CMP EBP, ESP
JNZ BAD
PUSH ... | amohanta/miasm | test/arch/x86/unit/mn_stack.py | Python | gpl-2.0 | 977 |
#!/usr/bin/python
##########################################################################################################################
#
#
# AES Encrypted Reverse HTTP Shell by:
#
# Dave Kennedy (ReL1K)
# http://www.secmaniac.com
#
####################################################################... | firebitsbr/raspberry_pwn | src/pentest/revshells/encrypted_http_shell/shell.py | Python | gpl-3.0 | 5,129 |
from __future__ import division
import unittest
import os
import logging
import numpy as np
from pele.potentials import _inversepower_cpp
from pele.optimize._quench import lbfgs_cpp
import _base_test
def read_xyzdr(fname, bdim=3):
coords = []
radii = []
rattlers = []
f = open(fname, "r")
while T... | kjs73/pele | pele/potentials/tests/test_inversepower_cpp.py | Python | gpl-3.0 | 1,652 |
#!/usr/bin/env python
#
# Copyright 2007,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opt... | pgoeser/gnuradio | gnuradio-core/src/python/gnuradio/gr/qa_ofdm_insert_preamble.py | Python | gpl-3.0 | 5,627 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Red Hat, Inc.
# Copyright: (c) 2014, Tim Bielawa <tbielawa@redhat.com>
# Copyright: (c) 2014, Magnus Hedemark <mhedemar@redhat.com>
# Copyright: (c) 2017, Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/... | valentin-krasontovitsch/ansible | lib/ansible/modules/files/xml.py | Python | gpl-3.0 | 35,343 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import importlib
from django.apps import Ap... | unho/pootle | pootle/apps/pootle_log/apps.py | Python | gpl-3.0 | 519 |
"""
WSGI config for todolist project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... | kommado/serious-integration | todolist/todolist/wsgi.py | Python | gpl-3.0 | 393 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Stephen Fromm <sfromm@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': ... | EvanK/ansible | lib/ansible/modules/system/user.py | Python | gpl-3.0 | 97,224 |
#!/usr/bin/env python
#
# xliff-cleanup.py <files>
#
# 1. Remove all <file> sections that we do not care about. We only care about the
# the one for our main app and those for our extensions.
#
# 2. Look at all remaining <file> sections and remove those strings that should not
# be localized. Currently that ... | doronkatz/firefox-ios | scripts/xliff-cleanup.py | Python | mpl-2.0 | 2,992 |
#!/usr/bin/python
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# 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 on... | koltegirish/Espruino | scripts/build_board_docs.py | Python | mpl-2.0 | 14,959 |
##############################################################################
#
# Copyright (c) 2008-2011 Alistek Ltd (http://www.alistek.com) All Rights Reserved.
# General contacts <info@alistek.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take th... | kailIII/emaresa | trunk.pe/report_aeroo/wizard/report_actions_remove.py | Python | agpl-3.0 | 4,658 |
'''
Code for migrating from other modulestores to the split_mongo modulestore.
Exists at the top level of modulestore b/c it needs to know about and access each modulestore.
In general, it's strategy is to treat the other modulestores as read-only and to never directly
manipulate storage but use existing api's.
'''
... | eduNEXT/edx-platform | common/lib/xmodule/xmodule/modulestore/split_migrator.py | Python | agpl-3.0 | 11,976 |
import hashlib
def make_hashkey(seed):
'''
Generate a hashkey (string)
'''
h = hashlib.md5()
h.update(str(seed))
return h.hexdigest()
def get_request_ip(request):
'''
Retrieve the IP origin of a Django request
'''
ip = request.META.get('HTTP_X_REAL_IP','') # nginx reverse proxy... | GbalsaC/bitnamiP | xqueue/queue/util.py | Python | agpl-3.0 | 402 |
from __future__ import print_function
from gi.repository import GObject
class C(GObject.GObject):
@GObject.Signal(arg_types=(int,))
def my_signal(self, arg):
"""Decorator style signal which uses the method name as signal name and
the method as the closure.
Note that with python3 anno... | GNOME/pygobject | examples/signal.py | Python | lgpl-2.1 | 1,236 |
# Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | WendellDuncan/or-tools | examples/python/volsay2.py | Python | apache-2.0 | 2,080 |
"""Tests for the Verisure platform."""
from contextlib import contextmanager
from unittest.mock import call, patch
from homeassistant.components.lock import (
DOMAIN as LOCK_DOMAIN,
SERVICE_LOCK,
SERVICE_UNLOCK,
)
from homeassistant.components.verisure import DOMAIN as VERISURE_DOMAIN
from homeassistant.c... | partofthething/home-assistant | tests/components/verisure/test_lock.py | Python | apache-2.0 | 4,819 |
# -*- coding: utf-8 -*-
###############################################################################
#
# FilterPlacesByTopLevelCategory
# Find places by top-level category and near specified latitude, longitude coordinates.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apa... | jordanemedlock/psychtruths | temboo/core/Library/Factual/FilterPlacesByTopLevelCategory.py | Python | apache-2.0 | 5,132 |
##############################################################################
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTW... | smmribeiro/intellij-community | plugins/hg4idea/testData/bin/mercurial/thirdparty/zope/interface/declarations.py | Python | apache-2.0 | 30,880 |
# coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from textw... | 15Dkatz/pants | tests/python/pants_test/backend/python/tasks2/test_python_binary_create.py | Python | apache-2.0 | 2,644 |
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
class DistCogdoCraneMoneyBagAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistCogdoCraneMoneyBagAI")
def setIndex(self, todo0):
pass
def reque... | silly-wacky-3-town-toon/SOURCE-COD | toontown/cogdominium/DistCogdoCraneMoneyBagAI.py | Python | apache-2.0 | 351 |
import os, sys
sys.path.insert(1, "../../../")
import h2o, tests
def deeplearning_multi():
print("Test checks if Deep Learning works fine with a multiclass training and test dataset")
prostate = h2o.import_file(h2o.locate("smalldata/logreg/prostate.csv"))
prostate[4] = prostate[4].asfactor()
h... | brightchen/h2o-3 | h2o-py/tests/testdir_algos/deeplearning/pyunit_multiclassDeepLearning.py | Python | apache-2.0 | 688 |
from functools import wraps
from django.contrib import messages
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import user_passes_test
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers impor... | sonofatailor/django-oscar | src/oscar/views/decorators.py | Python | bsd-3-clause | 5,064 |
#!/usr/bin/python
#----------------------------------------------------------------------
# This module is designed to live inside the "lldb" python package
# in the "lldb.macosx" package. To use this in the embedded python
# interpreter using "lldb" just import it:
#
# (lldb) script import lldb.macosx.heap
#-------... | endlessm/chromium-browser | third_party/llvm/lldb/examples/darwin/heap_find/heap.py | Python | bsd-3-clause | 61,273 |
#!/usr/bin/env python
# *-* coding: UTF-8 *-*
"""Împăratul a primit serie de mesaje importante pe care este
important să le descifreze cât mai repede.
Din păcate mesagerul nu a apucat să îi spună împăratul care au fost
cheile alese pentru fiecare mesaj și tu ai fost ales să descifrezi
misterul.
Informații:
În cr... | iulianbute/labs | python/solutii/alex_mitan/caesar.py | Python | mit | 1,892 |
# -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy Infrastructure Toolkit}.
"""
import sys
import argparse
import textwrap as _textwrap
from entropy.output import decolorize
class ColorfulFo... | mudler/entropy | server/eit/colorful.py | Python | gpl-2.0 | 3,125 |
__version__ = '0.17'
| etherkit/OpenBeacon2 | macos/venv/lib/python3.8/site-packages/PyInstaller/lib/modulegraph/__init__.py | Python | gpl-3.0 | 21 |
#!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# Copyright (c) 2017 Dell Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_versio... | haad/ansible | lib/ansible/modules/network/dellos10/dellos10_command.py | Python | gpl-3.0 | 7,132 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | resmo/ansible | lib/ansible/modules/cloud/google/gcp_cloudscheduler_job.py | Python | gpl-3.0 | 31,832 |
# -*- coding: utf-8 -*-
""" *==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3... | TOC-Shard/moul-scripts | Python/ahnyTrees.py | Python | gpl-3.0 | 4,774 |
from eventlet import patcher
from eventlet.green import socket
from eventlet.green import time
from eventlet.green import httplib
from eventlet.green import ftplib
from eventlet.support import six
if six.PY2:
to_patch = [('socket', socket), ('httplib', httplib),
('time', time), ('ftplib', ftplib)]
... | pbaesse/Sissens | lib/python2.7/site-packages/eventlet/green/urllib/__init__.py | Python | gpl-3.0 | 1,423 |
"""pure-Python sugar wrappers for core 0MQ objects."""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYIN... | IsCoolEntertainment/debpkg_python-pyzmq | zmq/sugar/__init__.py | Python | lgpl-3.0 | 1,187 |
# Copyright 2019 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... | tensorflow/tensorflow | tensorflow/lite/testing/op_tests/batch_to_space_nd.py | Python | apache-2.0 | 4,144 |
# Copyright 2015 CloudByte 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 b... | nikesh-mahalka/cinder | cinder/volume/drivers/cloudbyte/cloudbyte.py | Python | apache-2.0 | 38,259 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicabl... | vichoward/python-neutronclient | neutronclient/neutron/v2_0/credential.py | Python | apache-2.0 | 2,705 |
'''
Created on = '10/1/13'
Author = 'mmunn'
Unit test : EUCA-7710 missing input validation on CLC
setUp : Install Credentials, starts instance
test : run euca-bundle-instance, euca-attach-volume and euca-dettach-volume with bad input parameters
for bucket,prefix... | nagyistoce/eutester | testcases/cloud_admin/3-4/Euca7710.py | Python | bsd-2-clause | 4,008 |
#! /usr/bin/env python
#
# fits2pdf.py -- Image a FITS file as a PDF.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
$ ./fits2pdf.py <fitsfile> <output.pdf>
"""... | rajul/ginga | scripts/fits2pdf.py | Python | bsd-3-clause | 1,754 |
#!/usr/bin/env vpython3
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from blinkpy.web_tests.stale_expectation_removal import builders
from unexpected_passes_common import constants
from... | chromium/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/builders_unittest.py | Python | bsd-3-clause | 2,804 |
# Generated by Django 2.2.6 on 2019-11-05 16:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scanners', '0013_auto_20191105_1522'),
]
operations = [
migrations.AlterField(
model_name='scannerrule',
name='actio... | eviljeff/olympia | src/olympia/scanners/migrations/0014_alter_action_choices_on_scannerrule.py | Python | bsd-3-clause | 536 |
# Generic tests that all raw classes should run
from os import path as op
from numpy.testing import assert_allclose
from mne.datasets import testing
from mne.io import Raw
def _test_concat(reader, *args):
"""Test concatenation of raw classes that allow not preloading"""
data = None
for preload in (True, ... | trachelr/mne-python | mne/io/tests/test_raw.py | Python | bsd-3-clause | 1,809 |
import sys
import re
from functools import wraps
from unittest import TestCase
from scrapy.http import Request
from scrapy.utils.spider import iterate_spider_output
from scrapy.utils.python import get_spec
class ContractsManager(object):
contracts = {}
def __init__(self, contracts):
for contract in ... | 1900/scrapy | scrapy/contracts/__init__.py | Python | bsd-3-clause | 4,024 |
import six
import signal
import logging
import warnings
from twisted.internet import reactor, defer
from zope.interface.verify import verifyClass, DoesNotImplement
from scrapy.core.engine import ExecutionEngine
from scrapy.resolver import CachingThreadedResolver
from scrapy.interfaces import ISpiderLoader
from scrapy... | bdh1011/wau | venv/lib/python2.7/site-packages/scrapy/crawler.py | Python | mit | 11,081 |
# -*- coding: utf-8 -*-
from django.db import models, migrations
def migrate_requested_on(apps, schema_editor):
Changeset = apps.get_model("changeset", "Changeset")
for changeset in Changeset.objects.all():
if not changeset.requested_on:
changeset.requested_on = changeset.committed_on
... | tzhaoredhat/automation | pdc/apps/changeset/migrations/0005_changeset_requested_on_data_migration.py | Python | mit | 543 |
import logging
import os
import ftplib
from urlparse import urlparse
from flexget import plugin
from flexget.event import event
log = logging.getLogger('ftp')
class OutputFtp(object):
"""
Ftp Download plugin
input-url: ftp://<user>:<password>@<host>:<port>/<path to file>
Example: ftp://... | thalamus/Flexget | flexget/plugins/output/ftp_download.py | Python | mit | 6,524 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
extractprojection.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*****... | CS-SI/QGIS | python/plugins/processing/algs/gdal/extractprojection.py | Python | gpl-2.0 | 3,629 |
# -*- coding: utf-8 -*-
from ..internal.OCR import OCR
class GigasizeCom(OCR):
__name__ = "GigasizeCom"
__type__ = "ocr"
__version__ = "0.17"
__status__ = "testing"
__description__ = """Gigasize.com ocr plugin"""
__license__ = "GPLv3"
__authors__ = [("pyLoad Team", "admin@pyload.org")]
... | Arno-Nymous/pyload | module/plugins/captcha/GigasizeCom.py | Python | gpl-3.0 | 496 |
# https://djangosnippets.org/snippets/2533/
import inspect
from django.utils.html import strip_tags
from django.utils.encoding import force_unicode
def process_docstring(app, what, name, obj, options, lines):
# This causes import errors if left outside the function
from django.db import models
# Only lo... | waseem18/oh-mainline | vendor/packages/django-http-proxy/docs/_ext/django_models.py | Python | agpl-3.0 | 1,773 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | mxm/incubator-beam | sdks/python/apache_beam/runners/direct/direct_metrics_test.py | Python | apache-2.0 | 9,689 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... | tylertian/Openstack | openstack F/nova/nova/tests/api/openstack/compute/contrib/test_simple_tenant_usage.py | Python | apache-2.0 | 14,592 |
# 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... | jart/tensorflow | tensorflow/contrib/autograph/pyct/common_transformers/anf_test.py | Python | apache-2.0 | 1,708 |
#
# 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 ... | shahankhatch/aurora | src/main/python/apache/aurora/client/cli/update.py | Python | apache-2.0 | 18,361 |
# Copyright 2013-2015 ARM Limited
#
# 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 w... | bjackman/workload-automation | wlauto/result_processors/standard.py | Python | apache-2.0 | 6,207 |
"""
Filtering and resampling data
=============================
Some artifacts are restricted to certain frequencies and can therefore
be fixed by filtering. An artifact that typically affects only some
frequencies is due to the power line.
Power-line noise is a noise created by the electrical network.
It is composed... | teonlamont/mne-python | tutorials/plot_artifacts_correction_filtering.py | Python | bsd-3-clause | 5,783 |
from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def table_specific(context, table_id):
"""Safely include a fragment specific to the given table, but handle no special info gracefully."""
try:
fragment_path = "table/specific/%s.html" % table_id
... | uscensusbureau/censusreporter | censusreporter/apps/census/templatetags/tabletags.py | Python | mit | 462 |
# Copyright 2016 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... | xuleiboy1234/autoTitle | tensorflow/tensorflow/examples/get_started/regression/dnn_regression.py | Python | mit | 3,579 |
# coding:utf-8
"""
TokenStream represents a stream of tokens that a parser will consume.
TokenStream can be used to consume tokens, peek ahead, and synchonize to a
delimiter token. The tokens that the token stream operates on are either
compiled regular expressions or strings.
"""
import re
LBRACKET = '<'
AT_SYMBO... | glyph/flanker | flanker/addresslib/tokenizer.py | Python | apache-2.0 | 5,495 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | welikecloud/bigtop | bigtop-packages/src/charm/kafka/layer-kafka/lib/charms/layer/bigtop_kafka.py | Python | apache-2.0 | 3,240 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 OpenStack, LLC.
# 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... | gyang/nova | nova/rootwrap/volume.py | Python | apache-2.0 | 1,754 |
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | chrisdunelm/grpc | src/python/grpcio_tests/tests/unit/_from_grpc_import_star.py | Python | apache-2.0 | 836 |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# 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... | ktan2020/legacy-automation | win/Lib/site-packages/SeleniumLibrary/select.py | Python | mit | 9,556 |
"""
Support for EnOcean sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.enocean/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (CONF_NAME, CONF_ID)... | Smart-Torvy/torvy-home-assistant | homeassistant/components/sensor/enocean.py | Python | mit | 1,877 |
'''tzinfo timezone information for Asia/Manila.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Manila(DstTzInfo):
'''Asia/Manila timezone definition. See datetime.tzinfo for details'''
zone = 'Asia/Manila'
_utc_tran... | newvem/pytz | pytz/zoneinfo/Asia/Manila.py | Python | mit | 763 |
'''tzinfo timezone information for America/Kentucky/Monticello.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Monticello(DstTzInfo):
'''America/Kentucky/Monticello timezone definition. See datetime.tzinfo for details'''
... | newvem/pytz | pytz/zoneinfo/America/Kentucky/Monticello.py | Python | mit | 6,463 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
float_or_none,
qualities,
)
class GfycatIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?gfycat\.com/(?P<id>[^/?#]+)'
_TEST = {
'url': 'http://gfycat.com/Deadly... | apllicationCOM/youtube-dl-api-server | youtube_dl_server/youtube_dl/extractor/gfycat.py | Python | unlicense | 2,868 |
import unittest
import os
from os.path import abspath, join
from robot.running.importer import ImportCache
from robot.errors import FrameworkError
from robot.utils.asserts import assert_equal, assert_true, assert_raises
from robot.utils import normpath
class TestImportCache(unittest.TestCase):
def setUp(self):
... | alexandrul-ci/robotframework | utest/running/test_importer.py | Python | apache-2.0 | 2,640 |
# Copyright 2018 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... | jendap/tensorflow | tensorflow/compiler/tests/xla_ops_test.py | Python | apache-2.0 | 12,658 |
"""Support Wink alarm control panels."""
import pywink
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_AR... | sdague/home-assistant | homeassistant/components/wink/alarm_control_panel.py | Python | apache-2.0 | 2,276 |
# 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.
import collections
import logging
import os
import tempfile
import types
from pylib import cmd_helper
from pylib import constants
from pylib.utils import de... | mxOBS/deb-pkg_trusty_chromium-browser | build/android/pylib/utils/md5sum.py | Python | bsd-3-clause | 2,266 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from urllib.parse import parse_qs
from urllib.request import urlopen
from astropy.utils.data import get_pkg_data_contents
from .standard_profile import (SAMPSimpleXMLRPCRequestHandler,
ThreadingXMLRPCServer)
__all__ = []... | pllim/astropy | astropy/samp/web_profile.py | Python | bsd-3-clause | 5,583 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | tsdgeos/snapcraft | integration_tests/test_store_login_logout.py | Python | gpl-3.0 | 1,032 |
# encoding: utf-8
from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
from test.util import running_on_windows
# Quotes in Snippets {{{#
# Test for Bug #774917
def _snip_quote(qt):
return (
('te' + qt + 'st', 'Expand me' + qt + '!', 'test: ' + qt),
('te', 'Bad', ''... | Insanityandme/dotfiles | vim/bundle/ultisnips/test/test_Chars.py | Python | unlicense | 5,521 |
# Copyright (c) - 2014, Clinton Knight All rights reserved.
# Copyright (c) - 2015, Alex Meade. All Rights Reserved.
# Copyright (c) - 2015, Rushil Chugh. All Rights Reserved.
# Copyright (c) - 2015, Tom Barron. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | Hybrid-Cloud/cinder | cinder/tests/unit/volume/drivers/netapp/fakes.py | Python | apache-2.0 | 3,984 |