repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
dlozeve/reveal_CommunityDetection | node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py | 2710 | 5094 | # 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.
"""Visual Studio user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xml
#------... | mit |
ifesdjeen/cassandra | pylib/cqlshlib/wcwidth.py | 20 | 15875 | # 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 |
Abi1ity/uniclust2.0 | flask/lib/python2.7/site-packages/sqlalchemy/dialects/access/base.py | 35 | 16054 | # access/base.py
# Copyright (C) 2007-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
# Copyright (C) 2007 Paul Johnston, paj@pajhome.org.uk
# Portions derived from jet2sql.py by Matt Keranen, mksql@yahoo.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opens... | bsd-3-clause |
leshchevds/ganeti | test/py/ganeti.utils.lvm_unittest.py | 10 | 4711 | #!/usr/bin/python
#
# Copyright (C) 2013 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of... | bsd-2-clause |
yeraydiazdiaz/nonrel-blog | django/contrib/localflavor/ru/ru_regions.py | 199 | 4156 | # -*- encoding: utf-8 -*-
"""
Sources:
http://ru.wikipedia.org/wiki/Коды_субъектов_Российской_Федерации
http://ru.wikipedia.org/wiki/Федеральные_округа_Российской_Федерации
"""
from django.utils.translation import ugettext_lazy as _
RU_COUNTY_CHOICES = (
("Central Federal County", _("Central Federal County... | bsd-3-clause |
kivy/kivy | kivy/uix/gesturesurface.py | 3 | 23287 | '''
Gesture Surface
===============
.. versionadded::
1.9.0
.. warning::
This is experimental and subject to change as long as this warning notice
is present.
See :file:`kivy/examples/demo/multistroke/main.py` for a complete application
example.
'''
__all__ = ('GestureSurface', 'GestureContainer')
from... | mit |
CSC-ORG/Dynamic-Dashboard-2015 | engine/lib/python2.7/site-packages/pip/backwardcompat/__init__.py | 394 | 3756 | """Stuff that differs in different Python versions and platform
distributions."""
import os
import imp
import sys
import site
__all__ = ['WindowsError']
uses_pycache = hasattr(imp, 'cache_from_source')
class NeverUsedException(Exception):
"""this exception should never be raised"""
try:
WindowsError = Wind... | mit |
novirael/lotr-pygame | variables.py | 1 | 6374 | #-------------------------------------------------------------------------------
# Name: variables.py
# Purpose:
#
# Author: novirael
#
# Created: 18-08-2012
# Copyright: (c) novirael 2012
# Licence: <your licence>
#-------------------------------------------------------------------------... | gpl-2.0 |
jimmyraywv/cloud-custodian | c7n/resources/asg.py | 1 | 55595 | # Copyright 2015-2017 Capital One Services, 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 ... | apache-2.0 |
uwdata/termite-treetm | web2py/gluon/contrib/minify/minify.py | 43 | 4663 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
High-level CSS and JS minification class for web2py.
Called by response.include_files()
Created by: Ross Peoples <ross.peoples@gmail.com>
Modified by: Massimo Di Pierro <massimo.dipierro@gmail.com>
"""
import cssmin
import jsmin
import os
import hashlib
import re
de... | bsd-3-clause |
underyx/ansible-modules-core | cloud/digital_ocean/digital_ocean_sshkey.py | 37 | 4948 | #!/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 |
2014c2g4/2015cda_g7 | static/Brython3.1.1-20150328-091302/Lib/abc.py | 765 | 8057 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
from _weakrefset import WeakSet
def abstractmethod(funcobj):
"""A decorator indicating abstract methods.
Requires that the metaclass is ABCMeta or der... | gpl-3.0 |
jctanner/ansible | test/units/plugins/connection/test_psrp.py | 56 | 8330 | # -*- coding: utf-8 -*-
# (c) 2018, Jordan Borean <jborean@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
import sys
from io i... | gpl-3.0 |
ticosax/django | django/contrib/gis/geos/prototypes/misc.py | 103 | 1381 | """
This module is for the miscellaneous GEOS routines, particularly the
ones that return the area, distance, and length.
"""
from ctypes import POINTER, c_double, c_int
from django.contrib.gis.geos.libgeos import GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import check_dbl, check_string
from django.co... | bsd-3-clause |
leapp-to/prototype | leapp/snactor/commands/workflow/run.py | 1 | 2817 | from __future__ import print_function
import datetime
import os
import sys
from leapp.exceptions import CommandError, LeappError
from leapp.logger import configure_logger
from leapp.repository.scan import find_and_scan_repositories
from leapp.snactor.commands.workflow import workflow
from leapp.snactor.context import... | lgpl-2.1 |
koobonil/Boss2D | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/estimator/inputs/queues/feeding_functions.py | 46 | 15782 | # 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... | mit |
JulienMcJay/eclock | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/pywin/Demos/toolbar.py | 17 | 2742 | # Demo of ToolBars
# Shows the toolbar control.
# Demos how to make custom tooltips, etc.
import win32ui
import win32con
import win32api
from pywin.mfc import docview, window, afxres
import commctrl
class GenericFrame(window.MDIChildWnd):
def OnCreateClient(self, cp, context):
# handlers for toolbar buttons
sel... | gpl-2.0 |
jwlawson/tensorflow | tensorflow/python/ops/quantized_conv_ops_test.py | 9 | 7495 | # 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 |
taotie12010/bigfour | openedx/core/djangoapps/content/course_structures/api/v0/serializers.py | 65 | 1313 | """
API Serializers
"""
from rest_framework import serializers
class GradingPolicySerializer(serializers.Serializer):
""" Serializer for course grading policy. """
assignment_type = serializers.CharField(source='type')
count = serializers.IntegerField(source='min_count')
dropped = serializers.IntegerF... | agpl-3.0 |
vegitron/ansible | test/integration/gce_credentials.py | 275 | 1809 | import collections
import os
import yaml
try:
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
_ = Provider.GCE
except ImportError:
print("failed=True " + \
"msg='libcloud with GCE support (0.13.3+) required for this module'")
sys.exit(1)
def a... | gpl-3.0 |
yufengg/tensorflow | tensorflow/contrib/quantization/python/array_ops.py | 178 | 1156 | # 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 |
kustodian/ansible | test/units/mock/loader.py | 127 | 3861 | # (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 |
apbard/scipy | scipy/signal/spectral.py | 1 | 66503 | """Tools for spectral analysis.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy import fftpack
from . import signaltools
from .windows import get_window
from ._spectral import _lombscargle
from ._arraytools import const_ext, even_ext, odd_ext, zero_ext
import warning... | bsd-3-clause |
rolandgeider/pk15-orakel | oracle/views/misc.py | 1 | 5938 | # -*- coding: utf-8 -*-
# This file is part of pk15 Orakel
#
# pk15 Orakel 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 License, or
# (at your option) any later version.
#
# ... | agpl-3.0 |
heli522/scikit-learn | sklearn/covariance/outlier_detection.py | 208 | 6917 | """
Class for outlier detection.
This class provides a framework for outlier detection. It consists in
several methods that can be added to a covariance estimator in order to
assess the outlying-ness of the observations of a data set.
Such a "outlier detector" object is proposed constructed from a robust
covariance es... | bsd-3-clause |
WillisXChen/django-oscar | docs/source/conf.py | 37 | 9704 | # -*- coding: utf-8 -*-
#
# django-oscar documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 7 13:16:33 2011.
#
# 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.
#
... | bsd-3-clause |
doduytrung/odoo-8.0 | addons/event/report/report_event_registration.py | 310 | 4079 | # -*- 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 |
fllodrab/Practica1 | venv/lib/python2.7/site-packages/gunicorn/http/_sendfile.py | 53 | 2272 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import errno
import os
import sys
try:
import ctypes
import ctypes.util
except MemoryError:
# selinux execmem denial
# https://bugzilla.redhat.com/show_bug.cgi?id=488396
r... | gpl-3.0 |
fxfitz/ansible | test/units/modules/network/edgeos/edgeos_module.py | 55 | 2477 | # (c) 2018 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
bigswitch/nova | nova/api/openstack/compute/schemas/keypairs.py | 24 | 2524 | # Copyright 2013 NEC Corporation. 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 ... | apache-2.0 |
dkodnik/Ant | openerp/addons/base/ir/ir_mail_server.py | 15 | 26515 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 OpenERP S.A (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
MechCoder/sympy | sympy/crypto/crypto.py | 47 | 47918 | # -*- coding: utf-8 -*-
"""
Classical ciphers and LFSRs
"""
from __future__ import print_function
from random import randrange
from sympy import nextprime
from sympy.core import Rational, S, Symbol
from sympy.core.numbers import igcdex
from sympy.core.compatibility import range
from sympy.matrices import Matrix
fro... | bsd-3-clause |
FRCDiscord/Dozer | dozer/sources/RSSSources.py | 1 | 8500 | """Given an arbitrary RSS feed, get new posts from it"""
import re
import datetime
import xml.etree.ElementTree
import aiohttp
import discord
from .AbstractSources import Source
def clean_html(raw_html):
"""Clean all HTML tags.
From https://stackoverflow.com/questions/9662346/python-code-to-remove-html-tags-... | gpl-3.0 |
tempbottle/pycapnp | test/test_schema.py | 3 | 1639 | import pytest
import capnp
import os
this_dir = os.path.dirname(__file__)
@pytest.fixture
def addressbook():
return capnp.load(os.path.join(this_dir, 'addressbook.capnp'))
@pytest.fixture
def annotations():
return capnp.load(os.path.join(this_dir, 'annotations.capnp'))
def test_basic_schema(addressbook):... | bsd-2-clause |
vakhet/rathena-utils | dev/foo.py | 1 | 6608 | from re import search, findall, split, match
def valid(line):
if any(i in line for i in INVALID) or line == '':
return False
return True
def rathena_db_parse(table, schema, file, db):
# Parse any *db.txt from rAthena
# table - table's name
# schema - [('id', 'INTEGER PRI... | mit |
ErBa508/data-science-from-scratch | code/statistics.py | 60 | 5779 | from __future__ import division
from collections import Counter
from linear_algebra import sum_of_squares, dot
import math
num_friends = [100,49,41,40,25,21,21,19,19,18,18,16,15,15,15,15,14,14,13,13,13,13,12,12,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,8,8,8,8,8,8,8,8,8,8,8,... | unlicense |
pombreda/syzygy | third_party/numpy/files/numpy/distutils/mingw32ccompiler.py | 76 | 19091 | """
Support code for building Python extensions on Windows.
# NT stuff
# 1. Make sure libpython<version>.a exists for gcc. If not, build it.
# 2. Force windows to use gcc (we're struggling with MSVC and g77 support)
# 3. Force windows to use g77
"""
import os
import subprocess
import sys
import subp... | apache-2.0 |
goblincoding/ninja-ide | ninja_ide/gui/dialogs/add_to_project.py | 7 | 4094 | # -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE 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
# any later version.
#
# NIN... | gpl-3.0 |
luxus/home-assistant | homeassistant/components/light/hyperion.py | 4 | 3572 | """
Support for Hyperion remotes.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.hyperion/
"""
import json
import logging
import socket
from homeassistant.components.light import ATTR_RGB_COLOR, Light
from homeassistant.const import CONF_HOST
_LO... | mit |
phillxnet/rockstor-core | src/rockstor/storageadmin/tests/test_snapshot.py | 2 | 12564 | """
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 lat... | gpl-3.0 |
srimai/odoo | openerp/addons/base/res/res_bank.py | 242 | 10554 | # -*- 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 |
denovator/mochafac | lib/setuptools/tests/test_dist_info.py | 452 | 2615 | """Test .dist-info style distributions.
"""
import os
import shutil
import tempfile
import unittest
import textwrap
try:
import ast
except:
pass
import pkg_resources
from setuptools.tests.py26compat import skipIf
def DALS(s):
"dedent and left-strip"
return textwrap.dedent(s).lstrip()
class TestDist... | apache-2.0 |
sfairhur/pycbc | pycbc/distributions/qnm.py | 8 | 10576 | # Copyright (C) 2018 Miriam Cabero, Collin Capano
# 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 di... | gpl-3.0 |
Kongsea/tensorflow | tensorflow/python/kernel_tests/aggregate_ops_test.py | 53 | 5017 | # 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 |
racker/protobuf | python/google/protobuf/reflection.py | 260 | 5864 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
cinashp/whatsappbot | yowsup/layers/coder/tokendictionary.py | 14 | 11699 | class TokenDictionary:
def __init__(self):
self.dictionary = [
'',
'',
'',
'account',
'ack',
'action',
'active',
'add',
'after',
'all',
'allow',
'apple',
'audio',
'aut... | gpl-3.0 |
chromaway/ngcccbase | ngcccbase/p2ptrade/tests/test_ewctrl.py | 4 | 4017 |
import unittest
from coloredcoinlib import (
ZeroSelectError, SimpleColorValue, UNCOLORED_MARKER, ColorDefinition
)
from ngcccbase.pwallet import PersistentWallet
from ngcccbase.txcons import InsufficientFundsError, RawTxSpec
from ngcccbase.wallet_controller import WalletController
from ngcccbase.p2ptrade.ewctrl i... | mit |
arpho/mmasgis5 | Albero/progressBar.py | 2 | 1482 | from Ui_progressBar import *
from PyQt4 import QtCore,QtGui
from PyQt4.QtGui import QMainWindow
from PyQt4.QtCore import pyqtSignature
class ProgressBarWindow(QMainWindow, Ui_ProgressBar):
""" wrapper di Ui_Progressbar
"""
def __init__(self,visible1, visible2,parent=None):
"""
@param bool: True per visualizz... | mit |
Trust-Code/addons-yelizariev | res_users_signature/res_users_signature_models.py | 16 | 7872 | from openerp.osv import fields as old_fields
from openerp import api,models,fields,tools
try:
from openerp.addons.email_template.email_template import mako_template_env
except ImportError:
try:
from openerp.addons.mail.mail_template import mako_template_env
except ImportError:
pass
from ope... | lgpl-3.0 |
ryfeus/lambda-packs | Tensorflow/source/tensorflow/contrib/boosted_trees/lib/learner/batch/base_split_handler.py | 53 | 6483 | # 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... | mit |
ssdongdongwang/arisgames | zxing-master/cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/hplink.py | 34 | 2388 | """SCons.Tool.hplink
Tool-specific initialization for the HP linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foun... | mit |
ClaudioNahmad/Servicio-Social | Parametros/CosmoMC/prerrequisitos/plc-2.0/build/pyfits-3.2.2/lib/pyfits/scripts/fitsdiff.py | 3 | 9985 | import glob
import logging
import optparse
import os
import sys
import textwrap
import pyfits.diff
from pyfits.util import fill
log = logging.getLogger('fitsdiff')
USAGE = """
Compare two FITS image files and report the differences in header keywords and
data.
fitsdiff [options] filename1 filename2
where fil... | gpl-3.0 |
jrha/aquilon | lib/python2.6/aquilon/worker/commands/search_host.py | 2 | 13235 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | apache-2.0 |
saisaizhang/Food | flask/lib/python2.7/site-packages/sqlalchemy/ext/automap.py | 33 | 39713 | # ext/automap.py
# Copyright (C) 2005-2014 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
"""Define an extension to the :mod:`sqlalchemy.ext.declarative` system
which automati... | bsd-3-clause |
Haleyo/spark-tk | regression-tests/sparktkregtests/testcases/frames/frame_inspect_test.py | 13 | 4394 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
Griffintaur/QRCodeReader | simple_gui.py | 1 | 1696 | import os, threading, webbrowser
from flask import Flask, request, render_template, Response
from Imagehandler import Imagehandler
app = Flask(__name__, static_folder='Input')
APP_ROOT = os.path.dirname(os.path.abspath(__file__))
dest = []
def gen(destination):
import cv2
obj = Imagehandler(str(destination)... | mit |
darkspring2015/PyDatcomLab | PyDatcomLab/GUIs/components/BrowseModels.py | 1 | 12197 | # -*- coding: utf-8 -*-
"""
Module implementing DlgBrowseModels.
"""
from PyQt5.QtCore import pyqtSlot, pyqtSignal, QSize, QPoint, Qt
from PyQt5.QtWidgets import QDialog, QFileDialog, QMenu, QTableWidgetItem
from PyQt5.QtGui import QIcon, QPixmap
import logging
import os
from xml.etree import ElementTree as ET
from... | mit |
RecipeML/Recipe | recipe/preprocessors/fag.py | 1 | 1645 | # -*- coding: utf-8 -*-
"""
Copyright 2016 Walter José and Alex de Sá
This file is part of the RECIPE Algorithm.
The RECIPE 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 (a... | gpl-3.0 |
sudheesh001/oh-mainline | vendor/packages/requests/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## 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... | agpl-3.0 |
hyunchel/webargs | webargs/core.py | 1 | 15449 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import collections
import functools
import inspect
import logging
import warnings
import marshmallow as ma
from marshmallow.compat import iteritems
from marshmallow.utils import missing
logger = logging.getLogger(__name__)
__all__ = [
'WebargsErro... | mit |
google/pigweed | pw_arduino_build/py/pw_arduino_build/unit_test_runner.py | 1 | 13528 | #!/usr/bin/env python3
# Copyright 2020 The Pigweed 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 applicab... | apache-2.0 |
TheTimmy/spack | var/spack/repos/builtin/packages/r-rgl/package.py | 2 | 2441 | ##############################################################################
# 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... | lgpl-2.1 |
endlessm/chromium-browser | third_party/catapult/dashboard/dashboard/find_change_points.py | 1 | 9944 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A simplified change-point detection algorithm.
Historically, the performance dashboard has used the GASP service for
detection. Brett Schein wrote a simpl... | bsd-3-clause |
Flowerfan524/TriClustering | cotrain.py | 1 | 2741 | from __future__ import print_function, absolute_import
from reid.models import model_utils as mu
from reid.utils.data import data_process as dp
from reid.utils.serialization import save_checkpoint
from reid import datasets
from reid import models
from reid.config import Config
import torch
import numpy as np
import os
... | mit |
treycausey/scikit-learn | sklearn/cluster/tests/test_mean_shift.py | 9 | 2843 | """
Testing for mean shift clustering methods
"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_array_equal
from sklearn.cluster import MeanShift
from sklearn.clu... | bsd-3-clause |
jounex/hue | desktop/core/ext-py/MySQL-python-1.2.5/tests/test_MySQLdb_nonstandard.py | 41 | 2737 | import unittest
import _mysql
import MySQLdb
from MySQLdb.constants import FIELD_TYPE
from configdb import connection_factory
import warnings
warnings.simplefilter("ignore")
class TestDBAPISet(unittest.TestCase):
def test_set_equality(self):
self.assertTrue(MySQLdb.STRING == MySQLdb.STRING)
def test_... | apache-2.0 |
sidrakesh93/grpc | src/python/interop/interop/test_pb2.py | 22 | 8377 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: test/cpp/interop/test.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflec... | bsd-3-clause |
alikins/ansible | lib/ansible/modules/storage/netapp/netapp_e_lun_mapping.py | 32 | 10739 | #!/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 |
RackHD-Mirror/RackHD | test/tests/api-cit/v2_0/swagger_tests.py | 10 | 1438 | '''
Copyright (c) 2016-2017 Dell Inc. or its subsidiaries. All Rights Reserved.
'''
import fit_path # NOQA: unused import
import fit_common
import flogging
import requests
from config.api2_0_config import config
from nose.plugins.attrib import attr
logs = flogging.get_loggers()
@attr(regression=False, smoke=True, ... | apache-2.0 |
amjad-twalo/icsisumm | icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/classifier/attribute.py | 9 | 3778 | # Natural Language Toolkit - Attribute
# can extract the name and values from a line and operate on them
#
# Author: Sumukh Ghodke <sumukh dot ghodke at gmail dot com>
#
# URL: <http://nltk.sf.net>
# This software is distributed under GPL, for license information see LICENSE.TXT
from nltk_contrib.classifier.exceptions... | gpl-3.0 |
thesharp/botogram | tests/test_utils_calls.py | 1 | 2089 | """
Tests for botogram/utils/calls.py
Copyright (c) 2015 Pietro Albini <pietro@pietroalbini.io>
Released under the MIT license
"""
import pytest
import botogram.utils
def test_call():
testfunc_called = 0
# Just a test function
def testfunc(a, b, c):
nonlocal testfunc_called
... | mit |
zulip/django | django/template/base.py | 91 | 39166 | """
This is the Django template system.
How it works:
The Lexer.tokenize() function converts a template string (i.e., a string containing
markup with custom template tags) to tokens, which can be either plain text
(TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK).
The Parser() class takes a list ... | bsd-3-clause |
Jusedawg/SickRage | lib/github/GitTree.py | 74 | 3323 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
nouiz/pygithooks | hooks/util.py | 2 | 2663 | #!/usr/bin/env python
"""
Shared pygithooks utils.
"""
import shlex
import subprocess
def run_command(command, shell=False):
command_subprocess = subprocess.Popen(shlex.split(command),
stdout=subprocess.PIPE,
stderr=subprocess.PI... | bsd-3-clause |
lache/RacingKingLee | monitor/engine.win64/2.74/python/lib/sre_constants.py | 106 | 7267 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... | mit |
xiandiancloud/edx-platform-Y | common/djangoapps/django_comment_common/migrations/0001_initial.py | 188 | 6980 | # -*- coding: utf-8 -*-
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
#
# cdodge: This is basically an empty migration since everything has - up to now - managed in the django_comment_client app
# But going forward we should be using this migration
#
def forwards(self, orm):
pass
... | agpl-3.0 |
fpy171/django | tests/template_tests/filter_tests/test_iriencode.py | 388 | 1603 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import iriencode, urlencode
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class IriencodeTests(SimpleTestCase):
"""
Ensure iriencode keeps safe... | bsd-3-clause |
mhild/Sick-Beard | sickbeard/metadata/tivo.py | 8 | 13235 | # Author: Nic Wolfe <nic@wolfeden.ca>
# Author: Gordon Turner <gordonturner@gordonturner.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | gpl-3.0 |
lancezlin/pyjs | examples/jsimport/__main__.py | 8 | 1050 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
TARGETS = [
'examplejs.py',
]
PACKAGE = {
'title': 'jsimport',
'desc': 'JS import example',
}
def setup(targets):
'''Setup example for translation, MUST call util.setup(targets).'''
util.setup(targets)
def translate():
'''Translate example, M... | apache-2.0 |
pwarren/AGDeviceControl | agdevicecontrol/thirdparty/site-packages/win32/twisted/manhole/explorer.py | 81 | 21497 | # -*- test-case-name: twisted.test.test_explorer -*-
# $Id: explorer.py,v 1.6 2003/02/18 21:15:30 acapnotic Exp $
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Support for python object introspection and exploration.
Note that Explorers, what with their list of attributes, are ... | gpl-2.0 |
Wilee999/panda3d | direct/src/actor/DistributedActor.py | 11 | 1310 | """DistributedActor module: contains the DistributedActor class"""
__all__ = ['DistributedActor']
from direct.distributed import DistributedNode
import Actor
class DistributedActor(DistributedNode.DistributedNode, Actor.Actor):
def __init__(self, cr):
try:
self.DistributedActor_initialized
... | bsd-3-clause |
pixelrebel/st2 | st2common/st2common/logging/filters.py | 13 | 1591 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
theflofly/tensorflow | tensorflow/python/keras/layers/pooling_test.py | 10 | 7660 | # 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 |
endlessm/chromium-browser | tools/swarming_client/tests/lru_test.py | 4 | 6409 | #!/usr/bin/env vpython3
# Copyright 2013 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import json
import os
import tempfile
import unittest
# Mutates sys.path.
import test_env
from utils import lru
def _l... | bsd-3-clause |
frappe/frappe | frappe/tests/test_permissions.py | 1 | 19796 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
"""Use blog post test to test user permissions logic"""
import frappe
import frappe.defaults
import unittest
import frappe.model.meta
from frappe.permissions import (add_user_permission, remove_user_permission,
clear_u... | mit |
anhaidgroup/py_stringsimjoin | py_stringsimjoin/utils/generic_helper.py | 1 | 4541 |
import multiprocessing
import operator
import os
from six.moves import xrange
import pandas as pd
COMP_OP_MAP = {'>=': operator.ge,
'>': operator.gt,
'<=': operator.le,
'<': operator.lt,
'=': operator.eq,
'!=': operator.ne}
def get_output_... | bsd-3-clause |
gabrielfalcao/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/cache/tests.py | 38 | 28208 | # -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
import os
import tempfile
import time
import unittest
import warnings
from django.conf import settings
from django.core import management
from django.core.cache import get_cache
from django.core.c... | gpl-3.0 |
vatsan/pymadlib | pymadlib/utils.py | 2 | 21752 | '''
4 Jan 2013, vatsan.cs@utexas.edu>
Utility functions for PyMADlib. Currently this supports dummy coding of categorical columns (Pivoting).
'''
import pickle
default_schema = 'public'
default_prefix = 'gp_pymdlib_'
default_prefix_arr = 'gp_pymdlib_arr_'
MAX_DISTINCT_VALS = 128
#Easy way of encoding strings... | bsd-2-clause |
sanghinitin/golismero | thirdparty_libs/chardet/langgreekmodel.py | 235 | 12664 | ######################## 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 |
s3nk4s/flaskTutorials | FlaskApp/FlaskApp/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py | 949 | 19104 | ######################## 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... | mit |
caldwell/servo | tests/jquery/run_jquery.py | 215 | 9582 | #!/usr/bin/env python
# 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 os
import re
import subprocess
import sys
import BaseHTTPServer
import SimpleHTTPServer
im... | mpl-2.0 |
repotvsupertuga/repo | plugin.video.SportsDevil/service/oscrypto/errors.py | 7 | 1657 | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import sys
import socket
__all__ = [
'AsymmetricKeyError',
'CACertsError',
'LibraryNotFoundError',
'SignatureError',
'TLSError',
'TLSVerificationError',
]
class LibraryNotFoundError(Exception)... | gpl-2.0 |
djcatter/diaphora | pygments/style.py | 13 | 3779 | # -*- coding: utf-8 -*-
"""
pygments.style
~~~~~~~~~~~~~~
Basic style object.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.token import Token, STANDARD_TYPES
from pygments.util import add_metaclass
class StyleMeta(t... | gpl-2.0 |
deKupini/erp | addons/website_event_sale/models/sale_order.py | 1 | 4845 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.osv import osv
from openerp.tools.translate import _
from openerp.exceptions import UserError
class sale_order(osv.Model):
_inherit = "sale.order"
def _cart_find_product_line(self, cr, uid, ids, product_id=None, line_id=None, context=None,... | agpl-3.0 |
yarikoptic/pystatsmodels | statsmodels/tsa/tests/test_stattools.py | 3 | 7864 | from statsmodels.tsa.stattools import (adfuller, acf, pacf_ols, pacf_yw,
pacf, grangercausalitytests,
coint, acovf)
from statsmodels.tsa.base.datetools import dates_from_range
import numpy as np
from numpy.testing import asser... | bsd-3-clause |
danielhers/dynet | examples/variational-autoencoder/basic-image-recon/vae.py | 5 | 6690 | from __future__ import print_function
from utils import load_mnist, make_grid, pre_pillow_float_img_process, save_image
import numpy as np
import argparse
import dynet as dy
import os
if not os.path.exists('results'):
os.makedirs('results')
parser = argparse.ArgumentParser(description='VAE MNIST Example')
parser... | apache-2.0 |
stinebuu/nest-simulator | extras/help_generator/generate_help.py | 16 | 5251 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# generate_help.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ver... | gpl-2.0 |
abazad/SizotrixKernel | scripts/gcc-wrapper.py | 1276 | 3382 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
wiki-ai/revscoring | revscoring/features/wikitext/features/tokenized.py | 1 | 22071 | from revscoring.datasources.meta import dicts, filters, mappers
from ...meta import aggregators
from . import base
class Revision(base.BaseRevision):
def __init__(self, name, revision_datasources, tokens_datasource=None):
super().__init__(name, revision_datasources)
if tokens_datasource is None:
... | mit |
akatrevorjay/pyrox | pyrox/log.py | 3 | 1268 | import logging
_LOG_LEVEL_NOTSET = 'NOTSET'
def get_logger(logger_name):
return _LOGGING_MANAGER.get_logger(logger_name)
def get_log_manager():
return _LOGGING_MANAGER
class LoggingManager(object):
def __init__(self):
self._root_logger = logging.getLogger()
self._handlers = list()
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.