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 |
|---|---|---|---|---|---|
#
# 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... | nathanielvarona/airflow | tests/ti_deps/deps/test_dagrun_exists_dep.py | Python | apache-2.0 | 1,719 |
import os
import pytest
import ray
@pytest.mark.skipif("sys.platform != 'linux'")
def test_environ_file_on_linux(ray_start_10_cpus):
@ray.remote
class Actor1:
def __init__(self):
pass
def get_env_from_proc(self):
pid = os.getpid()
env = {}
with ... | pcmoritz/ray-1 | python/ray/tests/test_environ.py | Python | apache-2.0 | 1,082 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from pants_test.pants_run_integration_test import PantsRunIntegrationTest
class Scalast... | twitter/pants | tests/python/pants_test/tasks/test_scalastyle_integration.py | Python | apache-2.0 | 1,084 |
import os
import logging
import time
import requests
from staroid import Staroid
from kubernetes import client, config
import socket
from contextlib import closing
from uuid import uuid4
from kubernetes.client.rest import ApiException
from ray.autoscaler._private.staroid.command_runner import StaroidCommandRunner
fro... | richardliaw/ray | python/ray/autoscaler/_private/staroid/node_provider.py | Python | apache-2.0 | 15,357 |
from django.contrib import admin
from .models import Question
class QuestionForm(admin.ModelAdmin):
fieldsets = (
('Question Text', {
'fields': ('first_line',)
}),
('Additional Text', {
'fields': ('last_line',),
'classes': ('collapse',)
}),
... | learric/rivals_api | questions/admin.py | Python | apache-2.0 | 845 |
'''
Integration Test for down public network when public network is separated.
@author: SyZhao
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.node_operations as node_ops
im... | zstackorg/zstack-woodpecker | integrationtest/vm/mn_ha/test_sep_pub_1_mn_hst_pub_net_dwn_crt_vm.py | Python | apache-2.0 | 3,775 |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | pinterb/st2 | st2common/st2common/services/sensor_watcher.py | Python | apache-2.0 | 4,133 |
import pycuda.autoinit
import pycuda.driver as drv
import numpy
from pycuda.compiler import SourceModule
from jinja2 import Environment, PackageLoader
def main():
BankSize = 8 # Do not go beyond 8!
#Define constants
DimGridX = 19
DimGridY = 19
#SearchSpaceSize = 2**24
#BlockDimY = SearchSpac... | schroeder-dewitt/polyomino-self-assembly | test/SearchSpaceAdv/alpha-hash-ok/main.py | Python | apache-2.0 | 6,894 |
#!/usr/bin/env python
# Copyright 2017 gRPC 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... | firebase/grpc | tools/run_tests/python_utils/upload_test_results.py | Python | apache-2.0 | 7,511 |
"""Copyright 2008 Orbitz WorldWide
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... | krux/graphite-web | webapp/graphite/render/glyph.py | Python | apache-2.0 | 72,282 |
#!/usr/bin/env python
# Copyright 2016 neurodata (http://neurodata.io/)
#
# 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... | neurodata/blci | include/__init__.py | Python | apache-2.0 | 699 |
"""Support to help onboard new users."""
from homeassistant.core import callback
from homeassistant.helpers.storage import Store
from homeassistant.loader import bind_hass
from . import views
from .const import (
DOMAIN,
STEP_ANALYTICS,
STEP_CORE_CONFIG,
STEP_INTEGRATION,
STEP_USER,
STEPS,
)
S... | home-assistant/home-assistant | homeassistant/components/onboarding/__init__.py | Python | apache-2.0 | 2,140 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | les69/calvin-base | calvin/actorstore/systemactors/misc/ExplicitStateExample.py | Python | apache-2.0 | 2,590 |
from django.utils.translation import ugettext_lazy as _
from django import forms
#following koensblog.eu (both input and field)
class MultiFileInput(forms.FileInput):
def render(self, name, value, attrs={}):
attrs['multiple'] = 'multiple'
return super(MultiFileInput, self).render(name, None, attr... | cmunk/protwis | common/extensions.py | Python | apache-2.0 | 2,067 |
"""
Overridden syncdb command
"""
import sys
from optparse import make_option
from django.core.management.base import NoArgsCommand, BaseCommand
from django.core.management.color import no_style
from django.utils.datastructures import SortedDict
from django.core.management.commands import syncdb
from django.conf imp... | garnermccloud/OLD_DJANGO | south/management/commands/syncdb.py | Python | apache-2.0 | 3,778 |
#!/usr/bin/env python
'''
COPYRIGHT 2013 RPS ASA
This file is part of Wicken.
Wicken 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, either version 3 of the License, or
(at your option) any later... | ioos/wicken | wicken/xml_dogma.py | Python | apache-2.0 | 10,284 |
# Generated by Django 2.2.13 on 2020-06-26 14:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0032_data_migration'),
]
operations = [
migrations.AlterField(
model_name='value',
name='value_type',
... | DMPwerkzeug/DMPwerkzeug | rdmo/projects/migrations/0033_default_value_type.py | Python | apache-2.0 | 622 |
# -*- coding: utf-8 -*-
# Copyright 2014, Digital Reasoning
#
# 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... | clarkperkins/stackdio-python-client | stackdio/client/stack.py | Python | apache-2.0 | 5,007 |
"""Support for viewing the camera feed from a DoorBird video doorbell."""
import asyncio
import datetime
import logging
import aiohttp
import async_timeout
from homeassistant.components.camera import Camera
from homeassistant.components.doorbird import DOMAIN as DOORBIRD_DOMAIN
from homeassistant.helpers.aiohttp_clie... | nugget/home-assistant | homeassistant/components/doorbird/camera.py | Python | apache-2.0 | 2,879 |
# -*- 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/gapic-generator-python | tests/integration/goldens/logging/samples/generated_samples/logging_v2_generated_logging_service_v2_list_monitored_resource_descriptors_sync.py | Python | apache-2.0 | 1,580 |
# Copyright 2019 Nexenta 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 req... | openstack/cinder | cinder/volume/drivers/nexenta/ns5/jsonrpc.py | Python | apache-2.0 | 23,663 |
#!/usr/bin/env python
"""Configuration parameters for client builder and server packaging."""
import os
import time
from grr.lib import config_lib
from grr.lib import rdfvalue
from grr.lib import type_info
# Windows Memory driver information.
config_lib.DEFINE_string("MemoryDriver.driver_service_name",
... | statik/grr | config/build.py | Python | apache-2.0 | 17,066 |
#
# 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... | hvanhovell/spark | python/pyspark/pandas/tests/data_type_ops/testing_utils.py | Python | apache-2.0 | 7,827 |
# Copyright (c) 2012-2016 Seafile Ltd.
import logging
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from django.utils.translat... | miurahr/seahub | seahub/api2/endpoints/repo_send_new_password.py | Python | apache-2.0 | 3,479 |
# Copyright 2010-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... | shakamunyi/nova | nova/tests/unit/api/openstack/compute/test_versions.py | Python | apache-2.0 | 13,530 |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
""" Module for handling import and export of all workflow models """
from ggrc_... | prasannav7/ggrc-core | src/ggrc_workflows/converters/__init__.py | Python | apache-2.0 | 964 |
# coding: utf-8
#
# Copyright 2018 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... | brianrodri/oppia | core/domain/subtopic_page_services.py | Python | apache-2.0 | 9,591 |
import application
import config
import sys
app = application.create_app(config)
if __name__ == '__main__':
app.run(host='127.0.0.1', port=8080, debug=True)
| susnata1981/lendingclub | main.py | Python | apache-2.0 | 163 |
import sys
sys.path.insert(1, "../../")
import h2o
import pandas as pd
import numpy as np
def group_by(ip,port):
# Connect to a pre-existing cluster
h2o_iris = h2o.import_file(path=h2o.locate("smalldata/iris/iris_wheader.csv"))
pd_iris = pd.read_csv(h2o.locate("smalldata/iris/iris_wheader.csv"))
... | PawarPawan/h2o-v3 | h2o-py/tests/testdir_munging/pyunit_groupby.py | Python | apache-2.0 | 867 |
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | mahak/neutron | neutron/tests/unit/tests/functional/test_base.py | Python | apache-2.0 | 2,260 |
#!/usr/bin/env python
"""
Static Analyzer qualification infrastructure.
The goal is to test the analyzer against different projects, check for failures,
compare results, and measure performance.
Repository Directory will contain sources of the projects as well as the
information on how to build them and the expecte... | jeltz/rust-debian-package | src/llvm/tools/clang/utils/analyzer/SATestBuild.py | Python | apache-2.0 | 19,851 |
def predict_income(data={}):
""" Predictor for income from model/53603192ffa04466fd000977
https://archive.ics.uci.edu/ml/machine-learning-databases/adult/
"""
if (not 'marital_status' in data or data['marital_status'] is None):
return u'<=50K'
if (data['marital_status'] == 'Married-civ-... | bhtucker/impyla | examples/census/raw-models/model_1500.py | Python | apache-2.0 | 212,157 |
#!/usr/bin/python
# Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 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... | epall/selenium | common/test/py/api_examples.py | Python | apache-2.0 | 10,880 |
"""
MozTrap root URLconf.
"""
from django.conf.urls.defaults import patterns, url, include
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from moztrap.model import mtadmin
admin.site = mtadmin.MTAdminSite()
admin.autodiscover()
import session_csrf
ses... | bobsilverberg/moztrap | moztrap/view/urls.py | Python | bsd-2-clause | 1,609 |
#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from __future__ import unicode_literals
def configuration(parent_package='core', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('atoms', parent_package, top_path)
config.add_d... | scikit-nano/scikit-nano | sknano/core/atoms/setup.py | Python | bsd-2-clause | 475 |
# Generated by Django 2.1.8 on 2019-05-06 17:14
import django.contrib.postgres.fields
from django.db import migrations, models
feedback_emails_data = {}
def data_export(apps, schema_editor):
TethysApp = apps.get_model('tethys_apps', 'TethysApp')
for o in TethysApp.objects.raw('SELECT * FROM tethys_apps_tet... | tethysplatform/tethys | tethys_apps/migrations/0004_auto_20190506_1714.py | Python | bsd-2-clause | 1,301 |
from django.db import migrations
def create_iso_list(apps, schema_editor):
Bearing = apps.get_model('bearing', 'Bearing')
BearingISO = apps.get_model('bearing', 'BearingISO')
for name in list(set([item.iso for item in Bearing.objects.all()])):
iso = BearingISO(name=name)
iso.save()
class... | manti-by/POD | app/bearing/migrations/0016_create_iso_list.py | Python | bsd-3-clause | 502 |
from unittest import TestCase
from cartodb_services.refactor.storage.mem_config import InMemoryConfigStorage
class TestInMemoryConfigStorage(TestCase):
def test_can_provide_values_from_hash(self):
server_config = InMemoryConfigStorage({'any_key': 'any_value'})
assert server_config.get('any_key') =... | CartoDB/dataservices-api | server/lib/python/cartodb_services/test/refactor/storage/test_mem_config.py | Python | bsd-3-clause | 501 |
#
# Project:
# glideinWMS
#
# File Version:
#
import os,sys
from glideinwms.factory import glideFactoryInterface
glideFactoryInterface.factoryConfig.activity_log=sys.stdout
glideFactoryInterface.factoryConfig.warining_log=sys.stdout
glideFactoryInterface.advertizeGlidein("factory_name",
... | bbockelm/glideinWMS | factory/test_gfi.py | Python | bsd-3-clause | 820 |
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | VisTrails/VisTrails | vistrails/core/param_explore.py | Python | bsd-3-clause | 11,828 |
#!python
from __future__ import print_function
import time
from arduino_device import findArduinoDevicePorts
from arduino_olfactometer import ArduinoOlfactometers
from arduino_olfactometer import isOlfactometerPortInfo
from faa_actuation import PwmController
from faa_actuation import CurrentController
from faa_actuati... | JaneliaSciComp/fly-alcohol-assay | faa_actuation/src/faa_actuation/actuation.py | Python | bsd-3-clause | 2,123 |
#!/usr/bin/python2.4
# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Unit test suite that collects all test cases for GRIT.'''
import os
import sys
if __name__ == '__main__':
sys.path.append... | kuiche/chromium | tools/grit/grit/test_suite_all.py | Python | bsd-3-clause | 3,052 |
#!/usr/bin/env python
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
command += testshade("-g 256 256 -od uint8 -o Cspline color.tif -o DxCspline dcolor.tif -o Fspline float.tif -o DxFspline dflo... | imageworks/OpenShadingLanguage | testsuite/spline/run.py | Python | bsd-3-clause | 556 |
# Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
from django.conf import settings
from django.template.context import Context, RequestContext
from django.template.engine import _dirs_undefined, Engine
from .base import BaseEngine
class DjangoTemp... | iambibhas/django | django/template/backends/django.py | Python | bsd-3-clause | 1,651 |
# -*- coding: utf-8 -*-
import os
import nipype.interfaces.base as nib
from tempfile import mkdtemp
from shutil import rmtree
from nipype.testing import assert_equal
import nipype.pipeline.engine as pe
class InputSpec(nib.TraitedSpec):
input1 = nib.traits.Int(desc='a random int')
input2 = nib.traits.Int(desc... | carolFrohlich/nipype | nipype/pipeline/plugins/tests/test_linear.py | Python | bsd-3-clause | 1,540 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import OrderedDict
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.forms import widgets
from django.utils.translation import ugettext_lazy as _
from shop.models.notification import Notification, ... | jrief/django-shop | shop/admin/notification.py | Python | bsd-3-clause | 2,595 |
from __future__ import absolute_import, division, print_function
from . import IDataDescriptor, Capabilities
def blaze_func_iter(bfd, noiter_dims):
args = bfd.args
dim_size = 1
iters = []
for a, noiter in zip(args, noiter_dims):
if noiter:
iters.append(a)
else:
... | zeeshanali/blaze | blaze/datadescriptor/blaze_func_descriptor.py | Python | bsd-3-clause | 3,329 |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... | mxOBS/deb-pkg_trusty_chromium-browser | tools/gyp/pylib/gyp/generator/eclipse.py | Python | bsd-3-clause | 16,953 |
from django.contrib import admin
from django.contrib.admin.options import ModelAdmin
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core import mail
import mock
from nose.tools import eq_
import test_utils
from kitsune.forums.events import NewPostEvent, NewThreadE... | dbbhattacharya/kitsune | kitsune/forums/tests/test_notifications.py | Python | bsd-3-clause | 13,270 |
from browser import window
b_highchart = window.Highcharts.Chart.new
b_highchart({
'chart':{
'type': 'area',
'renderTo': 'container'
},
'title': {
'text': 'Historic and Estimated Worldwide Population Growth by Region'
},
'subtitle': {
'text': 'Source: Wikipedia.org'... | kikocorreoso/brython | www/gallery/highcharts/examples/area-stacked/chart.py | Python | bsd-3-clause | 1,524 |
#!/usr/bin/python2.6
# -*- coding: utf8 -*-
from __future__ import with_statement
"""
"""
__author__ = "Jerome Samson"
__copyright__ = "Copyright 2013, Mikros Image"
from fabric.api import *
from fabric.colors import green, blue
env.timeout = 5
env.disable_known_hosts = True
env.source_path = ''
env.target_path = ''... | mikrosimage/OpenRenderManagement | fabfile.py | Python | bsd-3-clause | 10,636 |
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't picklable (module imports are okay... | elena/django | docs/conf.py | Python | bsd-3-clause | 12,708 |
from django.http import HttpResponseRedirect
import apps.threads.views
from canvas.view_helpers import redirect_trailing, CommentViewData
@redirect_trailing
def share_detail(request, *args, **kwargs):
if request.user.is_authenticated():
view_data = CommentViewData(request, *args, **kwargs)
return ... | canvasnetworks/canvas | website/apps/share_page/views.py | Python | bsd-3-clause | 454 |
from sympy.core.basic import Basic, S, C, sympify, Wild
from sympy.core.function import Lambda, Function, Function
from sympy.core.cache import cacheit
from sympy.utilities.decorator import deprecated
class exp(Function):
nargs = 1
def fdiff(self, argindex=1):
if argindex == 1:
return s... | ryanGT/sympy | sympy/functions/elementary/exponential.py | Python | bsd-3-clause | 16,124 |
from distutils.core import setup
setup(
name='pipestash',
version='0.1.4',
author='GorillaNation',
author_email='noc@evolvemediallc.com',
packages=['pipestash', 'pipestash.output'],
scripts=['bin/pipestash'],
url='https://github.com/GorillaNation/pipestash',
license='LICENSE.txt',
d... | 1stone/pipestash | setup.py | Python | bsd-3-clause | 499 |
# -*- coding: utf-8 -*-
"""
website.vpn.dial.forms
~~~~~~~~~~~~~~~~~~~~~~
vpn forms:
/vpn/dial/add
/vpn/dial/settings
/vpn/dial/<int:id>/settings
"""
from flask_wtf import Form
from wtforms import StringField, SubmitField, TextAreaField, SelectField
from wtforms import ValidationE... | alibaba/FlexGW | website/vpn/dial/forms.py | Python | bsd-3-clause | 3,101 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that t... | ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/google/protobuf/internal/text_format_test.py | Python | mit | 68,043 |
from decimal import Decimal, InvalidOperation, ROUND_HALF_UP
import locale
from re import sub
import hashlib
from lib.filters import digest
NO_DECIMAL_PLACE = Decimal('1')
ONE_DECIMAL_PLACE = Decimal('0.1')
TWO_DECIMAL_PLACES = Decimal('0.01')
locale.setlocale(locale.LC_ALL, 'en_GB.utf-8')
path_prefix = '/'
asset... | gds-attic/transactions-explorer | lib/filters/__init__.py | Python | mit | 3,300 |
# Copyright 2017 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... | xuleiboy1234/autoTitle | tensorflow/tensorflow/python/eager/execute.py | Python | mit | 8,341 |
__author__ = 'girish'
from ghost import Ghost
ghost = Ghost()
USERNAME = "data"
PASSWORD = "data"
session = ghost.start()
page , resources = session.open("http://hackerrank.com/login",timeout=1000)
print(page.content)
session.fill("form",{
"username": USERNAME,
"password":PASSWORD
})
page, resources = ses... | girishramnani/hacking-tools | webioTools/formsubmitter.py | Python | mit | 387 |
# Python implementation of the MySQL client-server protocol
# http://dev.mysql.com/doc/internals/en/client-server-protocol.html
from __future__ import print_function
from ._compat import PY2, range_type, text_type, str_type, JYTHON, IRONPYTHON
import errno
from functools import partial
import os
import hashlib
import... | AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/pymysql/connections.py | Python | mit | 41,191 |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def binaryTreePaths(self, root):
"""
:type root: TreeNode
:rtype: List[str]
"""
l... | Mlieou/oj_solutions | leetcode/python/ex_257.py | Python | mit | 726 |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask import request
from indico.modules.api.controllers import (RHAPIAdminKeys, RHAPIAdminSettings,... | pferreir/indico | indico/modules/api/blueprint.py | Python | mit | 1,978 |
import sys
import os
from Tools.Profile import profile, profile_final
profile("PYTHON_START")
# Don't remove this line. It may seem to do nothing, but if removed,
# it will break output redirection for crash logs.
import Tools.RedirectOutput
import enigma
import eConsoleImpl
import eBaseImpl
enigma.eTimer = eBaseImpl.... | athoik/enigma2 | mytest.py | Python | gpl-2.0 | 17,551 |
"""
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
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, either version 3 of the License, or
(at your option) any later version.
This program is distribute... | SMALLplayer/smallplayer-image-creator | storage/.xbmc/addons/script.module.urlresolver/lib/urlresolver/plugins/veeHD.py | Python | gpl-2.0 | 4,492 |
# Copyright (C) 2001-2004 Python Software Foundation
# Contact: email-sig@python.org
# email package unit tests
import os
import sys
import time
import base64
import difflib
import unittest
import warnings
from cStringIO import StringIO
import email
from email.Charset import Charset
from email.Header import Header, ... | trivoldus28/pulsarch-verilog | tools/local/bas-release/bas,3.9-SunOS-i386/lib/python/lib/python2.4/email/test/test_email.py | Python | gpl-2.0 | 109,777 |
from versionutils.versioning.utils import is_versioned
from regions.models import Region
from pages.models import Page, PageFile
from redirects.models import Redirect
from tags.models import PageTagSet
from maps.models import MapData
def update_region_for_instance(m, region):
if not hasattr(m, 'region'):
... | evangeline97/localwiki-backend-server | localwiki/regions/utils.py | Python | gpl-2.0 | 3,683 |
# Copyright 2009 by Peter Cock. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Optimised sequence conversion code (PRIVATE).
You are not expected to access this module, or a... | updownlife/multipleK | dependencies/biopython-1.65/build/lib.linux-x86_64-2.7/Bio/SeqIO/_convert.py | Python | gpl-2.0 | 16,074 |
from nfs4_const import *
from environment import check
def testFile(t, env):
"""GETFH on testtree file
FLAGS: getfh file all
DEPEND: LOOKFILE
CODE: GF1r
"""
env.c1.do_getfh(env.opts.usefile)
def testDir(t, env):
"""GETFH on testtree dir
FLAGS: getfh dir all
DEPEND: LOOKDIR
... | srimalik/pynfs | nfs4.0/servertests/st_getfh.py | Python | gpl-2.0 | 1,538 |
from turbogears.util import load_class
import re
class Distro(object):
legacy_site_name = 'Fedora Mirror'
def __init__(self):
super(Distro, self).__init__()
glob_ns = globals()
classname = 'Base'
class_path = config.get('mirrormanager.distro', classname)
class_ = load... | squallsama/mirrormanager-rfr-fixed | server/mirrormanager/distros/base.py | Python | gpl-2.0 | 1,019 |
# Copyright (C) 2017 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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; either version 2 of the License, or
# ... | arichar6/veusz | veusz/dataimport/defn_fits.py | Python | gpl-2.0 | 20,315 |
# Copyright (C) 2011-2012 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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, either version 3 of the License, or (at you... | hcs/mailman | src/mailman/model/tests/test_uid.py | Python | gpl-3.0 | 1,472 |
"""Test class for Capsule Loadbalancer
:Requirement: Loadbalancer capsule
:CaseAutomation: ManualOnly
:CaseLevel: Integration
:CaseComponent: Capsule
:Assignee: akjha
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
@pytest.mark.stubbed
@pytest.mark.tier1
def initial_setup():
""... | SatelliteQE/robottelo | tests/foreman/longrun/test_capsule_loadbalancer.py | Python | gpl-3.0 | 7,911 |
import boto,sys,euca_admin,re
from boto.exception import EC2ResponseError
from euca_admin.generic import BooleanResponse
from euca_admin import EucaAdmin
from optparse import OptionParser
from string import split
SERVICE_PATH = '/services/Properties'
VERBOSE = False
class Property():
def __init__(self, propert... | Shebella/HIPPO | clc/tools/src/euca_admin/properties.py | Python | gpl-3.0 | 3,557 |
import os
import sys
# EDIT THE FOLLOWING TWO LINES
sys.path.append('/var/opt/vamdc/NodeSoftware/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'nodes.IDEADB.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| cpe/VAMDC-VALD | nodes/IDEADB/wsgi.py | Python | gpl-3.0 | 252 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | mrcslws/nupic.research | src/nupic/research/frameworks/vernon/distributed/experiments/supervised_experiment.py | Python | agpl-3.0 | 4,043 |
import csv
import StringIO
from tastypie.serializers import Serializer
class CsvHelper(Serializer):
formats = ['json', 'xml', 'csv']
content_types = {
'json': 'application/json',
'xml': 'application/xml',
'csv': 'text/csv',
}
def to_csv(self, data, options=None):
try:... | bryanph/OIPA | OIPA/api/v3/resources/csv_helper.py | Python | agpl-3.0 | 2,332 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-06-26 07:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0137_auto_20170620_1042'),
]
operations = [
migrations.AlterModelOptions(
... | uclouvain/OSIS-Louvain | base/migrations/0138_auto_20170626_0938.py | Python | agpl-3.0 | 614 |
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... | Rademade/taiga-back | taiga/external_apps/models.py | Python | agpl-3.0 | 3,477 |
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2019, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it unde... | mrcslws/nupic.research | packages/ray/src/nupic/research/frameworks/ray/ray_utils.py | Python | agpl-3.0 | 7,316 |
# Roundware Server is released under the GNU Affero General Public License v3.
# See COPYRIGHT.txt, AUTHORS.txt, and LICENSE.txt in the project root directory.
# Receives dbus signals from roundware/lib/server.py
from __future__ import unicode_literals
import dbus
from dbus.mainloop.glib import DBusGMainLoop
import js... | IMAmuseum/roundware-server | roundwared/dbus_receive.py | Python | agpl-3.0 | 1,506 |
#!/usr/bin/env python
from basetest import BaseTest
import os, sys, subprocess
import unittest
sys.path.insert(0, '..')
# (testing command support imports zeroinstall.injector._runenv in a sub-process)
os.environ['PYTHONPATH'] = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
mydir = os.path.abspath(os.p... | pombredanne/0install | tests/testrun.py | Python | lgpl-2.1 | 3,762 |
# This file is part of Aenea
#
# Aenea is free software: you can redistribute it and/or modify it under
# the terms of version 3 of the GNU Lesser General Public License as
# published by the Free Software Foundation.
#
# Aenea is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even ... | calmofthestorm/aenea | client/test/test_configuration.py | Python | lgpl-3.0 | 3,022 |
#!/usr/bin/env python
# coding: utf-8
import math
import fte.encoder
import marionette_tg.record_layer
MAX_CELL_LENGTH_IN_BITS = (2 ** 18) * 8
def send_async(channel, marionette_state, input_args):
send(channel, marionette_state, input_args, blocking=False)
return True
def recv_async(channel, marionette_... | irdan/marionette | marionette_tg/plugins/_fte.py | Python | apache-2.0 | 3,064 |
################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://svn.ecdf.ed.ac.uk/repo/inf/dnn_tts/
#
# Centre for Speech Technology Research
# ... | ronanki/merlin | src/configuration/examplelabelconfigfile.py | Python | apache-2.0 | 9,414 |
import datetime
from argparse import ArgumentParser
from typing import Any
from django.core.management.base import BaseCommand, CommandError
from django.utils.timezone import now as timezone_now
from zerver.models import Message, Realm, Stream, UserProfile, get_realm
class Command(BaseCommand):
help = "Generate... | shubhamdhama/zulip | analytics/management/commands/user_stats.py | Python | apache-2.0 | 1,718 |
# ----------------------------------------------------------------------------
# Copyright 2015 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.apache.o... | coufon/neon-distributed | tests/test_initializers.py | Python | apache-2.0 | 2,974 |
"""Support for IOTA wallets."""
import logging
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discovery import load_platform
from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['pyota==2.0.5']
_LOGGER = logging.getL... | HydrelioxGitHub/home-assistant | homeassistant/components/iota/__init__.py | Python | apache-2.0 | 1,923 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | mistercrunch/panoramix | tests/integration_tests/fixtures/public_role.py | Python | apache-2.0 | 1,469 |
#!/usr/bin/python
#
# 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 b... | coxmediagroup/googleads-python-lib | examples/dfp/v201502/user_service/get_all_roles.py | Python | apache-2.0 | 1,402 |
#
# 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... | lukecwik/incubator-beam | sdks/python/apache_beam/examples/complete/autocomplete.py | Python | apache-2.0 | 3,177 |
__author__ = 'Daniil Leksin'
| DaniilLeksin/gc | ui_gawrapper/__init__.py | Python | apache-2.0 | 29 |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme 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 ... | nzlosh/st2 | st2client/tests/unit/test_trace_commands.py | Python | apache-2.0 | 9,626 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Nebula, 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.or... | sridevikoushik31/openstack | nova/api/openstack/compute/contrib/server_password.py | Python | apache-2.0 | 3,027 |
######################################################################
# Cloud Routes Web Application
# -------------------------------------------------------------------
# DigitalOcean Droplet Status Check - Forms Class
######################################################################
from wtforms import TextFi... | Runbook/runbook | src/web/monitorforms/digitalocean-status/__init__.py | Python | apache-2.0 | 1,985 |
"""Support for Nest devices."""
import logging
from google_nest_sdm.event import EventMessage
from google_nest_sdm.exceptions import (
AuthException,
ConfigurationException,
GoogleNestException,
)
from google_nest_sdm.google_nest_subscriber import GoogleNestSubscriber
import voluptuous as vol
from homeas... | sander76/home-assistant | homeassistant/components/nest/__init__.py | Python | apache-2.0 | 7,094 |
# 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... | frreiss/tensorflow-fred | tensorflow/python/framework/python_memory_checker.py | Python | apache-2.0 | 5,163 |
import os
from segments import Segment, theme
from utils import colors
class Ssh(Segment):
bg = colors.background(theme.SSH_BG)
fg = colors.foreground(theme.SSH_FG) + colors.bold()
def init(self):
self.text = 'SSH'
if not os.getenv('SSH_CLIENT'):
self.active = False | nimiq/promptastic | segments/network.py | Python | apache-2.0 | 311 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
class CPUTargetUtilization(object):
"""
https://kubernetes.io/docs/api-reference/extensions/v1beta1/definitions/#_v1beta1_cputargetut... | mnubo/kubernetes-py | kubernetes_py/models/v1beta1/CPUTargetUtilization.py | Python | apache-2.0 | 1,131 |
# -*- coding: utf-8 -*-
"""
Functions to measure the synchrony of several spike trains.
Synchrony Measures
------------------
.. autosummary::
:toctree: _toctree/spike_train_synchrony/
spike_contrast
Synchrotool
:copyright: Copyright 2014-2020 by the Elephant team, see `doc/authors.rst`.
:license: Mod... | mdenker/elephant | elephant/spike_train_synchrony.py | Python | bsd-3-clause | 15,004 |