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 |
|---|---|---|---|---|---|
Duoxilian/home-assistant | homeassistant/components/switch/orvibo.py | 29 | 3065 | """
Support for Orvibo S20 Wifi Smart Switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.orvibo/
"""
import logging
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.con... | mit |
jlegendary/Dato-Core | src/unity/python/graphlab/meta/asttools/visitors/cond_symbol_visitor.py | 13 | 11320 | '''
Created on Aug 4, 2011
@author: sean
'''
from __future__ import print_function
from graphlab.meta.asttools.visitors import Visitor, visit_children
from graphlab.meta.asttools.visitors.symbol_visitor import get_symbols
import ast
from graphlab.meta.utils import py2op
class ConditionalSymbolVisitor(Visitor):
... | agpl-3.0 |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/pypy/lib_pypy/pyrepl/simple_interact.py | 3 | 2395 | # Copyright 2000-2010 Michael Hudson-Doyle <micahel@gmail.com>
# Armin Rigo
#
# All Rights Reserved
#
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose is hereby granted without fee,
# provided that the above copyrigh... | agpl-3.0 |
liukaijv/XlsxWriter | xlsxwriter/test/app/test_app02.py | 8 | 2248 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...app import App
class TestAssembleApp(uni... | bsd-2-clause |
bobisme/odoo | addons/mrp_operations/mrp_operations.py | 17 | 26993 | # -*- 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 |
jabesq/home-assistant | tests/components/rflink/test_switch.py | 11 | 10068 | """Test for RFlink switch components.
Test setup of rflink switch component/platform. State tracking and
control of Rflink switch devices.
"""
from homeassistant.components.rflink import EVENT_BUTTON_PRESSED
from homeassistant.const import (
ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_ON, STATE_OFF)... | apache-2.0 |
hdinsight/hue | desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/chart/axis.py | 10 | 12070 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
Float,
NoneSet,
Bool,
Integer,
MinMax,
NoneSet,
Set,
String,
Alias,
)
from openpyxl.descriptors.excel i... | apache-2.0 |
aperigault/ansible | lib/ansible/modules/windows/win_updates.py | 2 | 10479 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Matt Davis <mdavis_ansible@rolpdog.com>
# 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 ... | gpl-3.0 |
AgentN/namebench | libnamebench/nameserver.py | 173 | 18079 | #!/usr/bin/env python
# Copyright 2009 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... | apache-2.0 |
hynekcer/django | tests/model_fields/models.py | 210 | 12155 | import os
import tempfile
import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.db.models.fields.files import Imag... | bsd-3-clause |
xiaoyaozi5566/GEM5_DRAMSim2 | src/mem/slicc/generate/tex.py | 92 | 2816 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
pygeo/geoval | tests/test_mintrend.py | 1 | 3310 | # -*- coding: utf-8 -*-
"""
This file is part of GEOVAL.
(c) Alexander Loew
For COPYING and LICENSE details, please refer to the LICENSE file
"""
import sys
sys.path.append('..')
import unittest
from geoval.core import GeoData
from geoval.statistic.mintrend import MintrendPlot
try:
import cPickle # p2
except:
... | apache-2.0 |
nvoron23/socialite | jython/Lib/test/test_classdecorators.py | 23 | 1192 | # This test is temporary until we can import test_decorators from CPython 3.x
# The reason for not doing that already is that in Python 3.x the name of a
# function is stored in func.__name__, in 2.x it's func.func_name
import unittest
from test import test_support
class TestClassDecorators(unittest.TestCase):
de... | apache-2.0 |
Nikola-K/guessit | docs/_themes/flask_theme_support.py | 2228 | 4875 | # flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = "... | lgpl-3.0 |
ishay2b/tensorflow | tensorflow/tools/docs/generate_lib_test.py | 52 | 4345 | # 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 |
nvbn/python-social-auth | social/backends/dropbox.py | 3 | 1431 | """
Dropbox OAuth support.
This contribution adds support for Dropbox OAuth service. The settings
DROPBOX_APP_ID and DROPBOX_API_SECRET must be defined with the values
given by Dropbox application registration process.
By default account id and token expiration time are stored in extra_data
field, check OAuthBackend ... | bsd-3-clause |
blorgon9000/pyopus | pyopus/misc/sobol.py | 1 | 1725 | """
.. inheritance-diagram:: pyopus.misc.sobol
:parts: 1
**Sobol sequence generator**
Details can be found in
[joekuo1] S. Joe and F. Y. Kuo, Remark on Algorithm 659: Implementing Sobol's
quasirandom sequence generator, ACM Trans. Math. Softw. 29, 49-57 (2003).
[joekuo2] S. Joe and F. Y. Kuo, Const... | gpl-3.0 |
prospwro/odoo | addons/irsid_edu_training/models/core.py | 2 | 7407 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution Addon
# Copyright (C) 2009-2013 IRSID (<http://irsid.ru>),
# Paul Korotkov (korotkov.paul@gmail.com).
#
# This program is free software: you can redistribute it... | agpl-3.0 |
lucker6666/m4loc | corpus/corpus-cleaning-tool/src/scripts/corpustool/common/weird_align_clean.py | 3 | 7477 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Adobe Systems Incorporated
#
# This file is part of TMX to Moses Corpus Tool.
#
# TMX to Moses Corpus Tool is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Sof... | lgpl-3.0 |
yakky/django-cms | cms/tests/test_page_user_group_admin.py | 3 | 18350 | # -*- coding: utf-8 -*-
from django.contrib.messages.storage.cookie import CookieStorage
from django.forms.models import model_to_dict
from django.test.utils import override_settings
from cms.models.permissionmodels import PageUserGroup
from cms.test_utils.testcases import CMSTestCase
from cms.utils.urlutils import ad... | bsd-3-clause |
dcroc16/skunk_works | google_appengine/google/appengine/_internal/django/utils/translation/trans_real.py | 23 | 20698 | """Translation helper functions."""
import locale
import os
import re
import sys
import warnings
import gettext as gettext_module
from cStringIO import StringIO
from google.appengine._internal.django.utils.importlib import import_module
from google.appengine._internal.django.utils.safestring import mark_safe, SafeDat... | mit |
freaker2k7/chalice | chalice/local.py | 1 | 7587 | """Dev server used for running a chalice app locally.
This is intended only for local development purposes.
"""
import functools
from collections import namedtuple
from BaseHTTPServer import HTTPServer
from BaseHTTPServer import BaseHTTPRequestHandler
from chalice.app import Chalice # noqa
from typing import List,... | apache-2.0 |
eoss-cloud/madxxx_catalog_api | catalog/manage/sentinelcatalog.py | 1 | 4889 | #-*- coding: utf-8 -*-
""" EOSS catalog system
Implementation of ESA sentinel1/2 catalog access
(https://scihub.copernicus.eu)
Users need to register at the scihub page to get access to their catalog system. These credentials are set by SENTINEL_USER and SENTINEL_PASSWORD
"""
__author__ = "Thilo Wehrmann, Steffen Ge... | mit |
antb/TPT----My-old-mod | src/python/stdlib/test/test_cookie.py | 3 | 3429 | # Simple test suite for Cookie.py
from test.test_support import run_unittest, run_doctest, check_warnings
import unittest
import Cookie
class CookieTests(unittest.TestCase):
# Currently this only tests SimpleCookie
def test_basic(self):
cases = [
{ 'data': 'chips=ahoy; vienna=finger',
... | gpl-2.0 |
ArcherSys/ArcherSys | Lib/site-packages/nbformat/v3/__init__.py | 18 | 2328 | """The main API for the v3 notebook format.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
__all__ = ['NotebookNode', 'new_code_cell', 'new_text_cell', 'new_notebook',
'new_output', 'new_worksheet', 'new_metadata', 'new_author',
'new_head... | mit |
brendandahl/servo | tests/wpt/css-tests/css21_dev/html4/support/fonts/makegsubfonts.py | 820 | 14309 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
barryrobison/arsenalsuite | cpp/apps/absubmit/cinema4d/submit.py | 10 | 9966 | #!/usr/bin/python
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.uic import *
from blur.Stone import *
from blur.Classes import *
from blur.absubmit import Submitter
from blur.Classesui import *
import sys, os
class Cinema4DRenderDialog(QDialog):
def __init__(self,parent=None):
QDialo... | gpl-2.0 |
sean-/ansible | test/units/parsing/vault/test_vault.py | 87 | 5672 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
sivel/ansible | test/integration/targets/module_utils_urls/library/test_peercert.py | 29 | 2346 | #!/usr/bin/python
# Copyright: (c) 2020, 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
DOCUMENTATION = r'''
---
module: test_perrcert
short_description: Test getting t... | gpl-3.0 |
lammps/lammps | tools/i-pi/ipi/utils/softexit.py | 41 | 2190 | """Utility functions for killing the wrapper softly.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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... | gpl-2.0 |
Wilbeibi/rethinkdb | external/v8_3.30.33.16/build/gyp/tools/pretty_sln.py | 806 | 5092 | #!/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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | agpl-3.0 |
alcobar/asuswrt-merlin | release/src/router/samba-3.5.8/source4/heimdal/lib/wind/UnicodeData.py | 22 | 2225 | #!/usr/local/bin/python
# -*- coding: iso-8859-1 -*-
# $Id: UnicodeData.py,v 1.1.1.1 2011/06/10 09:34:43 andrew Exp $
# Copyright (c) 2004 Kungliga Tekniska Högskolan
# (Royal Institute of Technology, Stockholm, Sweden).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without ... | gpl-2.0 |
jay-lau/magnum | magnum/tests/functional/api/v1/models/baypatch_model.py | 1 | 2317 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | apache-2.0 |
benoitsteiner/tensorflow | tensorflow/contrib/data/python/kernel_tests/sequence_dataset_op_test.py | 39 | 8034 | # 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 |
tanmaykm/edx-platform | common/test/acceptance/tests/lms/test_programs.py | 13 | 6048 | """Acceptance tests for LMS-hosted Programs pages"""
from nose.plugins.attrib import attr
from common.test.acceptance.fixtures.catalog import CatalogFixture, CatalogConfigMixin
from common.test.acceptance.fixtures.programs import ProgramsFixture, ProgramsConfigMixin
from common.test.acceptance.fixtures.course import C... | agpl-3.0 |
frankvdp/django | django/conf/locale/zh_Hans/formats.py | 140 | 1745 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y年n月j日' # 2016年9月5日
TIME_FORMAT = 'H:i' # 20:45
DATETIME_FORMAT ... | bsd-3-clause |
TallonRain/horsefaxbot | horsefax/telegram/connections/polling.py | 1 | 1484 | import requests
import threading
import time
import traceback
from . import TelegramConnection, MessageHandler
class LongPollingConnection(TelegramConnection):
def __init__(self, token: str, handler: MessageHandler) -> None:
super().__init__(token, handler)
self._connected = False
self.la... | mit |
v-iam/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_sku.py | 2 | 1546 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
MQQiang/kbengine | kbe/src/lib/python/Lib/http/cookiejar.py | 63 | 75791 | r"""HTTP cookie handling for web clients.
This module has (now fairly distant) origins in Gisle Aas' Perl module
HTTP::Cookies, from the libwww-perl library.
Docstrings, comments and debug strings in this code refer to the
attributes of the HTTP cookie system as cookie-attributes, to distinguish
them clearly from Pyt... | lgpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/skimage/segmentation/tests/test_clear_border.py | 4 | 4369 | import numpy as np
from skimage.segmentation import clear_border
from skimage._shared.testing import assert_array_equal, assert_
def test_clear_border():
image = np.array(
[[0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0, 0, 0, 0],
[1, 0, 0, 1, 0, 1, 0, 0, 0],
[0, 0, 1, 1, 1, 1,... | gpl-3.0 |
adobe/chromium | third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_table.py | 33 | 7098 | #!/usr/bin/python2
# (C) Copyright IBM Corporation 2004
# All Rights Reserved.
#
# 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
# on the ri... | bsd-3-clause |
wanderine/nipype | nipype/interfaces/afni/tests/test_auto_Bandpass.py | 9 | 1844 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.afni.preprocess import Bandpass
def test_Bandpass_inputs():
input_map = dict(args=dict(argstr='%s',
),
automask=dict(argstr='-automask',
),
blur=dict(argstr='-blur %f',
),
de... | bsd-3-clause |
rossburton/yocto-autobuilder | lib/python2.7/site-packages/buildbot_slave-0.8.8-py2.7.egg/buildslave/test/fake/slavebuilder.py | 4 | 1411 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
an7oine/WinVHS | Cygwin/lib/python2.7/xml/sax/handler.py | 230 | 13921 | """
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.
Many of these classes are empty and are included only as documentation
of the interfaces.
$Id$
"""
version ... | gpl-3.0 |
glenn-edgar/local_controller_3 | io_control_py3/click_controller_class_py3.py | 1 | 8632 | #
#
# File: io_controller_class.py
#
#
#
#
#
import struct
import os
import sys
import time
import select
import socket
import json
import redis
class Click_Controller_Base_Class(object):
def __init__(self,instrument, click_io = [], m_tags = {}):
self.instrument = instrument
s... | mit |
eggplantbren/ExperimentalNS | TwoScalars/DNest/postprocess.py | 1 | 7100 | # Copyright (c) 2009, 2010, 2011, 2012 Brendon J. Brewer.
#
# This file is part of DNest3.
#
# DNest3 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 ... | gpl-3.0 |
raymondxyang/tensorflow | tensorflow/python/saved_model/loader.py | 127 | 2726 | # 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 |
111t8e/h2o-2 | src/test/python/take_one_test.py | 9 | 1096 | import unittest
from proboscis.asserts import assert_equal
from proboscis.asserts import assert_false
from proboscis.asserts import assert_raises
from proboscis.asserts import assert_true
from proboscis import after_class
from proboscis import before_class
from proboscis import SkipTest
from proboscis import test
impo... | apache-2.0 |
vgupta6/Project-2 | tests/unit_tests/modules/s3/s3gis/TrueCodePaths.py | 20 | 13547 |
import unittest
class TrueCodePaths(unittest.TestCase):
def setUp(self):
vars = request.vars
vars["lat"] = 0
vars["lon"] = 0
vars["zoom"] = 1
self.old_s3roles = list(session.s3.roles)
session.s3.roles.append(1)
def tearDown(self):
... | mit |
gvangool/django-extensions | django_extensions/management/commands/drop_test_database.py | 25 | 5810 | import logging
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from six.moves import configparser, input
from django_extensions.management.utils import signalcommand
try:
from django.db.backends.base.creation import TEST_DATABASE... | mit |
atrick/swift | utils/split_file.py | 65 | 1410 | #!/usr/bin/env python
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIB... | apache-2.0 |
caot/intellij-community | python/edu/interactive-learning-python/resources/com/jetbrains/python/edu/user_tester.py | 41 | 1825 | import sys
import imp
import os
import subprocess
USER_TESTS = "userTests"
TEST_FAILED = "FAILED"
TEST_PASSED = "PASSED"
INPUT = "input"
OUTPUT = "output"
def get_index(logical_name, full_name):
logical_name_len = len(logical_name)
if full_name[:logical_name_len] == logical_name:
return int(full_n... | apache-2.0 |
koolventure/replicator | dnaEncoder.py | 1 | 1184 | #Software to encode binary information to DNA nucleotides
import binascii
import re
class DNAEncoder:
def __init__(self):
self.binaryArray = []
self.nucleotideArray = []
#This section of code is used for the express purpose of encoding binary information
#Creates a demilited binary array
... | mit |
nickpack/reportlab | tests/test_platypus_tables.py | 1 | 38444 | #!/bin/env python
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
__version__=''' $Id: test_platypus_tables.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__='Test script for reportlab.tables'
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocatio... | bsd-3-clause |
sbesson/PyGithub | tests/PullRequest1375.py | 3 | 2693 | ############################ Copyrights and license ############################
# #
# Copyright 2019 Olof-Joachim Frahm <olof@macrolet.net> #
# ... | lgpl-3.0 |
chihyaoma/Activity-Recognition-with-CNN-and-RNN | textOverlay/TextOverlay.py | 1 | 4692 | # This is a Python code using OpenCV to print the probabilities and predictions on videos
#
# I am working for a deadline. It's still messed up...
#
# Contact: Chih-Yao Ma at cyma@gatech.edu
import numpy as np
import cv2
import random
import re
n = 3 # number of predictions per video
nVideo = 3754 # number of tota... | mit |
discosultan/quake-console | Samples/Sandbox/Lib/lib2to3/pgen2/token.py | 353 | 1244 | #! /usr/bin/env python
"""Token constants (from "token.h")."""
# Taken from Python (r53757) and modified to include some tokens
# originally monkeypatched in by pgen2.tokenize
#--start constants--
ENDMARKER = 0
NAME = 1
NUMBER = 2
STRING = 3
NEWLINE = 4
INDENT = 5
DEDENT = 6
LPAR = 7
RPAR = 8
LSQB = 9
RSQB = 10
C... | mit |
rmcgibbo/msmbuilder | msmbuilder/tests/test_vmhmm.py | 2 | 3951 | from __future__ import print_function, division
import numpy as np
from msmbuilder.hmm import VonMisesHMM
from msmbuilder.example_datasets import AlanineDipeptide
from msmbuilder.featurizer import DihedralFeaturizer
from scipy.stats.distributions import vonmises
from itertools import permutations
import random
def t... | lgpl-2.1 |
evaschalde/odoo | addons/membership/report/__init__.py | 432 | 1079 | # -*- 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... | agpl-3.0 |
nathanielcompton/actuallypittsburgh | actuallypittsburgh/ap_bot.py | 1 | 1562 | """
Run through comments in a specified list of subreddits,
look for typos, and if a typo is found,
post a new comment with the corrected spelling.
"""
import praw
import time
import logging
from . import ap_config
logger = logging.getLogger(__name__)
# User agent info so Reddit can track the bot
r = pra... | mit |
sigma-random/numpy | tools/win32build/prepare_bootstrap.py | 81 | 3648 | from __future__ import division, print_function
import os
import subprocess
import shutil
from os.path import join as pjoin, split as psplit, dirname
from zipfile import ZipFile
import re
def get_sdist_tarball():
"""Return the name of the installer built by wininst command."""
# Yeah, the name logic is harcod... | bsd-3-clause |
DJMuggs/ansible-modules-extras | notification/twilio.py | 8 | 5726 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Makai <matthew.makai@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 ... | gpl-3.0 |
nvoron23/statsmodels | statsmodels/sandbox/tsa/diffusion2.py | 38 | 13366 | """ Diffusion 2: jump diffusion, stochastic volatility, stochastic time
Created on Tue Dec 08 15:03:49 2009
Author: josef-pktd following Meucci
License: BSD
contains:
CIRSubordinatedBrownian
Heston
IG
JumpDiffusionKou
JumpDiffusionMerton
NIG
VG
References
----------
Attilio Meucci, Review of Discrete and Contin... | bsd-3-clause |
logithr/django-htpayway | htpayway/tests.py | 1 | 2885 | # -*- coding: utf-8 -*-
from django.test import TestCase, RequestFactory
from django.core import exceptions
from django.contrib.auth.models import AnonymousUser
from .utils import get_payway_class, begin_transaction, format_amount, PayWay
from .models import Transaction
from decimal import Decimal, InvalidOperation
... | mit |
wil/pyroman | pyroman/nat.py | 1 | 5751 | #Copyright (c) 2011 Erich Schubert erich@debian.org
#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, pu... | mit |
TeamMac/android_kernel_huawei_p6-u06 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
tonihr/pyGeo | Geometrias/PuntoGeodesico.py | 1 | 6474 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''!
Created on 5/2/2015
@author: Antonio Hermosilla Rodrigo.
@contact: anherro285@gmail.com
@organization: Antonio Hermosilla Rodrigo.
@copyright: (C) 2015 by Antonio Hermosilla Rodrigo
@version: 1.0.0
'''
from Geometrias.Angulo import Angulo
class PuntoGeodesico(object)... | gpl-2.0 |
dosiecki/NewsBlur | vendor/feedvalidator/channel.py | 16 | 9663 | """$Id: channel.py 711 2006-10-25 00:43:41Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 711 $"
__date__ = "$Date: 2006-10-25 00:43:41 +0000 (Wed, 25 Oct 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
from ... | mit |
Max-Vader/namebench | nb_third_party/dns/tokenizer.py | 246 | 17962 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
Jonadabe/letsencrypt | letsencrypt-nginx/letsencrypt_nginx/tests/obj_test.py | 55 | 3978 | """Test the helper objects in letsencrypt_nginx.obj."""
import unittest
class AddrTest(unittest.TestCase):
"""Test the Addr class."""
def setUp(self):
from letsencrypt_nginx.obj import Addr
self.addr1 = Addr.fromstring("192.168.1.1")
self.addr2 = Addr.fromstring("192.168.1.1:* ssl")
... | apache-2.0 |
charlesweir/BrickPython | test/TestSensor.py | 1 | 3630 | # Tests for Sensor
#
# Copyright (c) 2014 Charles Weir. Shared under the MIT Licence.
import unittest
from BrickPython.BrickPi import PORT_1
from BrickPython.Sensor import Sensor, TouchSensor, UltrasonicSensor, LightSensor
import TestScheduler
class TestSensor(unittest.TestCase):
'Tests for the Sensor classes'
... | mit |
jswope00/GAI | common/djangoapps/django_comment_common/models.py | 15 | 3806 | import logging
from django.db import models
from django.contrib.auth.models import User
from django.dispatch import receiver
from django.db.models.signals import post_save
from django.utils.translation import ugettext_noop
from student.models import CourseEnrollment
from xmodule.modulestore.django import modulestore... | agpl-3.0 |
GiovanniConserva/TestDeploy | venv/Lib/site-packages/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## 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... | bsd-3-clause |
benoitsteiner/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/models/k_feature_decisions_to_data_then_nn.py | 189 | 1874 | # 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 |
ntiufalara/openerp7 | openerp/addons/sale_stock/stock.py | 27 | 8014 | # -*- 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 |
aclifton/cpeg853-gem5 | src/cpu/testers/garnet_synthetic_traffic/GarnetSyntheticTraffic.py | 15 | 3122 | # Copyright (c) 2016 Georgia Institute of Technology
# 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 conditi... | bsd-3-clause |
SmartInfrastructures/fuel-web-dev | nailgun/nailgun/orchestrator/provisioning_serializers.py | 1 | 13570 | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | apache-2.0 |
renyi533/tensorflow | tensorflow/python/compiler/tensorrt/test/lru_cache_test.py | 3 | 2916 | # 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 |
zhinaonet/sqlmap-z | thirdparty/chardet/sbcsgroupprober.py | 2936 | 3291 | ######################## 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... | gpl-3.0 |
saurabh3949/mxnet | python/mxnet/executor.py | 16 | 20077 | # 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 |
tunneln/CarnotKE | jyhton/out/production/CarnotKE/shell/jython.py | 20 | 15050 | #!/usr/bin/env python2.7 -E
# -*- coding: utf-8 -*-
# Launch script for Jython. It may be wrapped as an executable with
# tools like PyInstaller, creating jython.exe, or run directly. The
# installer will make this the default launcher under the name
# bin/jython if CPython 2.7 is available with the above shebang
# in... | apache-2.0 |
Vixionar/django | django/contrib/gis/geos/prototypes/coordseq.py | 485 | 3049 | from ctypes import POINTER, c_double, c_int, c_uint
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import (
GEOSException, last_arg_byref,
)
# ## Error-checking routines specific to coordinate sequences. ##
def check_cs_op(result, fu... | bsd-3-clause |
OpenAcademy-OpenStack/project-docs | samples/helloworld/helloworld/openstack/common/eventlet_backdoor.py | 1 | 4797 | # Copyright (c) 2012 OpenStack Foundation.
# Administrator of the National Aeronautics and Space Administration.
# 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 a... | apache-2.0 |
benthomasson/ansible | lib/ansible/modules/storage/zfs/zfs.py | 9 | 7895 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Johan Wiren <johan.wiren.se@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.0... | gpl-3.0 |
foodszhang/kbengine | kbe/res/scripts/common/Lib/test/test_fileio.py | 80 | 15460 | # Adapted from test_file.py by Daniel Stutzbach
import sys
import os
import io
import errno
import unittest
from array import array
from weakref import proxy
from functools import wraps
from test.support import TESTFN, check_warnings, run_unittest, make_bad_fd, cpython_only
from collections import UserList
from _io ... | lgpl-3.0 |
jangorecki/h2o-3 | h2o-py/tests/testdir_misc/pyunit_create_frame.py | 6 | 2597 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from collections import defaultdict
import random
import sys
sys.path.insert(1, "../../")
import h2o
from h2o.exceptions import H2OValueError
from h2o.utils.compatibility import viewvalues
from tests import pyunit_utils
def create_frame_test():
"""Test `h2o.create_fr... | apache-2.0 |
HiroIshikawa/21playground | microblog/flask/lib/python3.5/site-packages/whoosh/lang/snowball/swedish.py | 96 | 2760 | from .bases import _ScandinavianStemmer
from whoosh.compat import u
class SwedishStemmer(_ScandinavianStemmer):
"""
The Swedish Snowball stemmer.
:cvar __vowels: The Swedish vowels.
:type __vowels: unicode
:cvar __s_ending: Letters that may directly appear before a word final 's'.
:type __s... | mit |
vfasky/BlogCatke | virtualenv.bundle/requests/packages/chardet2/langhungarianmodel.py | 25 | 12784 | ######################## 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 Ri... | apache-2.0 |
frainfreeze/studying | home/python/microblog/venv/lib/python3.5/site-packages/pip/_vendor/cachecontrol/filewrapper.py | 74 | 2533 | from io import BytesIO
class CallbackFileWrapper(object):
"""
Small wrapper around a fp object which will tee everything read into a
buffer, and when that file is closed it will execute a callback with the
contents of that buffer.
All attributes are proxied to the underlying file object.
Thi... | mit |
CLOUGH/info3180-project-4 | lib/werkzeug/contrib/fixers.py | 464 | 9949 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.fixers
~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module includes various helpers that fix bugs in web servers. They may
be necessary for some versions of a buggy web server but not others. We try
to stay updated with the status of the bug... | apache-2.0 |
vFense/vFenseAgent-nix | agent/deps/rpm6/Python-2.7.5/lib/python2.7/ctypes/test/test_cast.py | 81 | 3212 | from ctypes import *
import unittest
import sys
class Test(unittest.TestCase):
def test_array2pointer(self):
array = (c_int * 3)(42, 17, 2)
# casting an array to a pointer works.
ptr = cast(array, POINTER(c_int))
self.assertEqual([ptr[i] for i in range(3)], [42, 17, 2])
i... | lgpl-3.0 |
peergradeio/mongoengine-objectidmapfield | setup.py | 1 | 1158 | # -*- coding: utf-8 -*-
from setuptools import find_packages, setup
DESCRIPTION = "A MongoEngine MapField that allows and requires ObjectIds as " \
"keys."
try:
LONG_DESCRIPTION = open('README.md').read()
except:
LONG_DESCRIPTION = DESCRIPTION
setup(
name='mongoengine-objectidmapfield',
... | bsd-3-clause |
kularny/GeniSys.Kernel | toolchain/arm-cortex-a9/share/gcc-4.9.4/python/libstdcxx/v6/printers.py | 56 | 41551 | # Pretty-printers for libstdc++.
# Copyright (C) 2008-2014 Free Software Foundation, 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)... | gpl-2.0 |
bpupadhyaya/kafka | tests/kafkatest/services/verifiable_producer.py | 34 | 3924 | # 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 |
EduPepperPDTesting/pepper2013-testing | common/lib/xmodule/setup.py | 3 | 3346 | from setuptools import setup, find_packages
setup(
name="XModule",
version="0.1",
packages=find_packages(exclude=["tests"]),
install_requires=[
'distribute',
'docopt',
'capa',
'path.py',
],
package_data={
'xmodule': ['js/module/*']
},
# See http:... | agpl-3.0 |
KlaasDeNys/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/euckrfreq.py | 3121 | 45978 | ######################## 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... | lgpl-2.1 |
caseyrygt/osf.io | website/addons/figshare/views/hgrid.py | 39 | 1145 | # -*- coding: utf-8 -*-
from website.util import rubeus
from ..api import Figshare
def figshare_hgrid_data(node_settings, auth, parent=None, **kwargs):
node = node_settings.owner
if node_settings.figshare_type == 'project':
item = Figshare.from_settings(node_settings.user_settings).project(node_setti... | apache-2.0 |
wood-galaxy/FreeCAD | src/Mod/OpenSCAD/OpenSCAD2Dgeom.py | 7 | 21048 | #***************************************************************************
#* *
#* Copyright (c) 2012 Sebastian Hoogen <github@sebastianhoogen.de> *
#* *
#* This pr... | lgpl-2.1 |
leki75/ansible | lib/ansible/modules/network/netvisor/pn_show.py | 59 | 5460 | #!/usr/bin/python
""" PN CLI show commands """
#
# 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 ver... | gpl-3.0 |
SaranyaKarthikeyan/boto | boto/services/service.py | 170 | 6632 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.