repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
PatrickOReilly/scikit-learn | sklearn/feature_selection/__init__.py | 140 | 1302 | """
The :mod:`sklearn.feature_selection` module implements feature selection
algorithms. It currently includes univariate filter selection methods and the
recursive feature elimination algorithm.
"""
from .univariate_selection import chi2
from .univariate_selection import f_classif
from .univariate_selection import f_... | bsd-3-clause |
mianos/micropython | examples/pins.py | 86 | 2045 | # Print a nice list of pins, their current settings, and available afs.
# Requires pins_af.py from stmhal/build-PYBV10/ directory.
import pyb
import pins_af
def af():
max_name_width = 0
max_af_width = 0
for pin_entry in pins_af.PINS_AF:
max_name_width = max(max_name_width, len(pin_entry[0]))
... | mit |
home-assistant/home-assistant | homeassistant/components/humidifier/device_condition.py | 5 | 3283 | """Provide the device automations for Humidifier."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.device_automation import toggle_entity
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_MODE,
ATTR_SUPPORTED_FEATURES,
CONF_CONDITION,
CONF_DEVICE_ID... | apache-2.0 |
hueyyeng/AssetsBrowser | ui/window/ui_main.py | 1 | 12124 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'K:\Library\Python\AssetsBrowser\ui\window\main.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def se... | mit |
turi-code/SFrame | oss_src/unity/python/sframe/test/util.py | 5 | 4772 | '''
Copyright (C) 2016 Turi
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
import random
import tempfile
import shutil
import math
import string
import numpy as np
from pandas.util.testing import assert_frame_equal
from .. i... | bsd-3-clause |
spiermar/message-service | lib/werkzeug/local.py | 310 | 14094 | # -*- coding: utf-8 -*-
"""
werkzeug.local
~~~~~~~~~~~~~~
This module implements context-local objects.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrapper
from werkzeug.wsgi import ClosingIt... | apache-2.0 |
nathanielvarona/airflow | airflow/contrib/operators/gcp_video_intelligence_operator.py | 1 | 1369 | #
# 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... | apache-2.0 |
vhaupert/mitmproxy | mitmproxy/stateobject.py | 1 | 3417 | import json
import typing
from mitmproxy.coretypes import serializable
from mitmproxy.utils import typecheck
class StateObject(serializable.Serializable):
"""
An object with serializable state.
State attributes can either be serializable types(str, tuple, bool, ...)
or StateObject instances themselv... | mit |
jhsenjaliya/incubator-airflow | airflow/hooks/hdfs_hook.py | 39 | 3726 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
domibarton/ansible | lib/ansible/plugins/action/patch.py | 33 | 2563 | # (c) 2015, Brian Coca <briancoca+dev@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 v... | gpl-3.0 |
bukzor/sympy | sympy/assumptions/handlers/order.py | 9 | 10818 | """
AskHandlers related to order relations: positive, negative, etc.
"""
from __future__ import print_function, division
from sympy.assumptions import Q, ask
from sympy.assumptions.handlers import CommonHandler
from sympy.core.logic import fuzzy_not, fuzzy_and, fuzzy_or
class AskNegativeHandler(CommonHandler):
"... | bsd-3-clause |
Distrotech/telepathy-account-widgets | tools/manager-file.py | 12 | 6312 | #!/usr/bin/python
# manager-file.py: generate .manager files and TpCMParamSpec arrays from the
# same data (should be suitable for all connection managers that don't have
# plugins)
#
# The master copy of this program is in the telepathy-glib repository -
# please make any changes there.
#
# Copyright (c) Collabora Lt... | lgpl-2.1 |
mikedlowis-prototypes/albase | source/kernel/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | bsd-2-clause |
samthor/intellij-community | plugins/hg4idea/testData/bin/hgext/convert/bzr.py | 94 | 11295 | # bzr.py - bzr support for the convert extension
#
# Copyright 2008, 2009 Marek Kubica <marek@xivilization.net> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
# This module is for handling 'bzr', that was formerly kno... | apache-2.0 |
Ashaba/rms | rmslocalenv/lib/python2.7/site-packages/reportlab/platypus/paragraph.py | 2 | 79342 | #Copyright ReportLab Europe Ltd. 2000-2016
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/paragraph.py
__version__='3.3.0'
__doc__='''The standard paragraph implementation'''
from string import whitespace
from operator import truth
... | mit |
Gigabear/p2pool | nattraverso/portmapper.py | 288 | 4157 | """
Generic NAT Port mapping interface.
TODO: Example
@author: Raphael Slinckx
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
from twisted.internet.base import BasePort
# Public API
def get_port_mapper(proto="TCP"):
... | gpl-3.0 |
szatam/librenms | poller-service.py | 15 | 14406 | #! /usr/bin/env python2
"""
poller-service A service to wrap SNMP polling. It will poll up to $threads devices at a time, and will not re-poll
devices that have been polled within the last $poll_frequency seconds. It will prioritize devices based
on the last time polled. If resources a... | gpl-3.0 |
Danisan/odoo-1 | addons/product_extended/product_extended.py | 185 | 5460 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero G... | agpl-3.0 |
rechner/Taxidi | webcam.py | 1 | 18402 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
#TODO: Update for use with new API
#TODO: Read config, optionally disable rectangle.
#TODO: Create Destroy() method
#TODO: Implement file system organization, handle converting & uploading image to server.
#TODO: Use gstreamer for Linux instead of opencv - better performanc... | gpl-3.0 |
ODM2/ODMToolsPython | odmtools/gui/pnlPlot.py | 1 | 7003 | #Boa:FramePanel:Panel1
import wx
from wx.lib.pubsub import pub as Publisher
try:
from agw import flatnotebook as fnb
except ImportError: # if it's not there locally, try the wxPython lib.
import wx.lib.agw.flatnotebook as fnb
import matplotlib
matplotlib.use('WXAgg')
import plotTimeSeries
import plotSummar... | bsd-3-clause |
dsjr2006/namebench | nb_third_party/jinja2/loaders.py | 280 | 16242 | # -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
try:
from hashlib import sha1
except Imp... | apache-2.0 |
alajara/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/mux_client_for_testing.py | 457 | 25761 | #!/usr/bin/env python
#
# Copyright 2012, 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... | mpl-2.0 |
ybellavance/python-for-android | python3-alpha/python3-src/Lib/encodings/cp875.py | 272 | 12854 | """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... | apache-2.0 |
ghchinoy/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 |
hyperkitty/kittystore | kittystore/__init__.py | 1 | 3228 | # -*- coding: utf-8 -*-
"""
Module entry point: call get_store() to instanciate a KittyStore
implementation.
Copyright (C) 2012 Aurelien Bompard
Author: Aurelien Bompard <abompard@fedoraproject.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Lice... | gpl-3.0 |
fgaudin/aemanager | accounts/models.py | 1 | 20254 | # coding=utf-8
from decimal import Decimal
from django.utils.formats import localize
import datetime
from reportlab.platypus import Paragraph, Spacer
from reportlab.lib.units import inch
from reportlab.platypus import Table, TableStyle
from django.db import models, connection
from core.models import OwnedObject
from dj... | agpl-3.0 |
updatengine/updatengine-server | configuration/migrations/0005_auto__add_subuser.py | 1 | 11187 | # -*- 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 'subuser'
db.create_table(u'configuration_subuser', (
(u'id', self.gf('django.db.... | gpl-2.0 |
sigmunau/nav | python/nav/web/macwatch/forms.py | 2 | 3031 | #
# Copyright (C) 2011 UNINETT AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope... | gpl-2.0 |
asimshankar/tensorflow | tensorflow/python/kernel_tests/cond_v2_test.py | 1 | 35442 | # Copyright 2018 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 |
Distrotech/scons | test/TEX/makeindex.py | 3 | 3263 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... | mit |
levilucio/SyVOLT | ECore_Copier_MM/transformation-Large/HeattributeOUTeGenericTypeSolveRefEAttributeEGenericTypeEAttributeEGenericType.py | 1 | 5089 |
from core.himesis import Himesis
class HeattributeOUTeGenericTypeSolveRefEAttributeEGenericTypeEAttributeEGenericType(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HeattributeOUTeGenericTypeSolveRefEAttributeEGenericTypeEAttributeEGenericType.
""... | mit |
loongson-community/EFI-MIPS | ToolKit/cmds/python/Lib/curses/ascii.py | 396 | 2607 | """Constants and membership tests for ASCII characters"""
NUL = 0x00 # ^@
SOH = 0x01 # ^A
STX = 0x02 # ^B
ETX = 0x03 # ^C
EOT = 0x04 # ^D
ENQ = 0x05 # ^E
ACK = 0x06 # ^F
BEL = 0x07 # ^G
BS = 0x08 # ^H
TAB = 0x09 # ^I
HT = 0x09 # ^I
LF = 0x0a # ^J
NL =... | bsd-3-clause |
Blackfynn/python-neo | neo/io/brainwaredamio.py | 6 | 9084 | # -*- coding: utf-8 -*-
'''
Class for reading from Brainware DAM files
DAM files are binary files for holding raw data. They are broken up into
sequence of Segments, each containing a single raw trace and parameters.
The DAM file does NOT contain a sampling rate, nor can it be reliably
calculated from any of the par... | bsd-3-clause |
HyperBaton/ansible | lib/ansible/modules/windows/win_user_right.py | 56 | 3205 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
sinisterchipmunk/tomato | ext/tomato/external/scons/engine/SCons/Tool/386asm.py | 34 | 2217 | """SCons.Tool.386asm
Tool specification for the 386ASM assembler for the Phar Lap ETS embedded
operating system.
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... | mit |
yannickcr/CouchPotatoServer | libs/tornado/httpserver.py | 14 | 11484 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | gpl-3.0 |
fedora-conary/conary | conary/lib/keystore.py | 3 | 1046 | #
# Copyright (c) SAS Institute 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 w... | apache-2.0 |
pexip/os-chardet | chardet/latin1prober.py | 290 | 5370 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | lgpl-2.1 |
Abi1ity/uniclust2.0 | SQLAlchemy-0.9.9/test/sql/test_generative.py | 1 | 58459 | from sqlalchemy.sql import table, column, ClauseElement, operators
from sqlalchemy.sql.expression import _clone, _from_objects
from sqlalchemy import func, select, Integer, Table, \
Column, MetaData, extract, String, bindparam, tuple_, and_, union, text,\
case, ForeignKey, literal_column
from sqlalchemy.testing... | bsd-3-clause |
Endika/django | tests/swappable_models/tests.py | 339 | 2130 | from __future__ import unicode_literals
from swappable_models.models import Article
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core import management
from django.test import TestCase, override_settings
from django.utils.six import StringIO
... | bsd-3-clause |
fenginx/django | tests/modeladmin/test_checks.py | 20 | 45394 | from django import forms
from django.contrib.admin import BooleanFieldListFilter, SimpleListFilter
from django.contrib.admin.options import VERTICAL, ModelAdmin, TabularInline
from django.contrib.admin.sites import AdminSite
from django.core.checks import Error
from django.db.models import F
from django.db.models.funct... | bsd-3-clause |
dgwakeman/mne-python | examples/decoding/plot_decoding_time_generalization.py | 7 | 2024 | """
==========================================================
Decoding sensor space data with Generalization Across Time
==========================================================
This example runs the analysis computed in:
Jean-Remi King, Alexandre Gramfort, Aaron Schurger, Lionel Naccache
and Stanislas Dehaene, "T... | bsd-3-clause |
romain-dartigues/ansible | lib/ansible/modules/cloud/amazon/elb_target_group.py | 6 | 31757 | #!/usr/bin/python
# 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',
'status': ['preview'],
... | gpl-3.0 |
sogelink/ansible | lib/ansible/module_utils/facts/virtual/hpux.py | 199 | 2486 | # 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 distributed in the hope that ... | gpl-3.0 |
arlowhite/kivy | examples/canvas/texture.py | 40 | 4185 | '''
Texture Wrapping and Coordinates Example
========================================
This example changes texture properties and the properties
of its containing rectangle. You should see some a multicolored
texture with sliders to the left and below and buttons at the
bottom of the screen. The image texture_example_... | mit |
webspinner/webspinner-gae-cms | gdata/data.py | 24 | 38760 | #!/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 ... | bsd-3-clause |
TinajaLabs/makerfaire2015 | SensorGateway/home/tinaja/downloads/pyserial-2.5/build/lib.linux-armv6l-2.7/serial/serialwin32.py | 8 | 15637 | #! python
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# serial driver for win32
# see __init__.py
#
# (C) 2001-2009 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
#
# Initial patch to use ctypes by Giovanni Bajo <rasky@develer.com>
import ctypes
i... | mit |
QProjectOrg/QRepo | src/convertors/base/bqt/initreader.py | 1 | 14171 | # -*- encoding: utf-8 -*-
import datetime
import os
import string
from src.convertors.base.bqt.currentbooksettings import CurrentBookSettings
from src.utils import commonscript
from src.utils.logger import log
from src.convertors.base.bqt.bqtdata import *
from src.utils.common import getFileNameInProperCase
class In... | mit |
ksrajkumar/openerp-6.1 | openerp/addons/auction/report/seller_form_report.py | 9 | 2755 | # -*- 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 |
mattmakesmaps/opencv-junk | opencv-utils/bin/delete_dupes.py | 1 | 1635 | import argparse
import os
import sys
def get_abs_path(in_path):
"""
Given a relative or absolute path, return the absolute path.
:param in_path:
:return:
"""
if os.path.isabs(in_path):
return in_path
else:
return os.path.abspath(in_path)
if __name__ == '__main__':
# Def... | mit |
srivassumit/servo | tests/wpt/css-tests/tools/py/py/_io/terminalwriter.py | 175 | 12542 | """
Helper functions for writing to terminals and files.
"""
import sys, os
import py
py3k = sys.version_info[0] >= 3
from py.builtin import text, bytes
win32_and_ctypes = False
colorama = None
if sys.platform == "win32":
try:
import colorama
except ImportError:
try:
import ctyp... | mpl-2.0 |
w1r0x/ansible | lib/ansible/utils/module_docs_fragments/eos.py | 11 | 3357 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.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 late... | gpl-3.0 |
ChrisTruncer/rdpy | setup.py | 1 | 1335 | #!/usr/bin/env python
import setuptools
from distutils.core import setup, Extension
setup(name='rdpy',
version='1.3.2',
description='Remote Desktop Protocol in Python',
long_description="""
RDPY is a pure Python implementation of the Microsoft RDP (Remote Desktop Protocol) protocol (Client and Server side). RDPY ... | gpl-3.0 |
jacshfr/mozilla-bedrock | vendor-local/packages/chardet/chardet/escsm.py | 235 | 7996 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mpl-2.0 |
eemirtekin/edx-platform | common/lib/calc/calc/calc.py | 176 | 13572 | """
Parser and evaluator for FormulaResponse and NumericalResponse
Uses pyparsing to parse. Main function as of now is evaluator().
"""
import math
import operator
import numbers
import numpy
import scipy.constants
import functions
from pyparsing import (
Word, Literal, CaselessLiteral, ZeroOrMore, MatchFirst, O... | agpl-3.0 |
sarthfrey/sentimizer | lib/werkzeug/wrappers.py | 234 | 77011 | # -*- coding: utf-8 -*-
"""
werkzeug.wrappers
~~~~~~~~~~~~~~~~~
The wrappers are simple request and response objects which you can
subclass to do whatever you want them to do. The request object contains
the information transmitted by the client (webbrowser) and the response
object contains al... | apache-2.0 |
motmot/flymovieformat | bootstrap.py | 1 | 2578 | ##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... | bsd-3-clause |
kapilrastogi/Impala | shell/ext-py/sqlparse-0.1.14/tests/utils.py | 31 | 1447 | # -*- coding: utf-8 -*-
"""Helpers for testing."""
import codecs
import difflib
import os
import unittest
from StringIO import StringIO
import sqlparse.utils
NL = '\n'
DIR_PATH = os.path.abspath(os.path.dirname(__file__))
PARENT_DIR = os.path.dirname(DIR_PATH)
FILES_DIR = os.path.join(DIR_PATH, 'files')
def load_... | apache-2.0 |
ZHAW-INES/rioxo-uClinux-dist | user/python/python-2.4.4/Lib/test/test_gzip.py | 15 | 1904 | from test.test_support import verify, TESTFN
import sys, os
import gzip
filename = TESTFN
data1 = """ int length=DEFAULTALLOC, err = Z_OK;
PyObject *RetVal;
int flushmode = Z_FINISH;
unsigned long start_total_out;
"""
data2 = """/* zlibmodule.c -- gzip-compatible data compression */
/* See http://www.gzip.or... | gpl-2.0 |
ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylint/pylint/checkers/refactoring/len_checker.py | 1 | 4298 | # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/LICENSE
from typing import List
import astroid
from pylint import checkers, interfaces
from pylint.checkers import utils
class LenChecker(checkers.BaseChecker):
"""Checks f... | mit |
EventGhost/EventGhost | plugins/TechnoTrendIrBda/__init__.py | 2 | 5449 | # -*- coding: utf-8 -*-
#
# plugins/TechnoTrendIrBda/__init__.py
#
# Copyright (C) 2009 Mika Fischer <mika.fischer@zoopnet.de>
#
# This file is a plugin for EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost is free software: you can redistribute it and/or modify it under... | gpl-2.0 |
fanchunke1991/flask_website | migrations/versions/d8d1b418f41c_.py | 1 | 1046 | """empty message
Revision ID: d8d1b418f41c
Revises: 7f5c9e993be1
Create Date: 2017-02-15 21:03:05.958000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd8d1b418f41c'
down_revision = '7f5c9e993be1'
branch_labels = None
depends_on = None
def upgrade():
# ... | mit |
xfmysql/xfwdata | totcms/web/member/fckeditor/editor/filemanager/browser/default/connectors/py/connector.py | 6 | 21685 | #!/usr/bin/env python
"""
FCKeditor - The text editor for internet
Copyright (C) 2003-2006 Frederico Caldeira Knabben
Licensed under the terms of the GNU Lesser General Public License:
http://www.opensource.org/licenses/lgpl-license.php
For further information visit:
http://www.fckeditor.net/
"Support Open Sour... | apache-2.0 |
taedori81/gentlecoffee | home/templatetags/gentlecoffee_tags.py | 1 | 2563 | from django import template
from ..models import Area
register = template.Library()
@register.assignment_tag(takes_context=True)
def get_site_root(context):
return context['request'].site.root_page
@register.inclusion_tag("home/navbar/navbar.html", takes_context=True)
def display_navbar(context):
parent = ... | bsd-3-clause |
erickt/hue | desktop/core/ext-py/python-openid-2.2.5/openid/test/test_auth_request.py | 78 | 7976 | import cgi
import unittest
from openid.consumer import consumer
from openid import message
from openid.test import support
class DummyEndpoint(object):
preferred_namespace = None
local_id = None
server_url = None
is_op_identifier = False
def preferredNamespace(self):
return self.preferred... | apache-2.0 |
saurabhjn76/sympy | sympy/stats/rv.py | 28 | 29914 | """
Main Random Variables Module
Defines abstract random variable type.
Contains interfaces for probability space object (PSpace) as well as standard
operators, P, E, sample, density, where
See Also
========
sympy.stats.crv
sympy.stats.frv
sympy.stats.rv_interface
"""
from __future__ import print_function, division
... | bsd-3-clause |
garethr/django-project-templates | setup.py | 1 | 1174 | from setuptools import setup, find_packages
import os
setup(
name='django-project-templates',
version = "0.11",
description="Paster templates for creating Django projects",
author='Gareth Rushgrove',
author_email='gareth@morethanseven.net',
url='http://github.com/garethr/django-project-template... | mit |
IntersectAustralia/hcsvlab_robochef | hcsvlab_robochef/upload/sesame.py | 2 | 3861 | """Support for uploading RDF data directly to a Sesame instance"""
import urllib, urllib2
import os
import configmanager
configmanager.configinit()
class RequestWithMethod(urllib2.Request):
def __init__(self, *args, **kwargs):
self._method = kwargs.get('method')
if self._method:
del kwargs['method']... | gpl-3.0 |
apanda/phantomjs-intercept | src/breakpad/src/tools/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py | 151 | 1287 | #!/usr/bin/env python
# Copyright (c) 2009 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 inclusion of $HOME/.gyp/includes.gypi works properly with relocation
and with regeneration.
"""
import os
import TestGyp
# Re... | bsd-3-clause |
Mustard-Systems-Ltd/pyzmq | examples/device/server.py | 10 | 1419 | """A device based server."""
#
# Copyright (c) 2010 Brian E. Granger and Eugene Chernyshov
#
# This file is part of pyzmq.
#
# pyzmq is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation; eithe... | bsd-3-clause |
talhajaved/nyuadmarket | flask/lib/python2.7/site-packages/sqlalchemy/testing/__init__.py | 21 | 1052 | # testing/__init__.py
# Copyright (C) 2005-2015 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
from .warnings import testing_warn, assert_warnings, resetwarnings
from . impo... | mit |
jorsea/odoomrp-wip | sale_mrp_project_link/__openerp__.py | 14 | 1389 | # -*- encoding: 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 |
Nicop06/ansible | lib/ansible/modules/packaging/language/pear.py | 17 | 7105 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Afterburn <http://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com>
# (c) 2015, Jonathan Lestrelin <jonathan.lestrelin@gmail.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __f... | gpl-3.0 |
patrickstocklin/chattR | lib/python2.7/site-packages/nltk/corpus/reader/ppattach.py | 10 | 3138 | # Natural Language Toolkit: PP Attachment Corpus Reader
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Read lines from the Prepositional Phrase Attachment Corpus.
... | gpl-2.0 |
westinedu/newertrends | django/contrib/gis/sitemaps/views.py | 250 | 4342 | from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.models import get_current_site
from django.core import urlresolvers
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.contrib.gis.db.models.fields import GeometryField
from django.db import... | bsd-3-clause |
jpwarren/holideck | requests/models.py | 4 | 30153 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import os
import socket
import collections
from datetime import datetime
from io import BytesIO
from .hooks import dispatch_hook, HOOKS
from .structures import CaseInsensitiveDict
from .stat... | mit |
bsmrstu-warriors/Moytri--The-Drone-Aider | Lib/distutils/command/register.py | 75 | 11577 | """distutils.command.register
Implements the Distutils 'register' command (register with the repository).
"""
# created 2002/10/21, Richard Jones
__revision__ = "$Id$"
import urllib2
import getpass
import urlparse
import StringIO
from warnings import warn
from distutils.core import PyPIRCCommand
from distutils imp... | gpl-3.0 |
normanmaurer/autobahntestsuite-maven-plugin | src/main/resources/twisted/manhole/ui/test/test_gtk2manhole.py | 130 | 1276 | # Copyright (c) 2009 Twisted Matrix Laboratories.
"""
Tests for GTK2 GUI manhole.
"""
skip = False
try:
import pygtk
pygtk.require("2.0")
except:
skip = "GTK 2.0 not available"
else:
try:
import gtk
except ImportError:
skip = "GTK 2.0 not available"
except RuntimeError:
... | apache-2.0 |
quantopian/odo | odo/tests/test_into.py | 5 | 1712 | from __future__ import absolute_import, division, print_function
import pytest
import numpy as np
from odo import odo, into
from odo.utils import tmpfile, filetext
from odo.backends.csv import CSV
def test_into_convert():
assert odo((1, 2, 3), list) == [1, 2, 3]
def test_into_append():
lst = []
resul... | bsd-3-clause |
chetan51/nupic | examples/opf/experiments/anomaly/temporal/hotgym/description.py | 3 | 16606 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
Nicop06/ansible | lib/ansible/module_utils/univention_umc.py | 62 | 8734 | # -*- coding: UTF-8 -*-
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | gpl-3.0 |
migasfree/migasfree-backend | migasfree/client/models/fault.py | 1 | 4720 | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2021 Jose Antonio Chavarría <jachavar@gmail.com>
# Copyright (c) 2015-2021 Alberto Gacías <alberto@migasfree.org>
#
# 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 Softw... | gpl-3.0 |
arista-eosplus/ansible | lib/ansible/modules/network/f5/bigip_sys_db.py | 78 | 6008 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks 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
# ... | gpl-3.0 |
python-ivi/python-ivi | ivi/agilent/agilent8591C.py | 2 | 1555 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2013-2017 Alex Forencich
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... | mit |
cmdunkers/DeeperMind | PythonEnv/lib/python2.7/site-packages/theano/tests/test_rop.py | 3 | 15290 | """
WRITE ME
Tests for the R operator / L operator
For the list of op with r op defined, with or without missing test
see this file: doc/library/tensor/basic.txt
For function to automatically test your Rop implementation, look at
the docstring of the functions: check_mat_rop_lop, check_rop_lop,
check_nondiff_... | bsd-3-clause |
skurtapp/django-rest-framework-jwt | setup.py | 1 | 3378 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import shutil
import sys
from setuptools import setup
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
with open(os.path.join(package, '__init__.py'), 'rb') as init_py:
src = in... | mit |
wklm/dockerized_trains | node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | 2736 | 6387 | # 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 project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... | apache-2.0 |
Wafflespeanut/servo | tests/wpt/css-tests/tools/py/testing/log/test_log.py | 163 | 6634 | import py
import sys
from py._log.log import default_keywordmapper
callcapture = py.io.StdCapture.call
def setup_module(mod):
mod._oldstate = default_keywordmapper.getstate()
def teardown_module(mod):
default_keywordmapper.setstate(mod._oldstate)
class TestLogProducer:
def setup_method(self, meth):
... | mpl-2.0 |
40223137/150601 | static/Brython3.1.3-20150514-095342/Lib/stat.py | 765 | 4304 | """Constants/functions for interpreting results of os.stat() and os.lstat().
Suggested usage: from stat import *
"""
# Indices for stat struct members in the tuple returned by os.stat()
ST_MODE = 0
ST_INO = 1
ST_DEV = 2
ST_NLINK = 3
ST_UID = 4
ST_GID = 5
ST_SIZE = 6
ST_ATIME = 7
ST_MTIME = 8
ST_CTIME = 9
... | agpl-3.0 |
Endika/odoo | addons/account/report/account_partner_ledger.py | 236 | 13439 | # -*- 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 |
Changaco/oh-mainline | vendor/packages/irc/irc/strings.py | 21 | 2166 | from __future__ import absolute_import, unicode_literals
import re
import string
import six
# from jaraco.util.string
class FoldedCase(six.text_type):
"""
A case insensitive string class; behaves just like str
except compares equal when the only variation is case.
>>> s = FoldedCase('hello world')
... | agpl-3.0 |
deets/clang-complete | tests/test_async_api.py | 1 | 2891 | import os
import tempfile
from unittest import TestCase
from cStringIO import StringIO
from clangcomplete.libclang import setup
from clangcomplete.api import (
mainloop,
AsyncSession,
)
from clangcomplete.util import source_for_autocomplete
TEST_SOURCE = """
struct Foo {
int bar;
int baz;
};
int... | mit |
yongtang/tensorflow | tensorflow/compiler/tests/async_comp_test.py | 7 | 3619 | # 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 |
endlessm/chromium-browser | third_party/catapult/third_party/coverage/igor.py | 8 | 12301 | # coding: utf-8
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Helper for building, testing, and linting coverage.py.
To get portability, all these operations are written in Python here instead
of in shell s... | bsd-3-clause |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/solnlib/packages/splunklib/searchcommands/validators.py | 2 | 11699 | # coding=utf-8
#
# Copyright 2011-2015 Splunk, 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... | isc |
citrix-openstack-build/horizon | openstack_dashboard/api/cinder.py | 9 | 5532 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit... | apache-2.0 |
HaoMood/cs231n | assignment3 (copy)/assignment3/cs231n/optim.py | 20 | 2744 | import numpy as np
"""
This file implements various first-order update rules that are commonly used for
training neural networks. Each update rule accepts current weights and the
gradient of the loss with respect to those weights and produces the next set of
weights. Each update rule has the same interface:
def updat... | gpl-3.0 |
Manojkumar91/odoo_inresto | addons/account_chart/__openerp__.py | 8 | 1385 | # -*- 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 |
fredericlepied/ansible | lib/ansible/modules/network/f5/bigip_facts.py | 72 | 62015 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2013, Matt Hite <mhite@hotmail.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 Licens... | gpl-3.0 |
deKupini/erp | addons/l10n_be_coda/wizard/__init__.py | 8 | 1031 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.