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 |
|---|---|---|---|---|---|
holgerd77/django-dynamic-scraper | tests/scraper/models.py | 1 | 1421 | #Stage 2 Update (Python 3)
from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from builtins import str
from django.db import models
from dynamic_scraper.models import Scraper, SchedulerRuntime
from scrapy_djangoitem import DjangoItem
@python_2_unicode_compatible
clas... | bsd-3-clause |
mjirik/io3d | io3d/misc.py | 1 | 8466 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# import sys
import os
from loguru import logger
import sys
import os.path
import numpy as np
from io import open
from .image import DataPlus
path_to_script = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(path_to_script, "./extern/sPickle"))
... | mit |
mwatts15/YAROM | examples/adding_data.py | 1 | 1499 | import yarom as Y
import rdflib
Y.connect({'rdf.namespace': rdflib.Namespace("http://example.org/")})
def p1():
mary = Y.DataObject(key='mary')
fido = Y.DataObject(key='fido')
mary.relate('has_pet', fido)
mary.relate('age', Y.Quantity(23, 'years'))
mary.relate('email', "mary@example.org")
Y.pri... | bsd-3-clause |
lrq3000/neuro_experiments_tools | utils/asciirename/unidecode/x072.py | 252 | 4659 | data = (
'He ', # 0x00
'Lan ', # 0x01
'Biao ', # 0x02
'Rong ', # 0x03
'Li ', # 0x04
'Mo ', # 0x05
'Bao ', # 0x06
'Ruo ', # 0x07
'Lu ', # 0x08
'La ', # 0x09
'Ao ', # 0x0a
'Xun ', # 0x0b
'Kuang ', # 0x0c
'Shuo ', # 0x0d
'[?] ', # 0x0e
'Li ', # 0x0f
'Lu ', # 0x10
'Jue ', ... | mit |
837468220/python-for-android | python3-alpha/python3-src/Lib/distutils/filelist.py | 46 | 12462 | """distutils.filelist
Provides the FileList class, used for poking about the filesystem
and building lists of files.
"""
import os, re
import fnmatch
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsInternalError
from distutils import log
class FileList:
"""A ... | apache-2.0 |
tensorflow/tensorflow | tensorflow/python/kernel_tests/linalg/linear_operator_lower_triangular_test.py | 14 | 4757 | # 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 |
ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/google/protobuf/compiler/plugin_pb2.py | 2 | 10739 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/compiler/plugin.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf imp... | mit |
feincms/feincms-links | setuplib.py | 3 | 1871 | import os
__all__ = ['find_files']
def fullsplit(path, result=None):
"""
Split a pathname into components (the opposite of os.path.join) in a
platform-neutral way.
"""
if result is None:
result = []
head, tail = os.path.split(path)
if head == '':
return [tail] + result
... | bsd-3-clause |
danakj/chromium | tools/memory_inspector/memory_inspector/backends/native_heap_dump_parser.py | 89 | 1806 | # 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.
"""This parser turns the heap_dump output into a |NativeHeap| object."""
import json
from memory_inspector.core import native_heap
from memory_inspector.co... | bsd-3-clause |
toastedcornflakes/scikit-learn | sklearn/linear_model/tests/test_base.py | 83 | 15089 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from scipy import linalg
from itertools import product
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils... | bsd-3-clause |
smmribeiro/intellij-community | python/helpers/pycharm/_jb_pytest_runner.py | 3 | 1533 | # coding=utf-8
import sys
import pytest
from _pytest.config import get_plugin_manager
from pkg_resources import iter_entry_points
from _jb_runner_tools import jb_patch_separator, jb_doc_args, JB_DISABLE_BUFFERING, start_protocol, parse_arguments, \
set_parallel_mode
from teamcity import pytest_plugin
if __name_... | apache-2.0 |
nitin-cherian/Webapps | SimpleIsBetterThanComplex.com/myproject/.env/lib/python3.5/site-packages/pip/utils/hashes.py | 517 | 2866 | from __future__ import absolute_import
import hashlib
from pip.exceptions import HashMismatch, HashMissing, InstallationError
from pip.utils import read_chunks
from pip._vendor.six import iteritems, iterkeys, itervalues
# The recommended hash algo of the moment. Change this whenever the state of
# the art changes; ... | mit |
markslwong/tensorflow | tensorflow/contrib/metrics/python/metrics/classification.py | 111 | 2647 | # 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 |
joram/sickbeard-orange | lib/hachoir_core/stream/input_helper.py | 90 | 1546 | from lib.hachoir_core.i18n import getTerminalCharset, guessBytesCharset, _
from lib.hachoir_core.stream import InputIOStream, InputSubStream, InputStreamError
def FileInputStream(filename, real_filename=None, **args):
"""
Create an input stream of a file. filename must be unicode.
real_filename is an opti... | gpl-3.0 |
Jonekee/chromium.src | build/android/pylib/linker/test_runner.py | 14 | 3154 | # 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.
"""Runs linker tests on a particular device."""
import logging
import os.path
import sys
import traceback
from pylib import constants
from pylib.base impor... | bsd-3-clause |
marcwebbie/youtube-dl | youtube_dl/extractor/neteasemusic.py | 87 | 17336 | # coding: utf-8
from __future__ import unicode_literals
from hashlib import md5
from base64 import b64encode
from datetime import datetime
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlencode,
compat_str,
compat_itertools_count,
)
from ..utils import (
sanit... | unlicense |
Sofronio/youtube-dl-gui | youtube_dl_gui/widgets.py | 2 | 13180 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
import sys
try:
import wx
except ImportError as error:
print error
sys.exit(1)
def crt_command_event(event_type, event_id=0):
"""Shortcut to create command events."""
return wx.CommandEvent(event_type.typeId, ... | unlicense |
Darkmer/masterchief | CourseBuilderenv/lib/python2.7/site-packages/pip/_vendor/requests/__init__.py | 209 | 1856 | # -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('http://python.org')
>>> r.sta... | mit |
sqlalchemy/sqlalchemy | test/orm/inheritance/test_relationship.py | 3 | 88911 | from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy.orm import aliased
from sqlalchemy.orm import backref
from sqlalchemy.orm import configure_mappers
from sqlalchemy.orm i... | mit |
jounex/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/db/backends/spatialite/operations.py | 47 | 15372 | import re
import sys
from decimal import Decimal
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter
from django.contrib.gis.geometry.backe... | apache-2.0 |
sergei-maertens/django | django/core/files/uploadedfile.py | 67 | 4193 | """
Classes representing uploaded files.
"""
import errno
import os
from io import BytesIO
from django.conf import settings
from django.core.files import temp as tempfile
from django.core.files.base import File
from django.utils.encoding import force_str
__all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryU... | bsd-3-clause |
ccpgames/eve-metrics | web2py/applications/welcome/languages/cs.py | 52 | 23580 | # coding: utf8
{
'!langcode!': 'cs-cz',
'!langname!': 'čeština',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': 'Kolonka "Upravit" je nepovinný výraz, například "pole1=\'nováhodnota\'". Výsledky databázového JOINu nemůžete mazat ani upravovat.',
... | mit |
ccd-utexas/OLD-MAID | ProEMOnline.py | 2 | 57911 | # -*- coding: utf-8 -*-
"""
This scripts sets an initial layout for the ProEMOnline software. It uses the
PyQtGraph dockarea system and was designed from the dockarea.py example.
Keaton wrote this.
"""
#Import everything you'll need
from __future__ import absolute_import, division
import pyqtgraph as pg
from pyqtgr... | mit |
daviddao/luminosity | sklearn-server/flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## 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... | bsd-3-clause |
thaumos/ansible | lib/ansible/modules/network/fortios/fortios_firewall_ssl_server.py | 24 | 12328 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
archifix/settings | sublime/Packages/Jedi - Python autocompletion/dependencies/jedi/__init__.py | 1 | 1830 | """
Jedi is a static analysis tool for Python that can be used in IDEs/editors. Its
historic focus is autocompletion, but does static analysis for now as well.
Jedi is fast and is very well tested. It understands Python on a deeper level
than all other static analysis frameworks for Python.
Jedi has support for two di... | mit |
opoplawski/ansible | contrib/inventory/zone.py | 138 | 1466 | #!/usr/bin/env python
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
#
# 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 |
michellemorales/OpenMM | models/neural_gpu/neural_gpu_trainer.py | 16 | 45097 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | gpl-2.0 |
GaetanCambier/spksrc | spk/gentoo-chroot/src/app/application/auth.py | 119 | 2088 | # -*- coding: utf-8 -*-
from collections import namedtuple
from flask import abort, request
from functools import wraps, partial
from subprocess import check_output
import grp
import os
import pwd
__all__ = ['authenticate', 'requires_auth']
def authenticate():
"""Authenticate a user using Synology's authenticat... | bsd-3-clause |
vivaxy/algorithms | python/problems/prime_number_of_set_bits_in_binary_representation.py | 1 | 1089 | """
https://leetcode.com/problems/prime-number-of-set-bits-in-binary-representation/
https://leetcode.com/submissions/detail/136523875/
"""
class Solution:
def countPrimeSetBits(self, L, R):
"""
:type L: int
:type R: int
:rtype: int
"""
def isPrime(n):
... | mit |
Bismarrck/tensorflow | tensorflow/compiler/tests/nullary_ops_test.py | 19 | 2828 | # 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 |
saurabh6790/-aimobilize-lib | core/doctype/custom_field/custom_field.py | 16 | 3874 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, cstr
from webnotes import _
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def autoname(self... | mit |
Distrotech/sogo | Tests/Integration/test-ui-posts.py | 2 | 2154 | #!/usr/bin/python
from config import hostname, port, username, password, \
webCalendarURL
import simplejson
import sogoLogin
import sogotests
import unittest
import utilities
import webdavlib
import httplib
class UIPostsTests(unittest.TestCase):
def setUp(self):
self.client = webdavlib.We... | lgpl-2.1 |
mdboom/asv | asv/config.py | 1 | 2409 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import sys
import six
from . import util
# TODO: Some verification of the config values
class Config(object)... | bsd-3-clause |
openstack/tempest-lib | tempest_lib/api_schema/response/compute/v2_1/availability_zone.py | 33 | 2750 | # Copyright 2014 NEC Corporation. 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 |
hpandeycodeit/incubator-madlib | src/madpack/yaml/nodes.py | 985 | 1440 |
class Node(object):
def __init__(self, tag, value, start_mark, end_mark):
self.tag = tag
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
value = self.value
#if isinstance(value, list):
# if len(value) == 0:
... | apache-2.0 |
sutartmelson/girder | tests/cases/notification_test.py | 3 | 6332 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You may obtain a cop... | apache-2.0 |
noba3/KoTos | addons/plugin.video.7tv/resources/lib/nightcrawler/http/api.py | 4 | 6953 | __author__ = 'bromix'
import uuid
import urllib
import urllib2
from StringIO import StringIO
import gzip
import json as real_json
# nightcrawler
from .. import utils
class ErrorHandler(urllib2.HTTPDefaultErrorHandler):
def __init__(self):
pass
def http_error_default(self, req, fp, code, msg, hdrs):... | gpl-2.0 |
fountainhead-gq/DjangoBlog | blogproject/urls.py | 1 | 1922 | """blogproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | gpl-2.0 |
kiith-sa/QGIS | python/plugins/processing/admintools/geoserver/support.py | 6 | 7825 | # -*- coding: utf-8 -*-
"""
***************************************************************************
support.py
---------------------
Date : November 2012
Copyright : (C) 2012 by David Winslow
Email : dwins at opengeo dot com
****************************... | gpl-2.0 |
BeyondTheClouds/nova | nova/tests/unit/api/openstack/compute/test_hypervisor_status.py | 32 | 3825 | # Copyright 2014 Intel 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 required by applicable law or agreed... | apache-2.0 |
hasgeek/boxoffice | migrations/versions/253e7b76eb8e_modify_assignee.py | 1 | 2138 | """modify assignee.
Revision ID: 253e7b76eb8e
Revises: 1ea1e8070ac8
Create Date: 2016-04-11 20:15:52.864916
"""
# revision identifiers, used by Alembic.
revision = '253e7b76eb8e'
down_revision = '1ea1e8070ac8'
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
def upgrade():
op.add_column(... | agpl-3.0 |
ediston/energi | qa/rpc-tests/spentindex.py | 40 | 5001 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test addressindex generation and fetching
#
import time
from test_framework.test_framework import Bi... | mit |
rmhsawyer/EC601-Project1 | adversarial_text/data/gen_vocab.py | 8 | 3254 | # 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... | apache-2.0 |
imajes/Sick-Beard | lib/hachoir_parser/guess.py | 90 | 3940 | """
Parser list managment:
- createParser() find the best parser for a file.
"""
import os
from lib.hachoir_core.error import warning, info, HACHOIR_ERRORS
from lib.hachoir_parser import ValidateError, HachoirParserList
from lib.hachoir_core.stream import FileInputStream
from lib.hachoir_core.i18n import _
class Que... | gpl-3.0 |
zsiciarz/django | tests/auth_tests/models/custom_user.py | 21 | 3778 | from django.contrib.auth.models import (
AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission,
PermissionsMixin, UserManager,
)
from django.db import models
# The custom user uses email as the unique identifier, and requires
# that every user provide a date of birth. This lets us test
# changes ... | bsd-3-clause |
lykops/lykops | library/frontend/__init__.py | 1 | 13604 | import logging
from library.config.frontend import adminuser
from library.config.security import vault_header
from library.connecter.database.mongo import Op_Mongo
from library.connecter.database.redis_api import Op_Redis
from library.security.encryption.AES256.api import Using_AES256
from library.security.password im... | apache-2.0 |
loulich/Couchpotato | libs/pyutil/odict.py | 106 | 20991 | # Copyright (c) 2002-2009 Zooko "Zooko" Wilcox-O'Hearn
"""
This module offers a Ordered Dict, which is a dict that preserves
insertion order. See PEP 372 for description of the problem. This
implementation uses a linked-list to get good O(1) asymptotic
performance. (Actually it is O(hashtable-update-cost), but wha... | gpl-3.0 |
morpheby/ist303-miye | controllers/home_view.py | 1 | 1418 | """
home_view.py
ist303-miye
Copyright (C) 2017
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 distribut... | gpl-3.0 |
facebookexperimental/eden | build/fbcode_builder/getdeps/test/platform_test.py | 11 | 1271 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from ..platform import HostType
class P... | gpl-2.0 |
mdj2/django | django/conf/locale/hu/formats.py | 118 | 1118 | # -*- 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 = 'Y. F j.'
TIME_FORMAT = 'G.i.s'
DA... | bsd-3-clause |
adlius/osf.io | osf/models/action.py | 5 | 1878 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from include import IncludeManager
from osf.models.base import BaseModel, ObjectIDMixin
from osf.utils.workflows import DefaultStates, DefaultTriggers, ReviewStates, ReviewTriggers
from osf.utils import permissions
class B... | apache-2.0 |
udoyen/pythonlearning | reading_code/password_craacker_redone.py | 1 | 2533 | # Script Name : password_cracker.py
# Author : Craig Richards
# Created : 20 May 2013
# Last Modified :
# Version : 1.0
# Modifications :
# Description : Old school password cracker using python
import crypt # Import the module
def testPass(cryptPass): # Start the function
""" function to compare given pa... | mit |
Mixser/django | tests/forms_tests/widget_tests/test_textarea.py | 331 | 1313 | from django.forms import Textarea
from django.utils.safestring import mark_safe
from .base import WidgetTest
class TextareaTest(WidgetTest):
widget = Textarea()
def test_render(self):
self.check_html(self.widget, 'msg', 'value', html=(
'<textarea rows="10" cols="40" name="msg">value</tex... | bsd-3-clause |
skilledindia/autokey | src/lib/qtui/detectdialog.py | 50 | 2718 | #!/usr/bin/env python
# coding=UTF-8
#
# Generated by pykdeuic4 from detectdialog.ui on Sat Mar 10 13:47:59 2012
#
# WARNING! All changes to this file will be lost.
from PyKDE4 import kdecore
from PyKDE4 import kdeui
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
... | gpl-3.0 |
ciex/motor | application/forms.py | 1 | 1755 | """
forms.py
Web forms based on Flask-WTForms
See: http://flask.pocoo.org/docs/patterns/wtforms/
http://wtforms.simplecodes.com/
"""
import datetime
from flaskext import wtf
from flaskext.wtf import validators
from google.appengine.api import users
from models import Movement
class TimeDeltaField(wtf.Integer... | apache-2.0 |
zarafagroupware/zarafa-zsm | deploy.py | 1 | 6980 | #!/usr/bin/python
# Copyright 2012 - 2013 Zarafa B.V.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation with the following additional
# term according to sec. 7:
#
# According... | agpl-3.0 |
albertomurillo/ansible | lib/ansible/modules/cloud/google/gce_instance_template.py | 38 | 19054 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
... | gpl-3.0 |
davsebamse/skype4py | Skype4Py/utils.py | 21 | 24862 | """Utility functions and classes used internally by Skype4Py.
"""
__docformat__ = 'restructuredtext en'
import sys
import weakref
import threading
import logging
from new import instancemethod
__all__ = ['tounicode', 'path2unicode', 'unicode2path', 'chop', 'args2dict', 'quote',
'split', 'cndexp', 'EventH... | bsd-3-clause |
conejoninja/plugin.video.pelisalacarta | servers/documentary.py | 40 | 2839 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para documentary.es
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from cor... | gpl-3.0 |
lrem/chord.py | chord/peer.py | 1 | 9656 | #!/usr/bin/env python3
"""
Chord peer
==========
This module provides peer of a Chord distributed hash table.
"""
import random
import time
import socket
import socketserver
import threading
import logging
logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s',
level=logging.DEBUG)
CH... | mit |
kennedyshead/home-assistant | homeassistant/components/blueprint/schemas.py | 5 | 2875 | """Schemas for the blueprint integration."""
from typing import Any
import voluptuous as vol
from homeassistant.const import (
CONF_DEFAULT,
CONF_DESCRIPTION,
CONF_DOMAIN,
CONF_NAME,
CONF_PATH,
CONF_SELECTOR,
)
from homeassistant.core import callback
from homeassistant.helpers import config_va... | apache-2.0 |
evanphx/yoke | src/VBox/GuestHost/OpenGL/packer/packer_defs.py | 22 | 5685 | # Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
# This script generates the packer/packer.def file.
import sys
import cPickle
import apiutil
apiutil.CopyrightDef()
print "DESCRIPTION \"\""
print "EXPORTS"
keys = apiuti... | gpl-2.0 |
TimZaman/DIGITS | digits/tools/analyze_db.py | 3 | 6476 | #!/usr/bin/env python2
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
import argparse
from collections import Counter
import logging
import operator
import os.path
import sys
import time
# Find the best implementation available
try:
from cStringIO import StringIO
except ImportError:
from... | bsd-3-clause |
lamblin/pylearn2 | pylearn2/datasets/sparse_dataset.py | 44 | 6595 | """
.. todo::
WRITEME
"""
import functools
from pylearn2.datasets.dataset import Dataset
from pylearn2.utils import wraps
import logging
import numpy
import warnings
try:
import scipy.sparse
except ImportError:
warnings.warn("Couldn't import scipy.sparse")
import theano
import gzip
floatX = theano.config.... | bsd-3-clause |
chanyoonzhu/eatquik | urllib3/util/selectors.py | 138 | 21147 | # Backport of selectors.py from Python 3.5+ to support Python < 3.4
# Also has the behavior specified in PEP 475 which is to retry syscalls
# in the case of an EINTR error. This module is required because selectors34
# does not follow this behavior and instead returns that no dile descriptor
# events have occurred rath... | mit |
rcrowder/nupic | src/nupic/encoders/category.py | 6 | 8166 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
s20121035/rk3288_android5.1_repo | external/chromium_org/chrome/common/extensions/docs/server2/link_error_detector_test.py | 98 | 3030 | #!/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 unittest
from file_system import FileNotFoundError
from link_error_detector import LinkErrorDetector
from servlet import Respon... | gpl-3.0 |
xolox/python-rotate-backups | rotate_backups/cli.py | 1 | 14149 | # rotate-backups: Simple command line interface for backup rotation.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: May 17, 2020
# URL: https://github.com/xolox/python-rotate-backups
"""
Usage: rotate-backups [OPTIONS] [DIRECTORY, ..]
Easy rotation of backups based on the Python package by the same n... | mit |
chiviak/CouchPotatoServer | couchpotato/core/media/movie/providers/torrent/passthepopcorn.py | 59 | 1276 | from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.torrent.passthepopcorn import Base
from couchpotato.core.media.movie.providers.base import MovieProvider
log = CPLog(__name__)
autoload = 'PassThePopcorn'
class PassThePopcorn(MovieProvider, Base):
quality_search_params = {
... | gpl-3.0 |
OdooCommunityWidgets/website_multi_image | product_images.py | 3 | 1465 | from openerp import models, fields, api
class product_image(models.Model):
_name = 'product.image'
_order = 'sequence, id DESC'
name = fields.Char('Name')
description = fields.Text('Description')
sequence = fields.Integer('Sequence')
image_alt = fields.Text('Image Label')
image = fields.B... | mit |
Dhivyap/ansible | lib/ansible/modules/network/cnos/cnos_conditional_command.py | 52 | 5858 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2017 Lenovo, 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 Licens... | gpl-3.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/py/__init__.py | 3 | 5872 | """
py.test and pylib: rapid testing and development utils
this module uses apipkg.py for lazy-loading sub modules
and classes. The initpkg-dictionary below specifies
name->value mappings where value can be another namespace
dictionary or an import path.
(c) Holger Krekel and others, 2004-2014
"""
__version__ = '1.... | bsd-3-clause |
rven/odoo | addons/crm/tests/test_crm_lead_notification.py | 5 | 5190 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from .common import TestCrmCommon
class NewLeadNotification(TestCrmCommon):
def test_new_lead_notification(self):
""" Test newly create leads like from the website. People and channels
subscribed t... | agpl-3.0 |
eaplatanios/tensorflow | tensorflow/python/debug/cli/evaluator.py | 80 | 5731 | # 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 |
colinligertwood/odoo | openerp/tools/safe_eval.py | 48 | 11987 | # -*- coding: utf-8 -*-
##############################################################################
# Copyright (C) 2004-2014 OpenERP s.a. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | agpl-3.0 |
jeffrey4l/nova | nova/api/openstack/compute/images.py | 60 | 5221 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
levigross/pyscanner | mytests/django/conf/locale/hr/formats.py | 99 | 1758 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# 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:s'
DATETIME_FORMAT = 'j. E Y. H:i'
YEAR_MONTH... | mit |
podhmo/toybox | examples/jwt_server.py | 1 | 1141 | import logging
from toybox.simpleapi import simple_view, run
from pyramid.security import Authenticated
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.security import Allow
# please: pip install pyramid_jwt
"""
python ./jwt_server.py
# 403
$ http GET :8080/secure
# 200 OK
$ http GET :8080/logi... | mit |
yarhajile/sven-daemon | Sven/Module/BeagleboneBlack/Adafruit_BBIO-0.0.19/test/test_gpio_output.py | 1 | 1308 | import pytest
import os
import Adafruit_BBIO.GPIO as GPIO
def teardown_module(module):
GPIO.cleanup()
class TestGPIOOutput:
def test_output_high(self):
GPIO.setup("P8_10", GPIO.OUT)
GPIO.output("P8_10", GPIO.HIGH)
value = open('/sys/class/gpio/gpio68/value').read()
assert int(... | gpl-2.0 |
bobbydurrett/PythonDBAGraphs | onewait.py | 1 | 2938 | """
PythonDBAGraphs: Graphs to help with Oracle Database Tuning
Copyright (C) 2016 Robert Taft Durrett (Bobby Durrett)
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... | gpl-3.0 |
tzwlwm/openhab | bundles/binding/org.openhab.binding.piface/scripts/ohpiface.py | 13 | 5011 | #!/usr/bin/python
"""
ohpiface.py
A network listener for handling openHAB UDP commands for PiFace pins
"""
import getopt
import signal
import socket
import struct
import sys
import thread
import time
import piface.pfio as pfio
import SocketServer
WRITE_OUT_CMD = 1
WRITE_OUT_ACK = 2
READ_OUT_CMD = 3
READ_OUT_ACK = 4
... | gpl-3.0 |
AlexandreZani/phero | test_phero.py | 1 | 5815 | #!/usr/bin/env python
# Copyright 2012 (Alexandre Zani)
#
# 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 |
dashmug/saleor | saleor/order/models.py | 10 | 14550 | from __future__ import unicode_literals
from decimal import Decimal
from uuid import uuid4
from django.forms.models import model_to_dict
from django.shortcuts import get_list_or_404
import emailit.api
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.validators import MinVa... | bsd-3-clause |
fuchsia-mirror/third_party-grpc | tools/run_tests/python_utils/port_server.py | 14 | 5209 | #!/usr/bin/env python2.7
# Copyright 2015 gRPC 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 applicable la... | apache-2.0 |
nyu-mll/spinn | python/spinn/models/rl_classifier.py | 1 | 15458 | import os
import json
import math
import random
import sys
import time
import gflags
import numpy as np
from spinn.util import afs_safe_logger
from spinn.util.data import SimpleProgressBar
from spinn.util.blocks import to_gpu
from spinn.util.misc import Accumulator, EvalReporter
from spinn.util.logging import stats, ... | mit |
mlundblad/telepathy-gabble | tests/twisted/caps/receive-jingle.py | 1 | 5901 | """
Test receiving another contact's capabilities.
"""
import dbus
from servicetest import EventPattern, assertEquals, sync_dbus
from gabbletest import exec_test, make_result_iq, make_presence, sync_stream
import constants as cs
from config import VOIP_ENABLED
if not VOIP_ENABLED:
print "NOTE: built with --disa... | lgpl-2.1 |
Elico-Corp/odoo_OCB | addons/payment_buckaroo/controllers/main.py | 29 | 1107 | # -*- coding: utf-8 -*-
import json
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class BuckarooController(http.Controller):
_return_url = '/payment/buckaroo/return'
_cancel_url = '/payment/buckaroo/... | agpl-3.0 |
mxOBS/deb-pkg_trusty_chromium-browser | tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py | 9 | 11775 | # 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 contextlib
import httplib
import json
import logging
import pprint
import re
import socket
import sys
import urllib2
from telemetry import decorators... | bsd-3-clause |
Onager/artifacts | artifacts/source_type.py | 3 | 13855 | # -*- coding: utf-8 -*-
"""The source type objects.
The source type objects define the source of the artifact data. In earlier
versions of the artifact definitions collector definitions had a similar
purpose as the source type. Currently the following source types are defined:
* artifact; the source is one or more art... | apache-2.0 |
webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/botocore/vendored/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## 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-2.0 |
nigeriacoin/p2pool | p2pool/bitcoin/script.py | 282 | 2589 | from p2pool.util import math, pack
def reads_nothing(f):
return None, f
def protoPUSH(length):
return lambda f: pack.read(f, length)
def protoPUSHDATA(size_len):
def _(f):
length_str, f = pack.read(f, size_len)
length = math.string_to_natural(length_str[::-1].lstrip(chr(0)))
data, f... | gpl-3.0 |
Permutatrix/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/update/tree.py | 11 | 10856 | import os
import re
import subprocess
from .. import vcs
from ..vcs import bind_to_repo, git, hg
def get_unique_name(existing, initial):
"""Get a name either equal to initial or of the form initial_N, for some
integer N, that is not in the set existing.
:param existing: Set of names that must not be ch... | mpl-2.0 |
cgar/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_stream.py | 496 | 2872 | #!/usr/bin/env python
#
# Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mpl-2.0 |
360youlun/django-cms | cms/migrations/0010_5char_language.py | 525 | 20033 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
jjyycchh/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/crashlogs.py | 117 | 5490 | # Copyright (c) 2011, Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | bsd-3-clause |
SelvorWhim/competitive | LeetCode/MinimumSubsequenceInNonIncreasingOrder.py | 1 | 1351 | # idea: order by size and take largest elements until the sum becomes > sum of remaining
class Solution:
def minSubsequence(self, nums: List[int]) -> List[int]:
nums = sorted(nums, reverse=True)
total_sum = sum(nums)
running_sum = 0
subseq_len = 0 # how many biggest members we'll nee... | unlicense |
Ircam-Web/mezzanine-organization | organization/core/related.py | 1 | 2036 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016-2017 Ircam
# Copyright (c) 2016-2017 Guillaume Pellerin
# Copyright (c) 2016-2017 Emilie Zawadzki
# This file is part of mezzanine-organization.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
dohclude/Chucky-LINARO-DragunBall | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
femmerling/DirMaker | box/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_sequence.py | 21 | 3724 | from .. import fixtures, config
from ..config import requirements
from ..assertions import eq_
from ... import testing
from ... import Integer, String, Sequence, schema
from ..schema import Table, Column
class SequenceTest(fixtures.TablesTest):
__requires__ = ('sequences',)
run_create_tables = 'each'
@... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.