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 |
|---|---|---|---|---|---|
turbokongen/home-assistant | homeassistant/components/vacuum/__init__.py | 16 | 11808 | """Support for vacuum cleaner robots (botvacs)."""
from datetime import timedelta
from functools import partial
import logging
import voluptuous as vol
from homeassistant.const import ( # noqa: F401 # STATE_PAUSED/IDLE are API
ATTR_BATTERY_LEVEL,
ATTR_COMMAND,
SERVICE_TOGGLE,
SERVICE_TURN_OFF,
SE... | apache-2.0 |
srvg/ansible-modules-extras | network/f5/bigip_routedomain.py | 32 | 16675 | #!/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 |
robbiet480/home-assistant | tests/components/homekit_controller/specific_devices/test_ecobee_occupancy.py | 7 | 1323 | """
Regression tests for Ecobee occupancy.
https://github.com/home-assistant/home-assistant/issues/31827
"""
from tests.components.homekit_controller.common import (
Helper,
setup_accessories_from_file,
setup_test_accessories,
)
async def test_ecobee_occupancy_setup(hass):
"""Test that an Ecbobee oc... | apache-2.0 |
citrix-openstack-build/heat | heat/tests/test_vpc.py | 5 | 28455 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 |
0Chencc/CTFCrackTools | Lib/Lib/xmllib.py | 227 | 34865 | """A parser for XML, using the derived class as static DTD."""
# Author: Sjoerd Mullender.
import re
import string
import warnings
warnings.warn("The xmllib module is obsolete. Use xml.sax instead.",
DeprecationWarning, 2)
del warnings
version = '0.3'
class Error(RuntimeError):
pass
# Regular e... | gpl-3.0 |
datajoint/datajoint-python | tests/test_privileges.py | 2 | 1416 | from nose.tools import assert_true, raises
import datajoint as dj
from . import schema, CONN_INFO
namespace = locals()
class TestUnprivileged:
@classmethod
def setup_class(cls):
"""A connection with only SELECT privilege to djtest schemas"""
cls.connection = dj.conn(host=CONN_INFO['host'], u... | lgpl-2.1 |
suhussai/youtube-dl | youtube_dl/extractor/wimp.py | 65 | 1839 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .youtube import YoutubeIE
class WimpIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?wimp\.com/([^/]+)/'
_TESTS = [{
'url': 'http://www.wimp.com/maruexhausted/',
'md5': 'f1acced123ecb28d9bb79f2479f2b6a... | unlicense |
jordij/wagtail | wagtail/wagtailsearch/models.py | 9 | 2902 | from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailsearch.utils import normalise_query_string, MAX_QUERY_STRING... | bsd-3-clause |
greenhost/viper | viper/provider/__init__.py | 1 | 1457 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Greenhost VOF
# https://greenhost.nl -\- https://greenhost.io
#
# 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, eithe... | gpl-3.0 |
stethewwolf/Sapy | sapy_modules/gui/gtk/dialogs/__init__.py | 1 | 1885 | # Sapy
# Copyright (C) 2018 stefano prina <stefano-prina@outlook.it> <stethewwolf@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 3 of the License, or
# (at your opt... | mit |
dennybaa/st2contrib | packs/email/sensors/imap_sensor.py | 2 | 3392 | import eventlet
import easyimap
from flanker import mime
from st2reactor.sensor.base import PollingSensor
__all__ = [
'IMAPSensor'
]
eventlet.monkey_patch(
os=True,
select=True,
socket=True,
thread=True,
time=True)
class IMAPSensor(PollingSensor):
def __init__(self, sensor_service, conf... | apache-2.0 |
AOSPU/external_chromium_org | tools/deep_memory_profiler/lib/dump.py | 12 | 15534 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import datetime
import logging
import os
import re
import time
from lib.bucket import BUCKET_ID
from lib.exceptions import EmptyDumpException, I... | bsd-3-clause |
iulian787/spack | var/spack/repos/builtin/packages/aocc/package.py | 1 | 3072 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Aocc(Package):
'''
The AOCC compiler system is a high performance,
production qua... | lgpl-2.1 |
mikedanese/test-infra | gubernator/regex.py | 7 | 1750 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
novaksam/python-jss | jss/contrib/requests/packages/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
MattRijk/django-ecomsite | lib/python2.7/site-packages/django/contrib/sessions/backends/db.py | 101 | 2929 | import logging
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation
from django.db import IntegrityError, transaction, router
from django.utils import timezone
from django.utils.encoding import force_text
class SessionStore(SessionBase):
... | cc0-1.0 |
thnee/ansible | test/units/modules/network/nxos/test_nxos_ospf.py | 23 | 2029 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
aiguofer/bokeh | examples/app/gapminder/main.py | 3 | 2668 | # -*- coding: utf-8 -*-
import pandas as pd
from bokeh.core.properties import field
from bokeh.io import curdoc
from bokeh.layouts import layout
from bokeh.models import (
ColumnDataSource, HoverTool, SingleIntervalTicker, Slider, Button, Label,
CategoricalColorMapper,
)
from bokeh.palettes import Spectral6
fr... | bsd-3-clause |
tshrinivasan/open-tamil | examples/wordxsec.py | 3 | 2497 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (C) 2015 Muthiah Annamalai
import copy, random
import tamil
from sys import version
PYTHON3 = version > '3'
# compute word intersection graph of the a wordlist
# optimized for using the symmetry in computation but not space
class WordXSec:
@staticmethod
... | mit |
marckuz/django | django/contrib/gis/db/backends/spatialite/operations.py | 257 | 11441 | """
SQL functions reference lists:
http://www.gaia-gis.it/spatialite-2.4.0/spatialite-sql-2.4.html
http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html
http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html
"""
import re
import sys
from django.contrib.gis.db.backends.base.operations import \
... | bsd-3-clause |
bdelliott/wordgame | web/django/views/generic/dates.py | 5 | 19345 | import time
import datetime
from django.db import models
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from django.views.generic.base import View
from django.views.generic.detail import BaseDetailView, SingleObjectTemplateResponseMixin
from django.views.generic.list import Mult... | mit |
emon10005/sympy | sympy/solvers/inequalities.py | 25 | 17580 | """Tools for solving inequalities and systems of inequalities. """
from __future__ import print_function, division
from sympy.core import Symbol, Dummy
from sympy.core.compatibility import iterable, reduce
from sympy.sets import Interval
from sympy.core.relational import Relational, Eq, Ge, Lt
from sympy.sets.sets im... | bsd-3-clause |
jmartinm/invenio | modules/websession/lib/webuser_regression_tests.py | 16 | 11178 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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
## Licens... | gpl-2.0 |
arjunsinghy96/coala | tests/bearlib/spacing/SpacingHelperTest.py | 34 | 4419 | import unittest
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
from coalib.settings.Section import Section
class SpacingHelperTest(unittest.TestCase):
def setUp(self):
self.uut = SpacingHelper()
def test_needed_settings(self):
self.assertEqual(list(self.uut.get_optional_sett... | agpl-3.0 |
lorenzo-desantis/mne-python | examples/inverse/plot_make_inverse_operator.py | 21 | 3232 | """
===============================================================
Assemble inverse operator and compute MNE-dSPM inverse solution
===============================================================
Assemble M/EEG, MEG, and EEG inverse operators and compute dSPM
inverse solution on MNE evoked dataset and stores the solut... | bsd-3-clause |
LLNL/spack | lib/spack/spack/pkgkit.py | 2 | 2272 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
# flake8: noqa: F401
"""pkgkit is a set of useful build tools and directives for packages.
Everything in this module is a... | lgpl-2.1 |
ProtractorNinja/qutebrowser | tests/unit/commands/test_runners.py | 7 | 1488 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 Softwa... | gpl-3.0 |
jcpowermac/ansible | lib/ansible/modules/cloud/amazon/_ec2_ami_find.py | 8 | 14002 | #!/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': ['deprecated']... | gpl-3.0 |
hozn/coilmq | coilmq/store/sa/__init__.py | 3 | 7182 | """
Queue storage module that uses SQLAlchemy to access queue information and frames in a database.
"""
import threading
import logging
import os
import os.path
import shelve
from collections import deque
from datetime import datetime, timedelta
# try:
# from configparser import ConfigParser
# except ImportError... | apache-2.0 |
nvoron23/statsmodels | statsmodels/base/_constraints.py | 26 | 10377 | # -*- coding: utf-8 -*-
"""
Created on Thu May 15 16:36:05 2014
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
class TransformRestriction(object):
"""Transformation for linear constraints `R params = q`
Note, the transformation from the reduced to the full parameters is an
affine and not... | bsd-3-clause |
galaxyproject/pulsar | pulsar/managers/util/external.py | 6 | 1103 | from re import search
EXTERNAL_ID_TYPE_ANY = None
EXTERNAL_ID_PATTERNS = [
('condor', r'submitted to cluster (\d+)\.'),
('slurm', r'Submitted batch job (\w+)'),
('torque', r'(.+)'), # Default 'pattern' assumed by Galaxy code circa August 2013.
]
def parse_external_id(output, type=EXTERNAL_ID_TYPE_ANY):... | apache-2.0 |
ptrendx/mxnet | example/neural-style/end_to_end/gen_v4.py | 27 | 3955 | # 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 |
PurrfectDream/notepad-plus-plus | scintilla/qt/ScintillaEditPy/sepbuild.py | 54 | 11780 | import distutils.sysconfig
import getopt
import glob
import os
import platform
import shutil
import subprocess
import stat
import sys
sys.path.append(os.path.join("..", "ScintillaEdit"))
import WidgetGen
scintillaDirectory = "../.."
scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")... | gpl-2.0 |
snap-stanford/ogb | examples/nodeproppred/products/node2vec.py | 1 | 2074 | import argparse
import torch
from torch_geometric.nn import Node2Vec
from ogb.nodeproppred import PygNodePropPredDataset
def save_embedding(model):
torch.save(model.embedding.weight.data.cpu(), 'embedding.pt')
def main():
parser = argparse.ArgumentParser(description='OGBN-Products (Node2Vec)')
parser.... | mit |
Cue/eventlet | examples/twisted/twisted_portforward.py | 8 | 1158 | """Port forwarder
USAGE: twisted_portforward.py local_port remote_host remote_port"""
import sys
from twisted.internet import reactor
from eventlet.twistedutil import join_reactor
from eventlet.twistedutil.protocol import GreenClientCreator, SpawnFactory, UnbufferedTransport
from eventlet import proc
def forward(sourc... | mit |
migonzalvar/youtube-dl | youtube_dl/extractor/ted.py | 115 | 10646 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import int_or_none
class TEDIE(InfoExtractor):
IE_NAME = 'ted'
_VALID_URL = r'''(?x)
(?P<proto>https?://)
(?P<type>www|embed(?:-ssl)?)(?P<urlmain>\.te... | unlicense |
NeovaHealth/odoo | addons/board/board.py | 175 | 6654 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
timchen86/ntulifeguardapp | gdata-2.0.18/samples/apps/multidomain_quick_start_example.py | 22 | 13180 | #!/usr/bin/python2.4
#
# Copyright 2011 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 |
firebitsbr/infernal-twin | build/reportlab/build/lib.linux-i686-2.7/reportlab/lib/textsplit.py | 32 | 9741 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/textsplit.py
"""Helpers for text wrapping, hyphenation, Asian text splitting and kinsoku shori.
How to split a 'big word' depends on the language... | gpl-3.0 |
fredericlepied/ansible | lib/ansible/modules/network/avi/avi_serviceengine.py | 8 | 5728 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
#
# 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... | gpl-3.0 |
mkaluza/external_chromium_org | native_client_sdk/src/tools/tests/sel_ldr_test.py | 104 | 2080 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.dirname(SCRIPT_DIR)
... | bsd-3-clause |
Yannig/ansible | lib/ansible/plugins/action/aireos.py | 16 | 3267 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
GanjaNoel/pym2 | wdt/wdteditor.py | 2 | 11345 | # -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
import sys
if sys.version_info < (3,0):
import ConfigParser as configparser
#import _winreg as winreg
else:
import configparser
#import winreg
import os
from wowfile import *
from wdt import *
class WDTEditor(QtGui.QMainWindow):
def _... | lgpl-3.0 |
snakeleon/YouCompleteMe-x86 | third_party/ycmd/third_party/requests/requests/packages/chardet/eucjpprober.py | 2919 | 3678 | ######################## 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... | gpl-3.0 |
pgarridounican/ns-3.20-NC | src/point-to-point-layout/bindings/modulegen__gcc_ILP32.py | 14 | 468963 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
glwu/python-for-android | python-build/python-libs/gdata/src/gdata/Crypto/Protocol/Chaffing.py | 226 | 9467 | """This file implements the chaffing algorithm.
Winnowing and chaffing is a technique for enhancing privacy without requiring
strong encryption. In short, the technique takes a set of authenticated
message blocks (the wheat) and adds a number of chaff blocks which have
randomly chosen data and MAC fields. This means... | apache-2.0 |
agry/NGECore2 | scripts/mobiles/tatooine/tormented_bocatt.py | 2 | 1713 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | lgpl-3.0 |
daxxi13/CouchPotatoServer | libs/chardet/latin1prober.py | 950 | 5241 | ######################## 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 |
fmarier/letsencrypt | letsencrypt-apache/letsencrypt_apache/configurator.py | 14 | 47581 | """Apache Configuration based off of Augeas Configurator."""
# pylint: disable=too-many-lines
import itertools
import logging
import os
import re
import shutil
import socket
import subprocess
import zope.interface
from acme import challenges
from letsencrypt import achallenges
from letsencrypt import errors
from let... | apache-2.0 |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_4/tests/regressiontests/text/tests.py | 25 | 4236 | # coding: utf-8
from __future__ import with_statement
from django.test import TestCase
from django.utils.encoding import iri_to_uri
from django.utils.http import (cookie_date, http_date,
urlquote, urlquote_plus, urlunquote, urlunquote_plus)
from django.utils.text import get_text_list, smart_split
from django.utils... | mit |
eedf/jeito | booking/migrations/0007_payment.py | 2 | 1047 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-18 16:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('booking', '0006_auto_20170118_... | mit |
miipl-naveen/optibizz | addons/crm/crm.py | 267 | 7967 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
google-code/android-scripting | python/src/Mac/Demo/applescript/Disk_Copy/Utility_Events.py | 34 | 7685 | """Suite Utility Events: Commands that allow the user to select Disk Copy files
Level 1, version 1
Generated from Macintosh HD:Hulpprogramma's:Disk Copy
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'ddsk'
class Utility_Events_Events:
_argmap_select_disk_image = {... | apache-2.0 |
NetApp/cinder | cinder/api/contrib/volume_actions.py | 5 | 15292 | # Copyright 2012 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 or a... | apache-2.0 |
buaazp/etcd | Godeps/_workspace/src/github.com/ugorji/go/codec/test.py | 670 | 3808 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# pip install --user msgpack-python
# pip inst... | apache-2.0 |
fener06/pyload | module/cli/Handler.py | 42 | 1348 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#Copyright (C) 2011 RaNaN
#
#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 |
gisce/OCB | addons/l10n_be_coda/wizard/account_coda_import.py | 8 | 28350 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... | agpl-3.0 |
DucQuang1/youtube-dl | youtube_dl/extractor/shared.py | 40 | 1876 | from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
int_or_none,
)
class SharedIE(InfoExtractor):
_VALID_URL = r'http://shared\.sx/(?P<id>[\da-z]{10})'
... | unlicense |
goyoregalado/OMSTD | examples/cracking/ch-001/omstd_ch_001/api.py | 2 | 3383 | # -*- coding: utf-8 -*-
"""
Project name: Open Methodology for Security Tool Developers
Project URL: https://github.com/cr0hn/OMSTD
Copyright (c) 2014, cr0hn<-AT->cr0hn.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following ... | bsd-2-clause |
bcroq/kansha | kansha/user/view.py | 2 | 8283 | # -*- coding:utf-8 -*-
#--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--
from nagare.i18n import _
from nagare import presentation, component, ajax,... | bsd-3-clause |
SelvorWhim/competitive | Bloomberg_codecon/General_challenger_problems/mug_color.py | 1 | 1927 | ### INSTRUCTIONS ###
'''
Jay S. has got himself in trouble! He had borrowed a friend's coffee mug and somehow lost it. As his friend will be extremely angry when he finds out about it, Jay has decided to buy his friend a replacement mug to try to control the damage.
Unfortunately, Jay does not remember the color of t... | unlicense |
christianurich/DynaMind-ToolBox | DynaMind-Extensions/unit-tests/gtest-1.6.0/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, 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... | gpl-2.0 |
DoWhatILove/turtle | programming/python/design/swampy/World.py | 1 | 7842 | #!/usr/bin/python
"""
This module is part of Swampy, a suite of programs available from
allendowney.com/swampy.
Copyright 2005 Allen B. Downey
Distributed under the GNU General Public License at gnu.org/licenses/gpl.html.
"""
import math
import random
import time
import threading
import sys
import tkinter
from .Gu... | mit |
Fusion-Rom/android_external_chromium_org | tools/valgrind/browser_wrapper_win.py | 44 | 1638 | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import glob
import os
import re
import sys
import subprocess
# TODO(timurrrr): we may use it on POSIX too to avoid code duplication once we
# support la... | bsd-3-clause |
Eyepea/FrameworkBenchmarks | toolset/benchmark/test_types/framework_test_type.py | 27 | 4710 | import copy
import sys
import subprocess
from subprocess import PIPE
import requests
# Requests is built ontop of urllib3,
# here we prevent general request logging
import logging
logging.getLogger('urllib3').setLevel(logging.CRITICAL)
from pprint import pprint
class FrameworkTestType:
'''
Interface betwee... | bsd-3-clause |
CforED/Machine-Learning | examples/semi_supervised/plot_label_propagation_structure.py | 45 | 2433 | """
==============================================
Label Propagation learning a complex structure
==============================================
Example of LabelPropagation learning a complex internal structure
to demonstrate "manifold learning". The outer circle should be
labeled "red" and the inner circle "blue". Be... | bsd-3-clause |
jonyroda97/redbot-amigosprovaveis | lib/raven/middleware.py | 3 | 3675 | """
raven.middleware
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from contextlib import contextmanager
from raven._compat import Iterator, next
from raven.utils.wsgi import... | gpl-3.0 |
JasonCormie/ansible-modules-extras | cloud/vmware/vmware_vmkernel.py | 75 | 7458 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 Li... | gpl-3.0 |
pottzer/home-assistant | homeassistant/components/modbus.py | 10 | 2759 | """
homeassistant.components.modbus
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modbus component, using pymodbus (python3 branch).
Configuration:
To use the Modbus component you will need to add something like the following
to your configuration.yaml file.
#Modbus TCP
modbus:
type: tcp
host: 127.0.0.1
port: 2020
#M... | mit |
lude-ma/python-ivi | ivi/agilent/agilentDSAX92804A.py | 7 | 1691 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 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 |
theflofly/tensorflow | tensorflow/contrib/distributions/python/ops/vector_student_t.py | 22 | 10470 | # 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 |
mjnowen/mjnowen-anim-studio-tools | sherman/www/lib/template.py | 5 | 1571 | import os
import cherrypy
from genshi.core import Stream
from genshi.output import encode, get_serializer
from genshi.template import Context, TemplateLoader
from lib import ajax
loader = TemplateLoader(
os.path.join(os.path.dirname(__file__), '..', 'templates'),
auto_reload=True
)
def output(filename, meth... | gpl-3.0 |
lmr/autotest | database_legacy/migrations/058_drone_management.py | 16 | 1979 | UP_SQL = """
CREATE TABLE afe_drones (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
hostname VARCHAR(255) NOT NULL
) ENGINE=InnoDB;
ALTER TABLE afe_drones
ADD CONSTRAINT afe_drones_unique
UNIQUE KEY (hostname);
CREATE TABLE afe_drone_sets (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
name VARCHAR(255) NOT NUL... | gpl-2.0 |
yoseforb/lollypop | src/pop_infos.py | 1 | 5999 | #!/usr/bin/python
# Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.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 Software Foundation, either version 3 of the License, or
# (at your opti... | gpl-3.0 |
normtown/SickRage | lib/fanart/core.py | 60 | 1256 | import requests
import fanart
from fanart.errors import RequestFanartError, ResponseFanartError
class Request(object):
def __init__(self, apikey, id, ws, type=None, sort=None, limit=None):
self._apikey = apikey
self._id = id
self._ws = ws
self._type = type or fanart.TYPE.ALL
... | gpl-3.0 |
hellysmile/aiohttp | aiohttp/web_app.py | 2 | 10119 | import asyncio
import warnings
from collections import MutableMapping
from functools import partial
from . import hdrs
from .abc import AbstractAccessLogger, AbstractMatchInfo, AbstractRouter
from .frozenlist import FrozenList
from .helpers import AccessLogger
from .log import web_logger
from .signals import Signal
fr... | apache-2.0 |
Fireblend/scikit-learn | sklearn/feature_extraction/tests/test_dict_vectorizer.py | 276 | 3790 | # Authors: Lars Buitinck <L.J.Buitinck@uva.nl>
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from random import Random
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_array_equal
from sklearn.utils.testing import (assert_equal, assert_in,
... | bsd-3-clause |
nanolearningllc/edx-platform-cypress-2 | common/lib/xmodule/xmodule/library_tools.py | 154 | 7784 | """
XBlock runtime services for LibraryContentModule
"""
from django.core.exceptions import PermissionDenied
from opaque_keys.edx.locator import LibraryLocator, LibraryUsageLocator
from search.search_engine_base import SearchEngine
from xmodule.library_content_module import ANY_CAPA_TYPE_VALUE
from xmodule.modulestore ... | agpl-3.0 |
timm/timmnix | pypy3-v5.5.0-linux64/lib-python/3/ipaddress.py | 2 | 70303 | # Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
"""A fast, lightweight IPv4/IPv6 manipulation library in Python.
This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and networks.
"""
__version__ = '1.0'
import functools
IPV4LENGTH = 32
IPV6LENGTH = 128
class Add... | mit |
Chilledheart/vbox | src/VBox/ValidationKit/tests/selftests/tdSelfTest1.py | 4 | 1441 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id$
"""
Test Manager Self Test - Dummy Test Driver.
"""
__copyright__ = \
"""
Copyright (C) 2012-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistr... | gpl-2.0 |
realsystem/CloudFerry | cloudferrylib/os/actions/map_compute_info.py | 6 | 1797 | # 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 |
egabancho/invenio-collections | invenio_collections/admin.py | 4 | 1973 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio 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... | gpl-2.0 |
akhilaananthram/cortipy | setup.py | 5 | 1291 | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
sdict = {}
execfile('cortipy/version.py', {}, sdict)
def findRequirements():
"""
Read the requirements.txt file and parse into requirements for setup's
install_requirements option.
"""
retu... | mit |
bonitadecker77/python-for-android | python3-alpha/python3-src/Lib/lib2to3/tests/data/py3_test_grammar.py | 266 | 30362 | # Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
# NOTE: When you run this test as a script from the command line, you
# get warnings about certain hex/oct constants. Since those are
# issued by the parser, you can't suppress them by adding a
# filterwarnings() call to this... | apache-2.0 |
aebrahim/ome | ome/settings.py | 1 | 5475 | """retrive local user settings"""
from ConfigParser import SafeConfigParser, NoOptionError
import os as os
from os.path import join, split, abspath, isfile, expanduser
from sys import modules
self = modules[__name__]
# define various filepaths
omelib_directory = join(split(abspath(__file__))[0], "")
ome_directory = ... | mit |
marlboromoo/miniboa | miniboa/telnet.py | 18 | 24890 | # -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# miniboa/telnet.py
# Copyright 2009 Jim Storch
# 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 o... | apache-2.0 |
anpingli/openshift-ansible | roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py | 82 | 13262 | '''
Unit tests for oc secret add
'''
import os
import six
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylint: disable=import-erro... | apache-2.0 |
jkenn99/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/model/queuestatus.py | 121 | 2109 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | bsd-3-clause |
wangjun/CaoLiuDownloader | catch.py | 2 | 6767 | import sys
import logging
import os
import os.path
import requests
import re
import ConfigParser
def success(val): return val,None
def error(why): return None,why
def get_val(m_val): return m_val[0]
def get_error(m_val): return m_val[1]
class GetCaoliuPic(object):
"""docstring for ClassName"""
def __init__(se... | mit |
bottompawn/kbengine | kbe/src/lib/python/Lib/plat-darwin/IN.py | 109 | 13954 | # Generated by h2py from /usr/include/netinet/in.h
# Included from sys/appleapiopts.h
# Included from sys/_types.h
# Included from sys/cdefs.h
def __P(protos): return protos
def __STRING(x): return #x
def __P(protos): return ()
def __STRING(x): return "x"
def __attribute__(x): return
def __COPYRIGHT(s): return ... | lgpl-3.0 |
jmesteve/medical | openerp/addons/stock/wizard/stock_partial_picking.py | 11 | 12706 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
GustavWi/mbed | workspace_tools/dev/syms.py | 120 | 2186 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
wzbozon/statsmodels | statsmodels/sandbox/distributions/gof_new.py | 28 | 22302 | '''More Goodness of fit tests
contains
GOF : 1 sample gof tests based on Stephens 1970, plus AD A^2
bootstrap : vectorized bootstrap p-values for gof test with fitted parameters
Created : 2011-05-21
Author : Josef Perktold
parts based on ks_2samp and kstest from scipy.stats
(license: Scipy BSD, but were completely... | bsd-3-clause |
ibushong/test-repo | flask_admin/form/rules.py | 7 | 9864 | from jinja2 import Markup
from flask.ext.admin._compat import string_types
from flask.ext.admin import helpers
class BaseRule(object):
"""
Base form rule. All form formatting rules should derive from `BaseRule`.
"""
def __init__(self):
self.parent = None
self.rule_set = None
... | bsd-3-clause |
vitaly4uk/django | tests/fixtures_regress/models.py | 281 | 8611 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Animal(models.Model):
name = models.CharField(max_length=150)
latin_na... | bsd-3-clause |
tcoppex/gl-compute-c99 | tools/glextgen/main.py | 1 | 2567 |
# GL Extension Generator script
#
# This script generates an header and inline file from a list of OpenGL extensions
# functions to automate the loading process.
#
# Usage : python main.py extension_file dst_dir
#
# -----------------------------------------------------------------------------
def HeadComment():
im... | unlicense |
markeTIC/OCB | addons/association/__openerp__.py | 260 | 1700 | # -*- 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 |
rafael1193/spicegui | spicegui/running_dialog.py | 1 | 3173 | # -*- coding: utf-8 -*-
#
# SpiceGUI
# Copyright (C) 2014-2015 Rafael Bailón-Ruiz <rafaelbailon@ieee.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 Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
cloudbase/neutron | neutron/api/rpc/handlers/resources_rpc.py | 3 | 10920 | # Copyright (c) 2015 Mellanox Technologies, Ltd
# 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
#
# U... | apache-2.0 |
liam2/larray | larray/tests/test_array.py | 2 | 174871 | # -*- coding: utf8 -*-
from __future__ import absolute_import, division, print_function
import os
import re
import sys
import pytest
import numpy as np
import pandas as pd
from collections import OrderedDict
from larray.tests.common import (inputpath, tmp_path, meta,
assert_array_equ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.