repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
ludojmj/treelud
server/paramiko/pkey.py
1
14362
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License,...
mit
resmo/cloudstack
systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py
3
2545
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
kumarshivam675/Mobile10X-Hack
build/lib.linux-x86_64-2.7/yowsup/layers/protocol_presence/protocolentities/presence_unsubscribe.py
70
1047
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from .presence import PresenceProtocolEntity class UnsubscribePresenceProtocolEntity(PresenceProtocolEntity): ''' <presence type="unsubscribe" to="jid"></presence> ''' def __init__(self, jid): super(UnsubscribePresenceProtocolEntity, ...
gpl-3.0
edulramirez/nova
nova/virt/event.py
76
3420
# Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
apache-2.0
gylian/headphones
lib/mutagen/oggvorbis.py
16
4163
# Ogg Vorbis support. # # Copyright 2006 Joe Wreschnig # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. """Read and write Ogg Vorbis comments. This module handles Vorbis files wrapp...
gpl-3.0
Nyto035/Konza_backend
search/tests/test_search.py
1
17357
import json from mock import patch from django.test import TestCase from django.test.utils import override_settings from django.core.urlresolvers import reverse from django.core.management import call_command from django.contrib.auth.models import Group from django.contrib.auth import get_user_model from model_mommy ...
mit
abbeymiles/aima-python
submissions/McLean/vacuum2Runner.py
24
6129
import agents as ag import envgui as gui # change this line ONLY to refer to your project import submissions.aardvark.vacuum2 as v2 # ______________________________________________________________________________ # Vacuum environment class Dirt(ag.Thing): pass class VacuumEnvironment(ag.XYEnvironment): """T...
mit
ptemplier/ansible
lib/ansible/modules/cloud/azure/azure_rm_availabilityset.py
4
8695
#!/usr/bin/python # # Copyright (c) 2017 Julien Stroheker, <juliens@microsoft.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
sniperganso/python-manilaclient
manilaclient/openstack/common/apiclient/client.py
1
13107
# Copyright 2010 Jacob Kaplan-Moss # Copyright 2011 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, Inc. # Copyright 2013 Alessio Ababilov # Copyright 2013 Grid Dynamics # Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you ...
apache-2.0
Hitachi-Data-Systems/org-chart-builder
pptx/parts/image.py
1
7754
# encoding: utf-8 """ Image part objects, including Image """ import hashlib import os import posixpath try: from PIL import Image as PIL_Image except ImportError: import Image as PIL_Image from StringIO import StringIO from pptx.opc.package import Part from pptx.opc.packuri import PackURI from pptx.opc.sp...
apache-2.0
MridulS/sympy
sympy/solvers/recurr.py
20
24338
""" This module is intended for solving recurrences or, in other words, difference equations. Currently supported are linear, inhomogeneous equations with polynomial or rational coefficients. The solutions are obtained among polynomials, rational functions, hypergeometric terms, or combinations of hypergeometric term ...
bsd-3-clause
francisco-dlp/hyperspy
hyperspy/_signals/dielectric_function.py
4
5178
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
ClearCorp/odoo-clearcorp
TODO-7.0/hr_contract_name/__openerp__.py
4
1537
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
mydongistiny/external_chromium_org
tools/telemetry/telemetry/core/backends/chrome/inspector_websocket_unittest.py
26
3829
# 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. import unittest from telemetry.unittest import simple_mock from telemetry.core.backends.chrome import inspector_websocket from telemetry.core.backends.chrom...
bsd-3-clause
jkyeung/XlsxWriter
xlsxwriter/test/worksheet/test_cond_format14.py
1
4372
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet class TestAss...
bsd-2-clause
parthea/pydatalab
legacy_tests/bigquery/query_tests.py
2
6791
# 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 agreed ...
apache-2.0
jakevdp/scipy
scipy/_lib/tests/test__gcutils.py
109
2804
""" Test for assert_deallocated context manager and gc utilities """ import gc from scipy._lib._gcutils import set_gc_state, gc_state, assert_deallocated, ReferenceError from nose.tools import assert_equal, raises def test_set_gc_state(): gc_status = gc.isenabled() try: for state in (True, False): ...
bsd-3-clause
Lucidiot/PseudoScience
pseudosci/tests/test_relativity.py
1
2368
#!/usr/bin/env python # -*- coding:utf-8 -*- from ..units.general import Velocity, Time, Distance from ..data.constants import LIGHT_VELOCITY from ..movement import Movement from ..relativity import contraction_factor, lorentz_factor, time_dilation, \ length_contraction, RelativistMovement import pytest class T...
gpl-3.0
mhoffman/catmap
catmap/parsers/table_parser.py
3
18012
import numpy as np import catmap from .parser_base import * string2symbols = catmap.string2symbols Template = catmap.Template class TableParser(ParserBase): """Parses attributes based on column headers and filters. Additional functionality may be added by inheriting and defining the parse_{header_name...
gpl-3.0
kcompher/BuildingMachineLearningSystemsWithPython
ch08/stacked.py
4
1057
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License from __future__ import print_function from sklearn.linear_model import LinearRegression from load_ml100...
mit
ibigbug/shadowsocks
shadowsocks/crypto/table.py
1044
8108
# !/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
ahmadio/edx-platform
lms/djangoapps/course_wiki/plugins/markdownedx/mdx_image.py
151
2077
#!/usr/bin/env python ''' Image Embedding Extension for Python-Markdown ====================================== Converts lone links to embedded images, provided the file extension is allowed. Ex: http://www.ericfehse.net/media/img/ef/blog/django-pony.jpg becomes <img src="http://www.ericfehse.net/media/img...
agpl-3.0
rturumella/CloudBot
plugins/google_translate.py
25
3804
import requests from cloudbot import hook max_length = 100 def goog_trans(api_key, text, source, target): url = 'https://www.googleapis.com/language/translate/v2' if len(text) > max_length: return "This command only supports input of less then 100 characters." params = { 'q': text, ...
gpl-3.0
sunlianqiang/kbengine
kbe/res/scripts/common/Lib/encodings/cp1125.py
213
34597
""" Python Character Mapping Codec for CP1125 """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): return codecs.charmap_decode(input,errors,deco...
lgpl-3.0
Fat-Zer/FreeCAD_sf_master
src/Mod/Path/PathScripts/PathCustom.py
13
3170
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> * # * * # * This program is free software; you can redistribute it a...
lgpl-2.1
fmonjalet/miasm
miasm2/arch/arm/arch.py
1
65252
#!/usr/bin/env python #-*- coding:utf-8 -*- import logging from pyparsing import * from miasm2.expression.expression import * from miasm2.core.cpu import * from collections import defaultdict from miasm2.core.bin_stream import bin_stream import miasm2.arch.arm.regs as regs_module from miasm2.arch.arm.regs import * fro...
gpl-2.0
emccode/HeliosBurn
install/docker/proxy_settings.py
1
1641
from configurations import Configuration, values import redis class Common(Configuration): REDIS_HOST = 'redis' REDIS_PORT = 6379 REDIS_DB = 0 LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format' : "[%...
mit
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/azure-samples/databricks-pipelines/pipeline_cli.py
3
2464
import os import sys import logging import kfp import fire logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) class MyCLI: """ CLI for Kubeflow Pipelines. This CLI allows us to compile and run our pipelines in Kubeflow Pipelines without accessing Kubeflow portal. """ ...
apache-2.0
Suwings/Yeinw
src/Crypto/SelfTest/Random/OSRNG/__init__.py
118
2082
# -*- coding: utf-8 -*- # # SelfTest/Random/OSRNG/__init__.py: Self-test for OSRNG modules # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedica...
gpl-3.0
danakj/chromium
chrome/common/extensions/docs/server2/samples_model.py
36
7045
# 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. import json import logging import posixpath import re from compiled_file_system import Cache from extensions_paths import EXAMPLES from samples_data_source ...
bsd-3-clause
tomtor/QGIS
python/plugins/db_manager/db_plugins/gpkg/plugin.py
15
11191
# -*- 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
ArneBab/pypyjs
website/demo/home/rfk/repos/pypy/lib-python/2.7/idlelib/macosxSupport.py
34
6028
""" A number of function that enhance IDLE on MacOSX when it used as a normal GUI application (as opposed to an X11 application). """ import sys import Tkinter from os import path _appbundle = None def runningAsOSXApp(): """ Returns True if Python is running from within an app on OSX. If so, assume that ...
mit
tensorflow/tfjs-examples
iris/python/iris_test.py
1
1765
# Copyright 2018 Google LLC. 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
xiandiancloud/edxplaltfom-xusong
cms/djangoapps/contentstore/features/checklists.py
35
4765
# pylint: disable=C0111 # pylint: disable=W0621 from lettuce import world, step from nose.tools import assert_true, assert_equal # pylint: disable=E0611 from terrain.steps import reload_the_page from selenium.common.exceptions import StaleElementReferenceException ############### ACTIONS #################### @step(...
agpl-3.0
printerpam/autoconf-archive
macro2texi.py
16
1811
#! /usr/bin/env python assert __name__ == "__main__" import sys from macro import Macro, writeFile tmpl = """\ @node %(name)s @unnumberedsec %(name)s @majorheading Synopsis %(synopsis)s @majorheading Description %(description)s @majorheading Source Code Download the @uref{http://git.savannah.gnu.org/gitweb/?p=...
gpl-3.0
sshnaidm/ru
service.RussianKeyboard/default.py
3
2125
# declare file encoding # -*- coding: utf-8 -*- # Copyright (C) 2014 Lamkin666 # # 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, or (at your option) # any later version. ...
gpl-2.0
jeremyprice/PythonForDevs
LabsDone/lab12_2dim_list.py
2
1107
""" This program accumulates by month the maximum high temperature, the minimum high temperature, the number of days and the accumulated high temperatures. The latter two are used to calculate the average high temperature for the month. """ monlst = [] for i in range(12): monlst.append([0, 0, 0, 200]) # sublist[Da...
mit
cgrebeld/pymel
pymel/core/animation.py
1
5392
"""functions related to animation""" import pymel.util as _util import pymel.internal.factories as _factories import general as _general import pymel.internal.pmcmds as cmds def currentTime( *args, **kwargs ): """ Modifications: - if no args are provided, the command returns the current time """ if ...
bsd-3-clause
ddy88958620/lib
Python/scrapy/bosch_russian_diy/artemtools.py
2
1585
import csv import os import copy import re from decimal import Decimal from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse, FormRequest from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin_rfc from scrapy.http.c...
apache-2.0
KraweDad/Platformer
platformer.py
1
6762
""" platformer.py Author: Matthew F Credit: Robbie Assignment: Write and submit a program that implements the sandbox platformer game: https://github.com/HHS-IntroProgramming/Platformer Platformer.listenKeyEvent("keydown", "s", self.SPRING) Platformer.listenKeyEvent("keyup", "s", self.SPRINGoff) ...
mit
nexlab/domotikad
domotika/mediasources/modules/Sitecom/__init__.py
1
1420
########################################################################### # Copyright (c) 2011-2014 Unixmedia S.r.l. <info@unixmedia.it> # Copyright (c) 2011-2014 Franco (nextime) Lanza <franco@unixmedia.it> # # Domotika System Controller Daemon "domotikad" [http://trac.unixmedia.it] # # This file is part of domotik...
gpl-3.0
googleapis/googleapis-gen
google/cloud/recommendationengine/v1beta1/recommendationengine-v1beta1-py/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/grpc_asyncio.py
1
18458
# -*- 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
epinna/weevely3
tests/test_generators.py
1
1917
from tests.config import base_folder, base_url from core.generate import generate, save_generated from core.channels.channel import Channel from unittest import TestCase import subprocess import utils import random import hashlib import os def setUpModule(): subprocess.check_output(""" BASE_FOLDER="{base_folder}/g...
gpl-3.0
IITBinterns13/edx-platform-dev
common/lib/capa/capa/tests/__init__.py
11
1633
import fs.osfs import os, os.path from capa.capa_problem import LoncapaProblem from mock import Mock, MagicMock import xml.sax.saxutils as saxutils TEST_DIR = os.path.dirname(os.path.realpath(__file__)) def tst_render_template(template, context): """ A test version of render to template. Renders to the re...
agpl-3.0
GHackAnonymous/linux
tools/perf/python/twatch.py
1565
1316
#! /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
javierTerry/odoo
addons/account/company.py
384
2814
# -*- 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
wangxuan007/flasky
venv/lib/python2.7/site-packages/flask_script/commands.py
56
18544
# -*- coding: utf-8 -*- from __future__ import absolute_import,print_function import os import sys import code import warnings import string import inspect import argparse from flask import _request_ctx_stack from .cli import prompt, prompt_pass, prompt_bool, prompt_choices from ._compat import izip, text_type cl...
gpl-3.0
RedhawkSDR/throughput
streams/corba/__init__.py
1
2738
# # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of REDHAWK throughput. # # REDHAWK throughput is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published ...
lgpl-3.0
mitchellzen/pops
satchmo/apps/payment/signals.py
13
1911
import django.dispatch #: Sent after ensuring that the cart and order are valid. #: #: :param sender: The controller which performed the sanity check. #: :type sender: ``payment.views.confirm.ConfirmController`` #: #: :param controller: The controller which performed the sanity check. #: :type controller: ``payment.vi...
bsd-3-clause
PaulStoffregen/micropython
tests/bytecode/pylib-tests/_weakrefset.py
766
5570
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref __all__ = ['WeakSet'] class _IterationGuard: # This context manager registers itself in the current iterators of the # weak container, such ...
mit
steebchen/youtube-dl
youtube_dl/extractor/rtl2.py
12
7153
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..aes import aes_cbc_decrypt from ..compat import ( compat_b64decode, compat_ord, compat_str, ) from ..utils import ( bytes_to_intlist, ExtractorError, intlist_to_bytes, int_or_none, ...
unlicense
sanket4373/keystone
keystone/common/sql/migrate_repo/versions/025_add_index_to_valid.py
4
1086
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
madmongo1/hunter
maintenance/docs_create_missing_stubs.py
20
2271
import os import subprocess # hardcoded paths HUNTER_DIR='..' PACKAGES_DIR=os.path.join(HUNTER_DIR, 'cmake/projects') DOCS_PKG_DIR=os.path.join(HUNTER_DIR, 'docs', 'packages', 'pkg') # get all wiki entries docs_filenames = [x for x in os.listdir(DOCS_PKG_DIR) if x.endswith('.rst')] docs_entries = [x[:-4] for x in doc...
bsd-2-clause
porduna/weblabdeusto
tools/wcloud/wcloud/test/test_celery_db.py
4
1620
import os import unittest from nose.tools import assert_is_not_none from sqlalchemy import text from wcloud.tasks.db_tasks import connect, create_db, destroy_db # Fix the working directory. cwd = os.getcwd() if cwd.endswith(os.path.join("wcloud", "test")): cwd = cwd[0:len(cwd)-len(os.path.join("wcloud", "test"))]...
bsd-2-clause
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_fileio.py
48
9024
# Adapted from test_file.py by Daniel Stutzbach #from __future__ import unicode_literals import sys import os import unittest from array import array from weakref import proxy from test.test_support import (TESTFN, findfile, check_warnings, run_unittest, make_bad_fd) from UserList impor...
apache-2.0
ellonweb/merlin
Hooks/user/quits.py
1
1711
# This file is part of Merlin. # Merlin is the Copyright (C)2008,2009,2010 of Robin K. Hansen, Elliot Rosemarine, Andreas Jacobsen. # Individual portions may be copyright by individual contributors, and # are included in this collective work with permission of the copyright # owners. # This program is free software; ...
gpl-2.0
solent-eng/solent
solent/draft/demonstrate_line_console.py
2
4403
# // license # Copyright 2016, Free Software Foundation. # # This file is part of Solent. # # Solent is free software: you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) ...
lgpl-3.0
tornadozou/tensorflow
tensorflow/contrib/cluster_resolver/python/training/gce_cluster_resolver_test.py
64
8588
# 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 applicable ...
apache-2.0
BillMills/AutoQC
tests/ICDC_aqc_10_local_climatology_check_validation.py
3
3042
import qctests.ICDC_aqc_10_local_climatology_check as ICDC import util.testingProfile import numpy as np ##### ICDC 10 local climatology check. ##### -------------------------------------------------- class TestClass(): parameters = { 'db': 'iquod.db', 'table': 'unit' } def setUp(self): ...
mit
zeliard/grpc
src/python/src/grpc/framework/foundation/callable_util.py
41
3953
# 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
vinaypost/multiuploader
tests/test_settings.py
1
1057
# -*- encoding: utf-8 -*- import os SECRET_KEY = 'p23jof024jf5-94j3f023jf230=fj234fp34fijo' BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TEST_DATA_DIR = os.path.join(BASE_DIR, 'tests', 'test_data') DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', ...
mit
Zanzibar82/pelisalacarta
python/main-ui/plugintools.py
9
37167
# -*- coding: utf-8 -*- #------------------------------------------------------------ # Plugin Tools # Copyright 2015 tvalacarta@gmail.com # # Distributed under the terms of GNU General Public License v3 (GPLv3) # http://www.gnu.org/licenses/gpl-3.0.html #------------------------------------------------------------ # T...
gpl-3.0
ricardogsilva/QGIS
python/plugins/processing/algs/grass7/ext/r_li_mpa_ascii.py
45
1436
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_mpa_ascii.py ----------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ************************...
gpl-2.0
frugalware/mate
t/fpmjunk.py
13
1462
#!/usr/bin/env python try: import pacman except ImportError: import alpm pacman = alpm import os, tempfile, shutil, sys, re remove = False if len(sys.argv) > 1: if sys.argv[1] == "--help": print "no longer necessary %s fpms" % sys.argv[2] sys.exit(0) elif sys.argv[1] == "--remove": remove = True arch = s...
gpl-2.0
jalexvig/tensorflow
tensorflow/contrib/nearest_neighbor/python/kernel_tests/hyperplane_lsh_probes_test.py
51
1939
# 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
angelapper/edx-platform
openedx/core/djangoapps/credit/api/provider.py
35
16186
""" API for initiating and tracking requests for credit from a provider. """ import datetime import logging import uuid import pytz from django.db import transaction from edx_proctoring.api import get_last_exam_completion_date from openedx.core.djangoapps.credit.exceptions import ( UserIsNotEligible, CreditP...
agpl-3.0
ElunaLuaEngine/ElunaTrinityWotlk
contrib/enumutils_describe.py
7
6656
from re import compile, MULTILINE from os import walk, getcwd notice = ('''/* * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information * * 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 th...
gpl-2.0
xaxaxa/n7102_kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
tracksinspector/papi
setup.py
1
3827
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
mit
sergioska/EvernoteSyntaxHighlight
pygments/scanner.py
24
3114
# -*- coding: utf-8 -*- """ pygments.scanner ~~~~~~~~~~~~~~~~ This library implements a regex based scanner. Some languages like Pascal are easy to parse but have some keywords that depend on the context. Because of this it's impossible to lex that just by using a regular expression lexer like ...
apache-2.0
mrichart/ns-3-dev-git
src/point-to-point/bindings/modulegen__gcc_LP64.py
38
407808
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
skitazaki/jpgridmap
server/geojson/mapping.py
50
1326
GEO_INTERFACE_MARKER = "__geo_interface__" def is_mapping(ob): return hasattr(ob, "__getitem__") def to_mapping(ob): if hasattr(ob, GEO_INTERFACE_MARKER): candidate = ob.__geo_interface__ candidate = to_mapping(candidate) else: candidate = ob if not is_mapping(candidate): ...
apache-2.0
jseabold/statsmodels
statsmodels/tsa/tests/test_adfuller_lag.py
4
1833
# -*- coding: utf-8 -*- """Test for autolag of adfuller Created on Wed May 30 21:39:46 2012 Author: Josef Perktold """ import numpy as np from numpy.testing import assert_equal, assert_almost_equal import statsmodels.tsa.stattools as tsast from statsmodels.datasets import macrodata def test_adf_autolag(): #see i...
bsd-3-clause
tiagofrepereira2012/tensorflow
tensorflow/examples/learn/text_classification.py
12
6651
# 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 appl...
apache-2.0
WadeYuChen/django-oscar
src/oscar/apps/catalogue/receivers.py
60
1249
# -*- coding: utf-8 -*- from django.conf import settings if settings.OSCAR_DELETE_IMAGE_FILES: from oscar.core.loading import get_model from django.db import models from django.db.models.signals import post_delete from sorl import thumbnail from sorl.thumbnail.helpers import ThumbnailError ...
bsd-3-clause
DataDog/integrations-extras
portworx/datadog_checks/portworx/portworx.py
1
5120
from datadog_checks.base.checks.prometheus.prometheus_base import PrometheusCheck from datadog_checks.base.errors import CheckException EVENT_TYPE = SOURCE_TYPE_NAME = 'portworx' class PortworxCheck(PrometheusCheck): """ Collect px metrics from Portworx """ def __init__(self, name, init_config, agen...
bsd-3-clause
tempbottle/ironpython3
Tests/test_xrange.py
2
3215
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of th...
apache-2.0
revinate/kubernetes
examples/cluster-dns/images/frontend/client.py
468
1227
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
diogovk/ansible
lib/ansible/plugins/lookup/fileglob.py
176
1345
# (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
beiko-lab/gengis
bin/Lib/idlelib/run.py
3
11789
import sys import linecache import time import socket import traceback import thread import threading import Queue from idlelib import CallTips from idlelib import AutoComplete from idlelib import RemoteDebugger from idlelib import RemoteObjectBrowser from idlelib import StackViewer from idlelib import...
gpl-3.0
pperichon/domoticz
plugins/examples/RAVEn.py
1
11003
# RAVEn Plugin # # Author: Dnpwwo, 2016 # # # Plugin parameter definition below will be parsed during startup and copied into Manifest.xml, this will then drive the user interface in the Hardware web page # """ <plugin key="RAVEn" name="RAVEn Zigbee energy monitor" author="dnpwwo" version="1.3...
gpl-3.0
ProfessionalIT/professionalit-webiste
sdk/google_appengine/lib/django-0.96/django/views/debug.py
32
23633
from django.conf import settings from django.template import Template, Context, TemplateDoesNotExist from django.utils.html import escape from django.http import HttpResponseServerError, HttpResponseNotFound import os, re HIDDEN_SETTINGS = re.compile('SECRET|PASSWORD|PROFANITIES_LIST') def linebreak_iter(template_sou...
lgpl-3.0
cmisenas/artos
PyARTOS/GUI/CameraWindow.py
2
17193
"""Provides the CameraDetection class which creates a window for detecting objects in a video stream.""" try: # Python 3 import tkinter as Tkinter from tkinter import N, E, S, W from tkinter import ttk from tkinter import messagebox as tkMessageBox from tkinter import filedialog as tkFi...
gpl-3.0
J861449197/edx-platform
common/djangoapps/student/migrations/0050_auto__add_manualenrollmentaudit.py
84
17352
# -*- 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): def forwards(self, orm): # Adding model 'ManualEnrollmentAudit' db.create_table('student_manualenr...
agpl-3.0
byashimov/django-controlcenter
test_project/settings.py
1
1423
SECRET_KEY = 'test' DEBUG = True ALLOWED_HOSTS = [] INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'controlcenter', ) MIDDLEWARE_CLASSES = ( 'django.contr...
bsd-3-clause
KamalAwasthi/FullContact
myvenv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py
1777
19348
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
apache-2.0
dstcontrols/osisoftpy
src/osisoftpy/legacy/_client.py
1
1376
# -*- coding: utf-8 -*- """ osisoft_pi_webapi_python_client.client ~~~~~~~~~~~~~~~~~~~ This module contains the client used to access OSIsoft PI infrastructure and data """ from src.osisoftpy import _base, _server class client(_base): """A client to interact with the PI Web WebAPI""" def __init__(self, ...
apache-2.0
archifix/settings
sublime/Packages/backrefs/st3/backrefs/uniprops/unidata/linebreak.py
3
68020
"""Unicode Properties from Unicode version 6.1.0 (autogen).""" from __future__ import unicode_literals unicode_line_break = { "^ai": "\x00-\xa6\xa9\xab-\xb1\xb4-\xb5\xbb\xbf-\xd6\xd8-\xf6\xf8-\u02c6\u02c8\u02cc\u02ce-\u02cf\u02d1-\u02d7\u02dc\u02de-\u2014\u2017-\u201f\u2022-\u203a\u203c-\u2073\u2075-\u207e\u2080\u...
mit
avati/samba
python/samba/idmap.py
50
3258
# Unix SMB/CIFS implementation. # Copyright (C) 2008 Kai Blin <kai@samba.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 3 of the License, or # (at your option) any later...
gpl-3.0
olasitarska/django
django/contrib/gis/maps/google/zoom.py
87
6678
from __future__ import unicode_literals from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point from django.contrib.gis.maps.google.gmap import GoogleMapException from django.utils.six.moves import xrange from math import pi, sin, log, exp, atan # Constants used for degree to radian conversion, a...
bsd-3-clause
JoeWoo/grpc
src/python/grpcio_test/grpc_test/beta/test_utilities.py
8
2535
# 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
tobegit3hub/once2016
website/home/models.py
1
1439
from __future__ import unicode_literals import datetime from django.db import models class UserPhoto(models.Model): user_name = models.CharField(max_length=128, default="") user_phone = models.CharField(max_length=128, default="") access_code = models.CharField(max_length=128) photo_name = models.CharField(...
apache-2.0
theicfire/djangofun
django/utils/simplejson/encoder.py
430
15620
"""Implementation of JSONEncoder """ import re c_encode_basestring_ascii = None c_make_encoder = None ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]') ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') HAS_UTF8 = re.compile(r'[\x80-\xff]') ESCAPE_DCT = { '\\': '\\\\', '"': '\\"', '\b': '\\b', '\f': '\\f', ...
bsd-3-clause
tmerr/trevornet
trevornet/trevornet/idx.py
1
3888
#! /usr/bin/env python3 """ Parse an IDX file like the one used in the MNIST handwritten digit database. A description of the format is on this page: http://yann.lecun.com/exdb/mnist/ """ import struct import array import sys def _is_sequence(seq): return hasattr(seq, '__getitem__') and not hasattr(seq, 'strip')...
mit
Zopieux/py3status
py3status/modules/external_script.py
10
1913
# -*- coding: utf-8 -*- """ Display output of given script. Display output of any executable script set by 'script_path'. Pay attention. The output must be one liner, or will break your i3status ! The script should not have any parameters, but it could work. Configuration parameters: - cache_timeout : how often w...
bsd-3-clause
pipsiscool/audacity
lib-src/lv2/lv2/waflib/ansiterm.py
149
7136
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import sys,os try: if not(sys.stderr.isatty()and sys.stdout.isatty()): raise ValueError('not a tty') from ctypes import* class COORD(Structure): _fields_=[("X",c_short)...
mit
KohlsTechnology/ansible
lib/ansible/modules/network/dellos9/dellos9_facts.py
50
17592
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # Copyright (c) 2016 Dell Inc. # 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_versio...
gpl-3.0
adybbroe/oca_reader
mpef_oca/oca_reader.py
1
8139
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2016 Adam.Dybbroe # Author(s): # Adam.Dybbroe <a000680@c20671.ad.smhi.se> # 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, eith...
gpl-3.0
ajoaoff/django
django/db/backends/postgresql/client.py
346
2112
import os import subprocess from django.core.files.temp import NamedTemporaryFile from django.db.backends.base.client import BaseDatabaseClient from django.utils.six import print_ def _escape_pgpass(txt): """ Escape a fragment of a PostgreSQL .pgpass file. """ return txt.replace('\\', '\\\\').replace...
bsd-3-clause
t0in4/django
django/middleware/cache.py
372
7303
""" Cache middleware. If enabled, each Django-powered page will be cached based on URL. The canonical way to enable cache middleware is to set ``UpdateCacheMiddleware`` as your first piece of middleware, and ``FetchFromCacheMiddleware`` as the last:: MIDDLEWARE_CLASSES = [ 'django.middleware.cache.UpdateCa...
bsd-3-clause