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 2014 Huawei Technologies Co. 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 applicable law or agreed... | baigk/compass-core | compass/deployment/utils/__init__.py | Python | apache-2.0 | 638 |
#!/usr/bin/env python
# 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 "Licen... | dtrodrigues/nifi-minifi-cpp | python/getFile.py | Python | apache-2.0 | 3,036 |
# Copyright 2013 PLUMgrid, 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 ... | onecloud/neutron | neutron/plugins/plumgrid/drivers/fake_plumlib.py | Python | apache-2.0 | 2,992 |
# Copyright 2014 CERN.
#
# 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... | openstack/python-openstackclient | openstackclient/tests/unit/identity/v3/test_protocol.py | Python | apache-2.0 | 6,982 |
############################################################################
# Joshua Boverhof<JRBoverhof@lbl.gov>, LBNL
# Monte Goode <MMGoode@lbl.gov>, LBNL
# See Copyright for copyright notice!
############################################################################
import exceptions, sys, optparse, os, warning... | sassoftware/catalog-service | catalogService/libs/viclient_vendor/ZSI/generate/commands.py | Python | apache-2.0 | 19,840 |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hp.com>
#
# 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/L... | richm/designate | designate/api/v2/__init__.py | Python | apache-2.0 | 1,327 |
"""
Module Resty
Date: November 25, 2013
Company: SwissTech Consulting.
Author: Patrick Glass <patrickglass@gmail.com>
Copyright: Copyright 2013 SwissTech Consulting.
This class implements a simple rest api framework for interfacing with the
Server via its REST API.
"""
__title__ = 'Resty'
__version__ = '0.1'
__autho... | patrickglass/Resty | resty/__init__.py | Python | apache-2.0 | 667 |
#########
# 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... | GigaSpaces-ProfessionalServices/cloudify-openstack-plugin | nova_plugin/userdata.py | Python | apache-2.0 | 1,696 |
from twython import Twython
from config import APP_KEY, APP_SECRET
def obtain_auth_url():
"""Used to app to tweet to my account
NOT CALLED ANYWHERE"""
twitter = Twython(APP_KEY, APP_SECRET)
auth = twitter.get_authentication_tokens()
oauth_token = auth['oauth_token']
oauth_token_secret = auth[... | BWeatherMaine/WXGIF | twitter.py | Python | apache-2.0 | 885 |
# 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... | tqchen/tvm | tests/python/relay/test_backend_compile_engine.py | Python | apache-2.0 | 9,932 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | mahak/keystone | keystone/common/validation/__init__.py | Python | apache-2.0 | 2,344 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
class Atan(Base):
@staticmethod
def export(): # type: () -> None
... | mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/onnx-tensorrt/third_party/onnx/onnx/backend/test/case/node/atan.py | Python | apache-2.0 | 767 |
# 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... | allenlavoie/tensorflow | tensorflow/python/layers/convolutional_test.py | Python | apache-2.0 | 50,372 |
"""Helpers for config validation using voluptuous."""
import inspect
import logging
import os
import re
from datetime import (timedelta, datetime as datetime_sys,
time as time_sys, date as date_sys)
from socket import _GLOBAL_DEFAULT_TIMEOUT
from typing import Any, Union, TypeVar, Callable, Sequen... | HydrelioxGitHub/home-assistant | homeassistant/helpers/config_validation.py | Python | apache-2.0 | 26,479 |
# Copyright 2011 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | onecloud/neutron | neutron/plugins/cisco/common/cisco_constants.py | Python | apache-2.0 | 2,838 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'ExecutionCommandServer.celery_task_id'
db.add_column(u'ta... | gunnery/gunnery | gunnery/task/migrations/0002_auto__add_field_executioncommandserver_celery_task_id.py | Python | apache-2.0 | 12,042 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import gettext
from enum import Enum, unique
_ = gettext.gettext
strategy_descriptions = [_("New resourcelist strategy"),
_("New changelist strategy"),
_("Incremental changelist strategy")]
@unique
class Strategy(Enum... | EHRI/rspub-core | rspub/core/rs_enum.py | Python | apache-2.0 | 3,776 |
# vim: tabstop=4 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... | tylertian/Openstack | openstack F/glance/glance/__init__.py | Python | apache-2.0 | 733 |
import os
import pickle
import random
import re
from datetime import datetime
from data_processing import (InteractiveAnswer, _in_list, colorit, space_fill,
split_wrd)
BOARDER_LENGTH = 40
class Quest():
def __init__(self, q, sel=None, ta=None, args={}):
'''
Class rep... | heyrict/exam | exam.py | Python | apache-2.0 | 16,883 |
# Copyright (c) 2011 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 ... | openstack/nova | nova/compute/utils.py | Python | apache-2.0 | 63,683 |
#!/usr/bin/env python
# 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... | ealegol/kolla-newton | tools/version-check.py | Python | apache-2.0 | 5,041 |
# Copyright 2012 Big Switch Networks, 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... | uni2u/neutron | neutron/plugins/bigswitch/plugin.py | Python | apache-2.0 | 39,750 |
__author__ = 'Tony Beltramelli - www.tonybeltramelli.com'
import string
import random
class Utils:
@staticmethod
def get_random_text(length_text=10, space_number=1, with_upper_case=True):
results = []
while len(results) < length_text:
char = random.choice(string.ascii_letters[:26]... | tonybeltramelli/pix2code | compiler/classes/Utils.py | Python | apache-2.0 | 1,382 |
"""
WSGI config for crowd_server project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "crowd_server.settings")
from dja... | codeaudit/ampcrowd | ampcrowd/crowd_server/wsgi.py | Python | apache-2.0 | 399 |
from __future__ import print_function
import os
import abc
import shelve
from pprint import pprint
from cloudmesh_base.tables import dict_printer
from cloudmesh_base.Shell import Shell
from cloudmesh_base.util import banner
from cloudmesh_base.util import path_expand
from cloudmesh_pbs.OpenPBS import OpenPBS
class... | rajpushkar83/pbs | cloudmesh_pbs/DbPBS.py | Python | apache-2.0 | 4,729 |
# Copyright 2011 Openstack, 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... | rcbops/nova-buildpackage | nova/api/openstack/compute/contrib/cloudpipe.py | Python | apache-2.0 | 5,929 |
# Copyright (C) 2013-2015 eNovance SAS <licensing@enovance.com>
#
# 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... | enovance/hardware | hardware/tests/test_matcher.py | Python | apache-2.0 | 21,360 |
# -*- coding: utf-8 -*-
# Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of FI-WARE project.
#
# 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://w... | Fiware/cloud.SDC | test/acceptance/e2e/install_product/terrain.py | Python | apache-2.0 | 3,017 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | nanditav/15712-TensorFlow | tensorflow/contrib/learn/python/learn/estimators/linear.py | Python | apache-2.0 | 31,382 |
"""TempDir module."""
import tempfile
import shutil
class TempDir:
"""Class creating and managing the temporary directories."""
def __init__(self, directory: str):
self.temp_dir = directory
@classmethod
def create(cls) -> "TempDir":
"""Initializes a TempDir object."""
temp_di... | exonum/exonum | test-suite/exonum-py-tests/suite/temp_dir.py | Python | apache-2.0 | 629 |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Lice... | AnshulYADAV007/Lean | Algorithm.Python/VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.py | Python | apache-2.0 | 3,155 |
# This file is part of Androguard.
#
# Copyright (C) 2012, Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# 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:/... | shuxin/androguard | androguard/decompiler/dad/opcode_ins.py | Python | apache-2.0 | 61,738 |
#
# Copyright (c) 2013-2020 Contributors to the Eclipse Foundation
#
# See the NOTICE file distributed with this work for additional information regarding copyright
# ownership. All rights reserved. This program and the accompanying materials are made available
# under the terms of the Apache License, Version 2.0 whic... | locationtech/geowave | python/src/main/python/pygw/store/cassandra/__init__.py | Python | apache-2.0 | 739 |
import sqlite3
FIELD_MAX_WIDTH = 20
TABLE_NAME = 'people'
SELECT = 'select * from %s order by age, name_last' % TABLE_NAME
con = sqlite3.connect("mydb")
cur = con.cursor()
cur.execute(SELECT)
# Print a header.
for fieldDesc in cur.description:
print(fieldDesc[0].ljust(FIELD_MAX_WIDTH), end=' ')
print() # Finish... | batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Doc/includes/sqlite3/simple_tableprinter.py | Python | apache-2.0 | 731 |
##############################################################################
#
# Copyright Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS ... | dcm-oss/blockade | blockade/tests/util.py | Python | apache-2.0 | 1,956 |
# 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... | nathanbjenx/cairis | cairis/test/test_UseCaseContribution.py | Python | apache-2.0 | 3,094 |
"""Auto-generated file, do not edit by hand. LY metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_LY = PhoneMetadata(id='LY', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2}', possible_length=(3,)),
em... | gencer/python-phonenumbers | python/phonenumbers/shortdata/region_LY.py | Python | apache-2.0 | 556 |
"""Support for Meteo-France raining forecast sensor."""
import logging
from meteofrance_api.helpers import (
get_warning_text_status_from_indice_color,
readeable_phenomenoms_dict,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.helpers... | tboyce021/home-assistant | homeassistant/components/meteo_france/sensor.py | Python | apache-2.0 | 7,140 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2018 João Pedro Rodrigues
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | JoaoRodrigues/pdb-tools | tests/test_pdb_chain.py | Python | apache-2.0 | 4,623 |
default_app_config = 'workflow.apps.WorkflowAppConfig'
| toladata/TolaActivity | workflow/__init__.py | Python | apache-2.0 | 55 |
"""Implement the auth feature from Hass.io for Add-ons."""
from ipaddress import ip_address
import logging
import os
from aiohttp import web
from aiohttp.web_exceptions import (
HTTPInternalServerError,
HTTPNotFound,
HTTPUnauthorized,
)
import voluptuous as vol
from homeassistant.auth.models import User
f... | Teagan42/home-assistant | homeassistant/components/hassio/auth.py | Python | apache-2.0 | 4,204 |
# 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 ... | OBIGOGIT/etch | binding-python/runtime/src/test/python/tests/binding/support/TestValidator_float.py | Python | apache-2.0 | 3,261 |
# -*- coding: utf-8 -*-
#
# 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 (... | apache/bloodhound | bloodhound_multiproduct/tests/resource.py | Python | apache-2.0 | 14,341 |
# 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 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | citrix-openstack/horizon | horizon/horizon/dashboards/nova/containers/tests.py | Python | apache-2.0 | 10,798 |
#! /usr/bin/env python2
# encoding:utf-8
# python 2.7 测试通过
# python 3 更换适当的开发库就能使用,在此我们不额外提供
import httplib
import json
import hashlib
import random
import time
import argparse
class SmsSingleSender:
""" 单发类定义"""
appid = 0
appkey = ""
url = "https://yun.tim.qq.com/v5/tlssmssvr/sendsms"
template = ... | TalkingData/owl | src/controller/scripts/actions/send_tencent_sms.py | Python | apache-2.0 | 5,749 |
from ilogue.fexpect.api import expect, controlchar, expecting, run, sudo, local
| ilogue/fexpect | ilogue/fexpect/__init__.py | Python | bsd-2-clause | 80 |
from django.shortcuts import get_object_or_404
from rest_framework.response import Response
from geotrek.api.v2 import serializers as api_serializers, viewsets as api_viewsets, filters as api_filters
from geotrek.authent import models as authent_models
class StructureViewSet(api_viewsets.GeotrekViewSet):
filter... | GeotrekCE/Geotrek-admin | geotrek/api/v2/views/authent.py | Python | bsd-2-clause | 891 |
from webtest import TestApp
import helloworld
import os
def test_index():
test_index.testbed.init_taskqueue_stub(task_retry_seconds=42, root_path=os.path.dirname(__file__))
app = TestApp(helloworld.app)
# fires off a task queue and should pass without exceptions
response = app.get('/')
assert 'Hel... | Trii/NoseGAE | examples/function_manual_config/test.py | Python | bsd-2-clause | 348 |
# -*- coding: UTF-8 -*-
# Copyright 2016-2017 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
from lino_xl.lib.tickets.models import *
from lino.api import _
Ticket.hide_elements('closed')
# class Ticket(Ticket):
# class Meta(Ticket.Meta):
# app_label = 'tickets'
# verbose_name = _(... | lino-framework/book | lino_book/projects/anna/lib/tickets/models.py | Python | bsd-2-clause | 1,862 |
# TODO inspect for Cython (see sagenb.misc.sageinspect)
from __future__ import print_function
from nose.plugins.skip import SkipTest
from nose.tools import assert_true
from os import path as op
import sys
import inspect
import warnings
import imp
from pkgutil import walk_packages
from inspect import getsource
import... | wronk/mne-python | mne/tests/test_docstring_parameters.py | Python | bsd-3-clause | 5,347 |
#!/usr/bin/env python
import argparse
import logging
import os
import tractconverter.info as info
import tractconverter
from tractconverter import FORMATS
from tractconverter import EXT_ANAT
# Script description
DESCRIPTION = """
TractInfo {0}.
Print info about a streamlines file.
Supported formats are {1}
""".forma... | MarcCote/tractconverter | scripts/TractInfo.py | Python | bsd-3-clause | 1,223 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import importlib
from django.apps import apps
def get_seo_views(metadata_class):
return get_view_names(metadata_class._meta.seo_views)
def get_view_names(seo_views):
output = []
for name in seo_views:
try:
app = apps.get_app_config(name)... | tangochin/django-seo | djangoseo/systemviews.py | Python | bsd-3-clause | 835 |
import ui_plot
import sys
import numpy
from PyQt4 import QtCore, QtGui
import PyQt4.Qwt5 as Qwt
from recorder import *
def plotSomething():
if SR.newAudio==False:
return
xs,ys=SR.fft()
c.setData(xs,ys)
uiplot.qwtPlot.replot()
SR.newAudio=False
if __name__ == "__main__":... | LucidBlue/mykeepon-storyteller | src/realTimeAudio.py | Python | bsd-3-clause | 1,209 |
"""
Our version of sphinx-apidoc
@author : Spencer Lyon
@date : 2014-07-16
This file should be called from the command line. It accepts one
additional command line parameter. If we pass the parameter `single`
when running the file, this file will create a single directory named
modules where each module in quantecon ... | QuantEcon/QuantEcon.py | docs/qe_apidoc.py | Python | bsd-3-clause | 10,122 |
from __future__ import division, print_function
import numpy as np
import nose.tools as nt
import regreg.api as rr
from ..group_lasso import (group_lasso,
selected_targets,
full_targets,
debiased_targets)
from ...tests.instance import... | selective-inference/selective-inference | selectinf/randomized/tests/test_group_lasso.py | Python | bsd-3-clause | 10,569 |
from __future__ import print_function
import os
import sys
import math
import collections
import numpy as np
import flopy
import matplotlib.pyplot as plt
# --modify default matplotlib settings
updates = {'font.family': ['Univers 57 Condensed', 'Arial'],
'mathtext.default': 'regular',
'pdf.com... | bdestombe/flopy-1 | examples/scripts/flopy_swi2_ex5.py | Python | bsd-3-clause | 15,804 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
import roslib; roslib.load_manifest('zaber_stage')
import rospy
import actionlib
from geometry_msgs.msg import Pose
from zaber_stage.msg import PoseAndDebugInfo
from zaber_stage.srv import GetPoseAndDebugInfo,GetPoseAndDebugInfoResponse
def pose_publisher():
rospy... | janelia-ros/zaber_stage_ros | nodes/pose_and_debug_publisher.py | Python | bsd-3-clause | 1,472 |
from django.http import QueryDict
from django_facebook import settings as facebook_settings
def generate_oauth_url(scope=facebook_settings.FACEBOOK_DEFAULT_SCOPE,
next=None, extra_data=None):
query_dict = QueryDict('', True)
canvas_page = (next if next is not None else
... | fogcitymarathoner/djfb | facebook_example/django_facebook/canvas.py | Python | bsd-3-clause | 728 |
# -*- coding: utf-8 *-*
from pyglet.window import key
from pyglet import clock
from . import util, physicalobject
from . import resources
class Ship(physicalobject.PhysicalObject):
"""A class for the player"""
def __init__(self, thrust_image=None, *args, **kwargs):
super().__init__(*args, **kwargs)
... | mammadori/asteroids | game/ship.py | Python | bsd-3-clause | 3,293 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from acl.models import Role
from communities.models import Community, CommunityGroup, Committee, CommunityGroupRole
from django.db import models, migrations
def create_default_groups(apps, schema_editor):
Membership = apps.get_model("users", "Members... | nonZero/OpenCommunity | src/users/migrations/0003_auto_20150607_1606.py | Python | bsd-3-clause | 2,009 |
# -*- coding: utf-8 -*-
"""
wakatime.offlinequeue
~~~~~~~~~~~~~~~~~~~~~
Queue for saving heartbeats while offline.
:copyright: (c) 2014 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
import logging
import os
from time import sleep
from .compat import json
from .constants import ... | wakatime/komodo-wakatime | components/wakatime/offlinequeue.py | Python | bsd-3-clause | 3,427 |
import chainer
import chainer.functions as F
import chainer.links as L
class Alex(chainer.Chain):
"""Single-GPU AlexNet without partition toward the channel axis."""
def __init__(self, n_class=1000, threshold=0.5, pt_func=None):
self.threshold = threshold
self.pt_func = pt_func
self.... | start-jsk/jsk_apc | demos/selective_dualarm_stowing/python/selective_dualarm_stowing/models/alex.py | Python | bsd-3-clause | 4,007 |
"""This test checks for correct fork() behavior.
"""
import _imp as imp
import os
import signal
import sys
import threading
import time
import unittest
from test.fork_wait import ForkWait
from test.support import reap_children, get_attribute, verbose
# Skip test if fork does not exist.
get_attribute(os, 'fork')
cl... | kikocorreoso/brython | www/src/Lib/test/test_fork1.py | Python | bsd-3-clause | 3,761 |
#!/usr/bin/env python3
# Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
from contextlib import ExitStack
import subprocess
import sys
import utils
def M... | dart-lang/sdk | tools/run_with_coredumps_enabled.py | Python | bsd-3-clause | 627 |
from django.conf import settings
from django.views.generic.dates import ArchiveIndexView, DateDetailView, DayArchiveView, MonthArchiveView, YearArchiveView
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from .models import Photo, Gallery
# Number of galleries to displ... | MathieuDuponchelle/my_patched_photologue | photologue/views.py | Python | bsd-3-clause | 2,340 |
from weld.grizzly.core.frame import GrizzlyDataFrame
from weld.grizzly.core.series import GrizzlySeries
| weld-project/weld | weld-python/weld/grizzly/__init__.py | Python | bsd-3-clause | 105 |
# Copyright (c) 2010, Mats Kindahl, Charles Bell, and Lars Thalmann
# All rights reserved.
#
# Use of this source code is goverened by a BSD licence that can be
# found in the LICENCE file.
from mysql.replicant.server import Server
from mysql.replicant.common import User
from mysql.replicant.machine import Linux
from ... | mrramazani/mysql-replicant-python-1 | lib/tests/deployment/simple.py | Python | bsd-3-clause | 2,759 |
"""
Plugin: Slideshow
*****************
This plugin allows you to put a slideshow on a page, automatically
displaying the selected image files with customizable transitions and
intervals.
Installation
============
To use this plugin, put ``media_tree.contrib.cms_plugins.media_tree_slideshow``
in your installed app... | bittner/django-media-tree | media_tree/contrib/cms_plugins/media_tree_slideshow/__init__.py | Python | bsd-3-clause | 903 |
__author__ = 'frank'
import json
from BaseObject import BaseObject
from Requestor import process_request
class WalletName(BaseObject):
"""
Wallet Name object
:param domain_name: Domain name that Wallet Name should be associated with.
:param name: Unique name for this Wallet Name prefixed to your do... | netkicorp/python-partner-client | netki/WalletName.py | Python | bsd-3-clause | 4,099 |
'''
Hom family of models based on: [Drukker2013]_
Following: [Anselin2011]_
'''
__author__ = "Luc Anselin luc.anselin@asu.edu, Daniel Arribas-Bel darribas@asu.edu"
from scipy import sparse as SP
import numpy as np
from numpy import linalg as la
import ols as OLS
from pysal import lag_spatial
from utils import power... | ljwolf/pysal | pysal/spreg/error_sp_hom.py | Python | bsd-3-clause | 57,745 |
from flask import Flask
from flask.ext.admin import Admin, BaseView, expose
class MyView(BaseView):
@expose('/')
def index(self):
return self.render('index.html')
app = Flask(__name__)
admin = Admin(app)
admin.add_view(MyView(name='Hello'))
app.run()
| 0atman/flask-admin | examples/quickstart/second.py | Python | bsd-3-clause | 272 |
print('Importing command definitions...')
from jycraft.plugin.interpreter import PyContext
from org.bukkit import Bukkit
from org.bukkit import Location
from org.bukkit import Material
from org.bukkit import Effect
from org.bukkit.command import Command
from org.bukkit.event import Listener, EventPriority
from rando... | Jycraft/jycraft-server-plugin | python/spigot/mcapi.py | Python | bsd-3-clause | 7,416 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-12 08:41
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('cases',... | ad-m/foundation-manager | foundation/cases/migrations/0002_auto_20160512_1041.py | Python | bsd-3-clause | 888 |
from flask import Flask, redirect, url_for, session, request
from flask_oauthlib.client import OAuth, OAuthException
FACEBOOK_APP_ID = '188477911223606'
FACEBOOK_APP_SECRET = '621413ddea2bcc5b2e83d42fc40495de'
app = Flask(__name__)
app.debug = True
app.secret_key = 'development'
oauth = OAuth(app)
facebook = oauth... | Fleurer/flask-oauthlib | example/facebook.py | Python | bsd-3-clause | 1,663 |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailcore", "0016_change_page_url_path_to_text_field"),
]
operations = [
migrations.AlterField(
model_name="grouppagepermission",
name="per... | rsalmaso/wagtail | wagtail/core/migrations/0017_change_edit_page_permission_description.py | Python | bsd-3-clause | 771 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import sentry.db.models.fields.gzippeddict
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Nod... | beeftornado/sentry | src/sentry/nodestore/migrations/0001_initial.py | Python | bsd-3-clause | 654 |
"""
Roleplaying base system for Evennia
Contribution - Griatch, 2015
This module contains the ContribRPObject, ContribRPRoom and
ContribRPCharacter typeclasses. If you inherit your
objects/rooms/character from these (or make them the defaults) from
these you will get the following features:
- Objects/Rooms will... | shollen/evennia | evennia/contrib/rpsystem.py | Python | bsd-3-clause | 43,810 |
from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from sentry.models import Project, Team
from sentry.web.forms.add_project import AddProjectForm
from sentry.web.frontend.base import OrganizationView
from sentry.utils.http ... | nicholasserra/sentry | src/sentry/web/frontend/create_project.py | Python | bsd-3-clause | 2,910 |
##########################################################################
#
# Copyright (c) 2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | chippey/gaffer | python/GafferDispatch/__init__.py | Python | bsd-3-clause | 2,275 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | stonebig/bokeh | bokeh/io/tests/test_notebook.py | Python | bsd-3-clause | 5,073 |
"""setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
import sys, os, marshal
from setuptools import Command
from distutils.dir_util import remove_tree, mkpath
try:
from distutils.sysconfig import get_python_version, get_python_lib
except ImportError:
... | mayankcu/Django-social | venv/Lib/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.py | Python | bsd-3-clause | 18,594 |
import sublime
import sublime_plugin
import json
from threading import Thread
from ..lib.ycmd_handler import server
from ..lib.utils import *
from ..lib.msgs import MsgTemplates
class CppYCMHighlightProblemsListener(sublime_plugin.EventListener):
def on_selection_modified_async(self, view):
if not is_cp... | glymehrvrd/CppYCM | listeners/highlight_problems.py | Python | mit | 902 |
from biicode.common.model.cells import SimpleCell
from biicode.common.model.dependency_set import DependencySet
from biicode.common.model.brl.block_name import BlockName
from biicode.common.model.symbolic.block_version_table import BlockVersionTable
from biicode.common.model.blob import Blob
from biicode.common.model.r... | zhangf911/common | edition/block_holder.py | Python | mit | 6,717 |
# -*- coding: utf-8 -*-
import codecs
import logging
import os
import chardet
import pysrt
from .video import Episode, Movie
from .utils import sanitize, sanitize_release_group
logger = logging.getLogger(__name__)
#: Subtitle extensions
SUBTITLE_EXTENSIONS = ('.srt', '.sub', '.smi', '.txt', '.ssa', '.ass', '.mpl')... | neo1691/subliminal | subliminal/subtitle.py | Python | mit | 8,191 |
"""
tnetstring: data serialization using typed netstrings
======================================================
This is a custom Python 3 implementation of tnetstrings.
Compared to other implementations, the main difference
is that this implementation supports a custom unicode datatype.
An ordinary tnetstring is a ... | dufferzafar/mitmproxy | mitmproxy/contrib/tnetstring.py | Python | mit | 8,799 |
import os
import sys
import time
import types
ltime = 1 and time.localtime()
logSuffix = '%02d%02d%02d_%02d%02d%02d' % (ltime[0] - 2000, ltime[1], ltime[2],
ltime[3], ltime[4], ltime[5])
logfile = 'toontownD-' + logSuffix + '.log'
class LogAndOutput:
def __init__(self,... | Spiderlover/Toontown | toontown/launcher/ToontownLauncher.py | Python | mit | 8,767 |
from RockStar import RockStar
facefuck_code = (":) :) :) :) :) :) :) :) :) :)\n=(\n:> :) :) :) :) :) :) :) :> :) :) :) :) :) :) :) :) :) :) :> :) :) :) :> :) :< :< :< :< :(\n"
"=)\n:> :) :) :P\n:> :) :P\n:) :) :) :) :) :) :) :P\n"
":P\n:) :) :) :P\n:> :) :) :P\n:< :< :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) ... | johniek/meteor-rock | examples/facefuck_rockstar.py | Python | mit | 533 |
import time
import json
import datetime
import urllib
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
from django_dynamic_fixture import G
from django.utils.dateformat import format
from .utils import datetime_to_timestamp, timestamp_to_datetime
from .models import Message, Chann... | sirodoht/ting | API/chat/tests.py | Python | mit | 24,874 |
__author__ = 'dkador'
class BasePersistenceStrategy(object):
"""
A persistence strategy is responsible for persisting a given event
somewhere (i.e. directly to Keen, a local cache, a Redis queue, etc.)
"""
def persist(self, event):
"""Persists the given event somewhere.
:param ev... | isotoma/KeenClient-Python | keen/persistence_strategies.py | Python | mit | 1,595 |
# coding=utf-8
config = {
'timeout': 10,
'db_user': '', # mongodb的用户名
'db_pass': '', # mongodb的密码
'db_host': 'localhost',
'db_port': 27017,
'db_name': 'novelRS',
'cpu_num': 4 # 开几个进程计算
}
| nladuo/novelRS | web_demo/lib/config.py | Python | mit | 273 |
# debugshell extension
"""a python shell with repo, changelog & manifest objects"""
import mercurial
import code
def debugshell(ui, repo, **opts):
objects = {
'mercurial': mercurial,
'repo': repo,
'cl': repo.changelog,
'mf': repo.manifest,
}
bannermsg = "loaded repo : %s\n"... | iaddict/mercurial.rb | vendor/mercurial/contrib/debugshell.py | Python | mit | 533 |
from chainer import cuda
from chainer import function
from chainer.utils import type_check
class Sum(function.Function):
"""Sum of array elements over a given axis."""
keepdims = False
def __init__(self, axis=None, keepdims=False):
if axis is None:
self.axis = None
elif isins... | kiyukuta/chainer | chainer/functions/math/sum.py | Python | mit | 2,814 |
"""
The "engine room" of django mailer.
Methods here actually handle the sending of queued messages.
"""
from django_mailer import constants, models, settings
from lockfile import FileLock, AlreadyLocked, LockTimeout
from socket import error as SocketError
import logging
import os
import smtplib
import tempfile
impo... | selwin/django-mailer | django_mailer/engine.py | Python | mit | 7,863 |
import JeevesLib
from smt.Z3 import *
import unittest
from RSphaeroides import RSphaeroides
import JeevesLib
class TestAuction(unittest.TestCase):
def setUp(self):
JeevesLib.init()
def test_something(self):
r = RSphaeroides()
pass
| jonathanmarvens/jeeves | test/gallery/proteinsignal/testChemotaxis.py | Python | mit | 249 |
# -*- coding: utf-8 -*-
'''
Tulip routine libraries, based on lambda's lamlib
Author Twilight0
License summary below, for more details please read license.txt file
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License... | felipenaselva/felipe.repository | script.module.streamhub/resources/premium/modules/control.py | Python | gpl-2.0 | 3,906 |
# Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Participatory Culture Foundation
#
# 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; eithe... | debugger06/MiroX | tv/lib/frontends/widgets/watchedfolders.py | Python | gpl-2.0 | 3,503 |
from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService
from Components.Element import cached
from Tools.Transponder import ConvertToHumanReadable
class ServiceInfo(Converter, object):
HAS_TELETEXT = 0
IS_MULTICHANNEL = 1
IS_CRYPTED = 2
IS_WIDESCREEN = 3
SUBSE... | BlackPole/bp-enigma2 | lib/python/Components/Converter/ServiceInfo.py | Python | gpl-2.0 | 6,815 |
#!/usr/bin/python
from time import time
REPS = 17500
def insert():
m = [None]
i = 0
now = time()
while i < REPS:
m.insert(0, i)
i += 1
print 'Elapsed (insert):', time() - now
def colonZero():
m = [None]
i = 0
now = time()
while i < REPS:
m[:0] = [i]
i += 1
print 'Elapsed (... | opensvn/test | src/study/python/cpp/ch06/alt/insertVsColonZero.py | Python | gpl-2.0 | 442 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Donald N. Allingham
# Copyright (C) 2009 Douglas S. Blank
# Copyright (C) 2011 Tim G L Lyons
#
# 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
# ... | jralls/gramps | gramps/gui/plug/quick/_quicktable.py | Python | gpl-2.0 | 18,614 |
# CircularLayout.py
# Copyright (C) 2009 Matthias Treder
#
# 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
# (at your option) any later version.
#
# This pro... | bbci/pyff | src/lib/P300Layout/CircularLayout.py | Python | gpl-2.0 | 1,596 |