code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
#!/usr/bin/python
#
# 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 ag... | google/layered-scene-inference | lsi/nnutils/helpers.py | Python | apache-2.0 | 6,450 |
# 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 u... | Laurawly/tvm-1 | tests/python/contrib/test_cutlass.py | Python | apache-2.0 | 18,515 |
# Copyright 2016 Grist Labs, 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 writi... | gristlabs/asttokens | asttokens/asttokens.py | Python | apache-2.0 | 8,288 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# encoding=UTF8
# 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 ... | TieWei/nova | nova/tests/db/test_db_api.py | Python | apache-2.0 | 311,863 |
"""
Support for Yamaha Receivers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.yamaha/
"""
import logging
import requests
import voluptuous as vol
from homeassistant.components.media_player import (
DOMAIN, MEDIA_PLAYER_SCHEMA, MEDIA... | tinloaf/home-assistant | homeassistant/components/media_player/yamaha.py | Python | apache-2.0 | 13,441 |
__author__ = 'Sulantha'
import logging
class PipelineLogger:
logFunctions={'info':logging.info,
'debug':logging.debug,
'warning':logging.warning,
'error':logging.error,
'critical':logging.critical,
'exception':logging.exception}
... | sulantha2006/Processing_Pipeline | Utils/PipelineLogger.py | Python | apache-2.0 | 498 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | spandanb/horizon | openstack_dashboard/dashboards/admin/images/urls.py | Python | apache-2.0 | 1,311 |
import turtle
kay = turtle.Turtle()
kay.penup()
kay.goto(-125,0)
kay.pendown()
kay.width(5)
kay.color()
kay.color('blue','yellow')
kay.circle(50)
kay.penup()
kay.goto(0,0)
kay.pendown()
kay.color()
kay.color('black','yellow')
kay.circle(50)
kay.penup()
kay.goto(125,0)
kay.pendown()
kay.color()
kay.color('red','ye... | khoanguyen0791/cs170 | CS170_homework/Circles.py | Python | apache-2.0 | 579 |
import time
from Facturacion.Objects.Bill import Bill, ItemLine
from Facturacion.Controllers.ControlDB import BillsController
from Facturacion.Collections.Vendors import Vendors
from Facturacion.Collections.Clients import Clients
from Facturacion.Collections.Items import Items
class Bills:
facturas = {}
contr... | IhToN/DAW1-PRG | Facturacion/Collections/Bills.py | Python | apache-2.0 | 1,808 |
# Copyright (c) 2016, GohighSec
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | openstack/barbican | barbican/hacking/checks.py | Python | apache-2.0 | 7,978 |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 03 13:06:56 2015
@author: Eunice
"""
if __name__ == '__main__':
import sys
sys.path.append("..")
from engine import bar
# 以上模块仅测试用
from engine.broker.fillstrategy import DefaultStrategy
from engine.broker.backtesting import TradePercentage
from engine import ... | Yam-cn/potato | stratlib/thrSMA.py | Python | apache-2.0 | 5,091 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# 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... | jessevig/bertviz | bertviz/transformers_neuron_view/tokenization_bert.py | Python | apache-2.0 | 20,131 |
#!/usr/bin/python
__author__ = 'CGS'
import os, shutil, sys, distutils.core, subprocess
# Some configuration needed for this file
apps_directory = ""
apps = {"variants": "apps/variants"}
PRODUCTION = False
# TODO: better management of errors
# Some basic checks
if os.getuid() != 0:
sys.exit("This program require... | jpoullet2000/cgs-apps | installForTest.py | Python | apache-2.0 | 4,453 |
# Copyright 2016 Isotoma 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 writing... | yaybu/touchdown | touchdown/tests/fixtures/ssh_connection.py | Python | apache-2.0 | 2,710 |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | google-research/google-research | cache_replacement/policy_learning/cache_model/metric.py | Python | apache-2.0 | 7,155 |
_base_ = [
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
type='NASFCOS',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_c... | open-mmlab/mmdetection | configs/nas_fcos/nas_fcos_fcoshead_r50_caffe_fpn_gn-head_4x4_1x_coco.py | Python | apache-2.0 | 3,012 |
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from models import Project
class ProjectsTest(TestCase):
fixtures = ['test_data.json']
def test_project_listing(self):
"""
Verify that the project listing page contains a... | mazelife/django-belleville | belleville/projects/tests.py | Python | apache-2.0 | 1,492 |
# -*- 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... | googleads/google-ads-python | google/ads/googleads/v8/services/services/gender_view_service/transports/grpc.py | Python | apache-2.0 | 10,280 |
#
# Autogenerated by Thrift Compiler (0.14.1)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive impo... | jcamachor/hive | ql/src/gen/thrift/gen-py/queryplan/ttypes.py | Python | apache-2.0 | 43,635 |
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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... | platformio/platformio-core | platformio/commands/device/filters/time.py | Python | apache-2.0 | 1,381 |
#!/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/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... | chinbat/google-python-exercises | basic/string1.py | Python | apache-2.0 | 3,640 |
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... | moto-timo/ironpython3 | Tests/test_methodbinder1.py | Python | apache-2.0 | 57,530 |
from panda3d.core import *
from panda3d.direct import *
from NametagConstants import *
from Nametag3d import *
from Nametag2d import *
class NametagGroup:
CCNormal = CCNormal
CCNoChat = CCNoChat
CCNonPlayer = CCNonPlayer
CCSuit = CCSuit
CCToonBuilding = CCToonBuilding
CCSuitBuilding = CCSuitBui... | silly-wacky-3-town-toon/SOURCE-COD | otp/nametag/NametagGroup.py | Python | apache-2.0 | 9,754 |
# coding=utf-8
# Copyright 2022 The TensorFlow GAN 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 applicabl... | tensorflow/gan | tensorflow_gan/examples/progressive_gan/networks.py | Python | apache-2.0 | 15,202 |
#!/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/dfp/v201405/creative_wrapper_service/get_active_creative_wrappers.py | Python | apache-2.0 | 2,368 |
# -*- 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1_dataset_service_list_annotations_sync.py | Python | apache-2.0 | 1,539 |
# Copyright 2016-2017 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import logging
from botocore.exceptions import ClientError
import mock
from c7n.exceptions import PolicyValidationError
from c7n.executor import MainThreadExecutor
from c7n.resources.aws impo... | capitalone/cloud-custodian | tests/test_ebs.py | Python | apache-2.0 | 25,361 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2011 - 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | lakshmi-kannan/matra | openstack/common/rpc/impl_qpid.py | Python | apache-2.0 | 26,196 |
########################################################################
# amara/xpath/locationpaths/predicates.py
"""
A parsed token that represents a predicate list.
"""
from __future__ import absolute_import
from itertools import count, izip
from amara.xpath import datatypes
from amara.xpath.expressions.basics impo... | zepheira/amara | lib/xpath/locationpaths/predicates.py | Python | apache-2.0 | 7,392 |
##
# @author Brandon Michael
# Roll the dice based on the user's input. Track double rolls and display
# the double totals.
# import the random library
import random
# Set the start and end values the same as a dice
start = 1
end = 6
# Set the running total for doubles found
totalDoubles = 0
# Get the number of tim... | bwmichael/jccc-cis142-python | old/roll-the-dice.py | Python | apache-2.0 | 871 |
import os
import unittest
from __main__ import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
#
# CreateSamples
#
class CreateSamples(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https://github.com/Slicer/Slicer/blob/master/Base/Python/slicer/S... | fbudin69500/SlicerPythonPlayground | test/CreateSamples/CreateSamples.py | Python | apache-2.0 | 9,951 |
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from edctf.api.models import challengeboard, category, challenge
from edctf.api.serializers import challengeboard_serializer, category_serializer, challenge_serializer
class cha... | IAryan/edCTF | edctf/api/views/challengeboard.py | Python | apache-2.0 | 2,095 |
#!/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/
# Basic list exercises
# Fill in the code for the functions below. main() is already set ... | missyjcat/pythonexercises | basic/list1.py | Python | apache-2.0 | 3,070 |
"""The tests for SleepIQ binary sensor platform."""
import unittest
from unittest.mock import MagicMock
import requests_mock
from homeassistant.setup import setup_component
from homeassistant.components.binary_sensor import sleepiq
from tests.components.test_sleepiq import mock_responses
from tests.common import get... | persandstrom/home-assistant | tests/components/binary_sensor/test_sleepiq.py | Python | apache-2.0 | 1,835 |
from __future__ import print_function
from cms.sitemaps import CMSSitemap
from django.conf.urls import * # NOQA
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
from ImmOrbit.api import... | RedMap/Django-ImmOrbit | example/src/Demo/urls.py | Python | apache-2.0 | 1,077 |
import numpy as np
import pytest
import re
from typing import Text, Dict, Any, Callable, List, Optional, Union
from rasa.engine.graph import ExecutionContext
from rasa.engine.storage.storage import ModelStorage
from rasa.engine.storage.resource import Resource
from rasa.nlu.constants import (
DENSE_FEATURIZABLE_AT... | RasaHQ/rasa_nlu | tests/nlu/featurizers/test_lexical_syntactic_featurizer.py | Python | apache-2.0 | 11,174 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-30 12:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('todo', '0006_auto_20160530_1210'),
]
operations = [... | Azarn/mytodo | todo/migrations/0007_auto_20160530_1233.py | Python | apache-2.0 | 593 |
from nose.tools import eq_
from pepdata.amino_acid_alphabet import (
canonical_amino_acids,
canonical_amino_acid_letters,
extended_amino_acids,
extended_amino_acid_letters,
)
def test_canonical_amino_acids():
assert len(canonical_amino_acids) == 20
def test_canonical_amino_acids_letters():
ass... | hammerlab/pepdata | test/test_amino_acids.py | Python | apache-2.0 | 918 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Google Analytics cookie event formatters."""
import unittest
from plaso.formatters import ganalytics
from tests.formatters import test_lib
class AnalyticsUtmaCookieFormatterTest(test_lib.EventFormatterTestCase):
"""Tests for the UTMA Google Analytics coo... | dc3-plaso/plaso | tests/formatters/ganalytics.py | Python | apache-2.0 | 3,320 |
# 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 required by applica... | karllessard/tensorflow | tensorflow/python/tpu/tpu_outside_compilation_test.py | Python | apache-2.0 | 18,249 |
# coding=utf-8
__author__ = 'litao'
# -*- coding:utf-8 -*-
import urllib
import urllib2
import re
import thread
import time
class QSBK:
def __init__(self):
self.pageIndex = 1
self.user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
self.headers = { 'User-Agent' : self.user_age... | nfsli926/stock | python/com/nfs/helloworld.py | Python | apache-2.0 | 3,988 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | iwm911/plaso | plaso/output/l2t_csv.py | Python | apache-2.0 | 4,971 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from blinker import signal, Namespace, NamedSignal
from yosaipy2.core.event.abcs import EventBus
from typing import Dict
from functools import wraps
class BlinkerEventBus(EventBus):
def __init__(self):
# type: (str) -> None
self.AUTO_TOPIC = "blinker_e... | jellybean4/yosaipy2 | yosaipy2/core/event/event_bus.py | Python | apache-2.0 | 1,390 |
"""This test checks that Optuna is functional.
It also checks that it is usable with a separate scheduler.
"""
import time
import ray
from ray import tune
from ray.tune.suggest import ConcurrencyLimiter
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.optuna import OptunaSearch
def eval... | robertnishihara/ray | python/ray/tune/examples/optuna_example.py | Python | apache-2.0 | 1,721 |
'''
SI 618 - HW 4: Map-Reduce Part 2
Uniqname: gracfu
'''
from mrjob.job import MRJob
from mrjob.step import MRStep
import re
WORD_RE = re.compile(r"\b[\w']+\b")
class MRMostUsedWord(MRJob):
def mapper_get_words(self, _, line):
for word in WORD_RE.findall(line):
yield (word.lower(), 1)
def combiner_count_wo... | gracfu/618_map_reduce | map_reduce_part2.py | Python | apache-2.0 | 802 |
#!/usr/bin/env python
"""do_release.py
Usage:
do_release.py [--force] [CALICO_DOCKER_VERSION CALICO_VERSION LIBCALICO_VERSION LIBNETWORK_VERSION]
Options:
-h --help Show this screen.
"""
import subprocess
import utils
import re
from docopt import docopt
from utils import print_paragraph as para
from utils ... | alexhersh/calico-docker | release-scripts/do_release.py | Python | apache-2.0 | 11,007 |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/config/basic/servicegroup_servicegroupentitymonbindings_binding.py | Python | apache-2.0 | 10,748 |
# Copyright (c) 2013 Mirantis 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... | tellesnobrega/storm_plugin | sahara/service/trusts.py | Python | apache-2.0 | 1,897 |
#coding=utf-8
'''
Created on 2013年7月13日
@author: huiyugeng
'''
import types
import ndb
import regex
'''
载入解析映射
'''
def load_map(map_file):
map_struct = ndb.load(map_file)
map_list = ndb.execute(map_struct, 'select: map')
return map_list
'''
规则匹配及字段映射
'''
def reflect(map_list,... | fengtaijun/py_text | src/regex/regex_map.py | Python | apache-2.0 | 2,376 |
# 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/functions-framework-python | src/functions_framework/_function_registry.py | Python | apache-2.0 | 4,301 |
# Adapted from: https://github.com/sussexwearlab/DeepConvLSTM
__author__ = 'fjordonez, gchevalier'
from signal_filtering import filter_opportunity_datasets_accelerometers
import os
import zipfile
import argparse
import numpy as np
import cPickle as cp
from io import BytesIO
from pandas import Series
# Hardcoded num... | guillaume-chevalier/HAR-stacked-residual-bidir-LSTMs | data/preprocess_data.py | Python | apache-2.0 | 13,571 |
################################################################################
# Name : GDB Wrapper
# Author : Jesse Schwartzentruber & Tyson Smith
#
# Copyright 2014 BlackBerry Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | blackberry/ALF | alf/debug/_gdb.py | Python | apache-2.0 | 19,799 |
#!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | jiahaoliang/group-based-policy | setup.py | Python | apache-2.0 | 1,058 |
# ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | UManPychron/pychron | pychron/experiment/conflict_resolver.py | Python | apache-2.0 | 4,802 |
# GENERATED FILE - DO NOT EDIT THIS FILE UNLESS YOU ARE A WIZZARD
#pylint: skip-file
from heat.engine import properties
from heat.engine import constraints
from heat.engine import attributes
from heat.common.i18n import _
from avi.heat.avi_resource import AviResource
from avi.heat.avi_resource import AviNestedResource... | avinetworks/avi-heat | avi/heat/resources/se_group.py | Python | apache-2.0 | 63,203 |
import tangelo
import pymongo
import bson.json_util
from ArborFileManagerAPI import ArborFileManager
api = ArborFileManager()
api.initDatabaseConnection()
@tangelo.restful
def get(*pargs, **query_args):
if len(pargs) == 0:
return tangelo.HTTPStatusCode(400, "Missing resource type")
resource_type = pa... | arborworkflows/ProjectManager | tangelo/projmgr.py | Python | apache-2.0 | 7,996 |
try:
import unittest2 as unittest # Python2.6
except ImportError:
import unittest
from tests.functional import test_base
@unittest.skipIf(test_base.get_test_server_api() == 1,
"The tag API didn't work at v1 - see frontend issue #927")
class TestTags(test_base.TestBase):
testcase_name = "t... | photo/openphoto-python | tests/functional/test_tags.py | Python | apache-2.0 | 3,889 |
# -*- coding:utf-8 -*-
import scrapy | ds17/reptiles_gh | lianjia/lianjia.py | Python | apache-2.0 | 37 |
from setuptools import setup, find_packages
setup(name='netdisco',
version='0.9.2',
description='Discover devices on your local network',
url='https://github.com/home-assistant/netdisco',
author='Paulus Schoutsen',
author_email='Paulus@PaulusSchoutsen.nl',
license='Apache License 2.... | brburns/netdisco | setup.py | Python | apache-2.0 | 513 |
#coding: utf-8
#!/usr/bin/env python3
#Initial test code for MiSynth Wave Generator
#Opens Wave Files And Cuts And Plays Them As The FPGA will
#Synth plays back 2048 samples at frequency of note
#Effective sample rate is 901,120Hz @ 440Hz
#CURRENTLY A DRAWING LOOP TO BE SOLVED, THANKS WX/PYTHON FOR YOUR
#COMPLETE LACK... | magicmilo/MiSynth-Wavetable-Generator | main.py | Python | apache-2.0 | 9,015 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | girving/tensorflow | tensorflow/python/ops/special_math_ops_test.py | Python | apache-2.0 | 14,571 |
"""Constants for Google Assistant."""
from homeassistant.components import (
binary_sensor,
camera,
climate,
cover,
fan,
group,
input_boolean,
light,
lock,
media_player,
scene,
script,
sensor,
switch,
vacuum,
)
DOMAIN = "google_assistant"
GOOGLE_ASSISTANT_AP... | fbradyirl/home-assistant | homeassistant/components/google_assistant/const.py | Python | apache-2.0 | 3,937 |
# UDP code taken from < https://pymotw.com/2/socket/udp.html >
import socket, time, fcntl, struct
def udpBeacon():
# Create a UDP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADD... | cornell-cup/cs-minibot | minibot/hardware/communication/UDP.py | Python | apache-2.0 | 1,145 |
# -*- 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_vizier_service_suggest_trials_sync.py | Python | apache-2.0 | 1,664 |
import json
from datetime import datetime
from django.test import TestCase, Client
from authentication.models import Account
from recipies.models import Recipe, RecipeSteps
from recipies.serializers import RecipeSerializer, RecipeStepsSerializer
class Utility(TestCase):
"""Utility class para testing"""
@s... | moonboy13/brew-journal | brew_journal/recipies/tests.py | Python | apache-2.0 | 21,233 |
#!/usr/bin/python
'''
This script is used to generate a set of random-ish events to
simulate log data from a Juniper Netscreen FW. It was built
around using netcat to feed data into Flume for ingestion
into a Hadoop cluster.
Once you have Flume configured you would use the following
command to populate data:
./g... | jpacerqueira/jpac-flume-logs | generator/gen_events.py | Python | apache-2.0 | 1,662 |
# coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kinow_client
from kinow_client.rest import A... | kinow-io/kinow-python-sdk | test/test_add_product_to_cart_request.py | Python | apache-2.0 | 841 |
# -*- encoding: utf-8 -*-
# from django.test import TestCase
# from block.tests.helper import check_content
# from compose.tests.factories import HeaderFactory
# class TestHeader(TestCase):
#
# def test_content_methods(self):
# c = HeaderFactory()
# check_content(c)
| pkimber/compose | compose/tests/test_header.py | Python | apache-2.0 | 291 |
# -*- 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... | googleapis/python-compute | google/cloud/compute_v1/services/region_commitments/transports/__init__.py | Python | apache-2.0 | 1,127 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | google/citest | tests/json_contract/observation_verifier_test.py | Python | apache-2.0 | 14,132 |
import re
import uuid as py_uuid
from common_fixtures import * # NOQA
from test_volume import VOLUME_CLEANUP_LABEL
TEST_IMAGE = 'ibuildthecloud/helloworld'
TEST_IMAGE_LATEST = TEST_IMAGE + ':latest'
TEST_IMAGE_UUID = 'docker:' + TEST_IMAGE
if_docker = pytest.mark.skipif("os.environ.get('DOCKER_TEST') == 'false'",
... | vincent99/cattle | tests/integration/cattletest/core/test_docker.py | Python | apache-2.0 | 46,359 |
import django_filters
from django_filters import rest_framework as filters
from django_rv_apps.apps.believe_his_prophets.models.book import Book
from django_rv_apps.apps.believe_his_prophets.models.bible_read import BibleRead
from django_rv_apps.apps.believe_his_prophets.models.testament import Testament
class B... | davrv93/creed-en-sus-profetas-backend | django_rv_apps/apps/believe_his_prophets_api/views/book/filters.py | Python | apache-2.0 | 550 |
#!/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 or... | google/aiyprojects-raspbian | src/examples/voice/cloudspeech_demo.py | Python | apache-2.0 | 2,336 |
# -*- 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... | googleapis/python-dialogflow-cx | samples/generated_samples/dialogflow_v3beta1_generated_experiments_delete_experiment_sync.py | Python | apache-2.0 | 1,446 |
#!/usr/bin/python
#title :gentotsv.py
#description :Script to process impute files .gz and create a csv file
#author :Diego Alvarez
#date :2016-06-05
#python_version :3.5
#==============================================================================
import gzip
import os
import fn... | bigdatafoundation/qngene | Export_gen_files/gentotsv.py | Python | apache-2.0 | 14,598 |
# Copyright (c) 2015 Alex Meade
# Copyright (c) 2015 Rushil Chugh
# Copyright (c) 2015 Navneet Singh
# Copyright (c) 2015 Yogesh Kshirsagar
# 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
... | saeki-masaki/cinder | cinder/volume/drivers/netapp/eseries/library.py | Python | apache-2.0 | 46,616 |
#!/usr/bin/env python
from __future__ import print_function
from future.standard_library import install_aliases
install_aliases()
from urllib.parse import urlparse, urlencode
from urllib.request import urlopen, Request
from urllib.error import HTTPError
import json
import os
from flask import Flask
from flask impor... | MarcoLemmens/sporttotaal | app.py | Python | apache-2.0 | 5,918 |
#!/usr/bin/env python3
__author__ = "Ashwin Nanjappa"
# GUI viewer to view JSON data as tree.
# Ubuntu packages needed:
# python3-pyqt5
# Std
import argparse
import collections
import json
import sys
# External
from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5 import QtWidgets
class TextToTreeItem:
... | ashwin/json-viewer | json_viewer.py | Python | apache-2.0 | 4,537 |
"""The tests for the Script component."""
# pylint: disable=protected-access
import asyncio
from contextlib import contextmanager
from datetime import timedelta
import logging
from unittest import mock
import pytest
import voluptuous as vol
# Otherwise can't test just this file (import order issue)
from homeassistant... | pschmitt/home-assistant | tests/helpers/test_script.py | Python | apache-2.0 | 46,540 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflow/tpu | models/experimental/dcgan/mnist_model.py | Python | apache-2.0 | 3,215 |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | QISKit/qiskit-sdk-py | qiskit/transpiler/transpile_config.py | Python | apache-2.0 | 1,338 |
# Copyright 2015 Tianchuan Du University of Delaware
# 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
#
# THIS CODE IS PROVIDED *AS IS* BAS... | magic2du/dlnn | cmds2/run_CNN_SAT.py | Python | apache-2.0 | 5,839 |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2020 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... | mmerce/python | bigml/tests/create_script_steps.py | Python | apache-2.0 | 3,531 |
# Generated by Django 2.2.24 on 2021-10-02 14:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('products', '0072_product_order_index'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='order_index',
... | flavoi/diventi | diventi/products/migrations/0073_remove_product_order_index.py | Python | apache-2.0 | 337 |
#!/usr/bin/env python
# -*- coding: rot13 -*-
cevag "Uryyb TvgUho!".rapbqr("rot13")
| ET-CS/python-patterns | examples/python2/fun/rot13.py | Python | apache-2.0 | 85 |
# -*- coding: utf-8 -*-
"""Configure Watchmaker documentation."""
from __future__ import (absolute_import, division, print_function,
unicode_literals, with_statement)
import os
import sys
#
# Created by sphinx-quickstart on Thu Jun 30 20:11:36 2016.
#
# This file is execfile()d with the curren... | plus3it/watchmaker | docs/conf.py | Python | apache-2.0 | 11,108 |
import sys
import warnings
from django.db.models.fields import FieldDoesNotExist
from django.utils.text import capfirst
from django.utils.encoding import smart_text
try:
from django.db.models.options import get_verbose_name
except ImportError:
from django.utils.text import camel_case_to_spaces as get_verbose_... | iandd0824/ri-app | web/django_mongoengine/forms/document_options.py | Python | apache-2.0 | 7,439 |
from typing import Any, Dict, List, Optional, Set
from annotypes import add_call_types, stringify_error
from cothread import cothread
from p4p import Value
from p4p.server import DynamicProvider, Server, ServerOperation
from p4p.server.cothread import Handler, SharedPV
from malcolm.core import (
APublished,
B... | dls-controls/pymalcolm | malcolm/modules/pva/controllers/pvaservercomms.py | Python | apache-2.0 | 14,734 |
#!/usr/bin/python
# Copyright 2015 Rackspace, 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... | eshijia/magnum | magnum/templates/docker-swarm/fragments/make-cert.py | Python | apache-2.0 | 4,072 |
# 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... | tombstone/models | official/recommendation/ncf_keras_main.py | Python | apache-2.0 | 19,975 |
import pathlib
import sys
import attr
import pytest
import salt.channel.server
import salt.ext.tornado.gen
import salt.transport.ipc
import salt.utils.platform
from salt.ext.tornado import locks
pytestmark = [
# Windows does not support POSIX IPC
pytest.mark.skip_on_windows,
pytest.mark.skipif(
sy... | saltstack/salt | tests/pytests/functional/transport/ipc/test_subscriber.py | Python | apache-2.0 | 3,365 |
"""Deletes a global load balancer rule."""
from baseCmd import *
from baseResponse import *
class deleteGlobalLoadBalancerRuleCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""the ID of the global load balancer rule"""
"""Required"""
self.id = None
... | MissionCriticalCloud/marvin | marvin/cloudstackAPI/deleteGlobalLoadBalancerRule.py | Python | apache-2.0 | 763 |
# Copyright 2011 Andrew Bogott for the Wikimedia 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 requi... | fajoy/nova | nova/network/dns_driver.py | Python | apache-2.0 | 1,432 |
# 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... | NeCTAR-RC/horizon | openstack_dashboard/api/_nova.py | Python | apache-2.0 | 5,498 |
from django.core.management.base import BaseCommand
from django.utils.timezone import now
from ...models import BlogEntry, RelatedBlog, Feed
from ...parser import get_all_entries, update_blog_supernav
class Command(BaseCommand):
""" Update blog entries and related blog feed data """
def handle(self, **optio... | Mariatta/pythondotorg | blogs/management/commands/update_blogs.py | Python | apache-2.0 | 1,451 |
import logging
import random
import string
import sys
from oslo.config import cfg
# Logging setup
logger = logging.getLogger(__name__)
stdout = logging.StreamHandler(sys.stdout)
stdout.setLevel(logging.DEBUG)
logger.addHandler(stdout)
logger.setLevel(logging.DEBUG)
default_opts = [
cfg.StrOpt('working_dir',
... | jarretraim/py-docstack | docstack/config.py | Python | apache-2.0 | 2,382 |
# Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2014 Ben Swartzlander. All rights reserved.
# Copyright (c) 2014 Navneet Singh. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2014 Bob Callaw... | Akrog/cinder | cinder/volume/drivers/netapp/dataontap/nfs_cmode.py | Python | apache-2.0 | 24,731 |
# 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 u... | toddpalino/kafka-tools | kafka/tools/assigner/actions/clone.py | Python | apache-2.0 | 2,839 |
import xbmcgui
import urllib
def download(url, dest, dp = None):
if not dp:
dp = xbmcgui.DialogProgress()
dp.create("XBMCHUB...","Downloading & Copying File",' ', ' ')
dp.update(0)
urllib.urlretrieve(url,dest,lambda nb, bs, fs, url=url: _pbhook(nb,bs,fs,url,dp))
def _pbhook(numblocks, blo... | aplicatii-romanesti/allinclusive-kodi-pi | .kodi/addons/plugin.video.familyfunflix/downloader.py | Python | apache-2.0 | 588 |
import os
import sys
import logging
import datetime
from future.utils import iteritems
from pandaharvester.harvesterconfig import harvester_config
try:
os.remove(harvester_config.db.database_filename)
except Exception:
pass
from pandaharvester.harvestercore.db_proxy_pool import DBProxyPool as DBProxy
from panda... | PanDAWMS/panda-harvester | pandaharvester/harvestertest/basicTest.py | Python | apache-2.0 | 1,286 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.