repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
EdLogan18/logan-repository | plugin.video.playlistLoader/resources/lib/chardet/gb2312freq.py | 3132 | 36011 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | gpl-2.0 |
dset0x/invenio | invenio/modules/deposit/testsuite/test_deposit_models.py | 2 | 2455 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 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... | gpl-2.0 |
apark263/tensorflow | tensorflow/python/autograph/operators/py_builtins.py | 2 | 7074 | # 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... | apache-2.0 |
leedm777/ansible-modules-core | cloud/openstack/keystone_user.py | 14 | 13229 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#
... | gpl-3.0 |
XCage15/privacyidea | privacyidea/lib/applications/luks.py | 3 | 3609 | # -*- coding: utf-8 -*-
#
# privacyIDEA
# Jul 18, 2014 Cornelius Kölbel
# License: AGPLv3
# contact: http://www.privacyidea.org
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
# License as published by the Free Software Foundation... | agpl-3.0 |
snar5/Responder | servers/www/footer.py | 1 | 1220 | page_footer = """
<footer>Happy Hunting </footer>
<div id="hashModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Captured Hashes</h2>
</div>
<div class="modal-body">
<p id='dumped_hashes'></p>
</div>
<div class="... | gpl-3.0 |
flwh/KK_mt6589_iq451 | prebuilts/python/linux-x86/2.7.5/lib/python2.7/distutils/command/install_headers.py | 251 | 1346 | """distutils.command.install_headers
Implements the Distutils 'install_headers' command, to install C/C++ header
files to the Python include directory."""
__revision__ = "$Id$"
from distutils.core import Command
# XXX force is never used
class install_headers(Command):
description = "install C/C++ header file... | gpl-2.0 |
tensorflow/agents | tf_agents/policies/boltzmann_policy.py | 1 | 3143 | # coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env32/lib/python2.7/site-packages/twisted/trial/test/test_pyunitcompat.py | 13 | 7670 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import division, absolute_import
import sys
import traceback
from zope.interface import implementer
from twisted.python.failure import Failure
from twisted.trial.unittest import SynchronousTestCase, PyUnitResultAdapter
from twis... | gpl-2.0 |
simonsfoundation/CaImAn | caiman/utils/image_preprocessing_keras.py | 2 | 44852 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
From KERAS package
Fairly basic set of tools for real-time data augmentation on image data.
Can easily be extended to include new transformations,
new preprocessing methods, etc...
"""
from functools import partial
import multiprocessing.pool
import numpy as np
import... | gpl-2.0 |
callmetaste/PHCpack | src/Python/PHCpy3/phcpy/sets.py | 1 | 59284 | """
This module exports routines of PHCpack to manipulate
positive dimensional solution sets of polynomial systems.
"""
def standard_embed(nvar, topdim, pols):
"""
Given in pols a list of strings representing polynomials in nvar
variables, with coefficients in standard double precision,
this function r... | gpl-3.0 |
Parlin-Galanodel/scrapy | scrapy/utils/response.py | 16 | 2815 | """
This module provides some useful functions for working with
scrapy.http.Response objects
"""
import os
import weakref
import webbrowser
import tempfile
from twisted.web import http
from scrapy.utils.python import to_bytes, to_native_str
from w3lib import html
from scrapy.utils.decorators import deprecated
@depr... | bsd-3-clause |
skyddv/neutron | neutron/tests/unit/extensions/foxinsocks.py | 24 | 3568 | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
GaussDing/django | tests/gis_tests/gdal_tests/test_ds.py | 21 | 11450 | import os
import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from ..test_data import TEST_DATA, TestDS, get_ds_file
if HAS_GDAL:
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, GDALException, OGRIndexError, GDAL_VERSION
from django.contrib.gis.... | bsd-3-clause |
guerrerocarlos/odoo | addons/l10n_pl/__init__.py | 340 | 1155 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# l10n_pl module improved for Poland
# by Grzegorz Grzelak grzegorz.g... | agpl-3.0 |
mapzen/vector-datasource | test/test_meta.py | 2 | 26453 | # -*- coding: utf-8 -*-
import unittest
def memoize(f):
result = {}
def wrapped(*args, **kwargs):
cache_key = tuple(args)
if not result:
result[cache_key] = f(*args, **kwargs)
return result[cache_key]
return wrapped
@memoize
def parse_layers_props(yaml_path):
f... | mit |
openshift/openshift-tools | openshift/installer/vendored/openshift-ansible-3.9.40/roles/openshift_health_checker/openshift_checks/logging/kibana.py | 39 | 9211 | """
Module for performing checks on a Kibana logging deployment
"""
import json
import ssl
# pylint can't find the package when its installed in virtualenv
# pylint: disable=import-error,no-name-in-module
from ansible.module_utils.six.moves.urllib import request
# pylint: disable=import-error,no-name-in-module
from a... | apache-2.0 |
brittanystoroz/kitsune | kitsune/gallery/tests/test_templates.py | 6 | 5854 | from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.gallery.models import Image, Video
from kitsune.gallery.tests import ImageFactory, VideoFactory
from kitsune.sumo.templatetags.jinja_helpers import urlparams
from kitsune.sumo.tests import TestCase, get, LocalizingClient, post
from kitsune.sumo.... | bsd-3-clause |
mmoya/ansible | v2/test/parsing/vault/test_vault.py | 87 | 5672 | # (c) 2012-2014, 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) an... | gpl-3.0 |
switchkiller/ProjDjanko | lib/python2.7/site-packages/django/contrib/contenttypes/views.py | 124 | 3575 | from __future__ import unicode_literals
from django import http
from django.apps import apps
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.requests import RequestSite
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
def sh... | gpl-2.0 |
kbrebanov/ansible | lib/ansible/modules/network/nxos/nxos_ntp_options.py | 2 | 5577 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
Code4SA/odac-victim-empowerment | msg_handler/menu.py | 1 | 22821 | menu = {
"title": "Main menu",
"content": [
{
"title": "I've been raped / sexually abused what do I do now?",
"content": [
{
"title": "Important Information",
"content": [
"Make sure that you are safe... | apache-2.0 |
winningsix/hive | metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py | 3 | 317252 | #
# Autogenerated by Thrift Compiler (0.9.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
import fb303.ttypes
from thrift.transport import TTransport
from thrift.protocol import TBinaryP... | apache-2.0 |
LPgenerator/django-robokassa | robokassa/south_migrations/0001_initial.py | 5 | 1420 | # -*- 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 model 'SuccessNotification'
db.create_table('robokassa_successnotification', (
('id', s... | mit |
kgreav/cassandra | bin/cqlsh.py | 6 | 100531 | #!/bin/sh
# -*- mode: Python -*-
# 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.... | apache-2.0 |
deepsrijit1105/edx-platform | lms/djangoapps/course_wiki/tests/test_access.py | 17 | 8442 | """
Tests for wiki permissions
"""
from django.contrib.auth.models import Group
from nose.plugins.attrib import attr
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from courseware.test... | agpl-3.0 |
kawamon/hue | desktop/core/ext-py/PyYAML-5.4.1/tests/lib/test_multi_constructor.py | 8 | 1519 | import yaml
import pprint
import sys
def _load_code(expression):
return eval(expression)
def myconstructor1(constructor, tag, node):
seq = constructor.construct_sequence(node)
return {tag: seq }
def myconstructor2(constructor, tag, node):
seq = constructor.construct_sequence(node)
string = ''
... | apache-2.0 |
fake-name/ReadableWebProxy | WebMirror/processor/ProcessorUtils/jsLiteralParse.py | 1 | 11155 |
import pyparsing as pp
def jsParse(inStr):
# This disaster is a context-free grammar parser for parsing javascript object literals.
# It needs to be able to handle a lot of the definitional messes you find in in-the-wild
# javascript object literals.
# Unfortunately, Javascript is /way/ more tolerant then JSON w... | bsd-3-clause |
karllessard/tensorflow | tensorflow/python/kernel_tests/control_flow_ops_py_test.py | 1 | 190717 | # 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... | apache-2.0 |
mausvt/seagate_central_cns3420_2-6-35 | scripts/proc_static_files_table.py | 2 | 2411 | #!/usr/bin/env python
# Usage: progname <directory>
#
# This program scans <directory> and generates C code on its stdout
# that contains an array of psf_entry structures, one for each file
# in <directory>. This code may be used to instantiate a file in procfs
# whose contents is identical to each file in <directory... | gpl-2.0 |
iamgreaser/pysnip | feature_server/console.py | 8 | 2950 | # Copyright (c) Mathias Kaerlev 2011-2012.
# This file is part of pyspades.
# pyspades 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... | gpl-3.0 |
architecture-building-systems/CityEnergyAnalyst | cea/technologies/constants.py | 2 | 4135 | """
Constants used throughout the cea.technologies package.
History lesson: This is a first step at removing the `cea.globalvars.GlobalVariables` object.
"""
# Heat Exchangers
U_COOL = 2500.0 # W/m2K
U_HEAT = 2500.0 # W/m2K
DT_HEAT = 5.0 # K - pinch delta at design conditions
DT_COOL = 2.0 # K - pinch del... | mit |
cryptobanana/ansible | lib/ansible/modules/network/f5/bigiq_regkey_pool.py | 1 | 11321 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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_version': '1.1',
... | gpl-3.0 |
sebadiaz/rethinkdb | external/v8_3.30.33.16/build/gyp/test/mac/gyptest-app.py | 75 | 4193 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that app bundles are built correctly.
"""
import TestGyp
import os
import plistlib
import subprocess
import sys
def GetStdou... | agpl-3.0 |
VinceZK/phantomjs | src/qt/qtwebkit/Tools/Scripts/run-inspector-perf-tests.py | 131 | 1884 | #!/usr/bin/env python
# Copyright (C) 2011 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 ... | bsd-3-clause |
patrikpettersson/rest-engine | lib/aniso8601/tests/test_time.py | 3 | 20403 | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Brandon Nielsen
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import unittest
import datetime
from aniso8601.time import get_time_resolution, parse_time, parse_datetime, \... | mit |
wetek-enigma/oe-alliance-core | meta-oe/recipes-devtools/python/python_2.7.12/sitecustomize.py | 228 | 1125 | # OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
# GPLv2 or later
# Version: 20081123
# Features:
# * set proper default encoding
# * enable readline completion in the interactive interpreter
# * load command line history on startup
# * save command line history on exit
i... | gpl-2.0 |
Maximilian-Reuter/SickRage-1 | lib/hachoir_parser/image/tiff.py | 74 | 2337 | """
TIFF image parser.
Authors: Victor Stinner, Sebastien Ponce, Robert Xiao
Creation date: 30 september 2006
"""
from hachoir_parser import Parser
from hachoir_core.field import FieldSet, SeekableFieldSet, RootSeekableFieldSet, Bytes
from hachoir_core.endian import LITTLE_ENDIAN, BIG_ENDIAN
from hachoir_parser.image... | gpl-3.0 |
isard-vdi/isard | engine/engine/engine/api/evaluate.py | 1 | 2700 | import inspect
import time
from flask import jsonify, request
from engine.controllers.eval_controller import EvalController
from engine.services.csv.eval import eval_to_csv
from engine.services.db.eval import insert_eval_result
from . import api
@api.route('/create_domains', methods=['GET'])
def create_domains():
... | agpl-3.0 |
AMGitsKriss/Battlegrounds | battlegrounds_write_graph.py | 2 | 1492 | import pandas as pd
#Enumerate colors.
class COLOR:
RED = "tomato"
GREEN = "yellowgreen"
BLUE = "lightblue"
NEWLINE_INDENT = "\n "
def fill(color):
return f"[style=filled fillcolor=\"{color}\"]"
def dual_label(weapon, n):
return f"[label=\"{weapon}\" taillabel=\"{n}\"]"
def solo_node(player, color):
return f... | mit |
astrofrog/glue-vispy-viewers | glue_vispy_viewers/extern/vispy/gloo/wrappers.py | 21 | 24948 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | bsd-2-clause |
frmichel/vo-support-tools | CE/monitor-ce/processors/running_ratio_slices.py | 1 | 4606 | #!/usr/bin/python
#
# This tools exploits the data of csv files produced by script collect-ce-job-status.py, to
# compute the number of CEs grouped by slice of ratio R/(R+W) as a function of time:
# between 0 and 0,5, and between 0,5 and 1, exactly 1 or not calculable.
#
# Results are stored in file running_ratio_slic... | mit |
victorg590/ampadb | usermanager/models.py | 2 | 2784 | from django.core import validators
from django.core.exceptions import ValidationError
from django.contrib.auth.models import User
from django.db import models
from contactboard.models import Alumne
class Profile(models.Model):
class Meta:
verbose_name = 'perfil'
ordering = ['alumne']
user = m... | mit |
rahul67/hue | desktop/core/ext-py/Django-1.6.10/tests/forms_tests/tests/test_media.py | 131 | 45513 | # -*- coding: utf-8 -*-
from django.forms import TextInput, Media, TextInput, CharField, Form, MultiWidget
from django.template import Template, Context
from django.test import TestCase
from django.test.utils import override_settings
@override_settings(
STATIC_URL=None,
MEDIA_URL='http://media.example.com/med... | apache-2.0 |
mcmontero/tinyAPI | base/services/geo/api/tests/CountryCode_tests.py | 1 | 1390 | # ----- Info ------------------------------------------------------------------
__author__ = 'Michael Montero <mcmontero@gmail.com>'
# ----- Imports ---------------------------------------------------------------
from tinyAPI.base.services.geo.api.CountryCode import CountryCode
import tinyAPI
import unittest
# ---... | mit |
CenturylinkTechnology/ansible-modules-extras | monitoring/monit.py | 53 | 6888 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Darryl Stoflet <stoflet@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 Li... | gpl-3.0 |
maartenq/ansible | lib/ansible/modules/remote_management/manageiq/manageiq_policies.py | 64 | 11828 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Daniel Korn <korndaniel1@gmail.com>
# (c) 2017, Yaacov Zamir <yzamir@redhat.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
ANS... | gpl-3.0 |
thedrow/django | django/conf/locale/lt/formats.py | 504 | 1830 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. E j \d.'
TIME_FORMAT = 'H:... | bsd-3-clause |
arborh/tensorflow | tensorflow/python/autograph/utils/type_check.py | 22 | 1168 | # 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... | apache-2.0 |
tchellomello/home-assistant | homeassistant/scripts/macos/__init__.py | 7 | 1824 | """Script to install/uninstall HA into OS X."""
import os
import time
# mypy: allow-untyped-calls, allow-untyped-defs
def install_osx():
"""Set up to run via launchd on OS X."""
with os.popen("which hass") as inp:
hass_path = inp.read().strip()
with os.popen("whoami") as inp:
user = inp.... | apache-2.0 |
costypetrisor/scikit-learn | sklearn/externals/joblib/numpy_pickle.py | 35 | 15580 | """
Utilities for fast persistence of big data, with optional compression.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
import pickle
import traceback
import sys
import os
import zlib
import warnings
from ._compat import ... | bsd-3-clause |
yonglehou/spiderfoot | ext/stem/interpreter/commands.py | 11 | 11489 | # Copyright 2014-2015, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Handles making requests and formatting the responses.
"""
import code
import socket
import stem
import stem.control
import stem.descriptor.remote
import stem.interpreter.help
import stem.util.connection
import stem.... | gpl-2.0 |
amenonsen/ansible | test/units/modules/network/f5/test_bigip_asm_dos_application.py | 21 | 11479 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
Tejal011089/paypal_erpnext | erpnext/setup/doctype/sms_settings/sms_settings.py | 15 | 3544 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _, throw, msgprint
from frappe.utils import cstr, nowdate
from frappe.model.document import Document
class SMS... | agpl-3.0 |
Deepakkothandan/ansible | lib/ansible/modules/utilities/logic/import_tasks.py | 2 | 1548 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# 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_version': '1.1',
... | gpl-3.0 |
keyboardio/Kaleidoscope | testing/googletest/googletest/test/gtest_xml_outfiles_test.py | 60 | 5349 | #!/usr/bin/env python
#
# Copyright 2008, 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... | gpl-3.0 |
halberom/ansible-modules-core | inventory/group_by.py | 161 | 1330 | # -*- mode: python -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distr... | gpl-3.0 |
14thibea/megamix | doc/example.py | 1 | 2598 | ########################
# Prelude to the example
########################
"""
This example is realized with a DP-VBGMM model
The other mixtures and the K-means are working in the same way
The available classes are:
- Kmeans (kmeans)
- GaussianMixture (GMM)
- VariationalGaussianMixture (VBGMM)
- DPVariation... | apache-2.0 |
pravsripad/mne-python | tutorials/source-modeling/plot_compute_covariance.py | 4 | 8732 | """
.. _tut_compute_covariance:
Computing a covariance matrix
=============================
Many methods in MNE, including source estimation and some classification
algorithms, require covariance estimations from the recordings.
In this tutorial we cover the basics of sensor covariance computations and
construct a no... | bsd-3-clause |
tsdgeos/snapcraft | external_snaps_tests/__main__.py | 5 | 3360 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
openfun/edx-platform | lms/djangoapps/instructor/hint_manager.py | 110 | 11466 | """
Views for hint management.
Get to these views through courseurl/hint_manager.
For example: https://courses.edx.org/courses/MITx/2.01x/2013_Spring/hint_manager
These views will only be visible if FEATURES['ENABLE_HINTER_INSTRUCTOR_VIEW'] = True
"""
import json
import re
from django.http import HttpResponse, Http... | agpl-3.0 |
reshama/data-science-from-scratch | code/getting_data.py | 60 | 6317 | from __future__ import division
from collections import Counter
import math, random, csv, json
from bs4 import BeautifulSoup
import requests
######
#
# BOOKS ABOUT DATA
#
######
def is_video(td):
"""it's a video if it has exactly one pricelabel, and if
the stripped text inside that pricelabel starts with 'Vi... | unlicense |
Anonymouslemming/ansible | lib/ansible/modules/network/nxos/nxos_vrf_af.py | 37 | 7795 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
jmartinm/invenio | modules/bibformat/lib/elements/bfe_webauthorpage_data.py | 18 | 1333 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
cwadding/sensit-python | sensit/api/publication.py | 1 | 2940 | # Publications are stored actions which are taken when a feed is created, updated, deleted, or there is a matching percolator query.
#
# topic_id - The key for the parent topic
# id - The identifier of the publication
class Publication():
def __init__(self, topic_id, id, client):
self.topic_id = topic_id
self.id ... | mit |
sysalexis/kbengine | kbe/src/lib/python/Lib/test/sortperf.py | 92 | 4805 | """Sort performance test.
See main() for command line syntax.
See tabulate() for output format.
"""
import sys
import time
import random
import marshal
import tempfile
import os
td = tempfile.gettempdir()
def randfloats(n):
"""Return a list of n random floats in [0, 1)."""
# Generating floats is expensive,... | lgpl-3.0 |
kswiat/django | django/utils/module_loading.py | 18 | 6640 | from __future__ import absolute_import # Avoid importing `importlib` from this package.
import copy
from importlib import import_module
import os
import sys
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils.deprecation import RemovedInDjango19Warni... | bsd-3-clause |
paterson/servo | tests/wpt/css-tests/css21_dev/xhtml1/support/fonts/makegsubfonts.py | 820 | 14309 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
blacktear23/django | tests/regressiontests/utils/html.py | 86 | 4753 | import unittest
from django.utils import html
class TestUtilsHtml(unittest.TestCase):
def check_output(self, function, value, output=None):
"""
Check that function(value) equals output. If output is None,
check that function(value) equals value.
"""
if output is None:
... | bsd-3-clause |
Beyond-Imagination/BlubBlub | ChatbotServer/ChatbotEnv/Lib/site-packages/numpy/polynomial/tests/test_laguerre.py | 58 | 17242 | """Tests for laguerre module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.laguerre as lag
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run_mod... | gpl-3.0 |
alisaifee/limits | limits/_version.py | 1 | 18450 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | mit |
Jgarcia-IAS/localizacion | openerp/tools/convert.py | 205 | 41282 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
jgonthier/psi4 | tests/pytests/test_qcvars.py | 10 | 8520 | import copy
import pytest
from .utils import *
import numpy as np
import psi4
pytestmark = pytest.mark.quick
_vars_entered = {
'VAR A': 4.0,
'VaR B': -4.0,
'MATVAR A': psi4.core.Matrix.from_array(np.arange(6).reshape(2, 3)),
'MatvaR B': psi4.core.Matrix.from_array(np.arange(3).reshape(1, 3)),
'... | lgpl-3.0 |
vktr/CouchPotatoServer | couchpotato/core/media/movie/providers/automation/crowdai.py | 12 | 3025 | import re
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import tryInt, splitString
from couchpotato.core.logger import CPLog
from couchpotato.core.media.movie.providers.automation.base import Automation
log = CPLog(__name__)
autoload = 'CrowdAI'
class CrowdAI(Aut... | gpl-3.0 |
openmips/stbgui | lib/python/Screens/TimeDateInput.py | 25 | 2498 | from Screen import Screen
from Components.config import ConfigClock, ConfigDateTime, getConfigListEntry
from Components.ActionMap import NumberActionMap
from Components.ConfigList import ConfigListScreen
from Components.Label import Label
from Components.Pixmap import Pixmap
import time
import datetime
class TimeDateI... | gpl-2.0 |
seaotterman/tensorflow | tensorflow/contrib/learn/python/learn/metric_spec_test.py | 136 | 14891 | # 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... | apache-2.0 |
KiChjang/servo | tests/wpt/web-platform-tests/tools/third_party/pywebsocket3/test/testdata/handlers/origin_check_wsh.py | 21 | 1934 | # 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 conditions and the f... | mpl-2.0 |
lgp171188/cookiecutter | tests/test_generate_copy_without_render.py | 25 | 2238 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_generate_copy_without_render
---------------------------------
"""
from __future__ import unicode_literals
import os
import pytest
from cookiecutter import generate
from cookiecutter import utils
@pytest.fixture(scope='function')
def remove_test_dir(request):
... | bsd-3-clause |
h00dy/Diamond | src/collectors/slony/test/testslony.py | 23 | 3624 | #!/usr/bin/python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import run_only
from mock import patch
from slony import SlonyCollector
def run_only_if_psycopg2_is_available(func):
... | mit |
openstack/rally | tests/unit/test_resources.py | 1 | 1715 | # Copyright 2014: Mirantis 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 b... | apache-2.0 |
mat650/metagoofil | discovery/googlesearch.py | 15 | 1388 | import string
import httplib, sys
import myparser
import re
import time
class search_google:
def __init__(self,word,limit,start,filetype):
self.word=word
self.results=""
self.totalresults=""
self.filetype=filetype
self.server="www.google.com"
self.hostname="www.google.com"
self.userAgent="(Mozilla/5.0 (... | gpl-2.0 |
fceller/arangodb | 3rdParty/boost/1.62.0/libs/mpi/test/python/scatter_test.py | 64 | 1300 | # Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>.
# Use, modification and distribution is subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Test scatter() collective.
import boost.parallel.mpi as mpi
from ... | apache-2.0 |
drawks/ansible | test/units/module_utils/xenserver/test_xenserverobject.py | 14 | 2121 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, Bojan Vitnik <bvitnik@mainstream.rs>
# 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
import pytest
from .FakeAnsibleModule import FakeAn... | gpl-3.0 |
ahachete/gpdb | gpMgmt/bin/gppylib/commands/test/regress/test_regress_pg.py | 54 | 1711 | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
# Unit Testing of pg commands
#
import os
import unittest
import tempfile
from gppylib.db import dbconn
from gppylib.db.test import skipIfDatabaseDown
from gppylib import gplog
from gppylib.commands import pg
from gppylib.gparray impo... | apache-2.0 |
FrancisLab/bing_image_archiver | iorise_image_extractor.py | 1 | 4682 | import re
import urllib
from HTMLParser import HTMLParser
class BlogAttachmentPageParser(HTMLParser):
"""HTMLParser used to extract the url of Bing images from a Blog Post Attachment Page from www.iorise.com
(e.g.: http://www.iorise.com/blog/?attachment_id=44)"""
def __init__(self, result_list):
... | mit |
Distrotech/intellij-community | python/testData/inspections/PyTypeCheckerInspection/Generator.py | 25 | 3013 | def test():
def gen(n):
for x in xrange(n):
yield str(x)
def f_1(xs):
"""
:type xs: list of int
"""
return xs
def f_2(xs):
"""
:type xs: collections.Sequence of int
"""
return xs
def f_3(xs):
"""
:type xs... | apache-2.0 |
gbourdin/charlas | ml-notebook-to-prod/examples/mnistExample/mnistapi/mnistapi/__main__.py | 1 | 1833 | import click
from os import cpu_count, environ, execvp
from sys import prefix
from .app import create_app
@click.group()
def cli():
pass
@cli.command()
def run_uwsgi():
"""
Run API through uwsgi server.
"""
# avoid fork problems with tensorflow (and other non-serializable objects)
environ[... | gpl-2.0 |
Walesson/angular2-movie-app | node_modules/node-forge/tests/forge_ssl/forge/ssl.py | 169 | 16598 | # Wrapper module for _ssl, providing some additional facilities
# implemented in Python. Written by Bill Janssen.
"""\
This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O er... | gpl-3.0 |
aristotle-tek/cuny-bdif | AWS/ec2/lib/boto-2.34.0/tests/unit/vpc/test_routetable.py | 64 | 20068 | from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.vpc import VPCConnection, RouteTable
class TestDescribeRouteTables(AWSMockServiceTestCase):
connection_class = VPCConnection
def default_body(self):
return b"""
<DescribeRouteTablesResponse xmlns="ht... | mit |
rc0r/afl-utils | afl_utils/afl_stats.py | 1 | 15342 | """
Copyright 2015-2016 @_rc0r <hlt99@blinkenshell.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | apache-2.0 |
jmdejong/Asciifarm | asciifarm/server/entity.py | 1 | 4171 |
from . import serialize
from .eventtarget import EventTarget
class Entity:
""" Attempt to implement an entity component system
This is the base object
Components are given on construction.
Once a component is added to the object the attach method will be called on the component (if it has one).
... | gpl-3.0 |
jsgage/android_kernel_ba2x | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
yashrastogi16/python_koans | python2/runner/sensei.py | 3 | 9891 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import re
import sys
import os
import glob
import helper
from mockable_test_result import MockableTestResult
from runner import path_to_enlightenment
from libs.colorama import init, Fore, Style
init() # init colorama
class Sensei(MockableTestResult):
... | mit |
quole/gensim | gensim/corpora/wikicorpus.py | 2 | 13419 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Copyright (C) 2012 Lars Buitinck <larsmans@gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Construct a corpus from a Wikipedia (or other MediaWiki-based) database dum... | lgpl-2.1 |
vkroz/kafka | system_test/utils/system_test_utils.py | 88 | 23697 | # 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-2.0 |
EmmanuelJohnson/ssquiz | flask/lib/python2.7/site-packages/pip/_vendor/colorama/win32.py | 451 | 4833 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
from ctypes import windll
from ctypes import wintypes
except ImportError:
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import (
byref, Str... | bsd-3-clause |
elkingtonmcb/pattern | pattern/web/pdf/encodingdb.py | 56 | 1548 | #!/usr/bin/env python2
import re
from psparser import PSLiteral
from glyphlist import glyphname2unicode
from latin_enc import ENCODING
## name2unicode
##
STRIP_NAME = re.compile(r'[0-9]+')
def name2unicode(name):
"""Converts Adobe glyph names to Unicode numbers."""
if name in glyphname2unicode:
retu... | bsd-3-clause |
dudymas/python-openstacksdk | openstack/tests/unit/block_store/test_block_store_service.py | 4 | 1110 | # 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... | apache-2.0 |
Serg09/socorro | socorro/external/postgresql/skiplist.py | 8 | 3829 | # 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/.
import logging
import psycopg2
from socorro.external import DatabaseError, MissingArgumentError
from socorro.external.p... | mpl-2.0 |
fuhongliang/odoo | addons/crm/wizard/crm_partner_binding.py | 257 | 4570 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.