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
cokelaer/bioconda-recipes
recipes/biopet-sampleconfig/biopet-sampleconfig.py
53
3375
#!/usr/bin/env python # # Wrapper script for starting the biopet-sampleconfig JAR package # # This script is written for use with the Conda package manager and is copied # from the peptide-shaker wrapper. Only the parameters are changed. # (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shaker...
mit
ravibhure/ansible
lib/ansible/modules/network/cloudengine/ce_command.py
11
7815
#!/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
RuiNascimento/krepo
script.areswizard/requests/packages/chardet/gb2312freq.py
3132
36011
######################## 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...
gpl-2.0
Bysmyyr/chromium-crosswalk
tools/json_schema_compiler/features_h_generator.py
94
2686
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os.path from code import Code import cpp_util class HGenerator(object): def Generate(self, features, source_file, namespace): return _Generat...
bsd-3-clause
gnowxilef/plexpy
lib/cherrypy/_cprequest.py
58
37180
import os import sys import time import warnings import cherrypy from cherrypy._cpcompat import basestring, copykeys, ntob, unicodestr from cherrypy._cpcompat import SimpleCookie, CookieError, py3k from cherrypy import _cpreqbody, _cpconfig from cherrypy._cperror import format_exc, bare_error from cherrypy.lib import...
gpl-3.0
gmission/gmission
hkust-gmission/gmission/models/crowdsourcing.py
1
2810
__author__ = 'chenzhao' from base import * # type = text / image / selection class HIT(db.Model, BasicModelMixin): __tablename__ = 'hit' id = db.Column(db.Integer, primary_key=True) type = db.Column(db.String(20)) title = db.Column(db.String(500)) description = db.Column(db.TEXT) attachment_...
mit
ibab/tensorflow
tensorflow/models/image/cifar10/cifar10.py
9
13565
# 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
Beeblio/django
django/db/models/aggregates.py
6
2701
""" Classes to represent the definitions of aggregate functions. """ from django.db.models.constants import LOOKUP_SEP __all__ = [ 'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance', ] def refs_aggregate(lookup_parts, aggregates): """ A little helper method to check if the lookup_part...
bsd-3-clause
GDGLima/contentbox
third_party/django/contrib/gis/db/backends/base.py
112
11144
""" Base/mixin classes for the spatial backend database operations and the `SpatialRefSys` model the backend. """ import re from django.contrib.gis import gdal from django.utils import six from django.utils.encoding import python_2_unicode_compatible class BaseSpatialOperations(object): """ This module holds...
apache-2.0
FiloSottile/youtube-dl
youtube_dl/extractor/facebook.py
7
6654
from __future__ import unicode_literals import json import re import socket from .common import InfoExtractor from ..compat import ( compat_http_client, compat_str, compat_urllib_error, compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, int_or_none, lim...
unlicense
emad8878/finalproject
read_data.py
1
1788
#!/usr/bin/env python # -*- coding: utf-8 -*- """Student selection process""" from student_data import * import pprint def passed_exam(student_list): """This function will filter and selct students for medical program. Args: final_selections(list): This list will have students with 125 and higer. ...
mpl-2.0
agaffney/ansible
test/lib/ansible_test/_internal/cloud/acme.py
2
6056
"""ACME plugin for integration tests.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import time from . import ( CloudProvider, CloudEnvironment, CloudEnvironmentConfig, ) from ..util import ( find_executable, display, ApplicationError, ...
gpl-3.0
angelapper/odoo
addons/hr_payroll/report/report_contribution_register.py
47
2406
#-*- coding:utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from datetime import datetime from dateutil import relativedelta from openerp.osv import osv from openerp.report import report_sxw class contribution_register_report(report_sxw.rml_parse): def __init__(s...
agpl-3.0
Russell-IO/ansible
lib/ansible/modules/packaging/os/swupd.py
37
8830
#!/usr/bin/python # (c) 2017, Alberto Murillo <alberto.murillo.silva@intel.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
alfayez/gnuradio
gr-digital/examples/ofdm/ofdm_mod_demod_test.py
27
38561
#!/usr/bin/env python # # Copyright 2005,2006,2008 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 you...
gpl-3.0
prtkm/jasp
jasp/jasp_vib.py
3
9632
'''module for vibrational calculations in jasp''' from jasp import * import numpy as np from ase.data import atomic_masses from ase.io import read def get_vibrational_modes(self, mode=None, massweighted=False, show=False, ...
gpl-2.0
mancoast/CPythonPyc_test
cpython/211_test_ucn.py
15
3237
""" Test script for the Unicode implementation. Written by Bill Tutt. Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com) (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" from test_support import verify, verbose print 'Testing General Unicode Character Name, and case insensitivity...', # G...
gpl-3.0
damiansoriano/odoo
addons/account/wizard/account_report_partner_balance.py
364
2199
# -*- 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
waelrash1/or-tools
examples/python/jobshop_ft06_distance.py
32
3927
# Copyright 2010-2014 Google # 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
oliverlee/sympy
sympy/core/tests/test_trace.py
99
2825
from sympy import symbols, Matrix, Tuple from sympy.core.trace import Tr from sympy.utilities.pytest import raises def test_trace_new(): a, b, c, d, Y = symbols('a b c d Y') A, B, C, D = symbols('A B C D', commutative=False) assert Tr(a + b) == a + b assert Tr(A + B) == Tr(A) + Tr(B) #check trac...
bsd-3-clause
kalxas/QGIS
python/core/contextmanagers.py
45
2189
# -*- coding: utf-8 -*- """ *************************************************************************** contextmanagers.py --------------------- Date : May 2014 Copyright : (C) 2014 by Nathan Woodrow Email : woodrow dot nathan at gmail dot com *************...
gpl-2.0
GauravSahu/odoo
addons/base_import/__openerp__.py
317
1227
{ 'name': 'Base import', 'description': """ New extensible file import for OpenERP ====================================== Re-implement openerp's file import system: * Server side, the previous system forces most of the logic into the client which duplicates the effort (between clients), makes the import s...
agpl-3.0
ishank08/scikit-learn
examples/linear_model/plot_sgd_weighted_samples.py
344
1458
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model # we create 20 points np.random.seed(0) X ...
bsd-3-clause
rastrexando-eu/rastrexando-eu
core/migrations/0034_auto_20170424_2055.py
1
1367
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-04-24 18:55 from __future__ import unicode_literals import django.contrib.postgres.fields.jsonb from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [ ...
gpl-3.0
cyberark-bizdev/ansible
lib/ansible/modules/database/misc/redis.py
35
9782
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # 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
Starbow/StarbowWebSite
starbowmodweb/ladder/views.py
1
5026
from django.shortcuts import render from django import db from django.http import HttpResponse from django.contrib.auth.decorators import login_required from starbowmodweb.ladder.forms import CrashReportForm, CrashReport from starbowmodweb.ladder.helpers import get_matchhistory from starbowmodweb.ladder.models import C...
mit
burzillibus/RobHome
venv/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.py
335
14810
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. """ import fnmatch import logging import os import re import sys from . impor...
mit
raajitr/django_hangman
env/lib/python2.7/site-packages/django/test/html.py
59
8064
""" Comparing two html documents. """ from __future__ import unicode_literals import re from django.utils import six from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.html_parser import HTMLParseError, HTMLParser WHITESPACE = re.compile(r'\s+') def normalize_whitespace(st...
mit
rhyolight/nupic.son
app/soc/mapreduce/gci_insert_dummy_data.py
1
1438
# Copyright 2013 the Melange 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 applicable law or agreed to in wr...
apache-2.0
yiliaofan/faker
faker/providers/person/lt_LT/__init__.py
19
3334
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .. import Provider as PersonProvider class Provider(PersonProvider): formats = ( '{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}', '{{last_name}}, {{first_name}}' ) first_names = ( 'Tom...
mit
madhurauti/Map-Polygon
modules/tests/staff/create_staff_job_role.py
2
2075
""" Sahana Eden Automated Test - HRM001 Create Job Role @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT 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 with...
mit
jeffrey4l/nova
nova/openstack/common/report/views/text/threading.py
39
2473
# Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
apache-2.0
aerophile/django
tests/migrations/test_writer.py
10
19538
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import math import os import re import tokenize import unittest import custom_migration_operations.more_operations import custom_migration_operations.operations from django.conf import settings from django.core.validators import EmailVal...
bsd-3-clause
marcelocure/django
tests/postgres_tests/fields.py
302
1087
""" Indirection layer for PostgreSQL-specific fields, so the tests don't fail when run with a backend other than PostgreSQL. """ from django.db import models try: from django.contrib.postgres.fields import ( ArrayField, BigIntegerRangeField, DateRangeField, DateTimeRangeField, FloatRangeField, HSto...
bsd-3-clause
xuyuhan/depot_tools
third_party/retry_decorator/decorators.py
55
1565
import time from functools import wraps def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None): """Retry calling the decorated function using an exponential backoff. http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/ original from: http://wiki.python.org/moin/PythonD...
bsd-3-clause
ncrocfer/radric
radric/generators.py
1
9868
# -*- coding: utf-8 -*- import re import os import yaml import logging from slugify import slugify from jinja2 import Environment, FileSystemLoader from docutils.core import publish_parts try: from urllib.parse import urljoin except ImportError: from urlparse import urljoin from radric import rstdirective fr...
mit
marcass/tank_lora
python/archive/queue_listen.py
1
4136
from multiprocessing import Queue as Q from multiprocessing import Process as P import time import sys import numpy as np import paho.mqtt.publish as publish import serial import smtplib import requests import matplotlib.pyplot as plt import datetime import sqlite3 import creds import tanks s_port = '/dev/LORA' #initi...
gpl-3.0
uclouvain/osis
education_group/views/publication_contact/common.py
1
3775
# # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business involves the administration of students, teachers, # courses, progr...
agpl-3.0
mete0r/testfixture
mete0r_testfixture/tests/fixture_bar.py
1
1096
# -*- coding: utf-8 -*- # # mete0r_testfixture: a testfixture helper # Copyright (C) 2015-2017 mete0r <mete0r@sarangbang.or.kr> # # This program 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,...
agpl-3.0
tung7970/mbed-os-1
tools/test/config_test/test08/test_data.py
38
2118
# This build on top of test7 by adding some configuration values in targets # and overriding them in the application expected_results = { "base": { "desc": "override values based on labels with libs and target params (no labels)", "app.app1": "v_app1", "app.app2": "v_app2", "lib1.p1"...
apache-2.0
watchcat/cbu-rotterdam
lib/web/wsgiserver/__init__.py
4
84518
"""A high-speed, production ready, thread pooled, generic HTTP server. Simplest example on how to use this module directly (without using CherryPy's application machinery):: from cherrypy import wsgiserver def my_crazy_app(environ, start_response): status = '200 OK' response_headers = [('...
agpl-3.0
jelly/calibre
src/calibre/ebooks/djvu/djvu.py
2
4668
#! /usr/bin/env python2 # coding: utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2011, Anthon van der Neut <A.van.der.Neut@ruamel.eu>' # this code is based on: # Lizardtech DjVu Reference # DjVu v3 # November...
gpl-3.0
t794104/ansible
lib/ansible/playbook/taggable.py
96
3170
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
hubert667/AIR
build/celery/build/lib.linux-i686-2.7/celery/bin/worker.py
2
8853
# -*- coding: utf-8 -*- """ The :program:`celery worker` command (previously known as ``celeryd``) .. program:: celery worker .. seealso:: See :ref:`preload-options`. .. cmdoption:: -c, --concurrency Number of child processes processing the queue. The default is the number of CPUs available on your sy...
gpl-3.0
Shrhawk/edx-platform
common/lib/xmodule/xmodule/tests/xml/factories.py
77
4963
""" Factories for generating edXML for testing XModule import """ import inspect from fs.memoryfs import MemoryFS from factory import Factory, lazy_attribute, post_generation, Sequence from lxml import etree from xmodule.modulestore.inheritance import InheritanceMixin from xmodule.x_module import XModuleMixin from x...
agpl-3.0
rhurkes/chasegame
venv/lib/python2.7/site-packages/setuptools/tests/test_dist_info.py
452
2615
"""Test .dist-info style distributions. """ import os import shutil import tempfile import unittest import textwrap try: import ast except: pass import pkg_resources from setuptools.tests.py26compat import skipIf def DALS(s): "dedent and left-strip" return textwrap.dedent(s).lstrip() class TestDist...
mit
redengineer/airflow
airflow/executors/__init__.py
12
1209
import logging from airflow.configuration import conf from airflow.executors.base_executor import BaseExecutor from airflow.executors.local_executor import LocalExecutor from airflow.executors.celery_executor import CeleryExecutor from airflow.executors.sequential_executor import SequentialExecutor # TODO Fix this em...
apache-2.0
amylittleyang/OtraCAD
cadnano25/cadnano/tests/xmlrunner.py
2
12512
""" XML Test Runner for PyUnit """ # Written by Sebastian Rittau <srittau@jroger.in-berlin.de> and placed in # the Public Domain. With contributions by Paolo Borelli and others. from __future__ import with_statement __version__ = "0.1" import os.path import re import sys import time import traceback import unittest...
mit
ijks/textinator
tests/test_functions.py
1
1611
import pytest from textinator import build_lines, value_to_char, calculate_size @pytest.fixture(scope='module') def image(): from PIL import Image im = Image.open('tests/images/doge.jpg') return im.convert('RGB') @pytest.fixture(scope='module') def expected_out(): return open('tests/images/doge.txt'...
mit
bratsche/Neutron-Drive
neutron-drive/django/contrib/localflavor/ro/ro_counties.py
428
1231
# -*- coding: utf-8 -*- """ A list of Romanian counties as `choices` in a formfield. This exists as a standalone file so that it's only imported into memory when explicitly needed. """ COUNTIES_CHOICES = ( ('AB', u'Alba'), ('AR', u'Arad'), ('AG', u'Argeş'), ('BC', u'Bacău'), ('BH', u'Bihor'), ...
bsd-3-clause
guludo/ardupilot-1
Tools/LogAnalyzer/tests/TestVibration.py
261
3069
from LogAnalyzer import Test,TestResult import DataflashLog import numpy class TestVibration(Test): '''test for accelerometer vibration (accX/accY/accZ) within recommendations''' def __init__(self): Test.__init__(self) self.name = "Vibration" def run(self, logdata, verbose): se...
gpl-3.0
hazmatzo/oppia
extensions/gadgets/ScoreBar/ScoreBar.py
16
2130
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
mikewiebe-ansible/ansible
test/units/modules/network/check_point/test_cp_mgmt_service_tcp_facts.py
19
2854
# Ansible module to manage CheckPoint Firewall (c) 2019 # # 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 dist...
gpl-3.0
cesarmarinhorj/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/model/workitems_unittest.py
125
2015
# Copyright (C) 2010 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 ...
bsd-3-clause
hyperized/ansible
lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup_find.py
23
6212
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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'], 'supported...
gpl-3.0
ksmaheshkumar/FunkLoad
src/funkload/BenchRunner.py
3
35815
#!/usr/bin/python # (C) Copyright 2005-2010 Nuxeo SAS <http://nuxeo.com> # Author: bdelbosc@nuxeo.com # Contributors: Tom Lazar # Goutham Bhat # Andrew McFague # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License vers...
gpl-2.0
medallia/aurora
src/main/python/apache/aurora/client/api/scheduler_client.py
5
13651
# # 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, software # distributed under ...
apache-2.0
hifly/OpenUpgrade
addons/l10n_fr/wizard/fr_report_compute_resultant.py
374
2312
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential #...
agpl-3.0
thesuperzapper/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/uniform_test.py
35
8966
# 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
noelbk/neutron-juniper
neutron/db/portsecurity_db.py
9
7480
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Nicira Networks, 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.apac...
apache-2.0
spezi77/android_kernel_google_mako
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
okolisny/integration_tests
cfme/tests/containers/test_relationships.py
1
4852
from random import shuffle import pytest from cfme.utils import testgen from cfme.utils.version import current_version from cfme.web_ui import summary_title from cfme.containers.pod import Pod from cfme.containers.provider import ContainersProvider,\ ContainersTestItem from cfme.containers.service import Service...
gpl-2.0
srikantbmandal/ansible
lib/ansible/modules/network/dellos6/dellos6_command.py
46
7467
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # # Copyright (c) 2016 Dell 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 versi...
gpl-3.0
alex-quiterio/pychess
lib/pychess/Database/profilehooks.py
21
24872
""" Profiling hooks This module contains a couple of decorators (`profile` and `coverage`) that can be used to wrap functions and/or methods to produce profiles and line coverage reports. There's a third convenient decorator (`timecall`) that measures the duration of function execution without the extra profiling ove...
gpl-3.0
Clyde-fare/scikit-learn
sklearn/cluster/spectral.py
233
18153
# -*- coding: utf-8 -*- """Algorithms for spectral clustering""" # Author: Gael Varoquaux gael.varoquaux@normalesup.org # Brian Cheung # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import check_rand...
bsd-3-clause
samthor/intellij-community
python/lib/Lib/encodings/utf_8_sig.py
181
3585
""" Python 'utf-8-sig' Codec This work similar to UTF-8 with the following changes: * On encoding/writing a UTF-8 encoded BOM will be prepended/written as the first three bytes. * On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these bytes will be skipped. """ import codecs ### Codec APIs ...
apache-2.0
adaur/SickRage
lib/github/CommitComment.py
72
6837
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
ionelmc/pytest
_pytest/nose.py
228
2527
""" run test suites written for nose. """ import sys import py import pytest from _pytest import unittest def get_skip_exceptions(): skip_classes = set() for module_name in ('unittest', 'unittest2', 'nose'): mod = sys.modules.get(module_name) if hasattr(mod, 'SkipTest'): skip_cla...
mit
thinkAmi-sandbox/Django_generic_view_sample
Django_generic_view_sample/settings.py
1
3309
""" Django settings for Django_generic_view_sample project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ ...
unlicense
tpounds/ansible-modules-core
cloud/openstack/os_subnets_facts.py
25
4664
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
Cinntax/home-assistant
homeassistant/components/mysensors/gateway.py
3
8194
"""Handle MySensors gateways.""" import asyncio from collections import defaultdict import logging import socket import sys import async_timeout import voluptuous as vol from homeassistant.const import CONF_OPTIMISTIC, EVENT_HOMEASSISTANT_STOP from homeassistant.core import callback import homeassistant.helpers.confi...
apache-2.0
t3dev/odoo
odoo/osv/orm.py
1
6513
import json import warnings from lxml import etree from ..exceptions import except_orm from ..models import ( MetaModel, BaseModel, Model, TransientModel, AbstractModel, MAGIC_COLUMNS, LOG_ACCESS_COLUMNS, ) from odoo.tools.safe_eval import safe_eval # extra definitions for backward compatibilit...
gpl-3.0
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib64/scons-2.1.0/SCons/Tool/dmd.py
20
9512
"""SCons.Tool.dmd Tool-specific initialization for the Digital Mars D compiler. (http://digitalmars.com/d) Coded by Andy Friesen (andy@ikagames.com) 15 November 2003 Amended by Russel Winder (russel@russel.org.uk) 2010-02-07 There are a number of problems with this script at this point in time. The one that irritat...
gpl-2.0
Benjamin-Dobell/three.js
utils/converters/obj/convert_obj_three_for_python3.py
68
48066
"""Convert Wavefront OBJ / MTL files into Three.js (JSON model version, to be used with ascii / binary loader) ------------------------- How to use this converter ------------------------- python convert_obj_three.py -i infile.obj -o outfile.js [-m "morphfiles*.obj"] [-c "morphcolors*.obj"] [-a center|centerxz|top|bo...
mit
tuxfux-hlp-notes/python-batches
archieves/batch-56/modules/sheets/lib/python2.7/site-packages/pip/_vendor/requests/compat.py
571
2556
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1.x is_py31 =...
gpl-3.0
tashigaofei/BlogSpider
scrapy/utils/console.py
10
1260
def start_python_console(namespace=None, noipython=False, banner=''): """Start Python console binded to the given namespace. If IPython is available, an IPython console will be started instead, unless `noipython` is True. Also, tab completion will be used on Unix systems. """ if namespace is None: ...
mit
iut-ibk/DynaMind-UrbanSim
3rdparty/opus/src/opus_core/indicator_framework/image_types/dataset_table.py
2
9135
# Opus/UrbanSim urban simulation software. # Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington # See opus_core/LICENSE from numpy import array, logical_and, logical_not, concatenate, newaxis, rank from opus_core.indicator_framework.core.abstract_indicator import Ab...
gpl-2.0
piantado/kelpy
examples/demo-tobii/demo_tobii_choice.py
1
9949
# -*- coding: utf-8 -*- """ This example builds off of demo3b which is a 2-AFC task. However, instead of clicking on the 'correct' image, the program recognizes a person's selection based on which image was looked at for longer during the trial. For the correct image, an 'affirmative' sound plays. For the ...
gpl-3.0
theheros/kbengine
kbe/src/lib/python/Lib/sched.py
47
5541
"""A generally useful event scheduler class. Each instance of this class manages its own queue. No multi-threading is implied; you are supposed to hack that yourself, or use a single instance per application. Each instance is parametrized with two functions, one that is supposed to return the current time, one that i...
lgpl-3.0
willingc/zulip
zerver/lib/avatar.py
124
1765
from __future__ import absolute_import from django.conf import settings import hashlib from zerver.lib.utils import make_safe_digest def gravatar_hash(email): """Compute the Gravatar hash for an email address.""" # Non-ASCII characters aren't permitted by the currently active e-mail # RFCs. However, the I...
apache-2.0
grumpyjames/buck
third-party/py/unittest2/unittest2/test/test_setups.py
111
16845
import sys from cStringIO import StringIO import unittest2 from unittest2.test.support import resultFactory class TestSetups(unittest2.TestCase): def getRunner(self): return unittest2.TextTestRunner(resultclass=resultFactory, stream=StringIO()) def runT...
apache-2.0
CowboyKenbot/VT
node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
372
124844
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import copy import ntpath import os import posixpath import re import subprocess import sys import gyp.common import gyp.easy_xml as easy_xml i...
mit
KnightHawk3/GUTG-Vote
GUTG_Vote/utilities.py
1
1451
import json import gspread from oauth2client.client import SignedJwtAssertionCredentials from GUTG_Vote.models import User, Game json_key = json.load(open('auth.json')) scope = ['https://spreadsheets.google.com/feeds'] credentials = SignedJwtAssertionCredentials(json_key['client_email'], ...
mit
tkingless/webtesting
venvs/tutorials/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py
762
3532
import hashlib import os from pip._vendor.lockfile import LockFile from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile from ..cache import BaseCache from ..controller import CacheController def _secure_open_write(filename, fmode): # We only want to write to this file, so open it in write only mode ...
mit
dct2012/chromeos-3.14
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
evaschalde/odoo
addons/website_forum_doc/controllers/main.py
338
3425
# -*- coding: utf-8 -*- from openerp import http from openerp.http import request from openerp.addons.website.models.website import slug class WebsiteDoc(http.Controller): @http.route(['/forum/how-to', '/forum/how-to/<model("forum.documentation.toc"):toc>'], type='http', auth="public", website=True) def toc...
agpl-3.0
rishilification/phantomjs
src/qt/qtwebkit/Tools/BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py
116
4793
# Copyright (C) 2010 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
jobscore/sync-engine
inbox/contacts/algorithms.py
3
7124
import datetime from collections import defaultdict ''' This file currently contains algorithms for the contacts/rankings endpoint and the groups/intrinsic endpoint. ''' # For calculating message weights LOOKBACK_TIME = 63072000.0 # datetime.timedelta(days=2*365).total_seconds() MIN_MESSAGE_WEIGHT = .01 # For calcu...
agpl-3.0
HiSPARC/station-software
user/python/Lib/site-packages/pip/_vendor/chardet/mbcssm.py
289
25481
######################## 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...
gpl-3.0
hwroitzsch/DayLikeTodayClone
venv/lib/python3.5/site-packages/wheel/util.py
219
4192
"""Utility functions.""" import sys import os import base64 import json import hashlib __all__ = ['urlsafe_b64encode', 'urlsafe_b64decode', 'utf8', 'to_json', 'from_json', 'matches_requirement'] def urlsafe_b64encode(data): """urlsafe_b64encode without padding""" return base64.urlsafe_b64encode(da...
mit
596acres/livinglots-nola
livinglotsnola/pathways/migrations/0001_initial.py
1
12098
# -*- coding: 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 'Pathway' db.create_table(u'pathways_pathway', ( (u'id', self.gf('django.db.model...
gpl-3.0
ujenmr/ansible
lib/ansible/modules/network/fortios/fortios_firewall_profile_protocol_options.py
24
42201
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
joopert/home-assistant
tests/components/no_ip/test_init.py
4
2410
"""Test the NO-IP component.""" import asyncio from datetime import timedelta import pytest from homeassistant.setup import async_setup_component from homeassistant.components import no_ip from homeassistant.util.dt import utcnow from tests.common import async_fire_time_changed DOMAIN = "test.example.com" PASSWORD...
apache-2.0
rcarrillocruz/ansible
lib/ansible/modules/monitoring/honeybadger_deployment.py
36
4275
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014 Benjamin Curtis <benjamin.curtis@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 versi...
gpl-3.0
HyperBaton/ansible
lib/ansible/modules/network/fortios/fortios_webfilter_urlfilter.py
7
15868
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
procangroup/edx-platform
lms/djangoapps/notification_prefs/views.py
3
7651
""" Views to support notification preferences. """ from __future__ import division import json import os from base64 import urlsafe_b64decode, urlsafe_b64encode from hashlib import sha256 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.ciphers import Cipher from cryptogra...
agpl-3.0
frewsxcv/AutobahnPython
autobahn/autobahn/wamp/uri.py
11
5339
############################################################################### ## ## Copyright (C) 2013-2014 Tavendo GmbH ## ## 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 ## ## h...
apache-2.0
ybellavance/python-for-android
python3-alpha/python3-src/Doc/includes/dbpickle.py
100
2863
# Simple example presenting how persistent ID can be used to pickle # external objects by reference. import pickle import sqlite3 from collections import namedtuple # Simple class representing a record in our database. MemoRecord = namedtuple("MemoRecord", "key, task") class DBPickler(pickle.Pickler): def persi...
apache-2.0
davrv93/creed-en-sus-profetas-backend
django_rv_apps/apps/believe_his_prophets_api/views/spirit_prophecy_chapter_view.py
1
2084
from rest_framework import serializers from rest_framework import viewsets, status from rest_framework.response import Response from rest_framework.decorators import list_route from rest_framework.exceptions import ParseError from django_rv_apps.apps.believe_his_prophets.models.spirit_prophecy_chapter import SpiritProp...
apache-2.0
komsas/partner-contact
partner_helper/partner.py
35
2586
# -*- coding: utf-8 -*- ############################################################################## # # Author: Sébastien BEAU <sebastien.beau@akretion.com> # Copyright 2014 Akretion # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0