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 |
|---|---|---|---|---|---|
naveenvhegde/pytmdb3 | tmdb3/cache_file.py | 34 | 13291 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_file.py
# Python Library
# Author: Raymond Wagner
# Purpose: Persistant file-backed cache using /tmp/ to share data
# using flock or msvcrt.locking to allow safe concurrent
# access.
#-----------------------
import s... | bsd-3-clause |
pekeler/arangodb | 3rdParty/V8-4.3.61/build/gyp/test/gyp-defines/gyptest-multiple-values.py | 169 | 1312 | #!/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 when multiple values are supplied for a gyp define, the last one
is used.
"""
import os
import TestGyp
test = TestGyp.Te... | apache-2.0 |
nortikin/sverchok | nodes/layout/wifi_in.py | 2 | 3973 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is distrib... | gpl-3.0 |
iw3hxn/LibrERP | project_extended/models/inherited_project_task.py | 1 | 4994 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011-2016 Didotech Srl. (<http://www.didotech.com>)
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero G... | agpl-3.0 |
abadger/ansible | test/lib/ansible_test/_internal/commands/integration/cloud/__init__.py | 13 | 14122 | """Plugin system for cloud providers and environments for use in integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import abc
import atexit
import datetime
import os
import re
import tempfile
import time
from .... import types as t
from ....encoding import ... | gpl-3.0 |
hendradarwin/VTK | Common/DataModel/Testing/Python/TestTemplates.py | 11 | 4369 | #!/usr/bin/env python
"""Test template support in VTK-Python
VTK-python decides which template specializations
to wrap according to which ones are used in typedefs
and which ones appear as superclasses of other classes.
In addition, the wrappers are hard-coded to wrap the
vtkDenseArray and vtkSparseArray classes over ... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/opencv/sources/samples/python2/grabcut.py | 8 | 6091 | #!/usr/bin/env python
'''
===============================================================================
Interactive Image Segmentation using GrabCut algorithm.
This sample shows interactive image segmentation using grabcut algorithm.
USAGE:
python grabcut.py <filename>
README FIRST:
Two windows will show u... | gpl-3.0 |
arfoll/upm | examples/python/a110x.py | 16 | 1860 | #!/usr/bin/python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel 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 without restriction, including
# without limi... | mit |
moi65/cookiecutter | tests/test_utils.py | 26 | 1737 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_utils
------------
Tests for `cookiecutter.utils` module.
"""
import os
import pytest
import stat
import sys
from cookiecutter import utils
def make_readonly(path):
"""Helper function that is called in the tests to change the access
permissions of the... | bsd-3-clause |
DrOctogon/unwash_ecom | tests/unit/partner/price_tests.py | 3 | 1516 | from django.test import TestCase
from decimal import Decimal as D
from oscar.core.prices import TaxNotKnown
from oscar.apps.partner import prices, models
class TestUnavailable(TestCase):
def setUp(self):
self.price = prices.Unavailable()
def test_means_unknown_tax(self):
self.assertFalse(se... | bsd-3-clause |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/django/template/exceptions.py | 483 | 1392 | """
This module contains generic exceptions used by template backends. Although,
due to historical reasons, the Django template language also internally uses
these exceptions, other exceptions specific to the DTL should not be added
here.
"""
class TemplateDoesNotExist(Exception):
"""
The exception used when ... | apache-2.0 |
dpshelio/scikit-image | skimage/viewer/canvastools/base.py | 43 | 3877 | import numpy as np
from matplotlib import lines
__all__ = ['CanvasToolBase', 'ToolHandles']
def _pass(*args):
pass
class CanvasToolBase(object):
"""Base canvas tool for matplotlib axes.
Parameters
----------
manager : Viewer or PlotPlugin.
Skimage viewer or plot plugin object.
on_m... | bsd-3-clause |
madhugb/html2text | html2text/cli.py | 3 | 8645 | import optparse
from html2text.compat import urllib
from html2text import HTML2Text, config, __version__
from html2text.utils import wrapwrite, wrap_read
def main():
baseurl = ''
class bcolors: # pragma: no cover
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
W... | gpl-3.0 |
andrius-preimantas/account-financial-tools | account_auto_fy_sequence/tests/__init__.py | 37 | 1137 | # coding=utf-8
##############################################################################
#
# account_auto_fy_sequence module for Odoo
# Copyright (C) 2014 ACSONE SA/NV (<http://acsone.eu>)
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
#
# account_auto_fy_sequence is free software:
# you can ... | agpl-3.0 |
Esri/solutions-geoprocessing-toolbox | utils/test/geonames_tests/GeoNamesTestCase.py | 2 | 4726 | # coding: utf-8
#------------------------------------------------------------------------------
# Copyright 2017 Esri
# 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... | apache-2.0 |
ntiufalara/openerp7 | openerp/addons/account/account_bank_statement.py | 26 | 29621 | # -*- 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... | mit |
xiaoxiamii/scikit-learn | sklearn/neighbors/tests/test_nearest_centroid.py | 305 | 4121 | """
Testing for the nearest centroid module.
"""
import numpy as np
from scipy import sparse as sp
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal
from sklearn.neighbors import NearestCentroid
from sklearn import datasets
from sklearn.metrics.pairwise import pairwise_distances
# t... | bsd-3-clause |
KrzysztofStachanczyk/Sensors-WWW-website | www/env/lib/python2.7/site-packages/django/utils/cache.py | 50 | 14997 | """
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... | gpl-3.0 |
alfredoavanzosc/odoomrp-utils | stock_incoterm_extension/__openerp__.py | 10 | 1361 | # -*- coding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
#... | agpl-3.0 |
adrianholovaty/django | tests/modeltests/reverse_lookup/tests.py | 150 | 1687 | from __future__ import absolute_import
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import User, Poll, Choice
class ReverseLookupTests(TestCase):
def setUp(self):
john = User.objects.create(name="John Doe")
jim = User.objects.create(name="Jim Bo")
... | bsd-3-clause |
x2Ident/x2Ident | mitmproxy/test/netlib/http/test_url.py | 2 | 3211 | import six
from netlib import tutils
from netlib.http import url
def test_parse():
with tutils.raises(ValueError):
url.parse("")
s, h, po, pa = url.parse(b"http://foo.com:8888/test")
assert s == b"http"
assert h == b"foo.com"
assert po == 8888
assert pa == b"/test"
... | gpl-3.0 |
Deepakpatle/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/discardlocalchanges.py | 130 | 2379 | # Copyright (C) 2010 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 ... | bsd-3-clause |
rdeheele/odoo | openerp/addons/base/ir/ir_exports.py | 338 | 1672 | # -*- 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... | agpl-3.0 |
chenjun0210/tensorflow | tensorflow/examples/tutorials/mnist/mnist.py | 65 | 5292 | # 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 |
mmardini/django | django/conf/locale/en_GB/formats.py | 148 | 2111 | # -*- 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 = 'j M Y' # '25 Oc... | bsd-3-clause |
googleapis/google-cloud-ruby | google-cloud-assured_workloads-v1beta1/synth.py | 2 | 1090 | # Copyright 2020 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, s... | apache-2.0 |
hail-is/hail | hail/python/hail/typecheck/check.py | 2 | 18227 | import re
import inspect
import abc
import collections
from decorator import decorator
class TypecheckFailure(Exception):
pass
def identity(x):
return x
def extract(t):
m = re.match("<(type|class) '(.*)'>", str(t))
if m:
return m.groups()[1]
else:
return str(t)
class TypeChec... | mit |
tejasnikumbh/ThesisCode | lib/python2.7/site-packages/numpy/distutils/__config__.py | 6 | 1071 | # This file is generated by /home/users/tejasnikumbh/Desktop/numpy-1.9.2/setup.py
# It contains system_info results at the time of building this package.
__all__ = ["get_info","show"]
blas_info={}
atlas_3_10_blas_info={}
lapack_info={}
atlas_3_10_blas_threads_info={}
atlas_threads_info={}
blas_src_info={}
blas_opt_inf... | mit |
crazyAxe/tp-libvirt | libvirt/tests/src/virsh_cmd/host/virsh_nodecpustats.py | 4 | 8299 | import re
from autotest.client.shared import error
from autotest.client import utils
from virttest import virsh
from virttest import utils_libvirtd
def run(test, params, env):
"""
Test the command virsh nodecpustats
(1) Call the virsh nodecpustats command for all cpu host cpus
separately
(2... | gpl-2.0 |
arielalmendral/ert | python/python/ert/util/time_vector.py | 1 | 8443 | # Copyright (C) 2014 Statoil ASA, Norway.
#
# The file 'vector_template.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 ... | gpl-3.0 |
epruesse/ymp | src/ymp/stage/pipeline.py | 1 | 7053 | """Pipelines Module
Contains classes for pre-configured pipelines comprising multiple
stages.
"""
import logging
import os
from collections import OrderedDict
from collections.abc import Mapping
from typing import Dict, List, Set, Optional
from ymp.stage import StageStack, find_stage
from ymp.stage.base import Conf... | gpl-3.0 |
mfraezz/osf.io | api/caching/tasks.py | 3 | 4485 | from future.moves.urllib.parse import urlparse
import requests
import logging
from django.apps import apps
from api.caching.utils import storage_usage_cache
from django.db import models
from framework.postcommit_tasks.handlers import enqueue_postcommit_task
from api.caching import settings as cache_settings
from fra... | apache-2.0 |
patilsangram/erpnext | erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py | 2 | 4076 | import frappe
from frappe import _
from frappe.utils import flt
from erpnext.accounts.utils import get_fiscal_year
from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category \
import get_advance_vouchers, get_debit_note_amount
def execute(filters=None):
validate_filters(filters)
columns = get_... | gpl-3.0 |
fracting/depot_tools | third_party/gsutil/gslib/commands/setwebcfg.py | 51 | 7485 | # Copyright 2012 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... | bsd-3-clause |
StephenWeber/ansible | lib/ansible/modules/cloud/amazon/redshift.py | 25 | 16827 | #!/usr/bin/python
# Copyright 2014 Jens Carl, Hothead Games Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | gpl-3.0 |
partofthething/home-assistant | homeassistant/components/hisense_aehw4a1/climate.py | 21 | 13381 | """Pyaehw4a1 platform to control of Hisense AEH-W4A1 Climate Devices."""
import logging
from pyaehw4a1.aehw4a1 import AehW4a1
import pyaehw4a1.exceptions
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
FAN_AUTO,
FAN_HIGH,
FAN_LOW,
FAN_ME... | mit |
undoware/neutron-drive | google_appengine/lib/django_1_2/django/db/backends/postgresql/introspection.py | 308 | 3725 | from django.db.backends import BaseDatabaseIntrospection
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type codes to Django Field types.
data_types_reverse = {
16: 'BooleanField',
20: 'BigIntegerField',
21: 'SmallIntegerField',
23: 'IntegerField',
25: 'T... | bsd-3-clause |
alexandrettio/pyfpdf | tutorial/tuto4.py | 21 | 1932 | from fpdf import *
class PDF(FPDF):
#Current column
col=0
#Ordinate of column start
y0=0
def header(self):
#Page header
self.set_font('Arial','B',15)
w=self.get_string_width(title)+6
self.set_x((210-w)/2.0)
self.set_draw_color(0,80,180)
self.set_fill_color(230,230,0)
self.set_text_color(220,50,50)
s... | lgpl-3.0 |
liefdiy/bite-project | deps/gdata-python-client/tests/gdata_tests/sample_util_test.py | 41 | 1819 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 ... | apache-2.0 |
urrego093/proyecto_mv | applications/examples/controllers/appadmin.py | 39 | 25689 | # -*- coding: utf-8 -*-
# ##########################################################
# ## make sure administrator is on localhost
# ###########################################################
import os
import socket
import datetime
import copy
import gluon.contenttype
import gluon.fileutils
try:
import pygraphvi... | gpl-3.0 |
boberfly/gaffer | python/GafferUI/ColorChooser.py | 3 | 9946 | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | bsd-3-clause |
habitissimo/myaas | src/myaas/utils/database.py | 2 | 1350 | import logging
import importlib
from .. import settings
from .container import list_containers
logger = logging.getLogger(__name__)
def get_enabled_backend():
return importlib.import_module(settings.BACKEND)
def get_myaas_containers():
return filter(_is_database_container, list_containers())
def list_da... | lgpl-3.0 |
tonnrueter/pymca_devel | PyMca/APSMEDFileParser.py | 1 | 5643 | #/*##########################################################################
# Copyright (C) 2004-2012 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
#
# This toolkit is free software; you can redistribute it and/or m... | gpl-2.0 |
wimnat/ansible-modules | vpc/ec2_vpc_subnet.py | 44 | 8506 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | gpl-2.0 |
rriggio/wing-openwrt | scripts/flashing/jungo-image.py | 758 | 7069 | #!/usr/bin/env python
#
# Copyright 2008, 2009 (C) Jose Vasconcellos <jvasco@verizon.net>
#
# A script that can communicate with jungo-based routers
# (such as MI424-WR, USR8200 and WRV54G) to backup the installed
# firmware and replace the boot loader.
#
# Tested with Python 2.5 on Linux and Windows
#
"""Usage: %s [op... | gpl-2.0 |
google/llvm-propeller | lldb/third_party/Python/module/pexpect-4.6/pexpect/exceptions.py | 58 | 1068 | """Exception classes used by Pexpect"""
import traceback
import sys
class ExceptionPexpect(Exception):
'''Base class for all exceptions raised by this module.
'''
def __init__(self, value):
super(ExceptionPexpect, self).__init__(value)
self.value = value
def __str__(self):
re... | apache-2.0 |
Anonymouslemming/ansible | lib/ansible/plugins/lookup/together.py | 46 | 1803 | # (c) 2013, Bradley Young <young.bradley@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 later... | gpl-3.0 |
equake/aws-spot-fleet-helper | test/spot_fleet_config_test.py | 1 | 2768 | # -*- coding: utf-8 -*-
import json
import unittest
from base64 import b64decode
from mcmweb.aws_spot_fleet_helper.spot_fleet_config import SpotFleetConfig
class SpotFleetConfigTest(unittest.TestCase):
def setUp(self):
self.config = SpotFleetConfig(12345, 0.2, 'ssh_key', 'ami-f81a5826', 'iam_role')
... | mit |
ECP-CANDLE/Supervisor | workflows/cp-leaveout/py/plangen.py | 1 | 53118 |
from collections import deque
from collections import namedtuple
from enum import Enum
import glob
import itertools as it
import json
import numpy as np
import os
import sys
import sqlite3
from sqlite3 import Error as db_Error
import planargs
from abc import ABC, abstractmethod # abstract class support
from coll... | mit |
EduPepperPDTesting/pepper2013-testing | lms/envs/cms/preview_dev.py | 1 | 4394 | """
Settings for the LMS that runs alongside the CMS on AWS
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .dev import *
import os,sys
sys.path.append("..") # => /home/tahoe/edx_all
from siteconf import ... | agpl-3.0 |
Jackysonglanlan/devops | IDEs/sublime/shared-pkgs/Packages/backrefs/st3/backrefs/uniprops/unidata/hangulsyllabletype.py | 3 | 16109 | """Unicode Properties from Unicode version 6.1.0 (autogen)."""
from __future__ import unicode_literals
unicode_hangul_syllable_type = {
"^l": "\x00-\u10ff\u1160-\ua95f\ua97d-\U0010ffff",
"^lv": "\x00-\uabff\uac01-\uac1b\uac1d-\uac37\uac39-\uac53\uac55-\uac6f\uac71-\uac8b\uac8d-\uaca7\uaca9-\uacc3\uacc5-\uacdf\... | mit |
poldrack/openfmri | pipeline/ds105_reformat_data.py | 1 | 3055 | # reformat data from pymvpa shared dataset to openfmri format
import os
import nibabel
import shutil
from run_shell_cmd import *
s=4 # subject number
basedir='/corral/utexas/poldracklab/openfmri/inprocess/haxby/sub%03d/'%s
# set up directories
datadirs=['anatomy','behav','BOLD','model']
for d in datadirs:
if ... | bsd-2-clause |
qrkourier/ansible | lib/ansible/modules/storage/netapp/netapp_e_amg_sync.py | 56 | 10121 | #!/usr/bin/python
# (c) 2016, NetApp, 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',
'status': ['preview'],
... | gpl-3.0 |
lewer/gensim | gensim/models/hdpmodel.py | 1 | 22347 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Jonathan Esterhazy <jonathan.esterhazy at gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
#
# HDP inference code is adapted from the onlinehdp.py script by
# Chong Wang (chongw at cs.princeton.edu).
# http://www.c... | gpl-3.0 |
jeezybrick/django | django/core/serializers/xml_serializer.py | 25 | 15693 | """
XML serializer.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from xml.dom import pulldom
from xml.sax import handler
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.apps import apps
from django.conf import settings
from django.core.serializers import bas... | bsd-3-clause |
bonitadecker77/python-for-android | python3-alpha/python3-src/Lib/test/test_functools.py | 47 | 24017 | import functools
import collections
import sys
import unittest
from test import support
from weakref import proxy
import pickle
from random import choice
@staticmethod
def PythonPartial(func, *args, **keywords):
'Pure Python approximation of partial()'
def newfunc(*fargs, **fkeywords):
newkeywords = ke... | apache-2.0 |
guolivar/totus-niwa | service/thirdparty/featureserver/tests/FilterEncoding/regression.py | 1 | 1070 | '''
Created on May 10, 2011
@author: michel
'''
import unittest
class RegressionTest(unittest.TestCase):
def suite(self):
modules_to_test = ('SpatialOperatorTest')
alltests = unittest.TestSuite()
for module in map(__import__, modules_to_test):
alltests.addTest(unittest.fi... | gpl-3.0 |
spaghetti-/imusim | imusim/tests/environment/radio_test.py | 2 | 2201 | """
Tests for radio environments.
"""
# Copyright (C) 2009-2011 University of Edinburgh
#
# This file is part of IMUSim.
#
# IMUSim 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 Licen... | gpl-3.0 |
annoviko/pyclustering | pyclustering/core/xmeans_wrapper.py | 1 | 1207 | """!
@brief CCORE Wrapper for X-Means algorithm.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
from ctypes import c_double, c_longlong, c_size_t, c_uint, POINTER
from pyclustering.core.wrapper import ccore_library
from pyclustering.core.pyclustering_pac... | gpl-3.0 |
SomeFire/ignite | modules/platforms/python/tests/test_scan.py | 11 | 2086 | # 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 use ... | apache-2.0 |
kstrauser/ansible | lib/ansible/plugins/inventory/__init__.py | 162 | 2712 | # (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 |
apark263/tensorflow | tensorflow/python/training/adagrad_da_test.py | 13 | 8761 | # 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 |
ambyte/Vertaler | src/modules/translateservices/translatebing.py | 1 | 3636 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright (c) 2011 Sergey Gulyaev <astraway@gmail.com>
#
# This file is part of Vertaler.
#
# Vertaler is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | gpl-2.0 |
DreamLab/contrail-controller | src/opserver/setup.py | 3 | 1165 | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
from setuptools import setup, find_packages
setup(
name='opserver',
version='0.1dev',
packages=find_packages(exclude=["node_mgr", "node_mgr.*", "test.*",
"build.*", "plugins.*"]),
package_data={'':... | apache-2.0 |
bj7/barf-project | barf/barf/core/bi.py | 7 | 7589 | # Copyright (c) 2014, Fundacion Dr. Manuel Sadosky
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... | bsd-2-clause |
diegoguimaraes/django | tests/utils_tests/test_feedgenerator.py | 115 | 4300 | from __future__ import unicode_literals
import datetime
import unittest
from django.utils import feedgenerator
from django.utils.timezone import get_fixed_timezone
class FeedgeneratorTest(unittest.TestCase):
"""
Tests for the low-level syndication feed framework.
"""
def test_get_tag_uri(self):
... | bsd-3-clause |
mc-coal/mc-coal | lib/oauth2client/gce.py | 224 | 3038 | # Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | agpl-3.0 |
slimta/python-slimta | slimta/relay/http.py | 1 | 8580 | # Copyright (c) 2013 Ian C. Good
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | mit |
xenadevel/xenascriptlibs | layer47/python/Bisect.py | 1 | 7780 | #!/usr/bin/python
import os, sys, time, getopt
lib_path = os.path.abspath('testutils')
sys.path.append(lib_path)
from TestUtilsL47 import XenaScriptTools
ports= []
def helptext():
print
print "Usage: %s [options] ipaddr nb_ipaddr nb_ports ramp_max ramp_min svr_port cli_port" % (sys.argv[0])
print
print "The t... | mit |
denovator/mochafac | lib/mako/cmd.py | 13 | 2129 | # mako/cmd.py
# Copyright (C) 2006-2014 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from argparse import ArgumentParser
from os.path import isfile, dirname
import sys
from mako.template i... | apache-2.0 |
SnappleCap/oh-mainline | vendor/packages/scrapy/scrapyd/runner.py | 16 | 1074 | from __future__ import with_statement
import sys
import os
import shutil
import tempfile
from contextlib import contextmanager
from scrapyd import get_application
from scrapyd.interfaces import IEggStorage
from scrapyd.eggutils import activate_egg
@contextmanager
def project_environment(project):
app = get_appli... | agpl-3.0 |
MissCatLady/AlarmEZ | venv/lib/python2.7/site-packages/flask/views.py | 782 | 5642 | # -*- coding: utf-8 -*-
"""
flask.views
~~~~~~~~~~~
This module provides class-based views inspired by the ones in Django.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from .globals import request
from ._compat import with_metaclass
http_method_funcs =... | mit |
a-parhom/edx-platform | openedx/core/djangoapps/verified_track_content/partition_scheme.py | 2 | 5432 | """
UserPartitionScheme for enrollment tracks.
"""
import logging
from course_modes.models import CourseMode
from courseware.masquerade import (
get_course_masquerade,
get_masquerading_user_group,
is_masquerading_as_specific_student
)
from django.conf import settings
from opaque_keys.edx.keys import Course... | agpl-3.0 |
firmlyjin/brython | www/tests/unittests/test/test_capi.py | 25 | 14226 | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from __future__ import with_statement
import os
import pickle
import random
import subprocess
import sys
import time
import unittest
from test import support
try:
imp... | bsd-3-clause |
tashaxe/Red-DiscordBot | red.py | 17 | 22848 | import asyncio
import os
import sys
sys.path.insert(0, "lib")
import logging
import logging.handlers
import traceback
import datetime
import subprocess
try:
from discord.ext import commands
import discord
except ImportError:
print("Discord.py is not installed.\n"
"Consult the guide for your opera... | gpl-3.0 |
msabramo/suds | suds/servicedefinition.py | 200 | 8478 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 hope that it will ... | lgpl-3.0 |
al1221/ghost-openshift | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/emacs.py | 364 | 2486 | # -*- coding: utf-8 -*-
"""
pygments.styles.emacs
~~~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by Emacs.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import ... | mit |
cadavrege0733/YammerPlus | PPTconnect.py | 1 | 2303 | from TwitterAPI import TwitterAPI
import win32com.client
from MSO import *
# Open PowerPoint
Application = win32com.client.Dispatch("PowerPoint.Application")
# Add a presentation
Presentation = Application.Presentations.Add()
# Go to http://dev.twitter.com and create an app.
# The consumer key and secret will be ge... | apache-2.0 |
diyclassics/cltk | src/cltk/dependency/tree.py | 4 | 10141 | """A data structure for representing dependency tree graphs."""
__author__ = ["John Stewart <free-variation>"]
from typing import Dict, List, Union
from xml.etree.ElementTree import Element, ElementTree
from cltk.core.data_types import Doc, Process, Word
from cltk.core.exceptions import CLTKException
from cltk.morph... | mit |
StephenPower/CollectorCity-Market-Place | stores/apps/preferences/migrations/0002_auto__del_field_preference_store_password__del_field_preference_passwo.py | 2 | 12415 | # encoding: 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):
# Deleting field 'Preference.store_password'
db.delete_column('preferences_preference', 'store_password')
... | apache-2.0 |
rafaelvalle/music_pattern_graphs | pattern_graph.py | 1 | 5470 | from __future__ import division
def set_trace():
from IPython.core.debugger import Pdb
import sys
Pdb(color_scheme='Linux').set_trace(sys._getframe().f_back)
class Node(object):
def __init__(self, label, count=.0, n_trans=.0):
self.label = label
self.count = count
self.n_tran... | cc0-1.0 |
googlefonts/pyfontaine | fontaine/charsets/noto_chars/notosansdevanagari_bold.py | 2 | 16548 | # -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansDevanagari-Bold'
native_name = ''
def glyphs(self):
chars = []
chars.append(0x0000) #uni0000 ????
chars.append(0xA8E4) #uniA8E4 COMBINING DEVANAGARI DIGIT FOUR
chars.append(0xA8E7) #uniA8E7 COMBINING ... | gpl-3.0 |
ServicePortalTeam/service_portal | sites/all/libraries/elfinder/connectors/python/elFinder.py | 15 | 38063 | #!/usr/bin/env python
#
# Connector for elFinder File Manager
# author Troex Nevelin <troex@fury.scancode.ru>
import cgi
import hashlib
import json
import mimetypes
import os
import os.path
import re
import shutil
import sys
import time
from datetime import datetime
class connector():
"""Connector for elFinder"""
... | gpl-2.0 |
KaranToor/MA450 | google-cloud-sdk/lib/googlecloudsdk/calliope/exceptions.py | 3 | 14638 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
n-west/gnuradio-volk | docs/doxygen/doxyxml/generated/indexsuper.py | 348 | 19286 | #!/usr/bin/env python
#
# Generated Thu Jun 11 18:43:54 2009 by generateDS.py.
#
import sys
import getopt
from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these metho... | gpl-3.0 |
letouriste001/SmartForest_2.0 | python3.4Smartforest/lib/python3.4/site-packages/setuptools/command/install_lib.py | 431 | 3840 | import os
import imp
from itertools import product, starmap
import distutils.command.install_lib as orig
class install_lib(orig.install_lib):
"""Don't add compiled flags to filenames of non-Python files"""
def run(self):
self.build()
outfiles = self.install()
if outfiles is not None:
... | mit |
thresholdsoftware/asylum | openerp/addons/l10n_gr/__init__.py | 438 | 1102 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | agpl-3.0 |
falbassini/Samples | python/v2.1/download_placement_tags.py | 3 | 2591 | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
miquelo/storm | packages/storm/module/resource.py | 1 | 4556 | #
# This file is part of STORM.
#
# STORM 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.
#
# STORM is distributed in the hope that it ... | gpl-3.0 |
ujjwalwahi/odoo | addons/l10n_de/__init__.py | 693 | 1057 | # -*- encoding: 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 t... | agpl-3.0 |
tumbl3w33d/ansible | lib/ansible/modules/cloud/vmware/vmware_vm_shell.py | 23 | 13417 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015-16, Ritesh Khadgaray <khadgaray () gmail.com>
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__... | gpl-3.0 |
codepython/restcommander | play-1.2.4/python/Lib/webbrowser.py | 62 | 20990 | #! /usr/bin/env python
"""Interfaces for launching and remotely controlling Web browsers."""
# Maintained by Georg Brandl.
import os
import shlex
import sys
import stat
import subprocess
import time
__all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]
class Error(Exception):
pass
_browsers... | apache-2.0 |
mahendra-r/edx-platform | lms/djangoapps/verify_student/tests/test_ssencrypt.py | 101 | 3623 | import base64
from nose.tools import assert_equals
from verify_student.ssencrypt import (
aes_decrypt, aes_encrypt, encrypt_and_encode, decode_and_decrypt,
rsa_decrypt, rsa_encrypt
)
def test_aes():
key_str = "32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"
key = key_str.decode("hex... | agpl-3.0 |
gangadhar-kadam/nassimapp | selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py | 30 | 2676 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import msgprint, _
def execute(filters=None):
if not filters: filters = {}
columns = get_columns(filters)
data = ... | agpl-3.0 |
diydrones/ardupilot | Tools/Replay/check_replay.py | 17 | 2914 | #!/usr/bin/env python
'''
check that replay produced identical results
'''
from __future__ import print_function
def check_log(logfile, progress=print, ekf2_only=False, ekf3_only=False, verbose=False):
'''check replay log for matching output'''
from pymavlink import mavutil
progress("Processing log %s" %... | gpl-3.0 |
dronefly/dronefly.github.io | flask/lib/python2.7/site-packages/whoosh/util/varints.py | 95 | 3198 | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | apache-2.0 |
dknlght/dkodi | src/script.module.urlresolver/lib/urlresolver/plugins/mailru.py | 1 | 2735 | """
OVERALL CREDIT TO:
t0mm0, Eldorado, VOINAGE, BSTRDMKR, tknorris, smokdpi, TheHighway
Plugin for URLResolver
Copyright (C) 2011 t0mm0
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 So... | gpl-2.0 |
reid-vollett/Software_Quality_Project | BasePyUnit/main.py | 1 | 3014 | import Conversions
def DecToBinCheck(x): # Built in converting, used to check if the number was correct
return bin(x)
def BinToDecCheck(x): # Built in converting, used to check if the number was correct
return int(x, 2)
if __name__ == '__main__':
DTB = Conversions.ConvertDecToBin
BTD = Conversion... | gpl-3.0 |
nachandr/cfme_tests | cfme/tests/configure/test_tag.py | 2 | 19627 | import tempfile
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.cloud.provider import CloudProvider
from cfme.infrastructure.provider import InfraProvider
from cfme.markers.env_markers.provider import ONE
from cfme.markers.env_markers.provider import ONE_PER_CATEGORY
from cfme.rest.gen_d... | gpl-2.0 |
hongyegb123/wrtnode | tools/b43-tools/files/b43-fwsquash.py | 494 | 4767 | #!/usr/bin/env python
#
# b43 firmware file squasher
# Removes unnecessary firmware files
#
# Copyright (c) 2009 Michael Buesch <mb@bu3sch.de>
#
# Licensed under the GNU/GPL version 2 or (at your option) any later version.
#
import sys
import os
def usage():
print("Usage: %s PHYTYPES COREREVS /path/to/extracted/firm... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.