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 |
|---|---|---|---|---|---|
# /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2012-3-4
Modify_1: 2012.7.27
Modify_2: 2013.12.20
@author: zepheir
简介:
-- 这个控制台(Console)运行在服务器端;
-- 将"zhyDB"中的"devices"集中的数据转化为"Vars"集的数据;
-- 转化公式由"Vars"集中的calc来确定, 如果calc为"1"则直接赋值;
'''
import sys
sys.path.append('/app/srv/src')
from... | zepheir/pySrv_sipai | srv/src/resultConsole.py | Python | apache-2.0 | 7,198 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Created on Jan 25, 2018
.. codeauthor: Max Goebel <goebel@weblyzard.com>
'''
from __future__ import unicode_literals
from builtins import object
import json
from datetime import datetime
from decimal import Decimal
from itertools import chain
from weblyzard_api.model.par... | weblyzard/weblyzard_api | src/python/weblyzard_api/model/document.py | Python | apache-2.0 | 14,357 |
# 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, print_function, unicode_literals
from textwrap import dedent
from twitter.common.dirutil.fileset import Fileset
from pan... | twitter/pants | tests/python/pants_test/backend/codegen/antlr/python/test_antlr_py_gen.py | Python | apache-2.0 | 2,112 |
#!/usr/bin/python
# _*_ coding: utf-8 -*-
import base64 # used for base64 encoding of files
import ConfigParser # parses plain text config files
from httplib2 import Http
import httplib2
import json # provides high level JSON parsing functions
import mimetypes # provides high level methods for evaluating mime dat... | escube/GoogleCloudSpooler | lib/cloud_lib/cloud_spooler.py | Python | apache-2.0 | 13,426 |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | GoogleCloudPlatform/Data-Pipeline | app/src/pipelines/stages/gceinstancesinput.py | Python | apache-2.0 | 2,807 |
# Copyright 2015 Spotify AB. All rights reserved.
#
# The contents of this file are 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... | GGabriele/napalm-panos | napalm_panos/__init__.py | Python | apache-2.0 | 940 |
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from setuptools import find_packages, setup
setup(
name="tensorflow_custom_op",
version="0.0.1",
packages=find_packages(),
data_files=[("", ["libtensorflow-zero-out-operat... | tdyas/pants | examples/src/python/example/tensorflow_custom_op/setup.py | Python | apache-2.0 | 333 |
# -*- 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-artifact-registry | samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_test_iam_permissions_sync.py | Python | apache-2.0 | 1,637 |
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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/LIC... | redhat-openstack/glance | glance/tests/unit/test_policy.py | Python | apache-2.0 | 20,465 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Rackspace Hosting
#
# 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.... | rmyers/trove-dashboard | trove_dashboard/databases/urls.py | Python | apache-2.0 | 1,000 |
#!/usr/bin/python
# Copyright (c) 2017 David LePage
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: external_gateway
short_desc... | gabstopper/ansible-stonesoft | library/external_gateway.py | Python | apache-2.0 | 8,293 |
__author__ = 'Georgios Rizos (georgerizos@iti.gr)'
import numpy as np
from reveal_popularity_prediction.features.common import get_binary_graph, get_degree_undirected, get_degree_directed
def calculate_user_count(user_graph):
nodes_1 = list(user_graph.row)
nodes_2 = list(user_graph.col)
nodes = set(node... | MKLab-ITI/news-popularity-prediction | reveal_fp7_module/reveal-popularity-prediction/reveal_popularity_prediction/features/user_graph.py | Python | apache-2.0 | 6,955 |
import hashlib
import random
from datetime import timedelta
from typing import Any, Dict, List, Mapping, Optional, Sequence, Set, Union
from unittest import mock
import orjson
from django.conf import settings
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from django.utils.time... | punchagan/zulip | zerver/tests/test_subs.py | Python | apache-2.0 | 215,815 |
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | github-borat/cinder | cinder/openstack/common/processutils.py | Python | apache-2.0 | 10,827 |
#
# 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... | apache/incubator-airflow | airflow/migrations/versions/7939bcff74ba_add_dagtags_table.py | Python | apache-2.0 | 1,617 |
#!/usr/bin/env python
# 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
... | oleiade/stamp | stamp/utils.py | Python | apache-2.0 | 2,384 |
#
# 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
# ... | pshchelo/heat | heat/api/openstack/v1/stacks.py | Python | apache-2.0 | 20,533 |
# -*- 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-notebooks | samples/generated_samples/notebooks_v1_generated_notebook_service_stop_instance_async.py | Python | apache-2.0 | 1,558 |
import socket
def get_remote_machine_info():
remote_host = 'www.python.org'
try:
print "IP address of %s: %s" %(remote_host,socket.gethostbyname(remote_host))
except socket.error, err_msg:
print "%s: %s" %(remote_host,err_msg)
if __name__ == '__main__':
get_remote_machine_info(... | vvvvcp/NeverMore | base/remoteinfo.py | Python | apache-2.0 | 321 |
class CaptureOutput:
def write(self, message):
pass | aabs/edx-ai-week4-project | CaptureOutput.py | Python | apache-2.0 | 63 |
# This file is part of Moksha.
# Copyright (C) 2008-2010 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 ... | lmacken/moksha | moksha/api/widgets/placeholder.py | Python | apache-2.0 | 982 |
# 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... | thomasquintana/jobber | jobber/core/scheduler/shortest_job_next_scheduler.py | Python | apache-2.0 | 2,047 |
__author__ = 'jcorbett'
from slickqaweb.model.project import Project
from slickqaweb.model.projectReference import ProjectReference
from slickqaweb.model.testcase import Testcase
from slickqaweb.model.testcaseReference import TestcaseReference
from slickqaweb.model.component import Component
from slickqaweb.model.comp... | slickqa/slickqaweb | slickqaweb/model/reference.py | Python | apache-2.0 | 6,271 |
from typing import Type, Callable, Any, Dict, Tuple, Union
from util.flask_utils_types import Function
T = Type['T'] # class type
R = Type['R'] # return type
Extender = Union[Callable[[T, Any], R], callable]
Overrider = Union[Callable[[Callable[[Any], R], T, Any], R], callable]
def extend(klass):
#... | csmithsalzberg/Mr-CSS-Rockets | util/oop.py | Python | apache-2.0 | 1,300 |
# Copyright (c) 2015 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 writin... | OpenDaisy/daisy-api | daisy/artifacts/__init__.py | Python | apache-2.0 | 1,553 |
# 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... | YanTangZhai/tf | tensorflow/python/client/session_test.py | Python | apache-2.0 | 24,764 |
from datetime import datetime
import json
import os
import time
import math
import logging
import shutil
from graphite.render.hashing import ConsistentHashRing, hashRequest, hashData
from graphite.render.utils import extractPathExpressions
import whisper
from django.conf import settings
try:
from django.urls impo... | gwaldo/graphite-web | webapp/tests/test_render.py | Python | apache-2.0 | 17,244 |
import logging
import struct
import six
from six.moves import xrange
from kafka.codec import (
gzip_encode, gzip_decode, snappy_encode, snappy_decode
)
from kafka.common import (
Message, OffsetAndMessage, TopicAndPartition,
BrokerMetadata, TopicMetadata, PartitionMetadata,
MetadataResponse, ProduceR... | CrowdStrike/kafka-python | kafka/protocol.py | Python | apache-2.0 | 21,748 |
# 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, sof... | google-research/long-range-arena | lra_benchmarks/matching/configs/sinkhorn_transformer_base.py | Python | apache-2.0 | 898 |
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(process)-5d %(thread)d %(name)-50s %(levelname)-8s %(message)s'
},
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s:%(lineno)s %(funcName)s %(me... | davidhiendl/docker-seafile | config/seahub_settings.append.py | Python | apache-2.0 | 1,445 |
# Copyright 2012 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 w... | takeshineshiro/keystone | keystone/tests/unit/test_versions.py | Python | apache-2.0 | 45,174 |
from synapse.common import *
class Reactor:
'''
A class for registraction of one-to-one callbacks.
( much like a switch-case in C )
Unlike an EventBus, only one action may be registered
for a given mesg type and the function is expected to
return a result.
rtor = Reactor()
def doFooBa... | williballenthin/synapse | synapse/reactor.py | Python | apache-2.0 | 1,100 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# Copyright 2011 OpenStack Foundation
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# All Rights Reserved.
#
# Licensed under the ... | openstack/designate | designate/service.py | Python | apache-2.0 | 13,073 |
from discord.ext import commands
import cogs.utils.db as db
import discord
import asyncio
import logging
import json
import datetime
import psycopg2
# Logger Configuration
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='... | j-nguyen/FractalBot | bot.py | Python | apache-2.0 | 1,528 |
# ~*~ coding: utf-8 ~*~
__author__ = 'Kamo Petrosyan'
from django.core.management.base import BaseCommand, CommandError
from lxml import etree
from virtenviro.content.models import Page, AdditionalField, FieldValue, Template
def create_page(title, slug, content, template, is_home=False, intro='',
par... | Haikson/virtenviro | virtenviro/content/management/commands/import_content.py | Python | apache-2.0 | 5,045 |
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# profile Profile CPU usage by sampling stack traces at a timed interval.
# For Linux, uses BCC, BPF, perf_events. Embedded C.
#
# This is an efficient profiler, as stack traces are frequency counted in
# kernel context, rather than passing ever... | mkacik/bcc | tools/profile.py | Python | apache-2.0 | 9,848 |
#!/usr/bin/env python
#
# Copyright 2007 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... | GoogleCloudPlatform/appengine-python-standard | tests/google/appengine/api/apiproxy_stub_test.py | Python | apache-2.0 | 7,268 |
from pony.orm import *
from datetime import datetime
from model.group import Group
from model.contact import Contact
from pymysql.converters import encoders,decoders, convert_mysql_timestamp
class ORMFixture:
db = Database()
class ORMGroup(db.Entity):
_table_ = 'group_list'
id = PrimaryKey(in... | jurkovskaja/Task1 | fixture/orm.py | Python | apache-2.0 | 2,830 |
import datetime
from time import sleep
from typing import List
import bel.edge.edges
import bel.resources.resource
import bel.utils
import structlog
from common.celery import celery_app
log = structlog.getLogger(__name__)
@celery_app.task
def add_namespace(resource_url):
"""Add BEL resource_url to bel_resource... | belbio/bel_api | app/services/tasks.py | Python | apache-2.0 | 387 |
#!/usr/bin/python
# Copyright 2015 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 a... | TAJaroszewski/lma_contrail_monitoring | deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_openstack.py | Python | apache-2.0 | 11,828 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = "jihongrui@hotmail.com"
'''
nginx config
log_format json
'"host":"$server_addr",'
'"clientip":"$remote_addr",'
'"http_host":"$host",'
'"url":"$uri",'
'"agent":"$http_user_age... | jihongrui/markdown | ELK/test_elk_port.py | Python | apache-2.0 | 868 |
#!/usr/local/bin/python
from sys import argv
import os
import math
import urllib2
import time
import random
def deg2num(lat_deg, lon_deg, zoom):
lat_rad = math.radians(lat_deg)
n = 2.0 ** zoom
xtile = int((lon_deg + 180.0) / 360.0 * n)
ytile = int((1.0 - math.log(math.tan(lat_rad) + (1 / math.cos(lat_rad))) / mat... | ipepe/rails-real-tram-map | scripts/download_tiles.py | Python | apache-2.0 | 1,595 |
#!/usr/bin/env python
# Copyright 2015-2017 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | arm-hpc/allinea_json_analysis | MAP_JSON_Scripts/plot_mult_metrics_one_file.py | Python | apache-2.0 | 4,938 |
from setuptools import setup
setup(
name = 'sphinx-tabs',
version = '1.1.10',
author = 'djungelorm',
author_email = 'djungelorm@users.noreply.github.com',
packages = ['sphinx_tabs', 'sphinx_tabs.test'],
test_suite='sphinx_tabs.test',
package_data = {
'sphinx_tabs': [
'ta... | TheImagingSource/tiscamera | doc/sphinx-tabs/setup.py | Python | apache-2.0 | 1,508 |
#
#Test executable #04 for the ParticleBeam6D class.
#
# Copyright (c) 2016 RadiaBeam Technologies. All rights reserved
#
# RadiaBeam imports
import radtrack.bunch.RbParticleBeam6D as beam
# Specify the desired number of particles
numpoints = 4000
# Specify the average beam energy [eV]
energy = 2.5e+6
# Exercise som... | radiasoft/radtrack | experimental/bunch/testBeam04.py | Python | apache-2.0 | 1,703 |
from .base import BasePlatform
class GitHubPlatform(BasePlatform):
PATTERNS = {
"https": (
r"(?P<protocols>(git\+)?(?P<protocol>https))://(?P<domain>[^/]+?)"
r"(?P<pathname>/(?P<owner>[^/]+?)/(?P<repo>[^/]+?)(?:\.git)?(?P<path_raw>(/blob/|/tree/).+)?)$"
),
"ssh": (
... | yakky/giturlparse | giturlparse/platforms/github.py | Python | apache-2.0 | 1,446 |
###############################################################################################################
# Configure Logging:
# A directory to place log files in
LOG_DIR = "./logs/"
WORKSPACE_ = "./workspace/"
#######################################################################################################... | Tallisado/pyrobot_v1.0 | PyrobotConfig.py | Python | apache-2.0 | 1,492 |
"""
overloaded hacks for behave stuff
"""
import logging
from behave.formatter import formatters
from behave.runner_util import parse_features
from behave.model import Step, FileLocation
from behave.runner import Context, os, Runner
import mobilebdd
log = logging.getLogger(u'mobilebdd')
class HackedContext(Conte... | PhoenixWright/MobileBDDCore | mobilebdd/hacks/behaver.py | Python | apache-2.0 | 8,322 |
'''
Created on 25/11/2015
@author: alberto
'''
import unittest
from discoverer.discoverer import TBTAFDiscoverer
class prueba_unidad(unittest.TestCase):
def setUp(self):
pass
def test_HayComentarioMultilinea(self):
comment = TBTAFDiscoverer._readFirstMultilineComment('./samples/testComp... | S41nz/TBTAF | tbtaf/test/discoverer/comment_ut.py | Python | apache-2.0 | 760 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main-window.ui'
#
# Created by: PyQt5 UI code generator 5.12
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainW... | takeshixx/deen | deen/gui/widgets/ui_deenmainwindow.py | Python | apache-2.0 | 6,037 |
# Copyright 2009, Peter A. Bigot
#
# 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 ... | jonfoster/pyxb1 | pyxb/namespace/builtin.py | Python | apache-2.0 | 13,395 |
#__init__.py
# mas_unittest
#
# 2020-02-04 tc Initial, empty
| dinkumsoftware/dinkum | mas_unittest/__init__.py | Python | apache-2.0 | 62 |
#
# Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# 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 in the top-level directory
# of this distribution and at:
#
# http:... | hirokihamasaki/irma | probe/modules/metadata/pe_analyzer/plugin.py | Python | apache-2.0 | 3,613 |
from setuptools import setup
install_requires = [
'psycopg2',
]
setup(
name='cockroachdb',
version='0.3.1',
author='Cockroach Labs',
author_email='cockroach-db@googlegroups.com',
url='https://github.com/cockroachdb/cockroachdb-python',
description='CockroachDB adapter for SQLAlchemy',
... | cockroachdb/cockroach-python | setup.py | Python | apache-2.0 | 806 |
# 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... | tensorflow/tensorboard | tensorboard/util/timing.py | Python | apache-2.0 | 3,734 |
#!/usr/bin/env python
def walkfiles(apath, apattern=None):
for dir, dirlist, filelist in os.walk(apath):
for fname in filelist:
if apattern and not fnmatch.fnmatch(fname, apattern):
continue
yield os.path.join(dir, fname)
if __name__ == '__main__':
import os
... | ketancmaheshwari/hello-goog | src/python/likefind.py | Python | apache-2.0 | 404 |
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import time
import numpy as np
import sklearn.datasets
import sklearn.cross_validation
import sklearn.metrics
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
import canopy
fX = th... | nsauder/treeano | examples/mnist_mlp.py | Python | apache-2.0 | 3,438 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'workspace_merger.ui'
#
# Created: Tue Mar 24 13:44:50 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
exce... | xcgspring/XSTAF | XSTAF/tools/workspace_merger/ui/ui_workspace_merger.py | Python | apache-2.0 | 4,842 |
# Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved.
#
# Author: Kiall Mac Innes <kiall@hp.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.... | richm/designate | designate/central/__init__.py | Python | apache-2.0 | 1,860 |
from .base import *
SECRET_KEY = "HHSCLIENT-e81)))_cdlv24!g$4)b&wq9fjn)p!vrs729idssk2qp7iy!u#"
DBPATH=os.path.join(BASE_DIR, 'db/db.db')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': DBPATH, ... | TransparentHealth/hhs_oauth_client | hhs_oauth_client/settings/production.py | Python | apache-2.0 | 1,304 |
#
# 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
# ... | openstack/heat | heat/tests/openstack/monasca/test_alarm_definition.py | Python | apache-2.0 | 7,729 |
# -*- coding: utf-8 -*-
# 价格监控
DFXD = {"name": "大幅下跌", "description": ""}
DFSZ = {"name": "大幅上涨", "description": None}
JJDT = {"name": "接近跌停", "description": "跌幅超过-9%"}
JJZT = {"name": "接近涨停", "description": "涨幅超过9%"}
XXTP = {"name": "向下突破", "description": "当前价格小于设定的区间最低价low"}
XSTP = {"name": "向上突破", "description": "当... | zengbin93/Debug_A | debug_a/labels.py | Python | apache-2.0 | 937 |
"""
Original code Copyright 2009 [Waylan Limberg](http://achinghead.com)
All changes Copyright 2008-2014 The Python Markdown Project
Changed by Mohammad Tayseer to add CSS classes to table
License: [BSD](http://www.opensource.org/licenses/bsd-license.php)
"""
from __future__ import absolute_import
from __future__ ... | Jumpscale/web | examples/miniportal/portal/markdown_extensions/__init__.py | Python | apache-2.0 | 2,240 |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 19 21:45:57 2016
@author: AmatVictoriaCuramIII
"""
#Get modules
import numpy as np
import pandas.io.data as web
import pandas as pd
from pandas import read_csv
#Import and define info the list
df = read_csv('companylist.csv', sep = ',')
df1 = df.set_index('Symbol')
symbo... | adamrvfisher/TechnicalAnalysisLibrary | DefinitionList.py | Python | apache-2.0 | 7,664 |
import os
import re
import sys
import time
import fcntl
import types
import shelve
import random
import datetime
import commands
import traceback
import threading
import userinterface.Client as Client
from dataservice.DDM import ddm
from dataservice.DDM import toa
from dataservice.DDM import dashBorad
from dataservice.... | RRCKI/panda-server | pandaserver/test/datasetManager.py | Python | apache-2.0 | 49,774 |
# -*- coding: utf-8 -*-
"""Helper for building projects from source."""
from __future__ import unicode_literals
from l2tdevtools.build_helpers import dpkg
from l2tdevtools.build_helpers import msi
from l2tdevtools.build_helpers import osc
from l2tdevtools.build_helpers import pkg
from l2tdevtools.build_helpers import... | rgayon/l2tdevtools | l2tdevtools/build_helper.py | Python | apache-2.0 | 2,179 |
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from easy_thumbnails.fields import ThumbnailerImageField
from easy_thumbnails.files import... | JiaruZhang/Five | lbforum/models.py | Python | apache-2.0 | 9,562 |
import pygame
import db.db_service
import screens.sound as sound
import widget.button
HighscoresFetchQuery = "SELECT name, wins, losses, trim(from to_char(CAST(wins AS float) / CAST(wins + losses AS float), \'0.00\')) AS ratio FROM players GROUP BY name, wins, losses ORDER BY ratio DESC LIMIT 10;"
class HighscoresSc... | sinoz/boat-wars | src/screens/highscores.py | Python | apache-2.0 | 2,058 |
""" job.py
Bryce Mecum (mecum@nceas.ucsb.edu)
A Job processes a set of files in a directory for people and organization
and exports a list of unique people and organizations and their respective
documents.
"""
import os
import processing
import helpers
import unicodecsv
import pandas
class Job:
... | ec-geolink/d1lod | d1lod/d1lod/people/job.py | Python | apache-2.0 | 4,627 |
# Copyright 2019 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 required by applicable ... | prasanna08/oppia | core/controllers/contributor_dashboard.py | Python | apache-2.0 | 10,614 |
class farben:
AUF = '\033[91m'
LD = '\033[94m'
IN= '\033[92m'
END = '\033[0m'
| sarah314/SpyPi | Code/colors.py | Python | apache-2.0 | 99 |
import importlib
import os
import unittest
import open_container.ride as ride
from datetime import datetime, date, time, timedelta
class TestPassengers(unittest.TestCase):
def test_add_passenger(self):
DB_NAME = "create_event.test"
conn = ride.load_database(DB_NAME)
event_time = datetim... | liam-middlebrook/open-container | tests/test_passengers.py | Python | apache-2.0 | 3,811 |
# Copyright 2012 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 l... | fabian4/trove | trove/tests/unittests/guestagent/test_backups.py | Python | apache-2.0 | 32,833 |
import boto
import boto.ec2.elb
import datetime
import logging
from boto.ec2.cloudwatch import CloudWatchConnection
from boto.ec2 import RegionInfo
__all__ = ['get_elb_metrics']
'''
List of all ELB metrics we will collect. Each tuple in the list should have the form
(metric_name, statistic, metric_name_id)
where... | boundary/boundary-plugin-aws-elb | elb_metrics.py | Python | apache-2.0 | 6,339 |
"""
Support for Modbus.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/modbus/
"""
import logging
import threading
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import (
EVENT_HOMEASSISTANT_... | alexmogavero/home-assistant | homeassistant/components/modbus.py | Python | apache-2.0 | 6,110 |
""" ACL parsing stuff """
from kazoo.security import (
ACL,
Id,
make_acl,
make_digest_acl,
Permissions
)
class ACLReader(object):
""" Helper class to parse/unparse ACLs """
class BadACL(Exception):
""" Couldn't parse the ACL """
pass
valid_schemes = [
"world",... | harlowja/zk_shell | zk_shell/acl.py | Python | apache-2.0 | 2,728 |
# 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... | jiahaoliang/group-based-policy | gbpservice/neutron/tests/unit/nfp/configurator/test_data/fw_test_data.py | Python | apache-2.0 | 12,890 |
# Generated by Django 2.2.1 on 2019-05-29 16:05
from django.conf import settings
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_... | Ecotrust/COMPASS | mp/drawing/migrations/0001_initial.py | Python | apache-2.0 | 2,266 |
from collections import namedtuple
import functools
Decision = namedtuple('Decision', ['symbol', 'weight'])
Bias = namedtuple('Bias', ['symbol', 'modifier'])
Perception = namedtuple('Perception', ['symbol', 'value', 'reference'])
# Observation vector = perception plus physical modifiers
# choice vector = bias vector ... | lexwraith/ThisIsBob | src/agent/decisions.py | Python | apache-2.0 | 4,431 |
# Copyright (c) 2015 Quobyte, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | bswartz/manila | manila/tests/share/drivers/quobyte/test_quobyte.py | Python | apache-2.0 | 29,391 |
import struct
import math
import sys,getopt
import pexpect
import time
import struct
import binascii
import numpy as np
#import MySQLdb as sqldb
from time import gmtime, strftime
import time
DEFAULT_MAC_ADDRESS = "B0:B4:48:B8:9C:80"
#Lists containing the handles of the sensors to switch them on and to
#read the respo... | IoT-Expedition/Edge-Analytics | virtual_sensor/archive/RecordRawData.py | Python | apache-2.0 | 6,125 |
from django.db import models
# cms models
class Content(models.Model):
uri = models.CharField(max_length=2000, blank=True)
element_id = models.CharField(max_length=500, null=True, blank=True)
content = models.TextField()
date_created = models.DateTimeField(auto_now_add=True, editable=False)
date_mo... | sstacha/uweb-install | cms_files/models.py | Python | apache-2.0 | 522 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
fro... | gcrahay/otx_misp | setup.py | Python | apache-2.0 | 2,156 |
__author__ = 'Arunkumar Eli'
__email__ = "elrarun@gmail.com"
from selenium.webdriver.common.by import By
class InfraHostsLocators(object):
STATUS_LABEL = "/html/body/div/div[6]/div/main/section[2]/div[1]/div/div[1]/div[2]/span"
CREATING_HOST_PREFIX= "//section[2]/div["
CREATING_HOST_SUFFIX= "]/div/div[1... | aruneli/rancher-test | ui-selenium-tests/locators/InfraHostsLocators.py | Python | apache-2.0 | 841 |
"""
TMVA factory runs with classifier and additional information
"""
from __future__ import division, print_function, absolute_import
import sys
import os
from rootpy.io import root_open
import ROOT
from . import tmva
from six.moves import cPickle as pickle
__author__ = 'Tatiana Likhomanenko'
def tmva_proces... | Quadrocube/rep | rep/estimators/_tmvaFactory.py | Python | apache-2.0 | 3,202 |
from panda3d.core import *
from panda3d.direct import *
import ToonHood
from toontown.safezone import GSSafeZoneLoader
from toontown.toonbase.ToontownGlobals import *
from toontown.racing import DistributedVehicle
import SkyUtil
from otp.ai.MagicWordGlobal import *
class GSHood(ToonHood.ToonHood):
def __init__(se... | silly-wacky-3-town-toon/SOURCE-COD | toontown/hood/GSHood.py | Python | apache-2.0 | 3,512 |
# The content of this file was generated using the Python profile of libCellML 0.2.0.
from enum import Enum
from math import *
__version__ = "0.1.0"
LIBCELLML_VERSION = "0.2.0"
STATE_COUNT = 1
VARIABLE_COUNT = 1
class VariableType(Enum):
CONSTANT = 1
COMPUTED_CONSTANT = 2
ALGEBRAIC = 3
VOI_INFO = {"... | MichaelClerx/libcellml | tests/resources/generator/ode_computed_var_on_rhs_one_component/model.py | Python | apache-2.0 | 1,019 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | bclau/nova | nova/tests/virt/xenapi/test_vm_utils.py | Python | apache-2.0 | 49,156 |
#!/usr/bin/python
from fvregress import *
import string # really? you have to do this?
if len(sys.argv) > 1 :
wantPause = True
timeout=9999999
valgrindArgs=[]
else:
wantPause = False
timeout=5
valgrindArgs=None
# start up a flowvisor with 1 switch (default) and two guests
# out of the flowvisor-conf.d-mobili... | routeflow/AutomaticConfigurationRouteFlow | FLOWVISOR/regress/PORT_ME_TESTS/tests-mobility.py | Python | apache-2.0 | 2,960 |
# 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... | elingg/tensorflow | tensorflow/contrib/linalg/python/kernel_tests/linear_operator_util_test.py | Python | apache-2.0 | 3,351 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from solution import Codec
from solution import TreeNode
def createNode(s):
s = s.strip()
if s == '#':
return None
else:
return TreeNode(int(s))
def createTree(data):
q = []
data = data.split(",")
root = createNode(data[0]);
q.... | zhlinh/leetcode | 0297.Serialize and Deserialize Binary Tree/test.py | Python | apache-2.0 | 1,221 |
import subprocess
import numpy as np
import sys
import os
from threading import Thread
import glob
import io
#Total files in Document: 694152
#Current files allocated onto CS Machines: 416844
#True number of articles with coordinates: 330243
MAX_LINES = 1000 #Default subset of data you wa... | grantdelozier/TopoCluster | experimental/parser.py | Python | apache-2.0 | 14,596 |
#!/usr/bin/env python
#
# Copyright 2017 the original author or 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 require... | opencord/voltha | netconf/nc_rpc/base/copy_config.py | Python | apache-2.0 | 1,352 |
# coding=utf-8
# Copyright 2022 The Edward2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | google/edward2 | experimental/mimo/cifar.py | Python | apache-2.0 | 17,641 |
# -*- coding: utf-8 -*-
# Scrapy settings for qshop project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/t... | bryanyang0528/qshop_scrapy | qshop/settings.py | Python | apache-2.0 | 3,132 |
class Solution:
def climbStairs(self, n):
ans = [1, 1]
for i in range(2, n+1):
ans.append(ans[i-1]+ans[i-2])
return ans[n]
print(Solution().climbStairs(2))
print(Solution().climbStairs(3))
| zuun77/givemegoogletshirts | leetcode/python/70_climbing-stairs.py | Python | apache-2.0 | 229 |
from __future__ import unicode_literals
from .models import rds_backends
from ..core.models import base_decorator, deprecated_base_decorator
rds_backend = rds_backends["us-east-1"]
mock_rds = base_decorator(rds_backends)
mock_rds_deprecated = deprecated_base_decorator(rds_backends)
| william-richard/moto | moto/rds/__init__.py | Python | apache-2.0 | 284 |
# 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 use ... | RyanSkraba/beam | sdks/python/apache_beam/io/mongodbio_test.py | Python | apache-2.0 | 14,155 |
"""Support for monitoring the rtorrent BitTorrent client API."""
import logging
import xmlrpc.client
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_MONITORED_VARIABLES,
CONF_NAME,
CONF_URL,
DATA_RATE_KILOBYTES_PER_SECOND,
... | postlund/home-assistant | homeassistant/components/rtorrent/sensor.py | Python | apache-2.0 | 4,274 |
# 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... | DavidNorman/tensorflow | tensorflow/python/framework/tensor_shape.py | Python | apache-2.0 | 39,995 |