repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
thefinn93/CouchPotatoServer
libs/pyutil/benchmarks/bench_json.py
106
1210
from pyutil import randutil import random from decimal import Decimal l = [] s = None def data_strings(N): assert isinstance(N, int), (N, type(N)) del l[:] for i in range(N): l.append(repr(randutil.insecurerandstr(4))) global s s = json.dumps(l) def data_Decimals(N): del l[:] for ...
gpl-3.0
MoKee/android_kernel_nubia_nx403a
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
markYoungH/chromium.src
tools/telemetry/telemetry/web_perf/metrics/timeline_based_metric.py
77
2212
# 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. class TimelineBasedMetricException(Exception): """Exception that can be thrown from metrics that implements TimelineBasedMetric to indicate a problem...
bsd-3-clause
JulianSchuette/android-instrumentation
injector/androguard/core/bytecodes/jvm_generate.py
10
3707
# This file is part of Androguard. # # Copyright (C) 2012 Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the...
apache-2.0
orekyuu/intellij-community
python/lib/Lib/atexit.py
104
1631
""" atexit.py - allow programmer to define multiple exit functions to be executed upon normal program termination. One public function, register, is defined. """ __all__ = ["register"] import sys _exithandlers = [] def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in rev...
apache-2.0
u-ra/android_kernel_htc_msm8660
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/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 import sh...
gpl-2.0
kevin-f-liu/WSBAuto
src/finbox_master/finbox_request.py
1
1927
import requests import io import json import csv from math import floor class finboxRequest: def __init__(self): self.url = "https://api.finbox.io/beta" self.headers = { 'authorization': "Bearer 509e960d5d374b8958f00bd5e977d13f001925fe", 'accept': "application/json", 'c...
mit
razzius/PyClassLessons
instructors/lessons/django-intro/examples/grocery_project/grocery_project/settings.py
3
5489
# Django settings for grocery_project project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME':...
mit
MikeOfNoTrades/netmiko
netmiko/juniper/juniper_ssh.py
9
5570
from __future__ import unicode_literals import re from netmiko.ssh_connection import BaseSSHConnection class JuniperSSH(BaseSSHConnection): """Implement methods for interacting with Juniper Networks devices. Subclass of SSHConnection. Disables `enable()` and `check_enable_mode()` methods. Overrides sev...
mit
richpolis/siveinpy
env/lib/python2.7/site-packages/django/contrib/sessions/backends/cache.py
122
2505
from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.cache import get_cache from django.utils.six.moves import xrange KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ ...
mit
wonder-sk/QGIS
python/plugins/processing/algs/qgis/SetRasterStyle.py
3
2764
# -*- coding: utf-8 -*- """ *************************************************************************** SelectByLocation.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
gpl-2.0
mattcontinisio/cereal-yaml
yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_catch_exceptions_test.py
2139
9901
#!/usr/bin/env python # # Copyright 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 o...
bsd-3-clause
Tong-Chen/genomics-tools
mapreduce-python/cloudstorage/rest_api.py
106
8012
# Copyright 2012 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 ag...
apache-2.0
SageHack/cloud-buster
bust/descriptor/httpresponse.py
1
1544
import http.client class HttpResponse(object): responses = {} def __init__(self, domain, port=None, timeout=10, ssl=False): self.domain = domain self.timeout = timeout self.ssl = ssl if port is None and ssl is False: self.port = 80 elif port is None and s...
gpl-3.0
yogiben/Sublime-AdvancedNewFile
advanced_new_file/anf_util.py
2
6650
import sublime import re import os ALIAS_SETTING = "alias" DEFAULT_INITIAL_SETTING = "default_initial" USE_CURSOR_TEXT_SETTING = "use_cursor_text" SHOW_FILES_SETTING = "show_files" SHOW_PATH_SETTING = "show_path" DEFAULT_ROOT_SETTING = "default_root" DEFAULT_PATH_SETTING = "default_path" DEFAULT_FOLDER_INDEX_SETTING =...
mit
vegitron/pyodbc
tests3/accesstests.py
22
22390
#!/usr/bin/python usage="""\ usage: %prog [options] filename Unit tests for Microsoft Access These run using the version from the 'build' directory, not the version installed into the Python directories. You must run python setup.py build before running the tests. To run, pass the filename of an Access database on...
mit
Wonjuseo/Project101
1/1-3. Deep Neural Network.py
1
2311
# tensorflow, numpy를 사용하기위해 import import tensorflow as tf import numpy as np # Deep learning을 위해 데이터를 읽습니다. data = np.loadtxt('./data.csv',delimiter=',',unpack=True,dtype='float32') # csv자료의 0부터 2번째 까지의 feature를 x_data에 넣습니다. # 나머지는 분류가 되는 데이터로 y_data에 넣습니다. x_data = np.transpose(data[0:3]) y_data = np.transpose(da...
apache-2.0
akamensky/sssd
src/tests/intg/ent_test.py
1
15643
# # ent.py module tests # # Copyright (c) 2015 Red Hat, Inc. # Author: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> # # This 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; version 2 only # # This progra...
gpl-3.0
davidnmurray/iris
tools/generate_std_names.py
12
4673
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
jaywink/diaspora-hub
config/production.py
2
4976
''' Production Configurations ''' from .base import * # noqa # SECRET CONFIGURATION # ------------------------------------------------------------------------------ # See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key # Raises ImproperlyConfigured exception if DJANGO_SECRET_KEY not in os.environ SEC...
agpl-3.0
reubano/hdxscraper-fts
tests/__init__.py
7
2489
# -*- coding: utf-8 -*- """ tests ~~~~~ Provides application unit tests """ from flask.json import loads, dumps from app import create_app initialized = False app = None client = None jsonx = None endpoint = None base = None def setup_package(): """database context creation""" global initialize...
mit
ubc/edx-ora2
openassessment/assessment/test/constants.py
5
2894
# -*- coding: utf-8 -*- """ Constants used as test data. """ STUDENT_ITEM = { 'student_id': u'𝓽𝓮𝓼𝓽 𝓼𝓽𝓾𝓭𝓮𝓷𝓽', 'item_id': u'𝖙𝖊𝖘𝖙 𝖎𝖙𝖊𝖒', 'course_id': u'ՇєรՇ ς๏ยгรє', 'item_type': u'openassessment' } ANSWER = {'text': u'ẗëṡẗ äṅṡẅëṛ'} RUBRIC_OPTIONS = [ { "order_num": 0, ...
agpl-3.0
danakj/chromium
third_party/libxml/src/check-xinclude-test-suite.py
347
5333
#!/usr/bin/python import sys import time import os import string sys.path.insert(0, "python") import libxml2 # # the testsuite description # DIR="xinclude-test-suite" CONF="testdescr.xml" LOG="check-xinclude-test-suite.log" log = open(LOG, "w") os.chdir(DIR) test_nr = 0 test_succeed = 0 test_failed = 0 test_error =...
bsd-3-clause
BertrandBordage/cmsplugin-filer
cmsplugin_filer_image/models.py
4
4881
from django.utils.translation import ugettext_lazy as _ from django.db import models from cms.models import CMSPlugin, Page from cms.models.fields import PageField from posixpath import join, basename, splitext, exists from filer.fields.image import FilerImageField from filer.fields.file import FilerFileField from cms ...
mit
Azure/azure-sdk-for-python
sdk/core/azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py
6
67533
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apa...
mit
nkmk/python-snippets
notebook/dict_keys_values_items.py
1
1226
d = {'key1': 1, 'key2': 2, 'key3': 3} for k in d: print(k) # key1 # key2 # key3 for k in d.keys(): print(k) # key1 # key2 # key3 keys = d.keys() print(keys) print(type(keys)) # dict_keys(['key1', 'key2', 'key3']) # <class 'dict_keys'> k_list = list(d.keys()) print(k_list) print(type(k_list)) # ['key1', 'key...
mit
darkdukey/sdkbox-facebook-sample-v2
external/emscripten/tests/freetype/src/tools/docmaker/docmaker.py
18
2767
#!/usr/bin/env python2 # # DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org> # # This program is a re-write of the original DocMaker took used # to generate the API Reference of the FreeType font engine # by converting in-source comments into structured HTML. # # This new version is capable of outputting...
mit
Jim61C/VTT_Show_Atten_And_Tell
prepro.py
4
8670
from scipy import ndimage from collections import Counter from core.vggnet import Vgg19 from core.utils import * import tensorflow as tf import numpy as np import pandas as pd import hickle import os import json def _process_caption_data(caption_file, image_dir, max_length): with open(caption_file) as f: ...
mit
patrickhartling/maestro
maestro/gui/plugins/views/stanza_editor/optioneditors/OverrideEditorBase.py
2
4289
# Maestro is Copyright (C) 2006-2008 by Infiscape Corporation # # Original Author: Aron Bierbaum # # 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 ...
gpl-2.0
ARudiuk/mne-python
mne/gui/_file_traits.py
6
15746
"""File data sources for traits GUIs""" # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) import os import numpy as np from ..externals.six.moves import map # allow import without traits try: from traits.api import (Any, HasTraits, HasPrivateTraits, cached_property, ...
bsd-3-clause
marcy-terui/lamvery
lamvery/actions/base.py
1
2145
# -*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod from lamvery.config import Config from lamvery.log import get_logger from lamvery.clients import ( LambdaClient, KmsClient, EventsClient, LogsClient, ApiGatewayClient ) class BaseAction: __metaclass__ = ABCMeta _logger = No...
mit
smurfix/HomEvenT
homevent/__init__.py
1
1392
# -*- coding: utf-8 -*- ## ## Copyright © 2007-2012, Matthias Urlichs <matthias@urlichs.de> ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (a...
gpl-3.0
TalShor/SciLMM
scilmm/Tests/test_IBDCompute.py
1
2451
import os from os.path import join from unittest import TestCase import numpy as np from scilmm import IBDCompute class TestIBDCompute(TestCase): def setUp(self): self.ibd_compute = IBDCompute() def test_compute_relationships(self): pedigree, entries_list = self.ibd_compute.compute_relation...
gpl-3.0
Mercador/python-keystoneclient
keystoneclient/baseclient.py
10
1313
# 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 t...
apache-2.0
nikolas/mezzanine
mezzanine/forms/fields.py
51
3823
from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django import forms from django.forms.extras import SelectDateWidget from django.utils.translation import ugettext_lazy as _ from mezzanine.conf import settings from mezzanine.core.forms import SplitSelectDateTimeWidg...
bsd-2-clause
MonamAgarwal/final
GTG/backends/generictomboy.py
1
24956
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
gpl-3.0
facetoe/i3pystatus
i3pystatus/pagerduty.py
3
2349
from i3pystatus import IntervalModule from i3pystatus.core.util import internet, require, formatp import pypd __author__ = 'chestm007' class PagerDuty(IntervalModule): """ Module to get the current incidents in PD Requires `pypd` Formatters: * `{num_incidents}` - current number of incidents un...
mit
labcodes/django
tests/serializers/test_yaml.py
74
5567
import importlib import unittest from io import StringIO from django.core import management, serializers from django.core.serializers.base import DeserializationError from django.test import SimpleTestCase, TestCase, TransactionTestCase from .models import Author from .tests import SerializersTestBase, SerializersTra...
bsd-3-clause
henriquemiranda/yambopy
scripts/realtime/break-symm.py
6
2275
############################################################################## # # Author: Alejandro Molina-Sanchez # Run real-time simulations with yambo # # Warning: Real-time simulations requires several data folders for running # properly. Before using this scripts compulsively is recommended # to understand the d...
bsd-3-clause
Varbin/EEH
_vendor/ldap3/extend/microsoft/modifyPassword.py
1
2949
""" """ # Created on 2015.11.27 # # Author: Giovanni Cannata # # Copyright 2015, 2016, 2017 Giovanni Cannata # # This file is part of ldap3. # # ldap3 is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, ei...
bsd-2-clause
Gurdil/pywo
pywo/core/windows.py
5
34855
# # PyWO - Python Window Organizer # Copyright 2010, Wojciech 'KosciaK' Pietrzok # # This file is part of PyWO. # # PyWO 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 # (a...
gpl-3.0
RaoUmer/django
django/core/serializers/base.py
4
5766
""" Module for abstract serializer/unserializer base classes. """ from django.db import models from django.utils.encoding import smart_text from django.utils import six class SerializerDoesNotExist(KeyError): """The requested serializer was not found.""" pass class SerializationError(Exception): """Somet...
bsd-3-clause
BryanCutler/spark
examples/src/main/python/mllib/recommendation_example.py
27
2015
# # 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
adalke/rdkit
rdkit/ML/Descriptors/UnitTestDescriptors.py
4
1337
# # Copyright (C) 2001,2002 greg Landrum and Rational Discovery LLC # """ unit testing code for descriptors """ import unittest from rdkit.ML.Descriptors import CompoundDescriptors from rdkit.six.moves import xrange class TestCase(unittest.TestCase): def setUp(self): d = [('DED',['NonZero','Mean','Dev']...
bsd-3-clause
benpatterson/edx-platform
lms/djangoapps/instructor/management/commands/openended_post.py
86
4626
""" Command to manually re-post open ended submissions to the grader. """ from django.contrib.auth.models import User from django.core.management.base import BaseCommand from optparse import make_option from xmodule.modulestore.django import modulestore from opaque_keys.edx.locations import SlashSeparatedCourseKey fro...
agpl-3.0
eltonkevani/tempest_el_env
tempest/cli/simple_read_only/test_nova.py
3
5477
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 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.apach...
apache-2.0
janarthananfit/Nightlies-4.4
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
cobbler/cobbler
cobbler/cobbler_collections/mgmtclasses.py
1
2621
""" Copyright 2010, Kelsey Hightower Kelsey Hightower <kelsey.hightower@gmail.com> 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 versi...
gpl-2.0
dunkhong/grr
grr/client/grr_response_client/client_actions/osquery.py
1
8557
#!/usr/bin/env python """A module with client action for talking with osquery.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import collections import os from future.builtins import map from future.utils import iterkeys from typing import Any from t...
apache-2.0
virtualopensystems/neutron
neutron/db/migration/alembic_migrations/versions/4692d074d587_agent_scheduler.py
8
3255
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
yb-kim/gemV
src/arch/x86/isa/insts/x87/arithmetic/square_root.py
91
2150
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
karibou/sosreport
tests/policy_tests.py
15
1831
import unittest from sos.policies import Policy, PackageManager, import_policy from sos.plugins import Plugin, IndependentPlugin, RedHatPlugin, DebianPlugin class FauxPolicy(Policy): distro = "Faux" class FauxPlugin(Plugin, IndependentPlugin): pass class FauxRedHatPlugin(Plugin, RedHatPlugin): pass cla...
gpl-2.0
Leoniela/nipype
nipype/interfaces/spm/tests/test_auto_CreateWarped.py
12
1298
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.spm.preprocess import CreateWarped def test_CreateWarped_inputs(): input_map = dict(flowfield_files=dict(copyfile=False, field='crt_warped.flowfields', mandatory=True, ), ignore_exce...
bsd-3-clause
HiroIshikawa/21playground
microblog/flask/lib/python3.5/site-packages/sqlalchemy/util/queue.py
81
6548
# util/queue.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 """An adaptation of Py2.3/2.4's Queue module which supports reentrant behavior, using ...
mit
jchodera/pymbar
pymbar/tests/test_utils.py
3
1027
import numpy as np import pymbar from pymbar.utils_for_testing import eq import scipy.misc from nose import SkipTest def test_logsumexp(): a = np.random.normal(size=(200, 500, 5)) for axis in range(a.ndim): ans_ne = pymbar.utils.logsumexp(a, axis=axis) ans_no_ne = pymbar.utils.logsumexp(a, axi...
lgpl-2.1
bschuon/django-oscar
tests/integration/offer/percentage_benefit_tests.py
40
8517
from decimal import Decimal as D from django.test import TestCase import mock from oscar.apps.offer import models from oscar.test import factories from oscar.test.basket import add_product, add_products class TestAPercentageDiscountAppliedWithCountCondition(TestCase): def setUp(self): range = models.Ra...
bsd-3-clause
aetilley/scikit-learn
sklearn/metrics/cluster/bicluster.py
359
2797
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_consistent_length, check_array __all__ = ["consensus_score"] def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shap...
bsd-3-clause
xuerenlv/scrapy
scrapy/http/request/form.py
23
6564
""" This module implements the FormRequest class which is a more convenient class (than Request) to generate Requests based on form data. See documentation in docs/topics/request-response.rst """ from six.moves.urllib.parse import urljoin, urlencode import lxml.html from parsel.selector import create_root_node import...
bsd-3-clause
InakiZabala/odoomrp-wip
procurement_orderpoint_no_confirm/__openerp__.py
27
1348
# -*- encoding: utf-8 -*- ############################################################################## # # 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, either version 3 of the...
agpl-3.0
axinging/chromium-crosswalk
third_party/WebKit/LayoutTests/PRESUBMIT.py
3
2808
# Copyright (c) 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. """LayoutTests/ presubmit script for Blink. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presu...
bsd-3-clause
Shouqun/node-gn
tools/depot_tools/third_party/mock/__init__.py
1
75516
# Test tools for mocking and patching. # Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # mock 1.0 # http://www.voidspace.org.uk/python/mock/ # Released subject to the BSD License # Please see http://www.voidspace.org.uk/python/license.shtml # Scripts maintained ...
mit
ucloud/uai-sdk
uai/api/get_uai_srv_bill_unitprice.py
1
1616
# Copyright 2017 The UAI-SDK Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
imsut/commons
tests/python/twitter/common/python/test_nested.py
2
1942
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
Nihn/Diamond-1
src/collectors/http/http.py
28
3120
# coding=utf-8 """ Collect statistics from a HTTP or HTTPS connexion #### Dependencies * urllib2 #### Usage Add the collector config as : enabled = True ttl_multiplier = 2 path_suffix = "" measure_collector_time = False byte_unit = byte, req_vhost = www.my_server.com req_url = https://www.my_server.com/, https://...
mit
EasonYi/flask
tests/test_signals.py
149
5418
# -*- coding: utf-8 -*- """ tests.signals ~~~~~~~~~~~~~~~~~~~~~~~ Signalling. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest try: import blinker except ImportError: blinker = None import flask pytestmark = pytest.mark.skipif( ...
bsd-3-clause
CGATOxford/Optic
scripts/species_map2species_map.py
1
2392
''' species_map2species_map.py ============================================= :Author: Nick Ilott :Release: $Id$ :Date: |today| :Tags: Python Purpose ------- Convert species ids from a species_map file to names provided from genome files. Usage ----- Example:: python species_map2species_map.py --help Type:: ...
mit
potato/searx
searx/engines/digbt.py
5
1777
""" DigBT (Videos, Music, Files) @website https://digbt.org @provide-api no @using-api no @results HTML (using search portal) @stable no (HTML can change) @parse url, title, content, magnetlink """ from sys import version_info from lxml import html from searx.engines.xpath import extract_...
agpl-3.0
aricchen/openHR
openerp/addons/stock_location/__openerp__.py
59
5005
# -*- 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
brandond/ansible
lib/ansible/modules/crypto/openssh_cert.py
6
21127
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, David Kainz <dkainz@mgit.at> <dave.jokain@gmx.at> # 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 = { 'metadat...
gpl-3.0
ArcherSys/ArcherSys
Lib/site-packages/django/forms/models.py
37
55467
""" Helper functions for creating Form classes from Django models and database field objects. """ from __future__ import unicode_literals import warnings from collections import OrderedDict from itertools import chain from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, Valida...
mit
nttks/jenkins-test
common/lib/xmodule/xmodule/tests/test_imageannotation.py
25
3487
# -*- coding: utf-8 -*- """Test for Image Annotation Xmodule functional logic.""" import unittest from mock import Mock from lxml import etree from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xmodule.imageannotation_module import ImageAnnotationModule from . import get_test_system...
agpl-3.0
warped-rudi/xbmc
tools/EventClients/lib/python/zeroconf.py
181
4874
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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 opti...
gpl-2.0
HaroldMills/Vesper
vesper/signal/tests/test_wave_file_signal.py
1
1904
from pathlib import Path from vesper.signal.signal_error import SignalError from vesper.signal.tests.test_signal import SignalTests from vesper.signal.time_axis import TimeAxis from vesper.signal.wave_file_signal import WaveFileSignal from vesper.tests.test_case import TestCase import vesper.signal.tests.utils as util...
mit
kevinkle/semantic
app/SuperPhy/models/response.py
2
4112
""" models.py """ #pylint: disable=C0103, W0406 from collections import defaultdict from flask import Flask, abort, request, jsonify, g, url_for, current_app from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.httpauth import HTTPBasicAuth from passlib.apps import custom_app_context as pwd_context from itsdange...
apache-2.0
BallCity/PokemonGo-Map
pogom/models.py
2
12947
#!/usr/bin/python # -*- coding: utf-8 -*- import logging import os import time from peewee import Model, SqliteDatabase, InsertQuery,\ IntegerField, CharField, DoubleField, BooleanField,\ DateTimeField, OperationalError, create_model_tables from playhouse.flask_utils import FlaskD...
agpl-3.0
dmilith/SublimeText3-dmilith
Packages/pygments/all/pygments/lexers/r.py
47
23755
# -*- coding: utf-8 -*- """ pygments.lexers.r ~~~~~~~~~~~~~~~~~ Lexers for the R/S languages. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, include, words, do_insertions from ...
mit
hmen89/odoo
addons/stock/report/report_stock.py
376
2486
# -*- 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
pyblish/pyblish-win
lib/Python27/Lib/encodings/euc_jis_2004.py
816
1051
# # euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('euc_jis_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(m...
lgpl-3.0
Changaco/oh-mainline
mysite/profile/migrations/0007_tag_type_remove_s.py
17
5292
# This file is part of OpenHatch. # Copyright (C) 2009 OpenHatch, Inc. # # 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, either version 3 of the License, or # (at your option) any later v...
agpl-3.0
endlessm/chromium-browser
third_party/catapult/third_party/gsutil/gslib/tests/test_tabcomplete.py
5
14512
# -*- coding: utf-8 -*- # Copyright 2014 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 requir...
bsd-3-clause
olsonanl/transform
plugins/scripts/taskrunners/trns_upload_Transform.Pair.py
15
2910
#!/usr/bin/env python import argparse import sys import os import time import traceback import sys import ctypes import subprocess from subprocess import Popen, PIPE import shutil from optparse import OptionParser from biokbase.workspace.client import Workspace import urllib import urllib2 import json from biokbase im...
mit
Jigsaw-Code/net-analysis
netanalysis/ooni/data/fetch_measurements.py
1
4198
#!/usr/bin/python # # Copyright 2021 Jigsaw Operations LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
mozman/ezdxf
examples/text_layout_engine_usage.py
1
12087
# Copyright (c) 2021, Manfred Moitzi # License: MIT License import sys from typing import Iterable import pathlib import random import ezdxf from ezdxf import zoom, print_config from ezdxf.math import Matrix44 from ezdxf.tools import fonts from ezdxf.tools import text_layout as tl """ This example shows the usage o...
mit
garthomp/ruby_blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/murphy.py
364
2751
# -*- coding: utf-8 -*- """ pygments.styles.murphy ~~~~~~~~~~~~~~~~~~~~~~ Murphy's style from CodeRay. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Comment,...
mit
aricchen/openHR
openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py
384
11148
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
BaconPancakes/valor
lib/youtube_dl/extractor/bpb.py
37
2034
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( js_to_json, determine_ext, ) class BpbIE(InfoExtractor): IE_DESC = 'Bundeszentrale für politische Bildung' _VALID_URL = r'https?://(?:www\.)?bpb\.de/mediathek/(?P<id>[0-9]+)/' ...
gpl-3.0
divio/django
tests/migrations/test_optimizer.py
50
22478
# -*- coding: utf-8 -*- from django.db import migrations, models from django.db.migrations.optimizer import MigrationOptimizer from django.test import SimpleTestCase from .models import CustomModelBase, EmptyManager class OptimizerTests(SimpleTestCase): """ Tests the migration autodetector. """ def...
bsd-3-clause
ludobox/ludobox-ui
server/setup.py
2
2226
# ludobox setup.py """Setup script for Ludobox.""" # Copyright (C) 2016 Pierre-Yves Martin for DCALK # # 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, either version 3 of the License, ...
agpl-3.0
BT-ojossen/odoo
addons/payment_ogone/controllers/main.py
389
1179
# -*- coding: utf-8 -*- import logging import pprint import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class OgoneController(http.Controller): _accept_url = '/payment/ogone/test/accept' _decline_url = '/payment/ogone/test/decline' ...
agpl-3.0
orekyuu/intellij-community
python/helpers/docutils/parsers/rst/languages/it.py
57
3093
# $Id: it.py 4564 2006-05-21 20:44:42Z wiemann $ # Authors: Nicola Larosa <docutils@tekNico.net>; # Lele Gaifax <lele@seldati.it> # Copyright: This module has been placed in the public domain. # Beware: the italian translation of the reStructuredText documentation # at http://docit.bice.dyndns.org/static/ReST...
apache-2.0
Intel-Corporation/tensorflow
tensorflow/contrib/losses/python/losses/loss_ops_test.py
23
55152
# 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
lugensa/sqlalchemy-migrate
migrate/changeset/schema.py
60
22855
""" Schema module providing common schema operations. """ import warnings from UserDict import DictMixin import sqlalchemy from sqlalchemy.schema import ForeignKeyConstraint from sqlalchemy.schema import UniqueConstraint from migrate.exceptions import * from migrate.changeset import SQLA_07 from migrate.changese...
mit
levic/django-extensions
django_extensions/management/commands/mail_debug.py
27
2924
import asyncore import sys from logging import getLogger from optparse import make_option from smtpd import SMTPServer from django.core.management.base import BaseCommand, CommandError from django_extensions.management.utils import setup_logger, signalcommand logger = getLogger(__name__) class ExtensionDebuggingSe...
mit
orcasgit/django-flatcontent
flatcontent/models.py
1
2578
from django.contrib.sites.models import Site from django.core.cache import cache from django.db import models from django.utils import translation from templatefield.fields import TemplateTextField from templatefield.managers import RenderTemplateManager class FlatContent(models.Model): slug = models.SlugField(ma...
bsd-3-clause
BraydenYates/school
jenningsextracredit.py
1
2032
import os, sys def congrats(): print(" ,jf") print(" _am, ,_am, ,_g_oam, _am, _g_ag, _am, koewkovg _mm_") print(" ,gF @._-gF @-' jf @ ,gF @ ^ NX #_,gF @ jf qK '") print(" 8Y 8Y d j# ...
gpl-2.0
gdimitris/ChessPuzzler
Virtual_Environment/lib/python2.7/site-packages/sqlparse/formatter.py
118
5113
# Copyright (C) 2008 Andi Albrecht, albrecht.andi@gmail.com # # This module is part of python-sqlparse and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php. """SQL formatter""" from sqlparse import filters from sqlparse.exceptions import SQLParseError def validate_options(opti...
mit
bhairavmehta95/flashcard-helper-alexa-skill
venv/lib/python2.7/site-packages/pip/vcs/mercurial.py
514
3472
from __future__ import absolute_import import logging import os import tempfile from pip.utils import display_path, rmtree from pip.vcs import vcs, VersionControl from pip.download import path_to_url from pip._vendor.six.moves import configparser logger = logging.getLogger(__name__) class Mercurial(VersionControl...
mit
Aorjoa/aiyara-ceph-dash
.tox/py27/lib/python2.7/site-packages/nose/plugins/cover.py
48
11673
"""If you have Ned Batchelder's coverage_ module installed, you may activate a coverage report with the ``--with-coverage`` switch or NOSE_WITH_COVERAGE environment variable. The coverage report will cover any python source module imported after the start of the test run, excluding modules that match testMatch. If you ...
bsd-2-clause
inovtec-solutions/OpenERP
openerp/addons/point_of_sale/report/pos_details_summary.py
22
5615
# -*- 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
PiRSquared17/stoqs
loaders/CANON/stellas_loadsep2013.py
5
2830
#!/usr/bin/env python __author__ = 'Mike McCann,Duane Edgington,Reiko Michisaki' __copyright__ = '2013' __license__ = 'GPL v3' __contact__ = 'duane at mbari.org' __doc__ = ''' Stella loader for all CANON activities in September 2013 Mike McCann; Modified by Duane Edgington and Reiko Michisaki MBARI 02 Septemb...
gpl-3.0