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 |
|---|---|---|---|---|---|
class StadisticRouter(object):
"""A router to control all database operations on models in
the stadistic application"""
def db_for_read(self, model, **hints):
"Point all operations on myapp models to 'other'"
if model._meta.app_label == 'stadistic':
return 'nonrel'
retur... | frhumanes/consulting | web/src/stadistic/__init__.py | Python | apache-2.0 | 1,076 |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | Tan0/ironic | ironic/tests/drivers/ilo/test_inspect.py | Python | apache-2.0 | 19,077 |
# Copyright 2016 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... | tseaver/gcloud-python | speech/nox.py | Python | apache-2.0 | 3,927 |
# -*- 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-game-servers | samples/generated_samples/gameservices_v1_generated_game_server_deployments_service_update_game_server_deployment_async.py | Python | apache-2.0 | 1,658 |
from common_fixtures import * # NOQA
@pytest.mark.P0
@pytest.mark.LBHostRouting
@pytest.mark.incremental
class TestLbserviceHostRouting1:
testname = "TestLbserviceHostRouting1"
port = "900"
service_scale = 2
lb_scale = 1
service_count = 4
@pytest.mark.create
def test_lbservice_host_rout... | aruneli/validation-tests | tests/validation_v2/cattlevalidationtest/core/test_services_lb_host_routing.py | Python | apache-2.0 | 76,409 |
# coding=utf-8
# Copyright 2021 HuggingFace 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 ag... | huggingface/transformers | tests/speech_to_text/test_feature_extraction_speech_to_text.py | Python | apache-2.0 | 10,984 |
# 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 unde... | Alzon/senlin | senlin/tests/unit/engine/service/test_triggers.py | Python | apache-2.0 | 13,447 |
# Copyright 2017 Cisco 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 law o... | noironetworks/networking-cisco | networking_cisco/db/migration/alembic_migrations/versions/mitaka/expand/203b495958cf_add_port_profile_delete_table_for_ucsm_.py | Python | apache-2.0 | 1,179 |
# Copyright (C) 2017 Daniel Watkins <daniel@daniel-watkins.co.uk>
#
# 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... | OddBloke/jenkins-job-linter | tests/__init__.py | Python | apache-2.0 | 612 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-27 23:09
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("studies", "0024_merge_20170823_1352"),
("studies", "0029_auto_20170825_1505"),
]
op... | CenterForOpenScience/lookit-api | studies/migrations/0030_merge_20170827_1909.py | Python | apache-2.0 | 334 |
import csv
import regex as re
import gensim
import pandas as pd
hashtag_pattern = re.compile('#[^\s\p{P}]+')
dictionary = gensim.corpora.Dictionary()
texts = []
with open('/home/dbb/PycharmProjects/twitter_crawler/music.csv') as rdr:
csv = csv.reader(rdr)
for row in csv:
if len(row) > 0:
t... | dbracewell/pyHermes | tweet_analyze.py | Python | apache-2.0 | 1,469 |
# -*- coding: utf-8 -*-
from model.group import Group
# add db-fixture to get data from db, not from ui
def test_add_group(app, db, json_groups, check_ui): # add a fixture app as a parameter, data_groups/json_groups - load data for testing from data/group.py or test.json
group = json_groups
old_groups = db.ge... | Lana-Pa/Python-training | test/test_add_group.py | Python | apache-2.0 | 929 |
# -*- coding: utf-8 -*-
import logging
import operator
import httplib
import httplib as http
import os
from dateutil.parser import parse as parse_date
from flask import request
from modularodm.exceptions import ValidationError, NoResultsFound
from modularodm import Q
from framework import sentry
from framework.auth... | barbour-em/osf.io | website/profile/views.py | Python | apache-2.0 | 22,557 |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... | hone5t/pyquick | basic/string1.py | Python | apache-2.0 | 3,606 |
###genmapp
#Copyright 2005-2008 J. David Gladstone Institutes, San Francisco California
#Author Nathan Salomonis - nsalomonis@gmail.com
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without... | wuxue/altanalyze | genmappDBs.py | Python | apache-2.0 | 3,609 |
# coding: utf-8
from django import template
from django.db import models
from ref.models import ExtendedParameterDict
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter
def verbose_name(value):
return value._meta.verbose_name
@register.filter
def ksh_protect_and_quote(v... | digitalfox/MAGE | ref/templatetags/filter.py | Python | apache-2.0 | 2,371 |
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 28 23:29:44 2017
@author: AmatVictoriaCuramIII
"""
#Get modules
from SAge import SAge
from SAverageReturn import SAverageReturn
from SCoeffVar import SCoeffVar
from STrend import STrend
from SGapDown import SGapDown
from DayOverAverageRollingVolume import DayOverAverageRo... | adamrvfisher/TechnicalAnalysisLibrary | BigDownScanFilter.py | Python | apache-2.0 | 1,265 |
''' Copyright 2015 Neokami GmbH. '''
class NeokamiParametersException(Exception):
'''raise this when there's a Response error''' | NeokamiCode/Python-SDK | src/Neokami/Exceptions/NeokamiParametersException.py | Python | apache-2.0 | 131 |
"""Make the AWS bucket optional.
Revision ID: b6533e0a4e58
Revises: eca04db5c363
Create Date: 2017-02-06 02:16:03.926797
"""
# revision identifiers, used by Alembic.
revision = 'b6533e0a4e58'
down_revision = 'eca04db5c363'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.alter_column('aws_key'... | giubil/trackit | api/files/api/migrations/versions/b6533e0a4e58_make_the_aws_bucket_optional.py | Python | apache-2.0 | 605 |
def test_assert():
assert 'soup' == 'soup'
def test_pass():
pass
def test_fail():
assert False
test_fail.will_fail = True
| wilas/lab-ci | samples/py_garden/py_simple_tdd/test_nose_flat_play.py | Python | apache-2.0 | 137 |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | karllessard/tensorflow | tensorflow/python/distribute/v1/cross_device_ops_test.py | Python | apache-2.0 | 34,390 |
__author__ = 'tester'
from sys import maxsize
import re
class Group:
def __init__(self, name=None, header=None, footer=None, id=None):
self.name = name
self.header = header
self.footer = footer
self.id = id
def __repr__(self):
return "%s:%s:%s:%s" % (self.id, self.na... | EwgOskol/python_training | model/group.py | Python | apache-2.0 | 683 |
"""Viessmann ViCare sensor device."""
from __future__ import annotations
from contextlib import suppress
from dataclasses import dataclass
import logging
from PyViCare.PyViCareUtils import (
PyViCareInvalidDataError,
PyViCareNotSupportedFeatureError,
PyViCareRateLimitError,
)
import requests
from homeass... | aronsky/home-assistant | homeassistant/components/vicare/sensor.py | Python | apache-2.0 | 16,333 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'EmailUserHandler.to_ident'
db.add_column('form_builder_emailuserhandler', 'to_ident',
... | j00bar/django-widgy | widgy/contrib/form_builder/south_migrations/0010_auto__add_field_emailuserhandler_to_ident__chg_field_formsubmission_cr.py | Python | apache-2.0 | 9,301 |
"""Support for AVM FRITZ!Box classes."""
from __future__ import annotations
from collections.abc import Callable, ValuesView
from dataclasses import dataclass, field
from datetime import datetime, timedelta
import logging
from types import MappingProxyType
from typing import Any, TypedDict, cast
from fritzconnection ... | home-assistant/home-assistant | homeassistant/components/fritz/common.py | Python | apache-2.0 | 19,263 |
# 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 ... | kogotko/carburetor | openstack_dashboard/dashboards/project/api_access/views.py | Python | apache-2.0 | 9,052 |
# coding: utf-8
import os
import sys
import time
import tihldelib.userlib as lib
__author__ = 'Harald Floor Wilhelmsen'
def get_useramount():
formatstring = 'Format: python lan_users.py useramount'
# Checking if there are sufficient arguments, if not exit
if len(sys.argv) != 2:
sys.exit('Invail... | tihlde/TIHLDEscripts | userscripts/lan_users_ipa.py | Python | apache-2.0 | 1,614 |
def cyclegesture2():
##for x in range(5):
welcome()
sleep(1)
relax()
sleep(2)
fingerright()
sleep(1)
isitaball()
sleep(2)
removeleftarm()
sleep(2)
handdown()
sleep(1)
fullspeed()
i01.giving()
sleep(5)
removeleftarm()
sleep(4)
takeball()
sleep(1)
surrender()
sleep(6)
isitaba... | MyRobotLab/pyrobotlab | home/kwatters/harry/gestures/cyclegesture2.py | Python | apache-2.0 | 481 |
import json
from datetime import datetime
import numpy as np
import pandas as pd
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
set_session(tf.Session(config=config))
from keras.models import Sequential, Model
from ker... | amoshyc/tthl-code | train_resnet.py | Python | apache-2.0 | 1,324 |
"""Code representing a query."""
import six
from ichnaea.api.locate.constants import (
DataAccuracy,
MIN_WIFIS_IN_QUERY,
)
from ichnaea.api.locate.schema import (
CellAreaLookup,
CellLookup,
FallbackLookup,
WifiLookup,
)
try:
from collections import OrderedDict
except ImportError: # prag... | therewillbecode/ichnaea | ichnaea/api/locate/query.py | Python | apache-2.0 | 10,806 |
3485930
| kennknowles/python-rightarrow | tests/samples/literal_int.py | Python | apache-2.0 | 8 |
import pytest
from stellar_sdk import AuthorizationFlag, MuxedAccount, Operation, SetOptions, Signer
from stellar_sdk.utils import sha256
class TestSetOptions:
AUTHORIZATION_REQUIRED = 1
AUTHORIZATION_REVOCABLE = 2
AUTHORIZATION_IMMUTABLE = 4
AUTHORIZATION_CLAWBACK_ENABLED = 8
@pytest.mark.param... | StellarCN/py-stellar-base | tests/operation/test_set_options.py | Python | apache-2.0 | 5,429 |
__author__ = 'Nolan Nichols <http://orcid.org/0000-0003-1099-3328>'
import os
import StringIO
import rdflib
import pandas as pd
# Access namespace objects as attributes
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self... | nicholsn/niquery | niquery/utils.py | Python | apache-2.0 | 1,399 |
########
# Copyright (c) 2014 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... | fogelomer/cloudify-filebeat-plugin | filebeat_plugin/tasks.py | Python | apache-2.0 | 7,991 |
# Copyright 2017 AT&T Intellectual Property. All other 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... | att-comdev/drydock | drydock_provisioner/statemgmt/design/resolver.py | Python | apache-2.0 | 4,304 |
from great_expectations.core import IDDict
from great_expectations.core.util import convert_to_json_serializable
from great_expectations.types import SerializableDotDict
# TODO: <Alex>If/when usage of this class gains traction, it can be moved to common general utilities location.</Alex>
class Attributes(Serializable... | great-expectations/great_expectations | great_expectations/rule_based_profiler/types/attributes.py | Python | apache-2.0 | 604 |
# Remove key from Chrome manifest
#
# Run with:
# python removekey.py
import json
manifest_files = [
'build/dist/chrome/app/manifest.json',
'build/dist/chrome/extension/manifest.json'
]
for filename in manifest_files:
with open(filename) as manifest:
manif... | itplanes/uproxy | removekey.py | Python | apache-2.0 | 479 |
#!/usr/bin/env 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 requir... | Aloomaio/googleads-python-lib | examples/adwords/v201809/error_handling/handle_partial_failures.py | Python | apache-2.0 | 4,130 |
from django import forms
from django.forms.widgets import *
from django.utils.safestring import mark_safe
from madrona.analysistools.widgets import SliderWidget, DualSliderWidget
class AdminFileWidget(forms.FileInput):
"""
A FileField Widget that shows its current value if it has one.
"""
def __init__(... | Ecotrust/PEW-EFH | mp/scenarios/widgets.py | Python | apache-2.0 | 4,479 |
"""
Tests of RPI-specific functionality (adapters and sensors).
"""
import asyncio
import unittest
import platform
from utils import ValueListSensor
from thingflow.base import Scheduler, SensorAsOutputThing
import thingflow.filters.map
from thingflow.filters.output import output
from thingflow.filters.combinators imp... | mpi-sws-rse/thingflow-python | tests/test_rpi_adapters.py | Python | apache-2.0 | 1,694 |
from django.db import models
# Create your models here.
#class IDLUsers(models.Model) :
# userid = models.IntegerField()
# ssoaccount = models.CharField(max_length = 255)
# usernickname = models.CharField(max_length = 255)
# createdate = models.DateTimeField()
# lastlogin = models.DateTimeField(blank = ... | chyhsueh/singlesignonservice | singleSignOn/models.py | Python | apache-2.0 | 705 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 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/plist_plugins/airport_test.py | Python | apache-2.0 | 2,576 |
# 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... | itskewpie/tempest | tempest/api/network/test_routers.py | Python | apache-2.0 | 6,019 |
# -*- encoding: utf-8 -*-
#
# Copyright © 2017 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | sileht/pastamaker | pastamaker/gh_pr_fullifier.py | Python | apache-2.0 | 9,306 |
# coding: utf-8
from test.lib.testing import eq_
from sqlalchemy import *
from sqlalchemy import types as sqltypes, exc
from sqlalchemy.sql import table, column
from test.lib import *
from test.lib.testing import eq_, assert_raises, assert_raises_message
from test.lib.engines import testing_engine
from sqlalchemy.dial... | ioram7/keystone-federado-pgid2013 | build/sqlalchemy/test/dialect/test_oracle.py | Python | apache-2.0 | 57,961 |
# Copyright 2015 Curtis Sand
#
# 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, ... | fretboardfreak/space | tests/lib/cmdline/commands/test_quit.py | Python | apache-2.0 | 839 |
import glob
import json
import os
import random
import string
import pandas as pd
import pytest
from great_expectations.execution_engine.pandas_batch_data import PandasBatchData
from great_expectations.execution_engine.sparkdf_batch_data import SparkDFBatchData
from great_expectations.execution_engine.sqlalchemy_batc... | great-expectations/great_expectations | tests/test_definitions/test_expectations_cfe.py | Python | apache-2.0 | 17,894 |
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import Client, TestCase
from categories.models import Category
class TestCategoryAdmin(TestCase):
def setUp(self):
self.client = Client()
def test_adding_parent_and_child(self):
User.ob... | miceno/django-categories | categories/tests/test_admin.py | Python | apache-2.0 | 1,919 |
import os
import ConfigParser
import click
from base64 import b64encode
import requests
import json
class B3Notify(object):
"""
Build status notifier for bitbucket server
"""
def __init__(self, home='~/.b3notifyrc'):
self.home = home
self.verbose = True
self.config = {}
... | xydinesh/b3notify | b3notify.py | Python | apache-2.0 | 3,613 |
from os import environ, getcwd
from os.path import exists, join
from common import str2bool, env_var
from group_epitopes import group_epitopes_dataframe
from hla_file import read_hla_file
from immunogenicity import ImmunogenicityPredictor
from load_file import expand_transcripts
from load_file import load_variants
fro... | hammerlab/immuno | immuno/ui.py | Python | apache-2.0 | 14,247 |
class Solution(object):
# Op1: time O(n*log(n)) space O(1)
def hIndex(self, citations):
"""
:type citations: List[int]
:rtype: int
"""
citations.sort(reverse=True)
for i, x in enumerate(citations):
# print(i, x)
if i >= x:
r... | rx2130/Leetcode | python/274 H-Index.py | Python | apache-2.0 | 993 |
# Copyright (c) 2021 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... | PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/ipu/test_lookuptable_op_ipu.py | Python | apache-2.0 | 4,745 |
# run python freetests.py while server is running
import urllib2
import unittest
BASEURL = "http://cmput410project15.herokuapp.com"
class TestYourWebserver(unittest.TestCase):
"""
Tests some the responses from the server with urllib2
"""
def setUp(self,baseurl=BASEURL):
self.baseurl = baseurl... | TeamUACS1/410Project | tests/testResponse.py | Python | apache-2.0 | 1,144 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
from ... | ity/pants | src/python/pants/engine/legacy/graph.py | Python | apache-2.0 | 11,698 |
from __future__ import absolute_import
from __future__ import unicode_literals
class Config(object):
DEBUG = False
TESTING = False
# Host for the redis server
REDIS = 'redis'
# Do not push this to a public repo
SLACK_DEFAULT_CHANNEL = '#general'
SLACK_DEVELOPERS_CHANNEL = '#developers'
... | pipex/gitbot | config.py | Python | apache-2.0 | 1,016 |
# -*- coding: utf 8 -*-
"""
Define a suite a tests for the canstrat functions.
"""
from welly import Well
import welly.quality as q
tests = {
'Each': [
q.no_flat,
q.no_monotonic,
q.no_gaps,
],
'Gamma': [
q.all_positive,
q.all_below(450),
q.check_units(['API',... | agile-geoscience/welly | tests/test_quality.py | Python | apache-2.0 | 2,002 |
# 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 requ... | mikalstill/nova | nova/tests/unit/api/openstack/compute/test_server_metadata.py | Python | apache-2.0 | 31,012 |
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
from .access_memberships import *
from .fields import *
from .migrations import *
from .subscription import *
from .forms import *
from .widgets import *
| armstrong/armstrong.core.arm_access | armstrong/core/arm_access/tests/__init__.py | Python | apache-2.0 | 230 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('compose', '0010_auto_20151026_1126'),
]
operations = [
migrations.RenameField(
model_name='slideshow',
... | pkimber/compose | compose/migrations/0011_auto_20151026_1203.py | Python | apache-2.0 | 401 |
########
# Copyright (c) 2016 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... | dankilman/clue | clue/tests/test_git.py | Python | apache-2.0 | 16,458 |
""".. Ignore pydocstyle D400.
==================
Storage Management
==================
.. automodule:: resolwe.storage.management.commands.run_storage_manager
:members:
"""
| genialis/resolwe | resolwe/storage/management/__init__.py | Python | apache-2.0 | 180 |
# Copyright (c) 2015 Tintri. 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... | skylerberg/third-party-ci-tools | monitoring/ciwatch/ciwatch/cache.py | Python | apache-2.0 | 1,165 |
from CommonClasses import *
from solution import Solution
class TestSuite:
def run(self):
# self.test000()
# self.test001()
self.test002()
# self.test003()
# self.test004()
def test000(self):
print 'test 000\n'
... | 54lihaoxin/leetcode_python | src/SearchInRotatedSortedArrayII/test_suite.py | Python | apache-2.0 | 1,694 |
##############################################################################
# Copyright (c) 2015 Huawei Technologies Co.,Ltd. and others
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, ... | dtudares/hello-world | yardstick/yardstick/benchmark/scenarios/availability/monitor/monitor_command.py | Python | apache-2.0 | 3,388 |
# ----------------------------------------------------------------
# Copyright 2016 Cisco Systems
#
# 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... | psykokwak4/ydk-gen | sdk/python/core/ydk/services/crud_service.py | Python | apache-2.0 | 1,819 |
# Copyright (c) OpenMMLab. All rights reserved.
# Copyright (c) 2019 Western Digital Corporation or its affiliates.
import torch
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from ..builder import NECKS
class DetectionBlock(BaseModule):
"""Detection block in ... | open-mmlab/mmdetection | mmdet/models/necks/yolo_neck.py | Python | apache-2.0 | 5,431 |
# -*- coding: utf-8 -*-
# Copyright 2014-2015 Parsely, 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 ... | pystorm/pystorm | pystorm/version.py | Python | apache-2.0 | 1,051 |
# RUN: %PYTHON %s 2>&1 | FileCheck %s
# This file contains small benchmarks with reasonably-sized problem/tiling sizes
# and codegen options.
from ..core.experts import *
from ..core.harness import *
from ..core.transforms import *
from ..contraction.definitions import *
fun_name = 'column_reduction_2d'
op_name = '... | google/iree-llvm-sandbox | python/examples/reduction/column_reduction_2d_bench.py | Python | apache-2.0 | 3,738 |
# -*- coding: utf-8 -*-
""" standard """
from random import randint
import re
""" custom """
from examples.working_init import *
from threatconnect.Config.ResourceType import ResourceType
#
# CHANGE FOR YOUR TESTING ENVIRONMENT
# - These incidents must be created before running this script
#
owner = 'Example Communi... | percipient/threatconnect-python | examples/commit/incidents_commit.py | Python | apache-2.0 | 8,526 |
from copy import deepcopy
from .base import Strategy
class InsertionSort(Strategy):
def sort_by(self, field):
return self._sort(lambda x, y: x.grades[field] < y.grades[field])
def sort(self):
return self._sort(lambda x, y: x < y)
def _sort(self, compare):
for first_item in self.items:
items... | vtemian/university_projects | practic_stage/hmw4/strategies/insertion.py | Python | apache-2.0 | 524 |
import pytest
import salt.pillar.sql_base as sql_base
from tests.support.mock import MagicMock
class FakeExtPillar(sql_base.SqlBaseExtPillar):
"""
Mock SqlBaseExtPillar implementation for testing purpose
"""
@classmethod
def _db_name(cls):
return "fake"
def _get_cursor(self):
... | saltstack/salt | tests/pytests/unit/pillar/test_sql_base.py | Python | apache-2.0 | 1,158 |
# coding=utf-8
# Copyright 2022 The ML Fairness Gym 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/ml-fairness-gym | spaces/multinomial_test.py | Python | apache-2.0 | 3,523 |
# Copyright 2016 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | F5Networks/f5-common-python | f5/bigip/tm/sys/test/functional/test_folder.py | Python | apache-2.0 | 3,258 |
from utils import secret
import requests
import re
import json
import os
def gf_families_ignore_camelcase():
"""Find family names in the GF collection which cannot be derived by
splitting the filename using a camelcase function e.g
VT323, PTSans.
If these filenames are split, they will be V T 32... | googlefonts/gfregression | Lib/gfregression/gf_families_ignore_camelcase.py | Python | apache-2.0 | 936 |
from django.contrib import admin
from models import *
from cards.actions import export_as_xls
class ScanAdmin(admin.ModelAdmin):
list_filter = ['readerLocation', 'added']
search_fields = ['card__code']
# Register your models here.
admin.site.register(Batch)
admin.site.register(Card)
admin.site.register(Reade... | i-DAT-Qualia/Card-Backend | cards/admin.py | Python | apache-2.0 | 528 |
# pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
# Smartsheet Python SDK.
#
# Copyright 2018 Smartsheet.com, 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.... | smartsheet-platform/smartsheet-python-sdk | smartsheet/models/alternate_email.py | Python | apache-2.0 | 2,281 |
#
# Copyright 2017 Luma Pictures
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Tradem... | pxmkuruc/usd-qt | tests/test_usdlib.py | Python | apache-2.0 | 4,109 |
# 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 unde... | openstack/senlin | senlin/tests/unit/profiles/test_profile_base.py | Python | apache-2.0 | 38,181 |
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# L... | kayhayen/Nuitka | tests/optimizations/Attributes.py | Python | apache-2.0 | 1,056 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | kubernetes-client/python | kubernetes/client/models/v2_pods_metric_status.py | Python | apache-2.0 | 4,423 |
from serial import Serial
import time
import platform
import socket
serialPort = Serial('COM3' if platform.system() == 'Windows' else '/dev/ttyUSB0', 9600)
time.sleep(2)
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(('', 2222))
server.listen(1)
while True:
(client, address) = server.accept(... | Mnenmenth/RobotCode | JoystickInput/JoystickServer.py | Python | apache-2.0 | 458 |
_base_ = './retinanet_r50_fpn_2x_coco.py'
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained',
checkpoint='torchvision://resnet101')))
| open-mmlab/mmdetection | configs/retinanet/retinanet_r101_fpn_2x_coco.py | Python | apache-2.0 | 197 |
# Copyright 2016, 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, s... | GoogleCloudPlatform/python-docs-samples | compute/encryption/generate_wrapped_rsa_key_test.py | Python | apache-2.0 | 1,721 |
# -*- coding: utf-8 -*-
# Copyright 2016 Messente Communications OÜ
#
# 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 ... | messente/messente-python | messente/api/sms/api/delivery.py | Python | apache-2.0 | 1,647 |
# ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided t... | shadowmint/nwidget | lib/cocos2d-0.5.5/cocos/layer/python_interpreter.py | Python | apache-2.0 | 9,867 |
import cgi
print "Content-Type: text/html\n"
form = cgi.FieldStorage()
print """
<!DOCTYPE html>
<html lang="en">
<head>
<title>CodeBin</title>
<link rel="stylesheet" type="text/css" href="./css/editor.css"/>
<link rel="stylesheet" rel="stylesheet" type="text/css" media="screen" href="http://openfontl... | Alex-Jaeger/CodeBin | src/editor.py | Python | apache-2.0 | 6,836 |
#!/usr/bin/python
# -*- coding: utf-8; -*-
#
# 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... | locaweb/leela-client | src/python/leela/client/sensors/linux/network.py | Python | apache-2.0 | 1,492 |
# -*- coding: utf-8 -*-
#
# Copyright 2013 Unicon Pte. Ltd.
#
# 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... | unicon-pte-ltd/funnel | funnel/testing.py | Python | apache-2.0 | 4,075 |
from setuptools import setup
# Really only required so setup.cfg can pick up __version__
setup(
name="bruges",
) | agile-geoscience/bruges | setup.py | Python | apache-2.0 | 117 |
from model.info_contact import Infos
testdata = [
Infos(firstname="firstname1",lastname="lastname1"),
Infos(firstname="firstname2",lastname="lastname2")
] | Alex-Chizhov/python_training | home_works/data/contacts.py | Python | apache-2.0 | 166 |
# 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 ... | watermelo/libcloud | libcloud/test/loadbalancer/test_dimensiondata.py | Python | apache-2.0 | 26,630 |
from typing import Any, Callable, Optional
# Define the various operators' behavior for values other than None.
# The behavior with respect to None is defined explicitly in the "apply_operator()" function.
_operator_definitions_for_non_null_values = {
"=": lambda left, right: left == right,
">": lambda left, ... | kensho-technologies/graphql-compiler | graphql_compiler/interpreter/expression_ops/operators.py | Python | apache-2.0 | 2,903 |
# Copyright 2019 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, ... | googleapis/python-translate | samples/snippets/hybrid_glossaries/hybrid_tutorial_test.py | Python | apache-2.0 | 3,065 |
__author__ = 'Javier'
import urllib.request
import json
class Repo(object):
def __init__(self, fork, stars, watchers):
self._fork = int(fork)
self._stars = int(stars)
self._watchers = int(watchers)
@property
def forks(self):
return self._fork
@property
def stars(s... | javierj/kobudo-katas | Kata-RestConsumer/DjangoGIndexDemo/gindex/gindex_logic/gindex.py | Python | apache-2.0 | 1,609 |
'''
Created on 10/mar/2014
@author: sectumsempra
'''
import sys
'''
from variab_conc import errbox
from PyQt4 import QtGui, QtCore, Qt
from PyQt4.QtCore import pyqtSignal, SLOT
from PyQt4.QtCore import pyqtSlot, SIGNAL
from PyQt4.QtGui import QPushButton, QTextEdit, QTableWidgetItem
'''
from PyQt4 import QtGui, QtCor... | Roma2Lug-Projects/BEST_App | src/config.py | Python | apache-2.0 | 8,273 |
import pandas as pd
# TODO: Load up the dataset
# Ensuring you set the appropriate header column names
#
# .. your code here ..
df = pd.read_csv('~/courses/course-python-datascience-ms/DAT210x/Module2/Datasets/servo.data',
names=['motor', 'screw', 'pgain', 'vgain', 'class'])
# TODO: Create a slice ... | miltonlab/course-python-datascience-ms | DAT210x/Module2/assignment3.py | Python | apache-2.0 | 1,286 |
# Can't be run at the moment until migration with openstack-client
# Copyright (c) 2018 Intel Corporation.
#
# 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.ap... | openstack/neutron-classifier | neutron_classifier/tests/unit/cli/__test_db_classifications.py | Python | apache-2.0 | 2,667 |
# encoding: utf-8
"""Provides collection of events emitters"""
import time
from . import EndPoint
def container_count(host_fqdn, docker_client, statistics):
"""
Emit events providing:
- number of containers
- number of running containers
- number of crashed containers
:param host_fqdn:... | dockermeetupsinbordeaux/docker-zabbix-sender | docker_zabbix_sender/stats.py | Python | apache-2.0 | 2,565 |
import importlib.util
class Config:
def __init__(self, path: str) -> None:
spec = importlib.util.spec_from_file_location('conf', path)
self.module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(self.module)
@property
def rst_epilog(self) -> str:
"""A strin... | jeff-allen-mongo/mut | mut/tuft/config.py | Python | apache-2.0 | 911 |
# encoding: utf-8
u'''MCL — Organ Folder'''
from ._base import IIngestableFolder, Ingestor, IngestableFolderView
from .interfaces import IOrgan
from five import grok
class IOrganFolder(IIngestableFolder):
u'''Folder containing body systems, also known as organs.'''
class OrganIngestor(Ingestor):
u'''RDF i... | MCLConsortium/mcl-site | src/jpl.mcl.site.knowledge/src/jpl/mcl/site/knowledge/organfolder.py | Python | apache-2.0 | 544 |