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
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses...
tanglei528/nova
nova/tests/compute/test_compute_utils.py
Python
apache-2.0
34,518
#!/usr/bin/env python """Output plugins implementations.""" from grr_response_server import output_plugin # pylint: disable=unused-import,g-import-not-at-top try: from grr_response_server.output_plugins import bigquery_plugin except ImportError: pass from grr_response_server.output_plugins import csv_plugin from...
google/grr
grr/server/grr_response_server/output_plugins/__init__.py
Python
apache-2.0
625
# # 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...
stackforge/cloudkitty
cloudkitty/db/sqlalchemy/alembic/versions/464e951dc3b8_initial_migration.py
Python
apache-2.0
1,286
from read_data import read_from_file,read_nell_relations,get_relation_fname,get_node from nltk.stem.snowball import SnowballStemmer from nltk import word_tokenize,pos_tag from predicate_extraction_set_matching import set_matching import operator,sys from nltk.corpus import stopwords from nltk.stem.snowball import Snowb...
vedsarkushwaha/KBH_NELL
ques_ans.py
Python
apache-2.0
3,087
#!/usr/bin/python #coding=utf-8 ''' @author: sheng @license: ''' SPELL=u'chénglíng' CN=u'承灵' NAME=u'chengling22' CHANNEL='gallbladder' CHANNEL_FULLNAME='GallbladderChannelofFoot-Shaoyang' SEQ='GB18' if __name__ == '__main__': pass
sinotradition/meridian
meridian/acupoints/chengling22.py
Python
apache-2.0
248
# -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # 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...
rogerthat-platform/rogerthat-backend
src-test/rogerthat_tests/mobicage/bizz/service/test_broadcast.py
Python
apache-2.0
20,430
from domino import Domino import os domino = Domino("marks/quick-start-fork", api_key=os.environ['DOMINO_USER_API_KEY'], host=os.environ['DOMINO_API_HOST']) if domino.endpoint_publish("main.py", "api_endpoint", "22d864481c66b36d676056905d1f0545f5d3b742"): ...
dominodatalab/python-domino
examples/publish_api_endpoint.py
Python
apache-2.0
409
class FeedDisplayMapper: def __init__(self): self._display_to_internal_map = {} self._internal_to_display_map = {} def register(self, internal_name: str, display_name: str) -> None: self._display_to_internal_map[display_name] = internal_name self._internal_to_display_map[interna...
anchore/anchore-engine
anchore_engine/services/policy_engine/engine/vulns/feed_display_mapper.py
Python
apache-2.0
582
# # Copyright 2014-2015 eNovance # # 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...
openstack/ceilometer
ceilometer/publisher/gnocchi.py
Python
apache-2.0
23,918
# (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP # # 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 ap...
sapcc/monasca-notification
tests/test_notification_processor.py
Python
apache-2.0
5,662
#!/usr/bin/env python from setuptools import setup, find_packages tests_require = [ 'flake8', 'mock==0.8', 'pytest', 'pytest-django-lite', ] install_requires = [ 'Django>=1.5,<1.6', 'psycopg2', ] setup( name='django-db-routes', version='0.1.0', author='David Cramer', author_...
dcramer/django-db-routes
setup.py
Python
apache-2.0
968
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # TODO: ADD COPYRIGHT TAG from __future__ import absolute_import, division, print_function import multiprocessing import utool from vtool.tests import grabdata print, print_, printDBG, rrr, profile = utool.inject(__name__, '[TEST_DELETE_ANNOTATION_CHIPS]') def TEST_DEL...
SU-ECE-17-7/ibeis
_broken/test_delete_annotation_chips.py
Python
apache-2.0
1,694
#!/usr/bin/env python """ Source material taken from the spipylib package at Wadsworth * Spiderarray.py http://www.wadsworth.org/spider_doc/spider/docs/python/spipylib/array.html AND * Spiderutils.py http://www.wadsworth.org/spider_doc/spider/docs/python/spipylib/library.html # Spider Python Library: Spiderarray....
vossman/ctfeval
pyami/spider.py
Python
apache-2.0
11,056
# Copyright ? 2012 New Dream Network, LLC (DreamHost) # # 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...
kevin-zhaoshuai/zun
zun/api/middleware/parsable_error.py
Python
apache-2.0
3,499
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
skuda/client-python
kubernetes/client/models/v1_service.py
Python
apache-2.0
6,978
"""Defines the class for filtering data""" from __future__ import absolute_import from __future__ import unicode_literals import copy import logging from data.filter.exceptions import InvalidDataFilter from storage.models import ScaleFile from util.validation import ValidationWarning logger = logging.getLogger(__nam...
ngageoint/scale
scale/data/filter/filter.py
Python
apache-2.0
21,387
#!/usr/bin/env python # Copyright (c) PLUMgrid, Inc. # Licensed under the Apache License, Version 2.0 (the "License") import bcc import ctypes import errno import os import subprocess import shutil import time import unittest class TestUprobes(unittest.TestCase): def test_simple_library(self): text = """ ...
shodoco/bcc
tests/python/test_uprobes.py
Python
apache-2.0
4,406
# Copyright (c) 2019 Dell Inc. or its subsidiaries. # 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 # # ...
openstack/manila
manila/share/drivers/dell_emc/plugins/powermax/connection.py
Python
apache-2.0
36,844
# -*- coding: utf-8 -*- # # Copyright 2014-2015 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 ...
brokendata/bigmler
bigmler/processing/args.py
Python
apache-2.0
24,841
__author__ = 'cmantas' from tools import * def draw_single_move(frome, toe, minDf, **kwargs): if frome == "weka": table='arff2'+toe elif toe == "weka": table=frome+'2arff' else: table=frome+"2"+toe tfidf_table= frome+"_tfidf" query = join_query({'table':table, 'tfidf_table'...
project-asap/IReS-Platform
asap-tools/experiments/depricated/handler/draw_movers.py
Python
apache-2.0
2,135
from datetime import datetime from weakref import WeakValueDictionary from sqlalchemy import inspect from sqlalchemy.orm import aliased from sqlalchemy.orm.collections import InstrumentedList from . import db class MetaBaseModel(db.Model.__class__): def __init__(cls, *args): super().__init__(*args) ...
kymy86/gatlinpush
models/abc.py
Python
apache-2.0
1,671
from enum import Enum class State(Enum): PENDING = 1 STARTED = 2 STOPPED = 3 STOPPING = 4 COMPLETE = 5 ERROR = 6 class IllegalStateError(Exception): pass
csm/cloudant-sync-python
cloudant/sync/replication/state.py
Python
apache-2.0
185
import pytest from awx.main.access import ( LabelAccess, ) @pytest.mark.django_db def test_label_get_queryset_user(label, user): u = user('user', False) access = LabelAccess(u) label.organization.member_role.members.add(u) assert access.get_queryset().count() == 1 @pytest.mark.django_db def tes...
GoogleCloudPlatform/sap-deployment-automation
third_party/github.com/ansible/awx/awx/main/tests/functional/test_rbac_label.py
Python
apache-2.0
2,417
import datetime import resource import sys import traceback class StdErrLogger(): """Writes basic utilization data to stderr""" def __init__(self, verbose = False): self._verbose = verbose def log(self, message, verbose=None): """Logs message to std err with optional stats on peak utiliza...
lauringlab/variant_pipeline
scripts/logger.py
Python
apache-2.0
903
# Copyright 2016 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, ...
daspecster/google-cloud-python
translate/unit_tests/test_client.py
Python
apache-2.0
12,057
import json, os, sys from collections import OrderedDict from lxml.etree import fromstring, tostring # Builds a temporary patch for 'pluralRanges' JSON from original # supplemental 'pluralRanges.xml'. This data is currently missing # from the JSON CLDR export. ROOT = '//pluralRanges' def read(path): data = open...
Squarespace/cldr
scripts/make_pluralrange_fix.py
Python
apache-2.0
1,005
# 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 writing,...
google-research/smore
smore/common/torchext/dist_func/beta_dist.py
Python
apache-2.0
6,068
#!/usr/bin/env python #encoding=utf-8 #识别验证码返回由验证码数字组成的字符串 import Image,ImageEnhance,ImageFilter #将图片切成四份,并获得四个数字图形的序列,并将序列保存到data.txt文件中 #此函数是用来获取1-9数字的参照序列的 def split_pic_save(image_name): im = Image.open(image_name) im = im.filter(ImageFilter.MedianFilter()) enhancer = ImageEnhance.Contrast(im) im = enhancer....
lichenhui/guahao
guahao_beijing/code_identify.py
Python
apache-2.0
4,985
#!/usr/bin/env python3 import argparse import logging import os import sys import platform # import random import threading import pickle import time import datetime import queue import uuid import zmq import json from mpi4py import MPI from parsl.app.errors import RemoteExceptionWrapper from parsl.version import VE...
Parsl/parsl
parsl/executors/extreme_scale/mpi_worker_pool.py
Python
apache-2.0
19,559
from typing import Dict, Optional import time from collections import defaultdict, deque import numpy as np from ray import logger from ray.util.annotations import PublicAPI @PublicAPI class Stopper: """Base class for implementing a Tune experiment stopper. Allows users to implement experiment-level stoppin...
ray-project/ray
python/ray/tune/stopper.py
Python
apache-2.0
11,388
from test.integration.base import DBTIntegrationTest, use_profile class TestSimpleSnapshotFiles(DBTIntegrationTest): NUM_SNAPSHOT_MODELS = 1 @property def schema(self): return "simple_snapshot_004" @property def models(self): return "models" @property def project_config(...
analyst-collective/dbt
test/integration/004_simple_snapshot_tests/test_snapshot_check_cols.py
Python
apache-2.0
1,187
def fullspeed(): if isRightHandActivated: i01.setHandVelocity("right", -1, -1, -1, -1, -1, -1) if isLeftHandActivated: i01.setHandVelocity("left", -1, -1, -1, -1, -1, -1) if isRightArmActivated: i01.setArmVelocity("right", -1, -1, -1, -1) if isLeftArmActivated: i01.setArmVeloc...
MyRobotLab/pyrobotlab
home/kwatters/harry/gestures/fullspeed.py
Python
apache-2.0
539
# # 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...
aosagie/spark
python/pyspark/ml/evaluation.py
Python
apache-2.0
23,233
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2016 DNAnexus, Inc. # # This file is part of dx-toolkit (DNAnexus platform client libraries). # # 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...
dnanexus/dx-toolkit
src/python/test/dxpy_testutil.py
Python
apache-2.0
29,488
#!/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...
vmax-feihu/hue
desktop/core/src/desktop/views.py
Python
apache-2.0
16,942
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
darren-wang/ks3
keystone/auth/plugins/external.py
Python
apache-2.0
3,647
# # 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/io/gcp/bigquery_file_loads.py
Python
apache-2.0
34,932
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 OpenStack Foundation # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License....
sacharya/nova
nova/tests/console/test_console.py
Python
apache-2.0
7,724
import pandas as pd from base import filter_test, ConstantDataSource def test_simple_filter(): df = pd.DataFrame( { 't1': [1, 2, 3, 4, 5], 't2': [-1, -2, -3, 5, 7] } ) result_df = pd.DataFrame( { 't4': [2, 4], 't5': [-1, -4], ...
SirEdvin/Pandas-Pipe
tests/filter_test.py
Python
apache-2.0
561
# Copyright 2013 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...
Vaidyanath/tempest
tempest/api/identity/admin/v3/test_projects.py
Python
apache-2.0
7,060
from nets import vgg import tensorflow as tf from preprocessing import vgg_preprocessing from ..utils.upsampling import bilinear_upsample_weights slim = tf.contrib.slim # Mean values for VGG-16 from preprocessing.vgg_preprocessing import _R_MEAN, _G_MEAN, _B_MEAN def FCN_16s(image_batch_tensor, number_...
aakashsinha19/Aspectus
Image Segmentation/tf-image-segmentation/tf_image_segmentation/models/fcn_16s.py
Python
apache-2.0
7,835
# -*- coding: utf-8 -*- # Minio Python Library for Amazon S3 Compatible Cloud Storage, (C) # 2015, 2016 Minio, 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...
NitishT/minio-py
minio/post_policy.py
Python
apache-2.0
5,211
import json import logging import os from numbers import Number from typing import Any, Dict, List, Optional, Tuple from ray.tune.utils import flatten_dict try: import pandas as pd from pandas import DataFrame except ImportError: pd = None DataFrame = None from ray.tune.error import TuneError from ra...
robertnishihara/ray
python/ray/tune/analysis/experiment_analysis.py
Python
apache-2.0
27,440
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Copyright (C) 2017 Chuan Ji <jichu4n@gmail.com> # # # ...
jichu4n/srslib
srslib.py
Python
apache-2.0
14,041
from base64 import decodebytes from subprocess import call import paramiko, logging import pysftp, sys, os, zipfile print("Building") call([os.path.join('.', 'node_modules', '.bin', 'ng'), 'build', '--prod']) def zip(src, dst): zf = zipfile.ZipFile("%s.zip" % (dst), "w", zipfile.ZIP_DEFLATED) abs_src = os.path...
shamrickus/GloryOfNephilim
upload.py
Python
apache-2.0
2,024
#BEWARE: automatically generated code #This code was generated by /generate/__main__.py from opengl.gl.raw.bindings import * VERSION_ES_CL_1_0 = 1 VERSION_ES_CM_1_1 = 1 VERSION_ES_CL_1_1 = 1 DEPTH_BUFFER_BIT = 0x00000100 STENCIL_BUFFER_BIT = 0x00000400 COLOR_BUFFER_BIT = 0x00004000 FALSE = 0 TRUE = 1 POINTS = 0x0000 ...
SilentPenguin/OpenGL.py
opengl/gl/raw/gl_es_cm_1_0.py
Python
apache-2.0
51,087
"""This is complete MIME handling package, provides fast parser and models for handling mime. Rationale -------- * Standard python parser is slow at parsing big messages, it takes ~1 second and a couple of millions of ops to parse 11MB message. * Not very memory efficient, as it splits the message into array of lines,...
mailgun/flanker
flanker/mime/__init__.py
Python
apache-2.0
2,085
''' Created on 06.01.2015 @author: Iris ''' from Container import container from Component import Component class Tag(Component): ''' Tag class for tagging components ''' def __init__(self, tag): ''' Constructor ''' Component.__init__(self) self.uid = 'tag_' + ...
irisSchaffer/component-based-asteroids
Component/Tag.py
Python
apache-2.0
978
""" CAVEAT EMPTOR: Tests require to be launched top-down! Notes: If you inspect Gerrit manually after running these """ from __future__ import print_function import pytest import fixtures from gerrit import Client, AuthenticationError from gerrit.model import ChangeDetails, Patch def setup_module(): fixt...
bcwaldon/python-gerrit
tests/test_gerrit.py
Python
apache-2.0
4,616
#!/usr/bin/env python # # This script loads a trained LSTM net and starts # interactive session with a chat bot interface # that can verbally respond or fire API calls # import json import click import requests import numpy as np from modules.entities import EntityTracker from modules.bow import BowEncoder from module...
DrigerG/IIITB-ML
project/HCN/interact.py
Python
apache-2.0
4,952
# Copyright 2019 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...
tensorflow/tfjs
tfjs-converter/python/tensorflowjs/converters/common.py
Python
apache-2.0
2,349
#!/usr/bin/python # # Copyright 2014 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...
dietrichc/streamline-ppc-reports
examples/adwords/v201406/remarketing/add_audience.py
Python
apache-2.0
3,471
# Copyright 2021 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...
ros2/rosidl
rosidl_cli/rosidl_cli/command/generate/api.py
Python
apache-2.0
3,504
"""This module contains multiple constants collections typically used when communicating metrics and findings with Teamscale.""" from __future__ import absolute_import from __future__ import unicode_literals class Assessment: """Constants to be used as assessment levels.""" RED = "RED" YELLOW = "YELLOW"...
cqse/teamscale-client-python
teamscale_client/constants.py
Python
apache-2.0
3,287
#!/usr/bin/env python """ Robocom teleoperator node """ import sys, os, time import roslib import rospy from sensor_msgs.msg import Joy from r2p.msg import Velocity topic = rospy.get_param('topic', 'robot') setpoint_scale = rospy.get_param('setpoint_scale', {'x': 1, 'y': 1, 'w': 1}) gear_ratio = rospy.get_param('gea...
openrobots-dev/ROS
src/teleop_joy.py
Python
apache-2.0
1,794
## # Copyright (c) 2010-2015 Apple 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 l...
red-hood/calendarserver
contrib/od/setup_directory.py
Python
apache-2.0
16,267
#!/usr/bin/env python """This is the GRR client.""" import pdb import logging # pylint: disable=unused-import from grr.client import client_plugins # pylint: enable=unused-import from grr.client import comms from grr.client import installer from grr.client import stdlib from grr.lib import client_startup from grr....
destijl/grr
grr/client/client.py
Python
apache-2.0
1,795
from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from django.contrib.contenttypes.models import ContentType from django.contrib.auth.decorators import login_required from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.sites.models import S...
callowayproject/django-offensivecontent
offensivecontent/views.py
Python
apache-2.0
6,436
from share import ProviderAppConfig from .harvester import FigshareHarvester from .normalizer import FigshareNormalizer class AppConfig(ProviderAppConfig): name = 'providers.com.figshare' version = '0.0.1' title = 'figshare' long_title = 'figshare' harvester = FigshareHarvester normalizer = F...
zamattiac/SHARE
providers/com/figshare/apps.py
Python
apache-2.0
378
''' Class that handles all communal communications with the master sever ''' import threading from getMetrics import getPerfServer import time from ccmd.tools.helpers import logApp # this Thread will send periodically performance data about he whole instance to the master server # it also can be used t...
Northshoot/maestro
worker/senderThread.py
Python
apache-2.0
1,239
# # Created as part of the StratusLab project (http://stratuslab.eu), # co-funded by the European Commission under the Grant Agreement # INFSO-RI-261552." # # Copyright (c) 2011, SixSq Sarl # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
StratusLab/client
api/code/src/main/python/stratuslab/system/PackageInfo.py
Python
apache-2.0
1,159
# -*- coding: utf-8 -*- import re import types import logging import subprocess from ..exceptions import (ExecuteRuntimeError, ScriptRuntimeError, NetworkError) from .strings import mask_string block_fmt = ("\n============= %(title)s ==========\n%(content)s\n" "======== END OF...
harveyzh/packstack
packstack/installer/utils/shell.py
Python
apache-2.0
4,527
# Copyright 2013 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 req...
bigswitch/neutron
neutron/tests/unit/test_wsgi.py
Python
apache-2.0
25,931
#!/usr/bin/env python2.7 """ Script to extract names and aliases from Freebase RDF dump. """ import gzip import logging logging.basicConfig(format='%(asctime)s %(message)s') log = logging.getLogger() log.setLevel(logging.INFO) # DEBUG, INFO, WARN, ERROR, CRITICAL def read_mids(f): log.info('Reading mids..') m...
benhachey/fbutil
alias/extract.py
Python
apache-2.0
1,721
from upseto import gitwrapper from upseto import run import subprocess class RootfsLabel: def __init__(self, rootfs, product="rootfs"): self._rootfs = rootfs self._product = product if rootfs == "THIS": self._label = run.run([ "solvent", "printlabel", "--thisPro...
Stratoscale/pyracktest
py/strato/racktest/infra/rootfslabel.py
Python
apache-2.0
1,376
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Justin Santa Barbara # # 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/LICEN...
houshengbo/nova_vmware_compute_driver
nova/tests/test_utils.py
Python
apache-2.0
31,310
"""Base class for IKEA TRADFRI.""" from functools import wraps import logging from pytradfri.error import PytradfriError from homeassistant.core import callback from homeassistant.helpers.entity import Entity from .const import DOMAIN _LOGGER = logging.getLogger(__name__) def handle_error(func): """Handle tra...
Danielhiversen/home-assistant
homeassistant/components/tradfri/base_class.py
Python
apache-2.0
2,898
# -*- coding: utf-8 -*- ''' Salt module to manage unix mounts and the fstab file ''' # Import python libs import os import re import logging # Import salt libs import salt.utils from salt._compat import string_types from salt.utils import which as _which from salt.exceptions import CommandNotFoundError, CommandExecut...
victorywang80/Maintenance
saltstack/src/salt/modules/mount.py
Python
apache-2.0
12,839
''' Created on Sep 3, 2010 @author: Wilder Rodrigues (wilder.rodrigues@ekholabs.nl) ''' ''' This file comprises a few functions used to manipulate lists, queues and stacks. It shows the behavior of those data structures. ''' ''' Imports the deque object from the collections module. ''' from collections...
ekholabs/python
src/nl/ekholabs/sample/python/structure/lists.py
Python
apache-2.0
3,034
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
GoogleCloudPlatform/python-docs-samples
functions/v2/audit_log/main_test.py
Python
apache-2.0
1,569
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
GoogleCloudPlatform/python-docs-samples
people-and-planet-ai/image-classification/e2e_test.py
Python
apache-2.0
6,821
from __future__ import absolute_import from .administration import AGSAdministration from .parameters import ClusterProtocol, Extension __version__ = "3.5.5"
DShokes/ArcREST
src/arcrest/manageags/__init__.py
Python
apache-2.0
158
import asyncio import unittest.mock import pytest START = object() END = object() RETVAL = object() @pytest.fixture def mock(): return unittest.mock.Mock(return_value=RETVAL) @pytest.fixture async def async_fixture(mock): return await asyncio.sleep(0.1, result=mock(START)) @pytest.mark.asyncio async def...
pytest-dev/pytest-asyncio
tests/async_fixtures/test_async_fixtures.py
Python
apache-2.0
493
class Search(object): def __init__(self, keyword=""): self.keyword = keyword @classmethod def Positive(cls): return cls(keyword="my film") @classmethod def Negative(cls): return cls(keyword="sascmcsl")
iri6e4ka/test-project2
php4dvd/model/search.py
Python
apache-2.0
248
#Задача 10 #Напишите программу "Генератор персонажей" для игры. Пользователю должно быть предоставлено 30 пунктов, которые можно распределить между четырьмя характеристиками: Сила, Здоровье, Мудрость и Ловкость. Надо сделать так, чтобы пользователь мог не только брать эти пункты из общего "пула", но и возвращать их туд...
Mariaanisimova/pythonintask
BIZa/2014/Zyabko_A_A/Task_10_45.py
Python
apache-2.0
3,142
# Copyright 2012 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 by...
akushwah/python-quantumclient-n1kv
quantumclient/quantum/v2_0/network.py
Python
apache-2.0
3,028
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Pradeep Jairamani , github.com/pradeepjairamani def wp_plugins(): return ["1-flash-gallery", "1-jquery-photo-gallery-slideshow-flash", "Calendar", "Premium_Gallery_Manager", "a-gallery", "a-to-z-category-listing", "accept-signups", "admini...
viraintel/OWASP-Nettacker
lib/scan/wp_plugin/wp_plugins_small.py
Python
apache-2.0
5,928
#!/usr/bin/python3 # -*- coding: UTF-8 -*- import sys # Include custom libs sys.path.append( '../../include/python' ) import serverutils.config as config import serverutils.mongohelper as mongohelper import pymongo props = {'targetDbName': 'characterinsights_copy'} for prop in sys.argv[1:]: k,v = prop.split("=",1)...
Thylossus/tud-movie-character-insights
Server/Tools/urlUpdater/copyDatabase.py
Python
apache-2.0
853
from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.decorators import user_passes_test def not_anonymous_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url=None): """ Decorator for views that checks that the user is logged in and his username is not contain 'ano...
raccoongang/socraticqs2
mysite/mysite/decorators.py
Python
apache-2.0
670
#!/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...
erickt/hue
apps/spark/src/spark/urls.py
Python
apache-2.0
2,311
# Copyright 2019 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, ...
tensorflow/lattice
tensorflow_lattice/python/estimators_test.py
Python
apache-2.0
33,843
# -*- coding: utf-8 -*- # # openstack.common documentation build configuration file, created by # sphinx-quickstart on Mon Jul 4 16:08:06 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file...
blamarvt/openstack-common
doc/source/conf.py
Python
apache-2.0
7,283
# 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 applicable ...
Intel-Corporation/tensorflow
tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py
Python
apache-2.0
23,979
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2011-2015, Yu-chen Kao (cybeliak) # # 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...
cybeliak/mispronounceableness
mpn_utils/guess_pron_from_lex.py
Python
apache-2.0
4,324
# 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...
googlearchive/rgc-models
response_model/python/metric_learning/data_util.py
Python
apache-2.0
24,111
# Copyright 2012 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...
openstack/python-magnumclient
magnumclient/tests/utils.py
Python
apache-2.0
6,314
""" Copyright (2010-2014) INCUBAID BVBA 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, so...
Incubaid/arakoon
pylabs/test/server/left/test_collapse.py
Python
apache-2.0
2,292
# Copyright 2019 - Nokia # # 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, sof...
openstack/vitrage
vitrage/evaluator/template_functions/__init__.py
Python
apache-2.0
636
# -*- coding: utf-8 -*- import tensorflow as tf import argparse from nlp.segment.joint_bilstm_crf import train from nlp.segment.joint_bilstm_crf import test def main(args): if args.process == tf.estimator.ModeKeys.TRAIN: train.train(args) elif args.process == tf.estimator.ModeKeys.PREDICT: t...
koala-ai/tensorflow_nlp
nlp/segment/joint_bilstm_crf/run.py
Python
apache-2.0
2,419
#unit #mydict.py class Dict(dict): def __init__(self,**kw): super(Dict,self).__init__(**kw) def __getattr__(self,key): try: return self[key] except KeyError: raise AttributeError(r"'Dict' object han no attribute'%s'" %key) def __setattr__(self,key,value): self[key]=value
zengboming/python
mydict.py
Python
apache-2.0
293
# 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...
girving/tensorflow
tensorflow/python/ops/sparse_ops.py
Python
apache-2.0
90,949
import net_modules.gen import numpy as np import tensorflow as tf from net_modules.common import default_activation import math import zutils.tf_math_funcs as tmf from model.model import Factory from model.options import PipelineOptionDefinition from runner.train_pipeline import Pipeline as BasePipeline from zutils.o...
YutingZhang/lmdis-rep
model/pipeline_netdef.py
Python
apache-2.0
10,263
#!/usr/bin/env python # -*- encoding=utf-8 -*- from crawlers.electorates.base_provincePage import * from utils import sanitize def Crawler(nth, election_name, electionType): target = 'assembly' if 1 <= nth <= 17: raise NotImplementedError('Korean National Election Committee does not have any data about electorate...
comjoy91/SKorean-Election_result-Crawler
crawlers/electorates/electorates-original/assembly-original.py
Python
apache-2.0
6,879
# 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...
openstack/horizon
openstack_dashboard/dashboards/admin/routers/forms.py
Python
apache-2.0
1,567
# Copyright 2020 Google 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 by applicable law or a...
GoogleCloudPlatform/repo-automation-playground
xunit-autolabeler-v2/ast_parser/core/test_data/yaml/invalid/invalid_test.py
Python
apache-2.0
680
import random lorem_ipsum = ('Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante ' 'sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra ' 'turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis ' ...
dylanseago/CommunityFund
server/communityfund/placeholder.py
Python
apache-2.0
1,237
# ---------------------------------------------------------- # Introdução a Programação de Computadores - IPC # Universidade do Estado do Amazonas - UEA # Prof. Jucimar Jr # # Carlos Eduardo Tapudima de Oliveira 1715310030 # Frederico Victor Alfaia Rodrigues 1515200030 # Joelson Pereira Lima ...
jucimarjr/IPC_2017-1
lista1.5/lista1.5_questao14.py
Python
apache-2.0
1,767
#!/usr/bin/python # # Copyright 2014 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...
googlesamples/android-play-publisher-api
v3/python/upload_apks_rollout.py
Python
apache-2.0
2,789
# 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 ConfigParser ...
dbentley/pants
tests/python/pants_test/pants_run_integration_test.py
Python
apache-2.0
11,466
""" VirtWhoConf - File ``/etc/virt-who.conf`` and ``/etc/virt-who.d/*.conf`` ======================================================================== The ``VirtWhoConf`` class parses the virt-who configuration files in `ini-like` format. .. note:: The configuration files under ``/etc/virt-who.d/`` might ...
wcmitchell/insights-core
insights/parsers/virt_who_conf.py
Python
apache-2.0
2,357