repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
harshilasu/LinkurApp
refs/heads/master
y/google-cloud-sdk/lib/googlecloudapis/compute/v1/__init__.py
11
"""Common imports for generated compute client library.""" # pylint:disable=wildcard-import import pkgutil from googlecloudapis.apitools.base.py import * from googlecloudapis.compute.v1.compute_v1_client import * from googlecloudapis.compute.v1.compute_v1_messages import * __path__ = pkgutil.extend_path(__path__, __...
evan6200/cirrfy_pos
refs/heads/master
tools/perf/scripts/python/syscall-counts.py
11181
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
kaushik94/boto
refs/heads/develop
tests/integration/gs/test_resumable_uploads.py
101
# Copyright 2010 Google Inc. # # 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, dis- # trib...
nekonok/dotfiles
refs/heads/master
app/alfred/Alfred.alfredpreferences/workflows/user.workflow.125AE956-75D0-4ABD-BA83-AB8EB38B9531/libs/faker/providers/internet/no_NO/__init__.py
2
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as InternetProvider class Provider(InternetProvider): tlds = ('com', 'com', 'com', 'net', 'org', 'no', 'no', 'no', 'no', 'no') replacements = ( ('æ', 'ae'), ('Æ', 'Ae'), ('ø', 'oe'), ('Ø', 'Oe'), ('å', 'aa...
toontownfunserver/Panda3D-1.9.0
refs/heads/master
python/Lib/wsgiref/simple_server.py
177
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21) This is both an example of how WSGI can be implemented, and a basis for running simple web applications on a local machine, such as might be done when testing or debugging an application. It has not been reviewed for security issues, howev...
zerc/django
refs/heads/master
django/middleware/locale.py
358
"This is the locale selecting middleware that will look at accept headers" from django.conf import settings from django.core.urlresolvers import ( LocaleRegexURLResolver, get_resolver, get_script_prefix, is_valid_path, ) from django.http import HttpResponseRedirect from django.utils import translation from django....
rdqw/sscoin
refs/heads/master
qa/rpc-tests/txn_clone.py
1
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test proper accounting with an equivalent malleability clone # from test_framework.test_framework im...
mrrrgn/build-mozharness
refs/heads/master
configs/test/test.py
15
#!/usr/bin/env python config = { "log_name": "test", "log_dir": "test_logs", "log_to_console": False, "key1": "value1", "key2": "value2", "section1": { "subsection1": { "key1": "value1", "key2": "value2" }, "subsection2": { "key1": "value1", "key2": "value2" }, }...
CHBMB/LazyLibrarian
refs/heads/master
lib/requests/packages/chardet/gb2312prober.py
2993
######################## 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...
GameTheory-/android_kernel_g4stylusn
refs/heads/master
tools/perf/util/setup.py
2079
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
nmayorov/scikit-learn
refs/heads/master
doc/sphinxext/numpy_ext/numpydoc.py
413
""" ======== numpydoc ======== Sphinx extension that handles docstrings in the Numpy standard format. [1] It will: - Convert Parameters etc. sections to field lists. - Convert See Also section to a See also entry. - Renumber references. - Extract the signature from the docstring, if it can't be determined otherwis...
ekzhu/SetSimilaritySearch
refs/heads/master
SetSimilaritySearch/utils.py
1
import logging from collections import Counter import numpy as np def _jaccard_overlap_threshold_func(x, t): return int(x * t) _jaccard_overlap_index_threshold_func = _jaccard_overlap_threshold_func def _cosine_overlap_threshold_func(x, t): return int(np.sqrt(x) * t) _cosine_overlap_index_threshold_func = _...
luiscarlosgph/nas
refs/heads/master
env/lib/python2.7/site-packages/django/contrib/auth/tests/test_middleware.py
56
from django.contrib.auth.middleware import SessionAuthenticationMiddleware from django.contrib.auth.models import User from django.http import HttpRequest from django.test import TestCase class TestSessionAuthenticationMiddleware(TestCase): def setUp(self): self.user_password = 'test_password' sel...
njwilson23/landsat-util
refs/heads/master
tests/test_image.py
3
# Landsat Util # License: CC0 1.0 Universal """Tests for image processing""" from os.path import join, abspath, dirname, exists import errno import shutil import unittest from tempfile import mkdtemp import rasterio from rasterio.warp import transform_bounds from landsat.image import Simple, PanSharpen from landsat...
PetePriority/home-assistant
refs/heads/dev
homeassistant/components/ihc/__init__.py
1
""" Support for IHC devices. For more details about this component, please refer to the documentation at https://home-assistant.io/components/ihc/ """ import logging import os.path import voluptuous as vol from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA from homeassistant.components.ihc.cons...
ProfessorX/Config
refs/heads/master
.PyCharm30/system/python_stubs/-1247972723/_random.py
1
# encoding: utf-8 # module _random # from (built-in) # by generator 1.135 """ Module implements the Mersenne Twister random number generator. """ # no imports # no functions # classes from object import object class Random(object): """ Random() -> create a random number generator with its own internal state. """...
bitfree/TIL
refs/heads/master
python/headfirst/example/chapter7/page273.py
8
#! /usr/local/bin/python3 import glob import athletemodel import yate data_files = glob.glob("data/*.txt") athletes = athletemodel.put_to_store(data_files) print(yate.start_response()) print(yate.include_header("Coach Kelly's List of Athletes")) print(yate.start_form("generate_timing_data.py")) print(yate.para("Sel...
dwightgunning/django
refs/heads/master
tests/template_tests/syntax_tests/test_multiline.py
432
from django.test import SimpleTestCase from ..utils import setup multiline_string = """ Hello, boys. How are you gentlemen. """ class MultilineTests(SimpleTestCase): @setup({'multiline01': multiline_string}) def test_multiline01(self): output = self.engine.render_to_string('multiline01') s...
matejcik/weblate
refs/heads/master
weblate/trans/templatetags/permissions.py
1
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eith...
agry/NGECore2
refs/heads/master
scripts/object/building/poi/tatooine_dervishcamp_small1.py
85615
import sys def setup(core, object): return
agry/NGECore2
refs/heads/master
scripts/object/weapon/melee/2h_sword/crafted_saber/sword_lightsaber_two_handed_s7_gen1.py
85615
import sys def setup(core, object): return
moshthepitt/answers
refs/heads/master
questions/migrations/0006_auto_20151209_1015.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('saas', '0001_initial'), ('questions', '0005_auto_20151208_1752'), ] operations = [ ...
esthermm/odoomrp-wip
refs/heads/8.0
stock_picking_package_info/__openerp__.py
10
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) # 2015 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com) # 2015 AvanzOsc (http://www.avanzosc.es) # # This program is free software: you can redistribute it and/or modi...
ARTFL-Project/PhiloLogic5
refs/heads/master
python/philologic/Loader.py
1
#!/usr/bin/env python3 """Standard PhiloLogic5 loader. Calls all parsing functions and stores data in index""" import collections import imp import math import os import pickle import re import shutil import sqlite3 import sys import time from glob import glob from lxml import etree from philologic.Config import Make...
thispc/download-manager
refs/heads/master
module/lib/thrift/TSerialization.py
74
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
cliffe/SecGen
refs/heads/master
modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/encodings/cp862.py
593
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
salguarnieri/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/utils/cache.py
71
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
jdan/Melopy
refs/heads/master
melopy/exceptions.py
2
class MelopyGenericError(Exception): pass class MelopyValueError(ValueError): pass
kun--hust/SDSCloud
refs/heads/master
swift/common/utils.py
10
# Copyright (c) 2010-2012 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 or agree...
viharm/pyHumiTemp
refs/heads/master
pyHumiTemp.py
1
#!/usr/bin/python3 # coding=utf-8 ## @package pyHumiTemp # \author Viharm # \version See VERSION # \brief Program to provide numeric string output of humidity from DHT22 # \details Program to provide numeric string output of humidity from DHT22 # by using tango's binary. # Depe...
GoogleCloudPlatform/datacatalog-connectors-bi
refs/heads/master
google-datacatalog-qlik-connector/src/google/datacatalog_connectors/qlik/prepare/assembled_entry_factory.py
1
#!/usr/bin/python # # Copyright 2021 Google 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 applicable law or ag...
grigoriy-chirkov/mipt-mips-2015
refs/heads/master
libs/gtest-1.6.0/test/gtest_break_on_failure_unittest.py
1050
#!/usr/bin/env python # # Copyright 2006, 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...
dentaku65/plugin.video.sod
refs/heads/master
lib/mechanize/_useragent.py
133
"""Convenient HTTP UserAgent class. This is a subclass of urllib2.OpenerDirector. Copyright 2003-2006 John J. Lee <jjl@pobox.com> This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included with the distribution). """ impor...
luzfcb/django-autocomplete-light
refs/heads/master
src/dal/__init__.py
6
""" Welcome to django-autocomplete-light. For examples, see the test_project/ directory of the repository. """
ropik/chromium
refs/heads/master
native_client_sdk/src/build_tools/install_nsis.py
8
# 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. """Install the NSIS compiler and its SDK.""" import os import shutil import subprocess import zipfile SCRIPT_DIR = os.path.dirname(os.path.abspath(__f...
matejcik/urllib3
refs/heads/master
urllib3/__init__.py
3
""" urllib3 - Thread-safe connection pooling and re-using. """ from __future__ import absolute_import import warnings from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encode_multipart_formdata from .poolmanager impo...
chrisfilda/edx_platform
refs/heads/master
common/djangoapps/student/tests/test_bulk_email_settings.py
22
""" Unit tests for email feature flag in student dashboard. Additionally tests that bulk email is always disabled for non-Mongo backed courses, regardless of email feature flag, and that the view is conditionally available when Course Auth is turned on. """ from django.test.utils import override_settings from django.c...
hvy/chainer
refs/heads/master
chainer/functions/math/erfcinv.py
8
try: from scipy import special available_cpu = True except ImportError as e: available_cpu = False _import_error = e import math import chainer from chainer.backends import cuda from chainer import function_node from chainer import utils from chainer.utils import type_check BACKWORDC = math.pi ** 0.5...
saumishr/django
refs/heads/master
django/contrib/gis/geos/tests/__init__.py
332
""" GEOS Testing module. """ from django.utils.unittest import TestSuite, TextTestRunner import test_geos, test_io, test_geos_mutation, test_mutable_list test_suites = [ test_geos.suite(), test_io.suite(), test_geos_mutation.suite(), test_mutable_list.suite(), ] def suite(): "Builds a test sui...
lunyang/pylearn2
refs/heads/master
pylearn2/scripts/print_monitor.py
44
#!/usr/bin/env python """ .. todo:: WRITEME """ from __future__ import print_function __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" def p...
ericfc/django
refs/heads/master
tests/get_object_or_404/models.py
409
""" DB-API Shortcuts ``get_object_or_404()`` is a shortcut function to be used in view functions for performing a ``get()`` lookup and raising a ``Http404`` exception if a ``DoesNotExist`` exception was raised during the ``get()`` call. ``get_list_or_404()`` is a shortcut function to be used in view functions for per...
google-research/dice_rl
refs/heads/master
google/rl_algos/tabular_saddle_point.py
1
# Copyright 2020 Google 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 applicable law or agreed to in writing, ...
pshen/ansible
refs/heads/devel
lib/ansible/plugins/lookup/dig.py
46
# (c) 2015, Jan-Piet Mens <jpmens(at)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) any later ver...
uberamd/NGECore2
refs/heads/master
scripts/object/ship/bwing_tier6.py
85615
import sys def setup(core, object): return
ccomb/OpenUpgrade
refs/heads/master
addons/account/wizard/account_financial_report.py
33
# -*- 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...
rosmo/ansible
refs/heads/devel
lib/ansible/modules/remote_management/manageiq/manageiq_group.py
14
#!/usr/bin/python # # (c) 2018, Evert Mulder <evertmulder@gmail.com> (base on manageiq_user.py by Daniel Korn <korndaniel1@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 So...
fargalaxy1/geonode-wagtail
refs/heads/master
geonode/api/resourcebase_api.py
1
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
zeroc0d3/docker-lab
refs/heads/master
python/rootfs/usr/lib/python2.7/dist-packages/powerline/segments/i3wm.py
14
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import re from powerline.theme import requires_segment_info from powerline.bindings.wm import get_i3_connection WORKSPACE_REGEX = re.compile(r'^[0-9]+: ?') def workspace_groups(w): group = [] if w[...
cjwilburn/git-sweep
refs/heads/master
src/gitsweep/tests/test_inspector.py
5
from gitsweep.tests.testcases import GitSweepTestCase, InspectorTestCase class TestInspector(GitSweepTestCase, InspectorTestCase): """ Inspector can find merged branches and present them for cleaning. """ def test_no_branches(self): """ If only the master branch is present, nothing t...
CompassionCH/bank-payment
refs/heads/10.0-payment-cancel
account_banking_mandate_sale/wizard/sale_make_invoice_advance.py
1
# -*- coding: utf-8 -*- # © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, api class SaleAdvancePaymentInv(models.TransientModel): _inherit = 'sale.advance.payment.inv' @api.multi def _create_invoic...
opencloudinfra/orchestrator
refs/heads/master
venv/Lib/site-packages/wheel/decorator.py
627
# from Pyramid class reify(object): """Put the result of a method which uses this (non-data) descriptor decorator in the instance dict after the first call, effectively replacing the decorator with an instance variable. """ def __init__(self, wrapped): self.wrapped = wrapped self....
viewdy/phantomjs2
refs/heads/master
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/containers.py
261
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
miyakz1192/neutron
refs/heads/master
neutron/agent/common/ovs_lib.py
7
# Copyright 2011 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
pablorecio/Cobaya
refs/heads/master
src/tests/config.py
1
############################################################################### # 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 # ...
audip/lunr
refs/heads/master
lunr/common/jsonify.py
2
# Copyright (c) 2011-2016 Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
Trixter69/BookMarka
refs/heads/master
lib/requests/hooks.py
1891
# -*- coding: utf-8 -*- """ requests.hooks ~~~~~~~~~~~~~~ This module provides the capabilities for the Requests hooks system. Available hooks: ``response``: The response generated from a Request. """ HOOKS = ['response'] def default_hooks(): hooks = {} for event in HOOKS: hooks[event] = []...
indico/indico
refs/heads/master
indico/testing/fixtures/cache.py
4
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import pytest from indico.core.cache import cache @pytest.fixture(autouse=True) def clear_cache(): ...
simonkuang/grpc
refs/heads/master
tools/distrib/check_include_guards.py
5
#!/usr/bin/env python2.7 # Copyright 2016 gRPC 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 l...
fintech-circle/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/modulestore/tests/test_split_w_old_mongo.py
45
import datetime import random import unittest import uuid from nose.plugins.attrib import attr import mock from opaque_keys.edx.locator import CourseLocator, BlockUsageLocator from xmodule.modulestore import ModuleStoreEnum from xmodule.x_module import XModuleMixin from xmodule.modulestore.inheritance import Inherita...
wmvanvliet/mne-python
refs/heads/master
mne/commands/mne_compare_fiff.py
14
#!/usr/bin/env python """Compare FIFF files. Examples -------- .. code-block:: console $ mne compare_fiff test_raw.fif test_raw_sss.fif """ # Authors : Eric Larson, PhD import sys import mne def run(): """Run command.""" parser = mne.commands.utils.get_optparser( __file__, usage='mne compare_...
romain-dartigues/ansible
refs/heads/devel
lib/ansible/plugins/filter/core.py
7
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # 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....
crowdworks/redash
refs/heads/crowdworks
redash/query_runner/google_spreadsheets.py
1
import json import logging from base64 import b64decode from dateutil import parser from requests import Session from redash.query_runner import * from redash.utils import JSONEncoder logger = logging.getLogger(__name__) try: import gspread from gspread.httpsession import HTTPSession from oauth2client.s...
wrapp/ec2-nat-failover
refs/heads/master
nat_monitor.py
1
import boto.ec2 import boto.vpc import boto.utils from collections import namedtuple from subprocess import Popen, PIPE from sys import stdin from time import sleep from traceback import print_exc NUM_PINGS = 3 PING_TIMEOUT = 1 WAIT_BETWEEN_CHECKS = 60 def main(): host_info = HostInfo() ec2 = EC2(host_info...
hubo1016/vlcp
refs/heads/master
misc/testio.py
1
''' Created on 2015/9/28 :author: hubo ''' from __future__ import print_function, division from vlcp.protocol import Protocol from time import time from vlcp.event import ConnectionWriteEvent, Event, withIndices, RoutineContainer, Client, TcpServer import argparse import sys from vlcp.server import Server import logg...
erudit/eruditorg
refs/heads/master
eruditorg/erudit/migrations/0043_auto_20160921_0843.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-09-21 13:43 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("erudit", "0042_auto_20160920_1037"), ] operations = [ migrations.AlterField(...
saik0/humblebundle-python
refs/heads/master
humblebundle/__init__.py
1
__author__ = "Joel Pedraza" __copyright__ = "Copyright 2014, Joel Pedraza" __license__ = "MIT" __all__ = ['HumbleApi', 'logger'] import logging logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) from humblebundle.client import HumbleApi
iAmMrinal0/CouchPotatoServer
refs/heads/master
libs/html5lib/serializer/htmlserializer.py
235
from __future__ import absolute_import, division, unicode_literals from six import text_type import gettext _ = gettext.gettext try: from functools import reduce except ImportError: pass from ..constants import voidElements, booleanAttributes, spaceCharacters from ..constants import rcdataElements, entities,...
hsuantien/scikit-learn
refs/heads/master
examples/linear_model/plot_omp.py
385
""" =========================== Orthogonal Matching Pursuit =========================== Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encoded with a dictionary """ print(__doc__) import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import OrthogonalM...
deKupini/erp
refs/heads/master
openerp/report/render/__init__.py
8
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
austinban/aima-python
refs/heads/master
tests/test_probability.py
25
import pytest import random from probability import * # noqa from utils import rounder def tests(): cpt = burglary.variable_node('Alarm') event = {'Burglary': True, 'Earthquake': True} assert cpt.p(True, event) == 0.95 event = {'Burglary': False, 'Earthquake': True} assert cpt.p(False, event) == ...
317070/nntools
refs/heads/master
nntools/tests/test_layers.py
1
from mock import Mock import numpy import pytest import theano class TestLayer: @pytest.fixture def layer(self): from nntools.layers.base import Layer return Layer(Mock()) def test_get_output_shape(self, layer): assert layer.get_output_shape() == layer.input_layer.get_output_shape...
gdooper/scipy
refs/heads/master
scipy/odr/add_newdocs.py
153
from numpy import add_newdoc add_newdoc('scipy.odr', 'odr', """ odr(fcn, beta0, y, x, we=None, wd=None, fjacb=None, fjacd=None, extra_args=None, ifixx=None, ifixb=None, job=0, iprint=0, errfile=None, rptfile=None, ndigit=0, taufac=0.0, sstol=-1.0, partol=-1.0, maxit=-1, stpb=None, stpd=None, sclb=None, scld=No...
40123248/test
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/inspect.py
637
"""Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module:...
spulec/moto
refs/heads/master
moto/kms/responses.py
2
from __future__ import unicode_literals import base64 import json import os import re import six from moto.core.responses import BaseResponse from .models import kms_backends from .exceptions import ( NotFoundException, ValidationException, AlreadyExistsException, NotAuthorizedException, ) ACCOUNT_I...
ujenmr/ansible
refs/heads/devel
lib/ansible/plugins/terminal/dellos9.py
75
# # (c) 2016 Red Hat Inc. # # Copyright (c) 2017 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 version 3 of the License, or # (at your option) an...
hayderimran7/zulip
refs/heads/master
zerver/management/commands/gravatar_to_user_avatar.py
125
from __future__ import absolute_import import requests from zerver.models import get_user_profile_by_email, UserProfile from zerver.lib.avatar import gravatar_hash from zerver.lib.upload import upload_avatar_image from django.core.management.base import BaseCommand, CommandError from django.core.files.uploadedfile imp...
willowtreeapps/tango-core
refs/heads/master
tango/shelf.py
1
"Shelf connectors for persisting stashed template context variables." import cPickle as pickle import pickletools from contextlib import closing from cPickle import HIGHEST_PROTOCOL from sqlite3 import Binary as blobify from sqlite3 import dbapi2 as sqlite3 from sqlite3 import OperationalError class BaseConnector(ob...
maestreparra/Instapaima
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py
2479
#!/usr/bin/env python # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the xcode.py file. """ import gyp.generator.xcode as xcode import unittest import sys class TestEscapeXcodeDefine(unit...
Huluzai/DoonSketch
refs/heads/master
inkscape-0.48.5/share/extensions/draw_from_triangle.py
1
#!/usr/bin/env python ''' Copyright (C) 2007 John Beard john.j.beard@gmail.com ##This extension allows you to draw various triangle constructions ##It requires a path to be selected ##It will use the first three nodes of this path ## Dimensions of a triangle__ # # /`__ # / a_c``--__ # / `...
jsocol/django-pymemcache
refs/heads/master
tests/models.py
1
from django.db import models from django.utils import timezone def expensive_calculation(): expensive_calculation.num_runs += 1 return timezone.now() class Poll(models.Model): question = models.CharField(max_length=200) answer = models.CharField(max_length=200) pub_date = models.DateTimeField( ...
Korkki/django
refs/heads/master
django/db/backends/sqlite3/operations.py
180
from __future__ import unicode_literals import datetime import uuid from django.conf import settings from django.core.exceptions import FieldError, ImproperlyConfigured from django.db import utils from django.db.backends import utils as backend_utils from django.db.backends.base.operations import BaseDatabaseOperatio...
Teddy-Schmitz/temperature_admin
refs/heads/master
app/tasks.py
1
from apscheduler.schedulers.gevent import GeventScheduler from flask import current_app as app from models.event import Event, EventType from models.temperature import Temperature from app.extensions import arduino, db import arrow import logging sh = logging.StreamHandler() sh.setLevel(logging.INFO) logging.getLogger...
potatosushi/Discord-Notification-Bot
refs/heads/master
discord/opus.py
2
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2016 Rapptz 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 r...
StrellaGroup/erpnext
refs/heads/develop
erpnext/accounts/doctype/accounting_period/accounting_period.py
2
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ class OverlapError(frappe.ValidationError): pass class A...
tsdmgz/ansible
refs/heads/devel
test/units/modules/network/enos/test_enos_config.py
45
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
40223142/2015cad0623
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/unittest/loader.py
739
"""Loading unittests.""" import os import re import sys import traceback import types import functools from fnmatch import fnmatch from . import case, suite, util __unittest = True # what about .pyc or .pyo (etc) # we would need to avoid loading the same tests multiple times # from '.py', '.pyc' *and* '.pyo' VALID...
gqwest-erp/server
refs/heads/master
openerp/exceptions.py
76
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
mrkm4ntr/incubator-airflow
refs/heads/master
tests/core/test_example_dags_system.py
10
# # 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...
datacratic/StarCluster
refs/heads/vanilla_improvements
starcluster/commands/listzones.py
19
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster 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 # later ...
PythonNut/servo
refs/heads/master
tests/wpt/harness/wptrunner/browsers/firefox.py
24
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import subprocess import sys import mozinfo from mozprocess import ProcessHandler from mozprofile import Fire...
larsks/python-siggen
refs/heads/master
siggen/exc.py
1
class SynthError(Exception): pass class UnknownSynthType(SynthError): '''Raised if you attempt to instantiate a synth with an recognized 'type' key.''' pass class BootFailed(SynthError): '''This exception is raised if the PYO sound server fails to start.''' pass class MissingDevice(SynthErr...
MasterJames/three.js
refs/heads/dev
utils/exporters/blender/addons/io_three/exporter/api/mesh.py
1
""" Blender API for querying mesh data. Animation data is also handled here since Three.js associates the animation (skeletal, morph targets) with the geometry nodes. """ import operator import re from bpy import data, types, context from . import material, texture, animation from . import object as object_ from .. im...
plus-provenance/dataidentity
refs/heads/master
files/serializer.py
1
# Copyright [2013] [M. David Allen] # # 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 agr...
architecture-building-systems/CEAforArcGIS
refs/heads/master
cea/optimization/master/master_to_slave.py
2
""" Evaluation function of an individual """ import os import pandas as pd from cea.optimization import slave_data from cea.optimization.constants import * from cea.optimization.constants import DH_CONVERSION_TECHNOLOGIES_SHARE, DC_CONVERSION_TECHNOLOGIES_SHARE from cea.optimization.master import summarize_netwo...
AlbertoPeon/invenio
refs/heads/master
modules/miscutil/lib/upgrades/invenio_2013_06_11_rnkDOWNLOADS_file_format.py
24
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013 CERN. ## ## Invenio 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) a...
mbernasocchi/inasafe
refs/heads/develop
safe_extras/raven/transport/base.py
12
""" raven.transport.base ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import # Helper for external transports has_newstyle_transports = True class Transport(object): """ All ...
mitsei/dlkit
refs/heads/master
dlkit/json_/osid/settings.py
1
USERNAME = '' PASSWORD = ''
indhub/mxnet
refs/heads/master
python/mxnet/ndarray/op.py
47
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
jounex/hue
refs/heads/master
apps/oozie/src/oozie/migrations/0006_auto__chg_field_java_files__chg_field_java_archives__chg_field_sqoop_f.py
40
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Java.files' db.alter_column('oozie_java', 'files', self.gf('django.db.models.fields.TextField')(...
mazafrav/JdeRobot
refs/heads/master
src/libs/jderobotcomm_py/jderobotComm/motorsClient.py
1
import sys import Ice import rospy from .ice.motorsIceClient import MotorsIceClient if (sys.version_info[0] == 2): from .ros.publisherMotors import PublisherMotors def __getMotorsIceClient(ic, prefix): ''' Returns a Motors Ice Client. This function should never be used. Use getMotorsClient instead of this...