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
CT-Data-Collaborative/ctdata-wagtail-cms
ctdata/migrations/0033_auto_20161122_1634.py
1
2210
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-11-22 16:34 from __future__ import unicode_literals import datetime from django.db import migrations, models import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('ctdata', '0032_dataacademyliveevent_dataaca...
mit
ufosky-server/zulip
zerver/lib/bulk_create.py
121
5432
from __future__ import absolute_import from zerver.lib.initial_password import initial_password from zerver.models import Realm, Stream, UserProfile, Huddle, \ Subscription, Recipient, Client, get_huddle_hash, resolve_email_to_domain from zerver.lib.create_user import create_user_profile def bulk_create_realms(re...
apache-2.0
MattX/toylisp
src/lparse.py
1
1794
import objects class ParseError(Exception): pass def parse_list(tokens): # assuming the initial '(' and possibly some elements have been parsed # returns a pair : scanned object and rest of tokens if tokens == []: raise ParseError("Improper list") if tokens[0] == ')': return (objects.Nil...
mit
sysalexis/kbengine
kbe/res/scripts/common/Lib/idlelib/CallTips.py
97
5932
"""CallTips.py - An IDLE Extension to Jog Your Memory Call Tips are floating windows which display function, class, and method parameter and docstring information when you type an opening parenthesis, and which disappear when you type a closing parenthesis. """ import __main__ import inspect import re import sys impo...
lgpl-3.0
StevenBlack/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/version_check.py
128
1745
# 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 of conditions and the ...
bsd-3-clause
joergdietrich/astropy
astropy/units/__init__.py
4
1056
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains classes and functions for defining and converting between different physical units. This code is adapted from the `pynbody <http://code.google.com/p/pynbody/>`_ units module written by Andrew Pontzen, who has granted the Astr...
bsd-3-clause
shakamunyi/nova
nova/tests/unit/compute/test_claims.py
5
12014
# Copyright (c) 2012 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
xwzy/triplet-deep-hash-pytorch
triplet-deep-hash-pytorch/src/extract_feature/validation_utils/convert_ground_truth_labels/convert_ground_truth_labels.py
1
1398
''' Copyright 2017 Kent Sommer 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 dis...
apache-2.0
psolyca/totalopenstation
totalopenstation/formats/trimble_are.py
2
2124
# -*- coding: utf-8 -*- # filename: formats/trimble_are.py # Copyright 2009 Luca Bianconi <luxetluc@yahoo.it> # Copyright 2009 Stefano Costa <steko@iosa.it> # Copyright 2009 Alessandro Bezzi <alessandro.bezzi@arc-team.com> # This file is part of Total Open Station. # Total Open Station is free software: you can redis...
gpl-3.0
AkA84/edx-platform
lms/djangoapps/shoppingcart/migrations/0002_auto__add_field_paidcourseregistration_mode.py
182
8687
# -*- 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): # Adding field 'PaidCourseRegistration.mode' db.add_column('shoppingcart_paidcourseregistration', 'mode', ...
agpl-3.0
sbesson/openmicroscopy
components/tools/OmeroPy/test/integration/clitest/test_ldap.py
6
1953
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2014 University of Dundee & Open Microscopy Environment. # All rights reserved. # # 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
tailorian/Sick-Beard
lib/hachoir_parser/game/laf.py
90
2900
# -*- coding: utf-8 -*- """ LucasArts Font parser. Author: Cyril Zorin Creation date: 1 January 2007 """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, UInt8, UInt16, UInt32, GenericVector) from lib.hachoir_core.endian import LITTLE_ENDIAN class CharData(FieldSet): def...
gpl-3.0
mowenGithub/Clutch
clutch/urls.py
2
2350
# Copyright 2012 Twitter # # 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, softw...
apache-2.0
MaxTyutyunnikov/lino
obsolete/ui_old/requests.py
1
3385
## Copyright 2009-2012 Luc Saffre ## This file is part of the Lino project. ## Lino 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
RiccardoPecora/MP
Lib/site-packages/scipy/fftpack/pseudo_diffs.py
57
12479
""" Differential and pseudo-differential operators. """ # Created by Pearu Peterson, September 2002 __all__ = ['diff', 'tilbert','itilbert','hilbert','ihilbert', 'cs_diff','cc_diff','sc_diff','ss_diff', 'shift'] from numpy import pi, asarray, sin, cos, sinh, cosh, tanh, iscomplexobj i...
gpl-3.0
openmichigan/PSNM
NavierStokes/Programs/NavierStokes3dFortranMPIParaView/cell-based/pipeline_vtis.py
2
6764
try: paraview.simple except: from paraview.simple import * def RequestDataDescription(datadescription): "Callback to populate the request for current timestep" if datadescription.GetForceOutput() == True: for i in range(datadescription.GetNumberOfInputDescriptions()): datadescription.GetIn...
bsd-2-clause
akhilaananthram/nupic
nupic/regions/Spec.py
35
7825
#!/usr/bin/env python # ---------------------------------------------------------------------- # 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...
agpl-3.0
gundalow/ansible
test/units/module_utils/test_api.py
13
3389
# -*- coding: utf-8 -*- # Copyright: (c) 2020, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2020, 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 from ansibl...
gpl-3.0
jalaziz/django-cms-grappelli-old
cms/menu.py
1
9250
# -*- coding: utf-8 -*- from menus.menu_pool import menu_pool from menus.base import Menu, NavigationNode, Modifier from cms.utils import get_language_from_request from cms.utils.moderator import get_page_queryset, get_title_queryset from django.conf import settings from django.contrib.sites.models import Site from cms...
bsd-3-clause
thaumos/ansible
lib/ansible/modules/cloud/docker/docker_container_info.py
12
3405
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # 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': ['prev...
gpl-3.0
Kast0rTr0y/ansible
lib/ansible/modules/system/iptables.py
31
21384
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Linus Unnebäck <linus@folkdatorn.se> # # 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 published by # the Free Software Foundation, either version 3 of...
gpl-3.0
tomasreimers/tensorflow-emscripten
tensorflow/contrib/learn/python/learn/estimators/tensor_signature_test.py
18
8288
# 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
postlund/home-assistant
homeassistant/components/vizio/media_player.py
1
10054
"""Vizio SmartCast Device support.""" from datetime import timedelta import logging from typing import Callable, List from pyvizio import VizioAsync from homeassistant.components.media_player import MediaPlayerDevice from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( CONF_ACCES...
apache-2.0
glebmish/appleseed
scripts/oslextractmeta.py
5
16387
#!/usr/bin/python # # This source file is part of appleseed. # Visit http://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2015-2017 Hans Hoogenboom, The appleseedhq Organization # # Permission is hereby granted, free of charge, to any ...
mit
keysona/python
LiamHuang/0001/solution.py
38
1730
# coding: utf-8 ''' 做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券), 使用 Python 如何生成 200 个激活码(或者优惠券)? 笔记参见: http://liam0205.me/2015/05/07/generator-of-invitation-code-in-python/ ''' import random, string class LengthError(ValueError): def __init__(self, arg): self.args = arg def pad_zero_to_left(inputNu...
mit
youprofit/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/applywatchlist.py
132
2983
# 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 of conditions and the ...
bsd-3-clause
nudziarz/BetaKernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-3.0
stormi/tsunami
src/primaires/recherche/masques/__init__.py
1
1638
# -*-coding:Utf-8 -* # Copyright (c) 2012 NOEL-BARON Léo # 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 # li...
bsd-3-clause
varunarya10/nova_test_latest
nova/tests/unit/image/fake.py
33
9435
# Copyright 2011 Justin Santa Barbara # Copyright 2012 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/l...
apache-2.0
j0gurt/ggrc-core
src/ggrc_basic_permissions/migrations/versions/20130903124635_5325f2b93af8_programeditor_cannot.py
7
1903
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """ProgramEditor cannot delete program. Also, update list of all mappings that ProgramEditor can edit. Revision ID: 5325f2b93af8 Revises: 3909ea856bc9 Create Date: 2013-09-03 12:46:35.653904 """ # revisio...
apache-2.0
BondAnthony/ansible
test/lib/ansible_test/_internal/cloud/tower.py
19
7339
"""Tower plugin for integration tests.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import time from ..util import ( display, ApplicationError, SubprocessError, ConfigParser, ) from ..util_common import ( run_command, ) from . import ( ...
gpl-3.0
andyxhadji/incubator-airflow
airflow/hooks/sqlite_hook.py
23
1271
# -*- 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
miguelinux/vbox
src/VBox/Devices/EFI/Firmware/AppPkg/Applications/Python/PyMod-2.7.2/Lib/os.py
1
26590
"""OS routines for Mac, NT, Posix, or UEFI depending on what system we're on. This exports: - all functions from edk2, posix, nt, os2, or ce, e.g. unlink, stat, etc. - os.path is one of the modules uefipath, posixpath, or ntpath - os.name is 'edk2', 'posix', 'nt', 'os2', 'ce' or 'riscos' - os.curdir is a strin...
gpl-2.0
cloudfoundry/php-buildpack-legacy
builds/runtimes/python-2.7.6/lib/python2.7/lib-tk/test/test_ttk/test_extensions.py
88
9186
import sys import unittest import Tkinter import ttk from test.test_support import requires, run_unittest import support requires('gui') class LabeledScaleTest(unittest.TestCase): def setUp(self): support.root_deiconify() def tearDown(self): support.root_withdraw() def test_widget_des...
mit
elkingtonmcb/sympy
sympy/physics/unitsystems/units.py
57
13509
# -*- coding: utf-8 -*- """ Unit system for physical quantities; include definition of constants. """ from __future__ import division import numbers from sympy import sympify, Expr, Number, Pow, Mul from .dimensions import Dimension, DimensionSystem class Unit(Expr): """ Class for the units. A unit is...
bsd-3-clause
sshnaidm/ru
plugin.video.KinoPoisk.ru/tokp.py
2
8470
#!/usr/bin/python # -*- coding: utf-8 -*- import httplib #import re #import sys import os import Cookie import string, xbmc, xbmcgui, xbmcplugin, urllib, cookielib, xbmcaddon #------------------------------- import urllib, urllib2, time, random #from time import gmtime, strftime #from urlparse import ur...
gpl-2.0
samsu/neutron
tests/unit/vmware/nsxlib/base.py
16
3648
# Copyright (c) 2014 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
andycasey/sick
sick/__init__.py
1
1053
# coding: utf-8 """ sick, the spectroscopic inference crank """ __author__ = "Andy Casey <arc@ast.cam.ac.uk>" __version__ = "0.10.53" __all__ = ["Model", "models", "plot", "specutils", "utils"] import os import logging import warnings from numpy import RankWarning # It pains me to have to do this. if not os.enviro...
mit
colour-science/colour
colour/models/cie_ucs.py
1
7121
# -*- coding: utf-8 -*- """ CIE 1960 UCS Colourspace ======================== Defines the *CIE 1960 UCS* colourspace transformations: - :func:`colour.XYZ_to_UCS` - :func:`colour.UCS_to_XYZ` - :func:`colour.UCS_to_uv` - :func:`colour.uv_to_UCS` - :func:`colour.UCS_uv_to_xy` - :func:`colour.xy_to_UCS_uv` R...
bsd-3-clause
divya-csekar/flask-microblog-server
flask/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py
3127
1902
######################## 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...
bsd-3-clause
gauribhoite/personfinder
env/google_appengine/google/appengine/datastore/datastore_stub_util.py
1
158606
#!/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...
apache-2.0
jaap-karssenberg/zim-desktop-wiki
tests/mainwindow.py
1
7805
# Copyright 2009-2017 Jaap Karssenberg <jaap.karssenberg@gmail.com> import tests from zim.notebook import Path from zim.plugins import PluginManager from zim.gui.mainwindow import * is_sensitive = lambda w: w.get_property('sensitive') def setUpMainWindow(notebook, path='Test', plugins=None): if isinstance(pa...
gpl-2.0
rjschof/gem5
src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py
91
4079
# 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
auduny/home-assistant
homeassistant/components/http/view.py
7
4563
"""Support for views.""" import asyncio import json import logging from aiohttp import web from aiohttp.web_exceptions import ( HTTPBadRequest, HTTPInternalServerError, HTTPUnauthorized) import voluptuous as vol from homeassistant import exceptions from homeassistant.const import CONTENT_TYPE_JSON from homeassist...
apache-2.0
jiangzhuo/kbengine
kbe/res/scripts/common/Lib/encodings/cp852.py
272
35002
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
lgpl-3.0
rhyolight/nupic.research
tests/algorithms/apical_tiebreak_temporal_memory/attm_sequence_memory_test.py
7
2692
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2017, 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...
gpl-3.0
KOT040188/key-mon
src/keymon/key_mon.py
4
38703
#!/usr/bin/python # # Copyright 2010 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 or a...
apache-2.0
googleapis/googleapis-gen
google/container/v1beta1/container-v1beta1-py/google/container_v1beta1/types/cluster_service.py
1
194856
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
DecipherOne/Troglodyte
Trog Build Dependencies/Python26/Lib/distutils/log.py
146
1606
"""A simple log mechanism styled after PEP 282.""" # This module should be kept compatible with Python 2.1. # The class here is styled after PEP 282 so that it could later be # replaced with a standard Python logging implementation. DEBUG = 1 INFO = 2 WARN = 3 ERROR = 4 FATAL = 5 import sys class Log: def __i...
mit
jmehnle/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway_facts.py
62
4656
#!/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 distributed...
gpl-3.0
jt6562/XX-Net
python27/1.0/lib/encodings/cp862.py
593
33626
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
bsd-2-clause
RecipeML/Recipe
recipe/load_pipeline.py
1
2486
# -*- coding: utf-8 -*- """ Copyright 2016 Walter José This file is part of the RECIPE Algorithm. The RECIPE 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) ...
gpl-3.0
golharam/StarCluster
starcluster/commands/s3image.py
19
3729
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later ...
gpl-3.0
moksha11/xen-hv
tools/python/xen/xend/xenstore/xswatch.py
48
2418
# Copyright (C) 2005 Christian Limpach <Christian.Limpach@cl.cam.ac.uk> # Copyright (C) 2005 XenSource Ltd # This file is subject to the terms and conditions of the GNU General # Public License. See the file "COPYING" in the main directory of # this archive for more details. import errno import threading from xen.xe...
gpl-2.0
ELZo3/ArduinoJson
third-party/gtest-1.7.0/test/gtest_throw_on_failure_test.py
2917
5766
#!/usr/bin/env python # # Copyright 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...
mit
lxsmnv/spark
python/pyspark/mllib/__init__.py
123
1412
# # 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
darrencheng0817/AlgorithmLearning
Python/interview/review/MeanMedianDataStruct.py
1
1573
''' Created on 2016年2月29日 @author: Darren ''' class My_DS: def __init__(self): self.sum=0 self.count=0 self.data=[0]*1001 def add(self,num): self.sum+=num self.count+=1 self.data[num]+=1 def get_mean(self): if self.count==0: ...
mit
thresholdsoftware/asylum
openerp/addons/account_analytic_plans/wizard/__init__.py
445
1117
# -*- 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
tinloaf/home-assistant
homeassistant/helpers/config_entry_flow.py
5
4492
"""Helpers for data entry flows for config entries.""" from functools import partial from homeassistant import config_entries def register_discovery_flow(domain, title, discovery_function, connection_class): """Register flow for discovered integrations that not require auth.""" co...
apache-2.0
fernandezcuesta/ansible
test/runner/lib/executor.py
10
40461
"""Execute Ansible tests.""" from __future__ import absolute_import, print_function import json import os import re import tempfile import time import textwrap import functools import shutil import stat import random import string import atexit import hashlib import lib.pytar import lib.thread from lib.core_ci impo...
gpl-3.0
mhdella/scikit-learn
examples/applications/plot_tomography_l1_reconstruction.py
204
5442
""" ====================================================================== Compressive sensing: tomography reconstruction with L1 prior (Lasso) ====================================================================== This example shows the reconstruction of an image from a set of parallel projections, acquired along dif...
bsd-3-clause
citrix/netscaler_aci_poc_kit
Basic SSL XML Scripts/post_xml.py
7
2845
#!/usr/bin/python # The MIT License (MIT) # Copyright (c) 2015 Citrix Systems, 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 ri...
mit
scrasmussen/euler-enigma
covid-19/covid.py
1
1352
import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.axis as ax import matplotlib.cbook as cbook from scipy.optimize import curve_fit import sys def func(x,a,b,c,d): return a * (x**3) + b * (x**2) + c * x + d king = False print(len(sys.argv)) if (len(sys.argv) > 1 and str(sys.a...
mit
c0710204/edx-platform
common/djangoapps/track/backends/tests/test_logger.py
91
1931
from __future__ import absolute_import import json import logging import datetime from django.test import TestCase from track.backends.logger import LoggerBackend class TestLoggerBackend(TestCase): def setUp(self): self.handler = MockLoggingHandler() self.handler.setLevel(logging.INFO) ...
agpl-3.0
0x90sled/catapult
third_party/gsutil/third_party/boto/boto/mturk/question.py
170
16126
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
bsd-3-clause
Clinical-Genomics/scout
scripts/update_files_path.py
1
8018
#!/usr/bin/python # -*- coding: utf-8 -*- import click import pymongo from pymongo import MongoClient from tabulate import tabulate VCF_FILES = [ "vcf_snv", "vcf_sv", "vcf_str", "vcf_cancer", "vcf_cancer_sv", "vcf_snv_research", "vcf_sv_research", "vcf_cancer_research", "vcf_cancer_...
bsd-3-clause
ivangro/theriddlerbot
last-working-version/CategoryAttsHelper.py
1
3517
from collections import defaultdict from noc import parse, split from CharacterAttsHelper import getAttributes, getColumnName, getCharactersFromValues def loadContent(): i=0 columns = {} for elem in split(catContentCSV.readline(), "\t"): columns[str(i)] = elem i = i+1 #print "Column...
gpl-2.0
Project-Bonfire/EHA
Scripts/include/stats.py
3
2804
import sys from Scripts.include.package import * from Scripts.include.helper_func import * def statistics(verbal): """ Calculates the amount of packets sent and recieved and prints statistics about flit and packet loss percentages! """ print if verbal: if DEBUG: print_msg(MSG...
gpl-3.0
wmodes/crs
conductor/field.py
1
23227
#!/usr/bin/env python # -*- coding: utf-8 -*- """Header template file. Co-related Space is an interactive multimedia installation that engages the themes of presence, interaction, and place. Using motion tracking, laser light and a generative soundscape, it encourages interactions between participants, visually and so...
gpl-3.0
837468220/python-for-android
python-modules/twisted/twisted/web/test/test_xml.py
53
43051
# -*- test-case-name: twisted.web.test.test_xml -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Some fairly inadequate testcases for Twisted XML support. """ from twisted.trial.unittest import TestCase from twisted.web import sux from twisted.web import microdom from twisted....
apache-2.0
ajayydv/incubator-metron
metron-platform/metron-data-management/src/main/scripts/Whois_CSV_to_JSON.py
34
8130
#!/usr/bin/python """ Copyright 2014 Cisco Systems, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
apache-2.0
ajtowns/bitcoin
test/functional/feature_includeconf.py
11
4378
#!/usr/bin/env python3 # Copyright (c) 2018-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests the includeconf argument Verify that: 1. adding includeconf to the configuration file causes th...
mit
seoester/Git-Deployment-Handler
gitdh/modules/external.py
1
7970
# -*- coding: utf-8 -*- from gitdh.modules import Module from gitdh.git import Git from gitdh.gitdhutils import filterOnStatusBase, filterOnSource, mInsertCommit, generateRandomString from tempfile import TemporaryDirectory from subprocess import check_call, check_output, CalledProcessError from syslog import syslog, ...
mit
gye-tgm/spysniff
spysniffer.py
1
4762
#!/usr/bin/python import socket, sys from struct import * import string import binascii """ SpySniffer is a unique low level Python sniffer that can sniff TCP packets and filters out by certain, and customizable criterias. """ allowed_ports = [] for i in range(1, len(sys.argv)): allowed_ports.append(int(sys.argv[i...
mit
andfoy/margffoy-tuay-server
env/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/schema.py
518
6882
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor from django.db.utils import DatabaseError class SpatialiteSchemaEditor(DatabaseSchemaEditor): sql_add_geometry_column = ( "SELECT AddGeometryColumn(%(table)s, %(column)s, %(srid)s, " "%(geom_type)s, %(dim)s, %(null)s)" ) sq...
gpl-2.0
premanandchandrasekar/boto
tests/unit/cloudformation/test_connection.py
7
26203
#!/usr/bin/env python import unittest import httplib from datetime import datetime try: import json except ImportError: import simplejson as json from mock import Mock from tests.unit import AWSMockServiceTestCase from boto.cloudformation.connection import CloudFormationConnection SAMPLE_TEMPLATE = r""" { ...
mit
jonasschnelli/bitcoin
test/functional/mempool_updatefromblock.py
35
6203
#!/usr/bin/env python3 # Copyright (c) 2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mempool descendants/ancestors information update. Test mempool update of transaction descendants/ances...
mit
ducthien1490/youtube-dl
youtube_dl/extractor/vimple.py
121
1911
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import int_or_none class SprutoBaseIE(InfoExtractor): def _extract_spruto(self, spruto, video_id): playlist = spruto['playlist'][0] title = playlist['title'] video_id = playlist.get('videoId') or video_...
unlicense
fkolacek/FIT-VUT
bp-revok/python/lib/python2.7/encodings/cp861.py
593
34889
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP861.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
apache-2.0
opennode/nodeconductor-assembly-waldur
src/waldur_auth_social/extension.py
1
2121
from waldur_core.core import WaldurExtension class AuthSocialExtension(WaldurExtension): class Settings: # wiki: https://opennode.atlassian.net/wiki/display/WD/AuthSocial+plugin+configuration WALDUR_AUTH_SOCIAL = { 'FACEBOOK_SECRET': '', 'FACEBOOK_CLIENT_ID': '', ...
mit
thlorenz/lldb-jbt
jbt.py
1
6096
#!/usr/bin/python import lldb DEBUG = False kHeaderSize = 0 LAZY_COMPILE = 'LazyCompile:' LAZY_COMPILE_LEN = len(LAZY_COMPILE) from threading import Timer class Address: def __init__(self, inst_start, name): self.decimalAddress = inst_start self.hexadecimalAddress = "0x%x...
mit
DatapuntAmsterdam/handelsregister
web/handelsregister/datasets/hr/tests/factories.py
1
6713
import random from datetime import datetime import faker import factory import pytz from django.contrib.gis.geos import Point from factory import fuzzy from .. import models from datasets.build_hr_data import fill_geo_table from datasets.sbicodes import load_sbi_codes class NatuurlijkePersoonFactory(factory.DjangoM...
mpl-2.0
pathawks/pygments
pygments/lexers/_scilab_builtins.py
364
31261
# -*- coding: utf-8 -*- """ pygments.lexers._scilab_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Builtin list for the ScilabLexer. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ # These lists are generated automatically. # Run the follo...
bsd-2-clause
biicode/client
command/tool_catalog.py
5
2824
import inspect from biicode.client.shell.biistream import Color class ToolCatalog(dict): def __init__(self, main_class, tools): dict.__init__(self) self.main_class = main_class # dict from tool group name to set of classes for c in tools: self[c.group] = c self....
mit
IronLanguages/ironpython2
Src/StdLib/Lib/test/test_stat.py
54
5696
import unittest import os from test.test_support import TESTFN, run_unittest import stat class TestFilemode(unittest.TestCase): file_flags = {'SF_APPEND', 'SF_ARCHIVED', 'SF_IMMUTABLE', 'SF_NOUNLINK', 'SF_SNAPSHOT', 'UF_APPEND', 'UF_COMPRESSED', 'UF_HIDDEN', 'UF_IMMUTABLE', 'UF_...
apache-2.0
jfillmore/Omega-API-Engine
clients/python/omega/dbg.py
1
8885
#!/usr/bin/env python # omega - python client # https://github.com/jfillmore/Omega-API-Engine # # Copyright 2011, Jonathon Fillmore # Licensed under the MIT license. See LICENSE file. # http://www.opensource.org/licenses/mit-license.php """Uses python introspection to provide PHP-like "var_dump" functionality for de...
mit
jjdmol/LOFAR
LCS/Messaging/python/messaging/RPC.py
1
12411
# RPC.py: RPC client side used by the lofar.messaging module. # # Copyright (C) 2015 # ASTRON (Netherlands Institute for Radio Astronomy) # P.O.Box 2, 7990 AA Dwingeloo, The Netherlands # # This file is part of the LOFAR software suite. # The LOFAR software suite is free software: you can redistribute it # and/or modif...
gpl-3.0
arborh/tensorflow
tensorflow/python/training/tracking/benchmarks_test.py
7
4005
# Copyright 2019 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
codexns/sublime-coverage
st2_osx_x64/coverage/version.py
10
1193
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """The version and URL for coverage.py""" # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. version_info = (4, 0, 0,...
apache-2.0
zaffra/Donate
django/contrib/flatpages/admin.py
250
1089
from django import forms from django.contrib import admin from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', help_text = _("Example: ...
bsd-3-clause
davinellulinvega/SpheroMouse
scroll.py
1
2249
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'davinellulinvega' from sphero_driver import sphero_driver import pyautogui from time import sleep # Define the size of the screen width, height = pyautogui.size() half_width = width / 2 half_height = height / 2 pyautogui.FAILSAFE = False # Define a function f...
lgpl-3.0
griffithlab/regtools
src/utils/gtest-1.7.0/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...
mit
CatsAndDogsbvba/odoo
addons/point_of_sale/report/pos_details.py
37
10369
# -*- 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
mx3L/enigma2
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
26
37470
import os from time import strftime from enigma import iPlayableService, eTimer, eServiceCenter, iServiceInformation, ePicLoad from ServiceReference import ServiceReference from Screens.Screen import Screen from Screens.HelpMenu import HelpableScreen from Screens.MessageBox import MessageBox from Screens.InputBox impor...
gpl-2.0
talatshaikh29/multiprotocol-python-server
Server_Concurrent.py
1
2638
import threading from threading import Thread import time import socket import sys def master1(): global s1# = socket.socket() s1 = socket.socket() host = '' global port1# = 2222 port1 = 2222 s1.bind((host, port1)) threads1 =[] for i in range(3): print("START") t11=threading.Thread(target=slave1) thr...
gpl-2.0
colinoflynn/s6-reconfig-examples
exampleproj/reconfig_python/scan.py
1
1346
#! /usr/bin/env python """\ Scan for serial ports. Part of pySerial (http://pyserial.sf.net) (C) 2002-2003 <cliechti@gmx.net> The scan function of this module tries to open each port number from 0 to 255 and it builds a list of those ports where this was successful. """ import sys import platform import glob try: ...
mit
highweb-project/highweb-webcl-html5spec
build/android/gyp/util/md5_check_test.py
31
6065
#!/usr/bin/env python # Copyright 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 fnmatch import tempfile import unittest import zipfile import md5_check # pylint: disable=W0403 def _WriteZipFile(path, entri...
bsd-3-clause
CS-SI/QGIS
python/plugins/processing/algs/grass7/ext/v_in_geonames.py
9
1324
# -*- coding: utf-8 -*- """ *************************************************************************** v_in_geonames.py ---------------- Date : March 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr *****************************...
gpl-2.0
EmmaBYPeng/VaticHandHygiene
models.py
4
11035
import turkic.database import turkic.models from sqlalchemy import Column, Integer, Float, String, Boolean, Text from sqlalchemy import ForeignKey, Table, PickleType from sqlalchemy.orm import relationship, backref import Image import vision from vision.track.interpolation import LinearFill import random import logging...
mit
mar29th/ring
ring/pusher.py
1
2663
# Copyright 2016 Douban Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
apache-2.0