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 (c) 2016 Baidu, 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 o... | qingqing01/Paddle | doc/ui/predict/predict_sample.py | Python | apache-2.0 | 8,781 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | phrocker/accumulo | test/system/auto/simple/nativeMap.py | Python | apache-2.0 | 1,323 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import os
import shutil
from pants.backend.jvm.subsystems.scoverage_platform import ScoveragePlatform
from pants.backend.jvm.tasks.coverage.cobertura import Cobertura
from ... | tdyas/pants | src/python/pants/backend/jvm/tasks/coverage/manager.py | Python | apache-2.0 | 6,621 |
# Copyright 2012-2013 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 la... | nttcom/eclcli | eclcli/identity/v3/user.py | Python | apache-2.0 | 15,378 |
#!/usr/bin/env python3
# Copyright (c) 2014 Pawel Rozlach, Brainly.com sp. z o.o.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | vespian/inventory_tool | inventory_tool/object/ippool.py | Python | apache-2.0 | 8,065 |
# Copyright (c) 2012 - 2014 EMC Corporation, 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
#
# ... | hguemar/cinder | cinder/tests/test_emc_vnxdirect.py | Python | apache-2.0 | 125,902 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the file system implementation using pyfsapfs."""
import unittest
from dfvfs.lib import definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import context
from dfvfs.vfs import apfs_file_system
from tests import test_lib as sh... | joachimmetz/dfvfs | tests/vfs/apfs_file_system.py | Python | apache-2.0 | 4,316 |
# (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Copyright 2014 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
#
# ... | dims/cinder | cinder/zonemanager/fc_zone_manager.py | Python | apache-2.0 | 11,517 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018, Eric Jacob <erjac77@gmail.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/LICENS... | erjac77/ansible-module-f5bigip | library/f5bigip_sys_crypto_cert.py | Python | apache-2.0 | 8,937 |
# Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | viggates/nova | nova/tests/api/openstack/compute/contrib/test_agents.py | Python | apache-2.0 | 10,887 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-07 17:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('climate_data', '0029_auto_20170628_1527'),
]
operations = [
migrations.Alte... | qubs/climate-data-api | climate_data/migrations/0030_auto_20170707_1727.py | Python | apache-2.0 | 490 |
__author__ = 'alberto'
import time
from functools import wraps
from config import logger
def measure_time(func):
"""
Decorator that reports the execution time.
"""
@wraps(func)
def wrapper(*args, **kwargs):
logger.info("Running %s", func.__name__)
start = time.time()
resu... | jresendiz27/EvolutionaryComputing | escom/pepo/utils.py | Python | apache-2.0 | 469 |
# Copyright 2018-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | mongodb/mongo-python-driver | test/test_transactions.py | Python | apache-2.0 | 20,801 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | ilay09/keystone | keystone/tests/unit/identity/backends/test_ldap.py | Python | apache-2.0 | 1,538 |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Exceptions coverage.py can raise."""
class BaseCoverageException(Exception):
"""The base of all Coverage exceptions."""
pass
class CoverageException(... | hugovk/coveragepy | coverage/exceptions.py | Python | apache-2.0 | 1,237 |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | GoogleCloudPlatform/cloud-opensource-python | compatibility_server/configs.py | Python | apache-2.0 | 9,653 |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | quartzmo/google-cloud-ruby | google-cloud-datastore/synth.py | Python | apache-2.0 | 3,270 |
from proboscis import test
@test(groups=['benchmark.discovery'])
class BenchmarkDiscoveryTests(object):
def __init__(self):
pass
| jlongever/RackHD | test/benchmark/api_v2_0/discovery_tests.py | Python | apache-2.0 | 142 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class ScheduleConfig(AppConfig):
name = 'schedule'
| CongBao/mrsys.online | sub_mrsys/schedule/apps.py | Python | apache-2.0 | 156 |
# Copyright 2014 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | tseaver/google-cloud-python | datastore/tests/unit/test_client.py | Python | apache-2.0 | 44,363 |
"""
# 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/main/python/etch/binding/util/URLSerializer.py | Python | apache-2.0 | 2,249 |
# Inviwo Python script
import inviwopy
tf = inviwopy.app.network.VolumeRaycaster.transferFunction
tf.save( inviwopy.app.getPath( inviwopy.PathType.TransferFunctions) + "/transferfunction.itf" )
| Sparkier/inviwo | data/scripts/savetransferfunction.py | Python | bsd-2-clause | 196 |
#!/usr/bin/env python
# test --create
command += oiiotool ("--create 320x240 3 -d uint8 -o black.tif")
command += oiiotool ("--stats black.tif")
# test --pattern constant
command += oiiotool ("--pattern constant:color=.1,.2,.3,1 320x240 4 -o constant.tif")
command += oiiotool ("--stats constant.tif")
# test --patte... | OpenImageIO/oiio | testsuite/oiiotool-pattern/run.py | Python | bsd-3-clause | 3,464 |
import foauth.providers
class Cheddar(foauth.providers.OAuth2):
# General info about the provider
provider_url = 'https://cheddarapp.com/'
docs_url = 'https://cheddarapp.com/developer/'
category = 'Tasks'
# URLs to interact with the API
authorize_url = 'https://api.cheddarapp.com/oauth/author... | foauth/foauth.org | services/cheddar.py | Python | bsd-3-clause | 639 |
"""tuple sub-class which holds weak references to objects"""
import weakref
class WeakTuple( tuple ):
"""tuple sub-class holding weakrefs to items
The weak reference tuple is intended to allow you
to store references to a list of objects without
needing to manage weak references directly.
For th... | menpo/vrml97 | vrml/weaktuple.py | Python | bsd-3-clause | 4,708 |
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2015 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
import re
from rest_framework.serializers import ValidationError
def name(value):
'''Matches names of people, countries and and other thing... | ctmunwebmaster/huxley | huxley/api/validators.py | Python | bsd-3-clause | 1,610 |
## Automatically adapted for scipy Oct 21, 2005 by
"""
Integration routines
====================
Methods for Integrating Functions given function object.
quad -- General purpose integration.
dblquad -- General purpose double integration.
tplquad -- General purpose triple integration.
... | stefanv/scipy3 | scipy/integrate/info.py | Python | bsd-3-clause | 1,311 |
DEPS = [
'recipe_engine/platform',
]
| shishkander/recipes-py | recipe_modules/path/__init__.py | Python | bsd-3-clause | 39 |
"""
1.0 version of the API.
"""
from sharrock.descriptors import Descriptor
version = '1.0'
class MultiversionExample(Descriptor):
"""
This is the first version of this particular function.
"""
| Axilent/sharrock | sharrock_multiversion_example/descriptors/one.py | Python | bsd-3-clause | 208 |
#!/usr/bin/env python
number = 0
for a in range(999,99,-1):
for b in range(999,99,-1):
pal=a*b
if (str(pal) == str(pal)[::-1]):
if (pal > number):
number = pal
break
print(number)
| GT-IDEaS/SkillsWorkshop2017 | Week01/Problem04/cruiz_04.py | Python | bsd-3-clause | 242 |
from __future__ import unicode_literals
from unittest import TestCase
from shutil import rmtree
from tempfile import mkdtemp
from os import makedirs
from os.path import join, exists, dirname
from awsfabrictasks.s3.api import dirlist_absfilenames
from awsfabrictasks.s3.api import localpath_to_s3path
from awsfabrictask... | espenak/awsfabrictasks | awsfabrictasks/tests/s3/test_api.py | Python | bsd-3-clause | 1,830 |
"""
Classes for using robotic or other hardware using Topographica.
This module contains several classes for constructing robotics
interfaces to Topographica simulations. It includes modules that read
input from or send output to robot devices, and a (quasi) real-time
simulation object that attempts to maintain a cor... | ioam/topographica | topo/hardware/robotics.py | Python | bsd-3-clause | 4,844 |
# -*- coding: utf-8 -*-
import os
from os import path as op
import shutil
import glob
import warnings
from nose.tools import assert_true, assert_raises
from numpy.testing import assert_equal, assert_allclose
from mne import concatenate_raws, read_bem_surfaces
from mne.commands import (mne_browse_raw, mne_bti2fiff, mne... | nicproulx/mne-python | mne/commands/tests/test_commands.py | Python | bsd-3-clause | 9,165 |
from sqlagg.columns import SimpleColumn
from sqlagg.filters import BETWEEN, IN, EQ
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
from corehq.apps.reports.sqlreport import SqlData, DataFormatter, TableDataFormat, DatabaseColumn
from custom.tdh.reports import UNNECESSARY_FIELDS, CHILD_HEAD... | puttarajubr/commcare-hq | custom/tdh/sqldata.py | Python | bsd-3-clause | 25,506 |
#!/usr/bin/python -u
# coding=utf-8
"""
Generate certificates via Let's Encrypt
"""
import re
from subprocess import check_output, check_call
from os import path
import click
from colorama import Fore
import pexpect
# Extract the file/challenge from the LetsEncrypt output e.g.
CREX = re.compile(
".well-known\/acm... | SB-Technology-Holdings-International/WateringWebClient | regen.py | Python | bsd-3-clause | 5,942 |
# Copyright (c) 2012, CyberPoint International, LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this lis... | ririw/libpgm | libpgm/dyndiscbayesiannetwork.py | Python | bsd-3-clause | 9,472 |
from django.conf.urls import patterns, url
from django.views.generic import RedirectView
from . import views
APP_SLUGS = {
'chrono': 'Chrono',
'face_value': 'Face_Value',
'podcasts': 'Podcasts',
'roller': 'Roller',
'webfighter': 'Webfighter',
'generalnotes': 'General_Notes',
'rtcamera': '... | andymckay/zamboni | mkt/ecosystem/urls.py | Python | bsd-3-clause | 4,853 |
from __future__ import division
import argparse
import multiprocessing
import numpy as np
import PIL
import chainer
import chainer.functions as F
import chainer.links as L
from chainer.optimizer_hooks import WeightDecay
from chainer import serializers
from chainer import training
from chainer.training import extensio... | chainer/chainercv | examples/fpn/train_multi.py | Python | mit | 11,453 |
__author__ = 'cgonzalez'
| carlgonz/u-fit | src/python/u_fit/modules/__init__.py | Python | mit | 25 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from flexget import options, plugin
from flexget.event import event
from flexget.terminal import console
from flexget.manager import Session
try:
from flexget.plugins.inter... | oxc/Flexget | flexget/plugins/cli/t411.py | Python | mit | 4,537 |
# -*- coding: utf-8 -*-
"""
.. module:: admin
"""
from django.contrib import admin
from apps.volontulo.models import Offer
from apps.volontulo.models import Organization
from apps.volontulo.models import UserProfile
admin.site.register(Offer)
admin.site.register(Organization)
admin.site.register(UserProfile)
| magul/volontulo | backend/apps/volontulo/admin.py | Python | mit | 315 |
"""SCons.Tool.packaging.msi
The msi packager.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# with... | dezelin/scons | scons-local/SCons/Tool/packaging/msi.py | Python | mit | 20,208 |
import sys
# Import renderdoc if not already imported (e.g. in the UI)
if 'renderdoc' not in sys.modules and '_renderdoc' not in sys.modules:
import renderdoc
# Alias renderdoc for legibility
rd = renderdoc
# We'll need the struct data to read out of bytes objects
import struct
# We base our data on a MeshFormat, ... | Zorro666/renderdoc | docs/python_api/examples/renderdoc/decode_mesh.py | Python | mit | 9,433 |
"""
Support for Tellstick lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.tellstick/
"""
from homeassistant.components import tellstick
from homeassistant.components.light import ATTR_BRIGHTNESS, Light
from homeassistant.components.tellstick... | justyns/home-assistant | homeassistant/components/light/tellstick.py | Python | mit | 3,211 |
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# t... | sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/ete2/tools/phylobuild_lib/task/cog_selector.py | Python | mit | 10,562 |
"""Attempt to determine the current user's "system" directories"""
try:
## raise ImportError
from win32com.shell import shell, shellcon
except ImportError:
shell = None
try:
import _winreg
except ImportError:
_winreg = None
import os, sys
## The registry keys where the SHGetFolderPath values appear to... | ktan2020/legacy-automation | win/Lib/site-packages/runsnakerun/homedirectory.py | Python | mit | 2,694 |
"""The macros below aren't reliable (e.g., some fail if ``arg_string`` is `None`)
or safe (``include`` doesn't guard against circular reference). For a more complete example, see
`the code used in the sandbox <http://code.google.com/p/urlminer/source/browse/examples/wiki/macros.py>`_.
"""
import genshi.builder as... | hprid/creoleparser | creoleparser/test_cheat_sheet_plus.py | Python | mit | 2,923 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.contrib.auth.models import User
from django.test.utils import override_settings
from allauth.account import app_settings as account_settings
from allauth.account.models import EmailAddress
from allauth.socialaccount.models im... | AltSchool/django-allauth | allauth/socialaccount/providers/disqus/tests.py | Python | mit | 2,347 |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: ASCII visualization of NLTK trees
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Andreas van Cranenburgh <A.W.vanCranenburgh@uva.nl>
# Peter Ljunglöf <peter.ljunglof@gu.se>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Pretty-pr... | nelango/ViralityAnalysis | model/lib/nltk/treeprettyprinter.py | Python | mit | 24,360 |
# -*- coding: utf-8 -*-
import networkx as nx
from nose.tools import assert_equal, assert_raises
class TestNetworkSimplex:
def test_simple_digraph(self):
G = nx.DiGraph()
G.add_node('a', demand = -5)
G.add_node('d', demand = 5)
G.add_edge('a', 'b', weight = 3, capacity = 4)
... | ChristianKniep/QNIB | serverfiles/usr/local/lib/networkx-1.6/networkx/algorithms/flow/tests/test_mincost.py | Python | gpl-2.0 | 10,257 |
# Copyright 2009 by Cymon J. Cox. 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.
"""Command line wrapper for the multiple alignment program DIALIGN2-2.
"""
from __future__ impo... | updownlife/multipleK | dependencies/biopython-1.65/build/lib.linux-x86_64-2.7/Bio/Align/Applications/_Dialign.py | Python | gpl-2.0 | 9,793 |
from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParametersCable, eDVBFrontendParametersTerrestrial
from Components.NimManager import nimmanager
def ConvertToHumanReadable(tp, type = None):
ret = { }
if type is None:
type = tp.get("tuner_type", "None")
if type == "DVB-S":
ret["tuner_type"] = _("S... | popazerty/bh1 | lib/python/Tools/Transponder.py | Python | gpl-2.0 | 7,700 |
import re
import subprocess
import sys
def get_promotion_chain(git_directory, git_branch, upstream_name='origin'):
"""
For a given git repository & branch, determine the promotion chain
Following the promotion path defined for pulp figure out what the full promotion
path to master is from wherever we... | aprajshekhar/pulp_packaging | ci/lib/promote.py | Python | gpl-2.0 | 8,229 |
# -*- coding: utf-8 -*-
"""Storage for ports. Set defaults here, then :py:mod:`fixtures.portset` will make overrides."""
import sys
from cfme.utils import clear_property_cache
from cfme.utils.log import logger
class Ports(object):
SSH = 22
DB = 5432
TOWER = 54322
logger = logger
@property
d... | Yadnyawalkya/integration_tests | cfme/utils/ports.py | Python | gpl-2.0 | 747 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | felipenaselva/repo.felipe | plugin.video.exodus/resources/lib/sources/pftv_tv.py | Python | gpl-2.0 | 5,225 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
blast2dem.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
***************... | AsgerPetersen/QGIS | python/plugins/processing/algs/lidar/lastools/blast2dem.py | Python | gpl-2.0 | 3,426 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 2013 CERN.
##
## Invenio 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 opt... | labordoc/labordoc-next | modules/miscutil/lib/wtforms_utils.py | Python | gpl-2.0 | 6,653 |
"""Storage for pytest objects during test runs
The objects in the module will change during the course of a test run,
so they have been stashed into the 'store' namespace
Usage:
# imported directly (store is pytest.store)
from cfme.fixtures.pytest_store import store
store.config, store.pluginmanager, sto... | apagac/cfme_tests | cfme/fixtures/pytest_store.py | Python | gpl-2.0 | 6,454 |
import re
import xml.dom.minidom
from typing import (
Any,
List,
Optional,
)
from pcs import utils
from pcs.common import (
const,
pacemaker,
)
from pcs.common.str_tools import format_list_custom_last_separator
# pylint: disable=not-callable
# main functions
def parse_argv(argv, extra_options=N... | tomjelinek/pcs | pcs/rule.py | Python | gpl-2.0 | 37,973 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('forum', '0004_topic_update_index_date'),
]
database_operations = [
migrations.AlterModelTable('TopicFollowed', 'notification... | DevHugo/zds-site | zds/forum/migrations/0005_auto_20151119_2224.py | Python | gpl-3.0 | 594 |
# -*- coding: utf-8 -*-
"""
linkcode
~~~~~~~~
Add external links to module code in Python object descriptions.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division, absolute_import, print_function
import warn... | dbarbier/ot-svn | python/doc/sphinxext/numpydoc/linkcode.py | Python | gpl-3.0 | 2,510 |
# -*- coding: utf-8 -*-
#
# Cyruslib v0.8.5-20090401
# Copyright (C) 2007-2009 Reinaldo de Carvalho <reinaldoc@gmail.com>
# Copyright (C) 2003-2006 Gianluigi Tiesi <sherpya@netfarm.it>
# Copyright (C) 2003-2006 NetFarm S.r.l. [http://www.netfarm.it]
#
# This program is free software; you can redistribute it and/or modi... | redondomarco/useradm | doc/python-cyrus-0.8.5/cyruslib.py | Python | gpl-3.0 | 24,712 |
#!/usr/bin/env python
from pymongo import MongoClient
import pymongo
HOST = "wfSciwoncWiki:enw1989@172.31.2.76:27001/?authSource=admin"
c = MongoClient('mongodb://'+HOST)
dbname = "wiki"
sessions = "sessions"
contributors = "contributors"
user_sessions = "user_sessions"
top_sessions = "top_sessions"
c[dbname].... | elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 2/instances/7_2_wikiflow_1sh_1s_noannot_wmj/init_0/DataStoreInit.py | Python | gpl-3.0 | 1,335 |
# (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# Ansible 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.
#
# Ansible is distributed i... | kaarolch/ansible | lib/ansible/cli/doc.py | Python | gpl-3.0 | 13,556 |
#!/usr/bin/env python
# this program is used to test latency
# don't test RTT bigger than 3 secs - it will break
# we make sure that nothing breaks if there is a packet missing
# this can rarely happen
import select
import socket
import time
import sys
import struct
def pong():
# easy, receive and send back
... | olbat/distem | test/experimental_testing/exps/latency.py | Python | gpl-3.0 | 1,573 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# Ansible 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 Li... | pshen/ansible | lib/ansible/modules/network/net_vlan.py | Python | gpl-3.0 | 2,321 |
#!/usr/bin/env python -t
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Jonathan Delvaux <pyshell@djoproject.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 3 of the License... | djo938/supershell | pyshell/addons/test/parameter_test.py | Python | gpl-3.0 | 29,938 |
from cgi import escape
import gzip as gzip_module
import re
import time
import types
import uuid
from cStringIO import StringIO
def resolve_content(response):
rv = "".join(item for item in response.iter_content())
if type(rv) == unicode:
rv = rv.encode(response.encoding)
return rv
class Pipeline... | kaksmet/servo | tests/wpt/web-platform-tests/tools/wptserve/wptserve/pipes.py | Python | mpl-2.0 | 13,913 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-02-25 11:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0016_auto_20160224_1039'),
]
operations = [
migrations.AddField(
... | uclouvain/OSIS-Louvain | base/migrations/0017_person_language.py | Python | agpl-3.0 | 520 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django import forms
... | suutari-ai/shoop | shuup/admin/modules/users/views/permissions.py | Python | agpl-3.0 | 5,257 |
"""
Utility library for working with the edx-milestones app
"""
from django.conf import settings
from django.utils.translation import gettext as _
from edx_toggles.toggles import SettingDictToggle
from milestones import api as milestones_api
from milestones.exceptions import InvalidMilestoneRelationshipTypeException, I... | eduNEXT/edx-platform | common/djangoapps/util/milestones_helpers.py | Python | agpl-3.0 | 16,458 |
from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
from rest.views.blocks.base import BlockSSDataTables, ResourceBlockAction
from consts import EDIT, CONFIRM, EDIT_MULTIPLE, VIEW
from lib.shortcuts import render_to_response, render_to_xml_response, render_to_context_response
from gf.gas.form... | michelesr/gasistafelice | gasistafelice/rest/views/blocks/users.py | Python | agpl-3.0 | 4,621 |
import os
import pytest
skipiftravis = pytest.mark.skipif(
os.environ.get('TRAVIS') == 'true', reason='skip on Travis-CI')
| SANDAG/pandana | pandana/testing.py | Python | agpl-3.0 | 129 |
# ----------------------------------------------------------------------
# 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... | numenta/nupic.research | src/nupic/research/frameworks/vernon/mixins/multi_cycle_lr.py | Python | agpl-3.0 | 4,655 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RPng(RPackage):
"""This package provides an easy and simple way to read, write and display... | iulian787/spack | var/spack/repos/builtin/packages/r-png/package.py | Python | lgpl-2.1 | 793 |
# -*- Mode: Python; test-case-name: flumotion.test.test_feedcomponent010 -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or mo... | timvideos/flumotion | flumotion/test/test_component_padmonitor.py | Python | lgpl-2.1 | 3,361 |
#!/usr/bin/env python3
#
# test_codecmaps_cn.py
# Codec mapping tests for PRC encodings
#
from test import support
from test import test_multibytecodec_support
import unittest
class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'gb2312'... | harmy/kbengine | kbe/res/scripts/common/Lib/test/test_codecmaps_cn.py | Python | lgpl-3.0 | 1,006 |
"""Implementation of magic functions for interaction with the OS.
Note: this module is named 'osm' instead of 'os' to avoid a collision with the
builtin.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the ter... | cloud9ers/gurumate | environment/lib/python2.7/site-packages/IPython/core/magics/osm.py | Python | lgpl-3.0 | 25,771 |
# vim: set et sw=4 ts=4 ai:
import unittest
import utils
from testbin import TestBin
class TestBinSlam(TestBin, unittest.TestCase):
def setUp(self):
self.bin = 'slam'
def tearDown(self):
pass
| compatibleone/accords-platform | testsuite/basic/slam.py | Python | apache-2.0 | 220 |
# 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... | laosiaudi/tensorflow | tensorflow/python/util/deprecation.py | Python | apache-2.0 | 12,098 |
# -*- 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 (the
#... | danielvdende/incubator-airflow | tests/contrib/sensors/test_aws_redshift_cluster_sensor.py | Python | apache-2.0 | 3,415 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA
#
# 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/l... | hasegaw/IkaLog | ikalog/inputs/win/directshow.py | Python | apache-2.0 | 4,592 |
from django.conf.urls import patterns, include, url
from testapp.api import PersonResource
from django.contrib import admin
admin.autodiscover()
person_resource = PersonResource()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'testapp.views.home', name='home'),
... | satish-suradkar/pyresttest | pyresttest/testapp/testapp/urls.py | Python | apache-2.0 | 535 |
# 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... | dmlc/tvm | tests/python/topi/python/test_topi_qnn.py | Python | apache-2.0 | 6,744 |
import os
import json
import arcpy
import types
import general
from .._abstract import abstract
########################################################################
class SpatialReference(abstract.AbstractGeometry):
""" creates a spatial reference instance """
_wkid = None
#-----------------------------... | achapkowski/ArcREST | src/arcrest/common/geometry.py | Python | apache-2.0 | 20,189 |
# Copyright 2013 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | wesm/impyla | impala/dbapi.py | Python | apache-2.0 | 6,149 |
# Copyright 2009 Shikhar Bhushan
#
# 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 writin... | mbaukes/ncclient | ncclient/operations/__init__.py | Python | apache-2.0 | 1,443 |
# Tests for Pmw color handling.
import Tkinter
import Test
import Pmw
Test.initialise()
testData = ()
defaultPalette = Pmw.Color.getdefaultpalette(Test.root)
c = Tkinter.Button
colors = ('red', 'orange', 'yellow', 'green', 'blue', 'purple', 'white')
normalcolors = map(Pmw.Color.changebrightness,
(Test.root,) * le... | mhcrnl/PmwTkEx | src/Pmw/Pmw_1_3/tests/Colors_test.py | Python | apache-2.0 | 1,045 |
# Copyright (c) 2016-2021, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
| swiftstack/container-crawler | test/unit/__init__.py | Python | apache-2.0 | 85 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('server', '0003_auto_20150612_1123'),
]
operations = [
migrations.RemoveField(
model_name='apikey',
n... | chasetb/sal | server/migrations/0004_auto_20150623_1623.py | Python | apache-2.0 | 1,504 |
config = {
"interfaces": {
"google.devtools.clouderrorreporting.v1beta1.ReportErrorsService": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": []
},
"retry_params": {
"default": {
... | jonparrott/google-cloud-python | error_reporting/google/cloud/errorreporting_v1beta1/gapic/report_errors_service_client_config.py | Python | apache-2.0 | 987 |
from distutils.core import setup
setup(
name="kafka-python",
version="0.1-alpha",
author="David Arthur",
author_email="mumrah@gmail.com",
url="https://github.com/mumrah/kafka-python",
packages=["kafka"],
license="Copyright 2012, David Arthur under Apache License, v2.0",
description="Pur... | enoex/kafka-python | setup.py | Python | apache-2.0 | 404 |
#!/usr/bin/python
#
# mallocstacks Trace malloc() calls in a process and print the full
# stack trace for all callsites.
# For Linux, uses BCC, eBPF. Embedded C.
#
# This script is a basic example of the new Linux 4.6+ BPF_STACK_TRACE
# table API.
#
# Copyright 2016 GitHub, Inc.
# Licensed ... | tuxology/bcc | examples/tracing/mallocstacks.py | Python | apache-2.0 | 1,942 |
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | projectcalico/calico-neutron | neutron/tests/unit/test_l3_schedulers.py | Python | apache-2.0 | 61,087 |
#!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | Azure/azure-linux-extensions | VMBackup/main/workloadPatch/WorkloadUtils/OracleLogBackup.py | Python | apache-2.0 | 2,709 |
import logging
from docker.utils import kwargs_from_env
from cattle import default_value, Config
log = logging.getLogger('docker')
_ENABLED = True
class DockerConfig:
def __init__(self):
pass
@staticmethod
def docker_enabled():
return default_value('DOCKER_ENABLED', 'true') == 'true'
... | sonchang/python-agent | cattle/plugins/docker/__init__.py | Python | apache-2.0 | 3,232 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apach... | sparkslabs/kamaelia_ | Sketches/AM/KPIPackage/Kamaelia/Community/AM/Kamaelia/KPIFramework/KPI/Server/DataTx.py | Python | apache-2.0 | 2,606 |
# Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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... | sebrandon1/neutron | neutron/tests/unit/services/trunk/drivers/openvswitch/test_driver.py | Python | apache-2.0 | 2,829 |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | samiunn/incubator-tinkerpop | gremlin-python/src/main/jython/tests/structure/test_graph.py | Python | apache-2.0 | 4,417 |
# Copyright (c) 2016-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | davinwang/caffe2 | caffe2/python/workspace.py | Python | apache-2.0 | 19,553 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.