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 |
|---|---|---|---|---|---|
import os
from setuptools import setup
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.di... | severinson/pyrateless | setup.py | Python | apache-2.0 | 1,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/ns/nsdhcpip.py | Python | apache-2.0 | 2,447 |
#!/usr/bin/python
if __name__ == "__main__":
string1 = "Run from a1.py"
else:
string1 = "Run from a2.py"
print string1 | dominickhera/PosaRepo | cis3250labs/cis3250lab2/a1.py | Python | apache-2.0 | 122 |
#!/usr/bin/python
# This file is a part of the OpenSurgSim project.
# Copyright 2012-2015, SimQuest Solutions Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | simquest/opensurgsim | Tools/Converters/tetgen2ply.py | Python | apache-2.0 | 7,225 |
"""
Class for polling Ceilometer
This class provides means to requests for authentication tokens to be used with OpenStack's Ceilometer, Nova and RabbitMQ
"""
############# NOTICE ######################
# ProZaC is a fork of ZabbixCeilometer-Proxy (aka ZCP),
# which is Copyright of OneSource Consultoria... | hocchudong/ZabbixCeilometer-Proxy | ceilometer_handler.py | Python | apache-2.0 | 9,400 |
# coding=utf-8
# 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,... | naototty/vagrant-lxc-ironic | ironic/conductor/utils.py | Python | apache-2.0 | 6,340 |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... | sunqm/pyscf | pyscf/cc/uccsd_lambda.py | Python | apache-2.0 | 23,359 |
# 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.0
#
# Unless required by applicable law... | sajeeshcs/nested_quota | nova/objects/quotas.py | Python | apache-2.0 | 5,205 |
from typing import List
import torch
from torch import nn
from torch.nn import functional as F
from src.modules.normalize import Normalize
from src.resnet.bottleneck_block import create_bottleneck_stage, BottleneckBlock
from src.resnet.residual_block import ResidualBlock, create_residual_stage
class ResNet_4Stage_B... | googleinterns/out-of-distribution | src/resnet/resnet_4stage_backbone.py | Python | apache-2.0 | 3,819 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | celebdor/kuryr-libnetwork | kuryr_libnetwork/tests/unit/test_kuryr_existing_network.py | Python | apache-2.0 | 6,865 |
import os
import re
import sys
import subprocess
def sh(cmd, debug=False):
if debug:
sys.stderr.write("# " + " ".join(cmd) + "\n")
return subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
re_mtab = re.compile("^(.*) on ([^ ]*) type (.*) \((.*)\)$")
def mtab(typefilter=None):
""" Retu... | shykes/aufs.py | aufs.py | Python | apache-2.0 | 3,330 |
from flask.ext.babel import gettext
def AREAS():
return [
gettext("area1"),
gettext("area2"),
gettext("area3"),
gettext("area4"),
gettext("area5"),
gettext("area6"),
gettext("area7"),
gettext("area8"),
gettext("area9"),
gettext("area10"),
... | Dimona-Loves-Animals/fund-raising-page | app/data.py | Python | apache-2.0 | 1,616 |
# 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... | groschovskiy/lerigos_music | Server/API/lib/gcloud/datastore/_generated/entity_pb2.py | Python | apache-2.0 | 893 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, with_statement
from revolver.core import run
from revolver.tool import nodejs_nvm
def install(version, _update=True):
nodejs_nvm.ensure()
if not version.startswith("v"):
version = "v" + version
status = run("nvm use %s" ... | michaelcontento/revolver | revolver/tool/nodejs.py | Python | apache-2.0 | 543 |
"""mp_current
Revision ID: 460ef2ec2d21
Revises: 32d14f5f9773
Create Date: 2015-02-06 08:02:52.350474
"""
# revision identifiers, used by Alembic.
revision = '460ef2ec2d21'
down_revision = '32d14f5f9773'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### c... | Code4SA/pmg-cms-2 | migrations/versions/460ef2ec2d21_mp_current.py | Python | apache-2.0 | 817 |
import numpy as np
import os,sys
sys.path.append('/'.join(os.path.dirname(os.path.abspath(__file__)).split('/')[:-1]))
from GrobnerSolver.polys.multi_power import MultiPower
import unittest
class TestMultiCheb(unittest.TestCase):
def test_gen(self):
'''
Tests the generator
'''
... | drexmca/GrobnerSolver | Test/test_power.py | Python | apache-2.0 | 995 |
"""Handles reports over scheduler data."""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import time
import datetime
import itertools
import logging
import fnmatch
import numpy as np
import pandas as pd
import six... | captiosus/treadmill | treadmill/reports.py | Python | apache-2.0 | 10,706 |
#
# Copyright 2015 CityGrid Media, 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... | CityGrid/arsenal-client-lib | arsenalclientlib/operating_system.py | Python | apache-2.0 | 976 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('data', '0003_auto_20141117_2011'),
]
operations = [
migrations.AddField(
model_name='node',
name='la... | APTrust/EarthDiver | dpnode/dpn/data/migrations/0004_node_last_pull_date.py | Python | apache-2.0 | 506 |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... | HybridF5/jacket | jacket/compute/virt/volumeutils.py | Python | apache-2.0 | 1,230 |
# Copyright 2015 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | googleapis/python-bigtable | tests/unit/test_table.py | Python | apache-2.0 | 69,342 |
# Copyright 2021 The TensorFlow Probability 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... | tensorflow/probability | spinoffs/fun_mc/fun_mc/dynamic/backend_jax/backend.py | Python | apache-2.0 | 1,105 |
import json
import os
from os.path import join, dirname
from watson_developer_cloud import TradeoffAnalyticsV1
tradeoff_analytics = TradeoffAnalyticsV1(
username='YOUR SERVICE USERNAME',
password='YOUR SERVICE PASSWORD')
with open(os.path.join(os.path.dirname(__file__),
'../resources/pr... | ehdsouza/python-sdk | examples/tradeoff_analytics_v1.py | Python | apache-2.0 | 600 |
#!/usr/bin/env python3
import argparse
from collections import Counter
import logging
import eva_cttv_pipeline.clinvar_xml_utils as clinvar_xml_utils
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
parser = argparse.ArgumentParser()
parser.add_argument('--clinvar-xml', requi... | EBIvariation/eva-cttv-pipeline | data-exploration/clinvar-variant-types/clinvar-variant-types.py | Python | apache-2.0 | 12,268 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2010 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/LICE... | ntt-sic/nova | nova/tests/virt/libvirt/test_fakelibvirt.py | Python | apache-2.0 | 15,505 |
#
# 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
# ... | redhat-openstack/heat | heat/db/sqlalchemy/migrate_repo/versions/025_user_creds_drop_service.py | Python | apache-2.0 | 1,311 |
"""
SoloMapper_QX1.py
File used to control the Sony QX1 camera
"""
import pysony
import ConfigParser
import re
import subprocess
import urllib
import time
import threading
import os,sys
import signal
from SoloMapper_File import ExifWriter
from dronekit import connect, Vehicle
from FlagManager import FlagSystem
import l... | Escadrone/Solo-Mapper | SoloMapper_QX1.py | Python | apache-2.0 | 10,757 |
#!/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/classifier/scanner.py | Python | apache-2.0 | 24,473 |
# Copyright 2014
# The Cloudscaling Group, 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... | MayankGo/ec2-api | ec2api/tests/unit/test_api_init.py | Python | apache-2.0 | 4,595 |
# Copyright (c) 2014 Qumulo, 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, sof... | Qumulo/qumulo_splunk_app | bin/qumulo/commands/__init__.py | Python | apache-2.0 | 825 |
class MyCall:
def __call__(self):
print "Called callable method."
return
def func():
print "Called function func()."
cbList = []
cbList.append( MyCall() )
cbList.append( func )
for cb in cbList:
cb()
| egustafson/sandbox | Python/py-callable/callable.py | Python | apache-2.0 | 235 |
# stdlib
from collections import OrderedDict
from typing import Any
from typing import Callable
from typing import Dict
from typing import List
# third party
import pytest
# syft absolute
import syft as sy
def get_permission(
obj: Any, node: sy.VirtualMachine, client: sy.VirtualMachineClient
) -> None:
remo... | OpenMined/PySyft | packages/syft/tests/syft/core/pointer/primitive_type_pointer_test.py | Python | apache-2.0 | 19,254 |
# python3
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | google-research/data-driven-advection | datadrivenpdes/core/states.py | Python | apache-2.0 | 4,658 |
# #!/usr/bin/env python
# # -*- coding: utf-8 -*-
# import tensorflow as tf
# import numpy
# writer = tf.python_io.TFRecordWriter('test1111.tfrecord')
# for i in range(0, 2):
# a = 0.618 + i
# b = [2016 + i, 2017+i]
# #c = numpy.array([[0, 1, 2],[3, 4, 5]]) + i
# #c = c.astype(numpy.uint8)
# c = "你好... | paineliu/tflearn | tfrecord_test.py | Python | apache-2.0 | 4,884 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-05-27 15:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mapdata', '0004_space_level_category_name'),
]
operations = [
migrations.Al... | c3nav/c3nav | src/c3nav/mapdata/migrations/0005_auto_20170527_1556.py | Python | apache-2.0 | 679 |
import requests
def test_server_part():
res = requests.get("http://selenium2.ru/")
assert res.status_code == 200
assert "Selenium WebDriver" in res.text
| barancev/testautomation_training | testautomation_py/lesson1/module7/lesson1_module7_sample1.py | Python | apache-2.0 | 168 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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
#... | armando-migliaccio/tempest | tempest/api/compute/images/test_images_oneserver_negative.py | Python | apache-2.0 | 6,602 |
""" CISCO_CBP_TARGET_TC_MIB
This MIB module defines Textual Conventions for
representing targets which have class based policy
mappings. A target can be any logical interface
or entity to which a class based policy is able to be
associated.
"""
import re
import collections
from enum import Enum
from ydk.types... | 111pontes/ydk-py | cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_CBP_TARGET_TC_MIB.py | Python | apache-2.0 | 3,796 |
#! /usr/bin/env python
# KKD for Sage Bionetworks
import synapseclient, argparse
from synapseclient import Evaluation
def main():
parser = argparse.ArgumentParser(description='Creates XYZ evaluation via synapse.')
parser.add_argument('--name', dest='name', required=True, help='Name of workflow')
parser.add_argumen... | Sage-Bionetworks/synapse-seq | scripts/add_eval.py | Python | apache-2.0 | 874 |
__all__ = ['db_utils', 'RfamDB', 'parse_taxbrowser']
| Rfam/rfam-production | utils/__init__.py | Python | apache-2.0 | 53 |
class Solution:
def addDigits(self, num):
"""
:type num: int
:rtype: int
"""
while True:
num = sum([int(i) for i in str(num)])
if num < 10:
return num
| MingfeiPan/leetcode | math/258.py | Python | apache-2.0 | 257 |
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | FederatedAI/FATE | python/federatedml/framework/homo/blocks/aggregator.py | Python | apache-2.0 | 2,559 |
from django.contrib.auth.models import User
from django.conf import settings
from xml.dom.minidom import parseString
from django.contrib.auth.backends import ModelBackend
import httplib2
import json
class JiraBackend(ModelBackend):
"""
This is the Attlasian CROWD (JIRA) Authentication Backend for Django
H... | daniel-yavorovich/cpan2repo | webui/backends.py | Python | apache-2.0 | 4,309 |
# -*- 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-datacatalog | google/cloud/datacatalog_v1beta1/services/data_catalog/client.py | Python | apache-2.0 | 152,349 |
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = "3.10"
_lr_method = "LALR"
_lr_signature = "ADDRESS BOOL BYTES BYTESM COMMA FIXED FIXEDMN FUNCTION INT INTN LBRAKET LPAREN NUMBER RBRAKET RPAREN STRING UFIXED UFIXEDMN UINT UINTN\n T : UINTN\n T : UINT\n ... | montyly/manticore | manticore/ethereum/parsetab.py | Python | apache-2.0 | 4,413 |
# coding: utf-8
#
# Copyright 2021 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | kevinlee12/oppia | core/jobs/job_test_utils_test.py | Python | apache-2.0 | 7,492 |
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# Min version of python is 2.7
import sys
if ((sys.version_info.major != 2) or (sys.version_info.... | andrasigneczi/TravelOptimizer | DataCollector/mozilla/xulrunner-sdk/bin/install_app.py | Python | apache-2.0 | 8,115 |
"""
Usefull code pices for HG API, like list if important URLs and
navigation helpers.
"""
# pylint can't handle EasyDict properly
# pylint: disable=E1101
from easydict import EasyDict
from time import sleep
from collections import namedtuple
from contextlib import contextmanager
from retrying import retry
Participa... | enkidulan/hangout_api | hangout_api/utils.py | Python | apache-2.0 | 5,256 |
#!/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_selhetatm.py | Python | apache-2.0 | 3,504 |
"""Form definitions, allow easy validation of input and rendering of forms
"""
# future imports
from __future__ import absolute_import
# third-party imports
from wtforms import Form
from wtforms import DateField
from wtforms import FileField
from wtforms import StringField
from wtforms import TextAreaField
from wtform... | mjmcconnell/sra | src-server/app/forms/workshops.py | Python | apache-2.0 | 3,687 |
# coding=utf-8
# Copyright 2022 The Mesh TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | tensorflow/mesh | mesh_tensorflow/transformer/t2t_vocabulary.py | Python | apache-2.0 | 2,790 |
__author__ = 'Dima Potekhin'
import os
import re
from epicycle.derkonfigurator.WorkspaceEntity import WorkspaceEntity
from epicycle.derkonfigurator.utils import nget
from ProjectConfiguratorCs import ProjectConfiguratorCs
class Project(WorkspaceEntity):
CONFIG_FILE_NAME = "project_config.yaml"
_FULL_NAME_PAR... | open-epicycle/epicycle.derkonfigurator-py | projects/epicycle.derkonfigurator-py/epicycle/derkonfigurator/project/Project.py | Python | apache-2.0 | 3,502 |
# coding=utf-8
# Copyright 2020 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/motion_imitation | motion_imitation/learning/imitation_runners.py | Python | apache-2.0 | 7,855 |
from .test_helper import argv_kiwi_tests
import sys
import mock
from mock import patch
import azurectl
from pytest import raises
from azurectl.commands.compute_image import ComputeImageTask
class TestComputeImageTask:
def setup(self):
sys.argv = [
sys.argv[0], '--config', '../data/config',
... | SUSE/azurectl | test/unit/commands_compute_image_test.py | Python | apache-2.0 | 9,176 |
from functools import reduce
from Slices import Slice
from theReader import TheReader
class Brain:
def __init__(self, configFile):
self.reader = TheReader(configFile)
self.reader.readConfiguration()
self.slices = []
def searchMinOccurencesOfIngredient(self):
numResult = reduce... | ziliquas/PizzaHashCode | Logic.py | Python | apache-2.0 | 4,492 |
# -*- coding: utf-8 -*-
# Django settings for djangoreport project.
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
import os
PROJECT_PATH = PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Gabriel Fe... | gabrielferreira/djangoreport | djangoreport/settings.py | Python | apache-2.0 | 5,904 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | pypa/warehouse | warehouse/integrations/github/utils.py | Python | apache-2.0 | 9,548 |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | huntxu/neutron | neutron/plugins/ml2/ovo_rpc.py | Python | apache-2.0 | 6,603 |
########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... | anilveeramalli/cloudify-azure-plugin | azurecloudify/server.py | Python | apache-2.0 | 20,645 |
__author__ = 'Dzmitry'
import pytest
from fixture.application import Application
import json
import os.path
import ftputil
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), file)
with ope... | duskat/python_training_mantis | conftest.py | Python | apache-2.0 | 2,304 |
# -*- coding: utf-8 -*-
from setuptools import setup
packages = \
['qhbmlib']
package_data = \
{'': ['*']}
install_requires = \
['tensorflow-probability==0.15.0',
'tensorflow-quantum==0.6.1',
'tensorflow==2.7.0']
setup_kwargs = {
'name': 'qhbmlib',
'version': '0.3.0',
'description': 'Quantum Hamiltoni... | google/qhbm-library | setup.py | Python | apache-2.0 | 1,083 |
# Generated by Django 2.0.3 on 2018-06-06 21:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("profile", "0011_mediaresource_cover_style")]
operations = [
migrations.AlterOrderWithRespectTo(
name="listentry", order_with_respect_to="profile_item... | knowmetools/km-api | km_api/know_me/profile/migrations/0012_listentry_ordering.py | Python | apache-2.0 | 338 |
#!/usr/bin/env python3
#
# Copyright (c) 2019 Roberto Riggio
#
# 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... | rriggio/empower-runtime | empower/managers/envmanager/envhandler.py | Python | apache-2.0 | 1,405 |
# -*- 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/dynamic_search_ads_search_term_view_service/client.py | Python | apache-2.0 | 19,697 |
#!/usr/bin/env python3
# Copyright 2020 Department of Computational Biology for Infection Research - Helmholtz Centre for Infection Research
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, ei... | CAMI-challenge/AMBER | amber.py | Python | apache-2.0 | 15,947 |
# 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... | CiscoSystems/horizon | openstack_dashboard/static_settings.py | Python | apache-2.0 | 3,722 |
#!/usr/bin/python
#coding:utf-8
# Filename: seq.py
shoplist = ['apple', 'mango', 'carrot', 'banana']
name = 'swaroop'
# Indexing or 'Subscription' operation
print('Item 0 is', shoplist[0])
print('Item 1 is', shoplist[1])
print('Item 2 is', shoplist[2])
print('Item 3 is', shoplist[3])
print('Item -1 is', shoplis... | PythonT/Crawler | seq.py | Python | apache-2.0 | 781 |
#
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | lach76/scancode-toolkit | src/packagedcode/models.py | Python | apache-2.0 | 24,384 |
#!/usr/bin/python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | googleads/googleads-shopping-samples | python/shopping/content/datafeeds/insert.py | Python | apache-2.0 | 1,328 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-12-03 21:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nugget', '0001_initial'),
]
operations = [
migrations.AlterField(
... | mcculloughsco/CompSci326TermProject | django_application/TODO/nugget/migrations/0002_auto_20171203_1624.py | Python | apache-2.0 | 481 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Android Module Project Create Script
#
import os, sys, shutil
module_android_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
module_dir = os.path.dirname(module_android_dir)
sys.path.append(module_dir)
scripts_root_dir = os.path.dirname(mod... | appcelerator/titanium_mobile_tooling | scripts/module/android/android.py | Python | apache-2.0 | 2,633 |
import abc
import math
import numpy as np
import SimpleITK as sitk
from .base import (IConfusionMatrixMetric, ISimpleITKImageMetric, INumpyArrayMetric)
class AreaMetric(ISimpleITKImageMetric):
"""Represents an area metric."""
def __init__(self):
"""Initializes a new instance of the AreaMetric class... | istb-mia/miapy | miapy/evaluation/metric/segmentation.py | Python | apache-2.0 | 22,130 |
def helper_one():
print("HELLO MY FRIEND FROM HELPER ONE!!")
def testing(a):
print("HELPING TO PUSH ARGS: {0}".format(a))
| mrchristine/dbc-notebooks | tools/pyspark_sync/helper1.py | Python | apache-2.0 | 125 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | RyanSkraba/beam | sdks/python/apache_beam/io/external/xlang_parquetio_test.py | Python | apache-2.0 | 2,971 |
import os
from django.contrib.auth.models import User
from django.db import models
from django.utils.deconstruct import deconstructible
from ct.models import Course
@deconstructible
class UploadTo(object):
"""
Deconstructable class as function to serialize in migrations,
compatibility for python 2
... | cjlee112/socraticqs2 | mysite/analytics/models.py | Python | apache-2.0 | 1,362 |
#!/usr/bin/env python
#
# Copyright 2017 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 requir... | Aloomaio/googleads-python-lib | examples/ad_manager/v201805/report_service/run_report_and_create_match_table.py | Python | apache-2.0 | 3,150 |
def func1():
print "Hello world"
class MyClass(object):
def __init__(self, var_a, var_b, var_c):
self.var_a = var_a
self.var_b = var_b
self.var_c = var_c
def hello(self):
print "Hello world: %s %s %s" % (self.var_a, self.var_b, self.var_c)
def not_hello(self):
... | linkdebian/pynet_course | class9/exercise4/mytest/world.py | Python | apache-2.0 | 445 |
"""ThreatConnect TI Document"""
# standard library
from typing import TYPE_CHECKING
# first-party
from tcex.api.tc.v2.threat_intelligence.mappings.group.group import Group
if TYPE_CHECKING:
# first-party
from tcex.api.tc.v2.threat_intelligence.threat_intelligence import ThreatIntelligence
class Document(Gro... | ThreatConnect-Inc/tcex | tcex/api/tc/v2/threat_intelligence/mappings/group/group_types/document.py | Python | apache-2.0 | 4,495 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-16 06:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0008_auto_20170416_0549'),
]
operations = [... | raghuraju/Simple-Project-Management | src/users/migrations/0009_auto_20170416_0616.py | Python | apache-2.0 | 1,047 |
# Copyright (c) 2018 PaddlePaddle 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 app... | Canpio/Paddle | python/paddle/fluid/tests/unittests/transpiler_test.py | Python | apache-2.0 | 2,379 |
#coding=utf-8
'''
Created on 2016年1月11日
@author: xxw
'''
import logging
import time
from twisted.internet import protocol
from common import fprotocol,const,CmdMessage_pb2
import clientfactory
import clientparse
import loginservermanager
import loginserver
import json
import redishelper
CLIENT_STATE_INIT ... | xiexiangwei/xGame | logingate/client.py | Python | apache-2.0 | 3,357 |
# Copyright (c) 2014 Cisco Systems, 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 r... | rajalokan/nova | nova/api/openstack/compute/server_groups.py | Python | apache-2.0 | 7,939 |
# Copyright 2019, The TensorFlow Federated 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... | tensorflow/federated | tensorflow_federated/python/core/impl/executors/thread_delegating_executor_test.py | Python | apache-2.0 | 5,973 |
from django.core.mail import send_mail
from django.core.management.base import BaseCommand
from django.core.urlresolvers import reverse
from django.utils import timezone
from electees.models import ElecteeInterviewFollowup
from event_cal.models import InterviewShift
from mig_main.models import AcademicTerm
class Co... | tbpmig/mig-website | electees/management/commands/interview_followup_pester.py | Python | apache-2.0 | 1,846 |
from __future__ import print_function
import copy
import math
import sys
import time
from mavros_msgs.msg import CommandCode
from mavros_msgs.msg import State
from mavros_msgs.msg import Waypoint
from mavros_msgs.srv import CommandBool
from mavros_msgs.srv import CommandTOL
from mavros_msgs.srv import CommandTOLReque... | osrf/uctf | src/uctf/control.py | Python | apache-2.0 | 8,279 |
import random
import unittest
from pymongo import MongoClient
from service.UserService import UserService, DuplicateUserException
class test_user_service(unittest.TestCase):
def setUp(self):
self.dbClient = MongoClient()
self.db = self.dbClient.test_foodbeazt_database
self.db.user_collecti... | cackharot/fbeazt | src/test/test_user_service.py | Python | apache-2.0 | 2,088 |
class DeviceIsNotActive(Exception):
pass
| Hipo/django-sloop | django_sloop/exceptions.py | Python | apache-2.0 | 47 |
import pytest
from django.urls import reverse
from ..models import Membership
users = (
('owner', 'owner'),
('manager', 'manager'),
('author', 'author'),
('guest', 'guest'),
('api', 'api'),
('user', 'user'),
('site', 'site'),
('anonymous', None),
)
view_membership_permission_map = {
... | rdmorganiser/rdmo | rdmo/projects/tests/test_viewset_membership.py | Python | apache-2.0 | 3,543 |
# -*- coding: utf-8 -*-
# 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 applic... | sajeeshcs/nested_projects_keystone | keystone/tests/test_backend_sql.py | Python | apache-2.0 | 29,737 |
import json
from flask import Flask
from mock import Mock
import unittest2 as unittest
from molly.apps.common.components import Attribution
from molly.apps.weather.endpoints import ObservationsEndpoint
class ObservationsEndpointTest(unittest.TestCase):
_OBSERVATION = {'hello': 'world'}
_ATTRIBUTION = Attrib... | ManchesterIO/mollyproject-next | tests/molly/apps/weather/test_endpoints.py | Python | apache-2.0 | 1,587 |
from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from .exceptions import STSValidationError
from .models import sts_backend
MAX_FEDERATION_TOKEN_POLICY_LENGTH = 2048
class TokenResponse(BaseResponse):
def get_session_token(self):
duration = int(self.querystring.get('... | whummer/moto | moto/sts/responses.py | Python | apache-2.0 | 6,975 |
# -*- 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/v10/services/services/asset_group_signal_service/transports/base.py | Python | apache-2.0 | 6,052 |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | chengduoZH/Paddle | python/paddle/fluid/contrib/layers/nn.py | Python | apache-2.0 | 31,519 |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | metacloud/python-novaclient | novaclient/v1_1/networks.py | Python | apache-2.0 | 4,626 |
""".. Ignore pydocstyle D400.
.. autoclass:: resolwe.test.TransactionResolweAPITestCase
:members:
.. autoclass:: resolwe.test.ResolweAPITestCase
"""
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase as DjangoTestCase
from rest_framework... | jberci/resolwe | resolwe/test/testcases/api.py | Python | apache-2.0 | 10,152 |
# Copyright 2015-2016 Yelp 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... | gstarnberger/paasta | general_itests/steps/http_drain_method_steps.py | Python | apache-2.0 | 3,053 |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... | edgedb/edgedb | edb/edgeql/parser/grammar/session.py | Python | apache-2.0 | 1,721 |
# 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/connectomics | common/bounding_box.py | Python | apache-2.0 | 15,147 |
# ----------------------------------------------------------------------------
# Copyright 2015-2016 Nervana 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.apa... | Jokeren/neon | neon/layers/recurrent.py | Python | apache-2.0 | 85,169 |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | googleapis/proto-breaking-change-detector | src/comparator/enum_value_comparator.py | Python | apache-2.0 | 2,949 |