code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
oddui/selenium
py/test/selenium/webdriver/common/executing_async_javascript_tests.py
Python
apache-2.0
8,403
# -*- coding: utf-8 -*- import datetime from django.utils import timezone from cms.models import Page, PageModeratorState, CMSPlugin, Title def page_changed(page, old_page=None, force_moderation_action=None): """Called from page post save signal. If page already had pk, old version of page is provided in old_...
mpetyx/palmdrop
venv/lib/python2.7/site-packages/cms/utils/moderator.py
Python
apache-2.0
2,924
# Copyright (C) 2009 Daniel Carvalho <idnael@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/LICENSE-2.0 # # Unless required by applicable la...
certik/pyjamas
library/pyjamas/gmaps/Interfaces.py
Python
apache-2.0
774
import itertools from _init_environment import SetHostMTurkConnection def description_filter(substring): return lambda hit: substring in hit.Title def disable_hit(hit): return conn.disable_hit(hit.HITId) def dispose_hit(hit): # assignments must be first approved or rejected for assignment in conn.get_assignment...
canvasnetworks/canvas
common/boto/mturk/test/cleanup_tests.py
Python
bsd-3-clause
1,385
# encoding: utf-8 """Tests for IPython.utils.path.py""" #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this s...
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/IPython/utils/tests/test_path.py
Python
bsd-3-clause
23,383
# -*- coding: utf-8 -*- """ proxy.py ~~~~~~~~ HTTP Proxy Server in Python. :copyright: (c) 2013 by Abhinav Singh. :license: BSD, see LICENSE for more details. """ from setuptools import setup import proxy classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: Web Enviro...
Goshin/proxy.py
setup.py
Python
bsd-3-clause
1,314
from django.core.management.base import BaseCommand, CommandError import olympia.core.logger from olympia.access.models import Group, GroupUser from olympia.users.models import UserProfile class Command(BaseCommand): help = 'Remove a user from a group.' log = olympia.core.logger.getLogger('z.users') d...
mozilla/addons-server
src/olympia/zadmin/management/commands/removeuserfromgroup.py
Python
bsd-3-clause
1,424
from rest_framework import status, viewsets from rest_framework.response import Response from crowdsourcing.models import * from rest_framework.decorators import detail_route, list_route from crowdsourcing.serializers.user import UserProfileSerializer, UserSerializer, UserPreferencesSerializer from django.contrib.auth....
saiphcita/crowdsource-platform
crowdsourcing/viewsets/user.py
Python
mit
4,423
# Copyright (c) 2016, Shin DongJin. See the LICENSE file # at the top-level directory of this distribution and at # https://github.com/LastOne817/graduate-adventure/blob/master/LICENSE # # Licensed under the MIT license <http://opensource.org/licenses/MIT>. # This file may not be copied, modified, or distributed except...
LastOne817/graduate-adventure
backend/graduate/urls.py
Python
mit
699
import numpy as np import cPickle, gzip import theano import theano.tensor as T import os import anglepy.data paths = { 7: os.environ['ML_DATA_PATH']+'/mnist/mnist_7.pkl.gz', 14: os.environ['ML_DATA_PATH']+'/mnist/mnist_14.pkl.gz', 28: os.environ['ML_DATA_PATH']+'/mnist/mnist_28.pkl.gz', } def load_theano...
zhenxuan00/mmdgm
mlp-mmdgm/anglepy/data/mnist.py
Python
mit
4,677
"""tests the "bind" attribute/argument across schema and SQL, including the deprecated versions of these arguments""" from sqlalchemy.testing import assert_raises, assert_raises_message from sqlalchemy import engine, exc from sqlalchemy import MetaData, ThreadLocalMetaData from sqlalchemy import Integer, text from sql...
alex/sqlalchemy
test/engine/test_bind.py
Python
mit
6,754
""" Helper __init__ file to make using these helpers easier. These imports should be namespaced properly when used in full projects! """ # Use proper namespacing and importing when using using this file # # 1. Use absolute imports # from __future__ import absolute_import # # 2. Use absolute path for imports # e.g. # ...
Vvkmnn/books
TensorFlowForMachineIntelligence/chapters/08_helpers/__init__.py
Python
gpl-3.0
580
from pootle.core.proxy import BaseProxy from pootle_statistics.models import Submission, SubmissionFields class StoreVersion(BaseProxy): pass class VersionedStore(object): version_class = StoreVersion def __init__(self, store): self.store = store @property def current_store(self): ...
unho/pootle
pootle/apps/pootle_store/versioned.py
Python
gpl-3.0
2,085
#!/usr/bin/python ''' Print which bits are set in a value. ''' from __future__ import print_function, division, unicode_literals import argparse def intdh(s): if s.startswith("0x"): return int(s[2:], 16) else: return int(s) parser = argparse.ArgumentParser(description='Print which bits are set...
commshare/etna_viv
tools/bits_set.py
Python
gpl-3.0
783
import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr, cpython_only) from test.script_helper import assert_python_ok, make_script, temp_dir import sys import time import gc import weakref try: import threading except ImportError: thread...
mancoast/CPythonPyc_test
fail/340_test_gc.py
Python
gpl-3.0
32,448
"""Catalog model tests.""" import ddt from django.test import override_settings from openedx.core.djangoapps.catalog.tests import mixins from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration from openedx.core.djangolib.testing.utils import CacheIsolationTestCase COURSE_CATA...
edx-solutions/edx-platform
openedx/core/djangoapps/catalog/tests/test_models.py
Python
agpl-3.0
2,439
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
penelopy/luigi
luigi/interface.py
Python
apache-2.0
12,574
# Copyright (c) 2010-2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
tsli/test
swift/common/middleware/proxy_logging.py
Python
apache-2.0
12,130
# 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...
gnieboer/tensorflow
tensorflow/python/framework/ops.py
Python
apache-2.0
159,310
# Copyright 2012 OpenStack Foundation # 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 # # Unle...
zouyapeng/horizon_change
openstack_dashboard/dashboards/admin/instances/tables.py
Python
apache-2.0
7,557
# # Copyright (c) 2015 Juniper Networks, Inc. All rights reserved. # from snmp import SnmpSession import copy, traceback, time, ConfigParser from vnc_api.vnc_api import VncApi class DeviceDict(dict): def __init__(self, name, vnc, *a, **k): super(DeviceDict, self).__init__(*a, **k) self.name = name ...
facetothefate/contrail-controller
src/analytics/contrail-snmp-collector/contrail_snmp_collector/device_config.py
Python
apache-2.0
6,214
#----------------------------------------------------------------------------- # # Configuration for YouCompleteMe Vim plugin # # http://valloric.github.io/YouCompleteMe/ # #----------------------------------------------------------------------------- from os.path import realpath, dirname basedir = dirname(realpath...
oxidase/osrm-backend
third_party/vtzero/.ycm_extra_conf.py
Python
bsd-2-clause
1,199
import random from ..func import Func, TestData def rand_str(length, byte_list=None): if byte_list is None: return "".join(chr(random.randint(0, 255)) for _ in xrange(length)) return "".join(random.choice(byte_list) for _ in xrange(length)) class strncmp(Func): non_null = [chr(i) for i in rang...
Ruide/angr-dev
angr/angr/analyses/identifier/functions/strncmp.py
Python
bsd-2-clause
3,325
""" Moran's I Spatial Autocorrelation Statistics """ __author__ = "Sergio J. Rey <srey@asu.edu>" from pysal.common import * from pysal.weights.spatial_lag import lag_spatial as slag from pysal.esda.smoothing import assuncao_rate __all__ = ["Moran", "Moran_Local", "Moran_BV", "Moran_BV_matrix", "Moran_Rate"...
AlanZatarain/pysal
pysal/esda/moran.py
Python
bsd-3-clause
25,670
#!/usr/bin/env python # Copyright (c) 2010 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. """Wrapper around third_party/WebKit/Tools/Scripts/run-webkit-tests""" import os import subprocess import sys def main(): c...
hujiajie/pa-chromium
webkit/tools/layout_tests/run_webkit_tests.py
Python
bsd-3-clause
788
""" This contains a simple view for rendering the webclient page and serve it eventual static content. """ from django.shortcuts import render from evennia.players.models import PlayerDB def webclient(request): """ Webclient page template loading. """ # analyze request to find which port we are on...
ypwalter/evennia
evennia/web/webclient/views.py
Python
bsd-3-clause
783
#!/usr/bin/env python # Copyright (c) 2012 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. """A tool used to run a Chrome test executable and process the output. This script is used by the buildbot slaves. It must be run ...
hgl888/chromium-crosswalk
infra/scripts/legacy/scripts/slave/runtest.py
Python
bsd-3-clause
30,445
""" Functions for reading and writing Varian binary (fid) files and Varian parameter (procpar) files. Both file formats are documented in: * Varain MR News 2005-04-18 Importing Binary VnmrJ / VNMR FIDs into Third Party Software and VnmrJ / VNMR FID Data Format * VnmrJ User Programming - Chapter 5: Parameters and Dat...
thegooglecodearchive/nmrglue
nmrglue/fileio/varian.py
Python
bsd-3-clause
52,792
# This function is from lecture of Day13 import scipy.stats from scipy.stats import gamma import numpy as np def hrf(tr_times): """ Return values for HRF at given times """ # Gamma pdf for the peak peak_values = gamma.pdf(tr_times, 6) # Gamma pdf for the undershoot undershoot_values = gamma.pdf(tr...
giancarloescobar/project-kappa
code/utils/harmonic.py
Python
bsd-3-clause
467
# If you're new to dictionaries, you might want to start with dict_access.py # We create a dictionary. contacts = { 'Shannon': '202-555-1234', 'Amy': '410-515-3000', 'Jen': '301-600-5555', 'Julie': '202-333-9876' } name = raw_input("Enter the name of the person whose phone number you want: ") print ...
Pshellvon/python-lessons
section_10_(dictionaries)/dict_get.py
Python
mit
834
#!/usr/bin/env python3 # Copyright (c) 2014-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test RPCs related to blockchainstate. Test the following RPCs: - getblockchaininfo - getdeploy...
particl/particl-core
test/functional/rpc_blockchain.py
Python
mit
23,794
""" Support for Tellstick Net/Telstick Live. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.tellduslive/ """ import logging from datetime import datetime from homeassistant.components import tellduslive from homeassistant.const import ( ATTR...
deisi/home-assistant
homeassistant/components/sensor/tellduslive.py
Python
mit
4,434
# do not import any allmydata modules at this level. Do that from inside # individual functions instead. import struct, time, os, sys from twisted.python import usage, failure from twisted.internet import defer from twisted.scripts import trial as twisted_trial from foolscap.logging import cli as foolscap_cli from all...
pombredanne/tahoe-lafs
src/allmydata/scripts/debug.py
Python
gpl-2.0
43,180
# -*- 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...
KodiColdkeys/coldkeys-addons
repository/plugin.video.white.devil/resources/lib/sources/moviexk_wp_jh.py
Python
gpl-2.0
6,002
# -*- coding: utf-8 -*- ''' Test to make sure generated datasets are sane. ''' # needed for python 3 compatibility from __future__ import absolute_import, division try: import unittest2 as unittest except ImportError: import unittest from datetime import datetime import numpy as np import quantities as pq ...
CINPLA/expipe-dev
python-neo/neo/test/coretest/test_generate_datasets.py
Python
gpl-3.0
23,674
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. import pytest from pages.firefox.whatsnew.whatsnew_60 import FirefoxWhatsNew60Page @pytest.mark.skip_if_not_firefox(...
pascalchevrel/bedrock
tests/functional/firefox/whatsnew/test_whatsnew_60.py
Python
mpl-2.0
1,801
# -*- encoding: utf-8 -*- import sys import unittest from PyQt4 import QtGui import pilasengine class TestGeneral(unittest.TestCase): app = QtGui.QApplication(sys.argv) def setUp(self): import pilasengine self.pilas = pilasengine.iniciar() def testEscribirConAvisar(self): actor =...
fsalamero/pilas
pilasengine/tests/test_general.py
Python
lgpl-3.0
403
#!/usr/bin/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 Apache License, Vers...
sparkslabs/kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/SimpleGraphicalApps/TextBox/Textbox_TextDisplayer_Demo.py
Python
apache-2.0
1,119
"""Constants for the Alexa integration.""" from collections import OrderedDict from homeassistant.components.climate import const as climate from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT DOMAIN = "alexa" EVENT_ALEXA_SMART_HOME = "alexa_smart_home" # Flash briefing constants CONF_UID = "uid" CONF_TITL...
Danielhiversen/home-assistant
homeassistant/components/alexa/const.py
Python
apache-2.0
5,980
import json import os from django.conf import settings from django.core.management.base import BaseCommand from django.core.files.storage import default_storage as storage import commonware.log import amo from applications.models import Application, AppVersion log = commonware.log.getLogger('z.cron') # The validato...
wagnerand/zamboni
apps/applications/management/commands/dump_apps.py
Python
bsd-3-clause
1,396
########################################################################## # # Copyright 2011 Jose Fonseca # Copyright 2008-2009 VMware, Inc. # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to...
tuanthng/apitrace
specs/d3d9types.py
Python
mit
30,557
import cherrypy # 這是 MAN 類別的定義 ''' # 在 application 中導入子模組 import programs.cdag16.man as cdag16_man # 加入 cdag16 模組下的 man.py 且以子模組 man 對應其 MAN() 類別 root.cdag16.man = cdag16_man.MAN() # 完成設定後, 可以利用 /cdag16/man/assembly # 呼叫 man.py 中 MAN 類別的 assembly 方法 ''' class MAN(object): # 各組利用 index 引導隨後的程式執行 @cherrypy.exp...
2014cdag11/2014cadg11
wsgi/programs/cdag16/man.py
Python
gpl-2.0
13,294
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
sem-geologist/hyperspy
hyperspy/misc/ipython_tools.py
Python
gpl-3.0
3,083
# -*- coding: utf-8 -*- """ Platform specific utility functions, dummy version This has empty implementation of the platutils functions, used for unsupported operating systems. Authors ------- - Ville Vainio <vivainio@gmail.com> """ #***************************************************************************** # ...
mastizada/kuma
vendor/packages/ipython/IPython/platutils_dummy.py
Python
mpl-2.0
1,009
""" This page is in the table of contents. Splodge turns the extruder on just before the start of a thread. This is to give the extrusion a bit anchoring at the beginning. The splodge manual page is at: http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Splodge ==Operation== The default 'Activate Splodge' check...
nophead/Skeinforge50plus
skeinforge_application/skeinforge_plugins/craft_plugins/splodge.py
Python
agpl-3.0
14,880
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/raw/GL/ARB/depth_clamp.py
Python
lgpl-3.0
535
from .base import BaseJump class Goto(BaseJump): def __init__(self, parent, target): super(Goto, self).__init__(parent, []) self.successors = [target] def replaceBlocks(self, blockDict): self.successors = [blockDict.get(key,key) for key in self.successors] def getNormalSuccessors(...
xtiankisutsa/MARA_Framework
tools/decompilers/Krakatau/Krakatau/ssa/ssa_jumps/goto.py
Python
lgpl-3.0
507
# 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...
strint/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator.py
Python
apache-2.0
50,597
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: david@reciprocitylabs.com # Maintained By: david@reciprocitylabs.com from behave import given, then from tests.ggrc.behave.utils import Example, se...
prasannav7/ggrc-core
src/service_specs/steps/property_checks.py
Python
apache-2.0
7,299
# 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...
apache/incubator-airflow
airflow/kubernetes/secret.py
Python
apache-2.0
5,242
# Copyright 2010-2011 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, 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...
akash1808/nova_test_latest
nova/tests/unit/api/openstack/compute/plugins/v3/test_servers.py
Python
apache-2.0
163,669
# $Id: boost.jam 62249 2010-05-26 19:05:19Z steven_watanabe $ # Copyright 2008 Roland Schwarz # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Boost library support module. # # This module allows to use the boost library fr...
stan-dev/math
lib/boost_1.75.0/tools/build/src/contrib/boost.py
Python
bsd-3-clause
11,232
from __future__ import unicode_literals from django.db.models import Count, Max from django.shortcuts import get_object_or_404 from django.template.response import TemplateResponse from django.utils.translation import ugettext_lazy as _ from .forms import CustomerSearchForm from ..views import staff_member_required f...
laosunhust/saleor
saleor/dashboard/customer/views.py
Python
bsd-3-clause
1,809
from collections import defaultdict import i18naddress from django import forms from django.forms.forms import BoundField from django.utils.translation import pgettext_lazy, pgettext from django_countries.data import COUNTRIES from .models import Address COUNTRY_FORMS = {} UNKNOWN_COUNTRIES = set() AREA_TYPE_TRANS...
itbabu/saleor
saleor/userprofile/i18n.py
Python
bsd-3-clause
7,731
#!/usr/bin/env python # -*- coding: utf-8 -*- """Exercise 3.15 from Kane 1985. A robot arm, composed of Rigid Bodies 'A', 'B', 'C', operates in Reference Frame E. 'A*', 'B*', 'C*' are Points marking the centers of mass for the Rigid Bodies 'A', 'B', 'C'. Rigid Body 'D' also is lies in Reference Frame 'E'. The center o...
Shekharrajak/pydy
examples/Kane1985/Chapter2/Ex3.15.py
Python
bsd-3-clause
4,583
# Copyright 2017, 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, ...
martbhell/wasthereannhlgamelastnight
src/lib/google/api_core/future/_helpers.py
Python
mit
1,248
import android import json import time from urllib import urlencode from urllib2 import urlopen hello_msg = "Welcome to Coach Kelly's Timing App" list_title = 'Here is your list of athletes:' quit_msg = "Quitting Coach Kelly's App." web_server = 'http://192.168.1.34:8080' get_names_cgi = '/cgi-bin/g...
simontakite/sysadmin
pythonscripts/headfirst/hfpy_code/08-Mobile-App-Development_Small-Devices/page280.py
Python
gpl-2.0
1,581
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # Authors: # Michael Hale Ligh <michael.ligh@mnin.org> # # Contributors/References: # ## Based on sslkeyfinder: http://www.trapkit.de/research/sslkeyfinder/ # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/...
Cisco-Talos/pyrebox
volatility/volatility/plugins/dumpcerts.py
Python
gpl-2.0
10,953
""" Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the 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....
Chibin/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/package/contrib/pgcrypto/functional/__init__.py
Python
apache-2.0
6,969
#!/usr/bin/env python # Copyright (c) PLUMgrid, Inc. # Licensed under the Apache License, Version 2.0 (the "License") # test program to count the packets sent to a device in a .5 # second period from ctypes import c_uint, c_ulong, Structure from netaddr import IPAddress from bcc import BPF from subprocess import chec...
romain-intel/bcc
tests/python/test_stat1.py
Python
apache-2.0
2,632
# 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...
adit-chandra/tensorflow
tensorflow/python/keras/engine/node.py
Python
apache-2.0
7,398
# Copyright 2012 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 law ...
sjsucohort6/openstack
python/venv/lib/python2.7/site-packages/oslo_config/iniparser.py
Python
mit
4,207
#!/usr/bin/python """ Starter code for the validation mini-project. The first step toward building your POI identifier! Start by loading/formatting the data After that, it's not our code anymore--it's yours! """ import pickle import sys sys.path.append("../tools/") from feature_format import featur...
harish-garg/Machine-Learning
udacity/enron/ud120-projects-master/validation/validate_poi.py
Python
mit
800
from __future__ import absolute_import import os from io import BytesIO from django.core.files.storage import default_storage from django.core.files.uploadedfile import InMemoryUploadedFile from ckeditor_uploader import utils try: from PIL import Image, ImageOps except ImportError: import Image import I...
samdowd/drumm-farm
drumm_env/lib/python2.7/site-packages/ckeditor_uploader/image/pillow_backend.py
Python
mit
1,645
from mock import patch from pip.vcs.git import Git from tests.test_pip import (reset_env, run_pip, _create_test_package) def test_get_tag_revs_should_return_tag_name_and_commit_pair(): env = reset_env() version_pkg_path = _create_test_package(env) env.run('git', 'tag', '0.1', c...
evnpr/herokupython
vendor/pip-1.2.1/tests/test_vcs_git.py
Python
mit
2,956
from __future__ import unicode_literals import re import unittest from unittest import skipUnless from django.db import connection from django.contrib.gis import gdal from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import ( HAS_SPATIAL_DB, no_mysql, no_oracle, no_spatialite, m...
912/M-new
virtualenvironment/experimental/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/tests.py
Python
gpl-2.0
37,785
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
kissmetrics/spark
python/pyspark/ml/feature.py
Python
apache-2.0
125,204
import unittest, time, sys, random, math, getpass sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_import as h2i, h2o_util, h2o_print as h2p, h2o_browse as h2b ENABLE_ASSERTS = False ROWS = 1000000 COLS = 2 def write_syn_dataset(csvPathname, rowCount, colCount, SEED, enumChoices, intChoices): r1...
calvingit21/h2o-2
py/testdir_multi_jvm/test_mixed_int_enum_many.py
Python
apache-2.0
6,340
#!/usr/bin/env python """A wrapper for numbers.""" import numbers import apifunction import computedobject import ee_exception # Using lowercase function naming to match the JavaScript names. # pylint: disable=g-bad-name class Number(computedobject.ComputedObject): """An object to represent numbers.""" _ini...
wemanuel/smry
smry/server-auth/ee/ee_number.py
Python
apache-2.0
1,597
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Code coverage measurement for Python""" # Distutils setup for coverage.py # This file is used unchanged under all versions of Python, 2.x and 3.x. import os im...
catapult-project/catapult
third_party/coverage/setup.py
Python
bsd-3-clause
6,119
#!/usr/bin/env python # Copyright (c) 2012 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. """ This script invokes the go build tool. Must be called as follows: python go.py <go-binary> <build directory> <output file> <src...
krieger-od/nwjs_chromium.src
build/go/go.py
Python
bsd-3-clause
2,028
# -*- coding: utf-8 -*- """ Tests for the language API. """ from django.test import TestCase from django.test.utils import override_settings from django.utils import translation from openedx.core.djangoapps.lang_pref import api as language_api class LanguageApiTest(TestCase): """ Tests of the language APIs....
synergeticsedx/deployment-wipro
openedx/core/djangoapps/lang_pref/tests/test_api.py
Python
agpl-3.0
1,175
#!/usr/bin/env python3 # Copyright (c) 2013 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 os import unittest from idl_lexer import IDLLexer # # FileToTokens # # From a source file generate a list of tokens. # d...
nwjs/chromium.src
tools/idl_parser/idl_lexer_test.py
Python
bsd-3-clause
2,636
from peewee import * from playhouse.fields import ManyToManyField from playhouse.tests.base import database_initializer from playhouse.tests.base import ModelTestCase db = database_initializer.get_in_memory_database() class BaseModel(Model): class Meta: database = db class User(BaseModel): username ...
Sunzhifeng/peewee
playhouse/tests/test_manytomany.py
Python
mit
10,762
"""SCons.Scanner.LaTeX This module implements the dependency scanner for LaTeX code. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associat...
aubreyrjones/libesp
scons_local/scons-local-2.3.0/SCons/Scanner/LaTeX.py
Python
mit
16,268
# -*- encoding: utf-8 -*- ############################################################################## # # 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...
alfredoavanzosc/odoo-addons
project_issue_ext/models/__init__.py
Python
agpl-3.0
887
# 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...
karllessard/tensorflow
tensorflow/python/debug/lib/debug_graphs_test.py
Python
apache-2.0
4,297
# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import copy import io import sys import portage from portage import os from portage import _encodings from portage import _unicode_encode from portage import _unicode_decode from portage.checksum import _hash_fi...
nullishzero/Portage
pym/_emerge/EbuildFetcher.py
Python
gpl-2.0
8,710
""" WSGI config for opentreemap 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...
johnsonc/OTM2
opentreemap/opentreemap/wsgi.py
Python
gpl-3.0
1,434
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, 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_ve...
tersmitten/ansible
lib/ansible/modules/network/aci/mso_schema_site_vrf_region_cidr_subnet.py
Python
gpl-3.0
8,332
# 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...
GoogleCloudPlatform/mlops-on-gcp
workshops/tfx-caip-tf23/lab-04-tfx-metadata/solutions/pipeline/model.py
Python
apache-2.0
11,493
# -*- coding: utf-8 -*- ######################################################################### ## This scaffolding model makes your app work on Google App Engine too ## File is released under public domain and you can use without limitations ######################################################################### ...
lcp0578/FrameworkBenchmarks
frameworks/Python/web2py/app/app/models/db.py
Python
bsd-3-clause
1,434
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ....testing import assert_equal from ..preprocess import VBMSegment def test_VBMSegment_inputs(): input_map = dict(bias_corrected_affine=dict(field='estwrite.output.bias.affine', usedefault=True, ), bias_corrected_native=dict(field='estwrite.o...
sgiavasis/nipype
nipype/interfaces/spm/tests/test_auto_VBMSegment.py
Python
bsd-3-clause
4,218
# coding : utf -8 from quokka import admin from quokka.core.admin.models import BaseContentAdmin from quokka.core.widgets import TextEditor, PrepopulatedText from .models import Post from quokka.utils.translation import _l class PostAdmin(BaseContentAdmin): column_searchable_list = ('title', 'body', 'summary') ...
cbeloni/quokka
quokka/modules/posts/admin.py
Python
mit
878
from testsuite.base_test import BaseTest from core.weexceptions import ArgparseError from core.vectors import PhpCode from core.vectors import Os from core import modules from core.sessions import SessionURL from core import messages import logging import os class SystemInfo(BaseTest): def setUp(self): se...
Renji/weevely3
testsuite/test_shell_sh.py
Python
gpl-3.0
2,415
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2004-2011 # Pexego Sistemas Informáticos. (http://pexego.es) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
Jortolsa/l10n-spain
l10n_es_aeat/wizard/__init__.py
Python
agpl-3.0
989
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # 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...
wrouesnel/ansible
lib/ansible/modules/system/open_iscsi.py
Python
gpl-3.0
11,514
"""Generic thread tests. Meant to be used by dummy_thread and thread. To allow for different modules to be used, test_main() can be called with the module to use as the thread implementation as its sole argument. """ import dummy_thread as _thread import time import Queue import random import unittest from test impo...
HiSPARC/station-software
user/python/Lib/test/test_dummy_thread.py
Python
gpl-3.0
7,169
import warnings warnings.simplefilter('ignore', Warning) from content_gfk.tests.fields import * # flake8: noqa from content_gfk.tests.resources import * # flake8: noqa
cbxcube/bezrealitky.py
tests/content_gfk/tests/__init__.py
Python
bsd-3-clause
171
# -*- coding: utf-8 -*- import datetime import json from gluon import current, Field, IS_NOT_EMPTY, INPUT, A, SQLFORM, URL from s3 import s3_str, s3_encode_iso_datetime, s3_fullname, S3DateTime from s3db.dvr import DVRRegisterCaseEvent # ============================================================================= ...
flavour/eden
modules/templates/historic/DRK/food.py
Python
mit
25,409
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
mahak/spark
python/pyspark/sql/tests/test_serde.py
Python
apache-2.0
6,219
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2015 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
nwjs/chromium.src
third_party/protobuf/objectivec/DevTools/pddm.py
Python
bsd-3-clause
24,062
#!/usr/bin/env python import testlog_parser, sys, os, xml, glob, re from table_formatter import * from optparse import OptionParser numeric_re = re.compile("(\d+)") cvtype_re = re.compile("(8U|8S|16U|16S|32S|32F|64F)C(\d{1,3})") cvtypes = { '8U': 0, '8S': 1, '16U': 2, '16S': 3, '32S': 4, '32F': 5, '64F': 6 } convert...
lupustr3/opencv_tools
ts_tools/summary.py
Python
bsd-3-clause
13,963
from email.MIMEBase import MIMEBase from django.core.mail.backends.base import BaseEmailBackend from django.core.mail import EmailMultiAlternatives from google.appengine.api import mail as aeemail from google.appengine.runtime import apiproxy_errors def _send_deferred(message, fail_silently=False): try: ...
wangjun/djangae
djangae/mail.py
Python
bsd-3-clause
3,133
import cgi import mimetypes import os import posixpath import shutil import stat import tempfile from importlib import import_module from os import path from urllib.request import urlretrieve import django from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.co...
sametmax/Django--an-app-at-a-time
ignore_this_directory/django/core/management/templates.py
Python
mit
13,468
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 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 option) any later...
crepererum/invenio
invenio/modules/jsonalchemy/jsonext/engines/memory.py
Python
gpl-2.0
3,669
profiles = dict() def add(words): id = int(words["q"]) del words["q"] print "profile",id,"words=",words if not profiles.has_key(id): profiles[id] = list() profiles[id].append(words)
kinsamanka/machinekit
configs/sim/axis/remap/list-recorder/python/recorder.py
Python
lgpl-2.1
220
# Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2010-2012 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/LICENS...
yosshy/nova
nova/virt/xenapi/agent.py
Python
apache-2.0
18,768
from rez.plugin_managers import extend_path __path__ = extend_path(__path__, __name__)
saddingtonbaynes/rez
src/rezplugins/shell/__init__.py
Python
gpl-3.0
87
# -*- coding: utf-8 -*- """ babel.util ~~~~~~~~~~ Various utility classes and functions. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ import codecs from datetime import timedelta, tzinfo import os import re import textwrap from babel._compat import izip...
thonkify/thonkify
src/lib/babel/util.py
Python
mit
7,611