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 selenium import webdriver from selenium.webdriver import ActionChains from os import path import time #NOTE: this demo uses images under images subfolder to find by name. # Be sure to configure AutoPyDriverServer to use that folder for images by name # start up both Firefox & AutoPyDriver for demo browser = web...
daluu/AutoPyDriverServer
sample-code/webdriver_integration_demo.py
Python
apache-2.0
1,719
#!/env/python # -*- encoding: utf-8 -*- """ @version: 0.1 @author: wenzhiquan @contact: wenzhiquanr@163.com @site: http://github.wenzhiquan.com @software: PyCharm @file: movieAttr.py @time: 16/3/6 11:19 @description: null """ from config import config from lib import stdLib class MovieAttr(): def __init__(self):...
AlohaWorld/TR
UHCF/common/movieAttr.py
Python
apache-2.0
2,436
# (C) Copyright 2015,2016 Hewlett Packard Enterprise Development LP # Copyright 2017 Fujitsu 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/LICE...
openstack/monasca-notification
monasca_notification/plugins/pagerduty_notifier.py
Python
apache-2.0
3,277
#!/usr/bin/env python # Copyright (c) 2013. Mark E. Madsen <mark@pytransmission.org> # # This work is licensed under the terms of the Apache Software License, Version 2.0. See the file LICENSE for details. """ Description here """ import unittest if __name__ == '__main__': # use the default shared TestLoader ...
mmadsen/pytransmission
runtests.py
Python
apache-2.0
709
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). """Core rules for Pants to operate correctly. These are always activated and cannot be disabled. """ from pants.core.goals import check, fmt, lint, package, publish, repl, run, tailor, t...
patricklaw/pants
src/python/pants/core/register.py
Python
apache-2.0
1,821
# fugato.serializers # JSON Serializers for the Fugato app # # Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> # Created: Thu Oct 23 15:03:36 2014 -0400 # # Copyright (C) 2016 District Data Labs # For license information, see LICENSE.txt # # ID: serializers.py [8eae6c4] benjamin@bengfort.com $ """ JSON S...
DistrictDataLabs/minimum-entropy
fugato/serializers.py
Python
apache-2.0
4,013
import os import subprocess import time import distutils.dir_util from distutils.version import LooseVersion import pytest import logging from ccmlib import common as ccmcommon from dtest import Tester, create_ks, create_cf, MAJOR_VERSION_4 from tools.assertions import assert_all, assert_none, assert_one since = py...
aweisberg/cassandra-dtest
sstable_generation_loading_test.py
Python
apache-2.0
17,757
# coding: utf-8 # # Copyright 2018 The Oppia 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 requi...
souravbadami/oppia
core/domain/topic_domain.py
Python
apache-2.0
38,486
from ofd.models import * import csv, io, sys from datetime import datetime, time import time fh = open("./data/flight_test1.txt","r") al_dl = Airline.objects.get(iata="DL") al_kl = Airline.objects.get(iata="KL") al_af = Airline.objects.get(iata="AF") def convert_to_time(val): # expects a 5-character string, eg 0...
MarconiMediaGroup/TravelHub
web/data/sloppy_flight_import.py
Python
apache-2.0
2,568
# -*- 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/rogerthat/bizz/profile.py
Python
apache-2.0
48,219
#!/usr/bin/env python #encode=utf-8 #vim: tabstop=4 shiftwidth=4 softtabstop=4 #Created on 2013-6-24 #Copyright 2013 nuoqingyun xuqifeng from bson.code import Code traffic_map = Code("function () {" "emit(this.domain, this.bytes);" "}") traffic_reduce = Code("function (key, values) {" ...
homhei/glance
glance/db/js.py
Python
apache-2.0
1,449
# -*- coding: utf-8 -*- # # OSU DevOps Bootcamp documentation build configuration file, created by # sphinx-quickstart on Tue Oct 15 12:20:17 2013. # # 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 f...
reillysiemens/curriculum
source/conf.py
Python
apache-2.0
8,585
# lance simulations pour different nombre d'electeurs import multiprocessing import os, sys import shutil import time import numpy as np from randomSets import * def worker(((Ncandidats,q, Nwinners, Ntests))): """worker function""" sys.stdout.write('\nSTART -- %i candidats -- \n' % Ncandidats) sys.stdout....
plguhur/random-sets
simuFindNMin.py
Python
apache-2.0
1,243
import os import sys import time import pickle import threading import multiprocessing from concurrent.futures import ThreadPoolExecutor # required to reserve changed attributes from pandaserver.taskbuffer import JobSpec from pandaserver.taskbuffer import FileSpec JobSpec.reserveChangedState = True FileSpec.reserveC...
PanDAWMS/panda-server
pandaserver/taskbuffer/TaskBufferInterface.py
Python
apache-2.0
5,146
import itertools import json import logging import pickle # noinspection PyPep8Naming from typing import Iterator, KeysView, List, Optional, Text from rasa.core.actions.action import ACTION_LISTEN_NAME from rasa.core.broker import EventChannel from rasa.core.domain import Domain from rasa.core.trackers import ( Ac...
RasaHQ/rasa_core
rasa/core/tracker_store.py
Python
apache-2.0
13,497
# coding=utf-8 # 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 requir...
huggingface/transformers
tests/longformer/test_modeling_longformer.py
Python
apache-2.0
29,819
# Copyright 2020 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
google/pigweed
pw_protobuf/py/pw_protobuf/codegen_pwpb.py
Python
apache-2.0
25,350
# Copyright (c) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
huntxu/neutron
neutron/cmd/ovs_cleanup.py
Python
apache-2.0
4,457
# !/usr/bin/env python # -*- coding: utf-8 -*- import vtk def main(): cps = vtk.vtkConvexPointSet() points = vtk.vtkPoints() points.InsertNextPoint(0, 0, 0) points.InsertNextPoint(1, 0, 0) points.InsertNextPoint(1, 1, 0) points.InsertNextPoint(0, 1, 0) points.InsertNextPoint(0, 0, 1) ...
lorensen/VTKExamples
src/Python/GeometricObjects/ConvexPointSet.py
Python
apache-2.0
2,484
# -*- coding: utf-8 -*- """ Created on Fri May 30 16:31:36 2014 @author: dan """ from ahabSyntax import openingChars , closingChars def addIdentifiedSubgroup( curVal , inputModes , inputValues , curInpVals) : openSubgroup = True # subgroup is still open if closingChars[inputModes[-1]] not ...
djsegal/ahab_legacy_
pequod/addIdentifiedSubgroup.py
Python
apache-2.0
1,756
import uuid class RemoteProcessGroup(object): def __init__(self, url, name=None): self.uuid = uuid.uuid4() if name is None: self.name = str(self.uuid) else: self.name = name self.url = url def get_name(self): return self.name def get_uuid...
dtrodrigues/nifi-minifi-cpp
docker/test/integration/minifi/core/RemoteProcessGroup.py
Python
apache-2.0
353
# BEGIN_COPYRIGHT # # Copyright 2009-2018 CRS4. # # 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 agree...
elzaggo/pydoop
examples/pydoop_script/scripts/caseswitch.py
Python
apache-2.0
1,200
import unittest from ignite.engine import Engine class TestPytorchIgnite(unittest.TestCase): def test_engine(self): def update_fn(engine, batch): pass engine = Engine(update_fn) engine.run([0, 1, 2])
Kaggle/docker-python
tests/test_pytorch_ignite.py
Python
apache-2.0
245
"""A notebook manager that uses the local file system for storage. Authors: * Brian Granger * Zach Sailer """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in...
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython-2.2.0-py2.7.egg/IPython/html/services/notebooks/filenbmanager.py
Python
apache-2.0
18,231
""" page 222 225 226 227 """ from sklearn.datasets import fetch_20newsgroups from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.neighbors.nearest_centroid import NearestCentroid from sklearn.naive_bayes import Multinomia...
hhj0325/pystock
com/hhj/baihuabigdata/demo8.py
Python
apache-2.0
1,943
import json from flask import Blueprint, request from utils.decorators import required from .torrent import Torrent endpoint = Blueprint('announce', __name__) @endpoint.route('/announce', methods=['GET']) @required('info_hash', 'peer_id', 'port', 'uploaded', 'downloaded', 'left', 'compact', 'no_peer_id...
vtemian/university_projects
data_structures/bitorrent/server/announce/api.py
Python
apache-2.0
984
import unittest import json from flask_ask import Ask, audio from flask import Flask play_request = { "version": "1.0", "session": { "new": True, "sessionId": "amzn1.echo-api.session.0000000-0000-0000-0000-00000000000", "application": { "applicationId": "fake-application-id" }, "attribut...
lxwvictor/flask-ask
tests/test_integration.py
Python
apache-2.0
2,295
#!/usr/bin/env python from __future__ import absolute_import import os import shutil import tempfile from distutils.core import setup from .Dependencies import cythonize, extended_iglob from ..Utils import is_package_dir from ..Compiler import Options try: import multiprocessing parallel_compiles = int(mult...
thedrow/cython
Cython/Build/Cythonize.py
Python
apache-2.0
6,882
# Copyright 2016 Internap. # # 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...
internap/almanach
integration_tests/test_collector_volume_type.py
Python
apache-2.0
1,547
# 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, ...
google-research/graph-attribution
tests/test_training.py
Python
apache-2.0
3,709
# Copyright 2012 Cloudscaling Group, 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 ...
magic0704/oslo.db
oslo_db/tests/sqlalchemy/test_models.py
Python
apache-2.0
5,509
#!/usr/bin/env python '''This program is step 6 of class 1 of the PytNet course YAML/JSON 6. Write a Python program that creates a list. One of the elements of the list should be a dictionary with at least two keys. Write this list out to a file using both YAML and JSON data_formats. The YAML file should be in the e...
jbutler42/pynet_class
pyclass/week1/step6.py
Python
apache-2.0
2,734
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a...
citrix-openstack-build/os-brick
os_brick/tests/test_exception.py
Python
apache-2.0
2,260
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
alexgorban/models
research/object_detection/models/ssd_mobilenet_v1_fpn_feature_extractor_test.py
Python
apache-2.0
9,782
# 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 # distrib...
openstack/python-openstackclient
openstackclient/network/v2/network_meter_rule.py
Python
apache-2.0
7,644
#!/usr/bin/env python3 # # Copyright 2012-2020 Codinuum Software Lab <https://codinuum.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/LI...
codinuum/cca
src/ast/analyzing/langs/java/parsing/src/genclasstbl.py
Python
apache-2.0
3,392
import numpy as np import tensorflow as tf class ParameterEditor(): """Conveniently edit the parameters of a lucid model. Example usage: model = models.InceptionV1() param = ParameterEditor(model.graph_def) # Flip weights of first channel of conv2d0 param["conv2d0_w", :, :, :, 0] *= -1 """ ...
tensorflow/lucid
lucid/scratch/parameter_editor.py
Python
apache-2.0
1,750
from pathlib import Path import textwrap from typing import Text from collections import OrderedDict import pytest from rasa.shared.core.constants import ( ACTION_SESSION_START_NAME, ACTION_LISTEN_NAME, ACTION_UNLIKELY_INTENT_NAME, ) from rasa.shared.core.domain import Domain from rasa.shared.core.events i...
RasaHQ/rasa_nlu
tests/shared/core/training_data/story_writer/test_yaml_story_writer.py
Python
apache-2.0
9,414
""" This module contains all the Data Access Objects for models which are persisted to Elasticsearch at some point in their lifecycle. Each DAO is an extension of the octopus ESDAO utility class which provides all of the ES-level heavy lifting, so these DAOs mostly just provide information on where to persist the data...
JiscPER/jper
service/dao.py
Python
apache-2.0
3,957
"""Scikit Flow Estimators.""" # Copyright 2015-present The Scikit Flow 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/L...
shishaochen/TensorFlow-0.8-Win
tensorflow/contrib/learn/python/learn/estimators/__init__.py
Python
apache-2.0
1,777
""" Copyright (c) 2010, Tim Hartman 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, softwa...
tbhartman/eng
material/predefined.py
Python
apache-2.0
1,319
# Copyright (c) 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
openstack/python-zaqarclient
zaqarclient/queues/v1/message.py
Python
apache-2.0
2,204
# -*- coding: utf-8 -*- u"""simulation data operations :copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern.pkcollections import PKDict from pykern.pkdebug import pk...
mrakitin/sirepo
sirepo/sim_data/elegant.py
Python
apache-2.0
5,814
class Node(): def __init__(self, node,graph): self.vertex = node self.ids = graph.vertex_properties["id"] self.graph = graph def getId(self): return self.ids[self.vertex]
nopbyte/popularIoTy-test-scripts
create-data-from-graph/graph/node.py
Python
apache-2.0
207
# Copyright 2022 The Kubric 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 w...
google-research/kubric
test/test_cameras.py
Python
apache-2.0
1,140
# # 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...
wooga/airflow
airflow/providers/papermill/operators/papermill.py
Python
apache-2.0
2,587
from atlas_web import app app.run(debug=True)
RDCEP/atlas-viewer
run.py
Python
apache-2.0
45
#!/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...
sassoftware/mint
mint_test/resttest/modellibtest/jsontest.py
Python
apache-2.0
4,991
#! /usr/bin/python # -*- coding: utf-8 -*- """ # Reference: - [pose_lcn]( https://github.com/rujiewu/pose_lcn) - [3d-pose-baseline]( https://github.com/una-dinosauria/3d-pose-baseline) """ import tensorflow as tf import numpy as np import pickle import matplotlib.pyplot as plt import os import matplotlib.gr...
zsdonghao/tensorlayer
tensorlayer/app/human_pose_estimation/common.py
Python
apache-2.0
16,077
import session as s import sys import pprint import time import base64 def SyncSiteTag(sitename, site_id, tagname, value): """ SyncSiteTag() - either add, confirm, or update the tagname->value Args: sitename - string, name of site, used for messages only site_id - int, site id returned from G...
m-lab/mlab-ops
plsync/planetlab/sync.py
Python
apache-2.0
29,782
# -*- coding: utf-8 -*- from eventlet import wsgi, api import eventlet import webob.dec from webob import Request, Response from multiprocessing import cpu_count from StringIO import StringIO import httplib import socket class proxy(object): chunk_length = 32768 def __init__(self, time_out = None, lo...
Root-Fang/HTTP_Proxy
Proxy/Proxy.py
Python
apache-2.0
4,474
#!/usr/bin/env python # coding=utf-8 import traceback try: raise SyntaxError, "traceback test" except: traceback.print_exc()
zhaochl/python-utils
utils/except_util.py
Python
apache-2.0
134
# Copyright 2015 Rackspace Inc. # # Author: Tim Simmons <tim.simmons@rackspae.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 # # Unle...
grahamhayes/designate
designate/api/v2/controllers/zones/tasks/exports.py
Python
apache-2.0
4,055
# (C) Copyright 2015 Hewlett Packard Enterprise Development LP # Copyright 2017 Fujitsu 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...
openstack/monasca-notification
tests/test_mysql_repo.py
Python
apache-2.0
1,941
# Copyright 2014 PerfKitBenchmarker 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 appli...
xiaolihope/PerfKitBenchmarker-1.7.0
perfkitbenchmarker/data/__init__.py
Python
apache-2.0
6,390
# Resource object code # # Created: Tue Jan 10 14:08:21 2006 # by: The Resource Compiler for PyQt (Qt v4.1.0) # # WARNING! All changes made in this file will be lost! from PySide import QtCore qt_resource_data = "\ \x00\x00\x14\xa0\ \x3c\ \x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x...
cherry-wb/SideTools
examples/painting/svgviewer/svgviewer_rc.py
Python
apache-2.0
38,159
# Copyright 2018 New Vector # # 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...
matrix-org/synapse
tests/rest/client/test_consent.py
Python
apache-2.0
4,541
def main(j, args, params, tags, tasklet): doc = args.doc nid = args.getTag('nid') node =j.apps.system.gridmanager.getNodes(nid=nid) if node: node = node[0].to_dict() workerscl = j.clients.agentcontroller.getProxy(category="worker") jobs = workerscl.getQueuedJobs(queue=None, format='jso...
Jumpscale/jumpscale_portal8
apps/gridportal/base/Grid/.macros/wiki/workersjobs/3_workersjobs.py
Python
apache-2.0
635
# -*- coding: utf-8 -*- from eclcli.common import command from eclcli.common import exceptions from eclcli.common import utils from eclcli.identity import common as identity_common from ..sssclient.common.utils import objectify class SetAPIKeypair(command.ShowOne): def get_parser(self, prog_name): parser...
anythingrandom/eclcli
eclcli/sss/v1/api_keypair.py
Python
apache-2.0
878
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Translated to python3 wltrimbl 2016 """Mimic pyquick exercise -- optional extra exerci...
wltrimbl/google-python-exercises3
basic/solution/mimic.py
Python
apache-2.0
3,158
""" Stub file to work around django bug: https://code.djangoproject.com/ticket/7198 """ class APIDictWrapper(object): """ Simple wrapper for api dictionaries Some api calls return dictionaries. This class provides identical behavior as APIResourceWrapper, except that it will also behave as a ...
fogbow/fogbow-dashboard
openstack_dashboard/dashboards/fogbow/members/models.py
Python
apache-2.0
1,494
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
freedomtan/tensorflow
tensorflow/compiler/tests/qr_op_test.py
Python
apache-2.0
5,667
# # Copyright 2019 The FATE 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 appli...
FederatedAI/FATE
python/federatedml/statistic/statics.py
Python
apache-2.0
24,470
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-06-06 06:33 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 = [ migrations...
PrasannaBarate/ExpenseTracker-Django
DailyExpenses/migrations/0001_initial.py
Python
apache-2.0
998
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) with the Amazon Transcribe API to transcribe an audio file to a text file. Also shows how to define a custom vocabulary to improve the accuracy of the ...
awsdocs/aws-doc-sdk-examples
python/example_code/transcribe/transcribe_basics.py
Python
apache-2.0
17,119
"""Utility methods for handling Entities. These methods can be shared between entity generation (invoked through the Entities class) at the start of prod data generation, and between post processing methods (such as adding edges between family members and neighbours). """ import codecs import collections import re ...
verejnedigital/verejne.digital
data/prod_generation/entity_tools.py
Python
apache-2.0
3,557
# Copyright 2015 Hitachi Data Systems. # 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...
vponomaryov/manila
manila_tempest_tests/tests/api/admin/test_migration_negative.py
Python
apache-2.0
14,208
__author__ = 'frank' import os import os.path import pprint import traceback import urllib2 import zstacklib.utils.daemon as daemon import zstacklib.utils.http as http import zstacklib.utils.jsonobject as jsonobject from zstacklib.utils import log from zstacklib.utils.bash import * from zstacklib.utils.report import ...
mingjian2049/zstack-utility
cephbackupstorage/cephbackupstorage/cephagent.py
Python
apache-2.0
21,260
import distutils.dir_util as dir_util import os import shutil from mlflow.store.artifact.artifact_repo import ArtifactRepository, verify_artifact_path from mlflow.utils.file_utils import ( mkdir, list_all, get_file_info, local_file_uri_to_path, relative_path_to_artifact_path, ) class LocalArtifac...
mlflow/mlflow
mlflow/store/artifact/local_artifact_repo.py
Python
apache-2.0
5,055
from unittest import TestCase from datetime import timedelta from safepickle.types.timedelta import TimedeltaType from safepickle.encoding import encode, decode class TestTimedelta(TestCase): def test_timedelta(self): """ Asserts timedelta type is handled as expected """ obj = timedelta(...
nioinnovation/safepickle
safepickle/types/tests/test_timedelta.py
Python
apache-2.0
509
"""Defines the methods for handling file systems in the job execution's local container volume""" from __future__ import unicode_literals import os from storage.container import SCALE_ROOT_PATH SCALE_JOB_EXE_INPUT_PATH = os.path.join(SCALE_ROOT_PATH, 'input_data') SCALE_JOB_EXE_OUTPUT_PATH = os.path.join(SCALE_ROOT...
ngageoint/scale
scale/job/execution/container.py
Python
apache-2.0
2,514
import scrapy from sportscalendar.items import scItem # Suiza 4: # datasport # http://www.kikourou.net/resultats/ # https://livetrail.net/ # http://statistik.d-u-v.org/calendar.php # hago carreraspopulares? class DsSpider(scrapy.Spider): name = "ds" allowed_domains = ["livetrail.net"] start_urls = { ...
MrMjolnir/python-projects
sportscalendar/sportscalendar/spiders/livetrail.py
Python
apache-2.0
1,631
from nycodex import db from nycodex.logging import get_logger from nycodex.scrape import scrape_dataset, scrape_geojson from nycodex.scrape.exceptions import SocrataError BASE = "https://data.cityofnewyork.us/api" logger = get_logger(__name__) def main(): session = db.Session() while True: try: ...
alexander-yu/nycodex
scripts/socrata_raw.py
Python
apache-2.0
1,584
#!/usr/bin/env python3 # # Copyright 2017 F5 Networks # # 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 ...
michaeldayreads/marathon-bigip-ctlr
common.py
Python
apache-2.0
6,679
from django.core.management.base import BaseCommand, CommandError from apache_auth.middleware import rewrite_htpasswd class Command(BaseCommand): help = 'Rewrites the htpasswd file' def handle(self, *args, **options): written_users = rewrite_htpasswd() verbosity = options['verbosity'] ...
ginabythebay/iddocs
apache_auth/management/commands/rewrite_htpasswd.py
Python
apache-2.0
618
# 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...
nikste/tensorflow
tensorflow/contrib/framework/python/ops/variables.py
Python
apache-2.0
27,377
""" 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 ...
sfloresk/nso-dashboard-demo
web_app/ncclientextensions/operations.py
Python
apache-2.0
930
#!/usr/bin/env python # -*- coding: utf-8 -*- # imreg_dph.py """ Functions for 2D image registration Copyright (c) 2018, David Hoffman """ import itertools import numpy as np from dphutils import slice_maker # three different registration packages # not dft based import cv2 # dft based from skimage.feature import re...
david-hoffman/scripts
imreg_dph.py
Python
apache-2.0
14,711
# 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 ag...
YoshikawaMasashi/magenta
magenta/models/shared/events_rnn_graph.py
Python
apache-2.0
16,101
from pystorm.bolt import BasicBolt class SentenceSplitterBolt(BasicBolt): def process(self, tup): sentence = tup.values[0] for word in sentence.split(' '): BasicBolt.emit(word) if __name__ == '__main__': SentenceSplitterBolt().run()
thedrow/streamparse
examples/wordcount/multilang/resources/sentence_splitter.py
Python
apache-2.0
274
# -*- coding: utf-8 -*- """Tests for the data type definitions registry.""" import unittest from dtfabric import data_types from dtfabric import registry from tests import test_lib class DataTypeDefinitionsRegistryTest(test_lib.BaseTestCase): """Data type definitions registry tests.""" def testRegistration(se...
libyal/dtfabric
tests/registry.py
Python
apache-2.0
3,002
# Copyright 2020 The TensorFlow 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
tensorflow/graphics
tensorflow_graphics/geometry/__init__.py
Python
apache-2.0
1,274
# -*- coding: utf-8 -*- ''' Neutron class ''' # Import python libs from __future__ import absolute_import, with_statement import logging # Import third party libs import salt.ext.six as six # pylint: disable=import-error HAS_NEUTRON = False try: from neutronclient.v2_0 import client from neutronclient.shell ...
smallyear/linuxLearn
salt/salt/utils/openstack/neutron.py
Python
apache-2.0
33,523
class Lock(object): pass
JamieCressey/apt-s3
apts3/resources/lock.py
Python
apache-2.0
29
# coding=utf-8 # Copyright 2017 The Tensor2Tensor 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...
waterblue13/tensor2tensor
tensor2tensor/models/cycle_gan.py
Python
apache-2.0
4,931
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
rizzatti/luigi
examples/elasticsearch_index.py
Python
apache-2.0
3,410
import os from bs4 import BeautifulSoup count = pd.DataFrame(columns = ['filename', 'count']) for folder, subs, files in os.walk('data/xml'): for filename in files: try: if ('.xml' in filename) and (filename[0] != '.'): f = open(os.path.join(folder, filename)) soup = BeautifulSoup(f.read()) to...
fahadsultan/CausalRelations
to_txt.py
Python
apache-2.0
551
""" WSGI config for coursing_field 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.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJAN...
PNNutkung/Coursing-Field
coursing_field/wsgi.py
Python
apache-2.0
406
#!/usr/bin/env python # Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 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/LICEN...
sergeychipiga/selenium
setup.py
Python
apache-2.0
3,598
#!/usr/bin/env python # -*- encoding: utf-8 -*- # -*- mode: python -*- # vi: set ft=python : import os from setuptools import setup, find_packages README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README') DESCRIPTION = 'Easy image thumbnails in Django.' if os.path.exists(README_PATH): LONG_DE...
pegler/django-thumbs
setup.py
Python
bsd-2-clause
691
# ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (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.mozilla.org/MPL/ # # Softwa...
greyhavens/thane
tamarin-central/utils/stitch.py
Python
bsd-2-clause
19,451
# emacs: -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set fileencoding=utf-8 ft=python sts=4 ts=4 sw=4 et:
karchie/py4dfp
py4dfp/__init__.py
Python
bsd-2-clause
148
#!/usr/bin/env python3 import argparse import sniffer.sniffer as sniffer import parser.packet as packet_parser def main(): argument_parser = argparse.ArgumentParser() argument_parser.add_argument("-i", "--interface", type=str, required=True, help='Network interface to sniff p...
kbrebanov/sniffy
sniffy.py
Python
bsd-2-clause
1,287
from bee import * from bee.segments import * import libcontext from libcontext.socketclasses import * from libcontext.pluginclasses import * def get_worker(name, xyz): class moverel(worker): """Relative movement along %s axis""" % xyz __beename__ = name moverel = antenna("push", "float") ...
agoose77/hivesystem
dragonfly/scene/bound/moverel.py
Python
bsd-2-clause
978
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_comment08.py
Python
bsd-2-clause
1,363
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2005 onwards University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individuals, # list...
zstars/weblabdeusto
server/src/experiments/ud_demo_xilinx/server.py
Python
bsd-2-clause
2,623
from hashlib import md5 from base64 import (b64encode, b64decode) from Crypto.Cipher import DES, DES3 class PBECipher(object): def pad(self, data): # pkcs5 padding n = 8 - (len(data) % 8) if n == 0: return data + chr(8) * 8 else: return data + chr(n) * n ...
danieleandreatta/PyPBE
PyPBE/__init__.py
Python
bsd-2-clause
1,453
from typing import Dict, Generator def event( category: str, action: str, label: str=None, value: int=None, **extra_data) -> Generator[Dict, None, None]: payload = {'t': 'event', 'ec': category, 'ea': action} if label: payload['el'] = label if value: payload['ev'] = str(int...
mirumee/google-measurement-protocol
google_measurement_protocol/event.py
Python
bsd-2-clause
378
import random import datetime from USBIP import BaseStucture, USBDevice, InterfaceDescriptor, DeviceConfigurations, EndPoint, USBContainer # Emulating USB mouse # HID Configuration class HIDClass(BaseStucture): _fields_ = [ ('bLength', 'B', 9), ('bDescriptorType', 'B', 0x21), # HID ('bcd...
smulikHakipod/USB-Emulation
hid.py
Python
bsd-2-clause
4,982
# coding: UTF-8 """ Full end-to-end test: start a server, tunnel, and connect from the VM """ import argparse import SocketServer import contextlib import os import pkg_resources import socket import string import tempfile import threading import time import unittest from path import path from vmreflect import Tunn...
andrewdotn/vmreflect
vmreflect/tests/test_end_to_end.py
Python
bsd-2-clause
5,318