repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
pwong-mapr/private-hue
desktop/libs/liboozie/src/liboozie/oozie_api_test.py
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
bjuvensjo/scripts
vang/bitbucket/tests/test_get_clone_urls_grep.py
from unittest.mock import call, patch import pytest from pytest import raises from vang.bitbucket.get_clone_urls_grep import get_clone_urls_grep from vang.bitbucket.get_clone_urls_grep import main from vang.bitbucket.get_clone_urls_grep import parse_args @pytest.fixture def projects_fixture(): return [{ ...
Intel-Corp/CPU-Manager-for-Kubernetes
tests/mockhttp.py
# Copyright (c) 2017 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
Juniper/contrail-horizon
overrides.py
from django.utils.translation import ugettext_lazy as _ import horizon from contrail_openstack_dashboard.openstack_dashboard.dashboards.project.networking.panel \ import Networking from contrail_openstack_dashboard.openstack_dashboard.dashboards.admin.networking.panel \ import AdminNetworking from contrail_op...
yiqingj/airflow
airflow/migrations/versions/211e584da130_add_ti_state_index.py
# -*- coding: utf-8 -*- # # 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 ...
huggingface/pytorch-transformers
src/transformers/data/datasets/glue.py
# Copyright 2020 The HuggingFace 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 applicabl...
homhei/glance
glance/glance_agent/manager.py
#!/usr/bin/env python #encode=utf-8 #vim: tabstop=4 shiftwidth=4 softtabstop=4 #Created on 2013-8-17 #Copyright 2013 nuoqingyun xuqifeng import re from oslo.config import cfg from glance import manager from glance.utils import importutils from glance.glance_agent import rpcapi rpcapi_opts = [ ...
traai/async-deep-rl
algorithms/atari_environment.py
""" Code based on: https://github.com/coreylynch/async-rl/blob/master/atari_environment.py """ """ The MIT License (MIT) Copyright (c) 2016 Corey Lynch Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal ...
yeontaek/Basic-of-Tensorflow
02.Gradient Descent/02.cost.py
# -*- coding: utf-8 -*- """ Created on Sun Jan 15 16:10:01 2017 @author: 오연택 """ import tensorflow as tf x_data = [1., 2., 3.] y_data = [1., 2., 3.] W = tf.Variable(tf.random_uniform([1], -10.0, 10.0)) X = tf.placeholder(tf.float32) Y = tf.placeholder(tf.float32) #our hypothesis hypothesis = W * X #Simplified co...
tseaver/gcloud-python
pubsub/setup.py
# 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...
SU-ECE-17-7/ibeis
ibeis/viz/interact/interact_query_decision.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import six import utool as ut from ibeis import constants as const # NOQA from plottool import interact_helpers as ih import plottool as pt from ibeis.viz.interact import interact_matches # NOQA # from ibeis.gui...
MissionCriticalCloud/marvin
marvin/cloudstackAPI/deleteServiceOffering.py
"""Deletes a service offering.""" from baseCmd import * from baseResponse import * class deleteServiceOfferingCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "false" """the ID of the service offering""" """Required""" self.id = None self.typeInfo['id'] ...
akmcinto/TodoApp
ToDoApp/todo/apps.py
""" Copyright 2016 Andrea McIntosh 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 i...
henjo/pyoa
Scripts/pyDDDSpecialCases.py
#******************************************************************* # Copyright 2002-2008 LSI 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...
shojikai/python-google-api-clients
test/test_bigquery_insert.py
import os import signal import sys import time import unittest from pprint import pprint sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + '/../') from google_api_clients.bigquery import BigQuery from google_api_clients.bigquery.errors import BigQueryError class BigQueryTest(unittest.TestCase): de...
tuskar/tuskar-ui
openstack_dashboard/dashboards/project/access_and_security/tabs.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (...
biocommons/hgvs
tests/test_hgvs_validator.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import os import unittest import pytest from hgvs.exceptions import HGVSInvalidVariantError import hgvs.dataproviders.uta import hgvs.variantmapper import hgvs.parser import hgvs.validator from support import ...
fwalch/python-client
neovim/__init__.py
"""Python client for Nvim. Client library for talking with Nvim processes via it's msgpack-rpc API. """ import logging import os from .api import DecodeHook, Nvim, SessionHook from .msgpack_rpc import (socket_session, spawn_session, stdio_session, tcp_session) from .plugins import PluginHost...
FundersClub/bai-lockbox
setup.py
import os from setuptools import find_packages, setup os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() setup( name='bai-lockbox', version='0.0.7', packages=find_packages(e...
googleinterns/multimodal-long-transformer-2021
src/data/pretrain_dataloader.py
# Copyright 2021 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 writin...
rajalokan/nova
nova/api/openstack/placement/util.py
# 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...
carnadaxxx/lotizados
src/Contratos/migrations/0001_initial.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-03-17 00:04 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('Client...
google/objax
tests/resnet_v2.py
# 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, ...
mekkablue/Inverter
Inverter.glyphsFilter/Contents/Resources/plugin.py
# encoding: utf-8 from __future__ import division, print_function, unicode_literals ########################################################################################################### # # # Filter with dialog Plugin # # Read the docs: # https://github.com/schriftgestalt/GlyphsSDK/tree/master/Python%20Templates...
aaxelb/SHARE
share/transformers/oai.py
import re import logging from share.transform.chain import ctx, ChainTransformer, links as tools from share.transform.chain.exceptions import InvalidIRI from share.transform.chain.parsers import Parser from share.transform.chain.utils import force_text, oai_allowed_by_sets logger = logging.getLogger(__name__) def ...
mrbean-bremen/pyfakefs
pyfakefs/pytest_tests/conftest.py
# 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 t...
saltstack/salt
salt/runners/network.py
""" Network tools to run from the Master """ import logging import socket import salt.utils.files import salt.utils.network import salt.utils.stringutils log = logging.getLogger(__name__) def wollist(maclist, bcast="255.255.255.255", destport=9): """ Send a "Magic Packet" to wake up a list of Minions. ...
imperial-genomics-facility/data-management-python
setup.py
import os import sys from setuptools import setup tests_require = ["unittest2"] base_dir = os.path.dirname(os.path.abspath(__file__)) version = "0.0.2" setup( name = "data-management-python", version = version, description = "A python library for data analysis", long_description="\n\n"...
googleapis/python-datacatalog
samples/generated_samples/datacatalog_generated_datacatalog_v1beta1_data_catalog_delete_entry_group_async.py
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
pcmoritz/ray-1
python/ray/tune/suggest/suggestion.py
import copy import glob import logging import os from typing import Dict, Optional, List from ray.util.debug import log_once logger = logging.getLogger(__name__) UNRESOLVED_SEARCH_SPACE = str( "You passed a `{par}` parameter to {cls} that contained unresolved search " "space definitions. {cls} should however...
novafloss/multipart-reader
tests/test_multidict.py
import sys import unittest from multipart_reader.multidict import (MultiDictProxy, MultiDict, CIMultiDictProxy, CIMultiDict) from multipart_reader import multidict class _Root: cls = None ...
pongem/python-bot-project
appengine/standard/storage/appengine-client/main_test.py
# Copyright 2017 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 applicable law or a...
ARM-software/mbed-beetle
tools/build_api.py
""" mbed SDK Copyright (c) 2011-2013 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 wr...
MissionCriticalCloud/marvin
marvin/cloudstackAPI/listStorageTags.py
"""Lists storage tags""" from baseCmd import * from baseResponse import * class listStorageTagsCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "false" """List by keyword""" self.keyword = None self.typeInfo['keyword'] = 'string' """""" self.page...
appium/python-client
test/functional/android/keyboard_tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # 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...
keras-team/keras
keras/losses.py
# 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...
eayunstack/neutron
neutron/tests/unit/objects/test_rbac_db.py
# 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...
Clever/clever-oauth-examples
python/test.py
import json import os import unittest from bottle import request, BottleException, HTTPResponse from requests import get, post import responses #Set environment variables before importing server os.environ['CLIENT_ID'] = 'foo' os.environ['CLIENT_SECRET'] = 'foo' os.environ['DISTRICT_ID'] = 'foo' import server ACCES...
oudalab/phyllo
phyllo/extractors/malaterraDB.py
import sqlite3 import urllib import re from urllib.request import urlopen from bs4 import BeautifulSoup from phyllo.phyllo_logger import logger # Case 1: Sections split by numbers (Roman or not) followed by a period, or bracketed. Subsections split by <p> tags def parsecase1(ptags, c, colltitle, title, author, date, ...
Hybrid-Cloud/badam
fs_patches_of_hybrid_cloud/cherry_for_111T/nova_cascading/nova/network/neutronv2/api.py
# Copyright 2012 OpenStack Foundation # All Rights Reserved # Copyright (c) 2012 NEC 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.apache.org/lic...
tensorflow/model-optimization
tensorflow_model_optimization/python/core/clustering/keras/clusterable_layer.py
# 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...
pivotal-energy-solutions/django-datatable-view
datatableview/datatables.py
# -*- coding: utf-8 -*- import re import copy import operator from collections import OrderedDict from django.core.exceptions import FieldDoesNotExist from functools import reduce from django.template.loader import render_to_string from django.db.models import QuerySet from django.utils.encoding import force_str f...
Leaderman/pyspark
1.2.0/dev/wapvideodownload_cdn_province_isp_idc.py
# -*- encoding:utf-8 -*- from pyspark import SparkConf, SparkContext from pyspark.sql import HiveContext import numpy as np from pandas import * import pandas as pd conf = SparkConf().setAppName("wapvideodownload_cdn_province_isp_idc") sc = SparkContext(conf=conf) hc = HiveContext(sc) def split_idc(idc): if id...
laurenor/SchoolIdolAPI
web/donations.py
donations = [ { 'price': 1, 'thanks': True, 'col_size': 12, }, { 'price': 5, 'thanks': True, 'link': True, 'col_size': 12, }, { 'price': 10, 'thanks': True, 'link': True, 'postcard': True, 'status': 'SUP...
redhat-imaging/imagefactory
imagefactory_plugins/setup.py
# Copyright 2011 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 agreed t...
rednaxelafx/apache-spark
python/pyspark/sql/tests/test_readwriter.py
# # 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...
tensorflow/federated
tensorflow_federated/python/core/impl/execution_contexts/cpp_sync_execution_context.py
# Copyright 2022, The TensorFlow Federated 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 o...
lionleaf/dwitter
dwitter/models.py
import re from django.db import models from django.utils.functional import cached_property from django.contrib.auth import get_user_model from django.contrib.auth.models import User from django.dispatch import receiver from django.db.models.signals import pre_delete, post_save, m2m_changed from math import log from dat...
googleapis/python-monitoring
samples/snippets/v3/cloud-client/quickstart.py
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
ros2/rclpy
rclpy/test/mock_compat.py
# Copyright 2018 Open Source Robotics Foundation, 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...
tensorflow/lingvo
lingvo/core/gshard_utils.py
# Lint as: python3 # Copyright 2020 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 ...
blueyed/coveragepy
tests/test_html.py
# -*- coding: utf-8 -*- # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests that HTML generation is awesome.""" import datetime import glob import json import os import os.path import re import sys import ...
box/etcdb
etcdb/execute/dml/delete.py
""" Implement DELETE query. """ from etcdb.eval_expr import eval_expr from etcdb.execute.dml.insert import get_table_columns from etcdb.execute.dml.select import list_table, get_row_by_primary_key from etcdb.lock import WriteLock def _delete_key(etcd_client, key): etcd_client.delete(key) def execute_delete(etcd...
malongge/selenium-pom
pages/home_page.py
from selenium.webdriver.common.by import By from .login_page import _LoginPage class HomePage(_LoginPage): _page_title = "我的佳缘_世纪佳缘交友网" # 元素定位 _inbox_loc = (By.CSS_SELECTOR, '.cp-menu-card-mail .menu-left') _login_layer_ad_loc = (By.ID, 'usercp_dltc_div') def home_page_and_close_lay...
victorywang80/Maintenance
saltstack/src/salt/states/eselect.py
# -*- coding: utf-8 -*- ''' Management of Gentoo configuration using eselect ================================================ A state module to manage Gentoo configuration via eselect .. code-block:: yaml profile: eselect.set: target: hardened/linux/amd64 ''' # Define a function alias in ord...
oudalab/phyllo
phyllo/extractors/annalesvedastiniDB.py
import sqlite3 import urllib from urllib.request import urlopen from bs4 import BeautifulSoup, NavigableString import nltk nltk.download('punkt') from nltk import sent_tokenize def parseRes2(soup, title, url, cur, author, date, collectiontitle): chapter = 1 sen = "" num = 1 [e.extract() for e in sou...
laserson/phip-stat
phip/cli.py
# Copyright 2016 Uri Laserson # # 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,...
dstufft/cryptography
tests/hazmat/primitives/test_3des.py
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
deepmind/neural_testbed
neural_testbed/real_data/data_sampler.py
# python3 # pylint: disable=g-bad-file-header # Copyright 2021 DeepMind Technologies Limited. 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...
sassoftware/catalog-service
catalogService_test/mockedModules/mint/config.py
#!/usr/bin/python # # Copyright (c) SAS Institute 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...
telefonicaid/fiware-puppetwrapper
acceptance_tests/component/generate/features/steps.py
__author__ = 'arobres' # -*- coding: utf-8 -*- from commons.rest_utils import RestUtils from commons.constants import ACTION, VERSION, OP_SOFTWARE_NAME, UNINSTALL, AUTH_TOKEN_HEADER, TENANT_ID_HEADER, \ CONTENT_TYPE, ACCEPT_HEADER import commons.assertions as Assertions import commons.fabric_utils as Fabutils from...
lorensen/VTKExamples
src/Python/GeometricObjects/PolygonIntersection.py
#!/usr/bin/env python from __future__ import print_function import vtk def main(): # Create a square in the x-y plane. points = vtk.vtkPoints() points.InsertNextPoint(0.0, 0.0, 0.0) points.InsertNextPoint(1.0, 0.0, 0.0) points.InsertNextPoint(1.0, 1.0, 0.0) points.InsertNextPoint(0.0, 1.0, 0.0...
dprince/tripleo-heat-templates
docker/container-puppet.py
#!/usr/bin/env python # # 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 ...
tensorflow/federated
tensorflow_federated/python/simulation/__init__.py
# Copyright 2018, The TensorFlow Federated 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 o...
Kim-Seonghyeon/youtube_8m
scene_train.py
# Copyright 2016 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 applicable law or ...
jameskeaveney/ElecSus
elecsus/libs/durhamcolours.py
# Copyright 2014 M. A. Zentile, J. Keaveney, L. Weller, D. Whiting, # C. S. Adams and I. G. Hughes. # 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...
google-research/google-research
ipagnn/adapters/adapters_lib.py
# 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...
tejal29/pants
tests/python/pants_test/tasks/test_base.py
# 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) import os import sub...
google/aiyprojects-raspbian
src/examples/vision/image_classification_camera.py
#!/usr/bin/env python3 # # Copyright 2017 Google 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 ...
potsmaster/cinder
cinder/api/contrib/quotas.py
# Copyright 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 # # Unless requ...
spencerahill/aospy-obj-lib
aospy_user/calcs/stats.py
"""Functions related to statistical methods.""" from aospy.utils.vertcoord import level_thickness import numpy as np import scipy from .. import PLEVEL_STR from .toa_sfc_fluxes import cre_sw, cre_lw, cre_net, toa_rad_clr def flatten_spatial_dims(data): """Flatten all spatial dimensions of an input array. As...
LennonChin/Django-Practices
MxShop/apps/trade/migrations/0001_initial.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-10-09 21:40 from __future__ import unicode_literals import datetime from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('goods', '...
googleapis/python-aiplatform
samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_tensorboard_service_create_tensorboard_async.py
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
rhyolight/nupic.son
app/soc/models/conversation.py
# Copyright 2013 the Melange 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 wr...
openstack/designate
designate/tests/unit/test_utils.py
# 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 t...
googleapis/python-vm-migration
samples/generated_samples/vmmigration_v1_generated_vm_migration_list_target_projects_sync.py
# -*- 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...
Bigsby/PoC
py/jpegtorgb.py
import sys from pathlib import Path from PIL import Image if len(sys.argv) != 2: print("ERROR! Add image path as (only) parameter.") sys.exit(0) js = True requiredSize = (16,16) elementStart = "{" if not js else "[" elementEnd = "}" if not js else "]" elementSeperator = "," imagePath = Path(sys.argv[1]) if ...
mikaelbrandin/armory
client/ssh_client.py
__author__ = 'kra869' from . import base_client import os import getpass import sys import subprocess class Client(base_client.IOClient): PUSH = "ssh {server} \"cd {path}; armory-push\"" PULL = "ssh {server} \"cd {path}; armory-pull\"" def __init__(self, uri): base_client.IOClient.__init__(self, u...
GoogleChromeLabs/extension-manifest-converter
utils/arguments.py
# Copyright 2021 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 applicable law or agreed ...
jboeuf/grpc
tools/distrib/check_include_guards.py
#!/usr/bin/env python2.7 # 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 l...
nicozhang/startUp
d3status/libs/options.py
## -*- coding: utf-8 -*- # # Copyright (c) 2012 feilong.me. All rights reserved. # # @author: Felinx Lee <felinx.lee@gmail.com> # Created on Jun 30, 2012 # import logging import os import pdb from tornado.options import parse_command_line, options, define def parse_config_file(path): """Rewrite t...
googleapis/python-bigquery
samples/load_table_uri_truncate_parquet.py
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
drone115b/dirb
dirb/conf.py
##################################################################### # # Copyright 2015 SpinVFX # # 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...
ajorg/DMR_contacts
dmr_marc_users_cs750.py
#!/usr/bin/env python import csv import json import logging import re try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse try: from StringIO import StringIO except ImportError: from io import StringIO from io import BytesIO import requests import boto3 s3 = boto3.c...
Laisky/laisky-blog
gargantua/apis/parsers.py
"""Parsers to parse results will be return to client """ from abc import ABC, abstractclassmethod import datetime import tornado from bson import ObjectId from gargantua.utils import logger, utc2cst_timestamp, MongoParser, debug_wrapper, UTC class ParserError(Exception): pass class BaseParser(ABC): @abstr...
AcrDijon/henet
henet/tests/test_workers.py
# encoding: utf8 import unittest import time import logging from henet.workers import MemoryWorkers from henet import logger def boom(): raise Exception('ok') class TestMemoryWorkers(unittest.TestCase): def setUp(self): self.workers = MemoryWorkers(size=1) logger.setLevel(logging.CRITICAL) ...
ATM-HSW/mbed_target
buildtools/gcc-arm-none-eabi-6-2017-q2/arm-none-eabi/lib/thumb/v7e-m/fpv5/softfp/libstdc++.a-gdb.py
# -*- python -*- # Copyright (C) 2009-2016 Free Software Foundation, 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 of the License, or # (at your option) any later versio...
diracdeltas/lets-encrypt-preview
letsencrypt/acme/messages.py
"""ACME protocol v00 messages. .. warning:: This module is an implementation of the draft `ACME protocol version 00`_, and not the "RESTified" `ACME protocol version 01`_ or later. It should work with `older Node.js implementation`_, but will definitely not work with Boulder_. It is kept for reference purposes...
lijiejie/BBScan
scripts/disabled/smb_ms17010.py
# @Author : helit import socket import binascii from lib.common import save_script_result ports_to_check = 445 def get_tree_connect_request(ip, tree_id): ipc = "005c5c" + binascii.hexlify(ip) + "5c49504324003f3f3f3f3f00" ipc_len_hex = hex(len(ipc) / 2).replace("0x", "") smb = "ff534d4275000000001801280...
protron/namebench
tools/ordered-uniq.py
#!/usr/bin/env python # Copyright 2009 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...
ianblenke/awsebcli
ebcli/lib/utils.py
# Copyright 2014 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 in the "license" file accompa...
chicm/carvana
08-02/software/car-segment/dataset/carvana_cars.py
from common import * from dataset.mask import * CARVANA_DIR = '/root/share/data/kaggle-carvana-cars-2017' CARVANA_NUM_VIEWS = 16 CARVANA_HEIGHT = 1280 CARVANA_WIDTH = 1918 CARVANA_H = 512 CARVANA_W = 512 #data iterator ---------------------------------------------------------------- class KgCarDataset_1x(D...
hipnusleo/laserjet
resource/pypi/paramiko-2.1.1/paramiko/ber.py
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License,...
rtx3/saltstack-deyunio
srv/salt/supervisor/etc/event/http-ok.py
#!/usr/bin/python # -*- coding: utf-8 -*- import os import socket import sys import urllib import httplib import time import base64 import json from supervisor import childutils from supervisor.states import ProcessStates from supervisor.options import make_namespec KEY = "/cmdb/host" #AUTH = base64.b64encode('userna...
bne/hortee
hortee/tracktor/api/utils.py
from tastypie.api import Api from tastypie.authentication import Authentication from tastypie.serializers import Serializer from tastypie.utils.mime import determine_format class DjangoAuthentication(Authentication): """Checks is_authenticated on request.user as we're only going to be using this Api on this d...
sridevikoushik31/nova
nova/db/mysqldb/sql.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 Rackspace Hosting # 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.apac...
emitrom/integra-openstack-ui
schedules/workflows/add_task.py
import traceback from horizon import workflows, forms, exceptions from django.utils.translation import ugettext_lazy as _ from openstack_dashboard.dashboards.integra.schedules import utils class AddTaskDetailsAction(workflows.Action): scheduleId = forms.IntegerField( label=_("ScheduleId)"), req...
raintank/graphite-kairosdb
graphite_kairosdb.py
import re import time import struct import collections from elasticsearch import Elasticsearch from cassandra.cluster import Cluster from graphite_api.intervals import Interval, IntervalSet from graphite_api.node import LeafNode, BranchNode from flask import g import json import structlog logger = structlog.get_logger(...
selboo/squid-api
app/api/squid.py
#!/usr/bin/env python #coding=utf8 from httplib import HTTPConnection from glob import glob from re import findall from config import * def Squid_PURGE(Squid, Type, URL, Q): try: Conn = HTTPConnection(host=Squid, port='80', timeout=timeout) Conn.request(Type, URL) except: message = 'Timeout' Status = 408 ...
rosshendrickson-wf/furious
setup.py
from setuptools import find_packages, setup def get_version(): import imp import os with open(os.path.join('furious', '_pkg_meta.py'), 'rb') as f: mod = imp.load_source('_pkg_meta', 'biloba', f) return mod.version setup_args = dict( name='furious', version=get_version(), li...