repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
hortonworks/hortonworks-sandbox | apps/filebrowser/setup.py | 40 | 1214 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
etingof/pyasn1-modules | tests/test_rfc7292.py | 2 | 8295 | #
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
import unittest
from pyasn1.codec.der.decoder import decode as der_decoder
from pyasn1.codec.der.encoder import encode as der_encoder
f... | bsd-2-clause |
HydrelioxGitHub/home-assistant | homeassistant/components/homekit_controller/alarm_control_panel.py | 1 | 3396 | """Support for Homekit Alarm Control Panel."""
import logging
from homeassistant.components.alarm_control_panel import AlarmControlPanel
from homeassistant.components.homekit_controller import (
KNOWN_ACCESSORIES, HomeKitEntity)
from homeassistant.const import (
ATTR_BATTERY_LEVEL, STATE_ALARM_ARMED_AWAY, STAT... | apache-2.0 |
GuilhermeGSousa/ardupilot | mk/VRBRAIN/Tools/genmsg/test/test_genmsg_names.py | 51 | 4648 | # Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, 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 ... | gpl-3.0 |
chitr/neutron | neutron/db/migration/alembic_migrations/versions/16cdf118d31d_extra_dhcp_options_ipv6_support.py | 22 | 1657 | # Copyright 2015 OpenStack Foundation
#
# 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 ... | apache-2.0 |
zstackio/zstack-woodpecker | integrationtest/vm/multihosts/volumes/paths/ceph_san_path10.py | 1 | 5200 | import zstackwoodpecker.test_state as ts_header
import zstackwoodpecker.operations.resource_operations as res_ops
import random
TestAction = ts_header.TestAction
class VM(object):
def __init__(self, name=None):
self.name = name
self.cloned_name = 'cloned_from_' + self.name
def start(self):
... | apache-2.0 |
kursitet/edx-platform | lms/djangoapps/course_wiki/settings.py | 260 | 1247 | """
These callables are used by django-wiki to check various permissions
a user has on an article.
"""
from course_wiki.utils import user_is_article_course_staff
def CAN_DELETE(article, user): # pylint: disable=invalid-name
"""Is user allowed to soft-delete article?"""
return _is_staff_for_article(article, ... | agpl-3.0 |
faridani/pyDoc | Unidecode/build/lib/unidecode/x0d3.py | 253 | 4705 | data = (
'tim', # 0x00
'tib', # 0x01
'tibs', # 0x02
'tis', # 0x03
'tiss', # 0x04
'ting', # 0x05
'tij', # 0x06
'tic', # 0x07
'tik', # 0x08
'tit', # 0x09
'tip', # 0x0a
'tih', # 0x0b
'pa', # 0x0c
'pag', # 0x0d
'pagg', # 0x0e
'pags', # 0x0f
'pan', # 0x10
'panj', # 0x11
... | mit |
nsfmc/pygments | pygments/token.py | 24 | 5662 | # -*- coding: utf-8 -*-
"""
pygments.token
~~~~~~~~~~~~~~
Basic token types and the standard tokens.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
class _TokenType(tuple):
parent = None
def split(self):
buf = []
... | bsd-2-clause |
stankovski/AutoRest | AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/setup.py | 2 | 1095 | # 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 |
tsunli/statsite | sinks/librato.py | 12 | 8601 | """
Supports flushing statsite metrics to Librato
"""
import sys
import socket
import logging
import ConfigParser
import re
import base64
import urllib2
import json
import os
##
# Librato sink for statsite
# =========================
#
# Use with the following stream command:
#
# stream_cmd = python sinks/librato.py ... | bsd-3-clause |
apark263/tensorflow | tensorflow/python/keras/engine/training_distributed.py | 2 | 24931 | # 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 |
pre-commit/pre-commit | pre_commit/languages/conda.py | 1 | 2838 | import contextlib
import os
from typing import Generator
from typing import Sequence
from typing import Tuple
from pre_commit.envcontext import envcontext
from pre_commit.envcontext import PatchesT
from pre_commit.envcontext import SubstitutionT
from pre_commit.envcontext import UNSET
from pre_commit.envcontext import... | mit |
mgrygoriev/CloudFerry | cloudferrylib/os/actions/convert_image_to_compute.py | 12 | 1418 | # Copyright (c) 2014 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 required by applicable law or agreed to in writing, so... | apache-2.0 |
adsorensen/girder | girder/models/group.py | 3 | 15840 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | apache-2.0 |
rubencabrera/odoo | addons/mail/static/scripts/openerp_mailgate.py | 316 | 7640 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-TODAY OpenERP S.A. (http://www.openerp.com)
#
# This program ... | agpl-3.0 |
eduNEXT/edx-platform | openedx/core/djangoapps/oauth_dispatch/tests/mixins.py | 4 | 3682 | """
OAuth Dispatch test mixins
"""
import pytest
import jwt
from django.conf import settings
from jwkest.jwk import KEYS
from jwkest.jws import JWS
from jwt.exceptions import ExpiredSignatureError
from common.djangoapps.student.models import UserProfile, anonymous_id_for_user
class AccessTokenMixin:
""" Mixin f... | agpl-3.0 |
klmitch/tendril | tendril/framers.py | 1 | 20961 | ## Copyright (C) 2012 by Kevin L. Mitchell <klmitch@mit.edu>
##
## This program is free software: you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation, either version 3 of the
## License, or (at your option) any later version.
##
#... | gpl-3.0 |
initNirvana/Easyphotos | env/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py | 1724 | 14031 | """Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause proble... | mit |
KyleAMoore/KanjiNani | Android/.buildozer/android/platform/build/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a/kivy/kivy/core/clipboard/clipboard_gtk3.py | 23 | 1240 | '''
Clipboard Gtk3: an implementation of the Clipboard using Gtk3.
'''
__all__ = ('ClipboardGtk3',)
from kivy.utils import platform
from kivy.support import install_gobject_iteration
from kivy.core.clipboard import ClipboardBase
if platform != 'linux':
raise SystemError('unsupported platform for gtk3 clipboard')... | gpl-3.0 |
gangadharkadam/saloon_erp_install | erpnext/setup/page/setup_wizard/fixtures/operations.py | 19 | 3525 | # source: http://en.wikipedia.org/wiki/List_of_manufacturing_processes"
from __future__ import unicode_literals
from frappe import _
def get_operations():
return [
_("Centrifugal casting"),
_("Continuous casting"),
_("Die casting"),
_("Evaporative-pattern casting"),
_("Full-mold casting"),
_("Lost-foam c... | agpl-3.0 |
DriverCity/SPARK | src/cloud/parking_event_repo.py | 1 | 8631 | import json
from itertools import groupby
from firebase_repo import FirebaseRepo
from utils import TimeUtils
class ParkingEventRepository(FirebaseRepo):
"""
A repository for storing and receiving parking events on Firebase
"""
# ODS node is the node which is synchronised by parking attendant app
... | mit |
KevZho/mallbot | kol/request/ClanRaidLogRequest.py | 3 | 3485 | from GenericRequest import GenericRequest
from kol.manager import PatternManager
from datetime import datetime
class ClanRaidLogRequest(GenericRequest):
"""
This class retrieves a list of old raid logs that the clan has completed. In addition, it also
returns information about any given raid instance.
... | mit |
dhgarrette/cnn | pyexamples/xor.py | 4 | 1510 | from pycnn import *
#xsent = True
xsent = False
HIDDEN_SIZE = 8
ITERATIONS = 2000
m = Model()
sgd = SimpleSGDTrainer(m)
m.add_parameters("W",(HIDDEN_SIZE, 2))
m.add_parameters("b",HIDDEN_SIZE)
m.add_parameters("V",(1, HIDDEN_SIZE))
m.add_parameters("a",1)
W = parameter(m["W"])
b = parameter(m["b"])
V = parameter(m... | apache-2.0 |
dragosbdi/bitcredit-2.0 | qa/rpc-tests/test_framework/netutil.py | 1 | 4569 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcredit Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Linux network utilities
import sys
import socket
import fcntl
import struct
import array
import os
im... | mit |
rkarpuzov/Aurumcoin-0.12 | qa/rpc-tests/mempool_packages.py | 24 | 8960 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Test descendant package tracking code
from test_framework.test_framework import BitcoinTestFramework
f... | mit |
ptchankue/youtube-dl | youtube_dl/extractor/ccc.py | 107 | 3890 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
qualities,
unified_strdate,
)
class CCCIE(InfoExtractor):
IE_NAME = 'media.ccc.de'
_VALID_URL = r'https?://(?:www\.)?media\.ccc\.de/[^?#]+/[^?#/]*?_(?P<id>[0-9]{8,})._[^?#/]*\.h... | unlicense |
klahnakoski/jx-sqlite | vendor/mo_threads/python.py | 1 | 4720 | # encoding: utf-8
#
# 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, division... | mpl-2.0 |
paoloach/cc2530sim | googletest/googletest/scripts/release_docs.py | 1167 | 6132 | #!/usr/bin/env python
#
# Copyright 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | gpl-2.0 |
florianholzapfel/home-assistant | homeassistant/components/light/osramlightify.py | 11 | 8096 | """
Support for Osram Lightify.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.osramlightify/
"""
import logging
import socket
import random
from datetime import timedelta
import voluptuous as vol
from homeassistant import util
from homeassistant... | mit |
KMK-ONLINE/ansible | contrib/inventory/rax.py | 34 | 16010 | #!/usr/bin/env python
# (c) 2013, Jesse Keating <jesse.keating@rackspace.com,
# Paul Durivage <paul.durivage@rackspace.com>,
# Matt Martz <matt@sivel.net>
#
# 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 Pu... | gpl-3.0 |
EDUlib/edx-platform | common/djangoapps/edxmako/request_context.py | 4 | 1586 | # Copyright (c) 2008 Mikeal Rogers
#
# 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 agre... | agpl-3.0 |
tpham3783/openwrt | scripts/dl_cleanup.py | 177 | 5942 | #!/usr/bin/env python
"""
# OpenWrt download directory cleanup utility.
# Delete all but the very last version of the program tarballs.
#
# Copyright (C) 2010 Michael Buesch <mb@bu3sch.de>
# Copyright (C) 2013 OpenWrt.org
"""
import sys
import os
import re
import getopt
# Commandline options
opt_dryrun = False
def ... | gpl-2.0 |
kawasaki2013/python-for-android-x86 | python3-alpha/python3-src/Lib/test/test_linecache.py | 60 | 4141 | """ Tests for the linecache module """
import linecache
import unittest
import os.path
from test import support
FILENAME = linecache.__file__
INVALID_NAME = '!@$)(!@#_1'
EMPTY = ''
TESTS = 'inspect_fodder inspect_fodder2 mapping_tests'
TESTS = TESTS.split()
TEST_PATH = os.path.dirname(support.__file__)
MODULES = "li... | apache-2.0 |
shanil-puri/mase | python101/code/Lumpy.py | 14 | 48314 | #!/usr/bin/python
"""This module is part of Swampy, a suite of programs available from
allendowney.com/swampy.
Copyright 2010 Allen B. Downey
Distributed under the GNU General Public License at gnu.org/licenses/gpl.html.
UML diagrams for Python
Lumpy generates UML diagrams (currently object and class diagrams)
fro... | unlicense |
opennetworkinglab/OpenVirteX | utils/api_test.py | 11 | 6916 | echo "*****************************"
echo "***** VIRTUAL NETWORK 1 *****"
echo "*****************************"
echo ""
echo ""
./ovxctl.py -n createNetwork tcp 192.168.255.1 10000 192.168.0.0 16
./ovxctl.py -n createSwitch 1 00:00:00:00:00:00:00:6b,00:00:00:00:00:00:00:6c,00:00:00:00:00:00:00:73,00:00:00:00:00:00:00:74... | apache-2.0 |
kayarre/Tools | vtk/fluent2vtk.py | 1 | 3499 | import vtk
from glob import glob
import os
### THIS DOESN"T WORK!
file_path = "/raid/home/ksansom/caseFiles/mri/PAD_proj/case1/fluent3/"
out_dir = "/raid/home/ksansom/caseFiles/mri/PAD_proj/case1/fluent3/vtk_out"
wall = True
surface = True
file_pattern = "TH_0_PATIENT7100_M-3-?.????.dat"
filelist = sorted(glob(os.pa... | bsd-2-clause |
pitunti/alfaPitunti | plugin.video.alfa/channels/pepecine.py | 1 | 17392 | # -*- coding: utf-8 -*-
import re
import urlparse
from core import httptools
from core import jsontools
from core import scrapertools
from core import servertools
from core import tmdb
from core.item import Item, InfoLabels
from platformcode import config, logger
__url_base__ = "http://pepecine.net"
__chanel__ = "pe... | gpl-3.0 |
rajul/tvb-library | tvb/basic/traits/types_basic.py | 2 | 12063 | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://ww... | gpl-2.0 |
bzennn/blog_flask | python/lib/python3.5/site.py | 784 | 27543 | """Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... | gpl-3.0 |
JakeLowey/HackRPI2 | django/core/files/uploadedfile.py | 402 | 4225 | """
Classes representing uploaded files.
"""
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.core.files.base import File
from django.core.files import temp as tempfile
from django.utils.encoding import smart_str
__al... | mit |
sprockets/sprockets.http | sprockets/http/app.py | 1 | 9857 | import asyncio
import logging
import sys
import warnings
from tornado import concurrent, web
class _ShutdownHandler:
"""Keeps track of the application state during shutdown."""
def __init__(self, io_loop, shutdown_limit, wait_timeout):
self.io_loop = io_loop
self.logger = logging.getLogger(s... | bsd-3-clause |
kavanj/marioai | src/amico/python/agents/DemoForwardJumpingAgent.py | 1 | 4694 | # -*- coding: utf-8 -*-
__author__ = "Sergey Karakovskiy, sergey at idsia fullstop ch"
__date__ = "$${date} ${time}$"
import sys
import os
import ctypes
from ctypes import *
from ctypes import POINTER
from ctypes import c_int
from ctypes import py_object
from ctypes.util import find_library
from forwardjumpingagent ... | bsd-3-clause |
google/NeuroNER-CSPMC | neuroner/scripts/share_model.py | 1 | 1815 | #!/usr/bin/env python3
# Lint as: python3
# MIT License
#
# Copyright 2019 Google LLC
# Copyright (c) 2019 Franck Dernoncourt, Jenny Lee, Tom Pollard
#
# 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... | mit |
gmittal/aar-nlp-research-2016 | src/pygame-pygame-6625feb3fc7f/test/key_test.py | 18 | 4862 | if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.split(parent_dir)[1] == 'pygame')
if not is_pygame_pkg:
sys.path.inser... | mit |
arcolife/django-scholarec | scholarec_web/social/apps/django_app/me/models.py | 4 | 4227 | """
MongoEngine models for Social Auth
Requires MongoEngine 0.6.10
"""
import six
from django.conf import settings
from mongoengine import DictField, Document, IntField, ReferenceField, \
StringField, EmailField, BooleanField
from mongoengine.queryset import OperationError
from social.utils ... | gpl-3.0 |
JorgeCoock/django | django/conf/locale/el/formats.py | 446 | 1477 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd/m/Y'
TIME_FORMAT = 'P'
DATETIME... | bsd-3-clause |
lamby/pkg-reinteract | lib/reinteract/tokenized_statement.py | 1 | 30010 | # Copyright 2007-2009 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import inspect
from retokenize import *
# These... | bsd-2-clause |
gymnasium/edx-platform | cms/djangoapps/contentstore/management/commands/tests/test_force_publish.py | 52 | 4836 | """
Tests for the force_publish management command
"""
import mock
from django.core.management import call_command, CommandError
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase, ModuleStoreTestCase
from xmodule.modulestore.tests.factories impo... | agpl-3.0 |
RonnyPfannschmidt/pytest | src/_pytest/mark/expression.py | 2 | 6428 | r"""Evaluate match expressions, as used by `-k` and `-m`.
The grammar is:
expression: expr? EOF
expr: and_expr ('or' and_expr)*
and_expr: not_expr ('and' not_expr)*
not_expr: 'not' not_expr | '(' expr ')' | ident
ident: (\w|:|\+|-|\.|\[|\])+
The semantics are:
- Empty expression evaluates to False.
-... | mit |
Wingless-Archangel/spiderfoot | ext/dns/rdtypes/ANY/HIP.py | 100 | 4957 | # Copyright (C) 2010, 2011 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 "AS IS" AND... | gpl-2.0 |
shantanu561993/volatility | volatility/plugins/malware/apihooks.py | 12 | 47139 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# Authors:
# Michael Hale Ligh <michael.ligh@mnin.org>
#
# This file is part of Volatility.
#
# Volatility 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 Fou... | gpl-2.0 |
brianwc/courtlistener | cl/favorites/migrations/0001_initial.py | 1 | 1565 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('audio', '0001_initial'),
migrations.swappable_dependency(settings.AUTH... | agpl-3.0 |
tajinder-txstate/lenskit | lenskit-integration-tests/src/it/gradle/external-algorithms/item-mean.py | 9 | 2714 | import sys
class ItemMeanData(object):
def __init__(self):
self.global_sum = 0
self.global_count = 0
self.item_sums = {}
self.item_counts = {}
def train(self, trainfile):
with open(trainfile) as f:
for line in f:
user, item, rating = line.st... | lgpl-2.1 |
shaistaansari/django | django/middleware/gzip.py | 478 | 1831 | import re
from django.utils.cache import patch_vary_headers
from django.utils.text import compress_sequence, compress_string
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(object):
"""
This middleware compresses content if the browser allows gzip compression.
It sets the Vary header acco... | bsd-3-clause |
vovojh/gem5 | src/arch/mips/MipsTLB.py | 69 | 1846 | # -*- mode:python -*-
# Copyright (c) 2007 MIPS Technologies, 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 ... | bsd-3-clause |
gusDuarte/sugar-toolkit-gtk3 | src/sugar3/presence/activity.py | 2 | 30145 | # Copyright (C) 2007, Red Hat, Inc.
# Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
#
# This library 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 Software Foundation; either
# version 2 of the License, ... | lgpl-2.1 |
paninetworks/neutron | neutron/agent/l3_agent.py | 24 | 1967 | # Copyright (c) 2015 OpenStack Foundation.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | apache-2.0 |
mluo613/osf.io | tests/test_models.py | 2 | 194405 | # -*- coding: utf-8 -*-
'''Unit tests for models and their factories.'''
import datetime
import json
import os.path
import random
import string
import unittest
import urllib
import urlparse
import itsdangerous
import mock
import pytz
from dateutil import parser
from django.utils import timezone
from framework.analytic... | apache-2.0 |
phobson/statsmodels | statsmodels/genmod/cov_struct.py | 1 | 47404 | from statsmodels.compat.python import iterkeys, itervalues, zip, range
from statsmodels.stats.correlation_tools import cov_nearest
import numpy as np
import pandas as pd
from scipy import linalg as spl
from collections import defaultdict
from statsmodels.tools.sm_exceptions import (ConvergenceWarning, OutputWarning,
... | bsd-3-clause |
ravindrapanda/tensorflow | tensorflow/python/kernel_tests/embedding_ops_test.py | 48 | 34477 | # 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 |
aaugustin/websockets | experiments/authentication/app.py | 1 | 5614 | #!/usr/bin/env python
import asyncio
import http
import http.cookies
import pathlib
import signal
import urllib.parse
import uuid
import websockets
# User accounts database
USERS = {}
def create_token(user, lifetime=1):
"""Create token for user and delete it once its lifetime is over."""
token = uuid.uui... | bsd-3-clause |
brmscheiner/ideogram | ideogram/writer.py | 1 | 8468 | import json, os, random
def jsPath(path):
'''Returns a relative path without \, -, and . so that
the string will play nicely with javascript.'''
shortPath=path.replace(
"C:\\Users\\scheinerbock\\Desktop\\"+
"ideogram\\scrapeSource\\test\\","")
noDash = shortPath.replace("-","_d... | mit |
zhimin711/nova | nova/db/sqlalchemy/migrate_repo/versions/278_remove_service_fk_in_compute_nodes.py | 81 | 2799 | # Copyright (c) 2015 Red Hat, 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 require... | apache-2.0 |
Kingdread/sgl | sgl/draw.py | 1 | 4550 | # -*- coding: utf-8 -*-
import math
from .line import Line
from .point import Point
from .vector import Vector
def draw_parallels(renderer, box, start, count, direction, delta,
color=(0.7, 0.7, 0.7), opacity=0.5):
"""Draw count parallel lines, pointing in direction, starting at
start and cha... | gpl-3.0 |
winking324/OmnittyForMac | 3rdparty/log4cplus-2.0.0-rc1/catch/scripts/releaseCommon.py | 15 | 2967 | from __future__ import print_function
import os
import sys
import re
import string
from scriptCommon import catchPath
versionParser = re.compile( r'(\s*Version\slibraryVersion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*,\s*(.*)\s*\).*' )
rootPath = os.path.join( catchPath, 'include/' )
versionPath = os.pa... | gpl-2.0 |
CrushAndRun/Cloudbot-Fluke | cloudbot/hook.py | 9 | 10157 | import inspect
import re
import collections
from cloudbot.event import EventType
valid_command_re = re.compile(r"^\w+$")
class _Hook():
"""
:type function: function
:type type: str
:type kwargs: dict[str, unknown]
"""
def __init__(self, function, _type):
"""
:type function: ... | gpl-3.0 |
tutumcloud/django-registration | registration/views.py | 49 | 4888 | """
Views which allow users to create and activate accounts.
"""
from django.shortcuts import redirect
from django.views.generic.base import TemplateView
from django.views.generic.edit import FormView
from registration import signals
from registration.forms import RegistrationForm
class _RequestPassingFormView(For... | bsd-3-clause |
hyperized/ansible | lib/ansible/modules/network/nxos/nxos_snmp_host.py | 68 | 15264 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
mozilla/olympia | src/olympia/addons/tests/test_utils_.py | 2 | 5300 | # -*- coding: utf-8 -*-
from unittest import mock
import pytest
from django.conf import settings
from django.forms import ValidationError
from olympia.addons.utils import (
get_addon_recommendations,
get_addon_recommendations_invalid,
is_outcome_recommended,
TAAR_LITE_FALLBACK_REASON_EMPTY,
TAAR_L... | bsd-3-clause |
jamiefolsom/edx-platform | manage.py | 188 | 3930 | #!/usr/bin/env python
"""
Usage: manage.py {lms|cms} [--settings env] ...
Run django management commands. Because edx-platform contains multiple django projects,
the first argument specifies which project to run (cms [Studio] or lms [Learning Management System]).
By default, those systems run in with a settings file ... | agpl-3.0 |
ekasitk/sahara | sahara/tests/unit/service/test_ntp_service.py | 3 | 3595 | # Copyright (c) 2015 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 required by applicable law or agreed to in writ... | apache-2.0 |
Distrotech/binutils | gdb/testsuite/gdb.perf/backtrace.py | 41 | 1825 | # Copyright (C) 2013-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) any later version.
#
# This progr... | gpl-2.0 |
ajitmathew/pcap-parser | pcapparser/httpparser.py | 5 | 9824 | from __future__ import unicode_literals, print_function, division
from collections import defaultdict
from pcapparser import utils
from pcapparser.constant import HttpType, Compress
from pcapparser.reader import DataReader
from pcapparser import config
__author__ = 'dongliu'
class HttpRequestHeader(object):
d... | bsd-3-clause |
Kodagrux/Leap2Arduino2Tx | ValueHandler.py | 1 | 1739 | import math
class ValueHandler():
# Init
def __init__(self, parameter):
self.parameter = parameter
# Main function for getting the correct values
def getOutput(self, channelValue, channel):
return int(round(self.mapValue(self.calcDualRate(self.calcExponential(self.calcEndpoints(channelValue), channel), c... | lgpl-3.0 |
hamogu/marxs | marxs/math/tests/test_geometry.py | 1 | 10807 | # Licensed under GPL version 3 - see LICENSE.rst
import numpy as np
from numpy.core.umath_tests import inner1d
import transforms3d
import transforms3d.euler
import pytest
from ..geometry import Cylinder, FinitePlane
from ...math.utils import h2e
def test_intersect_plane_forwards():
pos = np.array([[20., 0., 0.8... | gpl-3.0 |
saurabhjn76/sympy | sympy/core/tests/test_numbers.py | 26 | 48965 | import decimal
from sympy import (Rational, Symbol, Float, I, sqrt, oo, nan, pi, E, Integer,
S, factorial, Catalan, EulerGamma, GoldenRatio, cos, exp,
Number, zoo, log, Mul, Pow, Tuple, latex, Gt, Lt, Ge, Le,
AlgebraicNumber, simplify)
from sympy.core.compatibili... | bsd-3-clause |
faridani/pyDoc | Unidecode/unidecode/x05a.py | 252 | 4636 | data = (
'Song ', # 0x00
'Wei ', # 0x01
'Hong ', # 0x02
'Wa ', # 0x03
'Lou ', # 0x04
'Ya ', # 0x05
'Rao ', # 0x06
'Jiao ', # 0x07
'Luan ', # 0x08
'Ping ', # 0x09
'Xian ', # 0x0a
'Shao ', # 0x0b
'Li ', # 0x0c
'Cheng ', # 0x0d
'Xiao ', # 0x0e
'Mang ', # 0x0f
'Fu ', # 0x1... | mit |
Nick-OpusVL/odoo | addons/board/__openerp__.py | 261 | 1647 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
doakey3/Subsimport | __init__.py | 1 | 8929 | import bpy
from .operators import *
bl_info = {
"name": "Subsimport",
"description": "Import subtitles into blender",
"author": "doakey3",
"version": (1, 3, 1),
"blender": (2, 80, 0),
"wiki_url": "https://github.com/doakey3/subsimport",
"tracker_url": "https://github.com/doakey3/s... | gpl-3.0 |
MihaiMoldovanu/ansible | test/units/plugins/action/test_action.py | 14 | 26512 | # -*- coding: utf-8 -*-
# (c) 2015, Florian Apolloner <florian@apolloner.eu>
#
# 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 |
gameduell/duell | bin/win/python2.7.9/Lib/ctypes/macholib/framework.py | 268 | 2414 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
Generic framework path manipulation
"""
import re
__all__ = ['framework_info']
STRICT_FRAMEWORK_RE =... | bsd-2-clause |
Jimmy-Morzaria/scikit-learn | sklearn/cluster/dbscan_.py | 7 | 10968 | # -*- coding: utf-8 -*-
"""
DBSCAN: Density-Based Spatial Clustering of Applications with Noise
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Joel Nothman <joel.nothman@gmail.com>
# Lars Buitinck
#
# License: BSD 3 clause
import warnings
import numpy as np
from ..base import BaseEstimator, ... | bsd-3-clause |
sklnet/openhdf-enigma2 | lib/python/Plugins/SystemPlugins/DeviceManager/ExtraMessageBox.py | 19 | 4039 | from enigma import *
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Sources.List import List
from Tools.Directories import resolveFilename, SCOPE_CURRENT_PLUGIN
from Tools.LoadPixmap import LoadPixmap
from Components.Label import Label
def MessageBoxEntry(name, picture):
... | gpl-2.0 |
CydarLtd/ansible | lib/ansible/modules/cloud/vmware/vmware_guest_snapshot.py | 30 | 10985 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This module is also sponsored by E.T.A.I. (www.etai.fr)
#
# 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... | gpl-3.0 |
instantchow/home-assistant | homeassistant/components/shell_command.py | 4 | 1211 | """
Exposes regular shell commands as services.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/shell_command/
"""
import logging
import subprocess
from homeassistant.util import slugify
DOMAIN = 'shell_command'
_LOGGER = logging.getLogger(__name__)
... | mit |
ywcui1990/nupic.research | htmresearch/encoders/sound_encoder.py | 10 | 3429 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, 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... | agpl-3.0 |
EoD/apitrace | retrace/retrace.py | 4 | 24554 | ##########################################################################
#
# Copyright 2010 VMware, Inc.
# 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 res... | mit |
clement/django-clement | django_clement/templatetags/clement.py | 1 | 4686 | """
Template filters used in `moderation` application
HTML templates. Mainly utility functions.
"""
import json
from django_clement.template import template_function
from django_clement.conf import settings
from django import template
from django.utils.html import conditional_escape
from django.utils.safestring import... | mit |
drayanaindra/shoop | shoop/admin/modules/shops/__init__.py | 5 | 1314 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from shoop.admin.base import AdminMo... | agpl-3.0 |
cr/fxos-certsuite | web-platform-tests/tests/tools/pywebsocket/src/mod_pywebsocket/msgutil.py | 658 | 7598 | # Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
hasteur/hasteurbot_task_3 | family.py | 3 | 242062 | # -*- coding: utf-8 -*-
#
# (C) Pywikipedia bot team, 2004-2013
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import re
import urllib
from datetime import timedelta, datetime
import config
import wikipedia as pywikibot
# Parent class for all wiki families
class Family(object):
def... | gpl-2.0 |
jiguoling/enjarify | enjarify/mutf8.py | 35 | 1760 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
endlessm/system-config-printer | SearchCriterion.py | 9 | 1348 | ## Copyright (C) 2008 Rui Matos <tiagomatos@gmail.com>
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## This pro... | gpl-2.0 |
lpantano/bcbio-nextgen | bcbio/structural/convert.py | 6 | 3999 | """Handle conversions between structural variant formats.
"""
import os
import pybedtools
import vcf
from bcbio import utils
from bcbio.distributed.transaction import file_transaction
from bcbio.provenance import do
from bcbio.variation import vcfutils
# ## Conversions to simplified BED files
MAX_SVSIZE = 1e6 # 1M... | mit |
proxysh/Safejumper-for-Mac | buildmac/Resources/env/lib/python2.7/site-packages/yaml/constructor.py | 391 | 25145 |
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',
'ConstructorError']
from error import *
from nodes import *
import datetime
import binascii, re, sys, types
class ConstructorError(MarkedYAMLError):
pass
class BaseConstructor(object):
yaml_constructors = {}
yaml_multi_constructors =... | gpl-2.0 |
lanyuwen/openthread | tools/harness-automation/cases/router_5_2_1.py | 18 | 1877 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# notic... | bsd-3-clause |
MarkWh1te/xueqiu_predict | p3_env/lib/python3.5/site-packages/pip/_vendor/colorama/initialise.py | 485 | 1917 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import contextlib
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = None
orig_stderr = None
wrapped_stdout = None
wrapped_stderr = None
atexit_done = False
def reset_all():
if AnsiToWin32 is not None: # Is... | mit |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/cffi-1.1.2/doc/source/conf.py | 3 | 6332 | # -*- coding: utf-8 -*-
#
# CFFI documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 14 16:37:47 2012.
#
# 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.
#
# All co... | mit |
PrehistoricTeam/pycrypt | pycrypt/translators/morsecodetranslator.py | 1 | 2025 | import translator
from .. import utils
from collections import OrderedDict
import numpy as np
class MorseCodeTranslator(translator.Translator):
"""Morse Code, translation formats: .-//-... ; ., ,... ; [[0,1],[1,0,0,0]]"""
key = {
'': ' ',
'.----.': '\'',
'-.--.': ')',
'-.--.-': '(',
'-....-': '-',
... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.