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
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
flask/lib/python2.7/site-packages/bs4/tests/test_soup.py
62
20345
# -*- coding: utf-8 -*- """Tests of Beautiful Soup as a whole.""" from pdb import set_trace import logging import unittest import sys import tempfile from bs4 import ( BeautifulSoup, BeautifulStoneSoup, ) from bs4.element import ( CharsetMetaAttributeValue, ContentMetaAttributeValue, SoupStrainer,...
mit
regular/pyglet-avbin-optimizations
pyglet/gl/lib_wgl.py
1
5718
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
bsd-3-clause
pomegranited/edx-platform
lms/djangoapps/instructor/access.py
16
3036
""" Access control operations for use by instructor APIs. Does not include any access control, be sure to check access before calling. TO DO sync instructor and staff flags e.g. should these be possible? {instructor: true, staff: false} {instructor: true, staff: true} """ import logging from djan...
agpl-3.0
espadrine/opera
chromium/src/third_party/closure_linter/closure_linter/error_check.py
137
3620
#!/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
ololobster/cvidone
localization/make_l10n.py
1
2994
# Licensed under The MIT License. # For full copyright and license information, please see the LICENSE.txt. import os import sys import codecs warning = "<!-- Generated automatically by make_l10n.py. Think twice before edit. -->" if (4 != len(sys.argv)): print("Usage:") print("./make_l10n.py <source directory...
mit
cisco-openstack/tempest
tempest/common/utils/linux/remote_client.py
2
8848
# 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 # d...
apache-2.0
chris-wood/python-mingus
mingus/extra/lilypond.py
8
7330
#!/usr/bin/python # -*- coding: utf-8 -*- # mingus - Music theory Python package, lilypond module. # Copyright (C) 2008-2009, Bart Spaans # # 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 Fo...
gpl-3.0
ablab/rectangles
bigraph.py
1
37881
from abstract_graph import Abstract_Graph, Abstract_Edge, Abstract_Vertex import abstract_graph import os import saveparser import experimental import graph import logging import cStringIO import itertools from test_util import TestUtils from rectangle import Rectangle from utils import conjugate import utils DEEP_T...
gpl-2.0
Kri-7-q/glimpse_client-1
3rdparty/breakpad/src/tools/gyp/test/mac/gyptest-xcode-env-order.py
24
2704
#!/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. """ Verifies that dependent Xcode settings are processed correctly. """ import TestGyp import sys if sys.platform == 'darwin': test = T...
bsd-3-clause
tedder/ansible
lib/ansible/modules/cloud/digital_ocean/digital_ocean_snapshot_facts.py
29
4965
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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__ = ty...
gpl-3.0
ROMFactory/android_external_chromium_org
tools/telemetry/telemetry/core/tab_unittest.py
23
3350
# 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 time from telemetry.core import util from telemetry.core import exceptions from telemetry.unittest import tab_test_case ...
bsd-3-clause
hoangt/goblin-core
llvm/3.4.2/llvm-3.4.2.src/utils/lint/common_lint.py
147
2589
#!/usr/bin/python # # Common lint functions applicable to multiple types of files. import re def VerifyLineLength(filename, lines, max_length): """Checks to make sure the file has no lines with lines exceeding the length limit. Args: filename: the file under consideration as string lines: contents of t...
bsd-3-clause
40223142/cda11
static/Brython3.1.0-20150301-090019/Lib/test/test_int.py
765
12587
import sys import unittest from test.support import run_unittest L = [ ('0', 0), ('1', 1), ('9', 9), ('10', 10), ('99', 99), ('100', 100), ('314', 314), (' 314', 314), ('314 ', 314), (' \t\t 314 \t\t ', 314), (repr(sys.maxsize...
gpl-3.0
dongjoon-hyun/incubator-reef
dev/release.py
13
5542
# 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...
apache-2.0
elkingtonmcb/rethinkdb
test/interface/artificial_table.py
27
2328
#!/usr/bin/env python # Copyright 2014-2015 RethinkDB, all rights reserved. '''This runs a bunch of the ReQL tests against the `rethinkdb._debug_scratch` artificial table to check that `artificial_table_t` works properly.''' from __future__ import print_function import os, subprocess, sys, time startTime = time.tim...
agpl-3.0
philippjfr/bokeh
bokeh/sphinxext/bokeh_sitemap.py
9
1661
""" Generate a ``sitemap.txt`` to aid with search indexing. ``sitemap.txt`` is a plain text list of all the pages in the docs site. Each URL is listed on a line in the text file. It is machine readable and used by search engines to know what pages are available for indexing. All that is required to generate the sitem...
bsd-3-clause
shakamunyi/tensorflow
tensorflow/python/kernel_tests/distributions/student_t_test.py
76
19957
# 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
stansonhealth/ansible-modules-core
packaging/os/yum.py
7
38851
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2012, Red Hat, Inc # Written by Seth Vidal <skvidal at fedoraproject.org> # (c) 2014, Epic Games, 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 publi...
gpl-3.0
enjaz/enjaz
academy/migrations/0005_Temporary_Stats.py
2
1170
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('academy', '0004_edit_work'), ] operations = [ migrations.CreateModel( name='Temporary_Stats', fields...
agpl-3.0
wangyou/XX-Net
code/default/gae_proxy/server/lib/google/appengine/api/xmpp/xmpp_service_pb.py
16
40692
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
bsd-2-clause
tanmaythakur/django
django/contrib/gis/db/backends/mysql/introspection.py
700
1771
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. ...
bsd-3-clause
nivertius/remoteable
server.py
1
3563
import json import logging import uuid from remoteable.command import Command __all__ = ('RemotingActual', 'RemotingHandler', 'RemotingServer', 'ThreadedRemotingServer') class RemotingActual(object): def __init__(self, name, exports = None): self._logger = logging.getLogger("remoting.actual.%s" % name) self._e...
bsd-2-clause
commonwealth-of-puerto-rico/lean
paart/apps/infrastructure/forms.py
2
4611
from __future__ import absolute_import import datetime from django import forms from common.forms import DetailForm, ROFormMixin, Select2FormMixin from .models import (Project, ProjectFile)#, ProjectInfo, ProjectBudget, ProjectFile) class ProjectForm_edit(forms.ModelForm, ROFormMixin): readonly_fields = ('age...
gpl-3.0
randynobx/ansible
lib/ansible/modules/storage/zfs/zpool_facts.py
69
6653
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Adam Števko <adam.stevko@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 L...
gpl-3.0
cypsun/FreeCAD
src/Mod/OpenSCAD/colorcodeshapes.py
29
4659
#*************************************************************************** #* * #* Copyright (c) 2012 Sebastian Hoogen <github@sebastianhoogen.de> * #* * #* This pr...
lgpl-2.1
with-git/tensorflow
tensorflow/python/kernel_tests/split_op_test.py
38
12123
# 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
sharkykh/SickRage
lib/oauthlib/oauth1/rfc5849/errors.py
87
2543
# coding=utf-8 """ oauthlib.oauth1.rfc5849.errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error used both by OAuth 1 clients and provicers to represent the spec defined error responses for all four core grant types. """ from __future__ import unicode_literals from oauthlib.common import urlencode, add_params_to_uri class O...
gpl-3.0
Tesora-Release/tesora-trove
trove/common/apischema.py
1
22361
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
apache-2.0
aacole/ursula-monitoring
sensu/plugins/metrics-nova-project-usage.py
2
2388
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import sys import time import argparse import traceback from datetime import datetime, timedelta import shade import novaclient OK = 0 WARNING = 1 CRITICAL = 2 UNKNOWN = 3 class CloudMetrics(object): def __init__(self): ...
apache-2.0
harmy/kbengine
kbe/res/scripts/common/Lib/idlelib/tabbedpages.py
3
18659
"""An implementation of tabbed pages using only standard Tkinter. Originally developed for use in IDLE. Based on tabpage.py. Classes exported: TabbedPageSet -- A Tkinter implementation of a tabbed-page widget. TabSet -- A widget containing tabs (buttons) in one or more rows. """ from tkinter import * cla...
lgpl-3.0
kmonsoor/pyglet
pyglet/canvas/carbon.py
39
8766
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' from pyglet import app from base import Display, Screen, ScreenMode, Canvas from pyglet.libs.darwin import * from pyglet.libs.darwin import _oscheck class CarbonDisplay(Display): # TODO: CarbonDisplay could be per display d...
bsd-3-clause
ToonTownInfiniteRepo/ToontownInfinite
Panda3D-1.9.0/direct/controls/ControlManager.py
11
14176
from direct.showbase.InputStateGlobal import inputState #from DirectGui import * #from PythonUtil import * #from IntervalGlobal import * #from otp.avatar import Avatar from direct.directnotify import DirectNotifyGlobal #import GhostWalker #import GravityWalker #import NonPhysicsWalker #import PhysicsWalker #if __debu...
mit
wasade/qiime
scripts/ampliconnoise.py
1
7975
#!/usr/bin/env python # File created on 20 Jun 2011 from __future__ import division __author__ = "Justin Kuczynski" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Justin Kuczynski", "Jose A. Navas Molina"] __license__ = "GPL" __version__ = "1.8.0-dev" __maintainer__ = "Justin Kuczynski" __email__ ...
gpl-2.0
araisrobo/machinekit
src/hal/user_comps/vismach/hbmgui.py
25
13177
#!/usr/bin/python2.4 # # Visulization model of a Horizontal Boring Mill with quill # # Copyright 2007 John Kasunich # Derived from a work by John Kasunich, Jeff Epler, and Chris Radek # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
lgpl-2.1
kubeflow/kfp-tekton-backend
sdk/python/kfp/components/structures/kubernetes/v1.py
1
16372
__all__ = [ 'Container', 'PodArgoSubset', ] from collections import OrderedDict from typing import Any, Dict, List, Mapping, Optional, Sequence, Union from ...modelbase import ModelBase class EnvVar(ModelBase): _serialized_names = { 'value_from': 'valueFrom', } def __init__(self, ...
apache-2.0
candy7393/VTK
ThirdParty/Twisted/twisted/conch/ssh/agent.py
59
9556
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implements the SSH v2 key agent protocol. This protocol is documented in the SSH source code, in the file U{PROTOCOL.agent<http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.agent>}. Maintainer: Paul Swartz """ import struct fr...
bsd-3-clause
adelomana/cassandra
conditionedFitness/figurePatterns/script.sustained.py
2
1771
import pickle import statsmodels,statsmodels.api import matplotlib,matplotlib.pyplot matplotlib.rcParams.update({'font.size':36,'font.family':'Arial','xtick.labelsize':28,'ytick.labelsize':28}) thePointSize=12 # 0. user defined variables jarDir='/Users/adriandelomana/scratch/' # sustained trajectories selected=['clon...
gpl-3.0
jeffdwyatt/taiga-back
taiga/projects/votes/serializers.py
8
1271
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014 Anler Hernández <hello@anler.me> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
TalShafir/ansible
lib/ansible/plugins/terminal/__init__.py
106
4365
# # (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...
gpl-3.0
HashUnlimited/Einsteinium-Unlimited
qa/rpc-tests/test_framework/bignum.py
123
1929
#!/usr/bin/env python3 # # bignum.py # # This file is copied from python-bitcoinlib. # # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # """Bignum routines""" import struct # generic big endian MPI format def bn_bytes(v, have...
mit
ptesarik/crash-python
crash/types/task.py
1
9970
# -*- coding: utf-8 -*- # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: from __future__ import print_function from __future__ import absolute_import from __future__ import division import gdb import sys if sys.version_info.major >= 3: long = int from crash.util import array_size from crash.infra im...
gpl-2.0
hoangt/goblin-core
riscv/llvm/3.5/llvm-3.5.0.src/utils/lit/tests/shtest-format.py
56
2520
# Check the various features of the ShTest format. # # RUN: not %{lit} -j 1 -v %{inputs}/shtest-format > %t.out # RUN: FileCheck < %t.out %s # # END. # CHECK: -- Testing: # CHECK: PASS: shtest-format :: argv0.txt # CHECK: FAIL: shtest-format :: external_shell/fail.txt # CHECK-NEXT: *** TEST 'shtest-format :: external...
bsd-3-clause
dsvalenciah/sanic-rest
app.py
1
2542
# bultin library from uuid import uuid4 # external libraries from sanic import Sanic from sanic.views import HTTPMethodView from sanic.response import json from sanic_cors import CORS app = Sanic() """ POST /tasks GET /tasks GET /task/<id> PUT /task/<id> """ DATOS = {} class TaskList(HTTPMethodView): def po...
mit
npiganeau/odoo
addons/crm_partner_assign/report/__init__.py
443
1096
# -*- 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
s2nner/py_test
api/v1.py
1
1300
from flask import Flask, Blueprint, request, jsonify from flask_restful import reqparse, abort, Api, Resource from api.auth import Signup, Signin parser = reqparse.RequestParser() # parser.add_argument('username', type=str, location='json') # json_data = request.get_json(force=True) API_VERSION_V1 = 1 API_VERSION = A...
mit
mdboom/jwst_lib.models
jwst_lib/models/dynamicdq.py
1
1162
import numpy as np from . import dqflags def dynamic_mask(input_model): # # Return a mask model given a mask with dynamic DQ flags # Dynamic flags define what each plane refers to using the DQ_DEF extension dq_table = input_model.dq_def # Get the DQ array and the flag definitions if (dq_table ...
bsd-3-clause
capriele/crazyflie-clients-python-move
lib/cflib/drivers/__init__.py
40
1166
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
gpl-2.0
jboeuf/grpc
src/python/grpcio_tests/tests_aio/unit/timeout_test.py
12
6674
# Copyright 2020 The 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 law or agreed to in writ...
apache-2.0
StackVista/hbase
hbase-examples/src/main/python/thrift2/DemoClient.py
31
2493
""" 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 ...
apache-2.0
UCHIC/h2outility
src/Utilities/H2OServices.py
1
19597
import datetime from exceptions import IOError from threading import Thread import jsonpickle import sys from wx.lib.pubsub import pub # from pubsub import pub from GAMUTRawData.odmservices import ServiceManager from H2OSeries import OdmSeriesHelper from Common import APP_SETTINGS, InitializeDirectories from Utilitie...
bsd-3-clause
vinodkc/spark
examples/src/main/python/ml/robust_scaler_example.py
27
1600
# # 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
bkahlert/seqan-research
raw/pmbs12/pmsb13-data-20120615/trunk/misc/seqan_instrumentation/py2exe/dist/classes/requests/packages/oreos/structures.py
47
13199
# -*- coding: utf-8 -*- """ oreos.structures ~~~~~~~~~~~~~~~~ The plastic blue packaging. This is mostly directly stolen from mitsuhiko/werkzeug. """ __all__ = ('MultiDict',) class _Missing(object): def __repr__(self): return 'no value' def __reduce__(self): return '_missing' _missing = ...
mit
axinging/chromium-crosswalk
tools/json_to_struct/element_generator_test.py
38
8079
#!/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. from element_generator import GenerateFieldContent from element_generator import GenerateElements import unittest class ElementGen...
bsd-3-clause
snargledorf/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/__init__.py
168
1055
######################## BEGIN LICENSE BLOCK ######################## # This library 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 2.1 of the License, or (at your option) any later ve...
lgpl-2.1
superhuahua/xunfengES
celerynode/vuldb/axis_config_read.py
4
1509
# coding:utf-8 import re import urllib2 def get_plugin_info(): plugin_info = { "name": "Axis2任意文件读取", "info": "通过此漏洞可以读取配置文件等信息,进而登陆控制台,通过部署功能可直接获取服务器权限。", "level": "高危", "type": "任意文件读取", "author": "wolf@YSRC", "url": "http://www.securityfocus.com/bid/40343/info", ...
gpl-3.0
laayis/yowsup
yowsup/layers/protocol_groups/structs/group.py
59
1287
class Group(object): def __init__(self, groupId, creatorJid, subject, subjectOwnerJid, subjectTime, creationTime, participants=None): self._groupId = groupId self._creatorJid = creatorJid self._subject = subject self._subjectOwnerJid = subjectOwnerJid ...
gpl-3.0
crdoconnor/olympia
apps/stats/tests/test_views.py
13
34435
# -*- coding: utf-8 -*- import csv import datetime import json import mock from nose.tools import eq_ from pyquery import PyQuery as pq import amo.tests from amo.urlresolvers import reverse from access.models import Group, GroupUser from addons.models import Addon from bandwagon.models import Collection from stats im...
bsd-3-clause
jirikuncar/invenio
invenio/testsuite/test_legacy_dbquery.py
12
5134
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013, 2015 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 # Li...
gpl-2.0
xinwu/horizon
openstack_dashboard/dashboards/project/connections/network_template/tests.py
12
34711
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
kansanmuisti/kamu
utils/http_cache.py
1
1334
# -*- coding: utf-8 -*- import os import urllib.request, urllib.error, urllib.parse import hashlib cache_dir = None def set_cache_dir(dir): global cache_dir cache_dir = dir def create_path_for_file(fname): dirname = os.path.dirname(fname) if not os.path.exists(dirname): os.makedirs(dirname) ...
agpl-3.0
deokjinkim/servo
tests/wpt/harness/wptrunner/executors/executorservo.py
14
7768
# 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 base64 import hashlib import json import os import subprocess import tempfile import threading import urlparse im...
mpl-2.0
linktlh/Toontown-journey
otp/level/EntityCreatorAI.py
5
1487
import EntityCreatorBase import LogicGate import EditMgrAI import LevelMgrAI import ZoneEntityAI from direct.showbase.PythonUtil import Functor def createDistributedEntity(AIclass, level, entId, zoneId): ent = AIclass(level, entId) ent.generateWithRequired(zoneId) return ent def createLocalEntity(AIclass...
apache-2.0
hdinsight/hue
desktop/core/ext-py/boto-2.38.0/boto/cloudsearch2/document.py
136
11630
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 r...
apache-2.0
stephane-martin/salt-debian-packaging
salt-2016.3.3/salt/proxy/esxi.py
3
14544
# -*- coding: utf-8 -*- ''' Proxy Minion interface module for managing VMWare ESXi hosts. .. versionadded:: 2015.8.4 **Special Note: SaltStack thanks** `Adobe Corporation <http://adobe.com/>`_ **for their support in creating this Proxy Minion integration.** This proxy minion enables VMware ESXi (hereafter referred t...
apache-2.0
hamish/SmeltCMS
packages/markupsafe/_native.py
1243
1187
# -*- coding: utf-8 -*- """ markupsafe._native ~~~~~~~~~~~~~~~~~~ Native Python implementation the C module is not compiled. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from markupsafe import Markup from markupsafe._compat import text_type def escape(...
gpl-3.0
memsql/memsql-loader
memsql_loader/util/servers.py
1
1107
import atexit import errno import os from memsql_loader.util import paths def get_pid_file_path(): return os.path.join(paths.get_data_dir(), "memsql-loader.pid") def delete_pid_file(): try: os.remove(get_pid_file_path()) except Exception: pass def write_pid_file(): atexit.register(de...
apache-2.0
mnahm5/django-estore
Lib/site-packages/braintree/merchant_gateway.py
4
1221
from braintree.error_result import ErrorResult from braintree.resource import Resource from braintree.resource_collection import ResourceCollection from braintree.successful_result import SuccessfulResult from braintree.exceptions.not_found_error import NotFoundError from braintree.merchant import Merchant from braintr...
mit
watchamakulit02/namebench
nb_third_party/dns/rdata.py
215
14860
# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
peterfpeterson/mantid
Framework/PythonInterface/plugins/algorithms/CreateEmptyTableWorkspace.py
3
1342
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + #pyl...
gpl-3.0
munhanha/mtg-random
django/db/models/__init__.py
248
1500
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured from django.db import connection from django.db.models.loading import get_apps, get_app, get_models, get_model, register_models from django.db.models.query import Q from django.db.models.expressions import F fro...
bsd-3-clause
vadimtk/chrome4sdp
tools/telemetry/third_party/png/png.py
161
157814
#!/usr/bin/env python # $URL$ # $Rev$ # png.py - PNG encoder/decoder in pure Python # # Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org> # Portions Copyright (C) 2009 David Jones <drj@pobox.com> # And probably portions Copyright (C) 2006 Nicko van Someren <nicko@nicko.org> # # Original concept by Johann...
bsd-3-clause
nlevitt/youtube-dl
youtube_dl/extractor/breakcom.py
35
1866
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..utils import ( int_or_none, parse_age_limit, ) class BreakIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?break\.com/video/(?:[^/]+/)*.+-(?P<id>\d+)' _TESTS = [{ 'url': 'http://www.break...
unlicense
kostaspl/SpiderMonkey38
python/requests/requests/cookies.py
821
16686
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import time import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading # grr, pyflakes: this fixes...
mpl-2.0
jjas0nn/solvem
tensorflow/lib/python2.7/site-packages/tensorflow/contrib/bayesflow/python/ops/stochastic_graph.py
6
6355
# 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...
mit
rowemoore/odoo
addons/purchase_requisition/wizard/bid_line_qty.py
374
1711
# -*- 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
timonwong/OmniMarkupPreviewer
OmniMarkupLib/Renderers/libs/python2/docutils/utils/math/math2html.py
106
174512
#! /usr/bin/env python # -*- coding: utf-8 -*- # math2html: convert LaTeX equations to HTML output. # # Copyright (C) 2009-2011 Alex Fernández # # Released under the terms of the `2-Clause BSD license'_, in short: # Copying and distribution of this file, with or without modification, # are permitted in any m...
mit
heartsucker/securedrop
securedrop/tests/migrations/migration_e0a525cbab83.py
4
5664
# -*- coding: utf-8 -*- import random import string import uuid from sqlalchemy import text from sqlalchemy.exc import NoSuchColumnError from db import db from journalist_app import create_app from .helpers import (random_bool, random_bytes, random_chars, random_datetime, random_username, bool_...
agpl-3.0
laufercenter/meld
meld/system/openmm_runner/runner.py
1
34742
# # Copyright 2015 by Justin MacCallum, Alberto Perez, Ken Dill # All rights reserved # from simtk.openmm.app import AmberPrmtopFile, OBC2, GBn, GBn2, Simulation from simtk.openmm.app import forcefield as ff from simtk.openmm import LangevinIntegrator, Platform, CustomExternalForce from simtk.unit import kelvin, picos...
mit
prasad-joshi/logfs
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 version. # # This program i...
gpl-2.0
jeffreyliu3230/osf.io
scripts/sync_email.py
23
6032
""" Subscribe all registered OSF users to the 'Open Science Framework General' mailing list on mailchimp. From the API docs: 1. Grab the users to be updated or created 2. For each user's status, sort them into two batches: Users to be subscribed or updated Users to be unsubscribed 3. For each of those batches,...
apache-2.0
japeto/Vigtech-Services
env/lib/python2.7/site-packages/django/utils/dateformat.py
365
10712
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print(df.format('jS F Y H:i')) 7th October 2003 11:39 >>> """ from __future__ import unicode_literals import calendar import datetime import re impo...
lgpl-3.0
huguesv/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/reprlib.py
41
5267
"""Redo the builtin repr() (representation) but with limits on most sizes.""" __all__ = ["Repr", "repr", "recursive_repr"] import builtins from itertools import islice from _thread import get_ident def recursive_repr(fillvalue='...'): 'Decorator to make a repr function return fillvalue for a recursive call' ...
apache-2.0
biocore/qiime2
qiime2/core/type/primitive.py
1
9941
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2019, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
gnychis/grforwarder
gnuradio-examples/python/pfb/resampler.py
7
4207
#!/usr/bin/env python # # Copyright 2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) ...
gpl-3.0
xubenben/data-science-from-scratch
code/clustering.py
60
6438
from __future__ import division from linear_algebra import squared_distance, vector_mean, distance import math, random import matplotlib.image as mpimg import matplotlib.pyplot as plt class KMeans: """performs k-means clustering""" def __init__(self, k): self.k = k # number of clusters ...
unlicense
dgoedkoop/QGIS
python/user.py
7
4676
# -*- coding: utf-8 -*- """ *************************************************************************** user.py --------------------- Date : January 2015 Copyright : (C) 2015 by Nathan Woodrow Email : woodrow dot nathan at gmail dot com ********************...
gpl-2.0
rogalski/pylint
pylint/test/extensions/test_check_docs.py
1
51612
# Copyright (c) 2014-2015 Bruno Daniel <bruno.daniel@blue-yonder.com> # Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2016 Ashley Whetter <ashley@awhetter.co.uk> # Copyright (c) 2016 Glenn Matthews <glenn@e-dad.net> # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-...
gpl-2.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/numpy/core/__init__.py
12
3039
from __future__ import division, absolute_import, print_function from .info import __doc__ from numpy.version import version as __version__ # disables OpenBLAS affinity setting of the main thread that limits # python threads or processes to one core import os env_added = [] for envkey in ['OPENBLAS_MAIN_FREE', 'GOTOB...
bsd-2-clause
iulian787/spack
var/spack/repos/builtin/packages/py-csvkit/package.py
5
1739
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyCsvkit(PythonPackage): """A library of utilities for working with CSV, the king of tabul...
lgpl-2.1
crosswalk-project/web-testing-service
wts/tests/csp/csp_enforcing_multiple_policies.py
25
3282
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) response.headers.set( "Content-Security-Policy", "connect-src * 'unsafe-inline'")...
bsd-3-clause
sadaf2605/django
tests/check_framework/test_security.py
12
18165
from django.conf import settings from django.core.checks.security import base, csrf, sessions from django.core.checks.utils import patch_middleware_message from django.test import SimpleTestCase from django.test.utils import override_settings class CheckSessionCookieSecureTest(SimpleTestCase): @property def f...
bsd-3-clause
foyzur/gpdb
gpAux/extensions/gtest/scripts/pump.py
2471
23673
#!/usr/bin/env python # # Copyright 2008, 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...
apache-2.0
deepesch/scikit-learn
examples/text/hashing_vs_dict_vectorizer.py
284
3265
""" =========================================== FeatureHasher and DictVectorizer Comparison =========================================== Compares FeatureHasher and DictVectorizer by using both to vectorize text documents. The example demonstrates syntax and speed only; it doesn't actually do anything useful with the e...
bsd-3-clause
localhuman/neo-python
neo/Core/TX/Transaction.py
1
22181
# -*- coding:utf-8 -*- """ Description: Transaction Basic Class Usage: from neo.Core.Transaction import Transaction """ from itertools import groupby from neo.Blockchain import * from neo.Core.TX.TransactionAttribute import * from neocore.Fixed8 import Fixed8 from neo.Network.Inventory import Inventory from neo...
mit
p0psicles/SickGear
lib/requests/packages/chardet/chardetect.py
1786
2504
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
gpl-3.0
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/WebKit/PRESUBMIT.py
5
16507
# 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. """Top-level presubmit script for Blink. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmi...
gpl-3.0
dpniel/snapcraft
snapcraft/internal/deltas/errors.py
5
1593
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
tensorflow/lingvo
lingvo/core/egdd_test.py
1
4604
# Lint as: python3 # Copyright 2020 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 ...
apache-2.0
mjroson/django-favit
favit/models.py
1
1048
# -*- coding: utf-8 -*- from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import models from django.conf import settings from django.utils.translation import ugettext_lazy as _ from .managers import FavoriteManager class Favorite(models.Model): ...
mit
akosel/incubator-airflow
tests/contrib/operators/test_mongo_to_s3_operator.py
14
3847
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0