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
ColOfAbRiX/ansible
lib/ansible/modules/database/vertica/vertica_facts.py
28
9387
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0
suninsky/ReceiptOCR
Python/server/lib/python2.7/site-packages/markupsafe/__init__.py
144
10697
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import string from collections import Mapping from markupsafe._compat import text_type, string_types, int_types, \ u...
mit
ahmadio/edx-platform
lms/djangoapps/mobile_api/social_facebook/groups/views.py
86
4938
""" Views for groups info API """ from rest_framework import generics, status, mixins from rest_framework.response import Response from django.conf import settings import facebook from ...utils import mobile_view from . import serializers @mobile_view() class Groups(generics.CreateAPIView, mixins.DestroyModelMixin)...
agpl-3.0
johnsonc/OTM2
opentreemap/treemap/tests/ui/uitest_registration_views.py
12
2858
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from time import sleep from django.core.urlresolvers import reverse from django.core import mail from registration.models import RegistrationProfile from treemap.tests.ui import UITes...
gpl-3.0
catb0t/simpleforth
forth.py
1
7114
#!/usr/bin/env python3 import builtins from pmlr import pmlr debug_write = pmlr.util.debug_write ERR_DATA = { ZeroDivisionError: {"IS_FATAL": False, "TYPE": "DEBUG"}, LookupError: {"IS_FATAL": False, "TYPE": "RANGE"}, IndexError: {"IS_FATAL": False, "TYPE": "RANGE"}, TypeError: ...
gpl-3.0
skidzen/grit-i18n
grit/tool/build.py
2
19603
#!/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. '''The 'grit build' tool along with integration for this tool with the SCons build system. ''' import filecmp import getopt import...
bsd-2-clause
minosg/piblinker
piblinker.py
1
14790
#!/usr/bin/env python """blinky.py: A small library that uses wiriping pi access to raspbery pi GPIO ports,aimed at providing a simple notification interface""" __author__ = "minos197@gmail.com" __license__ = "LGPL" __version__ = "0.0.1" __email__ = "Minos Galanakis" __project__ = "smartpi" __date__ = "01-06-2015"...
lgpl-2.1
jonwright/ImageD11
scripts/plotImageD11map.py
1
1829
#!/usr/bin/env python from __future__ import print_function from ImageD11.grain import read_grain_file import sys, os gf = read_grain_file(sys.argv[1]) mapfile=open(sys.argv[2],"w") def dodot(xyz,k): mapfile.write("%f %f %f %d\n"%(xyz[0],xyz[1],xyz[2],k)) def getmedian(s): items=s.split() j = -1 fo...
gpl-2.0
inspyration/odoo
addons/email_template/tests/test_mail.py
124
14318
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
eicher31/compassion-modules
child_compassion/mappings/household_mapping.py
3
3536
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py...
agpl-3.0
go-bears/nupic
src/nupic/encoders/category.py
39
7798
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
dvliman/jaikuengine
.google_appengine/lib/django-1.5/tests/regressiontests/extra_regress/models.py
114
1365
from __future__ import unicode_literals import copy import datetime from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class RevisionableModel(models.Model): base = models.ForeignKey('self', null=Tru...
apache-2.0
goFrendiAsgard/kokoropy
kokoropy/packages/sqlalchemy/dialects/mysql/pyodbc.py
32
2640
# mysql/pyodbc.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mysql+pyodbc :name: PyODBC :dbapi: pyodbc :connectstr...
mit
chienlieu2017/it_management
odoo/addons/website_event/controllers/main.py
7
11571
# -*- coding: utf-8 -*- import babel.dates import re import werkzeug from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from odoo import fields, http, _ from odoo.addons.website.models.website import slug from odoo.http import request class WebsiteEventController(http.Controll...
gpl-3.0
derekjchow/models
research/deeplab/core/nas_cell.py
1
8432
# Copyright 2018 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 applicab...
apache-2.0
lancezlin/ml_template_py
lib/python2.7/site-packages/sklearn/metrics/tests/test_score_objects.py
15
17443
import pickle import tempfile import shutil import os import numbers import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regexp from sklearn.utils.t...
mit
14thibea/megamix
megamix/batch/DPGMM.py
1
20644
# -*- coding: utf-8 -*- # #Created on Fri Apr 14 15:21:17 2017 # #author: Elina Thibeau-Sutre # from .initializations import initialize_log_assignements,initialize_mcw from .base import _full_covariance_matrices from .base import _log_normal_matrix from .base import BaseMixture from .base import _log_B import numpy a...
apache-2.0
sgarrity/bedrock
lib/l10n_utils/management/commands/fluent.py
8
3597
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from pathlib import Path import textwrap from django.core.management.base import BaseCommand class Command(BaseComman...
mpl-2.0
kevinmel2000/brython
www/src/Lib/test/unittests/test_cgitb.py
113
2551
from test.support import run_unittest from test.script_helper import assert_python_failure, temp_dir import unittest import sys import cgitb class TestCgitb(unittest.TestCase): def test_fonts(self): text = "Hello Robbie!" self.assertEqual(cgitb.small(text), "<small>{}</small>".format(text)) ...
bsd-3-clause
rhololkeolke/apo-website-devin
src/application/facebook/facebook.py
2
8731
""" This module contains helper classes and methods for the facebook integration module .. module:: application.facebook.facebook .. moduleauthor:: Devin Schwab <dts34@case.edu> """ import facebooksdk as fb import models from flask import flash class AlbumList(object): def __init__(self, token): """ ...
bsd-3-clause
korotkyn/ibis
ibis/expr/tests/test_temporal.py
9
5955
# Copyright 2014 Cloudera Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
apache-2.0
hectord/lettuce
tests/integration/lib/Django-1.2.5/django/core/handlers/base.py
44
9926
import sys from django import http from django.core import signals from django.utils.encoding import force_unicode from django.utils.importlib import import_module class BaseHandler(object): # Changes that are always applied to a response (in this order). response_fixes = [ http.fix_location_header, ...
gpl-3.0
KristFoundation/Programs
luaide/Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
mit
ARM-software/mbed-beetle
tools/host_tests/host_tests_plugins/module_copy_smart.py
2
4378
""" mbed SDK Copyright (c) 2011-2013 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
ahmadio/edx-platform
lms/lib/courseware_search/lms_filter_generator.py
58
5634
""" This file contains implementation override of SearchFilterGenerator which will allow * Filter by all courses in which the user is enrolled in """ from microsite_configuration import microsite from student.models import CourseEnrollment from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import Co...
agpl-3.0
goliate/sarakha63-persomov
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/twentyfourvideo.py
32
3892
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( parse_iso8601, int_or_none, ) class TwentyFourVideoIE(InfoExtractor): IE_NAME = '24video' _VALID_URL = r'https?://(?:www\.)?24video\.net/(?:video/(?:view|xml)/|player/new24_play\.swf\?id=)(...
gpl-3.0
longman694/youtube-dl
youtube_dl/extractor/watchbox.py
14
5539
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( int_or_none, js_to_json, strip_or_none, try_get, unified_timestamp, ) class WatchBoxIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?w...
unlicense
mesocentrefc/easybuild-framework
easybuild/tools/version.py
2
2926
## # Copyright 2009-2014 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
kinghaitao/git-core
scripts/rt-tester/rt-tester.py
904
5366
#!/usr/bin/env python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt impor...
gpl-2.0
broferek/ansible
test/units/modules/network/f5/test_bigip_service_policy.py
38
4128
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks 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 import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
wavelets/zipline
zipline/examples/dual_ema_talib.py
2
3230
#!/usr/bin/env python # # Copyright 2013 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
crmccreary/openerp_server
openerp/addons/account_bank_statement_extensions/account_bank_statement.py
9
6553
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/django-1.2/django/db/models/sql/datastructures.py
396
1157
""" Useful auxilliary data structures for query construction. Not useful outside the SQL domain. """ class EmptyResultSet(Exception): pass class FullResultSet(Exception): pass class MultiJoin(Exception): """ Used by join construction code to indicate the point at which a multi-valued join was att...
mit
wuga214/Django-Wuga
env/lib/python2.7/site-packages/pip/_vendor/distlib/markers.py
1261
6282
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # """Parser for the environment markers micro-language defined in PEP 345.""" import ast import os import sys import platform from .compa...
apache-2.0
maniacx/android_kernel_htcleo-3.0
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
paulgclark/rf_utilities
zmq_utils.py
1
1239
import zmq import array import time import struct import numpy as np import pmt import sys class zmq_pull_socket(): def __init__(self, tcp_str, verbose=0): self.context = zmq.Context() self.receiver = self.context.socket(zmq.PULL) self.receiver.connect(tcp_str) def poll(self, type_str...
mit
kcpawan/django
tests/many_to_one/models.py
215
2785
""" Many-to-one relationships To define a many-to-one relationship, use ``ForeignKey()``. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Reporter(models.Model): first_name = models.CharFiel...
bsd-3-clause
shikigit/python-phonenumbers
python/phonenumbers/data/region_PM.py
11
1604
"""Auto-generated file, do not edit by hand. PM metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_PM = PhoneMetadata(id='PM', country_code=508, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[45]\\d{5}', possible_number_pattern='\\...
apache-2.0
xguse/ggplot
ggplot/geoms/geom_abline.py
12
1487
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from ggplot.utils import make_iterable_ntimes from .geom import geom # Note when documenting # slope and intercept can be functions that compute the slope # and intercept using the data. If ...
bsd-2-clause
Vegasvikk/django-cms
cms/models/static_placeholder.py
49
3452
import uuid from django.contrib.auth import get_permission_codename from django.contrib.sites.models import Site from django.core.exceptions import ValidationError from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from cm...
bsd-3-clause
home-assistant/home-assistant
tests/components/hisense_aehw4a1/test_init.py
5
2927
"""Tests for the Hisense AEH-W4A1 init file.""" from unittest.mock import patch from pyaehw4a1 import exceptions from homeassistant import config_entries, data_entry_flow from homeassistant.components import hisense_aehw4a1 from homeassistant.setup import async_setup_component async def test_creating_entry_sets_up_...
apache-2.0
ChanChiChoi/scikit-learn
examples/model_selection/plot_roc.py
146
3697
""" ======================================= Receiver Operating Characteristic (ROC) ======================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality. ROC curves typically feature true positive rate on the Y axis, and false positive rate on the X a...
bsd-3-clause
difro/kubernetes
examples/cluster-dns/images/backend/server.py
468
1313
#!/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
vipulkanade/EventbriteDjango
lib/python2.7/site-packages/django/middleware/clickjacking.py
284
1989
""" 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...
mit
rcolasanti/CompaniesHouseScraper
DVLACompanyNmeMatchCoHoAPIFindMissing.py
1
5174
import requests import json import numpy as np import pandas as pd import CoHouseToken from difflib import SequenceMatcher # In[3]: def exactMatch(line1, line2): line1=line1.upper().rstrip() line2=line2.upper().rstrip() #print("|"+line1+"|"+line2+"|",line1==line2) return line1==line2 def ...
gpl-3.0
lyft/incubator-airflow
airflow/kubernetes/pod_generator.py
2
22063
# 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
rochoa85/pyMIC
examples/data_map/data_map.py
1
1674
#!/usr/bin/python # Copyright (c) 2014, Intel Corporation All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright # notice, th...
bsd-3-clause
javierTerry/odoo
addons/email_template/html2text.py
440
14143
#!/usr/bin/env python """html2text: Turn HTML into equivalent Markdown-structured text.""" __version__ = "2.36" __author__ = "Aaron Swartz (me@aaronsw.com)" __copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3." __contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes", "Kevin Jay North"] # TODO: # Support deco...
agpl-3.0
saguila/AlgoritmoA
pqdict.py
2
16450
"""Copyright (c) 2012 Nezar Abdennur This module contains code adapted from the Python implementation of the heapq module, which was written by Kevin O'Connor and augmented by Tim Peters and Raymond Hettinger. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated...
mit
ashwinikd/xhprof-dataextract
lib/sql.py
1
1165
DROP_TBL_PERFDATA = "DROP TABLE perfdata" CREATE_TBL_PERFDATA = """CREATE TABLE `perfdata` ( `pk` int(11) NOT NULL AUTO_INCREMENT, `id` varchar(16) NOT NULL, `fn` varchar(256) NOT NULL, `wt` int(11) NOT NULL, `ct` int(11) NOT NULL, `pmu` int(11) NOT NULL, `mu` int(11) NOT NULL, `cpu` int(11) NOT NULL, ...
bsd-3-clause
laurent-george/weboob
modules/barclays/pages.py
6
10301
# -*- coding: utf-8 -*- # Copyright(C) 2012 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opti...
agpl-3.0
nash-x/hws
neutron/service.py
3
10505
# Copyright 2011 VMware, 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 a...
apache-2.0
mclaughlin6464/pasta
pasta/ising.py
1
5474
''' This is a dummy file for me to get started making an Ising model. I'll get this 2-D Ising running, then generalize. ''' import argparse from itertools import izip import numpy as np from matplotlib import pyplot as plt import seaborn as sns sns.set() def run_ising(N, d, K, J,h, n_steps, plot = False): ''' ...
mit
benoitsteiner/tensorflow-opencl
tensorflow/python/client/session_test.py
11
71617
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
mhnatiuk/phd_sociology_of_religion
scrapper/lib/python2.7/site-packages/scrapy/contrib/linkextractors/htmlparser.py
11
2468
""" HTMLParser-based link extractor """ from HTMLParser import HTMLParser from urlparse import urljoin from w3lib.url import safe_url_string from scrapy.link import Link from scrapy.utils.python import unique as unique_list class HtmlParserLinkExtractor(HTMLParser): def __init__(self, tag="a", attr="href", pro...
gpl-2.0
Cynary/distro6.01
arch/6.01Soft/lib601-F13-4/build/lib/soar/io/io_useif.py
2
3114
# # soar # io.py - object-oriented interface to the robot # # This io file makes use of the "official" soar interface # (sonarDistances, etc), and it is still ugly, since it relies on having # a handle on the brain environment, but it is arguably neater than # the io.py file. However it seems to introduce some kind ...
mit
wanghaoran1988/origin
cmd/cluster-capacity/go/src/github.com/kubernetes-incubator/cluster-capacity/vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-e2e/reactive/kubernetes_e2e.py
100
7192
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
darryncampbell/KerrieWorking-Angular
app/bower_components/bootstrap/test-infra/s3_cache.py
1700
3523
#!/usr/bin/env python2.7 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, remove as _delete_file from os.path import isfile, dirname, basename, abspath from hashlib import sha256 from subprocess import check_call as run from boto.s3....
mit
njvack/ge-mri-rtafni
scanner-console/vendor/dicom/contrib/imViewer_Simple.py
4
12358
#========================================================================== # imViewer-Simple.py # # An example program that opens uncompressed DICOM images and # converts them via numPy and PIL to be viewed in wxWidgets GUI # apps. The conversion is currently: # # pydicom->NumPy->PIL->wxPython.Image->wxPython.B...
mit
vadimtk/chrome4sdp
tools/telemetry/third_party/gsutilz/third_party/pyasn1/test/type/test_constraint.py
53
8746
from pyasn1.type import constraint, error from pyasn1.error import PyAsn1Error from sys import version_info if version_info[0:2] < (2, 7) or \ version_info[0:2] in ( (3, 0), (3, 1) ): try: import unittest2 as unittest except ImportError: import unittest else: import unittest class Single...
bsd-3-clause
pschmitt/home-assistant
homeassistant/components/tof/sensor.py
11
3309
"""Platform for Time of Flight sensor VL53L1X from STMicroelectronics.""" import asyncio from functools import partial import logging from VL53L1X2 import VL53L1X # pylint: disable=import-error import voluptuous as vol from homeassistant.components import rpi_gpio from homeassistant.components.sensor import PLATFOR...
apache-2.0
claneys/shinken
test/test_servicetpl_no_hostname.py
18
2049
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the F...
agpl-3.0
hovsepm/AutoRest
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/auto_rest_date_time_test_service.py
3
2116
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
LibreSoftTeam/2016-uml-miner
phase3-outputs/scripts/umlfiles2table_images.py
1
2885
#!/usr/bin/python3 import csv import pymysql singleList = [] multipleList = [] # Connect to the database connection = pymysql.connect( host='localhost', user='operator', passwd='operator', db='chunk4_images', charset='utf8mb4', ...
gpl-3.0
IBM/differential-privacy-library
tests/mechanisms/test_ExponentialCategorical.py
1
4894
import numpy as np from unittest import TestCase from diffprivlib.mechanisms import ExponentialCategorical from diffprivlib.utils import global_seed class TestExponential(TestCase): def setup_method(self, method): if method.__name__ .endswith("prob"): global_seed(314159) self.mech = ...
mit
lewisc/spark-tk
python/sparktk/models/timeseries/arx.py
7
16906
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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 require...
apache-2.0
wederw/bitcoin
qa/rpc-tests/mempool_spendcoinbase.py
6
2762
#!/usr/bin/env python2 # Copyright (c) 2014 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 spending coinbase transactions. # The coinbase transaction in block N can appear in block # N+100... ...
mit
danilo-massa/honeyd
webserver/htdocs/index.py
2
1445
import honeyd import time import support from htmltmpl import TemplateManager, TemplateProcessor global counter self.send_response(200) self.send_header("Content-Type", "text/html") self.send_nocache() self.end_headers() # Compile or load already precompiled template. template = TemplateManager().prepare(self.root+"...
gpl-2.0
lmregus/Portfolio
python/design_patterns/env/lib/python3.7/site-packages/pip/_vendor/chardet/escsm.py
289
10510
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
openvapour/ryu
ryu/services/protocols/bgp/info_base/rtc.py
52
2467
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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 appli...
apache-2.0
admcrae/tensorflow
tensorflow/contrib/learn/python/learn/ops/seq2seq_ops.py
61
5870
# 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
pyblish/pyblish-starter
pyblish_starter/vendor/jsonschema/_reflect.py
7
5008
# -*- test-case-name: twisted.test.test_reflect -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Standardized versions of various cool and/or strange things that you can do with Python's reflection capabilities. """ import sys from .compat import PY3 class _NoModuleFound(Exception): ...
mit
gdimitris/ChessPuzzler
Virtual_Environment/lib/python2.7/site-packages/requests/packages/chardet/big5prober.py
2931
1684
######################## 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...
mit
nive-cms/nive
nive/userdb/tests/test_app.py
1
7136
# -*- coding: utf-8 -*- import time import unittest from nive.security import AdminUser, UserFound from db_app import * class ObjectTest(unittest.TestCase): def setUp(self): self.app = app() def tearDown(self): self.app.Close() pass def test_add(self): a=self.app ...
gpl-3.0
SwagColoredKitteh/servo
tests/wpt/web-platform-tests/tools/py/testing/root/test_py_imports.py
163
1983
import py import types import sys def checksubpackage(name): obj = getattr(py, name) if hasattr(obj, '__map__'): # isinstance(obj, Module): keys = dir(obj) assert len(keys) > 0 print (obj.__map__) for name in list(obj.__map__): assert hasattr(obj, name), (obj, name) ...
mpl-2.0
rbenson/orgmode
resolver/https.py
2
2676
import re import sys import subprocess import sublime from .abstract import AbstractRegexLinkResolver try: import urllib.request, urllib.parse, urllib.error except ImportError: import urllib PATTERN_SETTING = 'orgmode.open_link.resolver.https.pattern' PATTERN_DEFAULT = r'^(https):(?P<url>.+)$' URL_SETTING =...
mit
geosolutions-it/geonode
geonode/upload/tests/test_files.py
11
1695
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2018 OSGeo # # 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 ...
gpl-3.0
jfinkels/networkx
networkx/generators/tests/test_expanders.py
55
2497
# Copyright 2014 "cheebee7i". # Copyright 2014 "alexbrc". # Copyright 2014 Jeffrey Finkelstein <jeffrey.finkelstein@gmail.com>. """Unit tests for the :mod:`networkx.generators.expanders` module. """ try: import scipy is_scipy_available = True except: is_scipy_available = False import networkx as nx from n...
bsd-3-clause
hjanime/VisTrails
vistrails/gui/module_info.py
1
13979
############################################################################### ## ## Copyright (C) 2014-2015, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
bsd-3-clause
xthirtyfive/gamemod
guiprovider.py
1
2081
# Copyright 2013 X35 # # This file is part of gamemod. # # gamemod 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. # ...
gpl-3.0
romankagan/DDBWorkbench
plugins/hg4idea/testData/bin/hgext/acl.py
91
10362
# acl.py - changeset access control for mercurial # # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''hooks for controlling repository access This hook makes it possible to ...
apache-2.0
jhu-lcsr-forks/ogre
Tools/Blender2.6Export/ogre_mesh_exporter/mesh_impl.py
16
16080
# ##### BEGIN MIT LICENSE BLOCK ##### # Copyright (C) 2011 by Lih-Hern Pang # 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 ...
mit
Imaginashion/cloud-vision
.fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/encodings/cp1255.py
272
12466
""" Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
mit
levibostian/myBlanky
googleAppEngine/google/appengine/api/search/__init__.py
8
2549
#!/usr/bin/env python # # Copyright 2007 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
shakamunyi/neutron
neutron/db/metering/metering_rpc.py
46
2075
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com> # # 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 applicabl...
apache-2.0
ElephoneApp/kubernetes
cluster/juju/charms/trusty/kubernetes-master/unit_tests/test_install.py
105
4115
#!/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
cedadev/cis
cis/test/integration/test_eval.py
3
7743
import netCDF4 import numpy from hamcrest import assert_that, is_ import unittest from cis.cis_main import evaluate_cmd, col_cmd from cis.test.integration.base_integration_test import BaseIntegrationTest from cis.test.integration_test_data import * from cis.parse import parse_args from cis.test.unit.eval.test_calc im...
lgpl-3.0
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/template/loaders/app_directories.py
1
1602
""" Wrapper for loading templates from "templates" directories in INSTALLED_APPS packages. """ import io from django.core.exceptions import SuspiciousFileOperation from django.template.base import TemplateDoesNotExist from django.template.utils import get_app_template_dirs from django.utils._os import safe_...
mit
beatrizjesus/my-first-blog
pasta/Lib/site-packages/django/contrib/redirects/migrations/0001_initial.py
142
1271
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.CreateModel( name='Redirect', fields=[ ...
mit
denisenkom/django
tests/bulk_create/tests.py
5
6664
from __future__ import unicode_literals from operator import attrgetter from django.db import connection from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from django.test.utils import override_settings from .models import Country, Restaurant, Pizzeria, State, TwoFields class BulkCreateTests(T...
bsd-3-clause
mapr/impala
shell/ext-py/sasl-0.1.1/sasl/saslwrapper.py
76
4375
# This file was automatically generated by SWIG (http://www.swig.org). # Version 1.3.36 # # Don't modify this file, modify the SWIG interface instead. # This file is compatible with both classic and new-style classes. import _saslwrapper import new new_instancemethod = new.instancemethod try: _swig_property = prop...
apache-2.0
Vogeltak/pauselan
lib/python3.4/site-packages/sqlalchemy/dialects/mysql/gaerdbms.py
59
3387
# mysql/gaerdbms.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mysql+gaerdbms :name: Google Cloud SQL :dbapi: rdbms :...
gpl-2.0
numericillustration/sdc-imgapi
tools/manatee-diff/manatee2images.py
2
1948
#!/usr/bin/env python """ Take a imgapi_images-*.gz manatee table dump and emit a JSON array of images. Usage: gzcat imgapi_images-2014-11-15-00-01-56.gz | ./manatee2images.py > images.json """ import json import sys import operator from pprint import pprint import codecs # TODO: ideally we wouldn't hardcode ...
mpl-2.0
lancezlin/ml_template_py
lib/python2.7/site-packages/wheel/metadata.py
93
11676
""" Tools for converting old- to new-style metadata. """ from collections import namedtuple from .pkginfo import read_pkg_info from .util import OrderedDefaultDict try: from collections import OrderedDict except ImportError: OrderedDict = dict import re import os.path import textwrap import pkg_resources impo...
mit
nicholaschris/landsatpy
stuff.py
1
1864
import cloud_detection_new as cloud_detection from matplotlib import pyplot as plt import views from skimage import exposure nir = cloud_detection.get_nir()[0:600,2000:2600] red = cloud_detection.get_red()[0:600,2000:2600] green = cloud_detection.get_green()[0:600,2000:2600] blue = cloud_detection.get_blue()[0:600,200...
mit
koyuawsmbrtn/eclock
windows/kivy/kivy/core/image/img_dds.py
54
1048
''' DDS: DDS image loader ''' __all__ = ('ImageLoaderDDS', ) from kivy.lib.ddsfile import DDSFile from kivy.logger import Logger from kivy.core.image import ImageLoaderBase, ImageData, ImageLoader class ImageLoaderDDS(ImageLoaderBase): @staticmethod def extensions(): return ('dds', ) def load(...
gpl-2.0
dudonwai/dudonsblog
Lib/site-packages/django/contrib/gis/db/models/sql/conversion.py
308
2015
""" This module holds simple classes to convert geospatial values from the database. """ from django.contrib.gis.db.models.fields import GeoSelectFormatMixin from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.measure import Area, Distance class BaseField(object): empty_strings_allow...
mit
vedujoshi/tempest
tempest/api/identity/base.py
2
11762
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
JamesShaeffer/QGIS
tests/src/python/test_qgsmessagelog.py
30
3449
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsMessageLog. .. 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. """ __a...
gpl-2.0
hophacker/bitcoin_malleability
contrib/bitrpc/bitrpc.py
46
9207
from jsonrpc import ServiceProxy import sys import string import getpass # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8332") e...
mit