repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
owaiskhan/Retransmission-Combining | gnuradio-core/src/lib/filter/generate_gr_interp_fir_filter_XXX.py | 17 | 1397 | #!/bin/env python
# -*- python -*-
#
# Copyright 2003,2004 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or... | gpl-3.0 |
xavierwu/scikit-learn | examples/linear_model/plot_ransac.py | 250 | 1673 | """
===========================================
Robust linear model estimation using RANSAC
===========================================
In this example we see how to robustly fit a linear model to faulty data using
the RANSAC algorithm.
"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn import ... | bsd-3-clause |
boretom/pyload-apkg | source/py-mods-prebuilt-x86-64/site-packages/Crypto/SelfTest/Cipher/test_Blowfish.py | 119 | 5832 | # -*- coding: utf-8 -*-
#
# SelfTest/Cipher/test_Blowfish.py: Self-test for the Blowfish cipher
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that d... | gpl-3.0 |
hustodemon/spacewalk | backend/server/rhnServer/server_hardware.py | 1 | 34703 | #
# Copyright (c) 2008--2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
pomegranited/edx-platform | openedx/core/lib/api/authentication.py | 36 | 3458 | """ Common Authentication Handlers used across projects. """
from rest_framework.authentication import SessionAuthentication
from rest_framework_oauth.authentication import OAuth2Authentication
from rest_framework.exceptions import AuthenticationFailed
from rest_framework_oauth.compat import oauth2_provider, provider_n... | agpl-3.0 |
direvus/ansible | lib/ansible/modules/windows/win_get_url.py | 21 | 5031 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Paul Durivage <paul.durivage@rackspace.com>, and others
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_... | gpl-3.0 |
apllicationCOM/youtube-dl-api-server | youtube_dl_server/youtube_dl/extractor/__init__.py | 2 | 20811 | from __future__ import unicode_literals
from .abc import ABCIE
from .abc7news import Abc7NewsIE
from .academicearth import AcademicEarthCourseIE
from .addanime import AddAnimeIE
from .adobetv import (
AdobeTVIE,
AdobeTVVideoIE,
)
from .adultswim import AdultSwimIE
from .aftenposten import AftenpostenIE
from .a... | unlicense |
hgl888/chromium-crosswalk-efl | third_party/closure_linter/closure_linter/requireprovidesorter.py | 84 | 11383 | #!/usr/bin/env python
#
# Copyright 2011 The Closure Linter 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
#... | bsd-3-clause |
AgostonSzepessy/servo | tests/wpt/css-tests/tools/html5lib/html5lib/tests/performance/concatenation.py | 451 | 1145 | from __future__ import absolute_import, division, unicode_literals
def f1():
x = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
y = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
z = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
x += y + z
def f2():
x = "ABCDEFGHIJKLMNOP... | mpl-2.0 |
terbolous/SickRage | lib/hachoir_parser/archive/ace.py | 95 | 9944 | """
ACE parser
From wotsit.org and the SDK header (bitflags)
Partial study of a new block type (5) I've called "new_recovery", as its
syntax is very close to the former one (of type 2).
Status: can only read totally file and header blocks.
Author: Christophe Gisquet <christophe.gisquet@free.fr>
Creation date: 19 jan... | gpl-3.0 |
janicduplessis/buck | third-party/py/pex/pex/archiver.py | 55 | 1560 | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import contextlib
import os
import tarfile
import zipfile
from .common import safe_mkdtemp
class Archiver(object):
class Error(Exception): pass
class UnpackError(Error): pass
clas... | apache-2.0 |
ThirdProject/android_external_chromium_org | third_party/python_gflags/gflags2man.py | 407 | 18864 | #!/usr/bin/env python
# Copyright (c) 2006, 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 l... | bsd-3-clause |
joone/chromium-crosswalk | tools/grit/grit/format/resource_map_unittest.py | 16 | 10682 | #!/usr/bin/env python
# Copyright (c) 2012 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.
'''Unit tests for grit.format.resource_map'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.pa... | bsd-3-clause |
vrjuggler/maestro | maestro/gui/EnsembleModel.py | 2 | 6008 | # Maestro is Copyright (C) 2006-2008 by Infiscape Corporation
#
# Original Author: Aron Bierbaum
#
# 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 ... | gpl-2.0 |
beacloudgenius/edx-platform | common/djangoapps/config_models/admin.py | 83 | 2777 | """
Admin site models for managing :class:`.ConfigurationModel` subclasses
"""
from django.forms import models
from django.contrib import admin
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
# pylint: disable=protected-access
class ConfigurationModelAdmin(admin.ModelAdmin)... | agpl-3.0 |
skearnes/pylearn2 | pylearn2/gui/patch_viewer.py | 4 | 16076 | """
Functionality for display and saving images of collections of images patches.
"""
import numpy as np
from pylearn2.datasets.dense_design_matrix import DefaultViewConverter
from pylearn2.utils.image import Image, ensure_Image
from pylearn2.utils.image import show
from pylearn2.utils import py_integer_types
import wa... | bsd-3-clause |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/django-1.4/django/middleware/http.py | 105 | 1643 | from django.utils.http import http_date, parse_http_date_safe
class ConditionalGetMiddleware(object):
"""
Handles conditional GET operations. If the response has a ETag or
Last-Modified header, and the request has If-None-Match or
If-Modified-Since, the response is replaced by an HttpNotModified.
... | mit |
Deepakkothandan/ansible-modules-extras | monitoring/datadog_event.py | 24 | 5386 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Author: Artūras 'arturaz' Šlajus <x11@arturaz.net>
#
# This module is proudly sponsored by iGeolise (www.igeolise.com) and
# Tiny Lab Productions (www.tinylabproductions.com).
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modi... | gpl-3.0 |
CamelBackNotation/CarnotKE | jyhton/lib-python/2.7/plat-irix6/AL.py | 132 | 1593 | from warnings import warnpy3k
warnpy3k("the AL module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
RATE_48000 = 48000
RATE_44100 = 44100
RATE_32000 = 32000
RATE_22050 = 22050
RATE_16000 = 16000
RATE_11025 = 11025
RATE_8000 = 8000
SAMPFMT_TWOSCOMP= 1
SAMPFMT_FLOAT =... | apache-2.0 |
wattad169/sportbuddy_server | lib/django/contrib/contenttypes/views.py | 380 | 3608 | from __future__ import unicode_literals
from django import http
from django.apps import apps
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.requests import RequestSite
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
def sh... | bsd-3-clause |
arpitparmar5739/youtube-dl | youtube_dl/extractor/telebruxelles.py | 150 | 2352 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class TeleBruxellesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?telebruxelles\.be/(news|sport|dernier-jt)/?(?P<id>[^/#?]+)'
_TESTS = [{
'url': 'http://www.telebruxelles.be/news/auditions-devant-parlement... | unlicense |
kaynfiretvguru/Eldritch | plugin.video.exodus/resources/lib/sources/en/xmovies.py | 3 | 9412 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | gpl-2.0 |
cgc1983/zerorpc-python | tests/test_server.py | 72 | 5945 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
Metaswitch/calico-neutron | neutron/tests/unit/bigswitch/test_router_db.py | 8 | 28080 | # Copyright 2013 Big Switch Networks, 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 ... | apache-2.0 |
kleskjr/scipy | scipy/fftpack/realtransforms.py | 102 | 15426 | """
Real spectrum tranforms (DCT, DST, MDCT)
"""
from __future__ import division, print_function, absolute_import
__all__ = ['dct', 'idct', 'dst', 'idst']
import numpy as np
from scipy.fftpack import _fftpack
from scipy.fftpack.basic import _datacopied, _fix_shape, _asfarray
import atexit
atexit.register(_fftpack.d... | bsd-3-clause |
iffy/eliot | benchmarks/logwriter.py | 1 | 1041 | """
A benchmark for eliot.logwriter.
"""
import tempfile
import time
from twisted.internet.task import react
from twisted.python.filepath import FilePath
from eliot.logwriter import ThreadedFileWriter
LENGTH = 100
MESSAGES = 100000
def main(reactor):
print "Message size: %d bytes Num messages: %d" % (LENGT... | apache-2.0 |
iniverno/RnR-LLC | simics-3.0-install/simics-3.0.31/amd64-linux/lib/python2.4/UserDict.py | 14 | 5572 | """A more or less complete user-defined wrapper around dictionary objects."""
class UserDict:
def __init__(self, dict=None, **kwargs):
self.data = {}
if dict is not None:
self.update(dict)
if len(kwargs):
self.update(kwargs)
def __repr__(self): return repr(self.d... | gpl-2.0 |
edevil/django | tests/utils_tests/test_autoreload.py | 42 | 3564 | from importlib import import_module
import os
import tempfile
from django import conf
from django.contrib import admin
from django.test import TestCase, override_settings
from django.utils.autoreload import gen_filenames
from django.utils._os import upath
LOCALE_PATH = os.path.join(os.path.dirname(__file__), 'locale'... | bsd-3-clause |
kogone/android_kernel_oneplus_msm8974 | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
ssvsergeyev/ZenPacks.zenoss.AWS | src/boto/tests/integration/glacier/test_layer2.py | 136 | 2025 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 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 the rights ... | gpl-2.0 |
dagwieers/ansible | lib/ansible/plugins/connection/napalm.py | 24 | 6630 | # (c) 2018 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 = """
---
author: Ansible Networking Team
connection: napalm
short_description: Provides persis... | gpl-3.0 |
michalbe/servo | src/components/script/dom/bindings/codegen/parser/tests/test_interface.py | 134 | 5702 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("interface Foo { };")
results = parser.finish()
harness.ok(True, "Empty interface parsed without error.")
harness.check(len(results), 1, "Should be one production")
harness.ok(isinstance(results[0], WebIDL.IDLInterface),
"Sh... | mpl-2.0 |
sestrella/ansible | lib/ansible/modules/net_tools/hetzner_failover_ip.py | 30 | 3706 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2019 Felix Fontein <felix@fontein.de>
# 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',
... | gpl-3.0 |
kennym/itools | test/test_ical.py | 1 | 36237 | # -*- coding: UTF-8 -*-
# Copyright (C) 2005-2008 Juan David Ibáñez Palomar <jdavid@itaapy.com>
# Copyright (C) 2006-2007 Nicolas Deram <nicolas@itaapy.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... | gpl-3.0 |
rhertzog/django | django/db/backends/postgresql/client.py | 67 | 2126 | import os
import subprocess
from django.core.files.temp import NamedTemporaryFile
from django.db.backends.base.client import BaseDatabaseClient
from django.utils.six import print_
def _escape_pgpass(txt):
"""
Escape a fragment of a PostgreSQL .pgpass file.
"""
return txt.replace('\\', '\\\\').replace... | bsd-3-clause |
ijuma/kafka | tests/kafkatest/benchmarks/core/benchmark_test.py | 16 | 14178 | # 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 |
hirofumi0810/tensorflow_end2end_speech_recognition | utils/dataset/xe.py | 1 | 5444 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Base class for loading dataset for the frame-wise model.
In this class, all data will be loaded at each step.
You can use the multi-GPU version.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
imp... | mit |
wagnerjs/speakerfight | deck/migrations/0011_auto_20150825_1628.py | 14 | 1293 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('deck', '0010_create_activities_from_proposals'),
]
operations = [
migrations.RemoveField(
model_name='proposal',... | mit |
sparkslabs/kamaelia_ | Sketches/PT/likefile/testlikefile.py | 3 | 8892 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License,... | apache-2.0 |
schmatzler/zte-kernel-smartchat | 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 |
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price | data/25 verizon/getDataAutoQuery.py | 1 | 3761 | import webhose;
import time;
from datetime import datetime, timedelta
from lxml import html
import requests
import unirest
webhose.config(token='c6052904-f312-436b-a6d8-d915084ac866')
days_back = 30
date_days_ago = datetime.now() - timedelta(days=days_back)
organization = 'verizon'
lang = 'english'
country = 'US'
#... | mit |
bbsan2k/nzbToMedia | core/synchronousdeluge/transfer.py | 4 | 1364 | # coding=utf-8
import zlib
import struct
import socket
import ssl
from core.synchronousdeluge import rencode
__all__ = ["DelugeTransfer"]
class DelugeTransfer(object):
def __init__(self):
self.sock = None
self.conn = None
self.connected = False
def connect(self, hostport):
i... | gpl-3.0 |
njemak/syakago | vendor/psy/psysh/test/tools/vis.py | 710 | 3428 | """
vis.py
======
Ctypes based module to access libbsd's strvis & strunvis functions.
The `vis` function is the equivalent of strvis.
The `unvis` function is the equivalent of strunvis.
All functions accept unicode string as input and return a unicode string.
Constants:
----------
* to select alternate encoding for... | mit |
jumpserver/jumpserver | apps/perms/serializers/asset/permission.py | 1 | 5347 | # -*- coding: utf-8 -*-
#
from rest_framework import serializers
from django.utils.translation import ugettext_lazy as _
from django.db.models import Prefetch, Q
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
from perms.models import AssetPermission, Action
from assets.models import Asset, Node,... | gpl-2.0 |
metabrainz/listenbrainz-server | listenbrainz_spark/recommendations/recording/tests/test_models.py | 2 | 7922 | import re
import os
import uuid
import unittest
from unittest.mock import patch, Mock, MagicMock
import listenbrainz_spark
from listenbrainz_spark.tests import SparkTestCase, TEST_PLAYCOUNTS_PATH, PLAYCOUNTS_COUNT
from listenbrainz_spark import utils, config, hdfs_connection, path, schema
from listenbrainz_spark.recom... | gpl-2.0 |
easyfmxu/zulip | api/integrations/perforce/zulip_perforce_config.py | 124 | 2608 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Zulip, Inc.
#
# 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
#... | apache-2.0 |
nthuoj/NTHUOJ_web | team/views.py | 4 | 3033 | '''
The MIT License (MIT)
Copyright (c) 2014 NTHUOJ team
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, ... | mit |
bdero/edx-platform | common/lib/xmodule/xmodule/video_module/video_utils.py | 13 | 2020 | """
Module containts utils specific for video_module but not for transcripts.
"""
import json
import logging
import urllib
import requests
from requests.exceptions import RequestException
log = logging.getLogger(__name__)
def create_youtube_string(module):
"""
Create a string of Youtube IDs from `module`'s ... | agpl-3.0 |
brainstorm/bcbio-nextgen | tests/bcbio_vm/test_docker.py | 1 | 3019 | import os
import subprocess
import pytest
from tests.conftest import make_workdir
from tests.conftest import get_post_process_yaml
@pytest.marks('docker')
def test_docker(install_test_files, data_dir):
"""Run an analysis with code and tools inside a docker container.
Requires https://github.com/chapmanb/bc... | mit |
pdehaye/theming-edx-platform | common/lib/xmodule/xmodule/fields.py | 2 | 4427 | import time
import logging
import re
from xblock.core import ModelType
import datetime
import dateutil.parser
from pytz import UTC
log = logging.getLogger(__name__)
class Date(ModelType):
'''
Date fields know how to parse and produce json (iso) compatible formats. Converts to tz aware datetimes.
'''
... | agpl-3.0 |
nkgilley/home-assistant | tests/components/emulated_roku/test_config_flow.py | 22 | 1063 | """Tests for emulated_roku config flow."""
from homeassistant.components.emulated_roku import config_flow
from tests.common import MockConfigEntry
async def test_flow_works(hass):
"""Test that config flow works."""
flow = config_flow.EmulatedRokuFlowHandler()
flow.hass = hass
result = await flow.asyn... | apache-2.0 |
kasioumis/invenio | invenio/legacy/websubmit/functions/Send_Delete_Mail.py | 13 | 6420 | # This file is part of Invenio.
# Copyright (C) 2008, 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
# License, or (at your option) any later version.
#
# ... | gpl-2.0 |
nightjean/Deep-Learning | tensorflow/python/training/slot_creator.py | 51 | 7287 | # 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 |
mrquim/mrquimrepo | script.module.covenant/lib/resources/lib/sources/en/ddlvalley.py | 6 | 7994 | # -*- coding: utf-8 -*-
'''
Covenant Add-on
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 prog... | gpl-2.0 |
edgarli/proj8 | env/lib/python3.4/site-packages/dateutil/relativedelta.py | 104 | 18172 | # -*- coding: utf-8 -*-
import datetime
import calendar
from six import integer_types
__all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"]
class weekday(object):
__slots__ = ["weekday", "n"]
def __init__(self, weekday, n=None):
self.weekday = weekday
self.n = n
def __c... | artistic-2.0 |
giorgiop/scikit-learn | examples/ensemble/plot_adaboost_twoclass.py | 347 | 3268 | """
==================
Two-class AdaBoost
==================
This example fits an AdaBoosted decision stump on a non-linearly separable
classification dataset composed of two "Gaussian quantiles" clusters
(see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision
boundary and decision scores. The di... | bsd-3-clause |
maniteja123/sympy | sympy/liealgebras/root_system.py | 76 | 6884 | # -*- coding: utf-8 -*-
from .cartan_type import CartanType
from sympy.core import Basic
from sympy.core.compatibility import range
class RootSystem(Basic):
"""Represent the root system of a simple Lie algebra
Every simple Lie algebra has a unique root system. To find the root
system, we first consider t... | bsd-3-clause |
log2timeline/dfvfs | tests/resolver_helpers/vhdi_resolver_helper.py | 2 | 1467 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the Virtual Hard Disk image resolver helper implementation."""
import unittest
from dfvfs.lib import definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver_helpers import vhdi_resolver_helper
from tests.resolver_helpers import te... | apache-2.0 |
commtrack/commtrack-old-to-del | apps/hq/tests/views.py | 1 | 3356 | from django.test import TestCase
from django.test.client import Client
from hq.models import ExtUser, Domain, Organization, ReporterProfile
from hq.tests.util import create_user_and_domain
from reporters.models import Reporter
class ViewsTestCase(TestCase):
def setUp(self):
user, domain = create_user_and_d... | bsd-3-clause |
andymckay/zamboni | scripts/serve_webapps.py | 26 | 2238 | #!/usr/bin/env python
"""Serves .webapp/.json manifest files from the working directory."""
import logging
import optparse
import os
from wsgiref import simple_server
log = logging.getLogger(__name__)
document_root = os.getcwd()
def fileapp(environ, start_response):
path_info = environ['PATH_INFO']
if path_... | bsd-3-clause |
FusionSP/android_external_chromium_org | tools/site_compare/scrapers/firefox/firefox2.py | 189 | 6725 | #!/usr/bin/env python
# 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.
"""Does scraping for Firefox 2.0."""
import pywintypes
import time
import types
from drivers import keyboard
from drivers import ... | bsd-3-clause |
chromium/chromium | buildtools/checkdeps/rules.py | 5 | 7044 | # Copyright 2012 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.
"""Base classes to represent dependency rules, used by checkdeps.py"""
import os
import re
class Rule(object):
"""Specifies a single rule for an includ... | bsd-3-clause |
popazerty/enigma2-obh | lib/python/Screens/Console.py | 26 | 2543 | from enigma import eConsoleAppContainer
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.ScrollLabel import ScrollLabel
class Console(Screen):
#TODO move this to skin.xml
skin = """
<screen position="100,100" size="550,400" title="Command execution..." >
<widget name=... | gpl-2.0 |
loopCM/chromium | third_party/mesa/MesaLib/src/mapi/glapi/gen/extension_helper.py | 46 | 8261 | #!/usr/bin/env python
# (C) Copyright IBM Corporation 2005
# 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... | bsd-3-clause |
singlebrook/AWS-ElasticBeanstalk-CLI | eb/macosx/python2.7/lib/aws/requests/cookies.py | 34 | 13686 | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import collections
from .compat import cookielib, urlparse, Morsel
try:
import threading
# grr, pyflakes: this fixes "redefinition of unused... | apache-2.0 |
AlphaSmartDog/DeepLearningNotes | Note-2 RNN处理非线性回归/sonnet/testing/parameterized/parameterized_test.py | 9 | 13550 | # Copyright 2017 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... | mit |
kodabb/pjproject | pjsip-apps/src/swig/python/test.py | 44 | 3447 | import pjsua2 as pj
import sys
import time
#
# Basic data structure test, to make sure basic struct
# and array operations work
#
def ua_data_test():
#
# AuthCredInfo
#
print "UA data types test.."
the_realm = "pjsip.org"
ci = pj.AuthCredInfo()
ci.realm = the_realm
ci.dataType = 20
ci2 = ci
assert ci.dataT... | gpl-2.0 |
anhaidgroup/py_entitymatching | py_entitymatching/dask/dask_extract_features.py | 1 | 9597 | import logging
import os
import pandas as pd
import multiprocessing
import numpy as np
import dask
from dask.diagnostics import ProgressBar
from dask import delayed
from cloudpickle import cloudpickle
import tempfile
import py_entitymatching.catalog.catalog_manager as cm
import py_entitymatching.utils.catalog_helpe... | bsd-3-clause |
HLFH/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/mechanize/_mechanize.py | 133 | 24916 | """Stateful programmatic WWW navigation, after Perl's WWW::Mechanize.
Copyright 2003-2006 John J. Lee <jjl@pobox.com>
Copyright 2003 Andy Lester (original Perl code)
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt
included w... | gpl-3.0 |
BoltzmannBrain/nupic.research | projects/union_pooling/experiments/variation_robustness/variation_robustness_experiment.py | 3 | 27896 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# 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 ... | agpl-3.0 |
jswxdzc/shadowsocks | shadowsocks/local.py | 1015 | 2248 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 clowwindy
#
# 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 r... | apache-2.0 |
ahmedaljazzar/edx-platform | manage.py | 11 | 4180 | #!/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 |
hollabaq86/haikuna-matata | env/lib/python2.7/site-packages/numpy/distutils/fcompiler/ibm.py | 184 | 3408 | from __future__ import division, absolute_import, print_function
import os
import re
import sys
from numpy.distutils.fcompiler import FCompiler
from numpy.distutils.exec_command import exec_command, find_executable
from numpy.distutils.misc_util import make_temp_file
from distutils import log
compilers = ['IBMFCompi... | mit |
arista-eosplus/ansible | test/units/modules/network/eos/test_eos_system.py | 62 | 4530 | # (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 |
giggsey/SickRage | lib/unidecode/x01d.py | 240 | 3608 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | gpl-3.0 |
GarySparrow/mFlaskWeb | venv/Lib/site-packages/werkzeug/_reloader.py | 116 | 7938 | import os
import sys
import time
import subprocess
import threading
from itertools import chain
from werkzeug._internal import _log
from werkzeug._compat import PY2, iteritems, text_type
def _iter_module_files():
"""This iterates over all relevant Python files. It goes through all
loaded files from modules,... | mit |
ctk3b/mdtraj | mdtraj/tests/test_rmsd_memmap.py | 5 | 1405 | import os
import os.path
import numpy as np
import tempfile
import mdtraj as md
from mdtraj.testing import get_fn, assert_raises
def test_1():
# https://github.com/mdtraj/mdtraj/issues/438
try:
dir = tempfile.mkdtemp()
fn = os.path.join(dir, 'temp.npy')
traj = md.load(get_fn('frame0.h5... | lgpl-2.1 |
NuAoA/mopidy-alcd | mopidy_AdafruitLCD/Adafruit_LCD_frontend.py | 1 | 3199 | #!/usr/bin/env python
import logging
import traceback
import pykka
import mopidy
import sys
import re #todo: remove
import threading
from time import sleep
from mopidy import core
from .Adafruit_player import AdafruitPlayer
logger = logging.getLogger(__name__)
class AdafruitLCD(pykka.ThreadingActor, core.CoreListene... | apache-2.0 |
xiangel/hue | desktop/core/ext-py/boto-2.38.0/boto/configservice/layer1.py | 56 | 17092 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. 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 the rights ... | apache-2.0 |
holmes/intellij-community | python/helpers/pydev/pydevd_breakpoints.py | 19 | 5217 | from pydevd_constants import *
import pydevd_tracing
import sys
import pydev_log
import pydevd_import_class
_original_excepthook = None
_handle_exceptions = None
import _pydev_threading as threading
threadingCurrentThread = threading.currentThread
from pydevd_comm import GetGlobalDebugger
class ExceptionBreakpoin... | apache-2.0 |
Lekensteyn/buildbot | master/buildbot/test/unit/test_db_schedulers.py | 10 | 17020 | # 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 |
bottompawn/kbengine | kbe/src/lib/python/Lib/test/test_devpoll.py | 87 | 4637 | # Test case for the select.devpoll() function
# Initial tests are copied as is from "test_poll.py"
import os
import random
import select
import sys
import unittest
from test.support import TESTFN, run_unittest, cpython_only
if not hasattr(select, 'devpoll') :
raise unittest.SkipTest('test works only on Solaris O... | lgpl-3.0 |
chilitechno/barrioSquare | setup.py | 1 | 1178 | from py2deb import Py2deb
from glob import glob
version = "0.1.20"
p=Py2deb("barriosquare")
p.author="Chris J. Burris"
p.mail="chris@chlitechno.com"
p.description="Maemo application to access foursquare.com api functionality"
p["/opt/barrioSquare"] = ["barriosq.py|barriosq","barrioConfig.py","barrioStyles.py","get-loc... | gpl-3.0 |
luo66/scikit-learn | sklearn/isotonic.py | 206 | 12307 | # Authors: Fabian Pedregosa <fabian@fseoane.net>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Nelle Varoquaux <nelle.varoquaux@gmail.com>
# License: BSD 3 clause
import numpy as np
from scipy import interpolate
from scipy.stats import spearmanr
from .base import BaseEstimator, TransformerMixi... | bsd-3-clause |
dcroc16/skunk_works | google_appengine/lib/django-1.2/django/utils/dates.py | 120 | 1193 | "Commonly-used date structures"
from django.utils.translation import ugettext_lazy as _
WEEKDAYS = {
0:_('Monday'), 1:_('Tuesday'), 2:_('Wednesday'), 3:_('Thursday'), 4:_('Friday'),
5:_('Saturday'), 6:_('Sunday')
}
WEEKDAYS_ABBR = {
0:_('Mon'), 1:_('Tue'), 2:_('Wed'), 3:_('Thu'), 4:_('Fri'),
5:_('Sat'... | mit |
loulich/Couchpotato | libs/subliminal/services/subswiki.py | 105 | 5182 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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 3 of... | gpl-3.0 |
nishad-jobsglobal/odoo-marriot | addons/stock_account/wizard/stock_return_picking.py | 342 | 2715 | # -*- 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 |
skiz/warzone2100 | tools/tile_texpage2mipmap_tileset/texpage2mipmap.py | 13 | 12883 | #!/usr/bin/env python
""" Splits and scales tertile texpages into mipmaps.
Finds and filters files based on the 'extension' configuration setting, and
of those, groups where available to allow mipmap output to be created from
as few as one input texpage and as many texpages as there are output
resolutions.
Filenames... | gpl-2.0 |
ToonTownInfiniteRepo/ToontownInfinite | Panda3D-1.9.0/python/Lib/encodings/iso8859_4.py | 593 | 13632 | """ Python Character Mapping Codec iso8859_4 generated from 'MAPPINGS/ISO8859/8859-4.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | mit |
fkakuma/ryu | ryu/tests/unit/packet/test_ipv6.py | 23 | 36834 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
wemanuel/smry | smry/server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/compute/subcommands/instances/get_serial_port_output.py | 2 | 2504 | # Copyright 2014 Google Inc. All Rights Reserved.
"""Command for reading the serial port output of an instance."""
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.compute.lib import base_classes
from googlecloudsdk.compute.lib import request_helper
from googlecloudsdk.compute.lib import utils
from g... | apache-2.0 |
eliasdorneles/scrapy | tests/test_downloadermiddleware_useragent.py | 53 | 2206 | from unittest import TestCase
from scrapy.spiders import Spider
from scrapy.http import Request
from scrapy.downloadermiddlewares.useragent import UserAgentMiddleware
from scrapy.utils.test import get_crawler
class UserAgentMiddlewareTest(TestCase):
def get_spider_and_mw(self, default_useragent):
crawle... | bsd-3-clause |
sinkpoint/dipy | scratch/very_scratch/simulation_comparisons_modified.py | 20 | 13117 | import nibabel
import os
import numpy as np
import dipy as dp
import dipy.core.generalized_q_sampling as dgqs
import dipy.io.pickles as pkl
import scipy as sp
from matplotlib.mlab import find
import dipy.core.sphere_plots as splots
import dipy.core.sphere_stats as sphats
import dipy.core.geometry as geometry
import get... | bsd-3-clause |
yuanzhao/gpdb | gpMgmt/bin/gppylib/test/regress/test_regress_pygresql.py | 12 | 4162 | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
""" Unittesting for pygres module
"""
import logging
import unittest
from pygresql import pg
from pygresql import pgdb
from gppylib import gplog
from gppylib.db.dbconn import *
from gppylib.db.test import skipIfDatabaseDown
logger=... | apache-2.0 |
achang97/YouTunes | lib/python2.7/site-packages/youtube_dl/extractor/goshgay.py | 64 | 1542 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
)
from ..utils import (
parse_duration,
)
class GoshgayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?goshgay\.com/video(?P<id>\d+?)($|/)'
_TEST = {
'url': '... | mit |
EdDev/vdsm | tests/virttests/vmstats_test.py | 1 | 18952 | #
# Copyright 2015 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | gpl-2.0 |
rsvip/Django | django/conf/locale/hr/formats.py | 504 | 2106 | # -*- 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 = 'j. E Y.'
TIME_FORMAT = 'H:i'
DATE... | bsd-3-clause |
pankajk/MasterThesis | Code/Graph_Kernels/SKG/KroneckerGenerator.py | 1 | 2725 | import numpy as np
import networkx as nx
import math
import random
def convert(something):#use networkx conversion from numpy array
#g = nx.from_numpy_matrix(someNPMat)
g = nx.to_networkx_graph(something)
return g
def deleteSelfLoops(graph, nNodes): #used to take away self loops in final graph for stat p... | mit |
Livit/Livit.Learn.EdX | common/test/acceptance/tests/discussion/test_discussion.py | 7 | 56480 | """
Tests for discussion pages
"""
import datetime
from uuid import uuid4
from flaky import flaky
from nose.plugins.attrib import attr
from pytz import UTC
from .helpers import BaseDiscussionTestCase
from ..helpers import UniqueCourseTest
from ...pages.lms.auto_auth import AutoAuthPage
from ...pages.lms.courseware i... | agpl-3.0 |
aequitas/home-assistant | homeassistant/components/emulated_hue/hue_api.py | 2 | 20285 | """Support for a Hue API to control Home Assistant."""
import logging
from aiohttp import web
from homeassistant import core
from homeassistant.components import (
climate, cover, fan, light, media_player, scene, script)
from homeassistant.components.climate.const import (
SERVICE_SET_TEMPERATURE, SUPPORT_TAR... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.