code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# Copyright 2021 Google 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | tensorflow/tfx | tfx/dsl/input_resolution/strategies/latest_blessed_model_strategy_test.py | Python | apache-2.0 | 2,902 |
"""One-time script for extracting all the cat and dog images from CIFAR-10."""
import cPickle
import numpy as np
from PIL import Image
TRAIN_FILES = ['cifar-10-batches-py/data_batch_%d' % i for i in range(1,6)]
TEST_FILE = 'test_batch'
CAT_INPUT_LABEL = 3
DOG_INPUT_LABEL = 5
CAT_OUTPUT_LABEL = 1
DOG_OUTPUT_LABEL = ... | random-forests/tensorflow-workshop | archive/extras/cat_dog_estimator/extract_cats_dogs.py | Python | apache-2.0 | 1,545 |
from copy import deepcopy
from datetime import datetime
from datetime import timezone
from email.utils import mktime_tz
from email.utils import parsedate_tz
from io import BytesIO
from itertools import chain
from mimetypes import guess_type
from typing import Callable
from typing import Iterable
from typing import List... | ascoderu/opwen-cloudserver | opwen_email_server/utils/email_parser.py | Python | apache-2.0 | 7,047 |
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Rackspace Hosting Inc. All Rights Reserved.
# Copyright (C) 2013 Yahoo! 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... | citrix-openstack-build/taskflow | taskflow/atom.py | Python | apache-2.0 | 6,234 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 Canonical 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
... | yrobla/nova | nova/tests/test_vmwareapi_vm_util.py | Python | apache-2.0 | 5,302 |
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | platformio/platformio | tests/test_misc.py | Python | apache-2.0 | 1,489 |
../common/cgi_runtests.py | ankurjimmy/catawampus | tr/vendor/tornado/maint/appengine/py27/cgi_runtests.py | Python | apache-2.0 | 25 |
from PIL import Image
import os.path,os
#import pickle
#import sqlite3
import hashlib
import time
import random
import logging
import copy
import threading
import itertools
from math import ceil
from enum import Enum
from copy import deepcopy
import itertools
from lipyc.utility import recursion_protect
from lipyc.Ver... | severus21/LiPyc | src/Album.py | Python | apache-2.0 | 4,909 |
# 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... | yajiedesign/mxnet | tests/python/unittest/test_operator.py | Python | apache-2.0 | 407,016 |
__author__ = 'Keiran'
from model.contact import Contact
import pytest
def test_contact_compare(app, orm):
with pytest.allure.step('Given a sorted contact list from DB'):
contacts_from_db = orm.get_contact_list()
sorted_contacts_from_db = list(sorted(contacts_from_db, key=Contact.id_or_max))
wi... | IKeiran/FPT-Sinyakov | test/test_contact_compare.py | Python | apache-2.0 | 993 |
import os
import time
import json
import pprint
from util import hook
def readConfig():
### Read config json and parse it
confJson = None
with open(os.getcwd() + '/antiFloodBotConfig.json', 'r') as confFile:
confJson = confFile.read()
return json.loads(confJson)
inputs = {} #store time (uni... | mrok/ircAntiFloodBot | src/antiFloodBot.py | Python | apache-2.0 | 2,562 |
# Copyright (c) 2013 Facebook
#
# 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,... | lyft/huxley | huxley/steps.py | Python | apache-2.0 | 6,736 |
# Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | nuagenetworks/tempest | tempest/api/network/test_dhcp_ipv6.py | Python | apache-2.0 | 18,551 |
"""
WSGI config for server_proj project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATIO... | uw-it-aca/scout-vagrant | provisioning/templates/sample.wsgi.py | Python | apache-2.0 | 1,364 |
#!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, 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... | sullivanmatt/splunk-sdk-python | tests/test_storage_passwords.py | Python | apache-2.0 | 9,282 |
# Copyright 2016 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | google/openhtf | test/core/monitors_test.py | Python | apache-2.0 | 3,303 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# module builder script
#
import os, sys, shutil, tempfile, subprocess, platform
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
support_dir = os.path.join(template_dir, 'support')
sdk_dir = os.path.dirname(template_dir)
android_suppo... | arnaudsj/titanium_mobile | support/module/builder.py | Python | apache-2.0 | 7,110 |
"""
Asciimatics is a package to help people create full-screen text UIs (from interactive forms to
ASCII animations) on any platform. It is licensed under the Apache Software Foundation License 2.0.
"""
__author__ = 'Peter Brittain'
try:
from .version import version
except ImportError:
# Someone is running st... | peterbrittain/asciimatics | asciimatics/__init__.py | Python | apache-2.0 | 414 |
#
# Copyright 2014 Infoxchange Australia
#
# 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... | infoxchange/docker-forklift | forklift/registry.py | Python | apache-2.0 | 1,142 |
# 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, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
... | tejal29/pants | src/python/pants/backend/codegen/tasks/jaxb_gen.py | Python | apache-2.0 | 6,748 |
def test_delite_group(app):
app.session.login( username="admin", password="secret")
app.group.delete_first_group()
app.session.logout()
if __name__ == '__main__':
pytest.main('test_del_group.py') | Alex-Chizhov/python_training | home_work_6/test/test_del_group.py | Python | apache-2.0 | 201 |
import getpass
import json
import getopt
from genericpath import isfile
from os.path import sep
from pingdumb.main_module import url_type
def read_config():
f_path = "." + sep + "pingdumb.json"
if not isfile(f_path):
f = open(f_path, 'w')
conf = {
"url": "jellyms.kr",
... | kyunooh/pingdumb | pingdumb/conf.py | Python | apache-2.0 | 2,422 |
"""Cache util functions for ReSDKTables."""
import os
import pickle
import sys
from shutil import rmtree
from typing import Any
from resdk.__about__ import __version__
def _default_cache_dir() -> str:
"""Return default cache directory specific for the current OS.
Code originally from Orange3.misc.environ.
... | genialis/resolwe-bio-py | src/resdk/utils/table_cache.py | Python | apache-2.0 | 2,205 |
import sys
import threading
import time
io_lock = threading.Lock()
blocker = threading.Lock()
def block(i):
t = threading.current_thread()
with io_lock:
print('{} with ident {} going to sleep'.format(
t.name, t.ident))
if i:
blocker.acquire() # acquired but never released
... | jasonwee/asus-rt-n14uhp-mrtg | src/lesson_runtime_features/sys_current_frames.py | Python | apache-2.0 | 1,093 |
# -*- coding: utf-8 -*-
import nose.tools as ns
import os
from os.path import join
from tempfile import gettempdir
from relshell.record import Record
from relshell.recorddef import RecordDef
from relshell.batch import Batch
from shellstreaming.core.batch_queue import BatchQueue
from shellstreaming.ostream.localfile imp... | laysakura/shellstreaming | test/ostream/test_localfile.py | Python | apache-2.0 | 1,074 |
#!/usr/bin/env python
import imp
import os
import sys
PYCART_DIR = ''.join(['python-', '.'.join(map(str, sys.version_info[:2]))])
try:
zvirtenv = os.path.join(os.environ['OPENSHIFT_HOMEDIR'], PYCART_DIR,
'virtenv', 'bin', 'activate_this.py')
execfile(zvirtenv, dict(__file__ = zvirtenv... | getupcloud/openshift-nginx-python-2.7 | app.py | Python | apache-2.0 | 1,287 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2013 OpenStack Foundation
# Copyright 2013 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not ... | openstack/glance | glance/db/sqlalchemy/metadata.py | Python | apache-2.0 | 17,923 |
"""
Google Analytics template tags and filters.
"""
from __future__ import absolute_import
import re
from django.template import Library, Node, TemplateSyntaxError
from templatetags.utils import is_internal_ip, disable_html, get_required_setting
SCOPE_VISITOR = 1
SCOPE_SESSION = 2
SCOPE_PAGE = 3
PROPERTY_ID_RE = ... | linkedin/indextank-service | storefront/templatetags/google_analytics.py | Python | apache-2.0 | 2,712 |
#!/usr/bin/env python
import glob
import cv2
import cv_bridge
import rospy
from sensor_msgs.msg import Image
from std_msgs.msg import Int32, Float32
import rospkg
import sys
class Animation:
def __init__(self, directory):
self.fnames = [fname for fname in glob.glob("%s/*" % directory)]
self.fnames... | UCRoboticsLab/BaxterTictactoe | src/baxter_tictactoe/scripts/animator_server.py | Python | apache-2.0 | 4,046 |
import asyncio
import sys
import traceback
import pytest
from pykka import Future, Timeout, get_all
def run_async(coroutine):
loop = asyncio.get_event_loop()
f = asyncio.ensure_future(coroutine, loop=loop)
return loop.run_until_complete(f)
def test_base_future_get_is_not_implemented():
future = Fu... | jodal/pykka | tests/test_future.py | Python | apache-2.0 | 6,910 |
# yellowbrick.model_selection
# Visualizers that wrap the model selection libraries of Scikit-Learn
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Fri Mar 30 10:36:12 2018 -0400
#
# ID: __init__.py [c5355ee] benjamin@bengfort.com $
"""
Visualizers that wrap the model selection libraries of Scikit-Le... | DistrictDataLabs/yellowbrick | yellowbrick/model_selection/__init__.py | Python | apache-2.0 | 818 |
"""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, softwa... | brutasse/graphite-api | graphite_api/render/datalib.py | Python | apache-2.0 | 7,097 |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
# -*- test-case-name: flocker.provision.test.test_install -*-
"""
Install flocker on a remote node.
"""
import posixpath
from textwrap import dedent
from urlparse import urljoin, urlparse
from effect import Func, Effect
import yaml
from zope.interface impo... | Azulinho/flocker | flocker/provision/_install.py | Python | apache-2.0 | 36,812 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#... | sacharya/nova | nova/tests/api/openstack/compute/plugins/v3/test_admin_password.py | Python | apache-2.0 | 5,987 |
'''-------------------------------------------------------------------------
Copyright IBM Corp. 2015, 2015 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/... | hroumani/genericStorletStore | storletDeploy/sys_test_params.py | Python | apache-2.0 | 1,153 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012, Nachi Ueno, NTT MCL, 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://ww... | rossella/neutron | quantum/plugins/metaplugin/common/config.py | Python | apache-2.0 | 1,981 |
# coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
i... | kubevirt/client-python | test/test_k8s_io_apimachinery_pkg_apis_meta_v1_root_paths.py | Python | apache-2.0 | 1,105 |
#!/usr/bin/env python
# # -*- coding: utf-8 -*-
"""
title : __main__.py
description : entry point for core sira component
usage : python sira [OPTIONS]
-h Display this usage message
-d [input_directory] Specify the directory with the required
... | GeoscienceAustralia/sifra | __main__.py | Python | apache-2.0 | 11,130 |
import unittest
import mock
from mopidy_playbackdefaults import PlaybackDefaultsFrontend
class PlaybackDefaultsFrontendTest(unittest.TestCase):
def test_no_settings(self):
config = {'playbackdefaults': {'default_random': '', 'default_repeat': '', 'default_consume': '', 'default_single': ''}}
co... | DavisNT/mopidy-playbackdefaults | tests/test_frontend.py | Python | apache-2.0 | 5,145 |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | baidu/Paddle | python/paddle/fluid/tests/unittests/test_fake_quantize_op.py | Python | apache-2.0 | 5,508 |
#!/usr/bin/env python
# coding=utf-8
#
# Copyright (c) 2013-2015 First Flamingo Enterprise B.V.
#
# 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... | firstflamingo/treinenaapje | app/TAToolsHandler.py | Python | apache-2.0 | 17,879 |
#!/usr/bin/env python
from threaded_ssh import ThreadedClients
from ServerConfig import Aim
from ServerConfig import TellStore
from ServerConfig import General
from ServerConfig import Storage
from ServerConfig import Kudu
def hostToIp(host):
return General.infinibandIp[host]
def semicolonReduce(x, y):
return... | tellproject/helper_scripts | aim_server.py | Python | apache-2.0 | 1,508 |
#!/usr/bin/env python
# Copyright 2016 Sam Yaple
#
# 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... | brk3/ekko | tools/generate_manifest.py | Python | apache-2.0 | 2,544 |
from __future__ import absolute_import
from __future__ import unicode_literals
import glob
import imp
import inspect
import os
import sys
from mb.config.config import get_default_config_file
from mb.lib import logger
from mb.lib import process
_log = logger.get_logger('[Ioc]')
# plugin types
from mb import build_co... | silverbp/master-builder | mb/lib/ioc.py | Python | apache-2.0 | 4,431 |
# Copyright 2020 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | google/pigweed | pw_tokenizer/py/pw_tokenizer/__main__.py | Python | apache-2.0 | 687 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | openstack/senlin | senlin/tests/unit/engine/actions/test_check.py | Python | apache-2.0 | 8,927 |
#!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@license:
'''
SPELL=u'xiàjùxū'
CN=u'下巨虚'
NAME=u'xiajuxu441'
CHANNEL='stomach'
CHANNEL_FULLNAME='StomachChannelofFoot-Yangming'
SEQ='ST39'
if __name__ == '__main__':
pass
| sinotradition/meridian | meridian/acupoints/xiajuxu441.py | Python | apache-2.0 | 241 |
# 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... | bigswitch/nova | nova/tests/unit/api/openstack/compute/test_flavor_rxtx.py | Python | apache-2.0 | 3,454 |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008-2014,2016-2019 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | quattor/aquilon | lib/aquilon/worker/formats/location.py | Python | apache-2.0 | 4,816 |
from telnetlib import Telnet
class James:
def __init__(self, app):
self.app = app
def ensure_user_exists(self, username, password):
james_config = self.app.config['james']
session = James.Session(james_config['host'], james_config['port'], james_config['username'], james_config['pass... | esemin83/python_training_mantis | fixture/james.py | Python | apache-2.0 | 1,687 |
#!/usr/bin/env python3
# Copyright 2015-2016 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... | centricular/meson | mesonbuild/scripts/vcstagger.py | Python | apache-2.0 | 1,568 |
# This file implements all actions performed by agent to start execution script on exec host and sar data collection
# from all exec and stat hosts. Each procedure is mapped with particular daytona command used by scheduler to
# communicate with agent. Upon recieving command from daytona scheduler, agent execute below ... | deepeshmittal/daytona | Scheduler+Agent/action.py | Python | apache-2.0 | 25,730 |
#import RPi.GPIO as GPIO
import time
def ToString (List): # Coverts List to String
return ''.join(List)
def Setup ():
def Wait ():
reading_file=open('DataStore.txt', 'r')
lines=reading_file.readlines()
#print lines
GoodLine = lines[len(lines) - 1] #GoodLine is the last line of the file!
if len(l... | BostonA/SpudnikPi | Server.py | Python | apache-2.0 | 564 |
from unittest import TestCase
from chess import get_potential_moves
class ChessTestCase(TestCase):
def setup(self):
pass
def teardown(self):
pass
def test_knight(self):
response = get_potential_moves('knight', 'd2')
response = [each.strip() for each in response.split(',')... | jgoodell/chess-algebra | tests.py | Python | apache-2.0 | 1,483 |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | google/coursebuilder_xblock_module | src/modules/xblock_module/xblock_module.py | Python | apache-2.0 | 54,112 |
import poplib
import email
import time
class MailHelper:
def __init__(self, app):
self.app = app
def get_mail(self, username, password, subject):
for i in range (5):
pop = poplib.POP3(self.app.config['james']['host'])
pop.user(username)
pop.pass_(password)... | Droriel/python_training_mantis | fixture/mail.py | Python | apache-2.0 | 858 |
from .main import main, zdkb
| fprimex/zdkb | zdkb/__init__.py | Python | apache-2.0 | 29 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Appier Framework
# Copyright (c) 2008-2021 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apach... | hivesolutions/appier | src/appier/legacy.py | Python | apache-2.0 | 13,083 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Yue-Wen FANG'
__maintainer__ = "Yue-Wen FANG"
__email__ = 'fyuewen@gmail.com'
__license__ = 'Apache License 2.0'
__creation_date__= 'Dec. 28, 2018'
"""
9-3. Users: Make a class called User . Create two attributes called first_name and last_name, and then cre... | yw-fang/readingnotes | machine-learning/Matthes-crash-course/chapt09/scripts/user_03.py | Python | apache-2.0 | 1,263 |
from givabit.backend.errors import AlreadyExistsException
from givabit.backend.user import User
from givabit.backend.user_repository import UserRepository
from givabit.webapp.base_page import BasePage
from givabit.webapp.url import Url
class SignupPage(BasePage):
def __init__(self, request, response, user_reposito... | illicitonion/givabit | src/givabit/webapp/signup_page.py | Python | apache-2.0 | 1,031 |
# coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
i... | kubevirt/client-python | test/test_v1_i6300_esb_watchdog.py | Python | apache-2.0 | 927 |
import os, sys
sys.path = [os.path.join(os.getcwd(), "..") ] + sys.path
sys.path = [os.path.join(os.getcwd(), "..", "..") ] + sys.path
from flTile.amConfig import CreateAMConfig
def run():
tileConfig = CreateAMConfig()
#hostname = gethostname()
#machineDesc = tileConfig.getMachineDescByHostname(hostname)... | rpwagner/tiled-display | flTile/test/printTileConfigCoords.py | Python | apache-2.0 | 868 |
# pylint: skip-file
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-09-15 20:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('passive_data_kit', '0068_remove_deviceissue_platform_version'),
]
operations = [
migrations.A... | audaciouscode/PassiveDataKit-Django | migrations/0069_auto_20190915_1605.py | Python | apache-2.0 | 600 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | noironetworks/group-based-policy | gbpservice/nfp/core/sequencer.py | Python | apache-2.0 | 4,161 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (... | hortonworks/hortonworks-sandbox | apps/oozie/src/oozie/management/commands/oozie_setup.py | Python | apache-2.0 | 3,188 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
LOGIN_EMAIL = 'your@email.here'
LOGIN_PASSWORD = 'your_password_here'
SUB_DOMAIN = 'www'
DOMAIN = 'your-domain.here'
| leeyiw/dnspod_ddns | config.py | Python | apache-2.0 | 163 |
import unittest
from rx import Observable
from rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable
from rx.disposables import Disposable, SerialDisposable
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
sub... | dbrattli/RxPY | tests/test_observable/test_withlatestfrom.py | Python | apache-2.0 | 14,723 |
#!/usr/bin/env python
from __future__ import print_function
from collections import Counter
from operator import itemgetter
import os
_path = os.path.abspath(os.path.dirname(__file__))
SOURCE = os.path.join(_path, 'poems_for_wordcount.txt')
DESTINATION = os.path.join(_path, 'poem_words_out.txt')
def sort_word_cou... | clarkkarenl/brautbot | wordcount.py | Python | artistic-2.0 | 1,390 |
from rethinkengine.fields import *
import unittest2 as unittest
class PrimaryKeyFieldTestCase(unittest.TestCase):
def test_default(self):
f = ObjectIdField()
self.assertEqual(f._default, None)
with self.assertRaises(TypeError):
ObjectIdField(default='')
def test_required... | OpenSystemsLab/rethinkengine | tests/test_fields.py | Python | bsd-2-clause | 5,550 |
# -*- 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):
# Deleting field 'SurveyQuestion.statistic'
db.delete_column(u'survey_sur... | myvoice-nigeria/myvoice | myvoice/survey/migrations/0005_auto__del_field_surveyquestion_statistic.py | Python | bsd-2-clause | 12,627 |
#!/usr/bin/env python
"""Process that loads the datastore"""
__author__ = 'Michael Meisinger, Thomas Lennan'
"""
Possible Features
- load objects into different datastores
- load from a directory of YML files in ion-definitions
- load from a ZIP of YMLs
- load an additional directory (not under GIT control)
- change... | scionrep/scioncc | src/ion/process/bootstrap/datastore_loader.py | Python | bsd-2-clause | 2,396 |
#!/usr/bin/env python
from __future__ import print_function
import time
import pyupm_grove as grove
import pyupm_i2clcd as lcd
import pyupm_th02 as th02
import pyupm_guvas12d as upmUV
import pyupm_grovemoisture as upmMoisture
from phant import Phant
import requests
from iot_utils import *
__author__ = 'KT Kirk'
# Ini... | ktkirk/HSSI | IoT/iot_lcd.py | Python | bsd-2-clause | 1,768 |
# -*- coding: utf-8 -*-
"""This module contains the parser/generators (or coders/encoders if you
prefer) for the classes/datatypes that are used in iCalendar:
###########################################################################
# This module defines these property value data types and property parameters
4.2 D... | untitaker/icalendar | src/icalendar/prop.py | Python | bsd-2-clause | 30,687 |
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('webapp',
url(r'^/?$', 'views.home', name='home'),
url(r'^auth_redirect$', 'views.auth_redirect', name='auth_redirect'),
url(r'^nights$', 'views.night_index', name='night_index'),
url(r'^song$', 'view... | beddit/sleep-musicalization-web | webapp/urls.py | Python | bsd-2-clause | 806 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | mikehulluk/morphforge | src/morphforgecontrib/fake_namespaces/postsynaptictypes.py | Python | bsd-2-clause | 1,976 |
# coding: utf-8
'''
This script reads data from various sources to process and store in MongoDB.
'''
import pyexcel
import logging
import models
from transform_date import *
from accent_remover import *
logging.basicConfig(filename='logs/scieloci.info.txt', level=logging.INFO)
logger = logging.getLogger(__name__)
#... | scieloorg/journals-catalog | jcatalog/transform/scielo_wos_scieloci_update.py | Python | bsd-2-clause | 1,379 |
# -*- coding: UTF-8 -*-
import datetime
import os
import os.path
import subprocess
from collections import defaultdict
from django.conf import settings as dsettings
from django.core import exceptions
from django.core.cache import cache
from django.db import connection
from django.db import models
from django.db import... | PythonSanSebastian/epcon | conference/models.py | Python | bsd-2-clause | 49,377 |
# Copyright (c) Peter Parente
# Distributed under the terms of the BSD 2-Clause License.
import os
from flask import Flask
from flask_sslify import SSLify
from .model import db
from .auth import oauth
from .ui import ui_bp
from .api import api_bp
app = Flask(__name__)
app.secret_key = os.getenv('SECRET_KEY', os.urando... | parente/bof | bof/__init__.py | Python | bsd-2-clause | 897 |
#!/usr/bin/env python
import os
import sys
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.append(PROJECT_DIR)
sys.path.append(os.path.abspath(PROJECT_DIR + '/../'))
sys.path.append(os.path.abspath(PROJECT_DIR + '/../realestate/'))
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTIN... | wm3ndez/realestate | testproject/manage.py | Python | bsd-2-clause | 464 |
# What should be exported from module
from download_music import run_midi_load
| MikhailMS/Final_Project | download_music/__init__.py | Python | bsd-2-clause | 79 |
"""
Module `lino_xl.lib.properties`
-------------------------------
Imagine that we are doing a study about alimentary habits. We observe a
defined series of properties on the people who participate in our study.
Here are the properties that we are going to observe::
>>> weight = properties.INT.create_property(na... | khchine5/book | lino_book/projects/properties/models.py | Python | bsd-2-clause | 4,443 |
from os.path import join
from tempfile import mkdtemp
import unittest
from shutil import rmtree
import pandas as pd
from feagen.data_wrappers.pandas_hdf import get_shape_from_pandas_hdf_storer
class Test(unittest.TestCase):
def setUp(self):
self.test_output_dir = mkdtemp(prefix="feagen_test_output_")
... | ianlini/feagen | feagen/data_wrappers/tests/test_pandas_hdf.py | Python | bsd-2-clause | 4,476 |
import mongoengine as db
class BaseObject(db.Document):
meta = {'allow_inheritance': True}
name = db.StringField(required=True)
tags = db.ListField(db.StringField())
revision = db.IntField(default=1)
| ameily/pubfs | pubfs/core/models.py | Python | bsd-2-clause | 225 |
import sys
import time
from entrypoint2 import entrypoint
import pyscreenshot
from pyscreenshot.plugins.gnome_dbus import GnomeDBusWrapper
from pyscreenshot.plugins.gnome_screenshot import GnomeScreenshotWrapper
from pyscreenshot.plugins.kwin_dbus import KwinDBusWrapper
from pyscreenshot.util import run_mod_as_subpro... | ponty/pyscreenshot | pyscreenshot/check/speedtest.py | Python | bsd-2-clause | 3,228 |
"""
pygments.lexers._postgres_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Self-updating data files for PostgreSQL lexer.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Autogenerated: please edit them if you like wasting your time.... | dscorbett/pygments | pygments/lexers/_postgres_builtins.py | Python | bsd-2-clause | 12,184 |
#!/usr/bin/env python
# -*-coding:utf-8-*-
# @Time : 2017/11/1 ~ 2019/9/1
# @Author : Allen Woo
from flask import request
from apps.core.flask.login_manager import osr_login_required
from apps.configs.sys_config import METHOD_WARNING
from apps.core.blueprint import api
from apps.core.flask.permission import permission_... | osroom/osroom | apps/modules/category/apis/theme_category.py | Python | bsd-2-clause | 2,262 |
"""Leetcode 796. Rotate String
Easy
URL: https://leetcode.com/problems/rotate-string/
We are given two strings, A and B.
A shift on A consists of taking string A and moving the leftmost character to
the rightmost position. For example, if A = 'abcde', then it will be 'bcdea'
after one shift on A. Return True if and ... | bowen0701/algorithms_data_structures | lc0796_rotate_string.py | Python | bsd-2-clause | 1,408 |
# test_patternchain.py -- Tests for Pattern Chains
"""Tests for Pattern Chain objects"""
from morph import (
pattern,
patternchain
)
from morph.pattern import (
LiteralPattern,
NumericCounterPattern,
)
from morph.patternchain import (
generateFullReplaceChain,
PatternChain,
FilePatternCh... | milki/morph | morph/tests/test_patternchain.py | Python | bsd-2-clause | 3,569 |
# -*- coding: UTF-8 -*-
import logging
from model_utils import Choices
from simptools.wrappers.http import HttpClient, HttpRequest
from requests.exceptions import ConnectionError
from payway.merchants.models import Merchant
__author__ = 'Razzhivin Alexander'
__email__ = 'admin@httpbots.com'
RESPONSE_STATUS = Choices(... | RANUX/django-payway | payway/merchants/http.py | Python | bsd-2-clause | 1,585 |
###
### This file was automatically generated
###
from archinfo.arch import register_arch, Endness, Register
from .common import ArchPcode
class ArchPcode_dsPIC33E_LE_24_default(ArchPcode):
name = 'dsPIC33E:LE:24:default'
pcode_arch = 'dsPIC33E:LE:24:default'
description = 'dsPIC33E'
bits = 24
i... | angr/angr | angr/engines/pcode/arch/ArchPcode_dsPIC33E_LE_24_default.py | Python | bsd-2-clause | 4,846 |
import math
def get_direction(src, target):
diff = map(lambda a, b: a - b, target, src)
mag = math.sqrt(sum(map(lambda a: a ** 2, diff)))
if mag == 0:
return [0, 0]
return map(lambda a: a / mag, diff)
def distance(pos1, pos2):
return math.sqrt(sum(map(lambda a: a ** 2, map(lambda a, b: a -... | Wopple/fimbulvetr | src/client/util.py | Python | bsd-3-clause | 613 |
def extractNotsogoodtranslatorWordpressCom(item):
'''
Parser for 'notsogoodtranslator.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'tra... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractNotsogoodtranslatorWordpressCom.py | Python | bsd-3-clause | 578 |
import httpbenchmark
from unuk.benchmarks.base import runtests
| pombredanne/unuk | src/unuk/benchmarks/__init__.py | Python | bsd-3-clause | 63 |
from datetime import datetime, timedelta
import csv
from cStringIO import StringIO
from django.test import TestCase
from django.contrib.auth.models import User
from django.test import Client
from django.http import HttpRequest, QueryDict, response
from mock import patch, Mock
from .models import Variable, Session, Vi... | ResearchSoftwareInstitute/MyHPOM | hs_tracking/tests.py | Python | bsd-3-clause | 15,515 |
# -*- coding: utf8 -*-
from flask_login import AnonymousUserMixin
from .interface import BUIhandler, BUIuser, BUIloader
from ...utils import __
import ssl
try:
from ldap3 import (
Server,
Connection,
Tls,
ALL,
RESTARTABLE,
AUTO_BIND_TLS_BEFORE_BIND,
AUTO_BI... | ziirish/burp-ui | burpui/misc/auth/ldap.py | Python | bsd-3-clause | 11,183 |
# -*- coding: utf-8 -*-
from cms.exceptions import NoPermissionsException
from cms.models import Page, PagePermission, GlobalPagePermission
from cms.plugin_pool import plugin_pool
from cms.utils import get_cms_setting
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.au... | pixbuffer/django-cms | cms/utils/permissions.py | Python | bsd-3-clause | 11,836 |
from django.conf.urls import include, url
from rest_framework.routers import SimpleRouter
from rest_framework_nested.routers import NestedSimpleRouter
from olympia.bandwagon.views import CollectionViewSet, CollectionAddonViewSet
from . import views
accounts = SimpleRouter()
accounts.register(r'account', views.Acco... | tsl143/addons-server | src/olympia/accounts/urls.py | Python | bsd-3-clause | 1,619 |
cases = [
('pmt.py -s 1 -n 20 populations, first without state filter',
'pmt.py -s 1 -n 20 populations'),
('pmt.py -s 2 -n 20 populations filter3, state filter limits population to 3',
'pmt.py -s 2 -n 20 populations filter3')
]
| nfredrik/pyModelStuff | samples/populations/test/test_filter.py | Python | bsd-3-clause | 247 |
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
from PLC.SliceTags import SliceTag, SliceTags
from PLC.Persons import Person, Persons
from PLC.Sites import Site, Sites
from PLC.Nodes import Nodes
from PLC.Slices import Slice, Slices
from PL... | dreibh/planetlab-lxc-plcapi | PLC/Methods/GetSliceTags.py | Python | bsd-3-clause | 3,652 |
""" Specify the NetworkNode with its action, context-menus """
# Copyright (C) 2009-2010, Ecole Polytechnique Federale de Lausanne (EPFL) and
# University Hospital Center and University of Lausanne (UNIL-CHUV)
#
# Modified BSD License
# Standard library imports
import os
# Enthought library imports
from traits.api im... | LTS5/connectomeviewer | cviewer/plugins/cff2/ui/cnetwork_tree_node.py | Python | bsd-3-clause | 2,792 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.