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
#!/usr/bin/env python """ @file ion/core/security/authentication.py @author Roger Unwin @author Dorian Raymer @brief routines for working with crypto (x509 certificates and private_keys) """ import binascii import urllib import os import datetime import hashlib try: from M2Crypto import EVP, X509 except ImportEr...
crchemist/scioncc
src/pyon/core/security/authentication.py
Python
bsd-2-clause
8,374
"""Add is_draft status to queries and dashboards Revision ID: 65fc9ede4746 Revises: Create Date: 2016-12-07 18:08:13.395586 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. from sqlalchemy.exc import ProgrammingError revision = "65fc9ede4746" down_revision = None branch_l...
getredash/redash
migrations/versions/65fc9ede4746_add_is_draft_status_to_queries_and_.py
Python
bsd-2-clause
1,370
from django import http from django.conf.urls import include, patterns, url from rest_framework.routers import SimpleRouter from lib.misc.urlconf_decorator import decorate import amo from amo.decorators import write from amo.urlresolvers import reverse from mkt.api.base import SubRouter from mkt.developers.api impo...
wagnerand/zamboni
mkt/developers/urls.py
Python
bsd-3-clause
8,583
# -- encoding: UTF-8 -- """ These tests do not verify any results and should not be run when looking at improving test coverage. They just verify that basic operations don't fail due to odd corner cases on any locale that we ship. """ from datetime import datetime import pytest from babel import Locale from babel imp...
mitsuhiko/babel
tests/test_smoke.py
Python
bsd-3-clause
1,162
class queue(object): """ A queue is a container of objects (a linear collection) that are inserted and removed according to the first-in first-out (FIFO) principle. >>> from pydsa import queue >>> q = queue() >>> q.enqueue(5) >>> q.enqueue(8) >>> q.enqueue(19) >>> q.dequeue() ...
rehassachdeva/pydsa
pydsa/queue.py
Python
bsd-3-clause
786
# -*- mode: python; coding: utf-8 -*- import sys import drydrop.lib.walker from drydrop.app.core.model import Model drydrop.lib.walker.import_submodules(__file__, sys.modules[__name__], Model)
harperreed/drydrop
dryapp/drydrop/app/models/__init__.py
Python
bsd-3-clause
193
from json import dumps, loads import logging from tornado.web import authenticated from tornado.escape import url_escape from amgut import media_locale, text_locale from amgut.connections import ag_data, redis from amgut.handlers.base_handlers import BaseHandler from amgut.lib.util import store_survey, make_survey_cl...
josenavas/american-gut-web
amgut/handlers/human_survey.py
Python
bsd-3-clause
7,184
import multiprocessing import numpy as np def configure(num_jobs=8, TEST=False, subtract=0, num_proc=None, num_thread_per_proc=None): ''' num_jobs is typically the # of genes we are parallelizing over ''' if num_proc is None: num_proc = multiprocessing.cpu_count() - subtract if num_jobs >...
mayavanand/RMMAFinalProject
build/lib/azimuth/local_multiprocessing.py
Python
bsd-3-clause
821
# -*- coding: utf-8 -*- """Generate graphs with a given degree sequence or expected degree sequence. """ # Copyright (C) 2004-2016 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import heapq from itertools i...
SanketDG/networkx
networkx/generators/degree_seq.py
Python
bsd-3-clause
27,099
import os import unittest import tempfile import shutil from mock import MagicMock, Mock from catkin_pkg.package_templates import _safe_write_files, create_package_files, \ create_cmakelists, create_package_xml, PackageTemplate, _create_include_macro, \ _create_targetlib_args from catkin_pkg.package import pa...
ipa-mdl/catkin_pkg
test/test_templates.py
Python
bsd-3-clause
14,395
#! /usr/bin/env python import sys, time import skytools.psycopgwrapper import skytools._cquoting, skytools._pyquoting from decimal import Decimal # create a DictCursor row class fake_cursor: index = {'id': 0, 'data': 1} description = ['x', 'x'] dbrow = skytools.psycopgwrapper._CompatRow(fake_cursor()) dbrow[0...
overdrive3000/skytools
tests/quoting/regtest.py
Python
isc
2,848
from __future__ import unicode_literals from django.core.exceptions import ObjectDoesNotExist from django.db.models import Q from djblets.util.decorators import augment_method_from from djblets.webapi.decorators import webapi_login_required from djblets.webapi.responses import WebAPIResponsePaginated from reviewboard...
custode/reviewboard
reviewboard/webapi/resources/draft_file_attachment.py
Python
mit
4,019
# -*- coding: utf-8 -*- try: # Python 2.7 from collections import OrderedDict except: # Python 2.6 from gluon.contrib.simplejson.ordered_dict import OrderedDict from gluon import current from gluon.storage import Storage def config(settings): """ Template settings for CERT (Community Emer...
nck0405/ChennaiEden
modules/templates/CERT/config.py
Python
mit
7,115
### # Copyright (c) 2015, butterscotchstallion # All rights reserved. # # ### import supybot.conf as conf import supybot.registry as registry try: from supybot.i18n import PluginInternationalization _ = PluginInternationalization('IMDB') except: # Placeholder that allows to run the plugin on a bot # wi...
butterscotchstallion/limnoria-plugins
IMDB/config.py
Python
mit
1,389
import random import numpy as np import tensorflow as tf from language_model import LM from hparams import HParams def get_test_hparams(): return HParams( batch_size=21, num_steps=12, num_shards=2, num_layers=1, learning_rate=0.2, max_grad_norm=1.0, vocab_s...
okuchaiev/f-lm
language_model_test.py
Python
mit
1,667
# Copyright 2016 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/auth/crypt/_python_rsa.py
Python
mit
5,973
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
SUSE/azure-sdk-for-python
azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_create_or_update_parameters.py
Python
mit
4,958
#!/usr/bin/env python import sys def gen_test(n): print "CREATE TABLE t (a CHAR(%d));" % (n) for v in [ 'hi', 'there', 'people' ]: print "INSERT INTO t VALUES ('%s');" % (v) for i in range(2,256): if i < n: print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/" print "--e...
tplavcic/percona-xtradb-cluster
mysql-test/suite/tokudb/t/change_column_char.py
Python
gpl-2.0
1,383
from enigma import eComponentScan, iDVBFrontend from Components.NimManager import nimmanager as nimmgr from Tools.Transponder import getChannelNumber class ServiceScan: Idle = 1 Running = 2 Done = 3 Error = 4 Errors = { 0: _("error starting scanning"), 1: _("error while scanning"), 2: _("no resource manag...
mrnamingo/vix4-34-enigma2-bcm
lib/python/Components/ServiceScan.py
Python
gpl-2.0
7,567
# -*- coding: utf-8 -*- # # hl_api_exceptions.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 Licen...
weidel-p/nest-simulator
pynest/nest/lib/hl_api_exceptions.py
Python
gpl-2.0
9,411
'''OpenGL extension NV.texture_env_combine4 This module customises the behaviour of the OpenGL.raw.GL.NV.texture_env_combine4 to provide a more Python-friendly API Overview (from the spec) New texture environment function COMBINE4_NV allows programmable texture combiner operations, including ADD ...
D4wN/brickv
src/build_data/windows/OpenGL/GL/NV/texture_env_combine4.py
Python
gpl-2.0
1,343
#!/usr/bin/env python # -*- mode: python; -*- #============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation...
jeffchao/xen-3.3-tcg
tools/python/xen/util/vscsi_util.py
Python
gpl-2.0
4,265
########################################################################### # # This program is part of Zenoss Core, an open source monitoring platform. # Copyright (C) 2008-2010, Zenoss Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License ...
NetNow/wmi-samba
pysamba/wbem/__init__.py
Python
gpl-2.0
567
#-*- coding: utf-8 -*- __author__ = 'tsbc' import sys reload(sys) sys.setdefaultencoding('utf-8')
radiateboy/Demo126mail
testcase/public/__init__.py
Python
gpl-2.0
98
""" Indivo-specific extensions to httpdomain for loading autogenerated API docs. Adapted from: sphinxcontrib.httpdomain ~~~~~~~~~~~~~~~~~~~~~~~~ The HTTP domain for documenting RESTful HTTP APIs. :copyright: Copyright 2011 by Hong Minhee :license: BSD, see LICENSE for details. """ ...
newmediamedicine/indivo_server_1_0
doc/sphinx/localext/httpdomain.py
Python
gpl-3.0
11,915
#!/usr/bin/python import os import sys import time import shutil import ziputil # snapshot.py # Exports the IMOS Toolbox from SVN and # # - Creates an archive of the source # - Runs Util/imosPackage.m to package the source # # These files are submitted back to the project as file downloads. # # python, svn (Sli...
petejan/imos-toolbox
snapshot/snapshot.py
Python
gpl-3.0
1,834
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
hclivess/Stallion
nuitka/Cryptodome/Hash/SHA3_224.py
Python
gpl-3.0
5,302
# # (c) 2016 Red Hat Inc. # # 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 d...
sestrella/ansible
test/units/modules/network/ios/test_ios_ping.py
Python
gpl-3.0
2,838
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. ...
adam111316/SickGear
lib/chardet/eucjpprober.py
Python
gpl-3.0
3,754
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, date from lxml import etree import time from openerp import api from openerp import SUPERUSER_ID from openerp import tools from openerp.osv import fields, osv from openerp.tools.translate ...
be-cloud-be/horizon-addons
server/addons/project/project.py
Python
agpl-3.0
53,981
""" This module contains configuration settings via waffle flags for the Video Pipeline app. """ from openedx.core.djangoapps.waffle_utils import WaffleFlagNamespace, CourseWaffleFlag # Videos Namespace WAFFLE_NAMESPACE = 'videos' # Waffle flag telling whether youtube is deprecated. DEPRECATE_YOUTUBE = 'deprecate_you...
ahmedaljazzar/edx-platform
openedx/core/djangoapps/video_pipeline/config/waffle.py
Python
agpl-3.0
681
""" Utility Mixins for unit tests """ import json import sys import six from django.conf import settings from django.test import TestCase from django.urls import clear_url_caches, resolve from mock import patch from util.db import OuterAtomic if six.PY3: from importlib import reload class UrlResetMixin(objec...
edx-solutions/edx-platform
common/djangoapps/util/testing.py
Python
agpl-3.0
5,905
#!/usr/bin/python from ming import * import sys mediadir = sys.argv[1]+'/../Media' m = SWFMovie(); font = SWFFont(mediadir + "/font01.fdb") text = SWFText(2); text.setFont(font); text.setHeight(20); text.setColor(0x00, 0x00, 0x00, 0xff); text.addString("abc"); font2 = SWFFont(mediadir + "/test.ttf") text.setF...
gg0/libming-debian
test/Text/test02.py
Python
lgpl-2.1
451
# 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) class PyAzureMgmtAppconfiguration(PythonPackage): """Microsoft Azure App Configuration Management Client Library for ...
LLNL/spack
var/spack/repos/builtin/packages/py-azure-mgmt-appconfiguration/package.py
Python
lgpl-2.1
985
# mod_11_10.py - functions for performing the ISO 7064 Mod 11, 10 algorithm # # Copyright (C) 2010, 2011, 2012, 2013 Arthur de Jong # # This library 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; eithe...
dchoruzy/python-stdnum
stdnum/iso7064/mod_11_10.py
Python
lgpl-2.1
2,129
from __future__ import absolute_import import ast from myhdl._util import _flatten class Data(): pass def _getCellVars(symdict, arg): gens = _flatten(arg) data = Data() data.symdict = symdict v = _GetCellVars(data) for gen in gens: v.visit(gen.ast) return list(data.objset) cla...
DeadBugEngineering/myHDL_shenanigans
ssd1306_8x64bit_driver/myhdl_10dev/lib/python2.7/site-packages/myhdl-1.0.dev0-py2.7.egg/myhdl/_getcellvars.py
Python
lgpl-2.1
594
"""Demo of using urwid with Python 3.4's asyncio. This code works on older Python 3.x if you install `asyncio` from PyPI, and even Python 2 if you install `trollius`! """ from __future__ import print_function import asyncio from datetime import datetime import sys import weakref import urwid from urwid.raw_display i...
foreni-packages/urwid
examples/asyncio_socket_server.py
Python
lgpl-2.1
5,449
# 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) import os import pytest import llnl.util.tty as tty def test_get_timestamp(monkeypatch): """Ensure the results of ...
LLNL/spack
lib/spack/spack/test/llnl/util/tty/tty.py
Python
lgpl-2.1
3,017
#!/usr/bin/env python """ CsPython Tutorial Example 2 By Mark Gossage (mark@gossage.cjb.net) A pure-Python script to show the use of Crystal Space. To use this, ensure that your PYTHONPATH, CRYSTAL, and LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH for MacOS/X; or PATH for Windows) variables are set approrpriately, and then ...
baoboa/Crystal-Space
scripts/python/tutorial2.py
Python
lgpl-2.1
8,916
# Copyright 2012,2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 NTT DOCOMO, 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 # # ...
srajag/nova
nova/virt/baremetal/pxe.py
Python
apache-2.0
19,767
# Copyright (c) 2016 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 # # Unless required by ap...
cloudbase/cinder
cinder/tests/unit/volume/drivers/emc/vnx/test_client.py
Python
apache-2.0
17,512
# # 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...
wileeam/airflow
tests/providers/apache/spark/operators/test_spark_submit.py
Python
apache-2.0
7,170
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 VMware, 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/lic...
Juniper/neutron
neutron/plugins/vmware/plugins/service.py
Python
apache-2.0
81,232
# Copyright 2014 Cloudbase Solutions Srl # Copyright 2012 Mirantis 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 # # ...
CropCircleSys/bsd-cloudinit
cloudbaseinit/metadata/services/ec2service.py
Python
apache-2.0
3,464
from __future__ import division, unicode_literals from future.builtins import str from copy import copy from django.contrib.contenttypes.fields import GenericRelation from django.core.exceptions import ImproperlyConfigured, AppRegistryNotReady from django.db.models import IntegerField, CharField, FloatField from djan...
frankchin/mezzanine
mezzanine/generic/fields.py
Python
bsd-2-clause
11,915
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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; either version 2.1 of the License, or (a...
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/paramiko/dsskey.py
Python
bsd-3-clause
7,918
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/client/tabs/campaign.py # # 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 # not...
securestate/king-phisher
king_phisher/client/tabs/campaign.py
Python
bsd-3-clause
32,510
#!/usr/bin/env python # Copyright 2014 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Script for auto-increasing the version on bleeding_edge. The script can be run regularly by a cron job. It will increase the bui...
mxOBS/deb-pkg_trusty_chromium-browser
v8/tools/push-to-trunk/bump_up_version.py
Python
bsd-3-clause
7,906
# -*- coding: utf8 -*- ### # Copyright (c) 2002-2004, Jeremiah Fincher # 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...
ProgVal/Limnoria-test
plugins/Alias/test.py
Python
bsd-3-clause
7,992
"""This controller accepts ROS JointTrajectory messages from the ROS topic '/[robot_name]/joint_trajectory' and writes out JointState messages to the ROS topic '/[robot_name]/joint_state'. It also acts as a ROS clock server. """ import controller import rospy from klampt.trajectory import Trajectory,HermiteTrajectory...
arocchi/Klampt
Python/control/roscontroller.py
Python
bsd-3-clause
11,505
# # This file is part of pysnmp software. # # Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net> # License: http://pysnmp.sf.net/license.html # import sys from pyasn1.compat.octets import null from pysnmp.proto import rfc3411, error from pysnmp.proto.api import v1, v2c # backend is always SMIv2 compliant from pysnm...
filippog/pysnmp
pysnmp/entity/rfc3413/ntfrcv.py
Python
bsd-3-clause
4,010
#!/usr/bin/python from mod_pywebsocket import msgutil import urllib def web_socket_do_extra_handshake(request): pass def web_socket_transfer_data(request): msgutil._write(request, urllib.unquote(request.ws_location.split('?', 1)[1]).decode("string-escape"))
operasoftware/presto-testo
wpt/websockets/websock_handlers/after_handshake_raw_wsh.py
Python
bsd-3-clause
264
#!/usr/bin/env python ''' Video histogram sample to show live histogram of video Keys: ESC - exit ''' import numpy as np import cv2 # built-in modules import sys # local modules import video if __name__ == '__main__': hsv_map = np.zeros((180, 256, 3), np.uint8) h, s = np.indices(hsv_map.shape[:2]...
IsmoilovMuhriddin/allgo
opencv_samples/color_histogram.py
Python
mit
1,366
"""User-friendly public interface to polynomial functions. """ from __future__ import print_function, division from sympy.core import ( S, Basic, Expr, I, Integer, Add, Mul, Dummy, Tuple ) from sympy.core.mul import _keep_coeff from sympy.core.symbol import Symbol from sympy.core.basic import preorder_traversal ...
wolfram74/numerical_methods_iserles_notes
venv/lib/python2.7/site-packages/sympy/polys/polytools.py
Python
mit
171,109
# -*- coding: utf-8 -*- from modules.upsidedown.upsidedown import transform as upsidedown def tableflip(tbot, user, channel, msg): text = msg.replace('!tableflip', '').strip() flipped = upsidedown(text) tbot.msg(channel,u"%s: (╯°□°)╯︵ %s" % (user, flipped)) tableflip.rule = "!tableflip (.*)"
atwardowski/Dramiel
src/twisted/mod/tableflip.py
Python
mit
320
import mypickle import util # manages location-information for a single screenplay. a "location" is a # single place that can be referred to using multiple scene names, e.g. # INT. MOTEL ROOM - DAY # INT. MOTEL ROOM - DAY - 2 HOURS LATER # INT. MOTEL ROOM - NIGHT class Locations: cvars = None def __init__(...
tarikfayad/trelby
src/locations.py
Python
gpl-2.0
2,162
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
ChinaMassClouds/copenstack-server
openstack/src/nova-2014.2/nova/virt/ovirt/firewall.py
Python
gpl-2.0
13,628
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
bob123bob/Sick-Beard
sickbeard/show_name_helpers.py
Python
gpl-3.0
9,869
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # 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 lat...
mensler/ansible
lib/ansible/module_utils/facts.py
Python
gpl-3.0
171,136
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from erpnext.education.api import get_grade # test_records = frappe.get_test_records('Assessment Result') class TestAssessmentResult(uni...
indictranstech/erpnext
erpnext/education/doctype/assessment_result/test_assessment_result.py
Python
agpl-3.0
521
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('course_modes', '0004_auto_20151113_1457'), ] operations = [ migrations.SeparateDatabaseAndState( database_operations=[], state_operations=[ migra...
eduNEXT/edx-platform
common/djangoapps/course_modes/migrations/0005_auto_20151217_0958.py
Python
agpl-3.0
1,002
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
ThomasMiconi/nupic.research
projects/sequence_prediction/discrete_sequences/plotPerturbExperiment.py
Python
agpl-3.0
3,263
#!/usr/bin/env python # # Copyright 2007 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 o...
ProfessionalIT/professionalit-webiste
sdk/google_appengine/google/appengine/ext/mapreduce/model.py
Python
lgpl-3.0
38,467
# coding: utf-8 from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import ( determine_ext, ExtractorError, float_or_none, int_or_none, parse_iso8601, strip_or_none, ) class ToggleIE(InfoExtractor): IE_NAME = 'toggle' _VALID_UR...
rg3/youtube-dl
youtube_dl/extractor/toggle.py
Python
unlicense
8,970
"""Test the Smart Meter Texas config flow.""" import asyncio from unittest.mock import patch from aiohttp import ClientError import pytest from smart_meter_texas.exceptions import ( SmartMeterTexasAPIError, SmartMeterTexasAuthError, ) from homeassistant import config_entries, setup from homeassistant.componen...
w1ll1am23/home-assistant
tests/components/smart_meter_texas/test_config_flow.py
Python
apache-2.0
4,021
# # 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 # ...
pshchelo/heat
heat/tests/aws/test_instance_network.py
Python
apache-2.0
12,448
"""Representation of a deCONZ gateway.""" import asyncio import async_timeout from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.const import CONF_EVENT, CONF_HOST, CONF_ID from homeassistant.core import EventOrigin, callback from homeassistant.helpers import aiohttp_client from homeassistant....
MartinHjelmare/home-assistant
homeassistant/components/deconz/gateway.py
Python
apache-2.0
8,357
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: anze@reciprocitylabs.com # Maintained By: anze@reciprocitylabs.com """Move existing Workflows to new contexts Revision ID: 4b3316aa1acf Revises: ...
prasannav7/ggrc-core
src/ggrc_workflows/migrations/versions/20140722203407_4b3316aa1acf_move_existing_workflows_to_new_contexts.py
Python
apache-2.0
11,884
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: anze@reciprocitylabs.com # Maintained By: anze@reciprocitylabs.com """Remove Control.type, add Control assessors Revision ID: 3df9e3188977 Revise...
prasannav7/ggrc-core
src/ggrc/migrations/versions/20131113030336_3df9e3188977_remove_control_type_.py
Python
apache-2.0
991
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
Canpio/Paddle
python/paddle/fluid/tests/unittests/test_array_read_write_op.py
Python
apache-2.0
3,404
# Copyright 2017 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...
frreiss/tensorflow-fred
tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py
Python
apache-2.0
16,160
"""Support for sending data to StatsD.""" import logging import statsd import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_PORT, CONF_PREFIX, EVENT_STATE_CHANGED from homeassistant.helpers import state as state_helper import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogg...
leppa/home-assistant
homeassistant/components/statsd/__init__.py
Python
apache-2.0
2,957
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from __future__ import unicode_literals from ..utils import ApplyTransform def test_ApplyTransform_inputs(): input_map = dict(ignore_exception=dict(nohash=True, usedefault=True, ), in_file=dict(copyfile=True, mandatory=True, ), mat=dict...
mick-d/nipype
nipype/interfaces/spm/tests/test_auto_ApplyTransform.py
Python
bsd-3-clause
1,064
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=2> # Usage of IC 7400 # <codecell> from __future__ import print_function from BinPy import * # <codecell> # Usage of IC 7440: ic = IC_7440() print(ic.__doc__) # <codecell> # The Pin configuration is: inp = {1: 1, 2: 0, 4: 0, 5: 0, 7: 0, ...
daj0ker/BinPy
BinPy/examples/source/ic/Series_7400/IC7440.py
Python
bsd-3-clause
1,248
tests = [("testExecs/testMatCalc.exe", "", {})] longTests = [] if __name__ == '__main__': import sys from rdkit import TestRunner failed, tests = TestRunner.RunScript('test_list.py', 0, 1) sys.exit(len(failed))
rvianello/rdkit
Code/DataManip/MetricMatrixCalc/test_list.py
Python
bsd-3-clause
221
import torch.nn as nn from torch.autograd import Variable class RNNModel(nn.Module): """Container module with an encoder, a recurrent module, and a decoder.""" def __init__(self, rnn_type, ntoken, ninp, nhid, nlayers, dropout=0.5, tie_weights=False): super(RNNModel, self).__init__() self.drop ...
tshadley/examples
word_language_model_bptt_hsm/model.py
Python
bsd-3-clause
2,560
from __future__ import with_statement, unicode_literals import errno import os from django.core.files.base import ContentFile from django.core.files.storage import get_storage_class from django.test import TestCase from django.utils.functional import LazyObject from compressor import storage from compressor.conf impo...
ramcn/demo3
venv/lib/python3.4/site-packages/compressor/tests/test_storages.py
Python
mit
2,465
#!/usr/bin/env python3 # Copyright (c) 2017-2020 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 message sending before handshake completion. Before receiving a VERACK, a node should not send an...
JeremyRubin/bitcoin
test/functional/p2p_leak.py
Python
mit
7,392
# -*- coding: utf-8 -*- """ Test debug interface ~~~~~~~~~~~~~~~~~~~~ Tests the traceback rewriter. :copyright: (c) 2009 by the Jinja Team. :license: BSD. """ from jinja2 import Environment from test_loaders import filesystem_loader env = Environment(loader=filesystem_loader) def test_runtime_e...
yesudeep/tisshrmlr
app/jinja2/tests/test_debug.py
Python
mit
1,268
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
srene/ndnSIM-inrpp
src/fd-net-device/bindings/modulegen__gcc_LP64.py
Python
gpl-2.0
312,406
""" Common utility methods for Mobile APIs. """ API_V05 = 'v0.5' API_V1 = 'v1' def parsed_version(version): """ Converts string X.X.X.Y to int tuple (X, X, X) """ return tuple(map(int, (version.split(".")[:3])))
eduNEXT/edx-platform
lms/djangoapps/mobile_api/utils.py
Python
agpl-3.0
223
# 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 Examl(MakefilePackage): """ Exascale Maximum Likelihood (ExaML) code for phylogenetic ...
LLNL/spack
var/spack/repos/builtin/packages/examl/package.py
Python
lgpl-2.1
2,255
'''OpenGL extension KHR.stream_producer_eglsurface This module customises the behaviour of the OpenGL.raw.EGL.KHR.stream_producer_eglsurface to provide a more Python-friendly API The official definition of this extension is available here: http://www.opengl.org/registry/specs/KHR/stream_producer_eglsurface.txt ''' ...
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/EGL/KHR/stream_producer_eglsurface.py
Python
lgpl-3.0
831
# 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...
luoyetx/mxnet
example/image-classification/common/fit.py
Python
apache-2.0
12,877
# 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...
tensorflow/tensorflow
tensorflow/python/client/timeline.py
Python
apache-2.0
28,612
# # 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...
lukecwik/incubator-beam
sdks/python/apache_beam/runners/portability/spark_java_job_server_test.py
Python
apache-2.0
2,695
# # 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...
staslev/incubator-beam
sdks/python/apache_beam/metrics/metric_test.py
Python
apache-2.0
5,205
#!/usr/bin/env python # vim: expandtab:tabstop=4:shiftwidth=4 """ Interface to OpenShift oc command """ # # Copyright 2015 Red Hat 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 ...
rhdedgar/openshift-tools
openshift_tools/monitoring/ocutil.py
Python
apache-2.0
4,378
#!/usr/bin/env python # -*- encoding: utf-8 -*- """Pyunit for h2o.utils.typechecks.""" from __future__ import absolute_import, division, print_function import math from h2o import H2OFrame from h2o.exceptions import H2OTypeError, H2OValueError from h2o.utils.typechecks import (U, I, NOT, Tuple, Dict, numeric, h2ofram...
h2oai/h2o-3
h2o-py/tests/testdir_utils/pyunit_typechecks.py
Python
apache-2.0
6,106
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
hanlind/nova
nova/policies/security_groups.py
Python
apache-2.0
1,102
# Copyright (c) 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
nadeemsyed/swift
test/unit/common/test_splice.py
Python
apache-2.0
10,235
import re from django.conf import settings from nose.tools import eq_ from pyquery import PyQuery as pq import kitsune.sumo.tests.test_parser from kitsune.gallery.models import Video from kitsune.gallery.tests import image, video from kitsune.sumo.tests import TestCase from kitsune.wiki.models import Document from k...
orvi2014/kitsune
kitsune/wiki/tests/test_parser.py
Python
bsd-3-clause
39,480
import pandas as pd from pandas import DataFrame import pandas._testing as tm class TestConcatSort: def test_concat_sorts_columns(self, sort): # GH-4588 df1 = DataFrame({"a": [1, 2], "b": [1, 2]}, columns=["b", "a"]) df2 = DataFrame({"a": [3, 4], "c": [5, 6]}) # for sort=True/None...
rs2/pandas
pandas/tests/reshape/concat/test_sort.py
Python
bsd-3-clause
3,115
# Natural Language Toolkit: Cooper storage for Quantifier Ambiguity # # Copyright (C) 2001-2017 NLTK Project # Author: Ewan Klein <ewan@inf.ed.ac.uk> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT from __future__ import print_function from nltk.sem.logic import LambdaExpression, ApplicationExpres...
sdoran35/hate-to-hugs
venv/lib/python3.6/site-packages/nltk/sem/cooper_storage.py
Python
mit
4,067
import os from functools import partial from warnings import warn from dxr.utils import browse_file_url, search_url def quote(qualname): """ Wrap qualname in quotes if it contains spaces """ if ' ' in qualname: qualname = '"' + qualname + '"' return qualname def truncate_value(value, typ=""): ...
pombredanne/dxr
dxr/plugins/rust/menu.py
Python
mit
6,324
# (c) 2007 Chris AtLee <chris@atlee.ca> # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php """ PAM module for python Provides an authenticate function that will allow the caller to authenticate a user against the Pluggable Authentication Modules (PAM) on the system. Implemented usi...
MiLk/mineos
pam.py
Python
gpl-3.0
3,929
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the Li...
DreamSourceLab/DSView
libsigrokdecode4DSL/decoders/lpc/__init__.py
Python
gpl-3.0
941
#!/usr/bin/env python3 # ScintillaData.py - implemented 2013 by Neil Hodgson neilh@scintilla.org # Released to the public domain. # Common code used by Scintilla and SciTE for source file regeneration. # The ScintillaData object exposes information about Scintilla as properties: # Version properties # versi...
rddim/Notepad-plus-plus
scintilla/scripts/ScintillaData.py
Python
gpl-3.0
10,927
#!/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...
sonaht/ansible
lib/ansible/modules/network/ios/ios_logging.py
Python
gpl-3.0
9,798
# 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 http://mozilla.org/MPL/2.0/. # Common codegen classes. from collections import defaultdict from itertools import groupby import operator import os ...
jaysonsantos/servo
components/script/dom/bindings/codegen/CodegenRust.py
Python
mpl-2.0
279,760