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
JerzySpendel/python-social-auth
social/apps/django_app/default/models.py
30
3989
"""Django ORM models for Social Auth""" import six from django.db import models from django.conf import settings from django.db.utils import IntegrityError from social.utils import setting_name from social.storage.django_orm import DjangoUserMixin, \ DjangoAssociationMixin, \ ...
bsd-3-clause
pombredanne/pyjs
pyjs/runners/windows.py
6
13955
## Copyright (c) 2003 Henk Punt ## 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, #...
apache-2.0
dpiers/coderang-meteor
public/jsrepl/extern/python/unclosured/lib/python2.7/xml/sax/_exceptions.py
250
4785
"""Different kinds of SAX Exceptions""" import sys if sys.platform[:4] == "java": from java.lang import Exception del sys # ===== SAXEXCEPTION ===== class SAXException(Exception): """Encapsulate an XML error or warning. This class can contain basic error or warning information from either the XML parser o...
mit
LukeHoersten/ansible
lib/ansible/plugins/action/pause.py
57
5479
# Copyright 2012, Tim Bielawa <tbielawa@redhat.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
gpl-3.0
quinngroup/fergus-ssl
Extras/src/LabelPropagationDistributed.py
1
15949
# coding: utf-8 import numpy as np from numpy.core.numeric import array from sklearn.metrics import pairwise from collections import OrderedDict from scipy.linalg import eig from scipy import interpolate as ip from pyspark.mllib.linalg.distributed import IndexedRow, RowMatrix, IndexedRowMatrix, CoordinateMatrix, ...
apache-2.0
asadziach/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/relaxed_onehot_categorical_test.py
82
7463
# 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
robbiet480/home-assistant
homeassistant/components/timer/__init__.py
6
10411
"""Support for Timers.""" from datetime import timedelta import logging import typing import voluptuous as vol from homeassistant.const import ( ATTR_EDITABLE, CONF_ICON, CONF_ID, CONF_NAME, SERVICE_RELOAD, ) from homeassistant.core import callback from homeassistant.helpers import collection impo...
apache-2.0
DukeOfHazard/crits
crits/indicators/forms.py
7
9138
from django.conf import settings from django import forms from django.forms.widgets import RadioSelect from crits.campaigns.campaign import Campaign from crits.core import form_consts from crits.core.forms import add_bucketlist_to_form, add_ticket_to_form from crits.core.widgets import CalWidget from crits.core.handle...
mit
mlperf/inference_results_v0.7
closed/QCT/code/bert/tensorrt/harness.py
19
2575
# Copyright (c) 2020, NVIDIA CORPORATION. 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 appli...
apache-2.0
Nicotine-Plus/nicotine-plus
pynicotine/geoip/ip2location.py
1
3829
# MIT License # # Copyright (c) 2021 Nicotine+ Team # Copyright (c) 2017 IP2Location.com # # 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 th...
gpl-3.0
aasoliz/Bitcoin-Statistics
venv/lib/python2.7/site-packages/pip/_vendor/packaging/_structures.py
1152
1416
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function class Infinity(object): def __repr__(self): return "Infinity...
bsd-3-clause
woutdenolf/spectrocrunch
spectrocrunch/math/tests/test_ft.py
1
16429
# -*- coding: utf-8 -*- import unittest from .. import ft import numpy as np class test_ft(unittest.TestCase): """http://dsp.stackexchange.com/questions/633/what-data-should-i-use-to-test-an-fft-implementation-and-what-accuracy-should-i http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.38.3924 """...
mit
baigk/compass-core
bin/compass_wsgi.py
1
1076
#!/usr/bin/env python # # Copyright 2014 Huawei Technologies Co. Ltd # # 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 ...
apache-2.0
markYoungH/chromium.src
chrome/third_party/chromevox/third_party/closure-library/closure/bin/build/treescan.py
582
2203
#!/usr/bin/env python # # Copyright 2010 The Closure Library 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 ...
bsd-3-clause
bjackman/workload-automation
wlauto/instrumentation/__init__.py
5
1361
# Copyright 2013-2015 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 w...
apache-2.0
crazcalm/AngelHack_python34
myenv/Lib/site-packages/pip/_vendor/requests/packages/charade/utf8prober.py
2919
2652
######################## 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
trippysalmon/bitcoin
contrib/linearize/linearize-data.py
105
10081
#!/usr/bin/env python3 # # linearize-data.py: Construct a linear, no-fork version of the chain. # # Copyright (c) 2013-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import print...
mit
tanmaythakur/django
django/core/checks/registry.py
137
3051
# -*- coding: utf-8 -*- from __future__ import unicode_literals from itertools import chain from django.utils.itercompat import is_iterable class Tags(object): """ Built-in tags for internal checks. """ admin = 'admin' compatibility = 'compatibility' models = 'models' security = 'securit...
bsd-3-clause
alhashash/odoo
addons/account/report/account_central_journal.py
8
5350
# -*- 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
AustereCuriosity/astropy
astropy/visualization/wcsaxes/axislabels.py
4
4505
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import print_function, division, absolute_import import numpy as np from matplotlib.text import Text import matplotlib.transforms as mtransforms from .frame import RectangularFrame class AxisLabels(Text): def __init__(self, frame...
bsd-3-clause
constKutsy/GeoWiki
.compit/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py
2763
12628
######################## 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...
unlicense
spbguru/repo1
nupic/frameworks/opf/experiment_runner.py
3
26658
# ---------------------------------------------------------------------- # 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...
gpl-3.0
tailorian/Sick-Beard
lib/requests/adapters.py
213
14674
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib3.response impo...
gpl-3.0
TrimBiggs/calico
calico/test/test_geventutils.py
2
1246
# -*- coding: utf-8 -*- # Copyright 2015 Metaswitch Networks # # 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
kefo/moto
tests/test_s3/test_s3.py
1
58166
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from six.moves.urllib.request import urlopen from six.moves.urllib.error import HTTPError from functools import wraps from gzip import GzipFile from io import BytesIO import zlib import json import boto import boto3 from botocore.client ...
apache-2.0
Schwittleymani/ECO
src/python/irc/irc_clients.py
2
1540
import argparse import sys import os import subprocess import shlex import glob import irc_bot def process_arguments(args): parser = argparse.ArgumentParser(description='configure the irc clients') parser.add_argument('--txts_path', action='store', help='path to folder with txt files') parser.add_argument...
apache-2.0
javierlgroba/Eventer-gapp
django/core/cache/backends/db.py
102
7648
"Database cache backend." import base64 import time from datetime import datetime try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.core.cache.backends.base import BaseCache from django.db import connections, router, transa...
lgpl-3.0
aldian/tensorflow
tensorflow/python/saved_model/main_op_impl.py
73
2215
# 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
yanlend/scikit-learn
examples/neighbors/plot_nearest_centroid.py
264
1804
""" =============================== Nearest Centroid Classification =============================== Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap f...
bsd-3-clause
ICTU/quality-time
components/server/src/routes/measurement.py
1
5598
"""Measurement routes.""" import logging import time from collections.abc import Iterator from typing import cast import bottle from pymongo.database import Database from database import sessions from database.datamodels import latest_datamodel from database.measurements import ( measurements_by_metric, coun...
apache-2.0
ryangallen/django
tests/generic_views/models.py
382
1631
from django.core.urlresolvers import reverse from django.db import models from django.db.models import QuerySet from django.db.models.manager import BaseManager from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Artist(models.Model): name = models.CharField(max_length...
bsd-3-clause
evensonbryan/yocto-autobuilder
lib/python2.7/site-packages/sqlalchemy_migrate-0.7.2-py2.7.egg/migrate/changeset/databases/postgres.py
140
1129
""" `PostgreSQL`_ database specific implementations of changeset classes. .. _`PostgreSQL`: http://www.postgresql.org/ """ from migrate.changeset import ansisql from sqlalchemy.databases import postgresql as sa_base PGSchemaGenerator = sa_base.PGDDLCompiler class PGColumnGenerator(PGSchemaGenerator, ansisql.A...
gpl-2.0
LukeHoersten/ansible-modules-core
utilities/helper/fireball.py
132
8066
#!/usr/bin/python # -*- coding: utf-8 -*- # (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...
gpl-3.0
petecummings/django-cms
cms/south_migrations/0007_apphook_longer.py
1680
20032
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
ygol/it
it/equipment_partition.py
3
2153
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Leandro Ezequiel Baldi # <baldileandro@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licen...
agpl-3.0
wangdeshui/zulip
scripts/setup/generate_secrets.py
114
2179
#!/usr/bin/env python # This tools generates local_settings_generated.py using the template import sys, os, os.path sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..')) os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings' from django.utils.crypto import get_random_string from zerver.lib.util...
apache-2.0
chennan47/osf.io
osf/migrations/0045_add_view_subject_permissions.py
11
1801
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-07-17 20:11 from __future__ import unicode_literals from django.db import migrations from django.contrib.auth.models import Group, Permission from django.core.management.sql import emit_post_migrate_signal def add_subject_perms_to_groups(*args, **kwargs): ...
apache-2.0
calfonso/ansible
lib/ansible/modules/network/slxos/slxos_command.py
25
7951
#!/usr/bin/python # # (c) 2018 Extreme Networks 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 late...
gpl-3.0
nickster5001/ctracker
flask/lib/python3.4/site-packages/sqlalchemy/testing/runner.py
32
1625
#!/usr/bin/env python # testing/runner.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 """ Nose test runner module. This script is a front-end to "...
mit
Serag8/Bachelor
google_appengine/lib/django-1.4/django/contrib/admin/templatetags/admin_modify.py
98
2293
from django import template register = template.Library() @register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True) def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for the prepopulated fields for both the admin form and in...
mit
rec/BiblioPixel
test/bibliopixel/drivers/serial/driver_test.py
1
1735
import unittest from unittest import mock from bibliopixel.drivers.return_codes import RETURN_CODES from bibliopixel.drivers.serial import driver from test.bibliopixel.drivers.dummy_test import clock_only_project class DriverTest(unittest.TestCase): @mock.patch('serial.Serial', autospec=True) @mock.patch('bib...
mit
Samuel789/MediPi
MedManagementWeb/env/lib/python3.5/site-packages/wheel/signatures/__init__.py
565
3779
""" Create and verify jws-js format Ed25519 signatures. """ __all__ = [ 'sign', 'verify' ] import json from ..util import urlsafe_b64decode, urlsafe_b64encode, native, binary ed25519ll = None ALG = "Ed25519" def get_ed25519ll(): """Lazy import-and-test of ed25519 module""" global ed25519ll if not ...
apache-2.0
Vogeltak/pauselan
lib/python3.4/site-packages/sqlalchemy/sql/type_api.py
36
41925
# sql/types_api.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 """Base types API. """ from .. import exc, util from . import operators from .vi...
gpl-2.0
chenfengyuan/shadowsocks
setup.py
929
1321
import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name="shadowsocks", version="2.8.2", license='http://www.apache.org/licenses/LICENSE-2.0', description="A fast tunnel proxy that help you get through firewalls", ...
apache-2.0
papados/ordersys
Lib/site-packages/django/core/management/commands/diffsettings.py
120
1648
from optparse import make_option from django.core.management.base import NoArgsCommand def module_to_dict(module, omittable=lambda k: k.startswith('_')): """Converts a module namespace to a Python dictionary.""" return dict((k, repr(v)) for k, v in module.__dict__.items() if not omittable(k)) class Command(N...
unlicense
ogrisel/numpy
numpy/linalg/_gufuncs_linalg.py
1
39686
"""Linear Algebra functions implemented as gufuncs, so they broadcast. .. warning:: This module is only for testing, the functionality will be integrated into numpy.linalg proper. ======================= gufuncs_linalg module ======================= gufuncs_linalg implements a series of linear algebra functions ...
bsd-3-clause
super3/PyDev
Old Workspace/ex35.py
1
1798
# Name: ex35.py # Author: Super3(super3.org) # URL: http://learnpythonthehardway.org/book/ex35.html from sys import exit def gold_room(): print("This room is full of gold. How much do you take?") next = input("> ") if "0" in next or "1" in next: how_much = int(next) else: dead("Man, learn to type a number.") ...
mit
ppanczyk/ansible
lib/ansible/modules/network/interface/net_interface.py
38
3298
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, 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_version': '1.1', ...
gpl-3.0
dya2/python-for-android
python-build/python-libs/gdata/src/gdata/tlslite/messages.py
273
18429
"""Classes representing TLS messages.""" from utils.compat import * from utils.cryptomath import * from errors import * from utils.codec import * from constants import * from X509 import X509 from X509CertChain import X509CertChain import sha import md5 class RecordHeader3: def __init__(self): self.type ...
apache-2.0
aswinpj/Pygments
pygments/lexers/dsls.py
1
29186
# -*- coding: utf-8 -*- """ pygments.lexers.dsls ~~~~~~~~~~~~~~~~~~~~ Lexers for various domain-specific languages. :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, words, inc...
bsd-2-clause
jyotikamboj/container
django/contrib/gis/maps/google/overlays.py
102
11931
from __future__ import unicode_literals from django.contrib.gis.geos import fromstr, Point, LineString, LinearRing, Polygon from django.utils.functional import total_ordering from django.utils.safestring import mark_safe from django.utils import six from django.utils.encoding import python_2_unicode_compatible @pyth...
mit
alilotfi/django
django/contrib/admin/templatetags/admin_list.py
173
17480
from __future__ import unicode_literals import datetime import warnings from django.contrib.admin.templatetags.admin_static import static from django.contrib.admin.templatetags.admin_urls import add_preserved_filters from django.contrib.admin.utils import ( display_for_field, display_for_value, label_for_field, l...
bsd-3-clause
camilonova/sentry
src/sentry/web/forms/fields.py
2
3730
""" sentry.web.forms.fields ~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import six from django.forms.widgets import RadioFieldRenderer, TextInput, Widget from django.forms.u...
bsd-3-clause
routeflow/AutomaticConfigurationRouteFlow
pox/pox/forwarding/l3_learning.py
1
12554
# Copyright 2011,2012 James McCauley # # This file is part of POX. # # POX 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. # # POX is d...
apache-2.0
Chadsr/NordVPN-NetworkManager
nordnm/utils.py
1
4133
import os import stat from io import BytesIO from zipfile import ZipFile import subprocess import logging import getpass import requests logger = logging.getLogger(__name__) class LoggingFormatter(logging.Formatter): info_format = "[%(levelname)s] %(message)s" error_format = "[%(levelname)s] [%(name)s.%(func...
gpl-3.0
KelSolaar/Umbra
umbra/components/addons/tcp_server_ui/tcp_server_ui.py
1
19799
#!/usr/bin/env python # -*- coding: utf-8 -*- """ **tcp_serverUi.py** **Platform:** Windows, Linux, Mac Os X. **Description:** Defines the :class:`TCPServerUi` Component Interface class and others helper objects. **Others:** """ from __future__ import unicode_literals import os import SocketServer from P...
gpl-3.0
ychaim/mybitbank
mybitbank/libs/entities/cacher.py
2
2153
import datetime from django.utils.timezone import utc class Cacher(object): ''' Caching object for data ''' _cache = {} _caching_time = 10 # seconds _debug = False def __init__(self, initial_cache_dir): self._cache = initial_cache_dir def __getitem__(self, key): ...
mit
kastnerkyle/pylearn2
pylearn2/linear/conv2d.py
5
9182
""" .. todo:: WRITEME """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" import functools import numpy as np import theano import theano.t...
bsd-3-clause
devGregA/scrapy
scrapy/responsetypes.py
3
4445
""" This module implements a class which returns the appropriate Response class based on different criteria. """ from mimetypes import MimeTypes from pkgutil import get_data from io import BytesIO import six from scrapy.http import Response from scrapy.utils.misc import load_object from scrapy.utils.python import is...
bsd-3-clause
tafaRU/account-financial-tools
__unported__/account_move_line_search_extension/__openerp__.py
10
1836
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under...
agpl-3.0
ojengwa/oh-mainline
vendor/packages/twisted/twisted/test/test_nmea.py
18
5029
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """Test cases for the NMEA GPS protocol""" import StringIO from twisted.trial import unittest from twisted.internet import reactor, protocol from twisted.python import reflect from twisted.protocols.gps import nmea class StringIOWithNoClose(...
agpl-3.0
joram/sickbeard-orange
lib/requests/packages/chardet/constants.py
3008
1335
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
dhermes/google-cloud-python
dlp/google/cloud/dlp_v2/proto/dlp_pb2.py
2
607808
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/privacy/dlp_v2/proto/dlp.proto import sys _b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descri...
apache-2.0
NunoEdgarGub1/scikit-learn
examples/covariance/plot_outlier_detection.py
235
3891
""" ========================================== Outlier detection with several methods. ========================================== When the amount of contamination is known, this example illustrates two different ways of performing :ref:`outlier_detection`: - based on a robust estimator of covariance, which is assumin...
bsd-3-clause
sdopoku/flask-hello-world
venv/lib/python2.7/site-packages/pip/basecommand.py
392
6578
"""Base Command class, and related routines""" import os import sys import tempfile import traceback import time import optparse from pip import cmdoptions from pip.locations import running_under_virtualenv from pip.log import logger from pip.download import PipSession from pip.exceptions import (BadCommand, Installa...
gpl-2.0
akretion/odoo
addons/calendar/models/res_partner.py
7
1368
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime from odoo import api, fields, models from odoo.addons.calendar.models.calendar import get_real_ids class Partner(models.Model): _inherit = 'res.partner' calendar_last_notif_ack ...
agpl-3.0
vheon/ycmd
ycmd/tests/shutdown_test.py
4
3690
# Copyright (C) 2020 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # # ycmd...
gpl-3.0
stanmoore1/lammps
lib/colvars/Install.py
10
4577
#!/usr/bin/env python # Install.py tool to do automate build of Colvars from __future__ import print_function import sys,os,subprocess sys.path.append('..') from install_helpers import get_cpus from argparse import ArgumentParser parser = ArgumentParser(prog='Install.py', description="LAMMPS...
gpl-2.0
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/test/test_platform.py
6
13732
from unittest import mock import os import platform import subprocess import sys import tempfile import unittest import warnings from test import support class PlatformTest(unittest.TestCase): def test_architecture(self): res = platform.architecture() @support.skip_unless_symlink def test_archite...
gpl-3.0
aokolnychyi/spark
examples/src/main/python/mllib/normalizer_example.py
128
1756
# # 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 us...
apache-2.0
mrquim/repository.mrquim
repo/script.module.unidecode/lib/unidecode/x04f.py
252
4607
data = ( 'Zhong ', # 0x00 'Qi ', # 0x01 'Pei ', # 0x02 'Yu ', # 0x03 'Diao ', # 0x04 'Dun ', # 0x05 'Wen ', # 0x06 'Yi ', # 0x07 'Xin ', # 0x08 'Kang ', # 0x09 'Yi ', # 0x0a 'Ji ', # 0x0b 'Ai ', # 0x0c 'Wu ', # 0x0d 'Ji ', # 0x0e 'Fu ', # 0x0f 'Fa ', # 0x10 'Xiu ', ...
gpl-2.0
collects/VTK
Filters/Texture/Testing/Python/triangularTCoords.py
20
1976
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() def GetRGBColor(colorName): ''' Return the red, green and blue components for a color as doubles. ''' rgb = [0.0, 0.0, 0.0] # black vtk.vtkNamedColors...
bsd-3-clause
deKupini/erp
addons/account/wizard/account_report_general_ledger.py
8
3124
# -*- 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
lrq3000/author-detector
authordetector/lib/debug/pympler/tracker.py
7
9788
"""The tracker module allows you to track changes in the memory usage over time. Using the SummaryTracker, you can create summaries and compare them with each other. Stored summaries can be ignored during comparision, avoiding the observer effect. The ObjectTracker allows to monitor object creation. You create object...
gpl-3.0
kalahbrown/HueBigSQL
desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/reset_db.py
35
7215
""" originally from http://www.djangosnippets.org/snippets/828/ by dnordberg """ import logging from optparse import make_option from django.conf import settings from django.core.management.base import CommandError, BaseCommand from six.moves import input, configparser from django_extensions.management.utils import s...
apache-2.0
atsolakid/edx-platform
openedx/core/djangoapps/content/course_structures/tasks.py
54
3704
import json import logging from celery.task import task from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore log = logging.getLogger('edx.celery.task') def _generate_course_structure(course_key): """ Generates a course structure dictionary for the specified course. ...
agpl-3.0
QijunPan/ansible
lib/ansible/plugins/connection/iocage.py
67
2395
# based on jail.py (c) 2013, Michael Scherer <misc@zarb.org> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # (c) 2016, Stephan Lohse <dev-github@ploek.org> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU Ge...
gpl-3.0
ThePletch/ansible
lib/ansible/modules/network/vyos/vyos_config.py
29
9119
#!/usr/bin/python # # 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 distribut...
gpl-3.0
AICP/external_chromium_org
build/android/pylib/utils/parallelizer.py
16
5608
# 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. """ Wrapper that allows method execution in parallel. This class wraps a list of objects of the same type, emulates their interface, and executes any functi...
bsd-3-clause
peterbraden/tensorflow
tensorflow/examples/image_retraining/retrain.py
6
35796
# 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 a...
apache-2.0
vascotenner/holoviews
tests/testdynamic.py
1
4724
import numpy as np from holoviews import Dimension, DynamicMap, Image, HoloMap from holoviews.core.operation import DynamicFunction from holoviews.element.comparison import ComparisonTestCase frequencies = np.linspace(0.5,2.0,5) phases = np.linspace(0, np.pi*2, 5) x,y = np.mgrid[-5:6, -5:6] * 0.1 def sine_array(phas...
bsd-3-clause
Pablo126/SSBW
Entrega1/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
gpl-3.0
NaohiroTamura/ironic
ironic/drivers/modules/ilo/firmware_processor.py
2
17644
# Copyright 2016 Hewlett Packard Enterprise Development Company LP # # 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
ishay2b/tensorflow
tensorflow/python/ops/sets.py
109
1167
# 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
manojhirway/ExistingImagesOnNFS
cinder/volume/drivers/lenovo/lenovo_fc.py
14
1259
# Copyright 2014 Objectif Libre # Copyright 2015 DotHill Systems # # 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 # # U...
apache-2.0
beacloudgenius/edx-platform
common/lib/xmodule/xmodule/tests/__init__.py
49
28171
""" unittests for xmodule Run like this: paver test_lib -l common/lib/xmodule """ import inspect import json import os import pprint import sys import traceback import unittest from contextlib import contextmanager, nested from functools import wraps from lazy import lazy from mock import Mock, patch from oper...
agpl-3.0
jmcarp/osf.io
website/addons/s3/routes.py
29
2327
from framework.routing import Rule, json_renderer from website.addons.s3 import views settings_routes = { 'rules': [ Rule( [ '/project/<pid>/s3/newbucket/', '/project/<pid>/node/<nid>/s3/newbucket/', ], 'post', views.crud.cre...
apache-2.0
mustafat/odoo-1
addons/portal_claim/__openerp__.py
432
1643
# -*- 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
zetaris/zeppelin
python/src/main/resources/python/bootstrap_sql.py
60
1189
# 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 use ...
apache-2.0
RedTea/gaedav
pyfileserver/locklibrary.py
4
16025
""" locklibrary =========== :Module: pyfileserver.locklibrary :Author: Ho Chun Wei, fuzzybr80(at)gmail.com :Project: PyFileServer, http://pyfilesync.berlios.de/ :Copyright: Lesser GNU Public License, see LICENSE file attached with package This module consists of a number of miscellaneous functions for the locks featu...
lgpl-2.1
2014c2g1/c2g1
wsgi/programs/c2g23/__init__.py
10
8028
import cherrypy # 這是 C2G23 類別的定義 class C2G23(object): # 各組利用 index 引導隨後的程式執行 @cherrypy.expose def index(self, *args, **kwargs): outstring = ''' 這是 2014C2 協同專案下的 c2g23 分組程式開發網頁, 以下為 W12 的任務執行內容.<br /> <!-- 這裡採用相對連結, 而非網址的絕對連結 (這一段為 html 註解) --> <a href="fillpoly">c2g2 fillpoly 繪圖</a><br /> <a href="...
gpl-2.0
rparent/django-lock-tokens
tests/test_api.py
1
4307
# -*- coding: utf-8 from __future__ import absolute_import, unicode_literals import json import time try: from django.urls import reverse except ImportError: from django.core.urlresolvers import reverse from django.test import TransactionTestCase from django.test.client import Client from django.utils.encodin...
mit
ferabra/edx-platform
openedx/core/djangoapps/content/course_structures/api/v0/tests_api.py
80
5764
""" Course Structure api.py tests """ from .api import course_structure from openedx.core.djangoapps.content.course_structures.signals import listen_for_course_publish from xmodule.modulestore.django import SignalHandler from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tes...
agpl-3.0
PeterWangIntel/chromium-crosswalk
tools/relocation_packer/test_data/generate_elf_file_unittest_relocs.py
72
2982
#!/usr/bin/env python # # 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. """Build relocation packer unit test data. Uses a built relocation packer to generate 'golden' reference test data files for elf_fil...
bsd-3-clause
gx1997/chrome-loongson
chrome/test/functional/chromeos_private_view.py
5
1311
#!/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 pyauto_functional # must be imported before pyauto import pyauto class ChromeosPrivateViewTest(pyauto.PyUITest)...
bsd-3-clause
romain-dartigues/ansible
lib/ansible/modules/net_tools/nios/nios_aaaa_record.py
7
4507
#!/usr/bin/python # Copyright (c) 2018 Red Hat, 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_version': '1.1', 'status': ['preview...
gpl-3.0
gsmaxwell/phase_offset_rx
gr-analog/python/qa_plateau_detector_fb.py
1
1683
#!/usr/bin/env python # # Copyright 2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
sjb3/python_koans
python3/runner/path_to_enlightenment.py
80
4954
#!/usr/bin/env python # -*- coding: utf-8 -*- # The path to enlightenment starts with the following: import unittest from koans.about_asserts import AboutAsserts from koans.about_strings import AboutStrings from koans.about_none import AboutNone from koans.about_lists import AboutLists from koans.about_list_assignme...
mit
simplesslife/myblog
www/transwarp/db.py
16
13973
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao' ''' Database operation module. ''' import time, uuid, functools, threading, logging # Dict object: class Dict(dict): ''' Simple dict but support access as x.y style. >>> d1 = Dict() >>> d1['x'] = 100 >>> d1.x 100 ...
gpl-2.0
mohamedhagag/community-addons
project_hr_stakeholder/project.py
2
1289
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011 Eficent (<http://www.eficent.com/>) # <contact@eficent.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
agpl-3.0