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 |
|---|---|---|---|---|---|
Velkan/shadowsocks-1 | shadowsocks/asyncdns.py | 655 | 17416 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-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 |
rew4332/tensorflow | tensorflow/python/lib/io/file_io_test.py | 1 | 11309 | # 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 |
julianwang/cinder | tools/install_venv_common.py | 333 | 5959 | # Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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 |
shownomercy/django | tests/flatpages_tests/test_middleware.py | 290 | 8134 | from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
class TestDataMixin(object):
... | bsd-3-clause |
openiitbombayx/edx-platform | lms/djangoapps/courseware/models.py | 2 | 16642 | """
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py schemamigration courseware --auto description_of_your_change
3. Add the migration file created... | agpl-3.0 |
yanaitti/DeliveryPlanner | node_modules/npm/node_modules/node-gyp/gyp/PRESUBMIT.py | 1369 | 3662 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | mit |
vaygr/ansible | lib/ansible/modules/network/citrix/_netscaler.py | 12 | 4949 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Nandor Sivok <nandor@gawker.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': ... | gpl-3.0 |
grupoprog3/proyecto_final | proyecto/flask/Lib/site-packages/sqlalchemy/orm/dependency.py | 55 | 46192 | # orm/dependency.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Relationship dependencies.
"""
from .. import sql, util, exc as sa_exc
from .... | apache-2.0 |
jusdng/odoo | addons/website_sale_options/models/sale_order.py | 237 | 2831 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.osv import osv, orm, fields
from openerp.tools.translate import _
class sale_order_line(osv.Model):
_inherit = "sale.order.line"
_columns = {
'linked_line_id': fields.many2one('sale.order.line', 'Linked Order Line', domain="[('orde... | agpl-3.0 |
ephes/scikit-learn | doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py | 254 | 2253 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... | bsd-3-clause |
caiiiyua/monkful | tests/tests/basic_resource/post_invalid_value_type_bool.py | 2 | 1865 | import unittest
import json
from pymongo import MongoClient
from apps.basic_resource import server
from apps.basic_resource.documents import Article
class ResourcePostInvalidValueTypeBool(unittest.TestCase):
"""
Test if a HTTP POST request with an invalid value for a specific
field results in the correct ... | lgpl-3.0 |
RPGOne/Skynet | numpy-master/numpy/tests/test_reloading.py | 68 | 1038 | from __future__ import division, absolute_import, print_function
import sys
from numpy.testing import assert_raises, assert_, run_module_suite
if sys.version_info[:2] >= (3, 4):
from importlib import reload
else:
from imp import reload
def test_numpy_reloading():
# gh-7844. Also check that relevant glob... | bsd-3-clause |
Kingclove/project3-info3180 | server/lib/flask/views.py | 782 | 5642 | # -*- coding: utf-8 -*-
"""
flask.views
~~~~~~~~~~~
This module provides class-based views inspired by the ones in Django.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from .globals import request
from ._compat import with_metaclass
http_method_funcs =... | apache-2.0 |
iiilx/django-addressbook | addressbook/models.py | 1 | 5426 | from django.conf import settings
from django_localflavor_us.models import USStateField
from django.core.files.storage import get_storage_class
from django.db import models
from django.utils.functional import LazyObject
from easy_thumbnails.fields import ThumbnailerImageField
class AvatarStorage(LazyObject):
def ... | bsd-2-clause |
aifil/odoo | addons/point_of_sale/wizard/pos_confirm.py | 44 | 1457 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import osv
class pos_confirm(osv.osv_memory):
_name = 'pos.confirm'
_description = 'Post POS Journal Entries'
def action_confirm(self, cr, uid, ids, context=None):
order_obj = self... | gpl-3.0 |
midma101/AndIWasJustGoingToBed | .venv/lib/python2.7/site-packages/Crypto/Hash/MD4.py | 124 | 2716 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | mit |
puiterwijk/product-definition-center | setup.py | 4 | 1093 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from pdc import get_version
PACKAGE_NAME = 'pdc'
PACKAGE_VER = get_version()
PACKAGE_DESC = 'PDC - Product Definition Center'
PACKAGE_URL = 'https://github.com/release-engineering/product-definition-center.git' # noqa
def get_install_requires():... | mit |
tigwyk/eve-wspace | evewspace/Map/views.py | 3 | 30278 | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | gpl-3.0 |
kumajaya/android_kernel_samsung_universal5422 | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
arista-eosplus/ansible | lib/ansible/modules/cloud/azure/azure_rm_storageaccount_facts.py | 68 | 6452 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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 Soft... | gpl-3.0 |
androomerrill/scikit-nano | sknano/core/atoms/_image_atoms.py | 2 | 4201 | # -*- coding: utf-8 -*-
"""
===============================================================================
Atom classes with image id attributes (:mod:`sknano.core.atoms._image_atoms`)
===============================================================================
.. currentmodule:: sknano.core.atoms._image_atoms
""... | bsd-2-clause |
duyetdev/openerp-6.1.1 | openerp/addons/point_of_sale/report/pos_users_product.py | 9 | 3016 | # -*- 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 |
jbzdak/edx-platform | openedx/core/djangoapps/common_views/xblock.py | 33 | 1260 | """
Common views dedicated to rendering xblocks.
"""
from __future__ import absolute_import
import logging
import mimetypes
import pkg_resources
from xblock.core import XBlock
from django.conf import settings
from django.http import Http404, HttpResponse
log = logging.getLogger(__name__)
def xblock_resource(requ... | agpl-3.0 |
eneldoserrata/marcos_openerp | addons/stock/__init__.py | 64 | 1142 | # -*- 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 |
fritzSF/superdesk | server/apps/validate/validate.py | 7 | 2396 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import loggi... | agpl-3.0 |
RealImpactAnalytics/airflow | airflow/migrations/versions/127d2bf2dfa7_add_dag_id_state_index_on_dag_run_table.py | 9 | 1287 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
cruzegoodin/TSC-ShippingDetails | flask/lib/python2.7/site-packages/setuptools/__init__.py | 242 | 5033 | """Extensions to the 'distutils' for large or complex distributions"""
import os
import distutils.core
import distutils.filelist
from distutils.core import Command as _Command
from distutils.util import convert_path
from fnmatch import fnmatchcase
import setuptools.version
from setuptools.extension import Extension
f... | bsd-3-clause |
SebastianMerz/calalert | Server/venv/lib/python2.7/site-packages/unittest2/case.py | 153 | 42780 | """Test case implementation"""
import sys
import difflib
import pprint
import re
import unittest
import warnings
from unittest2 import result
from unittest2.util import (
safe_repr, safe_str, strclass,
unorderable_list_difference
)
from unittest2.compatibility import wraps
__unittest = True
DIFF_OMITTED =... | gpl-2.0 |
mtr/ttpd | lib/TTP/payex_prod/PxSms_types.py | 1 | 11060 | ##################################################
# file: PxSms_types.py
#
# schema types generated by "ZSI.generate.wsdl2python.WriteServiceModule"
# /usr/bin/wsdl2py external.payex.com-pxsms.wsdl
#
##################################################
import ZSI
import ZSI.TCcompound
from ZSI.schema import LocalEle... | gpl-3.0 |
akash1808/tempest | tempest/api/identity/v2/test_api_discovery.py | 22 | 2309 | # Copyright 2015 OpenStack Foundation.
# Copyright 2015, Red Hat, 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
#
# U... | apache-2.0 |
pelikanchik/edx-platform | lms/djangoapps/dashboard/management/commands/tests/test_git_add_course.py | 1 | 4559 | """
Provide tests for git_add_course management command.
"""
import unittest
import os
import shutil
import StringIO
import subprocess
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import CommandError
from django.test.utils import override_settings
... | agpl-3.0 |
gtoonstra/airflow | tests/contrib/hooks/test_bigquery_hook.py | 4 | 17580 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
zzacharo/inspire-next | inspirehep/modules/fixtures/users.py | 3 | 4337 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | gpl-3.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/lepl/_example/phone_words.py | 2 | 2192 |
# The contents of this file are subject to the Mozilla Public License
# (MPL) Version 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# b... | agpl-3.0 |
pvagner/orca | src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py | 2 | 6752 | # Orca
#
# Copyright 2005-2009 Sun Microsystems Inc.
# Copyright 2010 Joanmarie Diggs
#
# 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.1 of the License, or (at your op... | lgpl-2.1 |
BaichuanWu/Blog_on_django | site-packages/django/contrib/auth/models.py | 1 | 17175 | from __future__ import unicode_literals
from django.core.mail import send_mail
from django.core import validators
from django.db import models
from django.db.models.manager import EmptyManager
from django.utils.crypto import get_random_string, salted_hmac
from django.utils import six
from django.utils.translation impo... | mit |
resmo/ansible | lib/ansible/module_utils/network/vyos/config/lldp_global/lldp_global.py | 18 | 8716 | # Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The vyos_lldp_global class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessary to bring the current confi... | gpl-3.0 |
Neural-Network/TicTacToe | pybrain/rl/explorers/explorer.py | 28 | 1600 | __author__ = "Thomas Rueckstiess, ruecksti@in.tum.de"
from pybrain.structure.modules.module import Module
class Explorer(Module):
""" An Explorer object is used in Agents, receives the current state
and action (from the controller Module) and returns an explorative
action that is executed instea... | bsd-3-clause |
DARKPOP/external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/layout_tests/servers/apache_http_unittest.py | 59 | 3069 | # Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
OpenState-SDN/ryu | ryu/services/protocols/bgp/signals/base.py | 27 | 1031 | import logging
LOG = logging.getLogger('bgpspeaker.signals.base')
class SignalBus(object):
def __init__(self):
self._listeners = {}
def emit_signal(self, identifier, data):
identifier = _to_tuple(identifier)
LOG.debug('SIGNAL: %s emited with data: %s ', identifier, data)
for f... | apache-2.0 |
emon10005/scikit-image | skimage/segmentation/tests/test_quickshift.py | 24 | 1760 | import numpy as np
from numpy.testing import assert_equal, assert_array_equal
from nose.tools import assert_true
from skimage._shared.testing import assert_greater, test_parallel
from skimage.segmentation import quickshift
@test_parallel()
def test_grey():
rnd = np.random.RandomState(0)
img = np.zeros((20, 21... | bsd-3-clause |
tsinghuariit/DMP | project_src/app/translate.py | 4 | 2454 | try:
import httplib # Python 2
except ImportError:
import http.client as httplib # Python 3
try:
from urllib import urlencode # Python 2
except ImportError:
from urllib.parse import urlencode # Python 3
import json
from app import app
from flask_babel import gettext
from config import MS_TRANSLATOR_... | apache-2.0 |
neuroidss/nupic.research | projects/sequence_prediction/discrete_sequences/tdnn/suite.py | 4 | 14386 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, 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 |
wfxiang08/changes | tests/changes/lib/test_build_context_lib.py | 2 | 6493 | from datetime import datetime
from changes.config import db
from changes.constants import Result
from changes.models.log import LogSource, LogChunk
from changes.lib import build_context_lib
from changes.testutils.cases import TestCase
class GetTitleTestCase(TestCase):
def test_get_title(self):
self.asser... | apache-2.0 |
LeoGe/whattelcopybot | whatsapp_bot.py | 1 | 6093 | from yowsup.layers import YowParallelLayer
from yowsup.layers.auth import YowAuthenticationProtocolLayer
from yowsup.layers.protocol_messages import YowMessagesProtocolLayer
from yowsup.layers.protocol_receipts import YowReceiptProtocolLayer
from yo... | mit |
Fiedzia/pyes | tests/test_serialize.py | 5 | 3073 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import unittest
from pyes.tests import ESTestCase
from pyes.query import TermQuery, RangeQuery
from pyes.utils import ESRange
from datetime import datetime
class SerializationTestCase(ESTestCase):
def setUp(self):
super(SerializationTestCase, s... | bsd-3-clause |
splodingsocks/iTerm2 | tools/ply/ply-3.4/example/BASIC/basic.py | 166 | 1533 | # An implementation of Dartmouth BASIC (1964)
#
import sys
sys.path.insert(0,"../..")
if sys.version_info[0] >= 3:
raw_input = input
import basiclex
import basparse
import basinterp
# If a filename has been specified, we try to run it.
# If a runtime error occurs, we bail out and enter
# interactive mode below
... | gpl-2.0 |
40223117cda/w16cdaa | static/Brython3.1.0-20150301-090019/Lib/zipfile.py | 620 | 66368 | """
Read and write ZIP files.
XXX references to utf-8 need further investigation.
"""
import io
import os
import re
import imp
import sys
import time
import stat
import shutil
import struct
import binascii
try:
import zlib # We may need its compression method
crc32 = zlib.crc32
except ImportError:
zlib =... | gpl-3.0 |
mitchcapper/mythbox | resources/lib/twisted/twisted/conch/test/test_transport.py | 7 | 71487 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for ssh/transport.py and the classes therein.
"""
try:
import pyasn1
except ImportError:
pyasn1 = None
try:
import Crypto.Cipher.DES3
except ImportError:
Crypto = None
if pyasn1 is None or Crypto is None:
... | gpl-2.0 |
RachitKansal/scikit-learn | sklearn/utils/arpack.py | 265 | 64837 | """
This contains a copy of the future version of
scipy.sparse.linalg.eigen.arpack.eigsh
It's an upgraded wrapper of the ARPACK library which
allows the use of shift-invert mode for symmetric matrices.
Find a few eigenvectors and eigenvalues of a matrix.
Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/
"""
#... | bsd-3-clause |
nilbody/h2o-3 | h2o-py/h2o/display.py | 2 | 2682 | import tabulate
class H2ODisplay(object):
"""Pretty printing for H2O Objects.
Handles both IPython and vanilla console display
"""
THOUSANDS = "{:,}"
def __init__(self,table=None,header=None,table_header=None,**kwargs):
self.table_header=table_header
self.header=header
self.table=table
self... | apache-2.0 |
CSC-ORG/Dynamic-Dashboard-2015 | engine/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.py | 1002 | 25650 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os... | mit |
ljgabc/lfs | usr/lib/python2.7/rlcompleter.py | 175 | 5866 | """Word completion for GNU readline 2.0.
This requires the latest extension to the readline module. The completer
completes keywords, built-ins and globals in a selectable namespace (which
defaults to __main__); when completing NAME.NAME..., it evaluates (!) the
expression up to the last dot and completes its attribut... | gpl-2.0 |
neuropoly/spinalcordtoolbox | spinalcordtoolbox/image.py | 1 | 61190 | #!/usr/bin/env python
#########################################################################################
#
# SCT Image API
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2018 Polytechnique Montreal <www.neuro.polymtl.ca>
#
# About the license: see the ... | mit |
kuiwei/kuiwei | common/djangoapps/student/migrations/0038_auto__add_usersignupsource.py | 28 | 13942 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserSignupSource'
db.create_table('student_usersignupsource', (
('id', self.gf('... | agpl-3.0 |
cahirwpz/demoscene | effects/neons/data/neons.py | 1 | 1165 | #!/usr/bin/env python3
from PIL import Image
from utils import lerp
import sys
if __name__ == "__main__":
width = 320
height = 256
A = 128
B = 64
pal = []
for i in range(2):
pal.extend([0, 0, 0])
for i in range(6):
c = int(lerp(0, 15, float(i) / 5))
c = (c << 4) ... | artistic-2.0 |
antonioUnina/neutron | neutron/db/migration/alembic_migrations/versions/10cd28e692e9_nuage_extraroute.py | 15 | 1717 | # Copyright 2014 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 |
Nildram/rp | scripts/extract_archive_from_universal_bin.py | 46 | 1971 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# extract_archives_from_universal_bin.py - It extracts the binaries embeded into a Universal Binary Mach-o
# Copyright (C) 2012 Axel "0vercl0k" Souchet - http://www.twitter.com/0vercl0k
#
# This program is free software: you can redistribute it and/or modify
# ... | gpl-3.0 |
nyuszika7h/youtube-dl | youtube_dl/extractor/porn91.py | 14 | 2116 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
parse_duration,
int_or_none,
ExtractorError,
)
class Porn91IE(InfoExtractor):
IE_NAME = '91porn'
_VALID_URL = r'(?:https?://)(?:www\.|)91porn\.com/.+?\?viewkey=(?P<id>[\w\d]+)'
_TE... | unlicense |
kshmirko/pysolar-py3 | Pysolar/util.py | 1 | 26376 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright Brandon Stafford
#
# This file is part of Pysolar.
#
# Pysolar is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the... | gpl-3.0 |
afandria/sky_engine | build/ios/PRESUBMIT.py | 49 | 1358 | # 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.
import os
"""Chromium presubmit script for src/tools/ios.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details ... | bsd-3-clause |
emoon/prodbg-third-party | src/wxWidgets/misc/scripts/update_doc_utils.py | 5 | 1769 | ##############################################################################
# Name: misc/scripts/update_doc_utils.py
# Purpose: base utilities for others update_doc_*.py scripts
# Created: 2007-08-1
# Copyright: (c) 2007 Francesco Montorsi
# Licence: wxWindows licence
################################... | mit |
f0rki/cb-multios | original-challenges/stack_vm/poller/for-release/machine.py | 1 | 3755 | #!/usr/bin/env python
#
# Copyright (C) 2014 Narf Industries <info@narfindustries.com>
#
# 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
# th... | mit |
highweb-project/highweb-webcl-html5spec | content/test/gpu/gpu_tests/gpu_test_expectations_unittest.py | 12 | 8015 | # Copyright 2015 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 unittest
from telemetry.internal.platform import system_info
from telemetry.page import page as page_module
from telemetry.story import story_set
fro... | bsd-3-clause |
laperry1/android_external_chromium_org | third_party/yasm/run_yasm.py | 123 | 1830 | # Copyright 2014 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.
"""A wrapper to run yasm.
Its main job is to provide a Python wrapper for GN integration, and to write
the makefile-style output yasm generates in stdout to... | bsd-3-clause |
sestrella/ansible | test/units/executor/test_play_iterator.py | 22 | 18258 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
j-carl/ansible | test/support/integration/plugins/modules/ec2_vpc_subnet.py | 53 | 23063 | #!/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': ['stableinterf... | gpl-3.0 |
EDUlib/edx-platform | openedx/core/djangoapps/content/course_overviews/tests/test_tasks.py | 4 | 1982 | # lint-amnesty, pylint: disable=missing-module-docstring
from unittest import mock
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from ..tasks import enqueue_async_course_overview_upd... | agpl-3.0 |
dkubiak789/OpenUpgrade | addons/account_followup/report/__init__.py | 447 | 1108 | # -*- 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 |
Jgarcia-IAS/Fidelizacion_odoo | openerp/addons/crm/wizard/crm_phonecall_to_meeting.py | 381 | 2704 | # -*- 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 |
freedomtan/tensorflow | tensorflow/python/data/experimental/kernel_tests/scan_test.py | 7 | 11128 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
irinagrigorescu/bad_boids | boids/record_fixture.py | 1 | 5261 | from argparse import ArgumentParser
import sys
import yaml
import numpy as np
import flock as fl
# Fly towards the middle fixture file generator
def record_fixture_fly_towards_the_middle(config_file, fixture_file):
# Initial positions
boids = fl.Flock(config_file)
positions = boids.get_positions().tolist... | mit |
nuwainfo/treeio | news/ajax.py | 3 | 1124 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
News ajax views
"""
from dajaxice.core import dajaxice_functions
from dajax.core import Dajax
from django.template import RequestContext
from django.db.models import Q
from treeio.core.rendering import... | mit |
cmcantalupo/geopm | integration/experiment/uncore_frequency_sweep/uncore_frequency_sweep.py | 1 | 7067 | #!/usr/bin/env python
#
# Copyright (c) 2015 - 2021, Intel Corporation
#
# 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, thi... | bsd-3-clause |
billvsme/videoSpider | webs/douban/tasks/down_celebrity_images.py | 1 | 1702 | # -*- coding: utf-8 -*-
import ast
import os
import requests
import models
from config import config, sqla
from gevent.pool import Pool
from helpers import random_str, down
base_path = config.get('photo', 'path')
base_path = os.path.join(base_path, 'celebrity')
cookies = {
'bid': ''
}
def create_down(str_u... | mit |
xguse/ggplot | ggplot/stats/stat_bin2d.py | 4 | 2678 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import defaultdict
import pandas as pd
import numpy as np
from ggplot.utils import make_iterable_ntimes
from .stat import stat
_MSG_STATUS = """stat_bin2d is still under construction.
The re... | bsd-2-clause |
BrainIntensive/OnlineBrainIntensive | resources/HCP/mne-hcp/tutorials/plot_temporal_searchlight_decoding.py | 3 | 3094 | # -*- coding: utf-8 -*-
"""
.. _tut_searchlight_decoding:
=======================================================
Run temporal searchlight decoding on event related data
=======================================================
In this tutorial we show how to run a temporal window decoding
on event related data. We'll ... | mit |
briceburg/airflow | airflow/operators/hive_to_mysql.py | 29 | 2324 | import logging
from airflow.hooks import HiveServer2Hook, MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class HiveToMySqlTransfer(BaseOperator):
"""
Moves data from Hive to MySQL, note that for now the data is loaded
into memory before being pushed to MySQL, s... | apache-2.0 |
you21979/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/openbugs.py | 124 | 2780 | # Copyright (c) 2010 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 |
onaio/kpi | kobo/settings.py | 1 | 16558 | """
Django settings for kobo project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
from django.conf import global_settings
import os
import dj_database_url
im... | agpl-3.0 |
coreycb/horizon | openstack_dashboard/dashboards/project/access_and_security/security_groups/tests.py | 4 | 36833 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
hintikka/dl-sentence-classification | data_helpers.py | 1 | 5601 | import numpy as np
import re
import itertools
import json
from collections import Counter
def clean_str(string):
"""
Tokenization/string cleaning for all datasets except for SST.
Original taken from https://github.com/yoonkim/CNN_sentence/blob/master/process_data.py
"""
string = re.sub(r"[^A-Za-z0... | apache-2.0 |
mcameron/ansible-modules-extras | cloud/cloudstack/cs_network.py | 33 | 17539 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.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 Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | gpl-3.0 |
barma1309/Kalista | .virtualenvs/Kalista/lib/python3.4/site-packages/django/templatetags/i18n.py | 219 | 19311 | from __future__ import unicode_literals
import sys
from django.conf import settings
from django.template import Library, Node, TemplateSyntaxError, Variable
from django.template.base import TOKEN_TEXT, TOKEN_VAR, render_value_in_context
from django.template.defaulttags import token_kwargs
from django.utils import six... | gpl-3.0 |
amchagas/python-neo | doc/source/images/generate_diagram.py | 7 | 7892 | # -*- coding: utf-8 -*-
"""
This generate diagram in .png and .svg from neo.core
Author: sgarcia
"""
from datetime import datetime
import numpy as np
import quantities as pq
from matplotlib import pyplot
from matplotlib.patches import Rectangle, ArrowStyle, FancyArrowPatch
from matplotlib.font_manager import FontP... | bsd-3-clause |
nicoboss/Floatmotion | OpenGL/GL/AMD/seamless_cubemap_per_texture.py | 9 | 2229 | '''OpenGL extension AMD.seamless_cubemap_per_texture
This module customises the behaviour of the
OpenGL.raw.GL.AMD.seamless_cubemap_per_texture to provide a more
Python-friendly API
Overview (from the spec)
In unextended OpenGL, cube maps are treated as sets of six, independent
texture images. Once a face is se... | agpl-3.0 |
gxyang/hstore | third_party/python/boto/emr/connection.py | 9 | 13794 | # Copyright (c) 2010 Spotify AB
# Copyright (c) 2010-2011 Yelp
#
# 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, m... | gpl-3.0 |
jbzdak/edx-platform | common/djangoapps/student/helpers.py | 22 | 10559 | """Helpers for the student app. """
from datetime import datetime
import urllib
from pytz import UTC
from django.core.urlresolvers import reverse, NoReverseMatch
import third_party_auth
from lms.djangoapps.verify_student.models import VerificationDeadline, SoftwareSecurePhotoVerification
from course_modes.models impo... | agpl-3.0 |
allanlewis/behave | bin/jsonschema_validate.py | 13 | 3704 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Validate a JSON file against its JSON schema.
SEE ALSO:
* https://python-jsonschema.readthedocs.org/
* https://python-jsonschema.readthedocs.org/en/latest/errors.html
REQUIRES:
Python >= 2.6
jsonschema >= 1.3.0
argparse
"""
from __future__ import absolute... | bsd-2-clause |
aorzh/django-blog-zinnia | zinnia/templatetags/zinnia.py | 6 | 16406 | """Template tags and filters for Zinnia"""
import re
from hashlib import md5
from datetime import date
try:
from urllib.parse import urlencode
except ImportError: # Python 2
from urllib import urlencode
from django.db.models import Q
from django.db.models import Count
from django.conf import settings
from dja... | bsd-3-clause |
jazztpt/edx-platform | openedx/core/lib/xblock_utils.py | 80 | 15736 | """
Functions that can are used to modify XBlock fragments for use in the LMS and Studio
"""
import datetime
import json
import logging
import static_replace
import uuid
import markupsafe
from lxml import html, etree
from contracts import contract
from django.conf import settings
from django.utils.timezone import UTC... | agpl-3.0 |
awsdocs/aws-doc-sdk-examples | python/example_code/iotthingsgraph/camera.py | 1 | 6857 | #
# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This file is licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# This file is... | apache-2.0 |
davilla/mrmc | lib/libUPnP/Neptune/Extras/Tools/Logging/NeptuneLogConsole.py | 265 | 2923 | #!/usr/bin/env python
from socket import *
from optparse import OptionParser
UDP_ADDR = "0.0.0.0"
UDP_PORT = 7724
BUFFER_SIZE = 65536
#HEADER_KEYS = ['Logger', 'Level', 'Source-File', 'Source-Function', 'Source-Line', 'TimeStamp']
HEADER_KEYS = {
'mini': ('Level'),
'standard': ('Logger', 'Level', 'Source-Func... | gpl-2.0 |
rockyzhang/zhangyanhit-python-for-android-mips | python3-alpha/python3-src/Lib/msilib/sequence.py | 175 | 3929 | AdminExecuteSequence = [
('InstallInitialize', None, 1500),
('InstallFinalize', None, 6600),
('InstallFiles', None, 4000),
('InstallAdminPackage', None, 3900),
('FileCost', None, 900),
('CostInitialize', None, 800),
('CostFinalize', None, 1000),
('InstallValidate', None, 1400),
]
AdminUISequence = [
('FileCost', None,... | apache-2.0 |
DanaOshri/Open-Knesset | simple/management/commands/syncdata.py | 5 | 89175 | # -*- coding: utf-8 -*-
import urllib2, urllib, cookielib, re, gzip, datetime, time, logging, os, sys,traceback, difflib
from cStringIO import StringIO
from pyth.plugins.rtf15.reader import Rtf15Reader
from optparse import make_option
from django.core.management.base import NoArgsCommand
from django.conf import setti... | bsd-3-clause |
kennedyshead/home-assistant | tests/components/http/test_security_filter.py | 8 | 2776 | """Test security filter middleware."""
from aiohttp import web
import pytest
import urllib3
from homeassistant.components.http.security_filter import setup_security_filter
async def mock_handler(request):
"""Return OK."""
return web.Response(text="OK")
@pytest.mark.parametrize(
"request_path,request_pa... | apache-2.0 |
scipy/scipy | scipy/integrate/_ivp/lsoda.py | 12 | 7989 | import numpy as np
from scipy.integrate import ode
from .common import validate_tol, validate_first_step, warn_extraneous
from .base import OdeSolver, DenseOutput
class LSODA(OdeSolver):
"""Adams/BDF method with automatic stiffness detection and switching.
This is a wrapper to the Fortran solver from ODEPACK... | bsd-3-clause |
emersonsoftware/ansiblefork | lib/ansible/module_utils/gce.py | 94 | 2535 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
leiferikb/bitpop | build/third_party/twisted_10_2/twisted/python/lockfile.py | 61 | 6409 | # -*- test-case-name: twisted.test.test_lockfile -*-
# Copyright (c) 2005 Divmod, Inc.
# Copyright (c) 2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Filesystem-based interprocess mutex.
"""
__metaclass__ = type
import errno, os
from time import time as _uniquefloat
def unique():
return str(l... | gpl-3.0 |
benvermaercke/klustakwik2 | klustakwik2/numerics/cylib/masks.py | 2 | 1095 | from numpy import *
from .masks_cy import *
from random import shuffle
__all__ = ['sort_masks', 'mask_start_clusters']
def sort_masks(raw_data):
# step 1: sort into lexicographical order of masks
O = raw_data.offsets
I = raw_data.unmasked
start = zeros(len(O)-1, dtype=int)
end = zeros(l... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.