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 |
|---|---|---|---|---|---|
Debian/dak | daklib/termcolor.py | 1 | 1725 | # vim:set et sw=4:
"""
TermColor utils for dak
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2019 Mo Zhou <lumin@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publi... | gpl-2.0 |
alissonpintor/stoky | app/basemodel.py | 1 | 1966 | from flask_sqlalchemy import Model
from sqlalchemy import exc as core_exc
from sqlalchemy.orm import exc
class Result(object):
"""
Classe que recebe o resultado
"""
def __init__(self, status, message):
self.status = status
self.message = message
class BaseModel(Model):
"""
... | gpl-3.0 |
brigittebigi/proceed | proceed/src/wxgui/sp_icons.py | 1 | 2562 | import os.path
from sp_glob import ICONS_PATH
# Frames
APP_ICON = os.path.join(ICONS_PATH, "app.ico")
APP_CHECK_ICON = os.path.join(ICONS_PATH, "appcheck.ico")
APP_EXPORT_PDF_ICON = os.path.join(ICONS_PATH, "appexport-pdf.ico")
# For the toolbar of the main frame
EXIT_ICON = os.path.join(IC... | gpl-3.0 |
rhndg/openedx | common/djangoapps/contentserver/middleware.py | 119 | 9222 | """
Middleware to serve assets.
"""
import logging
from django.http import (
HttpResponse, HttpResponseNotModified, HttpResponseForbidden
)
from student.models import CourseEnrollment
from xmodule.assetstore.assetmgr import AssetManager
from xmodule.contentstore.content import StaticContent, XASSET_LOCATION_TAG
... | agpl-3.0 |
wevoteeducation/WeVoteBase | import_export/models.py | 1 | 38189 | # import_export/models.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.contrib import messages
from election_office_measure.models import Election, ContestOffice, CandidateCampaign, CandidateCampaignManager, \
BallotItem
from exception.models import handle_exception, handle_record_not_... | mit |
naojsoft/ginga | ginga/misc/grc.py | 3 | 2180 | #
# grc.py -- Ginga Remote Control example client
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""See the plugin RC.py for details of the server side.
In Ginga, start the RC plugin to enable Ginga remote control
(``Plugins->Start RC``).
Show example u... | bsd-3-clause |
surligas/gnuradio | gr-wxgui/grc/panel.py | 47 | 1651 | # Copyright 2009 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 (at your option)
# any later version.
#
# G... | gpl-3.0 |
jmesteve/saas3 | openerp/addons_extra/account_financial_report_webkit_xls/wizard/general_ledger_wizard.py | 6 | 1876 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under... | agpl-3.0 |
ombt/analytics | books/programming_in_python_3/book_examples/py31eg/Const.py | 2 | 1771 | #!/usr/bin/env python3
# Copyright (c) 2008-11 Qtrac Ltd. All rights reserved.
# This program or module 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... | mit |
xrg/django-static-gitified | django/contrib/auth/hashers.py | 43 | 12721 | import hashlib
from django.conf import settings
from django.utils import importlib
from django.utils.datastructures import SortedDict
from django.utils.encoding import smart_str
from django.core.exceptions import ImproperlyConfigured
from django.utils.crypto import (
pbkdf2, constant_time_compare, get_random_strin... | bsd-3-clause |
bdang2012/taiga-back-casting | taiga/external_apps/serializers.py | 1 | 2126 | # Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.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
# pub... | agpl-3.0 |
fried-sausage/graphite-beacon | graphite_beacon/handlers/victorops.py | 4 | 1218 | import json
try:
from urlparse import urljoin
except ImportError:
from urllib.parse import urljoin
from tornado import gen, httpclient as hc
from graphite_beacon.handlers import AbstractHandler, LOGGER
class VictorOpsHandler(AbstractHandler):
name = 'victorops'
def init_handler(self):
self... | mit |
stainsteelcrown/nonsense-story-generator | venv/lib/python2.7/site-packages/setuptools/extension.py | 165 | 1731 | import sys
import re
import functools
import distutils.core
import distutils.extension
from setuptools.dist import _get_unpatched
_Extension = _get_unpatched(distutils.core.Extension)
def have_pyrex():
"""
Return True if Cython or Pyrex can be imported.
"""
pyrex_impls = 'Cython.Distutils.build_ext',... | mit |
googleapis/python-firestore | tests/unit/v1/conformance_tests.py | 1 | 14551 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 o... | apache-2.0 |
keon/algorithms | algorithms/strings/count_binary_substring.py | 2 | 1177 | """
Give a string s, count the number of non-empty (contiguous) substrings that have
the same number of 0's and 1's, and all the 0's and all the 1's in these substrings are grouped consecutively.
Substrings that occur multiple times are counted the number of times they occur.
Example 1:
Input: "00110011"
Output: 6
Ex... | mit |
iuliat/nova | nova/tests/functional/v3/test_networks_associate.py | 29 | 3365 | # Copyright 2012 Nebula, Inc.
# Copyright 2014 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 required... | apache-2.0 |
tareqalayan/ansible | lib/ansible/modules/cloud/smartos/imgadm.py | 43 | 9827 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, 2017 Jasper Lievisse Adriaanse <j@jasper.la>
# 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 |
blaggacao/OpenUpgrade | addons/pos_restaurant/restaurant.py | 325 | 2246 | # -*- 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 |
sunlianqiang/kbengine | kbe/src/lib/python/Modules/_decimal/tests/formathelper.py | 52 | 11559 | #
# Copyright (c) 2008-2012 Stefan Krah. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions ... | lgpl-3.0 |
vvv1559/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/gdal/field.py | 264 | 6059 | from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException
from django.contrib.gis.gdal.prototypes import ds as capi
# For more information, see the OGR C API source code:
# http://www.gdal.org/ogr/... | apache-2.0 |
eagleamon/home-assistant | docs/source/conf.py | 36 | 12044 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Home-Assistant documentation build configuration file, created by
# sphinx-quickstart on Sun Aug 28 13:13:10 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in th... | apache-2.0 |
dstrockis/outlook-autocategories | lib/cachetools/lfu.py | 11 | 1096 | from __future__ import absolute_import
import collections
from .cache import Cache
class LFUCache(Cache):
"""Least Frequently Used (LFU) cache implementation."""
def __init__(self, maxsize, missing=None, getsizeof=None):
Cache.__init__(self, maxsize, missing, getsizeof)
self.__counter = col... | apache-2.0 |
themurph/openshift-tools | ansible/roles/lib_openshift_3.2/library/oc_edit.py | 3 | 34784 | #!/usr/bin/env python # pylint: disable=too-many-lines
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) ... | apache-2.0 |
markeTIC/OCB | addons/hw_escpos/escpos/constants.py | 278 | 7471 | # -*- coding: utf-8 -*-
""" ESC/POS Commands (Constants) """
# Feed control sequences
CTL_LF = '\x0a' # Print and line feed
CTL_FF = '\x0c' # Form feed
CTL_CR = '\x0d' # Carriage return
CTL_HT = '\x09' # Horizontal tab
CTL_VT = '\x0b' # Vertic... | agpl-3.0 |
NUKnightLab/panda | panda/models/notification.py | 2 | 1127 | #!/user/bin/env python
from django.db import models
from panda.models.user_proxy import UserProxy
NOTIFICATION_TYPE_CHOICES = (
('Info', 'Info'),
('Warning', 'Warning'),
('Error', 'Error')
)
class Notification(models.Model):
"""
A user notification related to a task.
"""
recipient = mode... | mit |
yanchen036/tensorflow | tensorflow/contrib/autograph/converters/break_statements.py | 2 | 4651 | # 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 |
kpiwko/jenkins-job-builder | jenkins_jobs/local_yaml.py | 7 | 8450 | #!/usr/bin/env python
# Copyright (C) 2013 Hewlett-Packard.
#
# 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 |
9wfox/mvc | utility.py | 1 | 6713 | # -*- coding:utf-8 -*-
"""
工具
历史:
2011-08-03 + 重构 get_pys_members。
2011-08-15 * 修改 con_mongo_object,支持 objectid。
2011-08-20 + 增加 template_path, static_path。
2011-08-25 * 将参数检查函数从 loigc 转移过来。
2011-08-27 * 重构 get_pys_members,改名 get_members。
"""
from dat... | mit |
elingg/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py | 88 | 31139 | # 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 |
redhat-openstack/django | django/contrib/gis/geos/libgeos.py | 115 | 5836 | """
This module houses the ctypes initialization procedures, as well
as the notice and error handler function callbacks (get called
when an error occurs in GEOS).
This module also houses GEOS Pointer utilities, including
get_pointer_arr(), and GEOM_PTR.
"""
import logging
import os
import re
from ctypes import c_... | bsd-3-clause |
sandeepgupta2k4/tensorflow | tensorflow/contrib/nccl/python/ops/nccl_ops_test.py | 68 | 5752 | # 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 |
mensler/ansible | lib/ansible/plugins/lookup/template.py | 23 | 3221 | # (c) 2012, 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) any lat... | gpl-3.0 |
leanix/leanix-sdk-python | src/leanix/DocumentsApi.py | 1 | 11645 | #!/usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2017 LeanIX GmbH
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,... | mit |
sander76/home-assistant | homeassistant/components/fritzbox_callmonitor/base.py | 5 | 2417 | """Base class for fritzbox_callmonitor entities."""
from contextlib import suppress
from datetime import timedelta
import logging
import re
from fritzconnection.lib.fritzphonebook import FritzPhonebook
from homeassistant.util import Throttle
from .const import REGEX_NUMBER, UNKOWN_NAME
_LOGGER = logging.getLogger(_... | apache-2.0 |
kracekumar/drf_tada | drf_tada/urls.py | 2 | 1698 | from django.conf.urls import patterns, include, url
from django.contrib import admin
from user.views import (UserDetailApiView, UserListApiView,
UserChangePasswordApiView)
from todo.views import (TodoBucketListApiView, TodoBucketDetailApiView)
from task.views import (TaskListApiView, TaskDetai... | bsd-3-clause |
garbled1/ansible | lib/ansible/modules/cloud/univention/udm_share.py | 29 | 23152 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# Copyright (c) 2016, Adfinis SyGroup AG
# Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch>
# 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
... | gpl-3.0 |
davidt/reviewboard | reviewboard/hostingsvcs/codebasehq.py | 3 | 20408 | from __future__ import unicode_literals
import logging
from xml.dom.minidom import parseString
from django import forms
from django.utils import six
from django.utils.six.moves.urllib.error import HTTPError, URLError
from django.utils.translation import ugettext_lazy as _, ugettext
from reviewboard.hostingsvcs.error... | mit |
arifsetiawan/edx-platform | lms/djangoapps/verify_student/admin.py | 48 | 1958 | from ratelimitbackend import admin
from verify_student.models import (
SoftwareSecurePhotoVerification,
VerificationStatus,
SkippedReverification,
)
class SoftwareSecurePhotoVerificationAdmin(admin.ModelAdmin):
"""
Admin for the SoftwareSecurePhotoVerification table.
"""
list_display = ('i... | agpl-3.0 |
taozhijiang/linux | tools/perf/scripts/python/syscall-counts.py | 1996 | 1700 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
blackye/luscan-devel | thirdparty_libs/nltk/sem/linearlogic.py | 12 | 15720 | # Natural Language Toolkit: Linear Logic
#
# Author: Dan Garrette <dhgarrette@gmail.com>
#
# Copyright (C) 2001-2012 NLTK Project
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
from nltk.internals import Counter
from logic import LogicParser, APP
_counter = Counter()
class Expression(object... | gpl-2.0 |
adlius/osf.io | api_tests/actions/views/test_action_detail.py | 15 | 2330 | import pytest
from api.base.settings.defaults import API_BASE
from api_tests.requests.mixins import NodeRequestTestMixin, PreprintRequestTestMixin
@pytest.mark.django_db
class TestActionDetailNodeRequests(NodeRequestTestMixin):
@pytest.fixture()
def url(self, node_request):
action = node_request.acti... | apache-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/plat-mac/lib-scriptpackages/SystemEvents/Login_Items_Suite.py | 82 | 1733 | """Suite Login Items Suite: Terms and Events for controlling the Login Items application
Level 1, version 1
Generated from /System/Library/CoreServices/System Events.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'logi'
class Login_Items_Suite_Events:
pass
cl... | mit |
louietsai/python-for-android | python-modules/twisted/twisted/spread/pb.py | 57 | 47156 | # -*- test-case-name: twisted.test.test_pb -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Perspective Broker
\"This isn\'t a professional opinion, but it's probably got enough
internet to kill you.\" --glyph
Introduction
============
This is a broker for proxies for and co... | apache-2.0 |
mvaled/sentry | src/sentry/south_migrations/0480_incidentactivity.py | 1 | 136910 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
# Flag to indicate if this migration is too risky
# to run online and needs to be coordinated for offline
... | bsd-3-clause |
lckung/spark-ec2 | launch-script/lib/boto-2.34.0/boto/dynamodb/exceptions.py | 185 | 1687 | """
Exceptions that are specific to the dynamodb module.
"""
from boto.exception import BotoServerError, BotoClientError
from boto.exception import DynamoDBResponseError
class DynamoDBExpiredTokenError(BotoServerError):
"""
Raised when a DynamoDB security token expires. This is generally boto's
(or the us... | apache-2.0 |
patricklodder/dogecoin | contrib/devtools/security-check.py | 120 | 8216 | #!/usr/bin/env python
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Perform basic ELF security checks on a series of executables.
Exit status will be 0 if successful, and ... | mit |
alianmohammad/pd-gem5 | src/mem/slicc/ast/AssignStatementAST.py | 51 | 2796 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
mavit/ansible | lib/ansible/modules/remote_management/ucs/ucs_vsans.py | 49 | 7479 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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': ['preview'],
... | gpl-3.0 |
jneves/python-social-auth | social/tests/backends/open_id.py | 67 | 8219 | # -*- coding: utf-8 -*-
from calendar import timegm
import sys
import json
import datetime
import requests
import jwt
from openid import oidutil
PY3 = sys.version_info[0] == 3
if PY3:
from html.parser import HTMLParser
HTMLParser # placate pyflakes
else:
from HTMLParser import HTMLParser
from httpre... | bsd-3-clause |
AlphaSmartDog/DeepLearningNotes | Note-6 A3CNet/Note-6.4 HS300指数增强/agent/agent.py | 1 | 6362 | import numpy as np
import tensorflow as tf
from agent.forward import ActorCriticNet
from params import *
def batch_choice(a, p):
action_list = [np.random.choice(a, p=i) for i in p]
return np.array(action_list)
# local network for advantage actor-critic which are also know as A2C
class Agent(object):
def... | mit |
mdrumond/tensorflow | tensorflow/contrib/layers/python/layers/initializers_test.py | 111 | 7640 | # 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 |
siliconsmiley/QGIS | python/plugins/db_manager/db_manager_plugin.py | 6 | 3251 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
saghul/shline | segments/hg.py | 1 | 1578 |
def add_hg_segment():
import os
import subprocess
env = {"LANG": "C", "HOME": os.getenv("HOME")}
def get_hg_status():
has_modified_files = False
has_untracked_files = False
has_missing_files = False
try:
output = subprocess.check_output(['hg', 'status'], e... | mit |
xujb/odoo | addons/l10n_ma/__openerp__.py | 260 | 2074 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010 kazacube (http://kazacube.com).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | agpl-3.0 |
zfergus2/Wrapping-Textures | src/lagrange_multipliers.py | 2 | 3485 | """
Use Lagrange multipliers to preform A Priori Lexicographical Multi-Objective
Optimization.
See math/lagrange_multipliers.pdf for a full explanation of the algorithm.
Written by Zachary Ferguson and Alec Jacobson.
"""
import pdb
import numpy
import scipy.linalg
import scipy.sparse
import scipy.sparse.linalg
imp... | mit |
DirtyUnicorns/android_external_chromium_org | third_party/markdown/extensions/headerid.py | 109 | 7683 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | bsd-3-clause |
scalable-networks/gnuradio-3.7.2.1 | gr-blocks/python/blocks/qa_file_metadata.py | 10 | 6785 | #!/usr/bin/env python
#
# Copyright 2012,2013 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 (at your optio... | gpl-3.0 |
yavalvas/yav_com | build/matplotlib/lib/mpl_toolkits/axes_grid1/mpl_axes.py | 8 | 4971 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import warnings
import matplotlib.axes as maxes
from matplotlib.artist import Artist
from matplotlib.axis import XAxis, YAxis
class SimpleChainedObjects(object):
def __init__(self, objects):
... | mit |
tpflueger/CSCI4900 | scripts/main.py | 1 | 1140 | # SPDX-License-Identifier: MIT
'''Usage:
{0} scan (FILE)
{0} dependencies (JARNAME)
{0} (--help | --version)
Arguments:
scan Scan pom file for dependencies
dependencies Show dependency tree for jarFile
'''
import shutil
import sys
import os
from dependency_reader import DependencyReader
from doco... | mit |
asser/django | tests/template_tests/filter_tests/test_join.py | 362 | 2707 | from django.template.defaultfilters import join
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class JoinTests(SimpleTestCase):
@setup({'join01': '{{ a|join:", " }}'})
def test_join01(self):
output = self.engine.render_to_string('join01... | bsd-3-clause |
kustodian/ansible | lib/ansible/module_utils/network/vyos/argspec/lldp_interfaces/lldp_interfaces.py | 21 | 3631 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by ... | gpl-3.0 |
Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/test/test_fileio.py | 5 | 18759 | # Adapted from test_file.py by Daniel Stutzbach
import sys
import os
import io
import errno
import unittest
from array import array
from weakref import proxy
from functools import wraps
from test.support import TESTFN, check_warnings, run_unittest, make_bad_fd, cpython_only
from collections import UserList
import _i... | gpl-3.0 |
DirectXMan12/nova-hacking | nova/scheduler/filters/image_props_filter.py | 2 | 3745 | # Copyright (c) 2011-2012 OpenStack Foundation
# Copyright (c) 2012 Canonical Ltd
# Copyright (c) 2012 SUSE LINUX Products GmbH
# 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 o... | apache-2.0 |
WSCU/crazyflie_ros | lib/cflib/bootloader/cloader.py | 10 | 9932 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
wylee/django-arcutils | arcutils/views.py | 2 | 1872 | import logging
from django.http import HttpResponseBadRequest, HttpResponseServerError
from django.template import loader
from django.views.decorators.csrf import requires_csrf_token
log = logging.getLogger(__name__)
@requires_csrf_token
def bad_request(request, exception=None, template_name='400.html'):
"""Ov... | mit |
Kurre/kernel_exynos_OLD | 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 |
iivic/BoiseStateX | cms/djangoapps/contentstore/views/certificates.py | 9 | 21664 | """
Certificates Data Model:
course.certificates: {
'certificates': [
{
'version': 1, // data contract version
'id': 12345, // autogenerated identifier
'name': 'Certificate 1',
'description': 'Certificate 1 Description',
'course_title': 'course ti... | agpl-3.0 |
mkl-/scioncc | src/pyon/core/governance/policy/evaluate.py | 3 | 6032 | """Contains a class to evaluate python code and return True or False"""
__author__ = "Stephen Henrie"
__date__ = "04/13/2013"
from ndg.xacml.core.context.exceptions import XacmlContextTypeError
from ndg.xacml.core.functions import AbstractFunction, FunctionClassFactoryInterface
from ndg.xacml.core.attributevalue impo... | bsd-2-clause |
wavelets/zipline | tests/test_batchtransform.py | 3 | 9739 | #
# Copyright 2013 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
charlesvdv/servo | tests/wpt/css-tests/css-fonts-3_dev/xhtml1print/support/fonts/makegsubfonts.py | 1616 | 14125 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
NoBodyCam/TftpPxeBootBareMetal | nova/api/openstack/compute/contrib/floating_ip_dns.py | 1 | 10842 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Andrew Bogott for the Wikimedia 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... | apache-2.0 |
tensorflow/datasets | tensorflow_datasets/structured/movielens.py | 1 | 17907 | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... | apache-2.0 |
igboyes/virtool | tests/otus/test_api.py | 2 | 33142 | import pytest
from aiohttp.test_utils import make_mocked_coro
import virtool.otus.db
import virtool.otus.utils
@pytest.mark.parametrize("find", [None, "tobacco"])
@pytest.mark.parametrize("verified", [None, True, False])
@pytest.mark.parametrize("names", [None, True, False])
async def test_find(find, verified, names... | mit |
xbmc/atv2 | xbmc/lib/libPython/Python/Mac/Modules/ibcarbon/IBCarbonsupport.py | 39 | 1223 | # IBCarbonsupport.py
from macsupport import *
IBNibRef = OpaqueByValueType('IBNibRef', 'IBNibRefObj')
#CFBundleRef = OpaqueByValueType('CFBundleRef')
IBCarbonFunction = OSErrFunctionGenerator
IBCarbonMethod = OSErrMethodGenerator
includestuff = """
#include <Carbon/Carbon.h>
#include "pymactoolbox.h"
#ifdef USE_TO... | gpl-2.0 |
ivanhorvath/openshift-tools | openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_openshift/src/class/oc_objectvalidator.py | 18 | 3329 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-instance-attributes
class OCObjectValidator(OpenShiftCLI):
''' Class to wrap the oc command line tools '''
def __init__(self, kubeconfig):
''' Constructor for OCObjectValidator '''
# namespace has no meaning for object validation, h... | apache-2.0 |
dpac-vlsi/SynchroTrace | ext/ply/example/yply/yply.py | 165 | 1237 | #!/usr/local/bin/python
# yply.py
#
# Author: David Beazley (dave@dabeaz.com)
# Date : October 2, 2006
#
# Converts a UNIX-yacc specification file into a PLY-compatible
# specification. To use, simply do this:
#
# % python yply.py [-nocode] inputfile.y >myparser.py
#
# The output of this program is Python code. In... | bsd-3-clause |
likaiwalkman/phantomjs | src/qt/qtwebkit/Tools/BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py | 116 | 4793 | # Copyright (C) 2010 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
mancoast/CPythonPyc_test | cpython/230_test_macpath.py | 43 | 2190 | import macpath
from test import test_support
import unittest
class MacPathTestCase(unittest.TestCase):
def test_abspath(self):
self.assert_(macpath.abspath("xx:yy") == "xx:yy")
def test_isabs(self):
isabs = macpath.isabs
self.assert_(isabs("xx:yy"))
self.assert_(isabs("xx:yy:... | gpl-3.0 |
TheJJoker/video-chat | src/third_party/oauth2client/multistore_file.py | 144 | 13935 | # Copyright 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
lento/cortex | test/IECore/Turbulence.py | 12 | 3731 | ##########################################################################
#
# Copyright (c) 2007-2010, Image Engine Design 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:
#
# * Redis... | bsd-3-clause |
connorimes/servo | tests/wpt/css-tests/tools/html5lib/utils/spider.py | 436 | 4157 | #!/usr/bin/env python
"""Spider to try and find bugs in the parser. Requires httplib2 and elementtree
usage:
import spider
s = spider.Spider()
s.spider("http://www.google.com", maxURLs=100)
"""
import urllib.request, urllib.error, urllib.parse
import urllib.robotparser
import md5
import httplib2
import html5lib
fro... | mpl-2.0 |
joebowman/webcode | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/shell.py | 287 | 15340 | # -*- coding: utf-8 -*-
"""
pygments.lexers.shell
~~~~~~~~~~~~~~~~~~~~~
Lexers for various shells.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, inclu... | mit |
jotes/boto | tests/integration/ec2/elb/test_cert_verification.py | 114 | 1577 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# 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 withou... | mit |
fredericlepied/ansible | lib/ansible/utils/module_docs_fragments/vca.py | 122 | 2636 | # (c) 2016, Charles Paul <cpaul@ansible.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) any later versio... | gpl-3.0 |
jelugbo/hebs_repo | lms/djangoapps/staticbook/views.py | 6 | 6331 | """
Views for serving static textbooks.
"""
from django.contrib.auth.decorators import login_required
from django.http import Http404
from edxmako.shortcuts import render_to_response
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.annotator_token import retrieve_token
from courseware.acces... | agpl-3.0 |
pkoutsias/SickRage | lib/github/File.py | 74 | 5212 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
laurenrevere/osf.io | admin/base/utils.py | 6 | 5870 | """
Utility functions and classes
"""
from osf.models import Subject, NodeLicense, DraftRegistration
from website.prereg.utils import get_prereg_schema
from django.core.exceptions import ValidationError, PermissionDenied
from django.core.urlresolvers import reverse
from django.utils.http import urlencode
from django.u... | apache-2.0 |
MercenaryLogic/StompingGround | stompingground/dpkt/dhcp.py | 1 | 6051 | # $Id: dhcp.py 272 2006-01-11 16:13:28Z dugsong $
"""Dynamic Host Configuration Protocol."""
import arp, dpkt
DHCP_OP_REQUEST = 1
DHCP_OP_REPLY = 2
DHCP_MAGIC = 0x63825363
# DHCP option codes
DHCP_OPT_NETMASK = 1 # I: subnet mask
DHCP_OPT_TIMEOFFSET = 2
DHCP_OPT_ROUTER = 3 # s: list of router... | mit |
SoMa-Project/ec_grasp_planner | ec_grasp_planner/src/tub_feasibility_check_interface.py | 1 | 30753 | import math
import rospy
import numpy as np
from tf import transformations as tra
from geometry_graph_msgs.msg import Node, geometry_msgs
from tub_feasibility_check import srv as kin_check_srv
from tub_feasibility_check.msg import BoundingBoxWithPose, AllowedCollision
from tub_feasibility_check.srv import CheckKinemat... | bsd-3-clause |
nriley/NewsBlur | apps/rss_feeds/migrations/0063_pgsql_index_trim.py | 18 | 7194 | # -*- 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):
# Removing index on 'Feed', fields ['active_subscribers']
db.delete_index('feeds', ['active_subscribers'])
... | mit |
honggyukim/uftrace | tests/t205_arg_auto4.py | 2 | 1366 | #!/usr/bin/env python
from runtest import TestBase
import re
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'autoargs', result="""autoargs test
# DURATION TID FUNCTION
[ 16523] | main(2, 0xADDR) {
2.670 us [ 16523] | strlen("autoargs test") = 13;
1.353 us... | gpl-2.0 |
ecederstrand/django | tests/auth_tests/test_views.py | 35 | 44018 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import os
import re
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.contrib.admin.models import LogEntry
from django.contrib.auth import REDIRECT_FIELD_NAME, S... | bsd-3-clause |
JetChars/vim | vim/bundle/python-mode/pymode/libs/pylint/checkers/base.py | 7 | 54101 | # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
# Copyright (c) 2009-2010 Arista Networks, 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
... | apache-2.0 |
Srisai85/scikit-learn | sklearn/decomposition/tests/test_truncated_svd.py | 240 | 6055 | """Test truncated SVD transformer."""
import numpy as np
import scipy.sparse as sp
from sklearn.decomposition import TruncatedSVD
from sklearn.utils import check_random_state
from sklearn.utils.testing import (assert_array_almost_equal, assert_equal,
assert_raises, assert_greater,
... | bsd-3-clause |
Yuudachimoe/HikariChun-RedBot | lib/youtube_dl/extractor/yourupload.py | 64 | 1411 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import urljoin
class YourUploadIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:yourupload\.com/(?:watch|embed)|embed\.yourupload\.com)/(?P<id>[A-Za-z0-9]+)'
_TESTS = [{
'url': 'http://yourup... | gpl-3.0 |
jerryge/zulip | zerver/management/commands/realm_alias.py | 113 | 1791 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.models import Realm, RealmAlias, get_realm
from zerver.lib.actions import realm_aliases
import sys
class Command(BaseCommand):
help = """Manage aliases for the specified realm"""
def add_arguments(self, par... | apache-2.0 |
garverp/gnuradio | gr-blocks/python/grc_gnuradio/blks2/__init__.py | 18 | 1205 | # Copyright 2008-2011 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 (at your option)
# any later version.
... | gpl-3.0 |
mat650/metagoofil | hachoir_parser/video/mov.py | 16 | 36206 | """
Apple Quicktime Movie (file extension ".mov") parser.
Documents:
- Parsing and Writing QuickTime Files in Java (by Chris Adamson, 02/19/2003)
http://www.onjava.com/pub/a/onjava/2003/02/19/qt_file_format.html
- QuickTime File Format (official technical reference)
http://developer.apple.com/documentation/QuickTi... | gpl-2.0 |
turbokongen/home-assistant | homeassistant/components/insteon/climate.py | 2 | 8466 | """Support for Insteon thermostat."""
from typing import List, Optional
from pyinsteon.constants import ThermostatMode
from pyinsteon.operating_flag import CELSIUS
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET... | apache-2.0 |
open-synergy/stock-logistics-warehouse | stock_operation_type_location/wizard/stock_transfer_details.py | 3 | 2960 | # -*- coding: utf-8 -*-
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api, models
from lxml import etree
class StockTransferDetails(models.TransientModel):
_inherit = "stock.transfer_details"
@api.model
def fields_view_get(self, v... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.