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
# -*- coding: utf-8 -*- ############################################################################### # # RandomWord # Retrieves a random word. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
jordanemedlock/psychtruths
temboo/core/Library/Wordnik/Words/RandomWord.py
Python
apache-2.0
6,299
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
srajag/nova
nova/openstack/common/jsonutils.py
Python
apache-2.0
6,824
import logging import requests from flask import redirect, url_for, Blueprint, flash, request, session from flask_login import login_user from flask_oauthlib.client import OAuth from redash import models, settings from redash.authentication.org_resolving import current_org logger = logging.getLogger('google_oauth') o...
pubnative/redash
redash/authentication/google_oauth.py
Python
bsd-2-clause
4,179
''' Created on Nov 16, 2011 @author: clarkmatthew Simple Example script using the eutester web ui classes. The intention of this script is to download and unzip credentials to a given file by interacting with the webui. -First a Eucaweb object is created which gives us a selenium interface to work with. In this...
nagyistoce/eutester
eucaweb/example_get_creds_via_webui.py
Python
bsd-2-clause
2,033
# -*- coding: utf-8 -*- """ flaskbb.utils.views ~~~~~~~~~~~~~~~~~~~ This module contains some helpers for creating views. :copyright: (c) 2016 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ from flaskbb.utils.helpers import render_template from flask.views import View clas...
realityone/flaskbb
flaskbb/utils/views.py
Python
bsd-3-clause
600
__author__ = 'nearl'
nmearl/ifupy
tests/__init__.py
Python
bsd-3-clause
21
# pylint: disable-msg=E1101,W0613,W0603 import os import numpy as np import pandas._libs.json as json from pandas._libs.tslib import iNaT from pandas.compat import StringIO, long, u from pandas import compat, isnull from pandas import Series, DataFrame, to_datetime, MultiIndex from pandas.io.common import get_filepath...
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/pandas/io/json/json.py
Python
mit
24,553
#!/usr/bin/env python from __future__ import print_function import chainer import chainer.functions as F from chainer import Variable class DCGANUpdater(chainer.training.StandardUpdater): def __init__(self, *args, **kwargs): self.gen, self.dis = kwargs.pop('models') super(DCGANUpdater, self).__...
kiyukuta/chainer
examples/dcgan/updater.py
Python
mit
1,441
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from os.path import join, normpath from .base import * ########## DEBUG CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = True # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-de...
python-spain/PyConES-2015
pycones/pycones/settings/local.py
Python
mit
1,632
# The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/license/. # # Software di...
epsylon3/torrentflux
html/bin/clients/mainline/BitTorrent/parseargs.py
Python
gpl-2.0
9,389
from __future__ import print_function # Note: this code was initially copied from the 'pyutools' package by its # original author, and re-licensed under Theano's license. import numpy import theano from theano.compile.mode import Mode class MonitorMode(Mode): """ `MonitorMode` is a debug mode to easily step ...
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/Theano-0.7.0-py3.4.egg/theano/compile/monitormode.py
Python
gpl-2.0
3,659
# -*- coding: utf-8 -*- """ *==LICENSE==* CyanWorlds.com Engine - MMOG client, server and tools Copyright (C) 2011 Cyan Worlds, Inc. 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...
TOC-Shard/moul-scripts
Python/Garrison.py
Python
gpl-3.0
4,371
# Copyright 2008-2015 Canonical # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed...
indradhanush/filesync-server
src/backends/db/schemas/account/__init__.py
Python
agpl-3.0
6,330
# -*- coding: utf-8 -*- # Copyright(C) 2010-2012 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
sputnick-dev/weboob
weboob/applications/havedate/havedate.py
Python
agpl-3.0
10,370
# Copyright 2013-2021 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 PyPyliblzma(PythonPackage): """Python bindings for liblzma""" homepage = "https://lau...
LLNL/spack
var/spack/repos/builtin/packages/py-pyliblzma/package.py
Python
lgpl-2.1
556
from PySide.QtCore import Qt, QPersistentModelIndex from PySide.QtGui import QStringListModel if __name__ == '__main__': stringListModel = QStringListModel(['one', 'two']) idx = stringListModel.index(1, 0) persistentModelIndex = QPersistentModelIndex(idx) stringListModel.data(persistentModelIndex, Qt.D...
M4rtinK/pyside-android
tests/QtGui/bug_716.py
Python
lgpl-2.1
333
#!/usr/bin/env python ################################################################################ # Copyright (C) 2015 The Qt Company Ltd # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # ...
danimo/qt-creator
scripts/packageIfw.py
Python
lgpl-2.1
5,571
#!/usr/bin/env python """Required credentials configuration.""" # See instructions in the README.md file for how to fill these in. # The service account email address authorized by your Google contact. EE_ACCOUNT = '<your-service-account>@developer.gserviceaccount.com' # Copy your credentials from the console. OAUTH...
tylere/earthengine-api
demos/export-to-drive/config.py
Python
apache-2.0
542
from __future__ import absolute_import import inspect import os import platform import sys import lit.Test import lit.formats import lit.TestingConfig import lit.util # LitConfig must be a new style class for properties to work class LitConfig(object): """LitConfig - Configuration data for a 'lit' test runner ins...
llvm-mirror/llvm
utils/lit/lit/LitConfig.py
Python
apache-2.0
7,264
#!/usr/bin/env python """ This module export tec format to stl, vtk and vtp Changes in version 1.1 (OpenWarp - Add Logging Functionality) Added support for logging. """ import settings import utility import os import sys import subprocess __author__ = "yedtoss" __copyright__ = "Copyright (C) 2014-2016 TopCode...
NREL/OpenWARP
source/openwarpgui/nemoh/export_tec.py
Python
apache-2.0
2,293
# Copyright 2014 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 ag...
KaranToor/MA450
google-cloud-sdk/lib/googlecloudsdk/core/resource/flattened_printer.py
Python
apache-2.0
4,616
#!/usr/bin/python # -*- coding: utf-8 -*- # # Full coverage testing of the MimeDict object # # (C) Cerenity Contributors, All Rights Reserved. # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.or...
sparkslabs/kamaelia_
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Support/Data/tests/test_MimeDict.py
Python
apache-2.0
27,574
import os import base64 from collections import defaultdict from django.db.models import F, Q from xos.config import Config from synchronizers.base.openstacksyncstep import OpenStackSyncStep from synchronizers.base.syncstep import * from core.models.site import Controller, SitePrivilege from core.models.user import Us...
xmaruto/mcord
xos/synchronizers/openstack/steps/sync_controller_site_privileges.py
Python
apache-2.0
4,346
from .assembler import KamiAssembler
johnbachman/indra
indra/assemblers/kami/__init__.py
Python
bsd-2-clause
37
# -*- encoding: utf-8 -*- # # :licence: see LICENSE from twisted.python import usage from scapy.all import IP, ICMP from ooni.templates import scapyt class UsageOptions(usage.Options): optParameters = [['target', 't', '8.8.8.8', "Specify the target to ping"]] class ExampleICMPPingScapy(scapyt.BaseScapyTest...
Karthikeyan-kkk/ooni-probe
ooni/nettests/examples/example_scapyt.py
Python
bsd-2-clause
728
class RestServiceInterface(object): def send(self, url, data=None): raise NotImplementedError
spatialdev/onadata
onadata/apps/restservice/RestServiceInterface.py
Python
bsd-2-clause
106
from .main import Test class Inheritance(Test): def TEMPLATE_CONTEXT_PROCESSORS(self): return super(Inheritance, self).TEMPLATE_CONTEXT_PROCESSORS() + ( 'tests.settings.base.test_callback',)
ramaseshan/django-configurations
tests/settings/multiple_inheritance.py
Python
bsd-3-clause
218
r""" Synthetic seismograms using the convolutional model --------------------------------------------------- The simplest way to get a seismogram (in time x offset) is through the convolutional model .. math:: trace(t) = wavelet(t) \ast reflectivity(t) Module :mod:`fatiando.seismic.conv` defines functions for d...
rafaelmds/fatiando
gallery/seismic/convolutional_model.py
Python
bsd-3-clause
1,804
""" This example shows to embed a Mayavi view in a wx frame. The trick is to create a `HasTraits` object, as in the mlab_traits_ui.py, mayavi_traits_ui.py, or the modifying_mlab_source.py examples (:ref:`example_mlab_traits_ui`, :ref:`example_mayavi_traits_ui`, :ref:`example_mlab_interactive_dialog`). Calling the `ed...
dmsurti/mayavi
examples/mayavi/interactive/wx_embedding.py
Python
bsd-3-clause
2,111
#!/usr/bin/env kross # -*- coding: utf-8 -*- import os, datetime, sys, traceback, pickle import Kross, Plan T = Kross.module("kdetranslation") #TODO some ui Plan.beginCommand( T.i18nc( "(qtundoformat)", "Clear all external appointments" ) ) Plan.project().clearExternalAppointments() Plan.endCommand()
wyuka/calligra
plan/plugins/scripting/scripts/busyinfoclear.py
Python
gpl-2.0
305
from django.core.urlresolvers import reverse from django.views.generic import View from pulp.server import exceptions as pulp_exceptions from pulp.server.auth import authorization from pulp.server.controllers import user as user_controller from pulp.server.managers import factory from pulp.server.webservices.views.dec...
ulif/pulp
server/pulp/server/webservices/views/roles.py
Python
gpl-2.0
7,995
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import formatdate from erpnext.controllers.website_list_for_contact import get_customers_suppliers ...
ebukoz/thrive
erpnext/templates/pages/rfq.py
Python
gpl-3.0
2,722
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import exceptions, SUPERUSER_ID from odoo.addons.sale.controllers.portal import CustomerPortal from odoo.http import request, route from odoo.tools import consteq class SaleStockPortal(CustomerPortal): d...
jeremiahyan/odoo
addons/sale_stock/controllers/portal.py
Python
gpl-3.0
1,748
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import test_work_entry from . import test_work_intervals
jeremiahyan/odoo
addons/hr_work_entry_contract/tests/__init__.py
Python
gpl-3.0
164
#!/usr/bin/env python # Test whether a client sends a correct SUBSCRIBE to a topic with QoS 1. # The client should connect to port 1888 with keepalive=60, clean session set, # and client id subscribe-qos1-test # The test will send a CONNACK message to the client with rc=0. Upon receiving # the CONNACK and verifying t...
telefonicaid/fiware-IoTAgent-Cplusplus
third_party/mosquitto-1.4.4/test/lib/02-subscribe-qos1.py
Python
agpl-3.0
2,349
# 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...
stefanhenneking/mxnet
python/mxnet/gluon/block.py
Python
apache-2.0
19,291
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 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 # # ...
ykaneko/quantum
quantum/plugins/cisco/run_tests.py
Python
apache-2.0
1,393
# Copyright 2013 Google Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
r8o8s1e0/ChromeWebLab
Sketchbots/sw/labqueue/config.py
Python
apache-2.0
6,010
"""Dummy package initialisation."""
emijrp/pywikibot-core
tests/pwb/__init__.py
Python
mit
36
""" Defines classes for path effects. The path effects are supported in :class:`~matplotlib.text.Text`, :class:`~matplotlib.lines.Line2D` and :class:`~matplotlib.patches.Patch`. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals i...
yuanagain/seniorthesis
venv/lib/python2.7/site-packages/matplotlib/patheffects.py
Python
mit
14,367
import ntpath from test.test_support import verbose, TestFailed import os errors = 0 def tester(fn, wantResult): global errors fn = fn.replace("\\", "\\\\") gotResult = eval(fn) if wantResult != gotResult: print "error!" print "evaluated: " + str(fn) print "should be: " + str(w...
trivoldus28/pulsarch-verilog
tools/local/bas-release/bas,3.9/lib/python/lib/python2.3/test/test_ntpath.py
Python
gpl-2.0
5,049
#!/usr/bin/env python # Gnome15 - Suite of tools for the Logitech G series keyboards and headsets # Copyright (C) 2012 Brett Smith <tanktarta@blueyonder.co.uk> # # 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...
achilleas-k/gnome15
src/plugins/voip-teamspeak3/test.py
Python
gpl-3.0
1,183
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import shuup.notify.enums import enumfields.fields import shuup.core.fields from django.conf import settings import django.db.models.deletion import jsonfield.fields class Migration(migrations.Migration): de...
suutari-ai/shoop
shuup/notify/migrations/0001_initial.py
Python
agpl-3.0
2,946
# -*- coding: utf-8 -*- # Author: Nicolas Bessi. Copyright Camptocamp SA # Copyright (C) # 2014: Agile Business Group (<http://www.agilebg.com>) # 2015: Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
BT-ojossen/partner-contact
partner_firstname/models.py
Python
agpl-3.0
5,391
#!/usr/bin/env python """ This is an Ansible dynamic inventory for OpenStack. It requires your OpenStack credentials to be set in clouds.yaml or your shell environment. """ import resources def build_inventory(): """Build the Ansible inventory for the current environment.""" inventory = resources.build_inv...
markllama/openshift-ansible
playbooks/openstack/inventory.py
Python
apache-2.0
652
# Copyright (c) 2015 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 ...
vivekanand1101/neutron
neutron/tests/unit/agent/l3/test_dvr_local_router.py
Python
apache-2.0
25,046
"""Tests for the Home Assistant Websocket API.""" import asyncio from unittest.mock import patch, Mock from aiohttp import WSMsgType import pytest import voluptuous as vol from homeassistant.components.websocket_api import const, messages @pytest.fixture def mock_low_queue(): """Mock a low queue.""" with pa...
MartinHjelmare/home-assistant
tests/components/websocket_api/test_init.py
Python
apache-2.0
3,364
# Copyright 2017 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 a...
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/models/lfads/synth_data/generate_labeled_rnn_data.py
Python
bsd-2-clause
5,821
########################################################################## # # Copyright (c) 2011-2015, Image Engine Design Inc. All rights reserved. # Copyright (c) 2011-2012, John Haddon. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
lucienfostier/gaffer
python/GafferCortexUI/ParameterisedHolderUI.py
Python
bsd-3-clause
10,409
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class QueryError(Exception): """Raised when a BigQuery query fails.""" class TimeoutError(Exception): """Raised when an operation takes longer than it...
endlessm/chromium-browser
third_party/catapult/firefighter/base/exceptions.py
Python
bsd-3-clause
344
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from django.conf import settings user_model = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') class Migration(SchemaMigration): def forwards(self, orm): # Adding unique ...
WhySoGeeky/DroidPot
venv/lib/python2.7/site-packages/admin_tools/dashboard/migrations/0003_auto__add_unique_dashboardpreferences_dashboard_id_user.py
Python
mit
4,467
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2012 Pekka Jääskeläinen # # 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 without limitation t...
NatTuck/pocl
doc/www/generate_html.py
Python
mit
1,768
"""ACME JSON fields.""" import logging import pyrfc3339 from acme import jose logger = logging.getLogger(__name__) class Fixed(jose.Field): """Fixed field.""" def __init__(self, json_name, value): self.value = value super(Fixed, self).__init__( json_name=json_name, default=val...
nohona/cron-crm
usr/local/certbot/acme/acme/fields.py
Python
gpl-3.0
1,745
from queue import Queue import sys import unittest from tests.test_bears.TestBear import TestBear from tests.test_bears.TestBearDep import (TestDepBearBDependsA, TestDepBearCDependsB, TestDepBearDependsAAndAA) from coalib.bearlib.abstr...
CruiseDevice/coala
tests/testing/LocalBearTestHelperTest.py
Python
agpl-3.0
5,968
# -*- encoding: utf-8 -*- # Copyright P. Christeas <p_christ@hol.gr> 2008-2010 # Copyright 2010 OpenERP SA. http://www.openerp.com # # This program is Free Software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; versio...
crmccreary/openerp_server
openerp/addons/document/dict_tools.py
Python
agpl-3.0
2,020
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
ywcui1990/nupic.research
htmresearch/support/nlp_classification_plotting.py
Python
agpl-3.0
12,290
import pos_multi_session_models import controllers
bmya/pos-addons
pos_multi_session/__init__.py
Python
lgpl-3.0
51
# # 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...
apache/incubator-airflow
tests/providers/jenkins/operators/test_jenkins_job_trigger.py
Python
apache-2.0
12,070
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import copy import logging import sys import traceback class PageTestResults(object): def __init__(self, output_stream=None): supe...
boundarydevices/android_external_chromium_org
tools/telemetry/telemetry/results/page_test_results.py
Python
bsd-3-clause
2,264
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import re from lib.core.data import kb from lib.core.enums import PRIORITY __priority__ = PRIORITY.NORMAL def dependencies(): pass def tamper(payload, **kwargs): "...
V11/volcano
server/sqlmap/tamper/bluecoat.py
Python
mit
1,316
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from . import views class PayFlowDashboardApplication(Application): name = None list_view = views.TransactionListView detail_view = views.Tran...
aarticianpc/greenpointtrees
src/paypal/payflow/dashboard/app.py
Python
mit
816
import sys,os from blur.build import * path = os.path.dirname(os.path.abspath(__file__)) smoke_path = os.path.join(path,'smoke/qt') perlqt_path = os.path.join(path,'PerlQt') win = sys.platform == 'win32' if not win or os.path.exists('c:/perl/bin/perl.exe'): # Install the libraries #if sys.platform != 'win32': # ...
cypod/arsenalsuite
cpp/lib/perlqt/build.py
Python
gpl-2.0
943
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import msgprint, _ from frappe.model.document import Document from frappe.utils import comma_and class ProgramEnrollment(Document): ...
bhupennewalkar1337/erpnext
erpnext/schools/doctype/program_enrollment/program_enrollment.py
Python
gpl-3.0
1,966
######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 #...
GISPPU/GrenadaLandInformation
geonode/layers/management/__init__.py
Python
gpl-3.0
1,781
"""Config flow for Kostal Plenticore Solar Inverter integration.""" import asyncio import logging from aiohttp.client_exceptions import ClientError from kostal.plenticore import PlenticoreApiClient, PlenticoreAuthenticationException import voluptuous as vol from homeassistant import config_entries from homeassistant....
aronsky/home-assistant
homeassistant/components/kostal_plenticore/config_flow.py
Python
apache-2.0
2,305
""" ========================= Kernel Density Estimation ========================= This example shows how kernel density estimation (KDE), a powerful non-parametric density estimation technique, can be used to learn a generative model for a dataset. With this generative model in place, new samples can be drawn. These...
vortex-ape/scikit-learn
examples/neighbors/plot_digits_kde_sampling.py
Python
bsd-3-clause
2,013
import unittest from node.openbazaar import create_argument_parser from node.openbazaar_daemon import OpenBazaarContext class TestLauncher(unittest.TestCase): def setUp(self): self.default_ctx = OpenBazaarContext.create_default_instance() def test_argument_parser(self): parser = create_argume...
Renelvon/OpenBazaar
tests/test_launcher.py
Python
mit
2,106
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2011 Mehmet Atakan Gürkan # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed i...
digitalvapor/PySkyAlmanac
sabanci/almanac_utils.py
Python
gpl-3.0
3,563
#!/usr/bin/python # -*- coding: utf-8 -*- """ *** Description *** A pygame drum computer with recording and playback functionality. The drum computer is completely controlled by the keyboard, no MIDI hardware is required. You only have to specify an sf2 file. *** Keys *** r Enter record mode ...
yardex/python-mingus
mingus_examples/pygame-drum/pygame-drum.py
Python
gpl-3.0
7,732
#!/usr/bin/python # This file is part of Ansible # # 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...
wshallum/ansible
lib/ansible/modules/cloud/profitbricks/profitbricks_volume_attachments.py
Python
gpl-3.0
8,217
"""Provides factories for User API models.""" from factory.django import DjangoModelFactory from factory import SubFactory from student.tests.factories import UserFactory from opaque_keys.edx.locator import CourseLocator from ..models import UserCourseTag, UserOrgTag, UserPreference # Factories are self documenting ...
ahmedaljazzar/edx-platform
openedx/core/djangoapps/user_api/tests/factories.py
Python
agpl-3.0
993
# django-openid-auth - OpenID integration for django.contrib.auth # # Copyright (C) 2009-2010 Canonical Ltd. # # 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 ...
jaredjennings/snowy
wsgi/snowy/snowy/lib/django_openid_auth/tests/__init__.py
Python
agpl-3.0
1,710
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
datanel/navitia
source/jormungandr/jormungandr/scenarios/tests/qualifier_tests.py
Python
agpl-3.0
13,445
import sys, os, os.path from distutils.core import Extension from distutils.errors import DistutilsOptionError from versioninfo import get_base_dir, split_version try: from Cython.Distutils import build_ext as build_pyx import Cython.Compiler.Version CYTHON_INSTALLED = True except ImportError: CYTHON_I...
cloudera/hue
desktop/core/ext-py/lxml-3.3.6/setupinfo.py
Python
apache-2.0
13,458
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
ntt-sic/nova
nova/api/openstack/compute/plugins/v3/server_metadata.py
Python
apache-2.0
9,307
# -*- coding: utf-8 -*- import json from django.contrib.auth import get_permission_codename from django.contrib.sites.models import Site from django.http import HttpResponse from django.shortcuts import render_to_response from django.template.context import RequestContext from django.utils.encoding import smart_str f...
DylannCordel/django-cms
cms/utils/admin.py
Python
bsd-3-clause
4,796
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (dagwieers) <dag@wieers.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_ver...
drmrd/ansible
lib/ansible/modules/network/aci/aci_taboo_contract.py
Python
gpl-3.0
7,355
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,shutil,sys,platform from waflib import TaskGen,Task,Build,Options,Utils,Errors from waflib.TaskGen import taskgen_method,feature,after_method,before_method app_info=...
rafalmiel/glmark2-wl
waflib/Tools/c_osx.py
Python
gpl-3.0
4,428
def func(): value = "not-none" <caret>if value is None: # pylint: disable=unused-argument print("None") else: print("Not none")
siosio/intellij-community
python/testData/intentions/PyInvertIfConditionIntentionTest/commentsPylintInlineIf.py
Python
apache-2.0
157
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2007, 2008, 2009, 2010, 2011 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 (a...
zenodo/invenio
invenio/modules/bulletin/format_elements/bfe_webjournal_widget_seminars.py
Python
gpl-2.0
12,516
# (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' callback: yaml type: stdout short_description: ...
Russell-IO/ansible
lib/ansible/plugins/callback/yaml.py
Python
gpl-3.0
4,321
# coding: utf-8 # # Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
nagyistoce/oppia
core/domain/event_services.py
Python
apache-2.0
7,275
# Copyright (c) 2013 Gergely Nagy <algernon@madhouse-project.org> # # 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 without limitation # the rights to use, copy...
farhaven/hy
hy/models/keyword.py
Python
mit
1,599
# -*- coding: iso-8859-1 -*- # # SmartInfo-Converter for Dreambox/Enigma-2 # Version: 1.0 # Coded by Vali (c)2009-2011 # ####################################################################### from enigma import iServiceInformation from Components.Converter.Converter import Converter from Components.Element...
sklnet/opendroid-enigma2
lib/python/Components/Converter/valioTunerInfo.py
Python
gpl-2.0
1,889
from __future__ import print_function from tempfile import mkdtemp import os from shutil import rmtree import rpm import base64 class KeyError(Exception): def __init__(self, key, *args): Exception.__init__(self) self.args = args self.key = key def __str__(self): return ''+self....
OlegGirko/osc
osc/checker.py
Python
gpl-2.0
3,087
from . import driver
ddico/odoo
addons/hw_drivers/controllers/__init__.py
Python
agpl-3.0
20
import sys import os import unittest sys.path.insert(0, os.getcwd()) import pybootchartgui.parsing as parsing import pybootchartgui.process_tree as process_tree import pybootchartgui.main as main if sys.version_info >= (3, 0): long = int class TestProcessTree(unittest.TestCase): def setUp(self): se...
wwright2/dcim3-angstrom1
sources/openembedded-core/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py
Python
mit
4,203
#!/usr/bin/python ################################################################ # SEMTK_policy_check.py # # This file is parsing *init.rc and /system/* executable file # # Input: # Assume /system/* is generated first # # Output: # print warning log into ./semtk_policy_check/semtk_policy_check.log # ################...
visi0nary/mediatek
mt6732/mediatek/custom/common/sepolicy/SEMTK_policy_check.py
Python
gpl-2.0
27,354
#! /usr/bin/env python __author__ = "Cathy Lozupone" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Catherine Lozupone", "Greg Caporaso", "Jose Antonio Navas Molina"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Cathy Lozupone" __email__ = "lozupone@colorado.edu" ...
josenavas/qiime
scripts/convert_unifrac_sample_mapping_to_otu_table.py
Python
gpl-2.0
457
# -*- coding: utf-8 -*- u"""A module to test whether doctest recognizes some 2.2 features, like static and class methods. >>> print 'yup' # 1 yup We include some (random) encoded (utf-8) text in the text surrounding the example. It should be ignored: ЉЊЈЁЂ """ from test import test_support class C(object): ...
xbmc/atv2
xbmc/lib/libPython/Python/Lib/test/test_doctest2.py
Python
gpl-2.0
2,297
# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # # 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 # withou...
apavlo/h-store
third_party/python/boto/jsonresponse.py
Python
gpl-3.0
5,809
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-07-16 19:57 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0119_add_registrationprovider_perms_to_admin'), ('osf', '0119_add_asset_perms'), ...
erinspace/osf.io
osf/migrations/0120_merge_20180716_1457.py
Python
apache-2.0
349
"""Nearest Neighbor Classification""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck # Multi-output support by Arnaud Joly <a.joly@ul...
aabadie/scikit-learn
sklearn/neighbors/classification.py
Python
bsd-3-clause
14,359
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Settings/DownloadSettingsAction.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.p...
DenL/pogom-webhook
pogom/pgoapi/protos/POGOProtos/Settings/DownloadSettingsAction_pb2.py
Python
mit
2,206
""" Doctests for Reversion. These tests require Python version 2.5 or higher to run. """ from __future__ import with_statement import datetime from django.db import models, transaction from django.test import TestCase import reversion from reversion.models import Version, Revision from reversion.revisions import ...
mzdaniel/oh-mainline
vendor/packages/django-reversion/src/reversion/tests.py
Python
agpl-3.0
22,563
# -*- coding: utf-8 -*- from openerp import models, fields, api class res_partner_strip_name(models.Model): _inherit = 'res.partner' @api.one def write(self, vals): vals = self._check_name_field(vals) return super(res_partner_strip_name, self).write(vals) @api.model def create(s...
Trust-Code/addons-yelizariev
res_partner_strip_name/models.py
Python
lgpl-3.0
588
# 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...
theflofly/tensorflow
tensorflow/python/keras/applications/mobilenet.py
Python
apache-2.0
1,618
import re from django.db.backends import BaseDatabaseIntrospection # This light wrapper "fakes" a dictionary interface, because some SQLite data # types include variables in them -- e.g. "varchar(30)" -- and can't be matched # as a simple dictionary lookup. class FlexibleFieldLookupDict(object): # Maps SQL types t...
lzw120/django
django/db/backends/sqlite3/introspection.py
Python
bsd-3-clause
7,499
#!/usr/bin/env python # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.spread import pb from twisted.internet import reactor def main(): factory = pb.PBClientFactory() reactor.connectTCP("localhost", 8800, factory) d = factory.getRootObject() d.addCallbacks(got_obj...
mzdaniel/oh-mainline
vendor/packages/twisted/doc/core/howto/listings/pb/exc_client.py
Python
agpl-3.0
886
# Copyright (C) 2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2015 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
CoolCloud/taiga-back
taiga/base/api/utils/breadcrumbs.py
Python
agpl-3.0
2,886