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 |
|---|---|---|---|---|---|
from osgeo import gdal
import unittest
def GetTiffSize(filename):
"""
returns sixtet of (width, height, minx, miny, maxx, maxy)
from stackoverflow, somewhere
"""
ds = gdal.Open(filename)
width = ds.RasterXSize
height = ds.RasterYSize
gt = ds.GetGeoTransform()
minx = gt[0]
miny =... | ledusledus/elevator | tiff_size.py | Python | apache-2.0 | 729 |
"""Python wrappers around Brain.
This file is MACHINE GENERATED! Do not edit.
"""
from google.protobuf import text_format
from tensorflow.core.framework import op_def_pb2
from tensorflow.python.framework import op_def_registry
from tensorflow.python.framework import ops
from tensorflow.python.ops import op_def_libra... | shishaochen/TensorFlow-0.8-Win | tensorflow/python/ops/gen_data_flow_ops.py | Python | apache-2.0 | 45,781 |
#!/usr/bin/python
# Copyright 2012 Google 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 applic... | AppScale/crisismap | perms_test.py | Python | apache-2.0 | 9,382 |
# -*- coding: utf-8 -*-
"""VGG16 model for Keras.
# Reference
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://arxiv.org/abs/1409.1556)
"""
from __future__ import absolute_import
from __future__ import print_function
from keras.engine import Input
from keras.engine import Model
from ke... | andrewv587/pycharm-project | myFCN/myVgg16.py | Python | apache-2.0 | 3,915 |
__author__ = 'stanley'
from domain.user import *
from google.appengine.api import users
from google.appengine.ext import blobstore
import webapp2
import json
class UploadURLHandler(webapp2.RequestHandler):
def post(self):
usr = user_key(users.get_current_user().email()).get()
if usr is None:
... | nimadini/Teammate | handlers/home/upload_url.py | Python | apache-2.0 | 600 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sorkandu.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| cnu/sorkandu | sorkandu/manage.py | Python | apache-2.0 | 251 |
"""
:synopsis: Unit Tests for Windows iis Module 'state.win_iis'
:platform: Windows
.. versionadded:: 2019.2.2
"""
import pytest
import salt.states.win_iis as win_iis
from tests.support.mock import MagicMock, patch
@pytest.fixture
def configure_loader_modules():
return {win_iis: {}}
def __base_webc... | saltstack/salt | tests/pytests/unit/states/test_win_iis.py | Python | apache-2.0 | 8,811 |
# coding=utf-8
# Copyright 2014 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)
from pants.backend.j... | UnrememberMe/pants | src/python/pants/backend/jvm/register.py | Python | apache-2.0 | 10,635 |
#
# Copyright 2015 Mikhail Titov
#
# 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
#
# Authors:
# - Mikhail Titov, <mikhail.titov@cern.ch>, 20... | mtitov/pyrexplorer | pyrexplorer/spade/element.py | Python | apache-2.0 | 11,003 |
# 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
# distribu... | vbuell/python-javaobj | javaobj.py | Python | apache-2.0 | 31,597 |
# -*- coding: utf-8 -*-
# Copyright: 2011, Grigoriy Petukhov
# Author: Grigoriy Petukhov (http://lorien.name)
# License: BSD
"""
The core of grab package: the Grab class.
"""
from __future__ import absolute_import
import logging
import os
#import urllib
from random import randint, choice
from copy import copy
import th... | boooka/GeoPowerOff | venv/lib/python2.7/site-packages/grab/base.py | Python | apache-2.0 | 25,496 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | google-research/language | language/bert_extraction/steal_bert_classifier/utils/preprocess_distill_input_watermark.py | Python | apache-2.0 | 5,277 |
# Copyright [2015] Hewlett-Packard Development Company, L.P.
# 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... | fabian4/trove | trove/tests/unittests/guestagent/test_vertica_manager.py | Python | apache-2.0 | 16,382 |
# 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... | hehongliang/tensorflow | tensorflow/python/training/checkpointable/util_test.py | Python | apache-2.0 | 72,153 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Zadara Storage Inc.
# Copyright (c) 2011 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
#
# ... | russellb/nova | nova/api/openstack/compute/contrib/virtual_storage_arrays.py | Python | apache-2.0 | 23,474 |
from flask_helpers.ErrorHandler import ErrorHandler
from Persistence.AbstractPersister import AbstractPersister
import io
import json
import pymongo
class Persister(AbstractPersister):
def __init__(
self
):
super(Persister, self).__init__()
self.handler.module="File Persister"
... | dsandersAzure/python_cowbull_server | PersistenceExtensions/File.py | Python | apache-2.0 | 1,914 |
from queues import queue_opencl_devices
from queues import queue_opencl_contexts
from queues import queue_opencl_buffers
from queues import queue_opencl_programs
from queues import queue_opencl_kernels
from queues import queue_opencl_command_queues
from queues import queue_opencl_notify
import sys
from oslo.config impo... | apatriciu/OpenStackOpenCL | computeOpenCL/nova/contrib/OpenCLServer/OpenCLServer.py | Python | apache-2.0 | 23,459 |
#!/usr/bin/env python
#
# Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or... | JoyIfBam5/aws-sdk-cpp | scripts/prepare_regenerate_high_level_sdks.py | Python | apache-2.0 | 3,418 |
#!/usr/bin/env python
#
# Copyright 2014 (c) Lei Xu <eddyxu@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | vsfs/vsfs-bench | ec2/fabfile.py | Python | apache-2.0 | 3,913 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Ericsson 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 ... | EricssonResearch/calvin-base | calvinextras/calvinsys/media/audio/play/BasePlay.py | Python | apache-2.0 | 1,328 |
class Graph():
pointSet = []
# it should be a dict on {point:[list of point it connects]}
pathDic = dict()
pointTime = dict() # points' discover time and finish time
def __init__(self, points, paths):
if set(paths.keys()) - set(points):
print(
"Warning: Some poi... | ccqpein/Arithmetic-Exercises | Depth-First-Search/DFS.py | Python | apache-2.0 | 3,928 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib, json, os, os.path, shutil
class KVStoreLocal (object):
def __init__ (self, path = u"./"):
self._path = path
def __del__ (self):
pass
def set_binary (self, key, value):
try:
with open (self._get_key (key), "wb") as s:
s.write (value)
exc... | c86j224s/memorize | kvstorelocal.py | Python | apache-2.0 | 1,438 |
# EFILTER Forensic Query Language
#
# Copyright 2015 Google 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
#
# Un... | google/dotty | efilter/parsers/dottysql/grammar.py | Python | apache-2.0 | 10,553 |
# Copyright 2019 DeepMind Technologies 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 agr... | deepmind/open_spiel | open_spiel/python/games/data.py | Python | apache-2.0 | 1,333 |
# 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... | alexgorban/models | official/nlp/bert/input_pipeline.py | Python | apache-2.0 | 8,437 |
from setuptools import find_packages
from setuptools import setup
setup(
name="plcd",
version="0.1.0",
provides=["plcd"],
author="gatoatigrado",
author_email="gatoatigrado@gmail.com",
url="https://github.com/gatoatigrado/plcd",
description=(
'This is a python library for facilitati... | gatoatigrado/plcd | setup.py | Python | apache-2.0 | 1,251 |
#!/usr/bin/python
import json
import tempfile
import re
import traceback
DOCUMENTATION = '''
---
module: openshift_resource
short_description: Creates and patches OpenShift resources.
description:
- Creates and patches OpenShift resources idempotently
- based on template or strategic merge patch.
options:
names... | appuio/ansible-role-openshift-zabbix-monitoring | vendor/ansible-module-openshift/library/openshift_resource.py | Python | apache-2.0 | 9,578 |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | google-research/google-research | motion_blur/train/dataset.py | Python | apache-2.0 | 3,453 |
from Cython.TestUtils import CythonTest
from Cython.Compiler.TreeFragment import *
from Cython.Compiler.Nodes import *
from Cython.Compiler.UtilNodes import *
import Cython.Compiler.Naming as Naming
class TestTreeFragments(CythonTest):
def test_basic(self):
F = self.fragment(u"x = 4")
T = F.copy()... | bzzzz/cython | Cython/Compiler/Tests/TestTreeFragment.py | Python | apache-2.0 | 2,243 |
import argparse
import changeling_client.api
import changeling_client.commands
parser = argparse.ArgumentParser()
parser.add_argument('--endpoint', required=True)
subparsers = parser.add_subparsers()
changeling_client.commands.register(subparsers)
def main():
args = parser.parse_args()
service = changelin... | bcwaldon/changeling-client | changeling_client/core.py | Python | apache-2.0 | 386 |
# -*- coding: utf-8 -*-
'''
Created on 2017/09/14
@author: yuyang
'''
import os
import urllib
import uuid
import re
import docx_ext
from docx.shared import Pt
from docx.shared import RGBColor
from docx.shared import Inches
JPEG_EXTENSION = '.jpg'
PNG_EXTENSION = '.png'
GIF_EXTENSION = '.gif'
SPLIT_STRING = '///'
T... | coolcooldool/tencent-weibo-exporter | loginver4/tencent_util.py | Python | apache-2.0 | 10,110 |
# pyOCD debugger
# Copyright (c) 2006-2020 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... | mbedmicro/pyOCD | test/basic_test.py | Python | apache-2.0 | 10,462 |
#!/usr/bin/env python
# -*- coding=utf-8 -*-
'''
Created on 2013-2-2
@author: Joseph
'''
from sqlalchemy.orm import sessionmaker #@UnresolvedImport
from sqlalchemy import create_engine #@UnresolvedImport
from User import User
from sqlalchemy.ext.declarative import declarative_base #@UnresolvedImport
Base = declarative_... | ptphp/PyLib | src/sqlalchemy/main.py | Python | apache-2.0 | 696 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License... | jasonz93/python-tordatahub | tordatahub/errors/__init__.py | Python | apache-2.0 | 3,583 |
from __future__ import absolute_import, unicode_literals
import logging
import os
import re
import urllib
import urlparse
from mopidy import compat
from mopidy.models import Track
from mopidy.utils.encoding import locale_decode
from mopidy.utils.path import path_to_uri, uri_to_path
M3U_EXTINF_RE = re.compile(r'#EXT... | priestd09/mopidy | mopidy/local/translator.py | Python | apache-2.0 | 3,919 |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import os,time
driver = webdriver.Chrome()
driver.get('http://www.ciliba.org/s/MDB-740.html')
time.sleep(3)
driver.execute("confirm")
print(driver.page_source)
driver.close()
driver.quit() | pythonlittleboy/python_gentleman_crawler | test/seleium2.py | Python | apache-2.0 | 268 |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2022 BigML
#
# 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 ... | bigmlcom/python | bigml/tests/create_statistical_tst_steps.py | Python | apache-2.0 | 2,418 |
"""Unit test for endpoint websocket API.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import jsonschema
from treadmill.websocket.api import state
class WSRunningAPITest(unittest.TestCase):
... | captiosus/treadmill | tests/websocket/api/state_test.py | Python | apache-2.0 | 2,300 |
# 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
# d... | openstack/horizon | horizon/templatetags/form_helpers.py | Python | apache-2.0 | 2,432 |
# Copyright 2011 Nicholas Bray
#
# 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... | ncbray/pystream | bin/decompiler/destacker/maindestacker.py | Python | apache-2.0 | 20,089 |
import time
import RPi.GPIO as GPIO
LED_VERDE = 22
LED_VERMELHO = 18
GPIO.setmode(GPIO.BOARD)
GPIO.setup(LED_VERDE, GPIO.OUT)
GPIO.output(LED_VERDE, GPIO.LOW)
GPIO.setup(LED_VERMELHO, GPIO.OUT)
GPIO.output(LED_VERMELHO, GPIO.LOW)
while True:
GPIO.output(LED_VERDE, GPIO.HIGH)
GPIO.output(LED_VERMELHO, GPIO.LO... | ocarneiro/minecraft-pi | lab/blinky.py | Python | apache-2.0 | 441 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Wed Jun 17 16:47:37 2015
# by: The Resource Compiler for PyQt (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x14\x89\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x... | xcgspring/dependence_repo | manager/dependence_repo_manager/ui/resources_rc.py | Python | apache-2.0 | 443,165 |
# -*- coding: utf-8 -*-
"""
https://github.com/block8437/gender.py
"""
import requests, json
def getGenders(names):
url = ""
cnt = 0
for name in names:
if url == "":
url = "name[0]=" + name
else:
url = url + "&name[" + str(cnt) + "]=" + name
cnt += 1
req = requests.get("http://api.genderize.io?" + ur... | aitoralmeida/teseo-viz | gender.py | Python | apache-2.0 | 560 |
from core.models import (
AtmosphereUser, AccountProvider, Group, Identity, Provider, Quota
)
from core.query import only_current, contains_credential
from api.v2.serializers.details.credential import CredentialSerializer
from service.driver import get_esh_driver, get_account_driver
from rtwo.exceptions import Keys... | CCI-MOC/GUI-Backend | api/v2/serializers/post/account.py | Python | apache-2.0 | 11,411 |
"""index_artifacts
Revision ID: 340d5cc7e806
Revises: af3f4bdc27d1
Create Date: 2019-08-09 12:37:50.706914
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "340d5cc7e806"
down_revision = "af3f4bdc27d1"
branch_labels = ()
depends_on = None
def upgrade():
# ... | getsentry/zeus | zeus/migrations/340d5cc7e806_index_artifacts.py | Python | apache-2.0 | 705 |
#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib 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
#
# ... | stdlib-js/stdlib | lib/node_modules/@stdlib/complex/float32/benchmark/python/benchmark.py | Python | apache-2.0 | 2,166 |
"""
FIXME the way the subclasses of Token are private with static isFoo and
accessors is kind of ridiculous.
"""
from .. import exceptions, ConfigOrigin, ConfigValueType
from .ResolveStatus import ResolveStatus
from .Token import Token
from .TokenType import TokenType
class Value(Token):
def __init__(self, val... | chris-martin/hocon-python | hocon/impl/tokens.py | Python | apache-2.0 | 11,757 |
import sst
import sst.actions
# tests for simulate_keys
sst.actions.set_base_url('http://localhost:%s/' % sst.DEVSERVER_PORT)
sst.actions.go_to('/')
sst.actions.assert_title('The Page Title')
sst.actions.write_textfield('text_1', 'Foobar..')
sst.actions.simulate_keys('text_1', 'BACK_SPACE')
sst.actions.simulate_ke... | DramaFever/sst | src/sst/selftests/keys.py | Python | apache-2.0 | 1,307 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sh
import yaml
from behave import *
from assertpy import assert_that
from qingstor.sdk.config import Config
from qingstor.sdk.service.qingstor import QingStor
config = Config().load_user_config()
qingstor = QingStor(config)
test_confi... | Fiile/qsctl | scenarios/steps/rb.py | Python | apache-2.0 | 1,677 |
#
# Copyright 2016 The BigDL 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 ... | intel-analytics/BigDL | python/ppml/src/bigdl/ppml/algorithms/hfl_nn.py | Python | apache-2.0 | 1,511 |
#!/usr/bin/python
# Python modules imports
from optparse import OptionParser, make_option
import pyupm_grove as g
import os, sys, socket, uuid, dbus, dbus.service
import dbus.mainloop.glib
#import gardening_system
try:
from gi.repository import GObject
except ImportError:
import gobject as GObject
# Set up consta... | TheIoTLearningInitiative/CodeLabs | Sandbox/Edison_Bluetooth/projects/gardening-system/spp.py | Python | apache-2.0 | 3,138 |
__author__ = 'fengguanhua'
| davidvon/pipa-pay-server | admin/utils/__init__.py | Python | apache-2.0 | 28 |
import pandas as pd
import numpy as np
from random import sample
from sklearn.ensemble import RandomForestClassifier
def ML_BuySell(all_data, predictDate, predictors, previous_results, limit=0.0051,
limit_comp=np.arange(-.015, 0.02, 0.001), days_previous=252, train_split=0.8, n=3,acc_limit=0.75):
"... | simonward86/MySJcLqwwx | ML_predict.py | Python | apache-2.0 | 3,255 |
from hamcrest import assert_that
from allure_commons_test.report import has_test_case
from allure_commons_test.result import with_status
from allure_commons_test.result import has_status_details
from allure_commons_test.result import with_message_contains
from allure_commons_test.result import with_trace_contains
def... | allure-framework/allure-python | allure-pytest/test/acceptance/status/xfail_call_status_test.py | Python | apache-2.0 | 4,151 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 compli... | sridevikoushik31/openstack | nova/tests/test_metadata.py | Python | apache-2.0 | 22,819 |
from django import forms
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from grandchallenge.core.templatetags.remove_whitespace import oxford_comma
from grandchallenge.policies.models import Policy
from grandchallenge.profiles.models import UserProfile
class User... | comic/comic-django | app/grandchallenge/profiles/forms.py | Python | apache-2.0 | 2,671 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 compli... | maoy/zknova | nova/image/s3.py | Python | apache-2.0 | 16,517 |
# coding=utf-8
# Copyright 2018 The DisentanglementLib 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
#
# Un... | google-research/disentanglement_lib | disentanglement_lib/utils/aggregate_results.py | Python | apache-2.0 | 2,233 |
from zope.interface import Interface
class IEcoregion(Interface):
"""marker
"""
class IImage(Interface):
"""marker
"""
| clld/tsammalex | tsammalex/interfaces.py | Python | apache-2.0 | 139 |
# -*- coding: utf-8 -*-
# Copyright 2013 Google 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 require... | GoogleCloudPlatform/gsutil | gslib/tests/test_notification.py | Python | apache-2.0 | 6,042 |
"""
WSGI config for mjuna 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.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mjuna.settings")
from django.core.wsgi ... | timokoola/mjuna | mjuna/mjuna/wsgi.py | Python | apache-2.0 | 385 |
import os
import sys as sys
os.system("python bot/bot.py engage")
import bot_response as bot
import bot_learn as learner
def hasUserSwore(message):
if "fuck" in message:
return True
elif "bitch" in message:
return True
elif "Fuck" in message:
re... | indie-dev/Clarissa | bot.py | Python | apache-2.0 | 2,985 |
"""
Models from Godley & Lavoie text.
[G&L 2012] "Monetary Economics: An Integrated Approach to credit, Money, Income, Production
and Wealth; Second Edition", by Wynne Godley and Marc Lavoie, Palgrave Macmillan, 2012.
ISBN 978-0-230-30184-9
Copyright 2016 Brian Romanchuk
Licensed under the Apache License, Version 2.... | brianr747/SFC_models | sfc_models/gl_book/__init__.py | Python | apache-2.0 | 2,795 |
# -*- coding: utf-8 -*-
'''
Module for Sending Messages via XMPP (a.k.a. Jabber)
.. versionadded:: 2014.1.0
:depends: - sleekxmpp python module
:configuration: This module can be used by either passing a jid and password
directly to send_message, or by specifying the name of a configuration
profile in the m... | rtx3/saltstack-deyunio | srv/salt/modules/xmpp.py | Python | apache-2.0 | 5,646 |
from __future__ import absolute_import, print_function, unicode_literals
from io import BytesIO
import warnings
try:
from unittest import mock
except ImportError:
import mock
try:
import msgpack
HAVE_MSGPACK = True
except:
warnings.warn(
"Cannot import msgpack. It is necessary for using ... | pystorm/pystorm | test/pystorm/serializers/test_msgpack_serializer.py | Python | apache-2.0 | 1,997 |
class Symbol(object):
def __init__(self, num, name):
pass
| lodevil/pyparser | pyparser/symbol.py | Python | apache-2.0 | 72 |
#!/usr/bin/env python
"""models.py
Udacity conference server-side Python App Engine data & ProtoRPC models
$Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $
created/forked from conferences.py by wesc on 2014 may 24
"""
import httplib
import endpoints
from protorpc import messages
from google.appengine.ext impor... | gersakbogdan/fsnd-conference | models.py | Python | apache-2.0 | 5,554 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018, Eric Jacob <erjac77@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | GabrielFortin/ansible-module-f5bigip | library/f5bigip_gtm_monitor_smtp.py | Python | apache-2.0 | 5,320 |
# Copyright 2018 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... | GoogleCloudPlatform/python-docs-samples | functions/billing/main.py | Python | apache-2.0 | 7,657 |
"""
A set of tests that check different cases for the network tester
"""
#python
#third-party
from mock import MagicMock
import nose
#from apetools.tools import networkcheck
from apetools.tools import timetorecovery as ttr
from apetools.tools import networktester
from apetools.commons import errors
def test_case_1(... | rsnakamura/oldape | tests/testunits/testtools/testnetwork/test_network.py | Python | apache-2.0 | 1,234 |
import ctypes
FILE_ATTRIBUTE_HIDDEN = 0x02
def hideFiles(folderPath):
print '[*] Hiding files'
try:
ctypes.windll.kernel32.SetFileAttributesW.argtypes = (ctypes.c_wchar_p, ctypes.c_uint32)
ret = ctypes.windll.kernel32.SetFileAttributesW(folderPath.encode('string-escape'), FILE_ATTRIBUTE_HIDDEN)... | mehulj94/BrainDamage | Breathe/hideme.py | Python | apache-2.0 | 582 |
from ionyx.contrib import Logger
print('Beginning logger test...')
path = '/home/john/temp/log.txt'
logger = Logger(path, mode='replace')
logger.write("Testing replace mode")
logger.close()
logger = Logger(path, mode='append')
logger.write("Testing append mode")
logger.close()
print('Done.')
| jdwittenauer/ionyx | tests/logger_test.py | Python | apache-2.0 | 297 |
#!/usr/bin/env python3
# Copyright 2017 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... | vjpai/grpc | tools/run_tests/sanity/check_port_platform.py | Python | apache-2.0 | 2,915 |
# fabfile.py
# TODO - Description.
#
###########################################################################
##
## Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the Lice... | adobe-research/spark-cluster-deployment | application-deployment-fabfile.py | Python | apache-2.0 | 4,180 |
# Copyright 2011 Tsutomu Uchino
#
# 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 ... | hanya/MRI | pythonpath/mytools_Mri/web.py | Python | apache-2.0 | 12,480 |
# (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Copyright 2014 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
#
# ... | Akrog/cinder | cinder/zonemanager/drivers/brocade/brcd_fabric_opts.py | Python | apache-2.0 | 2,207 |
from django.conf.urls import patterns, url
from proxy import views
urlpatterns = patterns('',
url(r'^$', views.search, name='search'),
url(r'^(?P<bucket_name>\S+?)(?P<key>/\S*)', views.get, name='get')
)
| stuart-warren/django-s3-proxy | proxy/urls.py | Python | apache-2.0 | 214 |
# 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... | tanglei528/glance | glance/tests/unit/v2/test_registry_client.py | Python | apache-2.0 | 24,618 |
#!/usr/bin/python
#
# Copyright 2011 Google 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... | nearlyfreeapps/python-googleadwords | tests/adspygoogle/adwords/v201206/error_handling_unittest.py | Python | apache-2.0 | 2,306 |
# Copyright 2020 Tensorforce Team. 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 applicable la... | reinforceio/tensorforce | tensorforce/core/parameters/__init__.py | Python | apache-2.0 | 1,826 |
import json
import os
import unittest
from unittest.mock import patch
from app.vcap_services import get_database_uri
VCAP_SERVICES = {
'cleardb': [
{
'credentials': {
'username': 'vcap_user',
'password': 'vcap_pass',
'hostname': '127.0.0.2',
... | nyu-devops-echo/shopcarts | tests/test_vcap_services.py | Python | apache-2.0 | 1,188 |
#
# 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... | iemejia/incubator-beam | sdks/python/apache_beam/transforms/display_test.py | Python | apache-2.0 | 9,047 |
from .responses import SecretsManagerResponse
url_bases = [r"https?://secretsmanager\.(.+)\.amazonaws\.com"]
url_paths = {"{0}/$": SecretsManagerResponse.dispatch}
| spulec/moto | moto/secretsmanager/urls.py | Python | apache-2.0 | 166 |
# This code is copied and adapted from Andrej Karpathy's code for learning to
# play Pong https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import numpy as np
import os
import ... | atumanov/ray | examples/rl_pong/driver.py | Python | apache-2.0 | 7,324 |
"""
Copyright 2020 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | googleinterns/debaised-analysis | intents/util/enums.py | Python | apache-2.0 | 2,574 |
from Launchpad import Launchpad
def create_instance(c_instance):
""" Creates and returns the Launchpad script """
return Launchpad(c_instance)
from _Framework.Capabilities import * # noqa
def get_capabilities():
return {
CONTROLLER_ID_KEY: controller_id(vendor_id=4661, product_ids=[14], model_name='Launchpa... | jim-cooley/abletonremotescripts | remote-scripts/samples/Launchpad95/__init__.py | Python | apache-2.0 | 425 |
"""
PackageProvidesJava - command ``/bin/echo {java_command_package}``
==================================================================
.. warning::
This module is deprecated, please use
:mod:`insights.parsers.package_provides` instead.
This command reads the output of the pre-command:
``for jp in `/bin/p... | RedHatInsights/insights-core | insights/parsers/package_provides_java.py | Python | apache-2.0 | 3,087 |
# Copyright 2014-2017 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | F5Networks/f5-common-python | f5/bigip/tm/gtm/test/unit/test_server.py | Python | apache-2.0 | 2,388 |
import tensorflow as tf
from .template import BaseLayer
class ToFloat(BaseLayer):
def _train_fprop(self, state_below):
return tf.to_float(state_below, name='ToFloat')
class ToInt32(BaseLayer):
def _train_fprop(self, state_below):
return tf.to_int32(state_below, name='ToInt32')
| hycis/TensorGraph | tensorgraph/layers/cast.py | Python | apache-2.0 | 306 |
"""
Test ants.learn module
nptest.assert_allclose
self.assertEqual
self.assertTrue
"""
import os
import unittest
from common import run_tests
from tempfile import mktemp
import numpy as np
import numpy.testing as nptest
import ants
class TestModule_surface(unittest.TestCase):
def setUp(self):
pass
... | ANTsX/ANTsPy | tests/test_viz.py | Python | apache-2.0 | 3,081 |
#
# 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... | bhardesty/qpid-dispatch | tests/system_tests_fallback_dest.py | Python | apache-2.0 | 29,872 |
# 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/licenses/LICENSE-2.0
#
# Unless required b... | salv-orlando/MyRepo | nova/tests/api/openstack/contrib/test_diskconfig.py | Python | apache-2.0 | 5,871 |
# pyOCD debugger
# Copyright (c) 2006-2015 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... | mbedmicro/pyOCD | test/json_lists_test.py | Python | apache-2.0 | 7,561 |
# encoding: utf-8
# Copyright 2012 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 applica... | redhat-imaging/imagefactory | imagefactory_plugins/Rackspace/__init__.py | Python | apache-2.0 | 668 |
#
# Copyright (c) 2011 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
#
# Unles... | openstack/heat | heat/common/policy.py | Python | apache-2.0 | 7,615 |
# Copyright 2015 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... | shakamunyi/tensorflow | tensorflow/python/framework/ops.py | Python | apache-2.0 | 181,558 |
# 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 agreed to in writ... | googleapis/python-compute | samples/ingredients/instances/custom_hostname/get.py | Python | apache-2.0 | 1,531 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM-SVC (Support Vector Classification)
=========================================================
The classification application of the SVM is used below. The
`Iris <http://en.wikipedia.org/wiki/Iris_flower_data_set... | hackliff/domobot | kinect/pySVM/test/plotLinearSVC.py | Python | apache-2.0 | 1,628 |
#!/usr/bin/env python
import os
from distutils.core import setup
def _fullsplit(path, result=None):
"""
Split a pathname into components (the opposite of os.path.join) in a
platform-neutral way.
"""
if result is None:
result = []
head, tail = os.path.split(path)
if head == '':
... | slipstream/SlipStreamClient | client/src/setup.py | Python | apache-2.0 | 2,355 |
# Copyright (c) 2016 Pani Networks 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 req... | romana/networking-romana | networking_romana/driver/ipam_romana.py | Python | apache-2.0 | 15,559 |