repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
josephlewis42/UDenverMavlink
pymavlink/tools/mavloss.py
9
1392
#!/usr/bin/env python ''' show MAVLink packet loss ''' import sys, time, os from optparse import OptionParser parser = OptionParser("sigloss.py [options]") parser.add_option("--no-timestamps",dest="notimestamps", action='store_true', help="Log doesn't have timestamps") parser.add_option("--planner",dest="planner", a...
lgpl-3.0
treejames/viewfinder
backend/db/test/indexing_test.py
13
24773
# -*- coding: utf-8 -*- # Copyright 2011 Viewfinder Inc. All Rights Reserved. """Tests DB indexing and querying. """ __author__ = 'spencer@emailscrubbed.com (Spencer Kimball)' import logging import platform import random import time import unittest from functools import partial from tornado import escape from viewf...
apache-2.0
aeph6Ee0/youtube-dl
youtube_dl/extractor/ondemandkorea.py
62
2036
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, js_to_json, ) class OnDemandKoreaIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ondemandkorea\.com/(?P<id>[^/]+)\.html' _GEO_COUNTRIES = ['US', 'CA'] _TEST = { ...
unlicense
unho/pootle
pootle/apps/pootle_data/project_data.py
5
1925
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from pootle.core.delegate import revision f...
gpl-3.0
liujunzhi321/SEIMS
preprocess/soil_param.py
1
31663
#! /usr/bin/env python # coding=utf-8 # # Author: Junzhi Liu, 2013-1-10 # Revised: Liang-Jun Zhu, Huiran Gao, Fang Shen # Revised date: 2016-7-22 # Note: 1. Names and units of soil physical parameter are referred to readsol.f, soil_par.f, and soil_phys.f in SWAT # 2. Data validation checking is also conducted her...
gpl-2.0
jendap/tensorflow
tensorflow/python/data/kernel_tests/iterator_checkpoint_test.py
6
5944
# 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
wofanli/trex-core
scripts/external_libs/zmq/sugar/version.py
19
1231
"""PyZMQ and 0MQ version functions.""" # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. from zmq.backend import zmq_version_info VERSION_MAJOR = 14 VERSION_MINOR = 5 VERSION_PATCH = 0 VERSION_EXTRA = "" __version__ = '%i.%i.%i' % (VERSION_MAJOR, VERSION_MINOR, VERSION_PAT...
apache-2.0
piskvorky/smart_open
release/check_preamble.py
3
2194
# -*- coding: utf-8 -*- # # Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com> # # This code is distributed under the terms and conditions # from the MIT License (MIT). # """Checks preambles of Python script files. We want to ensure they all contain the appropriate license and copyright. For the purposes of this...
mit
byakuinss/spark
examples/src/main/python/mllib/regression_metrics_example.py
158
2104
# # 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
PalisadoesFoundation/switchmap-ng
switchmap/snmp/mib_bridge.py
1
12748
#!/usr/bin/env python3 """Class interacts with devices supporting BRIDGE-MIB.""" from collections import defaultdict import binascii from switchmap.snmp.base_query import Query from switchmap.utils import log from pprint import pprint import sys def get_query(): """Return this module's Query class.""" retu...
apache-2.0
randyzingle/tools
kub/services/archive/cdk/python/sample-app/.env/lib/python3.6/site-packages/packaging/_structures.py
62
1416
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function class Infinity(object): def __repr__(self): return "Infinity"...
apache-2.0
sfrenza/test-for-bot
venv/Lib/site-packages/nltk/inference/nonmonotonic.py
7
18607
# Natural Language Toolkit: Nonmonotonic Reasoning # # Author: Daniel H. Garrette <dhgarrette@gmail.com> # # Copyright (C) 2001-2017 NLTK Project # URL: <http://nltk.org> # For license information, see LICENSE.TXT """ A module to perform nonmonotonic reasoning. The ideas and demonstrations in this module are based on...
mit
olologin/scikit-learn
sklearn/utils/linear_assignment_.py
67
9524
""" Solve the unique lowest-cost assignment problem using the Hungarian algorithm (also known as Munkres algorithm). """ # Based on original code by Brain Clapper, adapted to NumPy by Gael Varoquaux. # Heavily refactored by Lars Buitinck. # # TODO: a version of this algorithm has been incorporated in SciPy; use that #...
bsd-3-clause
kairen/kubernetes-ceph-ansible
hack/offline-tools/pkg-downloader.py
3
1650
# coding=utf-8 import os import urllib2 import yaml from jinja2 import Environment, FileSystemLoader TMPL_FILE = '../../roles/download/package/defaults/main.yml' YML_FILE = './pkg.yml' PKG_HOME_DIR = os.environ.get('PKG_HOME_DIR','/usr/local/apache2/htdocs') PATH = os.path.dirname(os.path.abspath(__file__)) TMPL_ENV ...
apache-2.0
maxalbert/blaze
blaze/expr/tests/test_split.py
4
12218
import pytest from blaze.expr import (symbol, transform, by, count, summary, var, std, mean, sqrt, sum) from blaze.expr.split import split, path_split from datashape import dshape from datashape.predicates import isscalar, isrecord, iscollection t = symbol('t', 'var * {name: string, amount: int...
bsd-3-clause
erickt/hue
desktop/core/ext-py/ctypes-1.0.2/ctypes/test/test_slicing.py
15
3845
import unittest from ctypes import * import _ctypes_test class SlicesTestCase(unittest.TestCase): def test_getslice_cint(self): a = (c_int * 100)(*xrange(1100, 1200)) b = range(1100, 1200) self.failUnlessEqual(a[0:2], b[0:2]) self.failUnlessEqual(len(a), len(b)) self.failUn...
apache-2.0
pbomta/or-tools
examples/python/volsay3.py
34
2461
# Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.com # # 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
apocalypsebg/odoo
addons/account_check_writing/__init__.py
446
1111
# -*- 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
dhimmel/networkx
networkx/utils/rcm.py
9
4913
""" Cuthill-McKee ordering of graph nodes to produce sparse matrices """ # Copyright (C) 2011-2014 by # Aric Hagberg <aric.hagberg@gmail.com> # All rights reserved. # BSD license. from collections import deque from operator import itemgetter import networkx as nx from ..utils import arbitrary_element __au...
bsd-3-clause
ramondelafuente/ansible
lib/ansible/plugins/callback/timer.py
168
1125
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from datetime import datetime from ansible.plugins.callback import CallbackBase class CallbackModule(CallbackBase): """ This callback module tells you how long your plays ran for. """ ...
gpl-3.0
baxter-oop/baxterite
src/server/database_setup.py
1
3100
import datetime from sqlalchemy import Column, ForeignKey, Integer, String, Boolean, Text, DateTime from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine import config Base = declarative_base() class Standard(Base): __tablename__ = 'S...
mit
yamahata/neutron
neutron/plugins/ml2/drivers/l2pop/config.py
28
1046
# Copyright (c) 2013 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
chauhanhardik/populo
lms/djangoapps/verify_student/migrations/0006_auto__add_skippedreverification__add_unique_skippedreverification_user.py
92
10538
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'SkippedReverification' db.create_table('verify_student_sk...
agpl-3.0
RobertoMalatesta/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/diff_parser_unittest.py
124
8145
# Copyright (C) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
koyuawsmbrtn/eclock
windows/Python27/Lib/site-packages/Cython/Compiler/Annotate.py
6
7209
# Note: Work in progress import os import re import time import codecs from StringIO import StringIO import Version from Code import CCodeWriter from Cython import Utils # need one-characters subsitutions (for now) so offsets aren't off special_chars = [ (u'&', u'\xF2', u'&amp;'), (u'<', u'\xF0', u'&lt;'), ...
gpl-2.0
freakboy3742/django
django/contrib/admin/models.py
39
5672
import json from django.conf import settings from django.contrib.admin.utils import quote from django.contrib.contenttypes.models import ContentType from django.db import models from django.urls import NoReverseMatch, reverse from django.utils import timezone from django.utils.text import get_text_list from django.uti...
bsd-3-clause
nixu-corp/oxAuth
Server/integrations/shared_libs/simplejson/encoder.py
5
23144
"""Implementation of JSONEncoder """ from __future__ import absolute_import import re from operator import itemgetter from decimal import Decimal from .compat import u, unichr, binary_type, string_types, integer_types, PY3 def _import_speedups(): try: from . import _speedups return _speedups.encode_...
mit
tntnatbry/tensorflow
tensorflow/python/kernel_tests/base64_ops_test.py
154
5658
# 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
cryptoguy71/FTCC
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
EmadMokhtar/Django
django/conf/locale/it/formats.py
35
2017
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' # 25 Ottobre 2006 TIME_FORMAT = 'H:i' # 14:30 DATETIME_FORMAT = 'l d F Y H:i' # Mercoledì...
mit
rjshade/grpc
test/http2_test/test_ping.py
26
3034
# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
bregman-arie/ansible
lib/ansible/modules/network/avi/avi_applicationprofile.py
23
7145
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
gpl-3.0
matmutant/sl4a
python/src/Tools/scripts/cvsfiles.py
101
1787
#! /usr/bin/env python """Print a list of files that are mentioned in CVS directories. Usage: cvsfiles.py [-n file] [directory] ... If the '-n file' option is given, only files under CVS that are newer than the given file are printed; by default, all files under CVS are printed. As a special case, if a file does no...
apache-2.0
wenjoy/homePage
node_modules/node-captcha/node_modules/canvas/node_modules/mocha/node_modules/should/node_modules/gulp-uglify/node_modules/deepmerge/node_modules/tap/node_modules/yamlish/yamlish-py/test/__init__.py
161
3430
# -*- coding: utf-8 -*- IGNORE:C0111 from __future__ import absolute_import, print_function, unicode_literals import logging import yamlish import yaml import tempfile import textwrap INPUT = 1 OUTPUT = 2 if yamlish.py3k: unicode = str #logging.basicConfig(level=logging.DEBUG) def _generate_test_name(source):...
mit
radosuav/QGIS
python/plugins/processing/algs/saga/SagaAlgorithmProvider.py
8
6485
# -*- coding: utf-8 -*- """ *************************************************************************** SagaAlgorithmProvider.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *****************...
gpl-2.0
KousikaGanesh/purchaseandInventory
openerp/addons/crm/res_partner.py
49
4424
# -*- 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
mekkablue/Glyphs-Scripts
Anchors/Remove Non-Standard Anchors from Selected Glyphs.py
1
6917
#MenuTitle: Remove Non-Standard Anchors from Selected Glyphs # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Removes all anchors from a glyph that should not be there by default, e.g., ogonek from J. """ import vanilla class RemoveNonStandardAnchors( object ): de...
apache-2.0
mozilla/stoneridge
python/src/Lib/plat-mac/macerrors.py
40
116661
# -coding=latin1- from warnings import warnpy3k warnpy3k("In 3.x, the macerrors module is removed.", stacklevel=2) svTempDisable = -32768 #svTempDisable svDisabled = -32640 #Reserve range -32640 to -32768 for Apple temp disables. fontNotOutlineErr = -32615 #bitmap font passed to routine that does outlin...
mpl-2.0
kevinwilde/WildeBot
src/mybot/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py
353
3380
from __future__ import absolute_import import socket try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is...
mit
Pikecillo/genna
external/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/dp_20000310.py
1
5761
#Namespace tracer from Pawson, David <DPawson@rnib.org.uk> on 10 March 2000, with a version using the namespace axis from David Carlisle. from Xml.Xslt import test_harness sheet_1 = """<?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns-test="http:/...
gpl-2.0
Gourav2906/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/jisfreq.py
3131
47315
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
lgpl-2.1
radu-gheorghe/rsyslog
plugins/impstats/statslog-analyzer.py
23
10847
#! /usr/bin/env python # -*- coding: utf-8 -*- # * Copyright (C) 2013 Adiscon GmbH. # * This file is part of RSyslog # * # * This script processes impstats logfiles and searches for abnormalities # * import sys import datetime import time import os # Include regex definitions import statslog_regex from statslog_re...
gpl-3.0
jmwright/cadquery-freecad-module
Libs/chardet/charsetgroupprober.py
270
3787
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
lgpl-3.0
severb/flowy-website
js/Lib/unittest/test/testmock/testmock.py
4
41315
import copy import sys import unittest from unittest.test.testmock.support import is_instance from unittest import mock from unittest.mock import ( call, DEFAULT, patch, sentinel, MagicMock, Mock, NonCallableMock, NonCallableMagicMock, _CallList, create_autospec ) class Iter(object): ...
mit
mike-rg/MyGoalTracker
myGoalTracker/meta/views.py
1
1698
from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from usuario.models import Usuario from meta.models import Meta from meta.forms import MetaForm from datetime import datetime @login_required def principal(request): return render(request, 'principal.html') ...
gpl-3.0
nachandr/cfme_tests
cfme/utils/appliance/services.py
2
3591
import attr from cfme.utils.appliance.plugin import AppliancePlugin from cfme.utils.appliance.plugin import AppliancePluginException from cfme.utils.log import logger_wrap from cfme.utils.quote import quote from cfme.utils.wait import wait_for class SystemdException(AppliancePluginException): pass @attr.s clas...
gpl-2.0
chjw8016/GreenOdoo7-haibao
openerp/addons/account/report/account_tax_report.py
41
10422
# -*- 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...
mit
Crevil/grpc
src/python/grpcio/grpc/_auth.py
12
2543
# 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 law or agreed to in writing...
apache-2.0
htem/CATMAID
scripts/neurohdf/neurohdf.py
3
14399
import json import time from django.conf import settings from django.http import HttpResponse from django.shortcuts import get_object_or_404 from catmaid.models import * from catmaid.control.authentication import * from catmaid.control.common import * from catmaid.control.object import get_annotation_graph from cat...
agpl-3.0
Sodki/ansible-modules-extras
packaging/os/yum_repository.py
39
24926
#!/usr/bin/python # encoding: utf-8 # (c) 2015-2016, Jiri Tyr <jiri.tyr@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,...
gpl-3.0
Aquafina-water-bottle/Command-Compiler-Unlimited
test_fena/v1_13/test_all.py
1
1226
from test_fena.v1_13.test_selectors import test_selectors from test_fena.v1_13.test_jsons import test_jsons from test_fena.v1_12.test_nbts import test_nbts from test_fena.v1_13.test_scoreboards import test_scoreboards from test_fena.v1_13.test_blocks import test_blocks from test_fena.v1_13.test_coords import test_coord...
mit
sksavant/geda-gaf
utils/scripts/garchive.py
6
37447
#! /usr/bin/env python # # Copyright (C) 2003 Stuart Brorson <sdb@cloud9.net> # #------------------------------------------------------------------ # 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...
gpl-2.0
tejasnikumbh/ThesisCode
lib/python2.7/site-packages/numpy/f2py/tests/test_size.py
69
1186
from __future__ import division, absolute_import, print_function import os import math from numpy.testing import * from numpy import array import util def _path(*a): return os.path.join(*((os.path.dirname(__file__),) + a)) class TestSizeSumExample(util.F2PyTest): sources = [_path('src', 'size', 'foo.f90'),...
mit
DropD/flask-mongorest
example/schemas.py
1
1159
from cleancat import * from example import documents class User(Schema): email = Email(required=False) first_name = String(required=False) last_name = String(required=False) emails = List(Email(), required=False) datetime = DateTime(required=False) datetime_local = DateTime(required=False) ...
bsd-3-clause
tuos/dasMonitorAOD2015
FileFrequentInventory/reportFileInventory.py
1
7038
import os.path, time import re import sys def main(): inputpath = './' counter = sys.argv[1] store = dict() with open(inputpath + 'store.inv.' + counter) as input_store: lines_store = input_store.read().splitlines() store[0] = parseLioDu(lines_store) prevDays = (1,2,3) for age...
mit
t794104/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
kirillmorozov/youbot_control
scripts/rospyoubot.py
1
23834
#!/usr/bin/python2 # coding=UTF-8 """This is goint to be a Python wrapper for ROS wrapper for KUKA youBot API.""" import rospy from geometry_msgs.msg import Twist from nav_msgs.msg import Odometry from brics_actuator.msg import JointPositions, JointValue, JointVelocities from sensor_msgs.msg import JointState from mat...
bsd-2-clause
doismellburning/django
tests/utils_tests/test_timesince.py
67
5931
from __future__ import unicode_literals import datetime import unittest from django.test.utils import requires_tz_support from django.utils.timesince import timesince, timeuntil from django.utils import timezone class TimesinceTests(unittest.TestCase): def setUp(self): self.t = datetime.datetime(2007, ...
bsd-3-clause
torchbox/django-assets
setup.py
1
1938
#!/usr/bin/env python # coding: utf8 from __future__ import with_statement from setuptools import setup, find_packages # Figure out the version; this could be done by importing the # module, though that requires dependencies to be already installed, # which may not be the case when processing a pip requirements # fil...
bsd-2-clause
lazybios/june
june/utils/user.py
11
3155
# coding: utf-8 import time import base64 import hashlib import functools from flask import g, request, session, current_app from flask import flash, url_for, redirect, abort from flask_babel import lazy_gettext as _ from ..models import Account class require_role(object): roles = { 'spam': 0, 'ne...
bsd-3-clause
yghannam/kubernetes
cluster/juju/return-node-ips.py
310
1024
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
elzaggo/pydoop
examples/wordcount/bin/wordcount_minimal.py
1
1267
#!/usr/bin/env python # BEGIN_COPYRIGHT # # Copyright 2009-2018 CRS4. # # 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 ap...
apache-2.0
Debian/debsources
lib/debsources/plugins/hook_hello.py
1
1179
# Copyright (C) 2013-2021 The Debsources developers # <qa-debsources@lists.alioth.debian.org>. # See the AUTHORS file at the top-level directory of this distribution and at # https://salsa.debian.org/qa/debsources/blob/master/AUTHORS # # This file is part of Debsources. Debsources is free software: you can # redistrib...
agpl-3.0
b2ogeyman/MyBranchGoAI
boardchange.py
2
3867
import numpy def boardchange(input, position): board = numpy.transpose(input, (2, 0, 1)) my_stones = board[0] my_stones[position[0]][position[1]] = 1 op_stones = board[1] def dfs(point_in, boundary): kill_list = [] visited = numpy.copy(boundary) visited[point_in[0]][point_i...
gpl-3.0
jjensenmike/The-Art-of-Computer-Programming-Code
euclid.py
1
1998
#!usr/bin/env python from argparse import ArgumentParser """ Euclid's algorithm from page 2 of Section 1.1 (Algorithm 1.1E) This algorithm accepts two positive integers and finds the greatest common divisor Knuth provides the following three steps for the algorithm (Does not include step E0 from page 4) E1. ...
mit
tungvx/deploy
Django-0.90/tests/testapp/models/ordering.py
1
2200
""" 6. Specifying ordering Specify default ordering for a model using the ``ordering`` attribute, which should be a list or tuple of field names. This tells Django how to order the results of ``get_list()`` and other similar functions. If a field name in ``ordering`` starts with a hyphen, that field will be ordered i...
apache-2.0
nikhilprathapani/python-for-android
python3-alpha/extra_modules/gdata/Crypto/Util/number.py
45
5475
# # number.py : Number-theoretic functions # # Part of the Python Cryptography Toolkit # # Distribute and use freely; there are no restrictions on further # dissemination and usage except those imposed by the laws of your # country of residence. This software is provided "as is" without # warranty of fitness for us...
apache-2.0
SomethingExplosive/android_external_chromium_org
build/android/pylib/utils/xvfb.py
66
1526
# 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. import os import signal import subprocess import sys import time def _IsLinux(): """Return True if on Linux; else False.""" return sys.platform.sta...
bsd-3-clause
stencila/hub
clients/python/test/test_zone.py
1
3273
# coding: utf-8 """ Stencila Hub API # Authentication Many endpoints in the Stencila Hub API require an authentication token. These tokens carry many privileges, so be sure to keep them secure. Do not place your tokens in publicly accessible areas such as client-side code. The API is only served over HTTPS t...
apache-2.0
hassancode/cognizant_test
CustomerManager/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/common_test.py
2542
1970
#!/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 common.py file.""" import gyp.common import unittest import sys class TestTopologicallySorted(unittest.TestCase): ...
mit
yasoob/PythonRSSReader
venv/lib/python2.7/dist-packages/oauthlib/oauth2/rfc6749/grant_types/base.py
17
1617
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from __future__ import unicode_literals, absolute_import from oauthlib.common import log from oauthlib.oauth2.rfc6749 import errors, utils class GrantTypeBase(object): error_uri = None request_validator =...
mit
taohungyang/cloud-custodian
c7n/resources/ecs.py
1
14819
# Copyright 2015-2017 Capital One Services, 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 ...
apache-2.0
michaelrice/graphite-api
graphite_api/utils.py
9
2513
"""Copyright 2008 Orbitz WorldWide 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, softwa...
apache-2.0
chalasr/Flask-P2P
venv/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/whitespace.py
1730
1142
from __future__ import absolute_import, division, unicode_literals import re from . import _base from ..constants import rcdataElements, spaceCharacters spaceCharacters = "".join(spaceCharacters) SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) class Filter(_base.Filter): spacePreserveElements = frozenset...
mit
dmitriy0611/django
django/conf/locale/lv/formats.py
504
1906
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'Y. \g\a\d\a j. F' TIME_FORMAT = ...
bsd-3-clause
ibollen/repo
subcmds/selfupdate.py
82
1931
# # Copyright (C) 2009 The Android Open Source Project # # 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 la...
apache-2.0
arne-cl/pymox
setup.py
15
1068
#!/usr/bin/python2.4 # # Copyright 2008 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...
apache-2.0
thoraxe/openshift-ansible
roles/openshift_health_checker/openshift_checks/logging/elasticsearch.py
2
10119
""" Module for performing checks on an Elasticsearch logging deployment """ import json import re from openshift_checks import get_var from openshift_checks.logging.logging import LoggingCheck class Elasticsearch(LoggingCheck): """Module that checks an integrated logging Elasticsearch deployment""" name = ...
apache-2.0
chand3040/cloud_that
lms/djangoapps/certificates/queue.py
25
19704
"""Interface for adding certificate generation tasks to the XQueue. """ import json import random import logging import lxml.html from lxml.etree import XMLSyntaxError, ParserError # pylint:disable=no-name-in-module from django.test.client import RequestFactory from django.conf import settings from django.core.urlres...
agpl-3.0
dburr/SchoolIdolAPI
api/management/commands/generate_settings.py
1
6202
from django.core.management.base import BaseCommand, CommandError from django.db.models import F from api import models from contest.utils import get_current_contests from collections import OrderedDict from web.templatetags.mod import tourldash from django.db.models import Count from django.utils import timezone from ...
apache-2.0
eort/OpenSesame
libqtopensesame/misc/sketchpad_canvas.py
2
20095
#-*- coding:utf-8 -*- """ This file is part of OpenSesame. OpenSesame 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. OpenSesame is distri...
gpl-3.0
AutorestCI/azure-sdk-for-python
azure-batch/azure/batch/models/pool_add_parameter.py
1
12312
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
CGATOxford/CGATPipelines
scripts/cgat_cluster_distribute.py
2
3186
'''cgat_cluster_distribute.py - distribute files to cluster nodes ================================================================= Purpose ------- This script distributes one or more files to the local scratch directory on all nodes in the cluster. The script uses ``rsync`` to only copy files that are newer. Usag...
mit
geometrybase/gensim
gensim/models/ldamodel.py
16
37653
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html # # Parts of the LDA inference code come from Dr. Hoffman's `onlineldavb.py` script, # (C) 2010 Matthew D. Hoffman, GNU GPL 3.0 """ **...
gpl-3.0
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/setuptools/ssl_support.py
40
8125
import os import socket import atexit import re from setuptools.extern.six.moves import urllib, http_client, map import pkg_resources from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_avail...
mit
abonil91/ncanda-data-integration
scripts/reporting/IRB_script.py
1
1770
#!/usr/bin/env python ## ## Copyright 2016 SRI International ## See COPYING file distributed along with the package for the copyright and license terms. ## """ Reprot: IRB_script ====================== This script generates a report of the numbers needed for the IRB renewal. """ import os import sys import csv impo...
bsd-3-clause
Northrend/mxnet
tests/nightly/dist_device_sync_kvstore.py
24
3540
#!/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 # "L...
apache-2.0
allanino/nupic
nupic/data/jsonhelpers.py
39
4914
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
Just-D/chromium-1
testing/chromoting/browser_tests_launcher.py
1
9787
# Copyright (c) 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility script to launch browser-tests on the Chromoting bot.""" import argparse import glob import hashlib import os from os.path import expanduser ...
bsd-3-clause
jctanner/ansible
test/integration/targets/setup_rpm_repo/files/create-repo.py
26
1922
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function) __metaclass__ = type import sys from collections import namedtuple try: from rpmfluff import SimpleRpmBuild from rpmfluff import YumRepoBuild except ImportError: from rpmfluff.rpmbuild import SimpleRpmBuild from ...
gpl-3.0
junmin-zhu/chromium-rivertrail
third_party/tlslite/tlslite/api.py
359
2965
"""Import this module for easy access to TLS Lite objects. The TLS Lite API consists of classes, functions, and variables spread throughout this package. Instead of importing them individually with:: from tlslite.TLSConnection import TLSConnection from tlslite.HandshakeSettings import HandshakeSettings f...
bsd-3-clause
amisrs/one-eighty
venv2/lib/python2.7/site-packages/pip/_vendor/appdirs.py
327
22368
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2005-2010 ActiveState Software Inc. # Copyright (c) 2013 Eddy Petrișor """Utilities for determining application-specific dirs. See <http://github.com/ActiveState/appdirs> for details and usage. """ # Dev Notes: # - MSDN on where to store app data files: # ...
mit
ifduyue/django
tests/template_tests/filter_tests/test_force_escape.py
133
2860
from django.template.defaultfilters import force_escape from django.test import SimpleTestCase from django.utils.safestring import SafeData from ..utils import setup class ForceEscapeTests(SimpleTestCase): """ Force_escape is applied immediately. It can be used to provide double-escaping, for example. ...
bsd-3-clause
cortedeltimo/SickRage
tests/config_tests.py
12
25664
# coding=utf-8 """ Test sickbeard.config's classes and methods Classes: ConfigMigrator migrate_config _migrate_v1 _name_to_pattern _migrate_v2 _migrate_v3 _migrate_v4 _migrate_v5 _migrate_v6 _migrate_v7 _migrate_v8 _migrate_v9 ...
gpl-3.0
wolfiex/CoolStuff
DataMining/from_source_download.py
1
2126
''' A script to iteratively download a website, and its dependant files. D. Ellis May 2016 If running manually add module and run using: from from_source_download import* url= 'http://.....' get_dependancies(get_url(url)) ''' import sys,re import urllib2 def get_url(...
gpl-3.0
shiora/The-Perfect-Pokemon-Team-Balancer
libs/env/Lib/site-packages/whoosh/util/text.py
96
4372
# Copyright 2007 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
gpl-2.0
bobobox/ansible
lib/ansible/modules/network/fortios/fortios_config.py
8
5623
#!/usr/bin/python # # Ansible module to manage configuration on fortios devices # (c) 2016, Benjamin Jolivot <bjolivot@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 Softwar...
gpl-3.0
GitHublong/hue
desktop/core/ext-py/thrift-0.9.1/src/Thrift.py
253
4543
# # 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
cberry777/dd-agent
tests/checks/mock/test_java_jmx.py
48
4565
# stdlib import os import tempfile import threading import time from types import ListType import unittest # 3p from mock import patch from nose.plugins.attrib import attr import yaml # project from aggregator import MetricsAggregator from dogstatsd import Server from jmxfetch import JMXFetch from tests.checks.common...
bsd-3-clause
langner/cclib
cclib/io/xyzwriter.py
3
4164
# -*- coding: utf-8 -*- # # Copyright (c) 2017, the cclib development team # # This file is part of cclib (http://cclib.github.io) and is distributed under # the terms of the BSD 3-Clause License. """A writer for XYZ (Cartesian coordinate) files.""" from cclib.io import filewriter class XYZ(filewriter.Writer): ...
bsd-3-clause