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
bw4sz/MotionMeerkat_Bisque
MotionMeerkat/BackgroundSubtractor.py
1
7362
####Background subtraction for Motion class import numpy as np import cv2 #takes in the constructor and the method chosen class Background: def __init__(self,subMethod,display_image,acc,thresh,moghistory,mogvariance): ##Subtractor Method self.subMethod=subMethod ####Create Bac...
gpl-3.0
electrolinux/weblate
weblate/trans/machine/glosbe.py
11
1996
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.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, eithe...
gpl-3.0
jonasjberg/autonameow
autonameow/vendor/guessit/rules/properties/language.py
21
9861
#!/usr/bin/env python # -*- coding: utf-8 -*- """ language and subtitle_language properties """ # pylint: disable=no-member import copy import babelfish from rebulk.remodule import re from rebulk import Rebulk, Rule, RemoveMatch, RenameMatch from ..common.words import iter_words, COMMON_WORDS from ..common.validators...
gpl-2.0
joakim-hove/django
django/conf/locale/pl/formats.py
504
1147
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y' TIME_FORMAT = 'H:i' DATETI...
bsd-3-clause
ardekantur/pyglet
pyglet/gl/xlib.py
38
13415
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' from ctypes import * from pyglet.canvas.xlib import XlibCanvas from base import Config, CanvasConfig, Context from pyglet import gl from pyglet.gl import glx from pyglet.gl import glxext_arb from pyglet.gl import glx_info from ...
bsd-3-clause
vipmike007/virt-test
virttest/utils_test/libguestfs.py
9
31942
import re import os import logging import commands from autotest.client.shared import error, utils from virttest import virsh, virt_vm, libvirt_vm, data_dir from virttest import utils_net, xml_utils from virttest.libvirt_xml import vm_xml, xcepts from virttest import utils_libguestfs as lgf from virttest import qemu_st...
gpl-2.0
VigTech/Vigtech-Services
env/lib/python2.7/site-packages/django/middleware/clickjacking.py
185
1994
""" Clickjacking Protection Middleware. This module provides a middleware that implements protection against a malicious site loading resources from your site in a hidden frame. """ from django.conf import settings class XFrameOptionsMiddleware(object): """ Middleware that sets the X-Frame-Options HTTP head...
lgpl-3.0
xiandiancloud/ji
lms/djangoapps/open_ended_grading/views.py
16
13661
import logging from django.views.decorators.cache import cache_control from edxmako.shortcuts import render_to_response from django.core.urlresolvers import reverse from courseware.courses import get_course_with_access from xmodule.open_ended_grading_classes.grading_service_module import GradingServiceError import j...
agpl-3.0
rhinstaller/system-config-kickstart
src/savedialog.py
1
3163
# # Chris Lumens <clumens@redhat.com> # Brent Fox <bfox@redhat.com> # Tammy Fox <tfox@redhat.com> # # Copyright (C) 2000-2008 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License...
gpl-2.0
forge33/CouchPotatoServer
libs/guessit/transfo/__init__.py
94
4117
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
QISKit/qiskit-sdk-py
test/python/transpiler/test_barrier_before_final_measurements.py
1
14581
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
apache-2.0
yongli3/rt-thread
bsp/stm32f411-nucleo/rtconfig.py
5
3761
# BSP Note: For TI EK-TM4C1294XL Tiva C Series Connected LancuhPad (REV D) import os # toolchains options ARCH='arm' CPU='cortex-m4' CROSS_TOOL='keil' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') #device options PART_TYPE = 'STM32F411xE' # cross_tool provides the cross compiler # EXEC_PATH is the com...
apache-2.0
uwescience/myria-web
appengine/networkx/algorithms/distance_measures.py
3
3839
# -*- coding: utf-8 -*- """ Graph diameter, radius, eccentricity and other properties. """ __author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)', 'Dan Schult(dschult@colgate.edu)']) # Copyright (C) 2004-2010 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # ...
bsd-3-clause
cpalmit/drupaltest
sites/all/themes/bootstrap/node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
531
41681
# Copyright (c) 2013 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. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
gpl-2.0
GdZ/scriptfile
software/googleAppEngine/lib/django_1_4/django/core/handlers/wsgi.py
83
8644
import sys from threading import Lock try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django import http from django.core import signals from django.core.handlers import base from django.core.urlresolvers import set_script_prefix from django.utils import datastructure...
mit
unsiloai/syntaxnet-ops-hack
tensorflow/contrib/seq2seq/python/ops/basic_decoder.py
31
5521
# 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
rockfruit/bika.lims
bika/lims/controlpanel/bika_containertypes.py
1
3518
# This file is part of Bika LIMS # # Copyright 2011-2016 by it's authors. # Some rights reserved. See LICENSE.txt, AUTHORS.txt. from AccessControl.SecurityInfo import ClassSecurityInfo from Products.ATContentTypes.content import schemata from Products.Archetypes import atapi from Products.Archetypes.ArchetypeTool impo...
agpl-3.0
morrillo/partner_id_validation
__openerp__.py
2
1489
# -*- 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...
gpl-2.0
theoryno3/scikit-learn
sklearn/feature_extraction/image.py
32
17167
""" The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to extract features from images. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Olivier Grisel # Vlad Niculae # License: BSD 3 clause fro...
bsd-3-clause
deonwu/robotframework-debuger
src/rdb/interface/web/standalone.py
1
8730
""" this module is support to run RDB web interface in standalone mode. the RDB is running with robot, it's not available after the robot is stopped. The user may be confused "what's happened RDB? Does crushed?" The RDB will switch over to stand alone mode to notify user the robot is stopped friendly. """ from wsgi...
gpl-2.0
codemonkey2841/tradebot
run.py
1
6871
#!/usr/bin/env python """ It's a TradeBot """ import configparser import curses from httplib import HTTPException import os import signal import socket from ssl import SSLError import sys import time from tradebot import TradeBot def on_exit(sig, func=None): curses.nocbreak() stdscr.keypad(0) curses.echo...
mit
upliftaero/MissionPlanner
Lib/lib2to3/fixes/fix_filter.py
61
2183
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes filter(F, X) into list(filter(F, X)). We avoid the transformation if the filter() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. N...
gpl-3.0
nkgilley/home-assistant
tests/components/blebox/test_sensor.py
13
2739
"""Blebox sensors tests.""" import logging import blebox_uniapi import pytest from homeassistant.const import ( ATTR_DEVICE_CLASS, ATTR_UNIT_OF_MEASUREMENT, DEVICE_CLASS_TEMPERATURE, STATE_UNKNOWN, TEMP_CELSIUS, ) from .conftest import async_setup_entity, mock_feature from tests.async_mock impo...
apache-2.0
alqfahad/odoo
addons/procurement_jit_stock/procurement_jit_stock.py
130
2001
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2013 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
lizardsystem/lizard-levee
lizard_levee/migrations/0011_auto__add_segment__add_field_area_segments.py
1
7042
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Segment' db.create_table('lizard_levee_segment', ( ('id', self.gf('django.db.m...
gpl-3.0
40223227/40223227
static/Brython3.1.1-20150328-091302/Lib/VFS_import.py
738
3059
import os from browser import doc #_scripts=doc.createElement('script') #_scripts.src="/src/py_VFS.js" #_scripts.type="text/javascript" #doc.get(tag='head')[0].appendChild(_scripts) VFS=dict(JSObject(__BRYTHON__.py_VFS)) class VFSModuleFinder: def __init__(self, path_entry): print("in VFSModuleFinder") ...
gpl-3.0
mread/buck
src/com/facebook/buck/command/intellij.py
2
19662
import errno import fnmatch import json import os import re import subprocess import sys from collections import defaultdict MODULE_XML_START = """<?xml version="1.0" encoding="UTF-8"?> <module type="%(type)s" version="4">""" MODULE_XML_END = """ </module> """ ANDROID_FACET = """ <component name="FacetManager"> ...
apache-2.0
megaumi/django
django/db/migrations/loader.py
165
16926
from __future__ import unicode_literals import os import sys from importlib import import_module from django.apps import apps from django.conf import settings from django.db.migrations.graph import MigrationGraph from django.db.migrations.recorder import MigrationRecorder from django.utils import six from .exception...
bsd-3-clause
udrg/rpg_svo
svo_analysis/src/svo_analysis/analyse_dataset.py
17
1178
# -*- coding: utf-8 -*- import associate import numpy as np import matplotlib.pyplot as plt import yaml def loadDataset(filename): file = open(filename) data = file.read() lines = data.replace(","," ").replace("\t"," ").split("\n") D = np.array([[v.strip() for v in line.split(" ") if v.strip()!=""] for line i...
gpl-3.0
dev-coop/machine-learning
playing_around5.py
1
3420
''' Working with my personal data again, using sk-learn Thanks mchan on freenode ##machine-learning for guiding me on rolling window and such ''' from sklearn import tree, linear_model, neighbors, cross_validation import pandas as pd import numpy data_labels = ["Happiness", "Motivation", "Flexibility", "Strength", ...
mit
jtux270/translate
ovirt/3.6_source/packaging/setup/ovirt_engine_setup/constants.py
2
14913
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
gpl-3.0
Hellrungj/CSC-412-Networking
Protocol_Buffers/venv/lib/python2.7/site-packages/setuptools/tests/test_easy_install.py
41
15704
"""Easy install Tests """ import sys import os import shutil import tempfile import unittest import site import contextlib import textwrap import tarfile import logging import distutils.core from setuptools.compat import StringIO, BytesIO, urlparse from setuptools.sandbox import run_setup, SandboxViolation from setupt...
gpl-3.0
jadedsurfer/genx
node_modules/grunt/node_modules/js-yaml/support/pyyaml-src/representer.py
238
13528
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer', 'RepresenterError'] from .error import * from .nodes import * import datetime, sys, copyreg, types, base64 class RepresenterError(YAMLError): pass class BaseRepresenter: yaml_representers = {} yaml_multi_representers = {} def __i...
mit
kirachen/canvas
icl_data_import_export/sync_enrollment.py
1
2523
import sys import requests, json canvas_domain = "http://146.169.47.160:3000/" canvas_access_token = "2Zg8KXWMNmt4LTukfYCJ1E50KoV4gJ7gGrydLrATH3BOgc1PJZ0g4L4CUuU9U8oP" #This never expires for this domain data_dir = "data_dump/enrollments.txt" def sync_enrollment(): print "syncing" enrolled = read_enrollment()...
agpl-3.0
vladikr/nova_drafts
nova/objects/fixed_ip.py
2
11566
# Copyright 2014 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 a...
apache-2.0
renyi533/tensorflow
tensorflow/examples/speech_commands/freeze_test.py
12
4130
# 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
gfyoung/pandas
pandas/tests/indexes/test_setops.py
1
16997
""" The tests in this package are to ensure the proper resultant dtypes of set operations. """ import numpy as np import pytest from pandas.core.dtypes.common import is_dtype_equal import pandas as pd from pandas import ( CategoricalIndex, DatetimeIndex, Float64Index, Int64Index, MultiIndex, R...
bsd-3-clause
citrix-openstack-build/nova
nova/cmd/objectstore.py
17
1184
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compl...
apache-2.0
paurosello/frappe
frappe/website/doctype/help_article/help_article.py
12
2994
# Copyright (c) 2013, Frappe and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.website.website_generator import WebsiteGenerator from frappe.utils import is_markdown, markdown from frappe.website.utils import get_comment_list from frapp...
mit
cyrusin/tornado
demos/benchmark/gen_benchmark.py
99
1189
#!/usr/bin/env python # # A simple benchmark of the tornado.gen module. # Runs in two modes, testing new-style (@coroutine and Futures) # and old-style (@engine and Tasks) coroutines. from timeit import Timer from tornado import gen from tornado.options import options, define, parse_command_line define('num', defaul...
apache-2.0
joone/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py
636
71218
# Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
pavelchristof/gomoku-ai
tensorflow/contrib/slim/python/slim/nets/overfeat.py
164
5562
# 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
o3project/odenos
src/test/python/org/o3project/odenos/__init__.py
233
1026
# -*- coding:utf-8 -*- # Copyright 2015 NEC Corporation. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License...
apache-2.0
aferr/TimingCompartments
src/arch/x86/bios/E820.py
19
2615
# Copyright (c) 2008 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
scipy/scipy
scipy/integrate/quadpack.py
12
37343
# Author: Travis Oliphant 2001 # Author: Nathan Woods 2013 (nquad &c) import sys import warnings from functools import partial from . import _quadpack import numpy from numpy import Inf __all__ = ['quad', 'dblquad', 'tplquad', 'nquad', 'quad_explain', 'IntegrationWarning'] error = _quadpack.error class ...
bsd-3-clause
ebar0n/django
django/contrib/admin/widgets.py
2
17014
""" Form Widget classes specific to the Django admin site. """ import copy import json from django import forms from django.conf import settings from django.db.models.deletion import CASCADE from django.urls import reverse from django.urls.exceptions import NoReverseMatch from django.utils.html import smart_urlquote f...
bsd-3-clause
marcuspridham/crosswalk
build/android/lzma_compress.py
11
1753
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # pylint: disable=F0401 import optparse import os import shutil import sys import subprocess GYP_ANDROID_DIR = os.path.join(os.path...
bsd-3-clause
sangwook236/sangwook-library
python/src/swl/machine_vision/draw_attention.py
2
7505
import math import tensorflow as tf #-------------------------------------------------------------------- class DrawAttentionBase(object): @staticmethod def filter(img, width, height, Fx, Fy, gamma, patch_width, patch_height): Fxt = tf.transpose(Fx, perm=[0, 2, 1]) img = tf.reshape(img, [-1, height, width]) g...
gpl-2.0
openstack/cinder
cinder/tests/unit/fake_constants.py
2
5220
# Copyright 2016 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 a...
apache-2.0
ntuecon/server
pyenv/Lib/site-packages/twisted/internet/error.py
15
12645
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Exceptions and errors for use in twisted.internet modules. """ from __future__ import division, absolute_import import socket from twisted.python import deprecate from incremental import Version class BindError(Exception): """An erro...
bsd-3-clause
tux-00/ansible
lib/ansible/modules/cloud/centurylink/clc_group.py
70
17220
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
gpl-3.0
xevernever/attrition
attrition/attrition_problem.py
1
1089
""""Goal 0: Tee Up Project; Why Do We Care?""" import pandas as pd import matplotlib.pyplot as plt ## Import Data ## df = load_data() # df = pd.read_csv('HR_comma_sep.csv') #df.head() #df.dtypes def display_attrition_level(): """ DV1: Left-or-Stayed (binary variable); Display Attrition Level """ df = load_dat...
bsd-3-clause
groschovskiy/lerigos_music
Server/API/lib/google/protobuf/internal/test_bad_identifiers_pb2.py
43
5759
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/test_bad_identifiers.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from googl...
apache-2.0
nilbody/h2o-3
h2o-docs-theme/demo_docs/source/conf.py
32
8221
# -*- coding: utf-8 -*- # # Sphinx RTD theme demo documentation build configuration file, created by # sphinx-quickstart on Sun Nov 3 11:56:36 2013. # # 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 # autogenerated...
apache-2.0
sudosurootdev/external_chromium_org
native_client_sdk/src/build_tools/tests/sdktools_commands_test.py
76
18779
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import re import tarfile import tempfile import unittest from sdktools_test import SdkToolsTestCase SCRIPT_DI...
bsd-3-clause
ishanic/scikit-learn
examples/classification/plot_digits_classification.py
289
2397
""" ================================ Recognizing hand-written digits ================================ An example showing how the scikit-learn can be used to recognize images of hand-written digits. This example is commented in the :ref:`tutorial section of the user manual <introduction>`. """ print(__doc__) # Autho...
bsd-3-clause
geoscixyz/em_examples
em_examples/InductionSphereTEM.py
1
19333
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import numpy as np import scipy as sp import matplotlib.pyplot as plt from matplotlib.ticker import ScalarFormatter, FormatStrFormatter from matplotlib.path import Path import matplotlib.patches as patc...
mit
chdecultot/frappe
frappe/email/doctype/newsletter/test_newsletter.py
9
2953
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, unittest from frappe.email.doctype.newsletter.newsletter import confirmed_unsubscribe from six.moves.urllib.parse import unquote email...
mit
wilebeast/FireFox-OS
B2G/gecko/testing/mochitest/pywebsocket/mod_pywebsocket/headerparserhandler.py
36
9460
# Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
apache-2.0
Tche333/Hello_World
plugin.video.belgium/tvcom.py
1
1850
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- import re import channel class Channel(channel.Channel): def get_main_url(self): return 'http://www.tvcom.be' def get_categories(self): data = channel.get_url(self.main_url) regex = r"""missions(.+?)</ul""" res = re.finda...
gpl-2.0
qtekfun/htcDesire820Kernel
external/chromium_org/chrome/test/chromedriver/test/run_all_tests.py
23
6672
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs all ChromeDriver end to end tests.""" import optparse import os import platform import sys import tempfile _THIS_DIR = os.pat...
gpl-2.0
KevinMidboe/statusHandler
flask/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py
360
11622
from __future__ import absolute_import import errno import warnings import hmac from binascii import hexlify, unhexlify from hashlib import md5, sha1, sha256 from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning SSLContext = None HAS_SNI = False create_default_context = None IS_PYOPENSSL = F...
mit
cypsun/FreeCAD
src/Mod/Sketcher/TestSketcherApp.py
27
7131
# (c) Juergen Riegel (FreeCAD@juergen-riegel.net) 2011 LGPL * # * # This file is part of the FreeCAD CAx development system. * # * # This pro...
lgpl-2.1
timthelion/FreeCAD_sf_master
src/Mod/Fem/convert2TetGen.py
27
10679
# (c) 2010 LGPL #Make mesh of pn junction in TetGen format import FreeCAD, FreeCADGui, Part, Mesh App = FreeCAD # shortcut Gui = FreeCADGui # shortcut def exportMeshToTetGenPoly(meshToExport,filePath,beVerbose=1): """Export mesh to TetGen *.poly file format""" ## Part 1 - write node list to output file i...
lgpl-2.1
ArcherSys/ArcherSys
Lib/site-packages/tornado/test/httpclient_test.py
12
26340
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement import base64 import binascii from contextlib import closing import copy import functools import sys import threading import datetime from io import BytesIO from tornado.escape import utf8 from tornado import gen f...
mit
gedads/Neodynamis
migrations/migrate.py
33
1735
import MySQLdb import re import spell_blobs_to_spell_table credentials = {} db = None cur = None def connect(): print("Loading conf/map_darkstar.conf") # Grab mysql credentials filename = "../conf/map_darkstar.conf" global credentials global db global cur with open(filename) as f: ...
gpl-3.0
owlzhou/ttornado
env/Lib/site-packages/pip/_vendor/requests/packages/urllib3/fields.py
1007
5833
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
apache-2.0
thaddeusdiamond/Social-Hierarchical-Learning
ext/protobuf/python/mox.py
603
38237
#!/usr/bin/python2.4 # # Copyright 2008 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 o...
mit
catiedev/mbed-os
tools/export/ds5_5/__init__.py
10
2065
""" mbed SDK Copyright (c) 2011-2016 ARM Limited 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
OpenSmalltalk/vm
processors/ARM/gdb-8.3.1/gdb/syscalls/arm-linux.py
7
1759
# Copyright (C) 2013-2019 Free Software Foundation, Inc. # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without any warranty. import sys import re import ...
mit
mozilla/olympia
src/olympia/lib/tests/test_unicodehelper.py
4
1311
# -*- coding: utf-8 -*- import os from olympia.lib import unicodehelper COMPARISON = 'täst' def _do_test(path): """Performs a test on a JS file""" path = os.path.join(os.path.abspath(os.path.dirname(__file__)), path) with open(path, 'rb') as fobj: text = fobj.read() utext = unicodehelper.d...
bsd-3-clause
cliffano/swaggy-jenkins
clients/python/generated/swaggyjenkins/models/github_organization.py
1
5363
# coding: utf-8 """ Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 OpenAPI spec version: 1.1.1 Contact: blah@cliffano.com Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class GithubOrganizati...
mit
alsrgv/tensorflow
tensorflow/python/data/experimental/kernel_tests/shuffle_and_repeat_test.py
17
5259
# 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
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/modeladmin/tests.py
12
56499
from __future__ import unicode_literals from datetime import date from django import forms from django.contrib.admin import BooleanFieldListFilter, SimpleListFilter from django.contrib.admin.options import ( HORIZONTAL, VERTICAL, ModelAdmin, TabularInline, ) from django.contrib.admin.sites import AdminSite from d...
mit
luiseduardohdbackup/odoo
addons/document/document.py
152
83929
# -*- 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
rwl/PyCIM
CIM15/CDPSM/Connectivity/IEC61970/Wires/__init__.py
1
3466
# Copyright (C) 2010-2011 Richard Lincoln # # 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...
mit
alexproca/askbot-devel
askbot/migrations/0099_auto__del_field_thread_accepted_answer__del_field_anonymousanswer_ques.py
10
33856
# encoding: 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 unique constraint on 'PostRevision', fields ['question', 'revision'] db.delete_unique('askbot_p...
gpl-3.0
w1ll1am23/home-assistant
tests/components/ring/test_sensor.py
23
1636
"""The tests for the Ring sensor platform.""" from .common import setup_platform WIFI_ENABLED = False async def test_sensor(hass, requests_mock): """Test the Ring sensors.""" await setup_platform(hass, "sensor") front_battery_state = hass.states.get("sensor.front_battery") assert front_battery_state...
apache-2.0
coolbombom/CouchPotato
library/sqlalchemy/orm/__init__.py
11
52904
# sqlalchemy/orm/__init__.py # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer # mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Functional constructs for ORM configuration. See the SQLAlchemy...
gpl-3.0
jbzdak/edx-platform
cms/envs/aws.py
1
15187
""" This is the default template for our main set of AWS servers. """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import # Pylint gets confused by path.py instances, which report themselves...
agpl-3.0
osiell/server-tools
base_export_manager/tests/test_ir_exports_line.py
9
3859
# -*- coding: utf-8 -*- # © 2015 Antiun Ingenieria S.L. - Javier Iniesta # Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests.common import TransactionCase from openerp.exceptions import ValidationError class TestIrExports...
agpl-3.0
luotao19861229/pyspider
pyspider/webui/result.py
11
1803
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-10-19 16:23:55 from __future__ import unicode_literals from flask import render_template, request, json from flask import Response from .app import a...
apache-2.0
vnsofthe/odoo
addons/product/wizard/__init__.py
452
1076
# -*- 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...
agpl-3.0
shinymayhem/kubernetes
cluster/juju/return-node-ips.py
310
1024
#!/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
boomcan90/store
tests/test_order_consists_of.py
4
1190
# # -*- coding: utf-8 -*- # """Functional tests using WebTest. # See: http://webtest.readthedocs.org/ # TESTS MUST START WITH "test" # """ # from flask import url_for # class TestBreakTheOrder: # """ # Breaking the order # """ # def test_order_conists_of_is_not_not_found(self, testapp): # # !...
bsd-3-clause
Kagee/youtube-dl
youtube_dl/extractor/dailymotion.py
1
9120
# coding: utf-8 from __future__ import unicode_literals import re import json import itertools from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_request, ) from ..utils import ( ExtractorError, int_or_none, orderedSet, str_to_int, unescapeHTML, ) class D...
unlicense
alx-eu/django
django/contrib/admin/views/decorators.py
230
1286
from functools import wraps from django.utils.translation import ugettext as _ from django.contrib.admin.forms import AdminAuthenticationForm from django.contrib.auth.views import login from django.contrib.auth import REDIRECT_FIELD_NAME def staff_member_required(view_func): """ Decorator for views that check...
bsd-3-clause
130s/ros_buildfarm
scripts/devel/catkin_make_isolated_and_test.py
3
2508
#!/usr/bin/env python3 import argparse import os import sys from ros_buildfarm.catkin_workspace import call_catkin_make_isolated from ros_buildfarm.catkin_workspace import clean_workspace from ros_buildfarm.catkin_workspace import ensure_workspace_exists def main(argv=sys.argv[1:]): parser = argparse.ArgumentPa...
apache-2.0
caveman-dick/ansible
test/units/modules/network/iosxr/iosxr_module.py
56
3259
# (c) 2016 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
t-artistik/browserscope
base/summary_test_set.py
9
2474
#!/usr/bin/python2.4 # # Copyright 2009 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 ...
apache-2.0
MoserMichael/cstuff
python-pypi/ntrace/setup.py
1
1131
import os from setuptools import setup from setuptools import Extension def read(fname): with open(os.path.join(os.path.dirname(__file__), fname)) as f: return f.read() setup( name = "ntrace", version = "0.0.1", author = "Michael Moser", author_email = "moser.michael@gmail.co...
bsd-3-clause
quamilek/django
tests/file_uploads/views.py
298
5093
from __future__ import unicode_literals import contextlib import hashlib import json import os from django.core.files.uploadedfile import UploadedFile from django.http import HttpResponse, HttpResponseServerError from django.utils import six from django.utils.encoding import force_bytes, smart_str from .models impor...
bsd-3-clause
kevin-coder/tensorflow-fork
tensorflow/contrib/learn/python/learn/learn_io/dask_io.py
42
4229
# 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
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/authentication/__init__.py
1
11770
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
bleachbit/bleachbit
tests/TestAll.py
1
1646
# vim: ts=4:sw=4:expandtab # BleachBit # Copyright (C) 2008-2021 Andrew Ziem # https://www.bleachbit.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 # ...
gpl-3.0
Mazecreator/tensorflow
tensorflow/contrib/layers/python/layers/embedding_ops_test.py
86
31950
# 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
AltSchool/django-allauth
allauth/socialaccount/providers/stripe/tests.py
7
1572
# -*- coding: utf-8 -*- from __future__ import unicode_literals from allauth.socialaccount.tests import OAuth2TestsMixin from allauth.tests import MockedResponse, TestCase from .provider import StripeProvider class StripeTests(OAuth2TestsMixin, TestCase): provider_id = StripeProvider.id def get_mocked_resp...
mit
CXQERP/ODOOERP
addons/hr_payroll/report/report_payslip.py
377
1982
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
potherca/phpDocumentor2
docs/.templates/responsive/conf.py
22
3320
import sys, os project = u'phpDocumentor' copyright = u'2013, Mike van Riel' version = '2.1' release = '2.1.0' sys.path.append(os.path.abspath('../../.exts')) extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.ifconfig', 'plantuml'] templates_path = ['.'] source_suffix = '.rst' master_doc = 'index' e...
mit
Time-Green/-tg-station-yog-rebase
tools/mapmerge/map_helpers.py
29
18534
import sys try: version = sys.version_info if version.major < 3 or (version.major == 3 and version.minor < 5): print("ERROR: You are running an incompatible version of Python. The current minimum version required is [3.5].\nYour version: {}".format(sys.version)) sys.exit() except: print("ER...
agpl-3.0