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 2013 Netherlands eScience Center # # 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 t...
NLeSC/eEcology-Annotation-WS
annotation/__init__.py
Python
apache-2.0
4,807
''' Created on 05/11/2015 @author: S41nz ''' class TBTAFTestSuiteType(object): ''' Simple enumeration class that defines the types of Test suites supported by the TBTAF ''' #Test suite enumeration types #This enumeration corresponds to the classic test suite, targeted for brute force approach...
S41nz/TBTAF
tbtaf/common/enums/suite_type.py
Python
apache-2.0
500
from easy_alert.util import CaseClass class Alert(CaseClass): """ Abstract model which can be the output of watchers and the input of notifiers """ keys = ['start_time', 'level', 'title', 'message'] def __init__(self, start_time, level, title, message): super(Alert, self).__init__(self.ke...
mogproject/easy-alert
src/easy_alert/entity/alert.py
Python
apache-2.0
446
#!/usr/bin/python from distutils.core import setup from lemonldap import __version__ setup( name='django-lemonldap', version=__version__, description='LemonLDAP: django authentication system to be used with LemonLDAP::NG', long_description='LemonLDAP: Allow users to be authenticated through LemonLDAP:...
rclsilver/django-lemonldap
setup.py
Python
apache-2.0
1,158
#!/usr/bin/env python2.5 # # Copyright 2009 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 applic...
MatthewWilkes/mw4068-packaging
src/melange/src/soc/views/helper/templatetags/comments_helpers.py
Python
apache-2.0
3,182
######################################################################## # amara/namespaces.py """ Common namespaces, for sake of convenience Note: NULL_NAMESPACE is useful in case you can't easily remember that None is the prefered way to write the null namespace in API """ NULL_NAMESPACE = None COMMON_NAMESPACES =...
zepheira/amara
lib/namespaces.py
Python
apache-2.0
8,593
class SMUserMiddleware(object): def process_request(self, request): """Map all the Siteminder headers in case they change in the future """ # Only BCeID request.META.update({ 'HTTP_SMAUTH_BUSINESSGUID': request.META.get('HTTP_SMGOV_BUSINESSGUID', ''), ...
swcurran/tfrs
backend/api/middleware.py
Python
apache-2.0
1,583
from geometry_msgs.msg import Twist from lg_msg_defs.msg import ApplicationState from evdev import AbsInfo, UInput, InputEvent, ecodes as e import time class DeviceWriter: def __init__(self, scale): self.scale = scale # most values were taken from running # InputDevice('/dev/input/event$N'...
EndPointCorp/lg_ros_nodes
lg_nav_to_device/src/lg_nav_to_device/device_writer.py
Python
apache-2.0
2,434
#!/usr/bin/python from twython import Twython import sys import os import argparse # requires 2.7 import json import codecs import pprint import textwrap import time import random LETTER_SCORE = {'a': 23, 'c': 43, 'b': 94, 'e': 17, 'd': 57, 'g': 79, 'f': 108, 'i': 26, 'h': 65, 'k': 178, 'j': 1000, 'm': 65, 'l': ...
timokoola/obscurebio
bio_tweet.py
Python
apache-2.0
4,322
from django.conf.urls import patterns, url from . import views urlpatterns = patterns( '', # ex: /visits/ url( regex=r'^$', view=views.VisitListView.as_view(), name='list'), # ex: /visits/NN/ url( regex=r'^(?P<pk>\d+)/$', view=views.VisitDetailView.as_view(...
robjordan/unesco_project
unesco/visits/urls.py
Python
apache-2.0
484
import boto3 import traceback from fractions import Fraction from app.aws import region_fullnames, region_names_aws_google, region_names_aws_azure from app.aws.instances import get_running_instances as get_running_instances_aws from app.gcloud import number_cpu_instances as gcloud_number_cpu_instances from app.gcloud.i...
giubil/trackit
api/files/api/app/compare_providers.py
Python
apache-2.0
20,830
#! /usr/bin/env 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...
google/neural-logic-machines
difflogic/nn/neural_logic/modules/_utils.py
Python
apache-2.0
2,087
from cloudify import ctx from cloudify import utils from cloudify.exceptions import NonRecoverableError from StringIO import StringIO import base64 import os import platform import re import subprocess import sys import time import threading import platform import json def convert_env_value_to_string(envDict): f...
alien4cloud/alien4cloud-cloudify3-provider
alien4cloud-cloudify3-provider/src/test/resources/outputs/blueprints/amazon/lamp/wrapper/Apache/org.alien4cloud.interfaces.cfy.lifecycle/NodeInit/_a4c_NodeInit.py
Python
apache-2.0
47,254
from great_expectations.expectations.expectation import MulticolumnMapExpectation from great_expectations.expectations.util import ( add_values_with_json_schema_from_list_in_params, render_evaluation_parameter_string, ) from great_expectations.render.renderer.renderer import renderer from great_expectations.ren...
great-expectations/great_expectations
great_expectations/expectations/core/expect_select_column_values_to_be_unique_within_record.py
Python
apache-2.0
8,276
"""A setuptools based setup module for continuous deployment devops. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from...
pypyr/pypyr-cli
setup.py
Python
apache-2.0
4,683
from httpMethods import * import time import random # Create the graph (profiling tags) post('/api/actors', {"data": {"type": "actors", "attributes": {"type":"httpbroadcast"}}}) post('/api/actors', {"data": {"type": "actors", "attributes": {"type":"stats", "params":{"field": "amount"}, "group":{"by":"city"}}}}) post(...
daishichao/coral
examples/example2.py
Python
apache-2.0
979
# 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, ...
daspecster/google-cloud-python
dns/setup.py
Python
apache-2.0
2,084
from setuptools import setup from setuptools import setup, find_packages, Extension from setuptools.command.test import test as TestCommand import sys, io, os, glob module1 = Extension('pylw.qs_parse', sources = ['pylw/qs_parse.c']) module2 = Extension('pylw.route_find', sources = ['pylw/route_find.c']) class PyTest(...
xstaticxgpx/pylw
setup.py
Python
apache-2.0
2,778
# -*- coding: utf-8 -*- import unicodedata import lxml.etree import lxml.builder from website import settings NAMESPACE = 'http://datacite.org/schema/kernel-4' XSI = 'http://www.w3.org/2001/XMLSchema-instance' SCHEMA_LOCATION = 'http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd...
pattisdr/osf.io
website/identifiers/metadata.py
Python
apache-2.0
5,346
import argparse import os import base64 import tempfile import requests from cnrclient.pack import pack_kub from cnrclient.utils import package_filename from cnrclient.commands.command_base import CommandBase, PackageSplit from cnrclient.formats.helm.manifest_chart import ManifestChart from cnrclient.formats import de...
app-registry/appr-cli
cnrclient/commands/push.py
Python
apache-2.0
5,164
# Copyright 2012 NTT Data # 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 appl...
ntymtsiv/tempest
tempest/services/compute/json/quotas_client.py
Python
apache-2.0
3,487
# Copyright 2010-2012 Institut Mines-Telecom # # 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 agre...
jordan-developer/pyCMBS
setup.py
Python
apache-2.0
2,370
#!/usr/bin/python2 # -*- coding: utf-8 -*- # trader_quant_obv # # # vim:fileencoding=utf-8:sw=4:et -*- coding: utf-8 -*- # # talib Quant. # import sys import json import _index from energy.db.kPrice import kPrice from energy.libs.buildReturnJson import buildReturnJson as brj from energy.libs.QTaLib import QTaLib ...
vyouzhis/energy
talib/talibQuant.py
Python
apache-2.0
3,274
# 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
dedal/models/nlp.py
Python
apache-2.0
8,662
API_BASE_URL = 'http://proyectocolibri.es/api/v1/' FIREBASE_BASE_URL = 'https://congresoaldia.firebaseio.com/'
rafaparadela/congresoaldia_server
constants.py
Python
apache-2.0
111
from unittest import mock import pylast import pytest from mopidy import models from mopidy_scrobbler import frontend as frontend_lib @pytest.fixture def pylast_mock(): with mock.patch("mopidy_scrobbler.frontend.pylast", spec=pylast) as m: yield m @pytest.fixture def frontend(): config = {"scrobbl...
mopidy/mopidy-scrobbler
tests/test_frontend.py
Python
apache-2.0
5,342
# 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 ...
cloudkick/libcloud
test/compute/test_ibm_sbc.py
Python
apache-2.0
9,476
# BEGIN_COPYRIGHT # # Copyright 2009-2018 CRS4. # # 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 agree...
elzaggo/pydoop
test/common/test_pydoop.py
Python
apache-2.0
2,522
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import abc from typing import Optional, Tuple import numpy as np from .. import ParameterSpace from ..acquisition import Acquisition from .context_manager import Context, ContextManager class Acquisition...
EmuKit/emukit
emukit/core/optimization/acquisition_optimizer.py
Python
apache-2.0
2,171
#!/usr/bin/env python """Configuration parameters for the admin UI.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from grr_response_core.lib import config_lib from grr_response_core.lib.rdfvalues import config as rdf_config # The Admin UI web applic...
dunkhong/grr
grr/core/grr_response_core/config/gui.py
Python
apache-2.0
6,387
# file django/existdb/manager.py # # Copyright 2010 Emory University General Library # # 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/...
emory-libraries/eulcore-history
src/eulcore/django/existdb/manager.py
Python
apache-2.0
4,089
import datetime import os from typing import Any, Dict, List import orjson from zerver.data_import.import_util import SubscriberHandler, ZerverFieldsT, build_recipients from zerver.data_import.rocketchat import ( build_reactions, categorize_channels_and_map_with_id, convert_channel_data, convert_huddl...
hackerkid/zulip
zerver/tests/test_rocketchat_importer.py
Python
apache-2.0
34,412
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('server', '0005_auto_20170501_1354'), ] operations = [ migrations.RemoveField( model_name='user', nam...
jeffmcnd/tfrs
server/migrations/0006_auto_20170728_2052.py
Python
apache-2.0
1,149
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ***************************************** Author: zhlinh Email: zhlinhng@gmail.com Version: 0.0.1 Created Time: 2016-03-03 Last_modify: 2016-03-03 ****************************************** ''' ''' Given a binary tree, return the inorder tr...
zhlinh/leetcode
0094.Binary Tree Inorder Traversal/solution.py
Python
apache-2.0
1,174
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
our-city-app/oca-backend
src/rogerthat/service/api/forms/service_callbacks.py
Python
apache-2.0
1,563
#Author : Yashdeep Hinge from sys import argv script, input_file = argv def print_all(f): print f.read() def rewind(f): f.seek(0) def print_a_line(line_count, f): print line_count, f.readline() current_file = open(input_file) print "First let's print the whole file:\n" print_all(current_file) print "Now let...
yashdeeph709/Algorithms
HardPython/funfiles.py
Python
apache-2.0
542
############################################################################## # Copyright 2016-2019 Rigetti Computing # # 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...
rigetticomputing/pyquil
pyquil/reference_simulator.py
Python
apache-2.0
1,103
# Copyright 2016 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...
cisco-openstack/tempest
tempest/tests/lib/services/object_storage/test_object_client.py
Python
apache-2.0
4,545
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
googleapis/python-bigquery
samples/tests/test_download_public_data.py
Python
apache-2.0
1,212
from awsdaleks import chaser, newTarget import boto3 def chase(target): return [newTarget("ec2_instances", region=target["region"])] chaser("ec2", lambda r: chase(r))
jfaerman/aws-daleks
awsdaleks/ec2.py
Python
apache-2.0
175
# Copyright (c) 2016 Dataman Cloud # 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...
Dataman-Cloud/omega-client
python-omegaclient/omegaclient/__init__.py
Python
apache-2.0
2,489
# Copyright 2014 IBM Corp. # # 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...
citrix-openstack-build/os-brick
os_brick/i18n.py
Python
apache-2.0
1,175
# Copyright 2013 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
kuujo/vertigo-python
src/test/resources/network_test.py
Python
apache-2.0
3,476
# 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...
dudymas/python-openstacksdk
openstack/message/message_service.py
Python
apache-2.0
927
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a ...
vuntz/glance
glance/common/exception.py
Python
apache-2.0
17,723
# 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 agreed to in writing, ...
google/dqm
backend/dqm/tests.py
Python
apache-2.0
9,519
# Copyright 2015 Isotoma Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
yaybu/touchdown
touchdown/aws/vpc/vpn_gateway.py
Python
apache-2.0
4,659
#!/usr/bin/python ############################################################################## # Copyright 2016-2017 Rigetti Computing # # 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 ...
balopat/pyquil
pyquil/tests/test_parametric.py
Python
apache-2.0
4,000
# Copyright 2022 The etils 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/etils
etils/ecolab/lazy_imports_test.py
Python
apache-2.0
847
# Copyright 2015 SimpliVity Corp. # # 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...
bswartz/cinder
cinder/tests/unit/objects/test_volume_type.py
Python
apache-2.0
6,925
# Copyright 2021 The Kubeflow 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...
kubeflow/pipelines
samples/test/parameter_with_format_test.py
Python
apache-2.0
1,248
""" This module contains functions for writing artemis files. """ """ Copyright 2010 Jarl Haggerty 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 ...
jarl-haggerty/profelis
src/main/jython/profelis/artemis.py
Python
apache-2.0
3,653
# -*- coding: utf-8 -*- # pylint: disable=bad-continuation """ Command line interface. """ # Copyright © 2015 Jürgen Hermann <jh@web.de> # # 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 # # ...
jhermann/thin-man
src/thinman/__main__.py
Python
apache-2.0
2,138
# this line prints 'yeet' print("yeet")
Akaoui-and-Miller/Web-A
yeet.py
Python
apache-2.0
40
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
kayhayen/Nuitka
nuitka/freezer/DependsExe.py
Python
apache-2.0
6,046
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
chemelnucfin/tensorflow
tensorflow/python/ops/variables.py
Python
apache-2.0
129,143
from setuptools import setup, find_packages from molotov import __version__ import sys install_requires = ['requests', 'statsd'] description = '' for file_ in ('README', ): with open('%s.rst' % file_) as f: description += f.read() + '\n\n' classifiers = ["Programming Language :: Python", ...
tarekziade/ailoads
setup.py
Python
apache-2.0
962
# Prevent typing ndod.algorithms.algorithms #import algorithms.deploy as deploy #import algorithms.emlib as emlib #import algorithms.sobol_lib as sobol_lib #import algorithms.models as models #import algorithms.train as train
neurodata/ndparse
ndparse/algorithms/__init__.py
Python
apache-2.0
227
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
keras-team/keras
keras/tools/pip_package/setup.py
Python
apache-2.0
2,933
# Задача 5. Вариант 38. # Напишите программу, которая бы при запуске случайным образом # отображала имя одной из семи птиц, # доступных с первой версии игры Angry Birds. # Kucheryavenko A. I. # 31.03.2016 import random print("Программа случайным образом отображает имя одной из семи птиц,доступных с первой версии игр...
Mariaanisimova/pythonintask
PMIa/2014/KUCHERYAVENKO_A_I/task_5_38.py
Python
apache-2.0
985
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib import feedparser import socket BASE_URL = 'https://news.google.com' class GoogleNews(object): def __init__(self, userip=None): self.userip = userip or socket.gethostbyname(socket.gethostname()) def news(self, query, language=None): ...
halflings/crosscultural-media
news.py
Python
apache-2.0
821
import subprocess from optparse import OptionParser import re import time def run(command): try: output = subprocess.Popen(command, shell=True, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) (out, err) ...
mffiedler/svt
openshift_scalability/scripts/pod_density/pod_density_helper.py
Python
apache-2.0
4,691
# -*- coding: utf-8 -*- # @Time : 17-9-30 下午1:55 # @Author : QIAO import pandas as pd import numpy as np from sklearn.linear_model import LogisticRegression, SGDClassifier from sklearn.metrics import classification_report from sklearn.model_selection import train_test_split from sklearn.preprocessing import Standa...
JNero/road_to_Kaggle
breast-cancer/src/App.py
Python
apache-2.0
1,706
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2011 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you m...
sridevikoushik31/openstack
nova/virt/firewall.py
Python
apache-2.0
21,734
# Copyright 2014 Dan Kilman # # 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, softw...
dankilman/pysource
pysource/main.py
Python
apache-2.0
5,723
"""Authentication for HTTP component.""" import base64 import hmac import logging from aiohttp import hdrs from aiohttp.web import middleware import jwt from homeassistant.core import callback from homeassistant.const import HTTP_HEADER_HA_AUTH from homeassistant.auth.providers import legacy_api_password from homeas...
PetePriority/home-assistant
homeassistant/components/http/auth.py
Python
apache-2.0
6,270
# -------------------------------------------------------- # Deformable Convolutional Networks # Copyright (c) 2016 by Contributors # Copyright (c) 2017 Microsoft # Licensed under The Apache-2.0 License [see LICENSE for details] # Modified by Yuwen Xiong # -------------------------------------------------------- impor...
dhzhd1/road_obj_detect
rfcn/core/DataParallelExecutorGroup.py
Python
apache-2.0
24,555
# -*- coding: gbk -*- from telnetlib import Telnet import time from datetime import datetime line = ["ACP_1344_352", "ACP_2688_512", "ACP_4032_512", "ACP_5120_512", "ACP_5344_512", "ACP_6144_512", "ACP_7168_512", "ACP_8168_512"] down = [1344, 2688, 4032, 5120, 5344, 6144, 7168, 7168] up = [352, 512, 512, 512, 512, 512,...
flowsha/zhwh
apps/afpp/test3.py
Python
apache-2.0
1,414
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rest_server.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that ...
mehdi149/Learning-projects
rest-server/rest_server/manage.py
Python
apache-2.0
809
# 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 req...
kevin-zhaoshuai/zun
zun/tests/unit/scheduler/test_loadables.py
Python
apache-2.0
5,450
"""Home Assistant command line scripts.""" import argparse import asyncio import importlib import logging import os import sys from typing import List, Optional, Sequence, Text from homeassistant.bootstrap import async_mount_local_lib_path from homeassistant.config import get_default_config_dir from homeassistant.requ...
leppa/home-assistant
homeassistant/scripts/__init__.py
Python
apache-2.0
2,245
# Copyright 2013-2017 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agree...
ernestask/meson
mesonbuild/dependencies/dev.py
Python
apache-2.0
10,195
# 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
dedal/models/encoders.py
Python
apache-2.0
9,105
import types import os import re import logging import urllib import hmac import hashlib from urlparse import urlparse from email import header from datetime import timedelta, datetime from hashlib import sha256 import iso8601 import pymongo from pylons import c, g, request from ming import schema as S from ming impo...
leotrubach/sourceforge-allura
Allura/allura/model/auth.py
Python
apache-2.0
21,852
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Piston Cloud Computing, Inc. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
tealover/nova
nova/tests/unit/compute/test_compute.py
Python
apache-2.0
508,402
""" Seeder de l'application (génère un jeu d'essai aléatoire) """ from services import TravelService, CityService from models import City, Travel, Accomodation, Transport, Session from faker import Factory import random import datetime class Seeder: """ Seeder """ def __init__(self, number_of_cities...
MarvinDurot/travel_manager
seeder.py
Python
apache-2.0
3,107
#!/usr/bin/python import json import urllib2 import time import datetime import base64 import os import pstats import io class CBSTATSPULLER(): hostname = '127.0.0.1' port = '8091' debug = False cbNodeNameCheck = "" cbNodeName = [] username = "read-only" password = "password" logPath = ...
Fujio-Turner/cb-stats-demo
cb-stats-demo.py
Python
apache-2.0
6,657
#-*- coding: utf-8 -*- from . import register from spirit.models.comment_like import CommentLike from spirit.forms.comment_like import LikeForm @register.inclusion_tag('spirit/comment_like/_form.html') def render_like_form(comment, like, next=None): form = LikeForm() return {'form': form, 'comment_id': comme...
Si-elegans/Web-based_GUI_Tools
spirit/templatetags/tags/comment_like.py
Python
apache-2.0
642
# Copyright 2010 Jacob Kaplan-Moss # # 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 ...
xuweiliang/Codelibrary
novaclient/v2/images.py
Python
apache-2.0
7,303
# Copyright 2013 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 applicabl...
NeCTAR-RC/ceilometer
ceilometer/openstack/common/rpc/matchmaker_redis.py
Python
apache-2.0
4,818
from .models import db, User from m import Router from m.utils import jsonify router = Router(prefix='') @router.route('/', methods=['POST']) def home(ctx, request): name = request.json().get('name') user = User(name=name) db.session.add(user) try: db.session.commit() except Exception as ...
comynli/m
example/example/handlers.py
Python
apache-2.0
619
import random from behave import when, step, then, given from src.tests.behave.api.features.common.utils import ( get_entity_list_container_field, read_json_from_file, ) @when("I get the list of {service_name}") def step_i_get_the_list_of_service(context, service_name): """ :type context: behave.runn...
jr0d/mercury
src/tests/behave/api/features/steps/list.py
Python
apache-2.0
5,473
""" SlateQ (Reinforcement Learning for Recommendation) ================================================== This file defines the trainer class for the SlateQ algorithm from the `"Reinforcement Learning for Slate-based Recommender Systems: A Tractable Decomposition and Practical Methodology" <https://arxiv.org/abs/1905....
ray-project/ray
rllib/agents/slateq/slateq.py
Python
apache-2.0
8,298
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Ma' """ IOLoop 模型 自动适应不同的平台 """ import select class IOLoop(object): # 事件轮询的常数 _EPOLLIN = 0x001 _EPOLLPRI = 0x002 _EPOLLOUT = 0x004 _EPOLLERR = 0x008 _EPOLLHUP = 0x010 _EPOLLRDHUP = 0x2000 _EPOLLONESHOT = (1 << 30) _EPO...
logwood/SLS
ioloop.py
Python
apache-2.0
1,313
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
polyaxon/polyaxon
core/polyaxon/schemas/fields/int_or_str.py
Python
apache-2.0
1,188
"""pypyr step that merges the input mappings into context. Whereas contextcopy and contextsetf overwrites values that are in context already, contextmerge merges its input into context, preserving the existing hierarchy while just updating the values where specified in the contextmerge input. Applies string interpola...
pypyr/pypyr-cli
pypyr/steps/contextmerge.py
Python
apache-2.0
2,097
from json import loads as json_loads from django.views.generic import TemplateView from django.utils.html import strip_tags from django.shortcuts import redirect from django.contrib import messages from braces.views import LoginRequiredMixin from geokey.core.decorators import handle_exceptions_for_admin from geokey....
nagyistoce/geokey
geokey/subsets/views.py
Python
apache-2.0
6,874
import pandas as pd import scipy from pandas import DataFrame from scipy.sparse import issparse from sklearn.base import BaseEstimator, TransformerMixin from sklearn.preprocessing import RobustScaler, StandardScaler from scattertext.representations.Doc2VecBuilder import Doc2VecBuilder from scattertext.termscoring.Rank...
JasonKessler/scattertext
scattertext/categoryprojector/CategoryProjector.py
Python
apache-2.0
8,205
import os import unittest ROOT_PATH = os.path.dirname(__file__) class TestCase(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_unit_test(self): self.assertEqual(True,True,"Woah!")
AlienVault-Engineering/service-manager
src/unittest/resources/service_templates_test/pylib/{{cookiecutter.project_slug}}/src/unittest/python/core_tests.py
Python
apache-2.0
250
# Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
rackerlabs/horizon
openstack_dashboard/test/test_data/keystone_data.py
Python
apache-2.0
10,474
# Copyright (c) 2014 Dell Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
dims/cinder
cinder/tests/unit/test_dellsc.py
Python
apache-2.0
126,380
# # This file is part of pySMT. # # Copyright 2015 Andrea Micheli and Marco Gario # # 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 ...
pysmt/pysmt
pysmt/solvers/btor.py
Python
apache-2.0
23,813
# -*- coding: utf-8 -*- """The base32 decoder object implementation.""" import base64 import binascii from dfvfs.encoding import decoder from dfvfs.encoding import manager from dfvfs.lib import definitions from dfvfs.lib import errors class Base32Decoder(decoder.Decoder): """Class that implements a base32 decoder...
dc3-plaso/dfvfs
dfvfs/encoding/base32_decoder.py
Python
apache-2.0
1,023
import logging from flask import request, url_for, flash, redirect, make_response, jsonify, abort, session from flask.ext.mako import render_template from flask.ext.security import roles_accepted, current_user, login_required from wand.exceptions import WandError from .app import app from .models import db, Document...
Code4SA/mma-dexter
dexter/articles.py
Python
apache-2.0
22,211
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a ...
eharney/nova
nova/api/metadata/base.py
Python
apache-2.0
19,860
# vim: tabstop=5 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 OpenStack 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...
russellb/nova
nova/tests/api/openstack/compute/contrib/test_createserverext.py
Python
apache-2.0
17,838
def f(): n, factor = 600851475143, 2 while True: if n % factor == 0: n //= factor else: factor += 1 if factor * factor > n: return n elif n == 1: return factor import ctypes import sys CLOCK_MONOTONIC = 1 class timespec(ctypes...
japaric/eulermark.rs
problems/003/003.py
Python
apache-2.0
954
# Frequent Words Problem: Find the most frequent k-mers in a string. import sys def main(string, k): seq = {} highest = 0 for i in range(0, len(string)-k): dna_sub = string[i:i+k] if dna_sub in seq: seq[dna_sub] += 1 if highest < seq[dna_sub]: ...
yuriyshapovalov/Prototypes
Stepic/BioinformaticsAlgorithms/FrequentWords.py
Python
apache-2.0
589
######## # 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/constants.py
Python
apache-2.0
5,414
import hf import logging from dispatcher import Dispatcher from timeseries import timeseriesPlot, getTimeseriesUrl, getTimeseriesPlotConfig from customplot import customPlot, getCustomPlotUrl logger = logging.getLogger(__name__) def init(): """ Configure matplotlib backends by hf-configuration. Call before any p...
HappyFaceMonitoring/HappyFace
hf/plotgenerator/__init__.py
Python
apache-2.0
528