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
xuerenlv/PaperWork
my_study/pandas_study/test1.py
1
1044
# -*- coding: utf-8 -*- ''' Created on Oct 16, 2015 @author: nlp ''' import sys import traceback from store_model import Single_weibo_store import datetime from datetime import timedelta import pprint import jieba reload(sys) sys.setdefaultencoding('utf8') from sklearn import svm X = [[0, 0], [1, 1]] y = [...
apache-2.0
iqas/e2gui
tools/create_picon_sats.py
193
2365
# # create symlinks for picons # usage: create_picon_sats lamedb # run in picon directory. # It will read the servicenames from the lamedb and create symlinks # for the servicereference names. # # by pieterg, 2008 import os, sys f = open(sys.argv[1]).readlines() f = f[f.index("services\n")+1:-3] while len(f) > 2:...
gpl-2.0
SUSE-Cloud/nova
nova/api/openstack/compute/plugins/v3/agents.py
8
6896
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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 # # ...
apache-2.0
ProgVal/Limnoria-test
plugins/Debug/plugin.py
3
6668
#!/usr/bin/python ### # Copyright (c) 2002-2005, Jeremiah Fincher # 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, # ...
bsd-3-clause
ncliam/serverpos
openerp/report/printscreen/ps_list.py
381
11955
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
jerivas/mezzanine
mezzanine/pages/templatetags/pages_tags.py
2
8361
from collections import defaultdict from django.core.exceptions import ImproperlyConfigured from django.template import TemplateSyntaxError, Variable from django.template.loader import get_template from django.utils.translation import gettext_lazy as _ from mezzanine import template from mezzanine.pages.models import...
bsd-2-clause
deonwu/Goku
scripts/GokuCtrl/ipa4django/views/simpleviews.py
1
6103
import types from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django import template from django.db.models.query import QuerySet import re from django.core import serializers class ViewHandler(object): def __init__(self, func, param_validator=None): ...
mit
Semi-global/edx-platform
cms/djangoapps/contentstore/course_group_config.py
70
13178
""" Class for manipulating groups configuration on a course object. """ import json import logging from util.db import generate_int_id, MYSQL_MAX_INT from django.utils.translation import ugettext as _ from contentstore.utils import reverse_usage_url from xmodule.partitions.partitions import UserPartition from xmodule...
agpl-3.0
ciex/motor
lib/werkzeug/datastructures.py
73
83980
# -*- coding: utf-8 -*- """ werkzeug.datastructures ~~~~~~~~~~~~~~~~~~~~~~~ This module provides mixins and classes with an immutable interface. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import codecs import ...
apache-2.0
Salandora/OctoPrint
tests/util/test_counted_event.py
8
3171
# coding=utf-8 from __future__ import absolute_import, division, print_function __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License" im...
agpl-3.0
yrizk/django-blog
blogvenv/lib/python3.4/site-packages/django/template/__init__.py
57
1897
""" Django's support for templates. The django.template namespace contains two independent subsystems: 1. Multiple Template Engines: support for pluggable template backends, built-in backends and backend-independent APIs 2. Django Template Language: Django's own template engine, including its built-in loaders, ...
apache-2.0
miloszz/DIRAC
Resources/Storage/GFAL2_XROOTStorage.py
2
1523
""" :mod: GFAL2_XROOTStorage ================= .. module: python :synopsis: XROOT module based on the GFAL2_StorageBase class. """ # from DIRAC from DIRAC import gLogger from DIRAC.Resources.Storage.GFAL2_StorageBase import GFAL2_StorageBase class GFAL2_XROOTStorage( GFAL2_StorageBase ): """ .. class:...
gpl-3.0
linjoahow/cd0505
static/Brython3.1.1-20150328-091302/Lib/sre_constants.py
692
7172
# # Secret Labs' Regular Expression Engine # # various symbols used by the regular expression engine. # run this script to update the _sre include files! # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support modul...
agpl-3.0
LordDarkula/chess_py
tests/test_pieces/test_pawn.py
1
5706
from unittest import TestCase from chess_py.core.algebraic import notation_const from chess_py.core import Board from chess_py.core.algebraic import Location, Move from chess_py.pieces import Queen, Rook, Bishop, Knight, Pawn from chess_py import color class TestPawn(TestCase): def setUp(self): self.posi...
mit
malmiron/incubator-airflow
airflow/contrib/operators/sagemaker_base_operator.py
5
3284
# -*- 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
moble/sympy
sympy/core/tests/test_basic.py
39
5776
"""This tests sympy/core/basic.py with (ideally) no reference to subclasses of Basic or Atom.""" from sympy.core.basic import Basic, Atom, preorder_traversal from sympy.core.singleton import S, Singleton from sympy.core.symbol import symbols from sympy.core.compatibility import default_sort_key, with_metaclass from s...
bsd-3-clause
dstftw/youtube-dl
youtube_dl/extractor/izlesene.py
24
4152
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse_unquote, ) from ..utils import ( determine_ext, float_or_none, get_element_by_id, int_or_none, parse_iso8601, str_to_int, ) class IzleseneIE...
unlicense
toshywoshy/ansible
lib/ansible/modules/cloud/azure/azure_rm_galleryimage_info.py
13
9211
#!/usr/bin/python # # Copyright (c) 2019 Liu Qingyi, (@smile37773) # # 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', 's...
gpl-3.0
Adtoma/amphtml
validator/validator_gen.py
112
11182
# # Copyright 2015 The AMP HTML 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 applic...
apache-2.0
manastech/de-bee
gdata/tlslite/utils/OpenSSL_TripleDES.py
359
1666
"""OpenSSL/M2Crypto 3DES implementation.""" from cryptomath import * from TripleDES import * if m2cryptoLoaded: def new(key, mode, IV): return OpenSSL_TripleDES(key, mode, IV) class OpenSSL_TripleDES(TripleDES): def __init__(self, key, mode, IV): TripleDES.__init__(self, key, mo...
mit
leogregianin/pychess
utilities/blunders.py
2
5552
#!/usr/bin/python # -*- coding: utf-8 -*- ''' PyChess blunder finder script. This scripts allows you to analyze a played pgn file for blunders, using the engine of your choice. PYTHONPATH=lib/ python blunders.py game.pgn ''' ############################################################################...
gpl-3.0
ZhuangER/robot_path_planning
gui/pyqtgraph/canvas/CanvasManager.py
3
2214
# -*- coding: utf-8 -*- from pyqtgraph.Qt import QtCore, QtGui if not hasattr(QtCore, 'Signal'): QtCore.Signal = QtCore.pyqtSignal import weakref class CanvasManager(QtCore.QObject): SINGLETON = None sigCanvasListChanged = QtCore.Signal() def __init__(self): if CanvasManager.SINGLETON...
mit
GladeRom/android_external_chromium_org
tools/deep_memory_profiler/lib/bucket.py
64
5564
# 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 logging import os from lib.symbol import FUNCTION_SYMBOLS, SOURCEFILE_SYMBOLS, TYPEINFO_SYMBOLS LOGGER = logging.getLogger('dmprof') class Bucket...
bsd-3-clause
Eureka22/ASM_xf
PythonD/lib/python2.4/site-packages/display/cursing/FileSelector.py
2
4138
# # This file is part of GNU Enterprise. # # GNU Enterprise 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, or (at your option) any later version. # # GNU Enterprise is distributed ...
gpl-2.0
ventoo-bike/Ventoo-PebbleWatchFace
pebblebike/dict2bin.py
10
1188
#!/usr/bin/python import os, sys, string, pdb import re, fileinput import ctypes import struct import json import sys def main(): # arguments, print an example of correct usage. if len(sys.argv) - 1 != 1: print("********************") print("Usage suggestion:") print("python " + sys.a...
mit
Voskrese/archlive.archldr
src/wubi/frontends/win32/uninstallation_finish_page.py
6
1766
# Copyright (c) 2008 Agostino Russo # # Written by Agostino Russo <agostino.russo@gmail.com> # # This file is part of Wubi the Win32 Ubuntu Installer. # # Wubi is free software; you can redistribute it and/or modify # it under 5the terms of the GNU Lesser General Public License as # published by the Free Software Found...
gpl-2.0
asampat3090/readthedocs.org
readthedocs/core/templatetags/core_tags.py
27
3014
import urllib import hashlib from django import template from django.conf import settings from django.utils.safestring import mark_safe from django.utils.encoding import force_bytes, force_text from readthedocs.builds.models import Version from readthedocs.projects.models import Project register = template.Library()...
mit
xzYue/odoo
addons/l10n_do/__openerp__.py
309
2992
# -*- coding: utf-8 -*- # ############################################################################# # # First author: Jose Ernesto Mendez <tecnologia@obsdr.com> (Open Business Solutions SRL.) # Copyright (c) 2012 -TODAY Open Business Solutions, SRL. (http://obsdr.com). All rights reserved. # # This is a fork to upg...
agpl-3.0
bloyl/mne-python
mne/preprocessing/nirs/tests/test_optical_density.py
12
1850
# Authors: Robert Luke <mail@robertluke.net> # Eric Larson <larson.eric.d@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import os.path as op import pytest as pytest import numpy as np from numpy.testing import assert_allclose from mne.datasets.testing impo...
bsd-3-clause
brianwoo/django-tutorial
build/Django/django/db/backends/dummy/base.py
94
2567
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends.base.base import BaseDatabas...
gpl-3.0
MicroWorldwide/tweeria
controllers/creation_center.py
3
15864
# -*- coding: UTF-8 -*- import basic from functions import prettyItemBonus, formatTextareaInput import re from sets import Set from misc import miscController import time class creationCenterController(basic.defaultController): DIR = './ugc/' RE_CHECK_NAME = re.compile('^[a-zA-Z0-9\s\-\+\']+$', re.U+re...
mit
skipmodea1/repository.skipmodea1
script.module.execjs/lib/execjs/_runner_sources.py
2
2973
#!/usr/bin/env python3 # -*- coding: ascii -*- from __future__ import unicode_literals, division, with_statement Node = r"""(function(program, execJS) { execJS(program) })(function() { #{source} }, function(program) { var output; var print = function(string) { process.stdout.write('' + string + '\n'); }; ...
gpl-3.0
curtisstpierre/django
tests/contenttypes_tests/test_models.py
249
12059
from __future__ import unicode_literals import warnings from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.views import shortcut from django.contrib.sites.shortcuts import get_current_site from django.db.utils import IntegrityError, OperationalError, ProgrammingError from djan...
bsd-3-clause
skycucumber/restful
python/venv/lib/python2.7/site-packages/migrate/versioning/util/__init__.py
33
5339
#!/usr/bin/env python # -*- coding: utf-8 -*- """.. currentmodule:: migrate.versioning.util""" import warnings import logging from decorator import decorator from pkg_resources import EntryPoint import six from sqlalchemy import create_engine from sqlalchemy.engine import Engine from sqlalchemy.pool import StaticPool...
gpl-2.0
dybiszb/MeanCurvatureLibrary
testing/gtest/googletest/test/gtest_env_var_test.py
343
4036
#!/usr/bin/env python # # Copyright 2008, 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...
mit
leiferikb/bitpop
src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
1
20535
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # Copyright (C) 2011 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following ...
gpl-3.0
juanc27/myfavteam
myfavteam/models.py
1
11412
from django.db import models from django.core.urlresolvers import reverse import datetime # Create your models here. class Team(models.Model): short_name = models.CharField(max_length=25) name = models.CharField(max_length=50, null=True, blank=True) my_team = models.BooleanField(default = False) city ...
mit
jalavik/invenio-workflows
invenio_workflows/upgrades/workflows_2014_08_12_task_results_to_dict.py
6
3636
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
mhrivnak/pulp_puppet
devel/pulp_puppet/devel/base_cli.py
8
2333
import copy import logging import os.path import unittest import mock import okaara from pulp.bindings.bindings import Bindings from pulp.bindings.server import PulpConnection from pulp.client.extensions.core import PulpPrompt, ClientContext, PulpCli from pulp.client.extensions.exceptions import ExceptionHandler from...
gpl-2.0
yekaylee/capstone
capstoneRepo/FacialRecognition/FinalFaceRecog_code/picam_version/config.py
3
2727
# Raspberry Pi Face Recognition Treasure Box Configuration # Copyright 2013 Tony DiCola # Edit the values below to configure the training and usage of the # face recognition box. # Pi GPIO port which is connected to the lock servo signal line. LOCK_SERVO_PIN = 18 # Pulse width value (in microseconds) for the servo a...
bsd-3-clause
xbmc/atv2
xbmc/lib/libPython/Python/Lib/idlelib/textView.py
15
2789
"""Simple text browser for IDLE """ from Tkinter import * import tkMessageBox class TextViewer(Toplevel): """ simple text viewer dialog for idle """ def __init__(self, parent, title, fileName, data=None): """If data exists, load it into viewer, otherwise try to load file. fileName - ...
gpl-2.0
axtra/ansible
v2/ansible/module_utils/database.py
401
5839
# 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
rldhont/Quantum-GIS
tests/src/python/test_authmanager_password_postgres.py
13
5704
# -*- coding: utf-8 -*- """ Tests for auth manager Password access to postgres. This is an integration test for QGIS Desktop Auth Manager postgres provider that checks if QGIS can use a stored auth manager auth configuration to access a Password protected postgres. It uses a docker container as postgres/postgis serve...
gpl-2.0
elpaso/QGIS
python/plugins/processing/algs/qgis/voronoi.py
11
29797
# -*- coding: utf-8 -*- """ *************************************************************************** voronoi.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *******************************...
gpl-2.0
ShineFan/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py
384
11372
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
AlertMe/cerbero
test/test_cerbero_packages_wix.py
27
8020
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
erkike/daw
angular/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py
2736
6387
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml #-------------------------------------------------------------------...
mit
jabl/offlineimap
offlineimap/CustomConfig.py
8
4401
# Copyright (C) 2003 John Goerzen # <jgoerzen@complete.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version...
gpl-2.0
Mushirahmed/gnuradio
docs/sphinx/hieroglyph/test/test_nodes.py
25
12795
import unittest from hieroglyph.nodes import Node, Arg, Raises, Except, Returns, Warning, Note __author__ = 'Robert Smallshire' class NodeTests(unittest.TestCase): def test_create_default_node(self): node = Node() self.assertEqual(node.indent, 0) self.assertEqual(node.lines, [])...
gpl-3.0
liberorbis/libernext
env/lib/python2.7/site-packages/_markerlib/markers.py
1769
3979
# -*- coding: utf-8 -*- """Interpret PEP 345 environment markers. EXPR [in|==|!=|not in] EXPR [or|and] ... where EXPR belongs to any of those: python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1]) python_full_version = sys.version.split()[0] os.name = os.name sys.platform = sys.platfo...
gpl-2.0
TinajaLabs/tinajagate
downloads/pyserial-2.5/serial/__init__.py
8
2268
#!/usr/bin/env python # portable serial port access with python # this is a wrapper module for different platform implementations # # (C) 2001-2010 Chris Liechti <cliechti@gmx.net> # this is distributed under a free software license, see license.txt VERSION = '2.5' import sys if sys.platform == 'cli': from ser...
mit
heeraj123/oh-mainline
vendor/packages/Django/django/contrib/sites/managers.py
491
1985
from django.conf import settings from django.db import models from django.db.models.fields import FieldDoesNotExist class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the current site." def __init__(self, field_name=None): super(CurrentSiteManager, self).__ini...
agpl-3.0
sysbot/contrail-controller
src/config/api-server/vnc_cfg_ifmap.py
1
38425
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # """ Layer that transforms VNC config objects to ifmap representation """ from gevent import ssl, monkey monkey.patch_all() import sys import time from pprint import pformat from lxml import etree, objectify import StringIO import re import socket i...
apache-2.0
tinloaf/home-assistant
tests/components/image_processing/test_openalpr_cloud.py
6
7163
"""The tests for the openalpr cloud platform.""" import asyncio from unittest.mock import patch, PropertyMock from homeassistant.core import callback from homeassistant.setup import setup_component from homeassistant.components import camera, image_processing as ip from homeassistant.components.image_processing.openal...
apache-2.0
aniketpuranik/pynet_test
ANSIBLE/library/eos_staticroute.py
8
18931
#!/usr/bin/python # # Copyright (c) 2015, Arista Networks, 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, # t...
apache-2.0
cswiercz/sympy
sympy/physics/quantum/tests/test_matrixutils.py
98
4111
from random import randint from sympy import Matrix, zeros, ones, Integer from sympy.physics.quantum.matrixutils import ( to_sympy, to_numpy, to_scipy_sparse, matrix_tensor_product, matrix_to_zero, matrix_zeros, numpy_ndarray, scipy_sparse_matrix ) from sympy.core.compatibility import range from sympy.extern...
bsd-3-clause
Tehsmash/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/phy_asa.py
2
5011
# Copyright 2016 Cisco Systems, 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 requi...
apache-2.0
teochenglim/ansible-modules-extras
monitoring/logentries.py
153
4566
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Ivan Vanderbyl <ivan@app.io> # # This 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) any la...
gpl-3.0
chrisxue815/leetcode_python
problems/test_0457_floyd.py
1
1491
import unittest from typing import List import utils # O(n) time. O(1) space. Floyd's tortoise and hare cycle detection algorithm. class Solution: def circularArrayLoop(self, nums: List[int]) -> bool: n = len(nums) for start, move in enumerate(nums): if move == 0: con...
unlicense
emijrp/robobrowser
robobrowser/cache.py
5
2908
""" Caching utilities for robotic browsers. Credit to https://github.com/Lukasa/httpcache """ import logging import datetime from requests.adapters import HTTPAdapter from robobrowser.compat import OrderedDict, iteritems logger = logging.getLogger(__name__) # Modified from https://github.com/Lukasa/httpcache/blob/m...
bsd-3-clause
hkariti/ansible
lib/ansible/module_utils/facts/system/apparmor.py
232
1311
# Collect facts related to apparmor # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # An...
gpl-3.0
MiLk/ansible
test/units/modules/network/junos/test_junos_rpc.py
43
3370
# (c) 2017 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
palladius/gcloud
packages/gsutil/boto/boto/gs/key.py
51
31785
# Copyright 2010 Google Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, dis- # trib...
gpl-3.0
eReuse/DeviceHub
ereuse_devicehub/security/request_auth.py
1
2169
import requests from flask import current_app from requests.auth import AuthBase class Auth(AuthBase): """ Handles the authorization method. If there is no available token for us, it logs-in and stores the token. Appends the token to the header accordingly. """ def __init__(self, domain: str, em...
agpl-3.0
tomannerino/PyHangman
venv/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py
252
106466
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
gpl-3.0
lancezlin/ml_template_py
lib/python2.7/site-packages/prompt_toolkit/key_binding/vi_state.py
20
1734
from __future__ import unicode_literals __all__ = ( 'InputMode', 'CharacterFind', 'ViState', ) class InputMode(object): INSERT = 'vi-insert' INSERT_MULTIPLE = 'vi-insert-multiple' NAVIGATION = 'vi-navigation' REPLACE = 'vi-replace' class CharacterFind(object): def __init__(self, cha...
mit
mtford90/silk
silk/management/commands/silk_clear_request_log.py
2
1832
from django.conf import settings from django.core.management.base import BaseCommand from django.db import connection import silk.models class Command(BaseCommand): help = "Clears silk's log of requests." @staticmethod def delete_model(model): engine = settings.DATABASES['default']['ENGINE'] ...
mit
buguen/pylayers
pylayers/location/algebraic/crlb.py
1
17260
import os from numpy import * from scipy import * from scipy import optimize from string import * from numpy.linalg import * class CRBLocation(object): """ A CRBLocation contains: 1- a set of RadioNodes (RN) with associated position accuracies (RNQoS), 2- a set of measurements (RSS, TOA, TDOA) with as...
lgpl-3.0
Juzley/golfstats
lib/werkzeug/datastructures.py
122
87447
# -*- coding: utf-8 -*- """ werkzeug.datastructures ~~~~~~~~~~~~~~~~~~~~~~~ This module provides mixins and classes with an immutable interface. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import codecs import ...
mit
jtovar2/demo_app
backend/resources/org_user_relationships.py
1
4196
from flask import Flask, request, abort import json import ndb_util from model import User from google.appengine.api import users from google.appengine.ext import ndb from google.appengine.api import app_identity from google.appengine.api import mail from flask_restful import Resource from google.appengine.runtime i...
mit
Wallacoloo/qemu-kinetis
scripts/tracetool.py
94
4095
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Command-line wrapper for the tracetool machinery. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintai...
gpl-2.0
jostmey/rwa
length_problem_100/rwa_model/dataplumbing.py
5
1694
#!/usr/bin/env python3 ########################################################################################## # Author: Jared L. Ostmeyer # Date Started: 2017-01-01 # Purpose: Load dataset and create interfaces for piping the data to the model ########################################################################...
bsd-3-clause
laribee/mochachino
node_modules/js-yaml/support/pyyaml-src/tokens.py
985
2573
class Token(object): def __init__(self, start_mark, end_mark): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in self.__dict__ if not key.endswith('_mark')] attributes.sort() arguments = ', '.join(['%s=...
mit
ufcg-lsd/python-hpOneView
examples/scripts/get-providers.py
1
3951
#!/usr/bin/env python ### # (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP # # 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 limita...
mit
petrus-v/odoo
addons/payment_adyen/models/adyen.py
33
7845
# -*- coding: utf-'8' "-*-" import base64 try: import simplejson as json except ImportError: import json from hashlib import sha1 import hmac import logging import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment_adyen.controllers.main import Adye...
agpl-3.0
tvalacarta/tvalacarta
python/main-classic/lib/youtube_dl/extractor/expotv.py
64
2913
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, ) class ExpoTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?expotv\.com/videos/[^?#]*/(?P<id>[0-9]+)($|[?#])' _TEST = { 'url': 'http://www.expotv.com/videos/rev...
gpl-3.0
NicolasDorier/bitcoin
qa/rpc-tests/p2p-acceptblock.py
10
11968
#!/usr/bin/env python3 # 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. """Test processing of unrequested blocks. Since behavior differs when receiving unrequested blocks from w...
mit
jalexvig/tensorflow
tensorflow/python/training/basic_session_run_hooks_test.py
14
58484
# pylint: disable=g-bad-file-header # 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/LICENS...
apache-2.0
babbage/zulip
zerver/management/commands/rename_stream.py
115
1189
from __future__ import absolute_import from django.core.management.base import BaseCommand from zerver.lib.actions import do_rename_stream from zerver.models import Realm, get_realm import sys class Command(BaseCommand): help = """Change the stream name for a realm.""" def add_arguments(self, parser): ...
apache-2.0
elkingtonmcb/pattern
pattern/server/cherrypy/cherrypy/lib/caching.py
37
17046
""" CherryPy implements a simple caching system as a pluggable Tool. This tool tries to be an (in-process) HTTP/1.1-compliant cache. It's not quite there yet, but it's probably good enough for most sites. In general, GET responses are cached (along with selecting headers) and, if another request arrives for the same r...
bsd-3-clause
wbyne/QGIS
tests/src/python/test_qgsrelationmanager.py
5
4936
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsRelationManager. .. note:: 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. ""...
gpl-2.0
googleapis/googleapis-gen
google/cloud/dialogflow/cx/v3/dialogflow-cx-v3-py/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/__init__.py
2
1275
# -*- 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 or...
apache-2.0
camptocamp/QGIS
python/plugins/processing/taudem/peukerdouglas.py
1
4055
# -*- coding: utf-8 -*- """ *************************************************************************** peukerdouglas.py --------------------- Date : October 2012 Copyright : (C) 2012 by Alexander Bruy Email : alexander dot bruy at gmail dot com ***********...
gpl-2.0
youprofit/servo
tests/wpt/web-platform-tests/2dcontext/tools/gentest.py
132
29897
# Copyright (c) 2010 Philip Taylor # Released under the BSD license and W3C Test Suite License: see LICENSE.txt # Current code status: # # This was originally written for use at # http://philip.html5.org/tests/canvas/suite/tests/ # # It has been adapted for use with the Web Platform Test Suite suite at # https://githu...
mpl-2.0
shaftoe/home-assistant
homeassistant/components/sensor/eddystone_temperature.py
4
5839
""" Read temperature information from Eddystone beacons. Your beacons must be configured to transmit UID (for identification) and TLM (for temperature) frames. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.eddystone_temperature/ """ import loggi...
apache-2.0
orcasgit/py-wsse
doc/conf.py
1
9315
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # py-wsse documentation build configuration file, created by # sphinx-quickstart on Mon May 25 12:37:44 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # au...
bsd-3-clause
myint-archive/bpython
bpython/pager.py
1
2528
# The MIT License # # Copyright (c) 2009-2011 Andreas Stuehrk # # 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, mo...
mit
marcore/edx-platform
lms/djangoapps/courseware/features/events.py
177
2247
# pylint: disable=missing-docstring from lettuce import step from lettuce import world from lettuce import before from pymongo import MongoClient from nose.tools import assert_equals from nose.tools import assert_in REQUIRED_EVENT_FIELDS = [ 'agent', 'event', 'event_source', 'event_type', 'host', ...
agpl-3.0
Kaisuke5/chainer
cupy/reduction.py
7
19153
import collections import string import numpy import six import cupy from cupy import carray from cupy import elementwise from cupy import util six_range = six.moves.range six_zip = six.moves.zip _broadcast = elementwise._broadcast _check_args = elementwise._check_args _decide_params_type = elementwise._decide_par...
mit
our-city-app/oca-backend
src/solutions/common/bizz/payment.py
1
5372
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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
tyagi-prashant/letsencrypt
letsencrypt-compatibility-test/letsencrypt_compatibility_test/configurators/apache/common.py
26
10466
"""Provides a common base for Apache proxies""" import re import os import subprocess import mock import zope.interface from letsencrypt import configuration from letsencrypt import errors as le_errors from letsencrypt_apache import configurator from letsencrypt_compatibility_test import errors from letsencrypt_compa...
apache-2.0
mensler/ansible
lib/ansible/plugins/action/junos_config.py
19
4243
# # (c) 2017, Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is...
gpl-3.0
karlinjf/ChromiumXRefs
lib/chromium_code_search.py
1
7067
# Copyright 2017 Josh Karlin. All rights reserved. # Use of this source code is governed by the Apache license found in the LICENSE # file. import argparse import datetime import getopt import json import sys import tempfile import threading import time import urllib.request import urllib.parse gFileCache = None; # ...
apache-2.0
darjeeling/django
django/contrib/gis/db/backends/mysql/introspection.py
700
1771
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. ...
bsd-3-clause
jeromesaiz/autoXLIFF
addXLIFF.py
1
7701
#!/usr/bin/env python # -*- coding: UTF-8 -*- __description__ = 'A companion tool to autoXLIFF.py. Helps batch-add translation strings to existing XLIFF documents (useful to add arbitrary strings like those that appear in files other than twig templates, since those are not picked-up automatically by autoXLIFF. Exampl...
mit
coreos/depot_tools
third_party/boto/pyami/copybot.py
102
4273
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
bsd-3-clause
pdebuyl/numpy
numpy/polynomial/tests/test_polynomial.py
10
20035
"""Tests for polynomial module. """ from functools import reduce import numpy as np import numpy.polynomial.polynomial as poly from numpy.testing import ( assert_almost_equal, assert_raises, assert_equal, assert_, assert_warns, assert_array_equal, assert_raises_regex) def trim(x): return poly.polytrim(x...
bsd-3-clause
orion1024/Sick-Beard
sickbeard/nzbSplitter.py
35
5802
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
raonyguimaraes/mendelmd
individuals/urls.py
1
1500
from django.conf.urls import * from individuals.views import IndividualDeleteView, GroupDeleteView from django.contrib.admin.views.decorators import staff_member_required from . import views urlpatterns = [ url(r'^create/$', views.create, name='individual_create'), url(r'^edit/(?P<individual_id>[0-9]+)/$', v...
bsd-3-clause
ksophocleous/grpc
src/python/grpcio/grpc/framework/interfaces/links/utilities.py
29
1810
# Copyright 2015, 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 f...
bsd-3-clause