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
from .logic import LogicAdapter class ClosestMatchAdapter(LogicAdapter): def get(self, text, list_of_statements): """ Takes a statement string and a list of statement strings. Returns the closest matching statement from the list. """ from fuzzywuzzy import process ...
karajrish/ChatterBot
chatterbot/adapters/logic/closest_match.py
Python
bsd-3-clause
666
"""Array printing function $Id: arrayprint.py,v 1.9 2005/09/13 13:58:44 teoliphant Exp $ """ __all__ = ["array2string", "array_str", "array_repr", "set_string_function", "set_printoptions", "get_printoptions", "printoptions", "format_float_positional", "format_float_scientific"] __docformat__ = ...
pbrod/numpy
numpy/core/arrayprint.py
Python
bsd-3-clause
61,625
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) from ..extern import six from ..extern.six.moves import zip import warnings import weakref from copy import deepcopy import numpy as np from num...
tbabej/astropy
astropy/table/column.py
Python
bsd-3-clause
41,990
#!/usr/bin/env python # Copyright Contributors to the Open Shading Language project. # SPDX-License-Identifier: BSD-3-Clause # https://github.com/AcademySoftwareFoundation/OpenShadingLanguage # See the test.osl source for explanation of this test command = testshade("-g 16 16 test -od uint8 -o Cout out.tif") outputs...
imageworks/OpenShadingLanguage
testsuite/bug-outputinit/run.py
Python
bsd-3-clause
337
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np __doctest_skip__ = ['quantity_support'] def quantity_support(format='latex_inline'): """ En...
kelle/astropy
astropy/visualization/units.py
Python
bsd-3-clause
2,941
#!/usr/bin/env python from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( packages=['jsk_apc2016_common'], package_dir={'': 'python'}, ) setup(**d)
start-jsk/jsk_apc
jsk_apc2016_common/setup.py
Python
bsd-3-clause
232
import datetime import logging from django.conf import settings from django.core.exceptions import NON_FIELD_ERRORS from google.appengine.api.datastore import Key, Delete, MAX_ALLOWABLE_QUERIES from google.appengine.datastore.datastore_rpc import TransactionOptions from google.appengine.ext import db from .unique_uti...
kirberich/djangae
djangae/db/constraints.py
Python
bsd-3-clause
11,037
import io import unittest from payment_terminal.drivers.bbs.connection import read_frame, write_frame class TestBBSFrames(unittest.TestCase): def test_read_one(self): port = io.BytesIO(b'\x00\x0512345') self.assertEqual(read_frame(port), b'12345') def test_read_two(self): port = io.B...
bwhmather/python-payment-terminal
payment_terminal/drivers/bbs/tests/test_frames.py
Python
bsd-3-clause
1,484
from __future__ import absolute_import, unicode_literals import re from django.conf import settings from django.contrib.auth.models import User from django_comments import signals from django_comments.models import Comment from . import CommentTestCase from ..models import Article, Book post_redirect_re = re.comp...
giginet/django-contrib-comments
tests/testapp/tests/test_comment_views.py
Python
bsd-3-clause
13,575
# To change this license header, choose License Headers in Project Properties. # To change this template file, choose Tools | Templates # and open the template in the editor. #if __name__ == "__main__": # print "Hello World" from WorkingWithFiles import Excel2PdfConversion import jpype import os.path asposeapispa...
asposecells/Aspose_Cells_Java
Plugins/Aspose-Cells-Java-for-Python/tests/WorkingWithFiles/Excel2PdfConversion/Excel2PdfConversion.py
Python
mit
668
#!/usr/bin/python # -*- coding: utf-8 -*- r""" Print a list of pages, as defined by page generator parameters. Optionally, it also prints page content to STDOUT or save it to a file in the current directory. These parameters are supported to specify which pages titles to print: -format Defines the output format....
npdoty/pywikibot
scripts/listpages.py
Python
mit
9,907
"""Output formatters using shell syntax. """ from .base import SingleFormatter import argparse import six class ShellFormatter(SingleFormatter): def add_argument_group(self, parser): group = parser.add_argument_group( title='shell formatter', description='a format a UNIX shell c...
sjsucohort6/openstack
python/venv/lib/python2.7/site-packages/cliff/formatters/shell.py
Python
mit
1,337
from collections import defaultdict, namedtuple from minecraft_data.v1_8 import recipes as raw_recipes RecipeItem = namedtuple('RecipeItem', 'id meta amount') class Recipe(object): def __init__(self, raw): self.result = reformat_item(raw['result'], None) if 'ingredients' in raw: sel...
Gjum/SpockBot
spockbot/mcdata/recipes.py
Python
mit
2,639
from sqlalchemy.testing import eq_, is_ from sqlalchemy.orm import backref, configure_mappers from sqlalchemy import testing from sqlalchemy import desc, select, func, exc from sqlalchemy.orm import mapper, relationship, create_session, Query, \ attributes, exc as orm_exc, Session from sqlalchemy.or...
mitsuhiko/sqlalchemy
test/orm/test_dynamic.py
Python
mit
30,088
# -*- coding: utf-8 -*- # Adapted from a contribution of Johan Dahlin import collections import errno import re import sys try: import multiprocessing except ImportError: # Python 2.5 multiprocessing = None import pep8 __all__ = ['multiprocessing', 'BaseQReport', 'QueueReport'] class BaseQReport(pep8.B...
wdv4758h/flake8
flake8/reporter.py
Python
mit
5,265
import argparse import copy import numpy as np import chainer from chainer.datasets import ConcatenatedDataset from chainer.datasets import TransformDataset from chainer.optimizer_hooks import WeightDecay from chainer import serializers from chainer import training from chainer.training import extensions from chainer....
chainer/chainercv
examples/ssd/train.py
Python
mit
6,895
""" pgoapi - Pokemon Go API Copyright (c) 2016 tjado <https://github.com/tejado> 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...
charbec1/pokemapfuntimesyay
pogom/pgoapi/pgoapi.py
Python
mit
6,103
from __future__ import division import numpy as np from chainer.backends import cuda import chainer.functions as F from chainercv import transforms exp_clip = np.log(1000 / 16) def smooth_l1(x, t, beta): return F.huber_loss(x, t, beta, reduce='no') / beta # to avoid out of memory def argsort(x): xp = c...
chainer/chainercv
chainercv/links/model/fpn/misc.py
Python
mit
974
""" PageLayout ========== .. image:: images/pagelayout.gif :align: right The :class:`PageLayout` class is used to create a simple multi-page layout, in a way that allows easy flipping from one page to another using borders. :class:`PageLayout` does not currently honor the :attr:`~kivy.uix.widget.Widget.size_hint...
rnixx/kivy
kivy/uix/pagelayout.py
Python
mit
7,321
# -*- coding: utf-8 -*- import pytest import numpy as np from pandas import Series, Timestamp from pandas.compat import range, lmap import pandas.core.common as com import pandas.util.testing as tm def test_mut_exclusive(): msg = "mutually exclusive arguments: '[ab]' and '[ab]'" with tm.assert_raises_regex...
lmallin/coverage_test
python_venv/lib/python2.7/site-packages/pandas/tests/test_common.py
Python
mit
4,870
import functools import pfp.interp def native(name, ret, interp=None, send_interp=False): """Used as a decorator to add the decorated function to the pfp interpreter so that it can be used from within scripts. :param str name: The name of the function as it will be exposed in template scripts. :param pfp.fields....
greenoaktree/pfp
pfp/native/__init__.py
Python
mit
1,639
# ------------------------------------------------------------------------------------------------ # Copyright (c) 2016 Microsoft Corporation # # 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 ...
murven/malmo
Malmo/samples/Python_examples/tutorial_5_solved.py
Python
mit
7,626
from django.conf.urls import url from django.views.decorators.csrf import csrf_exempt from . import views urlpatterns = [ url(r"^$", csrf_exempt(views.SamlView.as_view())), url(r"^metadata/$", views.serve_metadata), ]
FinnStutzenstein/OpenSlides
server/openslides/saml/urls.py
Python
mit
229
# -*- coding: utf-8 -*- # Copyright (c) 2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or impli...
beav/pulp
server/pulp/plugins/util/nectar_config.py
Python
gpl-2.0
2,490
# -*- coding: utf-8 -*- """QGIS Unit tests for edit widgets. .. note:: 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 License, or (at your option) any later version. """ __au...
NINAnor/QGIS
tests/src/python/test_qgseditwidgets.py
Python
gpl-2.0
2,315
################################################################################ # # This program is part of the DellMon Zenpack for Zenoss. # Copyright (C) 2008, 2009, 2010 Egor Puzanov. # # This program can be used under the GNU General Public License version 2 # You can find full information here: http://www.zenoss....
epuzanov/ZenPacks.community.DellMon
ZenPacks/community/DellMon/migrate/removeOldDellReports.py
Python
gpl-2.0
1,108
import unittest from PyFoam.Applications.ConvertToCSV import ConvertToCSV theSuite=unittest.TestSuite()
Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam
unittests/Applications/test_ConvertToCSV.py
Python
gpl-2.0
106
# -*- coding: utf-8 -*- # # This file is part of HEPData. # Copyright (C) 2016 CERN. # # HEPData 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...
HEPData/hepdata3
hepdata/factory.py
Python
gpl-2.0
2,063
# -*- coding: utf-8 -*- # # This file is part of Invenio Demosite. # Copyright (C) 2013 CERN. # # Invenio Demosite 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...
hachreak/invenio-demosite
invenio_demosite/base/fixtures/oai_harvest.py
Python
gpl-2.0
1,982
#!/usr/bin/env python # Support a YAML file hosts.yml as external inventory in Ansible # Copyright (C) 2012 Jeroen Hoekx <jeroen@hoekx.be> # # 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, eit...
j2sol/ansible
plugins/inventory/yaml.py
Python
gpl-3.0
7,145
""" This file is part of L3Morpho. Author: Michael Gasser <gasser@cs.indiana.edu> ----------------------------------------------------------------- internals.py is part of Natural Language Toolkit: Internal utility functions Copyright (C) 2001-2008 University of Pennsylvania Author: Steven Bird <sb@csse.unimelb.edu....
LowResourceLanguages/hltdi-l3
l3xdg/morphology/internals.py
Python
gpl-3.0
16,052
# -*- coding: utf-8 -*- __author__ = 'hal9000' __all__ = ['Cache', 'CacheServer'] import socket import time import json import hashlib from sqlite3 import dbapi2 as sqlite import xbmc import log import gui import system SOCKET = '127.0.0.1', 59999 CLEAR = 60*60*24 # 1 day class SQL: def __init__(self, name,...
chimkentec/KodiMODo_rep
script.module.xbmcup/lib/xbmcup/cache.py
Python
gpl-3.0
7,268
import numpy as np from gpaw import KohnShamConvergenceError class SCFLoop: """Self-consistent field loop. converged: Do we have a self-consistent solution? """ def __init__(self, eigenstates=0.1, energy=0.1, density=0.1, maxiter=100, fixdensity=False, niter_fixdensity=None...
qsnake/gpaw
gpaw/scf.py
Python
gpl-3.0
2,689
# Copyright (c) 2016 RIPE NCC # # 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 later version. # # This program is distributed in the h...
RIPE-NCC/ripe.atlas.sagan
ripe/atlas/sagan/http.py
Python
gpl-3.0
3,498
# sqlalchemy/ext/baked.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Baked query extension. Provides a creational pattern for the :class:`.que...
Vagab0nd/SiCKRAGE
lib3/sqlalchemy/ext/baked.py
Python
gpl-3.0
21,989
#!/usr/bin/env python import math import re EVERYTHING_BEFORE_PARAMS = """id: qtgui_time_sink_x label: QT GUI Time Sink parameters: - id: type label: Type dtype: enum default: complex options: [complex, float, msg_complex, msg_float] option_labels: [Complex, Float, Complex Message, Float Messag...
mbr0wn/gnuradio
gr-qtgui/grc/qtgui_time_sink_x.block.yml.py
Python
gpl-3.0
11,608
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions...
chetan51/nupic
nupic/engine/__init__.py
Python
gpl-3.0
23,538
# Core imports import copy import Queue import thread import time # Package imports from ..core.Threadable import Threadable from ..reconstruction.Buffer import Buffer from ..settings import Arguments from Packet import Packet from TDMA_Scheduler import TDMA_Scheduler # pylint: disable=undefined-all-variable __all__ ...
timvandermeij/mobile-radio-tomography
zigbee/RF_Sensor.py
Python
gpl-3.0
15,115
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (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 #...
traveloka/ansible
lib/ansible/modules/cloud/ovirt/ovirt_storage_domains.py
Python
gpl-3.0
17,259
#!/usr/bin/env python # # Copyright 2011-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from __future__ import print_function from __future__ import division from __future__ import unicode_literals from gnuradio import gr, digital, filter from ...
jdemel/gnuradio
gr-digital/examples/example_fll.py
Python
gpl-3.0
5,057
############################################################################ # # Copyright (C) 2016 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # accordance with the co...
pivonroll/Qt_Creator
tests/system/suite_APTW/tst_APTW02/test.py
Python
gpl-3.0
1,630
""" Copyright (c) 2012, CCL Forensics All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the fo...
Wonfee/pymobiledevice
util/ccl_bplist.py
Python
gpl-3.0
15,606
# coding=utf-8 from ._commandbase import RadianceCommand from ..datatype import RadiancePath import os class Epw2wea(RadianceCommand): """epw2wea transforms an EnergyPlus weather data (.epw) file into the DAYSIM weather file format, for use with the RADIANCE gendaymtx program. Attributes: ep...
ladybug-analysis-tools/honeybee
honeybee_plus/radiance/command/epw2wea.py
Python
gpl-3.0
2,274
# -*- test-case-name: twisted.conch.test.test_telnet -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.telnet}. """ from __future__ import absolute_import, division from zope.interface import implementer from zope.interface.verify import verifyObject from twis...
Architektor/PySnip
venv/lib/python2.7/site-packages/twisted/conch/test/test_telnet.py
Python
gpl-3.0
26,581
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
mugurrus/superdesk-core
superdesk/publish/publish_content.py
Python
agpl-3.0
6,229
from django.db import models from helusers.models import AbstractUser class User(AbstractUser): pass
City-of-Helsinki/devheldev
users/models.py
Python
agpl-3.0
107
import os from queue import Queue from bears.general.LicenseHeaderBear import LicenseHeaderBear from coalib.testing.LocalBearTestHelper import LocalBearTestHelper from coalib.results.Result import Result from coalib.settings.Section import Section from coalib.settings.Setting import Setting def get_testfile_path(nam...
coala-analyzer/coala-bears
tests/general/LicenseHeaderBearTest.py
Python
agpl-3.0
2,350
# -*- coding: utf-8 -*- # # pi-manage documentation build configuration file, created by # sphinx-quickstart on Sun Oct 11 19:10:09 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
jh23453/privacyidea
doc/installation/system/pimanage/conf.py
Python
agpl-3.0
9,178
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Issue.status' db.add_column('core_issue', 'status', self.gf('django.db...
bankonme/www.freedomsponsors.org
djangoproject/core/migrations/0046_auto__add_field_issue_status.py
Python
agpl-3.0
20,741
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
wscullin/spack
var/spack/repos/builtin/packages/py-markupsafe/package.py
Python
lgpl-2.1
2,130
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * import glob class Guidance(MakefilePackage): """Guidance: Accurate detection of unreliable align...
iulian787/spack
var/spack/repos/builtin/packages/guidance/package.py
Python
lgpl-2.1
1,751
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html import os from smart_open import smart_open try: import cPickle as _pickle except ImportError: import pickle as _pickle from gensi...
olavurmortensen/gensim
gensim/similarities/index.py
Python
lgpl-2.1
3,188
# -*- Mode: Python; -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified under the terms of # the GNU Lesser General Pu...
timvideos/flumotion
flumotion/test/test_icalbouncer.py
Python
lgpl-2.1
17,170
import curses import functools from stem.control import EventType, Controller from stem.util import str_tools # colors that curses can handle COLOR_LIST = { "red": curses.COLOR_RED, "green": curses.COLOR_GREEN, "yellow": curses.COLOR_YELLOW, "blue": curses.COLOR_BLUE, "cyan": curses.COLOR_CYAN, "magenta"...
tparks5/tor-stem
docs/_static/example/event_listening.py
Python
lgpl-3.0
5,286
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor class TumblrIE(InfoExtractor): _VALID_URL = r'http://(?P<blog_name>.*?)\.tumblr\.com/(?:post|video)/(?P<id>[0-9]+)(?:$|[/?#])' _TESTS = [{ 'url': 'http://tatianamaslanydaily.tumblr.com/post/54...
marxin/youtube-dl
youtube_dl/extractor/tumblr.py
Python
unlicense
2,338
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
mmasaki/trove
trove/common/strategies/storage/base.py
Python
apache-2.0
1,530
# Copyright (c) 2016 Intel, Inc. # Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/li...
bigswitch/nova
nova/conf/consoleauth.py
Python
apache-2.0
1,156
"""Support for Soma sensors.""" from datetime import timedelta import logging from requests import RequestException from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE from homeassistant.helpers.entity import Entity from homeassistant.util import Throttle from . import DEVICES, SomaEntity from .const im...
partofthething/home-assistant
homeassistant/components/soma/sensor.py
Python
apache-2.0
2,532
#!/usr/bin/env python import glob import copy import cv2 import cv_bridge import rospy from sensor_msgs.msg import Image from std_msgs.msg import Int32, Float32, String import rospkg class Hear_orders: def __init__(self): self.speech_subscriber = rospy.Subscriber("/speech_recognition", String, self.publi...
UCRoboticsLab/BaxterTictactoe
src/baxter_face_animation/src/baxter_face_animation/hear_words.py
Python
apache-2.0
926
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
benfinke/ns_python
nssrc/com/citrix/netscaler/nitro/resource/config/ns/nstimer.py
Python
apache-2.0
10,753
def main(): info('Evacuate Microbone') close(description='Jan Inlet') open(description='Jan Ion Pump') #close(description='Minibone to Bone') open(description='Minibone to Bone') #close(description='Microbone to Minibone') open(description='Microbone to Minibone') open('C') clos...
USGSDenverPychron/pychron
docs/user_guide/operation/scripts/examples/argus/extraction/apis/PrepareForApis.py
Python
apache-2.0
702
# 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...
raymondxyang/tensorflow
tensorflow/contrib/training/python/training/sequence_queueing_state_saver.py
Python
apache-2.0
78,772
# ---------------------------------------------------------------------------- # Copyright 2016 Nervana Systems 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.o...
coufon/neon-distributed
neon/backends/kernels/cuda/roipooling.py
Python
apache-2.0
9,019
#!/router/bin/python import outer_packages #from trex_stl_lib.trex_stl_hltapi import CTRexHltApi, CStreamsPerPort from trex_stl_lib.trex_stl_hltapi import * import traceback import sys, time from pprint import pprint import argparse def error(err = None): if not err: raise Exception('Unknown exception, lo...
kisel/trex-core
scripts/automation/regression/hltapi_playground.py
Python
apache-2.0
10,579
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
nzlosh/st2
st2api/st2api/controllers/v1/traces.py
Python
apache-2.0
2,445
"""Common test objects.""" import copy from datetime import datetime import json from unittest.mock import ANY, patch from homeassistant.components import mqtt from homeassistant.components.mqtt import debug_info from homeassistant.components.mqtt.const import MQTT_DISCONNECTED from homeassistant.components.mqtt.mixin...
sander76/home-assistant
tests/components/mqtt/test_common.py
Python
apache-2.0
41,174
#!/usr/bin/env python3 """Script to generate unannotated baseline stubs using stubgen. Basic usage: $ python3 scripts/create_baseline_stubs.py <project on PyPI> Run with -h for more help. """ import argparse import os import re import shutil import subprocess import sys from typing import Optional, Tuple PYRIGHT_C...
google/intellij-community
python/helpers/typeshed/scripts/create_baseline_stubs.py
Python
apache-2.0
6,346
# -*- coding: utf-8 -*- """Provides concept object.""" from __future__ import absolute_import from .. import t1types from ..entity import Entity class Concept(Entity): """Concept entity.""" collection = 'concepts' resource = 'concept' _relations = { 'advertiser', } _pull = { '...
MediaMath/t1-python
terminalone/models/concept.py
Python
apache-2.0
729
# Copyright 2015 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...
martinbede/second-sight
tensorflow/examples/tutorials/word2vec/word2vec_basic.py
Python
apache-2.0
8,770
# 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...
hfp/tensorflow-xsmm
tensorflow/python/ops/control_flow_util.py
Python
apache-2.0
12,264
# # Copyright (C) 2014 Dell, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
JPWKU/unix-agent
src/dcm/agent/messaging/utils.py
Python
apache-2.0
2,118
"""Test the openml loader. """ import gzip import warnings import json import os import re from importlib import resources from io import BytesIO import numpy as np import scipy.sparse import sklearn import pytest from sklearn import config_context from sklearn.datasets import fetch_openml as fetch_openml_orig from sk...
manhhomienbienthuy/scikit-learn
sklearn/datasets/tests/test_openml.py
Python
bsd-3-clause
53,604
from glob import glob import os try: from skimage.io import imread as sk_imread except ImportError: pass from .core import Array from ..base import tokenize def add_leading_dimension(x): return x[None, ...] def imread(filename, imread=None, preprocess=None): """ Read a stack of images into a dask a...
PhE/dask
dask/array/image.py
Python
bsd-3-clause
1,949
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import ctypes import pyglet from pyglet.libs.darwin import carbon, _oscheck, create_cfstring from pyglet.libs.darwin.constants import * from base import Device, Control, AbsoluteAxis, RelativeAxis, Button from base import Joyst...
regular/pyglet-avbin-optimizations
pyglet/input/darwin_hid.py
Python
bsd-3-clause
17,379
import numpy as np import regreg.api as rr from selection.randomized.glm import pairs_bootstrap_glm, bootstrap_cov from selection.randomized.query import query from selection.randomized.randomization import split import functools def pairs_bootstrap_glm(glm_loss, active, ...
selective-inference/selective-inference
selectinf/sandbox/bayesian/estimator.py
Python
bsd-3-clause
29,896
"""Compressed Sparse Column matrix format""" from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['csc_matrix', 'isspmatrix_csc'] import numpy as np from scipy._lib.six import xrange from ._sparsetools import csc_tocsr from . import _sparsetools from .sp...
Shaswat27/scipy
scipy/sparse/csc.py
Python
bsd-3-clause
6,349
"""Implementation of __array_function__ overrides from NEP-18.""" import collections import functools import os import textwrap from numpy.core._multiarray_umath import ( add_docstring, implement_array_function, _get_implementing_args) from numpy.compat._inspect import getargspec ARRAY_FUNCTION_ENABLED = bool( ...
grlee77/numpy
numpy/core/overrides.py
Python
bsd-3-clause
8,273
import numpy as np from bokeh.models import ColumnDataSource, Plot, LinearAxis, Grid from bokeh.models.markers import Diamond from bokeh.io import curdoc, show N = 9 x = np.linspace(-2, 2, N) y = x**2 sizes = np.linspace(10, 20, N) source = ColumnDataSource(dict(x=x, y=y, sizes=sizes)) plot = Plot( title=None, ...
mindriot101/bokeh
examples/reference/models/Diamond.py
Python
bsd-3-clause
815
def reference_case_attachment_view(request, domain, case_id, attachment_id): raise NotImplemented("This view is to be overrided by the specific implementations for retrieving case attachments")
puttarajubr/commcare-hq
corehq/ex-submodules/casexml/apps/case/views.py
Python
bsd-3-clause
201
import warnings from django.views.generic.dates import ArchiveIndexView, DateDetailView, DayArchiveView, MonthArchiveView, \ YearArchiveView from django.views.generic.detail import DetailView from django.views.generic.list import ListView from django.views.generic.base import RedirectView from django.core.urlresol...
rmaceissoft/django-photologue
photologue/views.py
Python
bsd-3-clause
5,802
#!/usr/bin/env python # Copyright 2017 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 runs swarming_xcode_install on the bots. It should be run when we need to upgrade all the swarming testers. It: 1) ...
endlessm/chromium-browser
build/run_swarming_xcode_install.py
Python
bsd-3-clause
3,039
Experiment(description='Synthetic data sets of interest', data_dir='../data/synth/', max_depth=9, random_order=False, k=1, debug=False, local_computation=False, n_rand=9, sd=2, jitter_sd=0.1, max_jobs=300, ...
ekamioka/gpss-research
experiments/synth/synth.py
Python
mit
1,731
"""events Revision ID: 9c92c85163a9 Revises: 666668eae682 Create Date: 2016-05-09 19:04:44.498817 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '9c92c85163a9' down_revision = '666668eae682' def upgrade(): op.cre...
gazeti/aleph
aleph/migrate/versions/9c92c85163a9_events.py
Python
mit
1,959
import numpy as np import matplotlib.pyplot as plt from sklearn.neighbors import KNeighborsRegressor from sklearn.metrics import euclidean_distances from .datasets import make_wave from .plot_helpers import cm3 def plot_knn_regression(n_neighbors=1): X, y = make_wave(n_samples=40) X_test = np.array([[-1.5],...
bgroveben/python3_machine_learning_projects
oreilly_GANs_for_beginners/oreilly_GANs_for_beginners/introduction_to_ml_with_python/mglearn/mglearn/plot_knn_regression.py
Python
mit
1,285
__author__ = 'Anatoli Kalysch'
anatolikalysch/VMAttack
ui/__init__.py
Python
mit
31
#!/usr/bin/env python # -*- coding: utf-8 -*- from pypinyin.phrases_dict import phrases_dict from pypinyin import pinyin, TONE phrases_list = set() phrases_same = set() for han, pys in phrases_dict.items(): if pinyin(han, style=TONE, heteronym=True) != pys: phrases_list.add(han) else: phrase...
MingStar/python-pinyin
tools/small_phrases.py
Python
mit
562
""" Misago default settings This fille sets everything Misago needs to run. If you want to add custom app, middleware or path, please update setting vallue defined in this file instead of copying setting from here to your settings.py. Yes: #yourproject/settings.py INSTALLED_APPS += ( 'myawesomeapp', ) No: #yo...
390910131/Misago
misago/conf/defaults.py
Python
gpl-2.0
12,306
# -*- coding: utf-8 -*- """ *************************************************************************** lassplit.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************************...
slarosa/QGIS
python/plugins/sextante/lidar/lastools/lassplit.py
Python
gpl-2.0
2,455
#!/usr/bin/python import sys import csv import lxml.etree as ET # This script creates a CSV file from an XCCDF file formatted in the # structure of a STIG. This should enable its ingestion into VMS, # as well as its comparison with VMS output. xccdf_ns = "http://checklists.nist.gov/xccdf/1.1" disa_cciuri = "http://...
mpreisler/scap-security-guide-debian
scap-security-guide-0.1.21/shared/modules/xccdf2csv_stig_module.py
Python
gpl-2.0
1,883
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)) ...
tomhenderson/ns-3-dev-git
src/topology-read/bindings/modulegen__gcc_LP64.py
Python
gpl-2.0
251,206
version_info = (1, 4, 2) __version__ = '.'.join(map(str, version_info))
Vdragon/git-cola
qtpy/_version.py
Python
gpl-2.0
72
# -*- coding: utf-8 -*- ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS 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 versio...
ppiotr/Bibedit-some-refactoring
modules/webjournal/lib/webjournal_tests.py
Python
gpl-2.0
2,817
import os import sys import datetime as dt import json from itertools import groupby from kivy.properties import (StringProperty, DictProperty, ListProperty, BooleanProperty) from kivy.uix.boxlayout import BoxLayout from kivy.uix.sc...
9and3r/RPi-InfoScreen-Kivy
screens/mythtv/screen.py
Python
gpl-3.0
6,297
# urllib3/response.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import gzip import logging import zlib from io import BytesIO from .exceptions import HTTPEr...
mozilla/mwc
vendor-local/packages/requests/requests/packages/urllib3/response.py
Python
mpl-2.0
6,422
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
CLVsol/odoo_addons
clv_medicament_dispensation_mng/clv_insured_card/__init__.py
Python
agpl-3.0
1,428
# Copyright (c) 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.apache.org/licenses/LICENSE-2.0 # # Unless ...
rajalokan/nova
nova/scheduler/filters/compute_capabilities_filter.py
Python
apache-2.0
4,838
# (c) Copyright 2014 Cisco Systems 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 # # Unl...
alex8866/cinder
cinder/tests/zonemanager/test_cisco_fc_zone_client_cli.py
Python
apache-2.0
9,495
#!/usr/bin/python2.4 # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
plxaye/chromium
src/native_client_sdk/src/site_scons/site_tools/target_platform_mac.py
Python
apache-2.0
7,631
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2012 Red Hat, Inc. # Copyright 2013 NTT corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file exc...
saeki-masaki/cinder
cinder/common/config.py
Python
apache-2.0
9,037
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
alanconway/dispatch
console/dispatch-dashboard/dispatch/topology/urls.py
Python
apache-2.0
693