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
LiuWenJu/shadowsocks
shadowsocks/crypto/table.py
1044
8108
# !/usr/bin/env python # # Copyright 2015 clowwindy # # 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...
apache-2.0
elventear/ansible
lib/ansible/modules/windows/win_region.py
12
3845
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Ansible, 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 o...
gpl-3.0
djmaze/phantomjs
src/qt/qtwebkit/Tools/TestResultServer/generate_builders_json.py
119
4429
#!/usr/bin/env python # Copyright (C) 2011 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 ...
bsd-3-clause
liqi328/rjrepaircompany
django/conf/project_template/settings.py
150
5005
# Django settings for {{ project_name }} project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
bsd-3-clause
erkanay/django
django/core/management/commands/runserver.py
9
6725
from __future__ import unicode_literals from datetime import datetime import errno import os import re import sys import socket from django.core.management.base import BaseCommand, CommandError from django.core.servers.basehttp import run, get_internal_wsgi_application from django.db import connections, DEFAULT_DB_AL...
bsd-3-clause
mobo95/pyload
module/lib/feedparser.py
42
167083
#!/usr/bin/env python """Universal feed parser Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds Visit http://feedparser.org/ for the latest version Visit http://feedparser.org/docs/ for the latest documentation Required: Python 2.4 or later Recommended: CJKCodecs and iconv_codec <http://cjkpytho...
gpl-3.0
qubole/qds-sdk-py
qds_sdk/user.py
3
2855
from qds_sdk.qubole import Qubole from qds_sdk.resource import Resource import argparse import json class UserCmdLine: @staticmethod def parsers(): argparser = argparse.ArgumentParser( prog="qds.py user", description="User level operations for Qubole Data Service.") sub...
apache-2.0
wuhengzhi/chromium-crosswalk
build/android/emma_coverage_stats.py
23
18165
#!/usr/bin/python # Copyright 2015 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. """Generates incremental code coverage reports for Java code in Chromium. Usage: build/android/emma_coverage_stats.py -v --out <output ...
bsd-3-clause
coteyr/home-assistant
homeassistant/components/switch/transmission.py
2
2844
""" homeassistant.components.switch.transmission ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Enable or disable Transmission BitTorrent client Turtle Mode. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.transmission/ """ import logging from homea...
mit
chriskmanx/qmole
QMOLEDEV/protobuf-2.4.1/python/google/protobuf/internal/service_reflection_test.py
560
5127
#! /usr/bin/python # # 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: # # ...
gpl-3.0
dischinator/pyload
module/plugins/hoster/RemixshareCom.py
5
2094
# -*- coding: utf-8 -*- # # Test links: # http://remixshare.com/download/z8uli # # Note: # The remixshare.com website is very very slow, so # if your download not starts because of pycurl timeouts: # Adjust timeouts in /usr/share/pyload/module/network/HTTPRequest.py import re from module.plugins.internal.SimpleHoster...
gpl-3.0
drewandersonnz/openshift-tools
openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_openshift/library/oc_serviceaccount_secret.py
18
60388
#!/usr/bin/env python # pylint: disable=missing-docstring # flake8: noqa: T001 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ ...
apache-2.0
emesene/emesene
emesene/e3/xmpp/SleekXMPP/sleekxmpp/xmlstream/handler/base.py
14
2697
# -*- coding: utf-8 -*- """ sleekxmpp.xmlstream.handler.base ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Part of SleekXMPP: The Sleek XMPP Library :copyright: (c) 2011 Nathanael C. Fritz :license: MIT, see LICENSE for more details """ import weakref class BaseHandler(object): """ Base class for s...
gpl-3.0
xsunfeng/cir
cir/workbench_views.py
1
21105
import json from django.template.loader import render_to_string from django.http import HttpResponse from django.utils import timezone from cir.models import * import claim_views from cir.phase_control import PHASE_CONTROL import utils def api_load_all_documents(request): response = {} context = {} cont...
mit
charbeljc/server-tools
users_ldap_mail/users_ldap_model.py
51
2783
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Daniel Reis # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gen...
agpl-3.0
dhalperi/beam
sdks/python/apache_beam/runners/worker/logger_test.py
18
7354
# # 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
antonioUnina/neutron
neutron/tests/unit/api/rpc/handlers/test_dvr_rpc.py
26
2032
# Copyright (c) 2015 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 agreed to...
apache-2.0
luisfer85/newspaper
newspaper/newspaper/news/migrations/0002_auto_20170210_2109.py
1
1054
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('news', '0001_initial'), ] operations = [ migrations.CreateModel( name='Event', fields=[ ...
apache-2.0
dandygithub/kodi
addons/plugin.video.hdrezka.tv/requests/packages/urllib3/util/retry.py
64
13508
from __future__ import absolute_import import time import logging from collections import namedtuple from itertools import takewhile import email import re from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, InvalidHeader, ) from ..pack...
gpl-3.0
AsimmHirani/ISpyPi
tensorflow/contrib/tensorflow-master/tensorflow/contrib/cudnn_rnn/python/kernel_tests/cudnn_rnn_ops_benchmark.py
45
6944
# 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
tzewangdorje/SIPserv
Twisted-13.1.0/twisted/test/test_paths.py
3
53813
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases covering L{twisted.python.filepath}. """ from __future__ import division, absolute_import import os, time, pickle, errno, stat import contextlib from pprint import pformat from twisted.python.compat import _PY3 from twisted.pytho...
gpl-3.0
calfonso/ansible
lib/ansible/modules/cloud/rackspace/rax_cdb_database.py
102
4470
#!/usr/bin/python # 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', 'status': ['preview'], ...
gpl-3.0
sander76/home-assistant
tests/components/influxdb/test_sensor.py
5
17275
"""The tests for the InfluxDB sensor.""" from __future__ import annotations from dataclasses import dataclass from datetime import timedelta from unittest.mock import MagicMock, patch from influxdb.exceptions import InfluxDBClientError, InfluxDBServerError from influxdb_client.rest import ApiException import pytest f...
apache-2.0
ZobairAlijan/osf.io
website/addons/box/serializer.py
7
3568
from website.addons.base.serializer import OAuthAddonSerializer from website.util import api_url_for, web_url_for from box.client import BoxClient, BoxClientException class BoxSerializer(OAuthAddonSerializer): def credentials_owner(self, user_settings=None): return user_settings.owner or self.user_sett...
apache-2.0
MQQiang/kbengine
kbe/res/scripts/common/Lib/test/test_contextlib.py
80
25997
"""Unit tests for contextlib.py, and other context managers.""" import io import sys import tempfile import unittest from contextlib import * # Tests __all__ from test import support try: import threading except ImportError: threading = None class ContextManagerTestCase(unittest.TestCase): def test_con...
lgpl-3.0
wskplho/sl4a
python/src/Lib/test/test_macpath.py
55
2190
import macpath from test import test_support import unittest class MacPathTestCase(unittest.TestCase): def test_abspath(self): self.assert_(macpath.abspath("xx:yy") == "xx:yy") def test_isabs(self): isabs = macpath.isabs self.assert_(isabs("xx:yy")) self.assert_(isabs("xx:yy:...
apache-2.0
MyAOSP/external_chromium_org
third_party/closure_linter/closure_linter/requireprovidesorter.py
137
9826
#!/usr/bin/env python # # Copyright 2011 The Closure Linter Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
bsd-3-clause
bitcity/django
tests/backends/tests.py
59
47291
# -*- coding: utf-8 -*- # Unit and doctests for specific database backends. from __future__ import unicode_literals import copy import datetime import re import threading import unittest import warnings from decimal import Decimal, Rounded from django.conf import settings from django.core.exceptions import Improperly...
bsd-3-clause
GustavoHennig/ansible
lib/ansible/modules/clustering/consul_acl.py
66
11534
#!/usr/bin/python # # (c) 2015, Steve Gargan <steve.gargan@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...
gpl-3.0
jeffh/YACS
courses/south_migrations/0017_auto__del_unique_course_department_name_number.py
2
7503
# -*- 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): # Removing unique constraint on 'Course', fields ['department', 'name', 'number'] db.delete_unique('courses_...
mit
mlperf/training_results_v0.6
NVIDIA/benchmarks/ssd/implementations/pytorch/opt_loss_testing.py
4
1453
import torch from base_model import Loss from train import dboxes300_coco from opt_loss import OptLoss # In: # ploc : N x 8732 x 4 # plabel : N x 8732 # gloc : N x 8732 x 4 # glabel : N x 8732 data = torch.load('loss.pth') ploc = data['ploc'].cuda() plabel = data['plabel'].cuda() gloc = data['gloc'].cuda() glabe...
apache-2.0
j00bar/ansible
lib/ansible/modules/network/ovs/openvswitch_db.py
16
3948
#!/usr/bin/python # coding: utf-8 -*- # pylint: disable=C0111 # # (c) 2015, Mark Hamilton <mhamilton@vmware.com> # # Portions copyright @ 2015 VMware, Inc. # # This file is part of Ansible # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-3.0
tarikkdiry/Flock
sqlalchemy-workspace/lib/python2.7/site-packages/pip/utils/__init__.py
323
27187
from __future__ import absolute_import from collections import deque import contextlib import errno import io import locale # we have a submodule named 'logging' which would shadow this if we used the # regular name: import logging as std_logging import re import os import posixpath import shutil import stat import su...
bsd-3-clause
ArnossArnossi/django
tests/get_object_or_404/models.py
409
1133
""" 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...
bsd-3-clause
demisto/demisto-py
demisto_client/demisto_api/models/widget.py
1
19555
# coding: utf-8 """ Demisto API This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web clie...
apache-2.0
gangadharkadam/stfrappe
frappe/website/doctype/blog_post/test_blog_post.py
5
5182
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt """Use blog post test to test user permissions logic""" import frappe import frappe.defaults import unittest from frappe.core.page.user_permissions.user_permissions import add, remove, get_permissions from frappe.pe...
mit
shsingh/ansible
lib/ansible/modules/cloud/azure/azure_rm_mysqlfirewallrule.py
25
9716
#!/usr/bin/python # # Copyright (c) 2018 Zim Kalinowski, <zikalino@microsoft.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
Bismarrck/tensorflow
tensorflow/python/keras/utils/vis_utils.py
2
5253
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
amith01994/intellij-community
python/lib/Lib/site-packages/django/db/models/query.py
71
53653
""" The main QuerySet implementation. This provides the public API for the ORM. """ from itertools import izip from django.db import connections, router, transaction, IntegrityError from django.db.models.aggregates import Aggregate from django.db.models.fields import DateField from django.db.models.query_utils import...
apache-2.0
lwoydziak/caldav
tests/conf.py
2
1075
#!/usr/bin/env python # -*- encoding: utf-8 -*- try: from conf_private import caldav_servers except: caldav_servers = [] # caldav_servers.append({"url": "http://sogo1:sogo1@sogo-demo.inverse.ca:80/SOGo/dav/", "principal_url": "http://sogo-demo.inverse.ca:80/SOGo/dav/sogo1/", "backwards_compatibility_url": "ht...
gpl-3.0
erdc/proteus
proteus/tests/cylinder2D/sbm_3Dmesh/pressureincrement_p.py
1
1854
from builtins import object from math import * from proteus import * from proteus.default_p import * from cylinder import * #domain = ctx.domain #nd = ctx.nd name = "pressureincrement" #from ProjectionScheme import PressureIncrement #coefficients=PressureIncrement(rho_f_min = rho_1, # r...
mit
blahu/pynet-mat
AppliedPythonCourse/ANSIBLE/class5/eapilib-0.1.0/eapilib/__init__.py
2
1630
# # Copyright (c) 2014, Arista Networks, 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 condit...
apache-2.0
pomegranited/edx-platform
openedx/core/djangoapps/profile_images/tests/test_images.py
111
7026
""" Test cases for image processing functions in the profile image package. """ from contextlib import closing from itertools import product import os from tempfile import NamedTemporaryFile import unittest from django.conf import settings from django.core.files.uploadedfile import UploadedFile from django.test import...
agpl-3.0
noam-stratoscale/rackattack-api
py/rackattack/tcp/heartbeat.py
3
1173
import threading import logging import time HEARTBEAT_OK = "OK" class HeartBeat(threading.Thread): def __init__(self, client): self._client = client self._ids = [] threading.Thread.__init__(self) self.daemon = True threading.Thread.start(self) def register(self, id): ...
apache-2.0
nirmeshk/oh-mainline
vendor/packages/Django/tests/modeltests/m2m_intermediary/tests.py
112
1333
from __future__ import absolute_import from datetime import datetime from django.test import TestCase from django.utils import six from .models import Reporter, Article, Writer class M2MIntermediaryTests(TestCase): def test_intermeiary(self): r1 = Reporter.objects.create(first_name="John", last_name="S...
agpl-3.0
comocheng/RMG-Py
examples/cantherm/reactions/23dimethylpropoxy/dimetpropoxy_betasci.py
11
1275
#!/usr/bin/env python # encoding: utf-8 atoms = { 'C': 5, 'H': 11, 'O': 1 } bonds = {} linear = False externalSymmetry = 1 spinMultiplicity = 2 opticalIsomers = 1 energy = { 'M...
mit
spacewolf009/LoL-Stats-for-Discord
bot.py
1
2179
import discord import asyncio import re import json import magic8ball import player_stats client = discord.Client() USE_TTS = False @client.event async def on_ready(): print('Logged in as {}'.format(client.user.name)) print(client.user.id) print('------') bot_commands = { '!command...
mit
rmtew/peasauce
python/disassemblylib/capstone.py
1
10072
""" This module is intended to emulate Capstone, with the option of bringing in Capstone to do the work, if desirable. """ # mypy-lang support from typing import Iterator from . import util as disassemblylib_util CS_ARCH_ARM = 0 CS_ARCH_ARM64 = 1 CS_ARCH_MIPS = 2 CS_ARCH_X86 = 3 CS_ARCH_PPC = 4 CS_ARCH_SPARC = 5 CS_...
mit
whs/django
tests/m2m_through/models.py
72
4434
from datetime import datetime from django.db import models # M2M described on one of the models class Person(models.Model): name = models.CharField(max_length=128) class Meta: ordering = ('name',) def __str__(self): return self.name class Group(models.Model): name = models.CharFie...
bsd-3-clause
google-research/google-research
state_of_sparsity/sparse_transformer/layers/common_init.py
1
2263
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
manish211/mase
python101/code/Threader.py
14
1664
"""This code is for an exercise from Think Python: An Introduction to Software Design Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html This program requires Gui.py, which is part of Swampy; you can download it from thinkpython.com/swampy. """ from swampy.Gui import Callable fro...
unlicense
rofehr/linux-wetek
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
pyKy/kivy-doc-ja
kivy/core/spelling/spelling_osxappkit.py
21
2463
''' AppKit Spelling: Implements spelling backend based on OSX's spellchecking features provided by the ApplicationKit. NOTE: Requires pyobjc and setuptools to be installed! `sudo easy_install pyobjc setuptools` Developers shoul...
mit
uannight/reposan
plugin.video.tvalacarta/lib/youtube_dl/extractor/iqiyi.py
1
13308
# coding: utf-8 from __future__ import unicode_literals import hashlib import itertools import re import time from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse_urlencode, ) from ..utils import ( clean_html, decode_packed_codes, get_element_by_id, get_elem...
gpl-2.0
rsepassi/tensor2tensor
tensor2tensor/data_generators/dna_encoder_test.py
1
1771
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
apache-2.0
ssomenzi/silence
node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
1843
1786
#!/usr/bin/env python # 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. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
agpl-3.0
hvdieren/parsec-swan
pkgs/libs/libxml2/src/python/tests/reader6.py
87
2600
#!/usr/bin/python -u # # this tests the entities substitutions with the XmlTextReader interface # import sys import StringIO import libxml2 schema="""<element name="foo" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <oneOrMore> <element name="l...
bsd-3-clause
bastianh/zulip
api/integrations/perforce/zulip_perforce_config.py
124
2608
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2014 Zulip, 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 #...
apache-2.0
TimothyVandenbrande/ansible-modules-extras
notification/hipchat.py
29
6557
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
Vanuan/gpx_to_road_map
biagoni2012/spatialfunclib.py
1
6295
# # Spatial function library. # Author: James P. Biagioni (jbiagi1@uic.edu) # Company: University of Illinois at Chicago # Created: 3/3/10 # import math # # Global constants. # METERS_PER_DEGREE_LATITUDE = 111070.34306591158 METERS_PER_DEGREE_LONGITUDE = 83044.98918812413 EARTH_RADIUS = 6371000.0 # meters # # Return...
apache-2.0
tbutter/zulip
zerver/lib/response.py
124
1316
from __future__ import absolute_import from django.http import HttpResponse, HttpResponseNotAllowed import ujson class HttpResponseUnauthorized(HttpResponse): status_code = 401 def __init__(self, realm): HttpResponse.__init__(self) self["WWW-Authenticate"] = 'Basic realm="%s"' % (realm,) def...
apache-2.0
batxes/4c2vhic
Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/Six_mouse_models38863.py
4
18200
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
BoGoEngine/bogo-win
bogo/accent.py
1
3731
# -*- coding: utf-8 -*- # # This file is part of ibus-bogo project. # # Copyright (C) 2012 Long T. Dam <longdt90@gmail.com> # Copyright (C) 2012-2013 Trung Ngo <ndtrung4419@gmail.com> # Copyright (C) 2013 Duong H. Nguyen <cmpitg@gmail.com> # # ibus-bogo is free software: you can redistribute it and/or modify # it under...
gpl-3.0
ajaali/django
django/core/management/commands/loaddata.py
294
12977
from __future__ import unicode_literals import glob import gzip import os import warnings import zipfile from itertools import product from django.apps import apps from django.conf import settings from django.core import serializers from django.core.exceptions import ImproperlyConfigured from django.core.management.b...
bsd-3-clause
YunYinORG/social
model/user.py
2
1522
#!/usr/bin/env python # coding=utf-8 from db import Model, db """todo : 临时账号和云印账号数据合并""" __doc__ = "用户数据库层封装" _table = 'user' userModel = Model(_table) def merge(phone_id, card_id): """手机临时账号和校园卡账号合并""" record_table = 'record' t = db.transaction() phone_id, card_id = int(phone_id), int(card_id) #...
apache-2.0
cchurch/ansible
lib/ansible/modules/cloud/amazon/iam_role.py
7
24072
#!/usr/bin/python # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: iam_role short_description: Manage ...
gpl-3.0
kernel-sanders/arsenic-mobile
Dependencies/Twisted-13.0.0/doc/core/examples/dbcred.py
19
6869
#!/usr/bin/env python # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Simple example of a db checker: define a L{ICredentialsChecker} implementation that deals with a database backend to authenticate a user. """ from twisted.cred import error from twisted.cred.credentials import IUsername...
gpl-3.0
jmehnle/ansible
lib/ansible/modules/network/cloudengine/ce_ospf.py
46
35013
#!/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
ppwwyyxx/tensorflow
tensorflow/python/autograph/core/naming.py
11
4124
# Copyright 2017 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
mdhaber/scipy
scipy/optimize/_basinhopping.py
12
30791
""" basinhopping: The basinhopping global optimization algorithm """ import numpy as np import math from numpy import cos, sin import scipy.optimize from scipy._lib._util import check_random_state __all__ = ['basinhopping'] class Storage: """ Class used to store the lowest energy structure """ def __...
bsd-3-clause
arenadata/ambari
ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
1
21005
#!/usr/bin/env python """ 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");...
apache-2.0
Savahi/tnn
tnn/calib/trade.py
1
4263
from tnn.io import prepareData, loadNetwork import numpy as np import sys from tnn.calib import graph from tnn.network import Network #from tnn.boosting import aggregate from tnn.data_handler.RTS_Ret_Vol_Mom_Sto_RSI_SMA_6 import calc_data def simple_sum(threshold = 2): def f(decisions): d = sum(decisions) if d >=...
mit
Djabbz/scikit-learn
sklearn/datasets/samples_generator.py
103
56423
""" Generate samples of synthetic data sets. """ # Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel, # G. Louppe, J. Nothman # License: BSD 3 clause import numbers import array import numpy as np from scipy import linalg import scipy.sparse as sp from ..preprocessing import MultiLabelBin...
bsd-3-clause
timduru/platform-external-chromium_org
tools/telemetry/telemetry/page/record_wpr.py
23
4261
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import sys import tempfile import time from telemetry import test from telemetry.core import browser_optio...
bsd-3-clause
mjamesruggiero/tripp
tests/test_hypothesis.py
1
1253
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import random from .context import tripp from tripp import hypothesis import logging logging.basicConfig(level=logging.INFO, format="%(lineno)d\t%(message)s") class TestHypothesis(unittest.TestCase): def test_normal_approximation_to_binomial(self):...
bsd-3-clause
roadmapper/ansible
lib/ansible/modules/cloud/vmware/vmware_host_active_directory.py
21
17701
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de> # # 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 = { 'met...
gpl-3.0
40223137/150601
static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/color.py
603
4330
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
agpl-3.0
apigee/edx-platform
common/djangoapps/student/management/commands/anonymized_id_mapping.py
11
2427
# -*- coding: utf-8 -*- """Dump username, per-student anonymous id, and per-course anonymous id triples as CSV. Give instructors easy access to the mapping from anonymized IDs to user IDs with a simple Django management command to generate a CSV mapping. To run, use the following: ./manage.py lms anonymized_id_mappin...
agpl-3.0
Menooker/gem5_pcm
src/arch/x86/isa/insts/simd128/floating_point/logical/orp.py
91
3181
# 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
mjg/PyX
design/invalid4.py
2
1412
#!/usr/bin/env python import sys;sys.path.insert(0, "..") from math import * from pyx import * # File for invalid parametrisations of Bezier curves # Check a-posteriori the sign of Delta y for the square-root solution of Delta x def Dx_m(y): return (-1-2*y-sqrt((1+2*y)**2+3))/3.0 def Dx_p(y): return (-1-2*y+sq...
gpl-2.0
qq2588258/floweers
libs/external/emscripten/third_party/ply/test/lex_closure.py
174
1119
# ----------------------------------------------------------------------------- # lex_closure.py # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.lex as lex tokens = ( 'NAME','NUMBER', 'PLUS','MINUS',...
mit
kc4271/batch_downloader
requests/sessions.py
294
22290
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Or...
mit
Jgarcia-IAS/localizacion
openerp/addons-extra/odoo-pruebas/odoo-server/addons/report/models/abstract_report.py
96
2900
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
sahiljain/catapult
third_party/gsutil/third_party/boto/tests/integration/s3/test_https_cert_validation.py
111
6023
# Copyright 2011 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...
bsd-3-clause
bregman-arie/ansible
lib/ansible/parsing/mod_args.py
46
12036
# (c) 2014 Michael DeHaan, <michael@ansible.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 ve...
gpl-3.0
nomadcube/scikit-learn
doc/sphinxext/numpy_ext/numpydoc.py
413
6182
""" ======== 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...
bsd-3-clause
ageron/tensorflow
tensorflow/contrib/slim/__init__.py
101
2359
# 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
plantdiet/plantdiet.github.io
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
542
45270
# 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. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
mit
kobejean/tensorflow
tensorflow/python/kernel_tests/scatter_ops_test.py
4
11254
# 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
MphasisWyde/eWamSublimeAdaptor
POC/v0_3_POC_with_project_aborted/third-party/requests/packages/chardet/sbcsgroupprober.py
2936
3291
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
killpanda/Ailurus
ailurus/common/tips.py
1
7954
#coding: utf-8 # # Ailurus - a simple application installer and GNOME tweaker # # Copyright (C) 2009-2010, Ailurus developers and Ailurus contributors # Copyright (C) 2007-2010, Trusted Digital Technology Laboratory, Shanghai Jiao Tong University, China. # # Ailurus is free software; you can redistribute it and/or modi...
gpl-2.0
bolkedebruin/airflow
airflow/contrib/hooks/aws_hook.py
1
1196
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
t0mm0/youtube-dl
youtube_dl/extractor/aljazeera.py
95
1253
from __future__ import unicode_literals from .common import InfoExtractor class AlJazeeraIE(InfoExtractor): _VALID_URL = r'http://www\.aljazeera\.com/programmes/.*?/(?P<id>[^/]+)\.html' _TEST = { 'url': 'http://www.aljazeera.com/programmes/the-slum/2014/08/deliverance-201482883754237240.html', ...
unlicense
mainakibui/kobocat
onadata/apps/main/google_export.py
13
2853
import gdata.client import gdata.docs.data import gdata.docs.client import gdata.gauth from gdata.spreadsheets import client from django.core.urlresolvers import reverse from django.http import HttpResponse from django.http import HttpResponseRedirect from onadata.apps.main.models import TokenStorageModel from onadat...
bsd-2-clause
alexconlin/three.js
utils/build/build.py
53
3356
#!/usr/bin/env python import sys if sys.version_info < (2, 7): print("This script requires at least Python 2.7.") print("Please, update to a newer version: http://www.python.org/download/releases/") # exit() import argparse import json import os import shutil import tempfile from io import open def main(argv=Non...
mit
parsenz/django-taxbot
taxbot/taxes.py
1
7884
from decimal import Decimal from django.db import models CURRENCY_DICT = { 'CA': 'CAD', 'US': 'USD', 'NG': 'NGN', 'GB': 'GBP' } # Countries with Simple Taxes SIMPLE_TAX_COUNTRIES = { 'GB': 'GREAT BRITAIN', 'NG': 'NIGERIA' } # Countries which do not have their # taxes broken up by city. Do not include # a cou...
bsd-3-clause
wbrefvem/heroku-buildpack-python
vendor/pip-pop/pip/req/req_file.py
239
9670
""" Requirements file parsing """ from __future__ import absolute_import import os import re import shlex import optparse from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves import filterfalse import pip from pip.download import get_file_content from pip.req.req_install import ...
mit
tropp/acq4
acq4/pyqtgraph/GraphicsScene/exportDialogTemplate_pyside.py
53
3149
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './pyqtgraph/GraphicsScene/exportDialogTemplate.ui' # # Created: Mon Dec 23 10:10:53 2013 # by: pyside-uic 0.2.14 running on PySide 1.1.2 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class U...
mit
yoer/hue
desktop/libs/indexer/src/indexer/controller.py
9
11152
#!/usr/bin/env python # -- coding: utf-8 -- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (th...
apache-2.0
FRidh/python-acoustics
acoustics/quantity.py
3
2707
""" Quantities and units ==================== The Quantity module provides two classes to work with quantities and units. .. inheritance-diagram:: acoustics.quantity """ from acoustics.standards.iso_tr_25417_2007 import REFERENCE_PRESSURE quantities = { 'pressure' : ('Pressure', 'pascal', True, 'p', '$p$', RE...
bsd-3-clause