code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
from dataclasses import dataclass
from pants.backend.awslambda.python.target_types import (
PythonAwsLambdaHandlerField,
PythonAwsLambdaRuntime,
ResolvedPythonA... | patricklaw/pants | src/python/pants/backend/awslambda/python/rules.py | Python | apache-2.0 | 5,713 |
# Задача 4. Вариант 11.
""" Напишите программу, которая выводит имя, под которым скрывается Йоханнес Бруфельдт.
Дополнительно необходимо вывести область интересов указанной личности, место рождения, годы рождения и
смерти (если человек умер), вычислить возраст на данный момент (или момент смерти).
Для хранения всех ... | Mariaanisimova/pythonintask | INBa/2015/Kurchatov_N_V/z4_11.py | Python | apache-2.0 | 1,352 |
movies=["adv","qwe","zxc"]
print(movies[1])
print(movies[0])
print(movies[2])
print(movies)
print(len(movies))
movies.append("ppp")
print(movies)
movies.pop()
print(movies)
movies.extend(["www","cccc"])
print(movies) | wxmylife/Python-Study-Tour | HeadPython/chapter1/Demo/Demo1.py | Python | apache-2.0 | 221 |
# Copyright (c) 2015 Mirantis 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/api/views/quota_class_sets.py | Python | apache-2.0 | 1,801 |
#!/usr/bin/python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | adviti/melange | app/soc/mapreduce/convert_profile.py | Python | apache-2.0 | 2,054 |
import logging
from airflow.hooks import PrestoHook, MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class PrestoToMySqlTransfer(BaseOperator):
"""
Moves data from Presto to MySQL, note that for now the data is loaded
into memory before being pushed to MySQL, so... | Chedi/airflow | airflow/operators/presto_to_mysql.py | Python | apache-2.0 | 2,281 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
import tldextract
import re
import requests
# curl -v "http://statmt.org:8030/query_domain?domain=caletas.cr&full"
def get_tld(uri):
try:
netloc = uri.split(
'//', 1)[1].split('/', 1)[0].split(':', 1)[0].split('@')[-1]
... | ModernMT/DataCollection | baseline/locate_candidates.py | Python | apache-2.0 | 3,214 |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# Opserver
#
# Operational State Server for VNC
#
from gevent import monkey
monkey.patch_all()
import sys
import json
import socket
import time
import copy
import traceback
import signal
import logging
logging.getLogger('kafka').addHandler(logging... | codilime/contrail-controller | src/opserver/alarmgen.py | Python | apache-2.0 | 94,566 |
from typing import Any, Type
from tornado.web import RequestHandler
from malcolm.core import Info
class HandlerInfo(Info):
"""Tornado RequestHandlers that should make up the webserver application
Args:
regex: Path for this handler to get requests from. E.g. r"/ws"
request_class: Request han... | dls-controls/pymalcolm | malcolm/modules/web/infos.py | Python | apache-2.0 | 643 |
# -*- coding: utf-8 -*-
import time
from hil import Component
class Sound(Component):
def run(self, id, participation, role):
print(chr(7))
return 'Sound'
| fvioz/hil-sample | apps/sound/main.py | Python | apache-2.0 | 167 |
from orderedset import OrderedSet
from structurizr.model.component import Component
from structurizr.model.container import Container
from structurizr.model.enterprise import Enterprise
from structurizr.model.interaction_style import InteractionStyle
from structurizr.model.location import Location
from structurizr.mode... | sixty-north/structurizr-python | structurizr/model/model.py | Python | apache-2.0 | 8,215 |
class Solution(object):
def checkValidString(self, s):
"""
:type s: str
:rtype: bool
"""
N = len(s)
isValid = [[False] * (N+1) for _ in xrange(N+1)]
for i in xrange(N+1):
isValid[i][i] = True
if i < N:
isValid[i][i+1] = (s[i] == '*') # len 1 str is valid only when it's '*'
for l in xrange(2,... | xiaonanln/myleetcode-python | src/678. Valid Parenthesis String.py | Python | apache-2.0 | 1,229 |
# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""A module with configuration of the ProgramAuditOwner role's permissions."""
... | prasannav7/ggrc-core | src/ggrc_basic_permissions/roles/ProgramAuditOwner.py | Python | apache-2.0 | 1,926 |
#!/usr/bin/env python2
# Copyright (c) 2016 Martin F. Falatic
#
# 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... | MartyMacGyver/EnvironmentalSensorManager | backend/environmental_data_logger.py | Python | apache-2.0 | 6,369 |
import unittest
from graphene.storage.base.node_store import *
class TestNodeStoreMethods(unittest.TestCase):
def setUp(self):
GrapheneStore.TESTING = True
def tearDown(self):
"""
Clean the database so that the tests are independent of one another
"""
graphene_store =... | PHB-CS123/graphene | tests/storage/base/test_node_store.py | Python | apache-2.0 | 8,220 |
# -*- coding: utf-8 -*-
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import unittest
from iptest import run_test
unicode = str
unichr = chr
class UnicodeT... | IronLanguages/ironpython3 | Tests/test_unicode.py | Python | apache-2.0 | 3,711 |
from minicps.devices import Tank
from minicps.devices import PLC
from scipy.integrate import odeint
from utils import *
import numpy as np
import sys
import time
import math
import logging
import signal
import sys
Q101 = ('Q101', 1)
Q102 = ('Q102', 1)
LIT101 = ('LIT101', 1)
LIT102 = ('LIT102', 1)
LIT103 = ('LIT103', 1... | afmurillo/ICS-SDN | francisco-topo/physical_process.py | Python | apache-2.0 | 2,582 |
#!/usr/bin/env python
# Copyright (c) 2014 VMware, 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
#
... | openstack/congress | congress/datasources/neutronv2_driver.py | Python | apache-2.0 | 32,756 |
# -*- 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-language | google/cloud/language_v1/types/language_service.py | Python | apache-2.0 | 29,767 |
# 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 | non_semantic_speech_benchmark/export_model/model_conversion_beam_main.py | Python | apache-2.0 | 3,053 |
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | google/tangent | tangent/desugar.py | Python | apache-2.0 | 2,988 |
# Copyright 2016-2017 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .common import BaseTest
from c7n.resources.aws import shape_validate
class ElasticSearch(BaseTest):
def test_get_resources(self):
factory = self.replay_flight_data('test_el... | capitalone/cloud-custodian | tests/test_elasticsearch.py | Python | apache-2.0 | 10,624 |
'''
@author:fangxiao
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.operations.account_operations as acc_ops
import zstackwoodpecker.operations.iam2_operations as iam2_ops
import zstackwoodpecker.operations.resource_operations as res_ops
import time
import os
import apibinding.api_actions a... | zstackio/zstack-woodpecker | integrationtest/vm/simulator/iam2/test_share_resources_to_project.py | Python | apache-2.0 | 7,458 |
# -*- coding: utf-8 -*-
from model.contact import PersonalData
def test_delete_all_contacts(app, db, check_ui):
if app.contact.count() == 0:
app.contact.init_new_contact()
app.contact.fill_personal_data(PersonalData(firstname="test"))
app.contact.submit_contact()
app.contact.init_n... | Droriel/python_training | test/test_del_contacts_all.py | Python | apache-2.0 | 709 |
# Specify a model and the file path where it is to be saved. If no path is specified, the model will be saved to the
# current working directory
model_path = h2o.save_model(
model = model,
#path = "/tmp/mymodel",
force = True)
print model_path
# /tmp/mymodel/DeepLearning_model_python_144183809... | pchmieli/h2o-3 | h2o-docs/src/booklets/v2_2015/source/DeepLearning_Vignette_code_examples/deeplearning_savemodel.py | Python | apache-2.0 | 325 |
# Copyright (c) 2018 Fujitsu Limited
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | noironetworks/neutron | neutron/tests/unit/agent/l3/extensions/test_snat_log.py | Python | apache-2.0 | 2,160 |
import sys
sys.path.insert(1, "../../")
import h2o, tests
def vec_as_list(ip,port):
iris = h2o.import_file(path=h2o.locate("smalldata/iris/iris_wheader.csv"))
res = h2o.as_list(iris[0], use_pandas=False)
assert abs(float(res[4][0]) - 4.6) < 1e-10 and abs(float(res[6][0]) - 5.4) < 1e-10 and \
... | bospetersen/h2o-3 | h2o-py/tests/testdir_misc/pyunit_vec_as_list.py | Python | apache-2.0 | 910 |
"""
CGAL DCEL implemanation
By Georgios Koloventzos
DCEL First Implemantation
Download-URL: https://netfiles.uiuc.edu/ayg/www/stuff/dcel-0.1.0.tar.gz
By Angel Yanguas-Gil
"""
from CGAL import *
from math import *
from cgalvisual import *
def collinear(i, j, k):
return orientation(i, j, k) == CGAL.Kernel.Sign.EQUAL
... | sfagmenos/GuardsInArtGallery | dcel.py | Python | apache-2.0 | 7,306 |
from common import TestID, log_surl_call_result
from eu.emi.security.authn.x509.impl import PEMCredential
from exceptions import Exception
from jarray import array
from java.io import FileInputStream
from javax.net.ssl import X509ExtendedKeyManager
from net.grinder.plugin.http import HTTPRequest
from net.grinder.script... | italiangrid/grinder-load-testsuite | storm/base/mkdir.py | Python | apache-2.0 | 1,065 |
import GameLibrary.Action as Action
import GameLibrary.Card as Card
import GameLibrary.Client as Client
import GameLibrary.Constant as Constant
import GameLibrary.Creature as Creature
import GameLibrary.Game as Game
import GameLibrary.Player as Player
import GameLibrary.Spell as Spell
print(dir(Action))
print(dir(Acti... | maspe36/WhispererTCG | cards/test.py | Python | apache-2.0 | 651 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2018, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
"""
Interfaces
####################
This subpackage contains support for (small) third-party packages and
external file types.
"""
from .cclib import universe_from_cclib
from .xyz im... | tjduigna/exatomic | exatomic/interfaces/__init__.py | Python | apache-2.0 | 378 |
from model.contact import Contact
testdata = [
Contact(firstname="Senin", lastname="Pavel", email="psenin@mail.ru", bday="24",
bmonth="December", byear="1981"),
Contact(firstname="Senin2", lastname="Pavel2", email="psenin@mail.ru2", bday="24",
bmonth="December", byear... | senin24/python_trainig | data/contacts.py | Python | apache-2.0 | 330 |
from __future__ import unicode_literals
import pytz
from datetime import datetime
from django.utils import timezone
from django.core.exceptions import PermissionDenied, ValidationError
from django.views.generic import ListView, DeleteView, View, TemplateView
from django.shortcuts import redirect
from django.views.def... | pattisdr/osf.io | admin/nodes/views.py | Python | apache-2.0 | 19,293 |
#
# 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 or agreed to in ... | sassoftware/mirrorball | updatebot/__init__.py | Python | apache-2.0 | 833 |
from tools.SVGGenerator import SVGGenerator
__author__ = 'Robin Quetin'
class GraphicsGenerator(object):
def __init__(self, output_format='svg'):
output_format = output_format.lower()
if output_format == 'svg':
self.ded_generator = SVGGenerator()
else:
raise Runtime... | RobinQuetin/CAIRIS-web | cairis/cairis/tools/GraphicsGenerator.py | Python | apache-2.0 | 658 |
#!/usr/bin/env python3
"""Roll up the geo6 json to produce a tree suitable for sub9 query"""
__author__ = "H. Martin"
__version__ = "0.1.0"
import json
import math
from random import randint
data = {}
transformed = {}
with open('geohash_counter_6.json', encoding='utf-8') as data_file:
data = json.loads(data_... | hbmartin/sub9-client | etl/produce_map.py | Python | apache-2.0 | 888 |
# Copyright 2021 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_console/py/log_view_test.py | Python | apache-2.0 | 22,584 |
# Copyright 2019 The ROBEL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | google-research/robel | robel/components/robot/dynamixel_client.py | Python | apache-2.0 | 17,950 |
#!/usr/bin/python
#
# Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
#
# 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... | nouiz/fredericbastien-ipaddr-py-speed-up | tags/2.1.2/ipaddr_test.py | Python | apache-2.0 | 45,855 |
from pkg_resources import require
require("cothread==2.14")
from cothread.catools import *
import cothread
from Generic_BPMDevice import *
from subprocess import Popen, PIPE
import numpy as np
class Electron_BPMDevice(Generic_BPMDevice):
"""Libera Electron BPM Device class that uses Epics to communicate with PVs.
... | dharryman/BPM_Test_Framework | BPMDevice/Electron_BPMDevice.py | Python | apache-2.0 | 6,025 |
# Copyright 2014 NEC Corporation.
# 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... | bigswitch/tempest | tempest/tests/lib/common/utils/test_misc.py | Python | apache-2.0 | 2,733 |
# Copyright 2014 Red Hat, 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... | openstack/ironic-lib | ironic_lib/disk_partitioner.py | Python | apache-2.0 | 5,705 |
#!/usr/bin/python
import os
import sys
import pwd
import uuid
import struct
import socket
import logging
import base64
from M2Crypto import EVP, EC, util
logger = logging.getLogger("sock2proc")
class ProcInfo(object):
# Either sock (local tcp) or pid/euid (unix stream) must be present
def __init__(sel... | cloudxaas/cloudauth | lib/sock2proc.py | Python | apache-2.0 | 5,686 |
import socket
from flaky import flaky
import mock
from event_consumer import message_handler
from event_consumer import handlers as ec
from .base import BaseConsumerIntegrationTest
class ConsumeMessageHandlerTest(BaseConsumerIntegrationTest):
@flaky(max_runs=5, min_passes=5)
def test_consume_basic(self):
... | depop/celery-message-consumer | tests/test_consume_handler.py | Python | apache-2.0 | 6,210 |
"""Voluptuous schemas for the KNX integration."""
from __future__ import annotations
from abc import ABC
from collections import OrderedDict
from typing import Any, ClassVar, Final
import voluptuous as vol
from xknx import XKNX
from xknx.devices.climate import SetpointShiftMode
from xknx.dpt import DPTBase, DPTNumeri... | aronsky/home-assistant | homeassistant/components/knx/schema.py | Python | apache-2.0 | 33,511 |
#!/usr/bin/env python
#
# Copyright 2015 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 o... | nlpraveennl/cloud-bigtable-examples | python/thrift/flask_thrift.py | Python | apache-2.0 | 3,774 |
# ~*~ coding: utf-8 ~*~
__author__ = 'Kamo Petrosyan'
"""
Django settings for virtenviro project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Quick-start dev... | Haikson/virtenviro | virtenviro/required_settings.py | Python | apache-2.0 | 2,252 |
raise AssertionError(
'should not be executed as name starts with an underscore'
)
| DramaFever/sst | src/sst/selftests/_ignored.py | Python | apache-2.0 | 87 |
# -*- 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/v9/errors/types/field_error.py | Python | apache-2.0 | 1,275 |
# -*- 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-dialogflow | samples/generated_samples/dialogflow_generated_dialogflow_v2_conversations_get_conversation_async.py | Python | apache-2.0 | 1,511 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
from setuptools import find_packages, setup # pytype: disable=import-error
# Package meta-data.
NAME = 'importlab'
DESCRIPTION = 'A library to calculate python dependency graphs.'
URL = 'https://github.com/google/importlab'
EMAIL = 'pytype-dev@google... | google/importlab | setup.py | Python | apache-2.0 | 1,658 |
# 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/LICENSE-2.0
#
# Unless required by app... | BeenzSyed/tempest | tempest/scenario/test_swift_basic_ops.py | Python | apache-2.0 | 4,130 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 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
#
# ... | Brocade-OpenSource/OpenStack-DNRM-Nova | nova/tests/fake_policy.py | Python | apache-2.0 | 13,474 |
from core import dates
from core.peers import AllowedPeers
from db.db_manager import db_sync_manager
from delegate.geni.v3 import exceptions
from core.config import ConfParser
from os.path import abspath, dirname, join
import ast
import core
import xmlrpclib
import sys
logger = core.log.getLogger("rmadaptor")
def f... | ict-felix/stack | modules/resource/orchestrator/src/delegate/geni/v3/rm_adaptor.py | Python | apache-2.0 | 18,116 |
# -*- coding: utf-8 -*-
#
# tests/entidades/test_pis.py
#
# Copyright 2019 Base4 Sistemas Ltda ME
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | base4sistemas/satcfe | tests/entidades/test_pis.py | Python | apache-2.0 | 7,584 |
"""Helps build config packages for installer-specific templates.
Takes in a bunch of configuration files, as well as functions to calculate the values/strings which
need to be put into the configuration.
Operates strictly:
- All paramaters are strings. All things calculated / derived are strings.
- Every given pa... | BenWhitehead/dcos | gen/__init__.py | Python | apache-2.0 | 26,189 |
# 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... | mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/tests/python/relay/test_op_level2.py | Python | apache-2.0 | 21,337 |
class Cell:
value = False
neighbourListe = [(0,0), (0,1), (0,2), (1,0), (1,2), (2,0), (2,1), (2,2)] # fuer (1,1)
def __init__(self, coordinate):
self.coordinate = coordinate
neighbourListe = [(0,0), (0,1), (0,2), (1,0), (1,2), (2,0), (2,1), (2,2)] # fuer (1,1)
def exists(s... | hemmerling/codingdojo | src/game_of_life/python_coderetreat_socramob/cr_socramob05/cell.py | Python | apache-2.0 | 607 |
"""Trophies-related data model.
"""
from google.appengine.ext import ndb
from heroes.models import Base, BaseExpando
class Trophy(BaseExpando):
"""Trophy, like Worlds Best Football Team. That trophie can change hands at any point
depending on how the Football administration is set up.
"""
"""
B... | bentilly/heroes | heroes/trophies/models.py | Python | apache-2.0 | 622 |
from django.utils import html
import CommonMark
from HTMLParser import HTMLParser
def markdown_unescape(markdown):
#pus proper markdown <code> tags instead of >, allowing
#markdown to be applied, which translates and returns markdown
#text
temp_markdown=markdown
#parse to decode markdown
parse_markdown=HTMLPa... | DaynaLacoursiere/cmput404-project | squirespace/blog/functions.py | Python | apache-2.0 | 1,556 |
# 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 agreed to in writing, ... | google/gazoo-device | gazoo_device/capabilities/usb_hub_default.py | Python | apache-2.0 | 8,992 |
from model.model_contact import Contact
from model.model_group import Group
import random
from fixture.orm import *
def test_delete_contact_to_group(app2, db, orm):
#проверка на пустой список групп
if len(orm.get_group_list()) == 0:
app2.group.create(Group(name="Created in_test_delete_contact_to_group... | anjel-ershova/python_training | test/test_delete_contact_from_group.py | Python | apache-2.0 | 2,890 |
from .to_binary import to_binary
from .add_two_binary import add_two_binary
from .to_decimal import to_decimal
from .substract_binary import substract_binary
| vtemian/university_projects | arhitecure/hmw2/utils/__init__.py | Python | apache-2.0 | 158 |
"""VcfNormalize module.
This module is used to normalize a file in the VCF format
(see https://samtools.github.io/hts-specs/VCFv4.2.pdf).
Normalizing a file is basically used to make different VCFs
comparable, and it is highly recommended when you are
benchmarcking your call set using a reference call set.
Normalizati... | igsr/igsr_analysis | VCF/VcfNormalize.py | Python | apache-2.0 | 11,345 |
# Copyright 2016 Matthias Gazzari
#
# 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... | qtux/instmatcher | instmatcher/version.py | Python | apache-2.0 | 631 |
"""
Copyright (c) 2017 SONATA-NFV and Paderborn University
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 ap... | stevenvanrossem/son-emu | src/emuvim/api/openstack/resources/instance_flavor.py | Python | apache-2.0 | 1,486 |
from TestStack.White.UIItems.TreeItems import Tree
from WhiteLibrary.keywords.librarycomponent import LibraryComponent
from WhiteLibrary.keywords.robotlibcore import keyword
class TreeKeywords(LibraryComponent):
@keyword
def select_tree_node(self, locator, *node_path):
"""Selects a tree node.
... | Omenia/robotframework-whitelibrary | src/WhiteLibrary/keywords/items/tree.py | Python | apache-2.0 | 2,478 |
# -*- coding: utf-8 -*-
"""
Authors: Tim Hessels
UNESCO-IHE 2017
Contact: t.hessels@unesco-ihe.org
Repository: https://github.com/wateraccounting/wa
Module: Generator/Sheet4
"""
import os
import glob
def Create(Dir_Basin, Basin, Simulation, Dir_Basin_CSV, Unit_front):
"""
This functions create the mon... | wateraccounting/wa | Generator/Sheet4/PDF.py | Python | apache-2.0 | 3,012 |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | googleapis/google-resumable-media-python | google/resumable_media/requests/download.py | Python | apache-2.0 | 24,705 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import image_cropping.fields
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_20151012_1611'),
]
operations = [
migrations.AlterField(
model_na... | rogerhil/flaviabernardes | flaviabernardes/flaviabernardes/blog/migrations/0006_auto_20151027_1121.py | Python | apache-2.0 | 942 |
import multiprocessing, sys, random
import model
pool = None
def get_pool():
global pool
if pool is None:
pool = multiprocessing.Pool()
return pool
def search_d1_process_opponent(mxm, gm, maxpi, minpi, init):
maxp, minp = gm.plebeians[maxpi], gm.plebeians[minpi]
acts = gm.NumActions()
... | cmr/automatafl | old_python_prototype/search.py | Python | apache-2.0 | 2,634 |
import os, logging
from xpybuild.propertysupport import *
from xpybuild.buildcommon import *
from xpybuild.pathsets import *
defineOutputDirProperty('OUTPUT_DIR', None)
from xpybuild.targets.copy import Copy
for i in range(0, 3500):
Copy('${OUTPUT_DIR}/output%s/'%i, FindPaths('${OUTPUT_DIR}/../input-files/', inclu... | xpybuild/xpybuild | tests/performance/Dependency_FindPaths_NonTarget_Performance/Input/test.xpybuild.py | Python | apache-2.0 | 337 |
#!/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... | jdilallo/jdilallo-test | examples/dfa/v1_20/get_available_permissions.py | Python | apache-2.0 | 1,872 |
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | tensorflow/tfx | tfx/components/transform/stats_options_util.py | Python | apache-2.0 | 843 |
import unittest
from data_cube_utilities import dc_fractional_coverage_classifier
class TestFractionalCover(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_frac_coverage_classify(self):
pass
| ceos-seo/data_cube_utilities | test/test_dc_fractional_coverage_classifier.py | Python | apache-2.0 | 261 |
# Copyright 2015 Observable 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 or agreed to ... | obsrvbl/ona | src/scripts/tests/test_service.py | Python | apache-2.0 | 3,205 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under th... | kaiweifan/horizon | openstack_dashboard/dashboards/project/access_and_security/floating_ips/views.py | Python | apache-2.0 | 3,863 |
from neptune.base_classes import Error404
class NRouter(object):
"""
The URL route handling class
Rule is defined as:
[
{ 'route': '/', 'class': 'cname' },
{ 'route': '/b/:id', 'class': 'cname' },
{ 'route': '/home', 'class': 'cname' },
]
"""
# ... | NeptuneFramework/neptune | neptune/router.py | Python | apache-2.0 | 760 |
# Copyright (c) 2015 Huawei Technologies Co., Ltd.
# See LICENSE file for details.
from flocker.node.agents.blockdevice import (
VolumeException, AlreadyAttachedVolume,
UnknownVolume, UnattachedVolume,
IBlockDeviceAPI, _blockdevicevolume_from_dataset_id,
BlockDeviceVolume
)
from uuid import uuid4, UUI... | huaweistorage/huawei-oceanstor-flocker-plugin | huawei_oceanstor_flocker_plugin/huawei_oceanstor_blockdevice.py | Python | apache-2.0 | 13,417 |
import unittest, random, sys, time, getpass
sys.path.extend(['.','..','py'])
# FIX! add cases with shuffled data!
import h2o, h2o_cmd, h2o_hosts, h2o_gbm
import h2o_browse as h2b, h2o_import as h2i, h2o_exec as h2e, h2o_jobs as h2j
DO_PLOT_IF_KEVIN = False
class Basic(unittest.TestCase):
def tearDown(self):
... | janezhango/BigDataMachineLearning | py/testdir_multi_jvm/test_GBM_poker_1m.py | Python | apache-2.0 | 5,772 |
# data.world-py
# Copyright 2017 data.world, 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 agr... | datadotworld/data.world-py | tests/datadotworld/test_config.py | Python | apache-2.0 | 8,193 |
# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU.
#
# 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... | KristianJensen/cameo | cameo/network_analysis/util.py | Python | apache-2.0 | 1,935 |
"""
File copy from https://github.com/moddevices/lilvlib
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------------------------------------
# Imports
import json
import lilv
import os
from math import fmod
# -----------------------------... | PedalPi/PluginsManager | pluginsmanager/model/lv2/lilvlib.py | Python | apache-2.0 | 57,410 |
# -*- coding: utf8 -*-
__author__ = 'meng'
import os
import sys
import shutil
import re
from bs4 import BeautifulSoup
htmlfilename = sys.argv[1]
outfilename = re.sub('\.html','-new.html',htmlfilename)
filedir = os.path.split(os.path.abspath(htmlfilename))[0]
with open(htmlfilename) as infile:
lines = infile.re... | menglingjie/transharoopadhtml | transhtml.py | Python | apache-2.0 | 1,033 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2018 João Pedro Rodrigues
#
# 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
#
# Unl... | JoaoRodrigues/pdb-tools | pdbtools/pdb_delchain.py | Python | apache-2.0 | 4,832 |
"""
Write a script that will create a static webpage served out of Cloud Files.
The script must create a new container, cdn enable it, enable it to serve an index file, create an index file object,
upload the object to the container, and create a CNAME record pointing to the CDN URL of the container.
"""
__author__ = ... | Gifflen/API-Challenge | challenge08.py | Python | apache-2.0 | 4,868 |
from abc import ABCMeta, abstractmethod
class Generic_RFSigGen():
"""Generic RF signal generator class used for hardware abstraction.
All of the methods listed here are abstract and will be overridden by child classes,
this will abstract hardware as the methods here are called, but the functionality ... | dharryman/BPM_Test_Framework | RFSignalGenerators/Generic_RFSigGen.py | Python | apache-2.0 | 5,154 |
# 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... | alisidd/tensorflow | tensorflow/python/kernel_tests/resource_variable_ops_test.py | Python | apache-2.0 | 10,612 |
# *- coding: utf-8 -*-
# pylint: disable=wildcard-import, missing-docstring, no-self-use, bad-continuation
# pylint: disable=unused-import
""" Test ``rudiments.morph``.
"""
# Copyright © 2015 - 2019 Jürgen Hermann <jh@web.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... | jhermann/rudiments | src/tests/test_morph.py | Python | apache-2.0 | 975 |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | phenoxim/nova | nova/tests/unit/virt/test_block_device.py | Python | apache-2.0 | 62,888 |
import json
import httplib2
from samples.utils import get_service, poll_job
from oauth2client.client import GoogleCredentials
# [START make_post]
def make_post(http, schema, data, projectId, datasetId, tableId):
url = ('https://www.googleapis.com/upload/bigquery/v2/projects/' +
projectId + '/jobs')
... | googlearchive/bigquery-samples-python | python/samples/load_data_by_post.py | Python | apache-2.0 | 2,723 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 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/parsers/mcafeeav.py | Python | apache-2.0 | 3,840 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from arrow.arrow import Arrow
from datetime import timedelta
from six import PY2, PY3, StringIO, string_types, text_type, integer_types
from six.moves import filter, map, range
from uuid import uuid4
import arrow
im... | zifeiwoo/icalics | ics/utils.py | Python | apache-2.0 | 4,846 |
# Lint as: python3
# Copyright 2019 Verily Life Sciences 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
#
# Unles... | DataBiosphere/dsub | dsub/providers/google_cls_v2.py | Python | apache-2.0 | 3,428 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_global_morans_i.ui'
#
# Created: Mon Jul 07 17:51:16 2014
# by: PyQt4 UI code generator 4.10.2
#
# WARNING! All changes made in this file will be lost!
| Gaia3D/GeepsSpatialStatistic | ui_global_morans_i.py | Python | apache-2.0 | 240 |
# Copyright 2016 Red Hat, Inc
# Copyright 2017 Rackspace Australia
#
# 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
#
# Unles... | klmitch/nova | nova/privsep/fs.py | Python | apache-2.0 | 12,310 |
import itertools
import logging
import re
import time
import urllib
from collections import defaultdict
from datetime import datetime, timedelta, timezone
from decimal import Decimal
from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, Type, Union
import pytz
from django.conf import settings
f... | showell/zulip | analytics/views.py | Python | apache-2.0 | 57,805 |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Ericsson 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 ... | EricssonResearch/calvin-base | calvin/runtime/north/plugins/port/queue/fanout_mapped_fifo.py | Python | apache-2.0 | 3,069 |
# Copyright (c) 2013 Mortar Data
#
# 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, ... | robbles/mortar-luigi | mortar/luigi/dynamodb.py | Python | apache-2.0 | 13,619 |
# -*- 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_featurestore_service_batch_create_features_async.py | Python | apache-2.0 | 1,850 |