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
YangChihWei/2015cdb_g1_0623
static/Brython3.1.1-20150328-091302/Lib/optparse.py
728
60616
"""A powerful, extensible, and easy-to-use option parser. By Greg Ward <gward@python.net> Originally distributed as Optik. For support, use the optik-users@lists.sourceforge.net mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). Simple usage example: from optparse import OptionParser pa...
gpl-3.0
edx/xblock-lti-consumer
lti_consumer/migrations/0002_ltiagslineitem.py
1
1256
# Generated by Django 2.2.16 on 2020-09-29 21:48 from django.db import migrations, models import django.db.models.deletion import opaque_keys.edx.django.models class Migration(migrations.Migration): dependencies = [ ('lti_consumer', '0001_initial'), ] operations = [ migrations.CreateMod...
agpl-3.0
Micronaet/micronaet-migration
base_accounting_program/accounting.py
1
14040
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
agpl-3.0
Parrot-Developers/ardupilot
Tools/scripts/frame_sizes.py
351
1117
#!/usr/bin/env python import re, sys, operator, os code_line = re.compile("^\s*\d+:/") frame_line = re.compile("^\s*\d+\s+/\* frame size = (\d+) \*/") class frame(object): def __init__(self, code, frame_size): self.code = code self.frame_size = int(frame_size) frames = [] def process_lst(filena...
gpl-3.0
inertialsense/InertialSenseSDK
python/pylib/ISToolsDataSorted.py
1
51887
''' Created on Feb 22, 2014 @author: waltj ''' from numbers import Number import numpy as np import os import glob import sys import simplekml import ctypes as ct import pylib.pose as pose import pylib.filterTools as ft # Profiling code import time as systime from numpy import uint8 as u8 from numpy import uint16 as...
mit
GPflow/GPflowOpt
doc/source/conf.py
1
5534
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # GPflowOpt documentation build configuration file, created by # sphinx-quickstart on Sun Apr 30 20:34:41 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # ...
apache-2.0
rsip22/101
Python/OO/cheapest_options/models/establishment.py
1
1339
import random from constants import PRICE_TABLE from enums import client class Establishment: """ Class for an establishment in the chain. Attributes: name: (str) name of the establishment stars: (int) establishment category is_rewards: (bool) establishment client participates in...
gpl-2.0
kyrus/crypto-un-locker
CryptoUnLocker.py
2
10737
#!/usr/bin/env python import struct import os import argparse import shutil import sys from collections import namedtuple from datetime import datetime import csv import re from Crypto.Cipher import AES from Crypto.PublicKey import RSA from Crypto.Cipher import PKCS1_v1_5 from Crypto.Hash import SHA from Crypto.Util....
mit
anthgur/servo
components/script/dom/bindings/codegen/parser/tests/test_cereactions.py
32
3904
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface Foo { [CEReactions(DOMString a)] void foo(boolean arg2); }; """) results = parser.finish() except: threw = True harness.ok(threw, "Should have thrown for...
mpl-2.0
kejkz/holmium.core
holmium/core/enhancers.py
3
2484
""" implementation of element enhancer base """ from selenium.webdriver.support.ui import Select class ElementEnhancer(object): """ base class for implementing custom element enhancers to add functionality to located webelements based on the element type (tag name) """ # pylint: disable=too-f...
mit
boyuegame/kbengine
kbe/res/scripts/common/Lib/distutils/command/sdist.py
96
18221
"""distutils.command.sdist Implements the Distutils 'sdist' command (create a source distribution).""" import os import string import sys from types import * from glob import glob from warnings import warn from distutils.core import Command from distutils import dir_util, dep_util, file_util, archive_util from distu...
lgpl-3.0
piotroxp/scibibscan
scib/lib/python3.6/site-packages/setuptools/command/develop.py
106
7384
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsError, DistutilsOptionError import os import glob import io from setuptools.extern import six from pkg_resources import Distribution, PathMetadata, normalize_path from setuptools.command.easy_install import easy_in...
mit
BenDz/amphtml
validator/build.py
12
21559
#!/usr/bin/env python2.7 # # Copyright 2015 The AMP HTML 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 # # ...
apache-2.0
jobscore/sync-engine
inbox/test/general/test_provider_resolution.py
3
2672
import pytest from inbox.util.url import provider_from_address from inbox.util.url import InvalidEmailAddressError from inbox.auth.base import handler_from_provider from inbox.auth.generic import GenericAuthHandler from inbox.auth.gmail import GmailAuthHandler from inbox.basicauth import NotSupportedError def test_pr...
agpl-3.0
Shanec132006/project
server/lib/werkzeug/contrib/jsrouting.py
318
8534
# -*- coding: utf-8 -*- """ werkzeug.contrib.jsrouting ~~~~~~~~~~~~~~~~~~~~~~~~~~ Addon module that allows to create a JavaScript function from a map that generates rules. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ ...
apache-2.0
majek/rons
rons/parser.py
1
4184
''' Recursive decoder for Redis protocol. The code is quite reasonable and has no external dependencies whatsoever. To test run: $ python -m doctest parser.py -v ''' import collections import itertools class ProtocolError(Exception): pass EMPTY=0 BULK=1 MULTIBULK=2 _State = collections.namedtuple('State', ['s', 'l'...
mit
Rewardcoin/p2ppool-SGcoin
p2pool/test/test_p2p.py
269
2724
import random from twisted.internet import defer, endpoints, protocol, reactor from twisted.trial import unittest from p2pool import networks, p2p from p2pool.bitcoin import data as bitcoin_data from p2pool.util import deferral class Test(unittest.TestCase): @defer.inlineCallbacks def test_sharereq(self): ...
gpl-3.0
ytjiang/django
django/contrib/staticfiles/handlers.py
581
2328
from django.conf import settings from django.contrib.staticfiles import utils from django.contrib.staticfiles.views import serve from django.core.handlers.wsgi import WSGIHandler, get_path_info from django.utils.six.moves.urllib.parse import urlparse from django.utils.six.moves.urllib.request import url2pathname clas...
bsd-3-clause
gautam1168/tardis
tardis/io/model_reader.py
5
7787
#reading different model files import numpy as np from numpy import recfromtxt, genfromtxt import pandas as pd from astropy import units as u import logging # Adding logging support logger = logging.getLogger(__name__) from tardis.util import parse_quantity class ConfigurationError(Exception): pass def read_d...
bsd-3-clause
gauribhoite/personfinder
env/google_appengine/lib/django-1.4/django/utils/tzinfo.py
90
3213
"Implementation of tzinfo classes for use with datetime.datetime." import time from datetime import timedelta, tzinfo from django.utils.encoding import smart_unicode, smart_str, DEFAULT_LOCALE_ENCODING # Python's doc say: "A tzinfo subclass must have an __init__() method that can # be called with no arguments". Fixe...
apache-2.0
jameskyle/KExperiment
Scripts/create_task_list.py
1
1800
#!/opt/local/bin/python import os import sys import re import fnmatch PROJECT_NAME = "KExperiment" source_reg = re.compile(".*\.(cpp|h)$") task_reg = re.compile("^\s*/+\s*(TODO|FIXME|BUG|NOTE|HACK):?\s*(.*)$", re.I) source_match = source_reg.match task_match = task_reg.match def main(): output = os.path.join(os....
gpl-3.0
ToonTownInfiniteRepo/ToontownInfinite
Panda3D-1.9.0/python/Tools/pynche/StripViewer.py
100
15465
"""Strip viewer and related widgets. The classes in this file implement the StripViewer shown in the top two thirds of the main Pynche window. It consists of three StripWidgets which display the variations in red, green, and blue respectively of the currently selected r/g/b color value. Each StripWidget shows the co...
mit
aspose-cells/Aspose.Cells-for-Cloud
Examples/Python/Examples/GetCellStyleFromWorksheet.py
2
1286
import asposecellscloud from asposecellscloud.CellsApi import CellsApi from asposecellscloud.CellsApi import ApiException import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi apiKey = "XXXXX" #sepcify App Key appSid = "XXXXX" #sepcify App SID apiServer = "http://api.aspose.com/v1.1" data_fol...
mit
ULHPC/easybuild-framework
easybuild/framework/easyconfig/format/convert.py
3
4431
# # # Copyright 2014-2017 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (...
gpl-2.0
valkjsaaa/sl4a
python/src/Lib/encodings/shift_jisx0213.py
816
1059
# # shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jisx0213') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEnc...
apache-2.0
stainsteelcrown/nonsense-story-generator
venv/lib/python2.7/site-packages/pip/commands/__init__.py
476
2236
""" Package containing all pip commands """ from pip.commands.bundle import BundleCommand from pip.commands.completion import CompletionCommand from pip.commands.freeze import FreezeCommand from pip.commands.help import HelpCommand from pip.commands.list import ListCommand from pip.commands.search import SearchComman...
mit
kagayakidan/scikit-learn
sklearn/manifold/tests/test_isomap.py
226
3941
from itertools import product import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from sklearn import datasets from sklearn import manifold from sklearn import neighbors from sklearn import pipeline from sklearn import preprocessing from sklearn.utils.testing import assert_less ...
bsd-3-clause
fauferoth/assignment
.mywaflib/waflib/extras/color_gcc.py
7
1138
#!/usr/bin/env python # encoding: utf-8 # Replaces the default formatter by one which understands GCC output and colorizes it. __author__ = __maintainer__ = "Jérôme Carretero <cJ-waf@zougloub.eu>" __copyright__ = "Jérôme Carretero, 2012" import sys from waflib import Logs class ColorGCCFormatter(Logs.formatter): d...
bsd-3-clause
Juniper/neutron
neutron/common/log.py
22
1332
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # Author: Sylvain Afchain <sylvain.afchain@enovance.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.apach...
apache-2.0
tamnm/kodi.mp3.zing.vn
dev/plugin.video.tvzing/bs4/element.py
82
49756
import collections import re import sys import warnings from bs4.dammit import EntitySubstitution DEFAULT_OUTPUT_ENCODING = "utf-8" PY3K = (sys.version_info[0] > 2) whitespace_re = re.compile("\s+") def _alias(attr): """Alias one attribute name to another for backward compatibility""" @property def alias...
gpl-2.0
energyPATHWAYS/energyPATHWAYS
energyPATHWAYS/dispatch_maintenance.py
1
7610
from pyomo.environ import * import numpy as np import util import config as cfg import pdb import pandas as pd import copy import dispatch_budget import logging def surplus_capacity(model): return model.surplus_capacity + model.peak_penalty * model.weight_on_peak_penalty def define_penalty_to_preference_high_cos...
mit
OmarIthawi/edx-platform
common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py
18
6195
# This class gives a common interface for logging into the grading controller import json import logging import requests import dogstats_wrapper as dog_stats_api from requests.exceptions import RequestException, ConnectionError, HTTPError from .combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingEr...
agpl-3.0
tlakshman26/cinder-bug-fix-volume-conversion-full
cinder/api/v2/volumes.py
2
18272
# Copyright 2011 Justin Santa Barbara # 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 requ...
apache-2.0
alisonken1/openlp-projector-2.0
openlp/projectors/projectormanager.py
1
8836
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # -------------------------------------------------------...
gpl-2.0
akhmadMizkat/odoo
addons/mail/models/res_users.py
3
6450
# -*- coding: utf-8 -*- from openerp import _, api, fields, models import openerp class Users(models.Model): """ Update of res.users class - add a preference about sending emails about notifications - make a new user follow itself - add a welcome message - add suggestion preferenc...
gpl-3.0
c960657/dd-agent
dogstatsd.py
3
18023
#!/opt/datadog-agent/embedded/bin/python # (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) """ A Python Statsd implementation with some datadog special sauce. """ # set up logging before importing any other components from config import initialize_logging # no...
bsd-3-clause
blopker/PCLite
pclite/http/downloaders/__init__.py
1
1722
''' The MIT License Copyright (c) Bo Lopker, http://blopker.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, ...
mit
tersmitten/ansible
lib/ansible/modules/storage/glusterfs/gluster_peer.py
37
5845
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 Nandaja Varma <nvarma@redhat.com> # Copyright 2018 Red Hat, Inc. # # 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_M...
gpl-3.0
sergiusens/snapcraft
tests/unit/repo/test_deb.py
1
19745
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2018 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 ...
gpl-3.0
ryfeus/lambda-packs
Selenium_PhantomJS/source/service.py
1
1299
#!/usr/bin/env python import httplib2 import datetime import time import os import selenium import json import boto3 import requests from dateutil.parser import parse from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys from selenium.webdriver...
mit
Communities-Communications/cc-odoo
openerp/addons/base/res/res_country.py
283
4728
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
tqchen/tvm
python/tvm/topi/sparse/csrmm.py
2
4109
# 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
rednaxelafx/apache-spark
resource-managers/kubernetes/integration-tests/tests/worker_memory_check.py
26
1585
# # 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
GermanRuizMarcos/Classical-Composer-Classification
code_10_1/classification.py
1
30838
''' AUDIO CLASSICAL COMPOSER IDENTIFICATION BASED ON: A SPECTRAL BANDWISE FEATURE-BASED SYSTEM ''' import essentia from essentia.standard import * import glob import numpy as np import arff from scipy import stats import collections import cv2 import matplotlib import matplotlib.pyplot as plt #### gabor filters d...
gpl-3.0
TRESCLOUD/odoo
addons/account_bank_statement_extensions/report/__init__.py
415
1128
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # i...
agpl-3.0
serviceagility/boto
boto/cognito/identity/layer1.py
15
12034
# 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 restriction, including # without limitation the rights ...
mit
facelessuser/backrefs
tests/test_wordbreak.py
1
2754
"""Test `Word Break`.""" import unittest from backrefs import uniprops import re class TestWordBreak(unittest.TestCase): """Test `Word Break` access.""" def test_table_integrity(self): """Test that there is parity between Unicode and ASCII tables.""" re_key = re.compile(r'^\^?[a-z0-9./]+$') ...
mit
Shelnutt2/android_kernel_lge_gee_3.4
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
tuxfux-hlp-notes/python-batches
archieves/batch-64/09-modules/myenv/lib/python2.7/site-packages/django/core/files/uploadedfile.py
471
4334
""" Classes representing uploaded files. """ import errno import os from io import BytesIO from django.conf import settings from django.core.files import temp as tempfile from django.core.files.base import File from django.utils.encoding import force_str __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryU...
gpl-3.0
kbdick/RecycleTracker
recyclecollector/scrap/gdata-2.0.18/samples/apps/marketplace_sample/gdata/tlslite/integration/IntegrationHelper.py
286
1839
class IntegrationHelper: def __init__(self, username=None, password=None, sharedKey=None, certChain=None, privateKey=None, cryptoID=None, protocol=None, x509Fingerprint=None, x509TrustList=None, x509CommonName=None, setti...
gpl-3.0
FireBladeNooT/Medusa_1_6
lib/sqlalchemy/orm/mapper.py
12
115133
# orm/mapper.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Logic to map Python classes to and from selectables. Defines the :class:`~sqlalche...
gpl-3.0
chadnetzer/numpy-gaurdro
numpy/f2py/crackfortran.py
2
114871
#!/usr/bin/env python """ crackfortran --- read fortran (77,90) code and extract declaration information. Usage is explained in the comment block below. Copyright 1999-2004 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the t...
bsd-3-clause
zmarcantel/Marlin
buildroot/share/atom/auto_build.py
3
46162
####################################### # # Marlin 3D Printer Firmware # Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] # # Based on Sprinter and grbl. # Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm # # This program is free software: you can redistribute it and/or modify # it unde...
gpl-2.0
luoshao23/ML_algorithm
Clustering/Pred_KNN.py
1
4903
from random import random, randint import math import numpy as np import plotly.plotly as py import plotly.graph_objs as go weightdomain = [(0, 20)] * 4 def wineprice(rating, age): peak_age = rating - 50 price = float(rating) / 2 if age > peak_age: price = price * (5 - (age - peak_age)) else...
mit
snnn/tensorflow
tensorflow/python/ops/bitwise_ops_test.py
25
7698
# 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
gaohr/SEIMS
preprocess/reclass_landuse.py
2
2171
#! /usr/bin/env python # coding=utf-8 # @Redistribute landuse parameters # @Author: Junzhi Liu # @Revised: Liang-Jun Zhu # import sqlite3 from config import * from util import * def ReclassLanduse(landuseFile, dbname, dstdir): # code:{property_name:value} # for example: # 1:{"clay":0.12, "sand":0.1} ...
gpl-2.0
ryanahall/django
django/db/models/options.py
6
35477
from __future__ import unicode_literals import warnings from bisect import bisect from collections import OrderedDict, defaultdict from itertools import chain from django.apps import apps from django.conf import settings from django.core.exceptions import FieldDoesNotExist from django.db.models.fields import AutoFiel...
bsd-3-clause
simonjbeaumont/planex
planex/init.py
1
1365
#!/usr/bin/env python """ Creates or regenerates a Makefile with special planex-init comments """ import os import logging MAKEFILE_PATH = "/usr/share/planex" def create_makefile(): """ Checks if a Makefile exists with special planex-init comments in it. If not, it creates or regenerates the Makefile while...
lgpl-2.1
jsdosa/TizenRT
external/protobuf/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/text_format_test.py
27
24605
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
apache-2.0
ogenstad/ansible
lib/ansible/modules/network/f5/bigip_virtual_address.py
23
19782
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
FNST-OpenStack/horizon
openstack_dashboard/dashboards/project/stacks/forms.py
13
18349
# 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 # distributed under th...
apache-2.0
fullfanta/mxnet
python/mxnet/rnn/io.py
2
7353
# 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
jic-dtool/dtool-create
setup.py
1
1165
from setuptools import setup url = "https://github.com/jic-dtool/dtool-create" version = "0.23.4" readme = open('README.rst').read() setup( name="dtool-create", packages=["dtool_create"], package_data={"dtool_create": ["templates/*"]}, version=version, description="Dtool plugin for creating datase...
mit
cjellick/agent
tests/tests/cattle/plugins/host_info/main.py
2
1722
import logging from tests.cattle.plugins.host_info.memory import MemoryCollector from tests.cattle.plugins.host_info.os_c import OSCollector from tests.cattle.plugins.host_info.cpu import CpuCollector from tests.cattle.plugins.host_info.disk import DiskCollector from tests.cattle.plugins.host_info.iops import IopsColl...
apache-2.0
Flexget/Flexget
setup.py
1
2371
import sys from pathlib import Path from typing import List from setuptools import find_packages, setup long_description = Path('README.rst').read_text() # Populates __version__ without importing the package __version__ = None with open('flexget/_version.py', encoding='utf-8') as ver_file: exec(ver_file.read()) ...
mit
probablytom/tomwallis.net
venv/lib/python2.7/site-packages/django/core/mail/backends/smtp.py
43
4723
"""SMTP email backend class.""" import smtplib import ssl import threading from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.utils import DNS_NAME from django.core.mail.message import sanitize_address class EmailBackend(BaseEmailBackend): """ A...
artistic-2.0
kbc-developers/android_kernel_htc_msm8960
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
methane/logbook
logbook/notifiers.py
2
9892
# -*- coding: utf-8 -*- """ logbook.notifiers ~~~~~~~~~~~~~~~~~ System notify handlers for OSX and Linux. :copyright: (c) 2010 by Armin Ronacher, Christopher Grebs. :license: BSD, see LICENSE for more details. """ import os import sys import base64 from time import time from logbook.base import N...
bsd-3-clause
diorcety/intellij-community
python/lib/Lib/encodings/hex_codec.py
528
2309
""" Python 'hex_codec' Codec - 2-digit hex content transfer encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs, binascii ### Codec APIs def hex_encode(...
apache-2.0
sgenoud/scikit-learn
sklearn/mixture/tests/test_gmm.py
3
12260
import itertools import unittest import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal, \ assert_raises from scipy import stats from sklearn import mixture from sklearn.datasets.samples_generator import make_spd_matrix rng = np.random.RandomState(0) def test_sample_gaussian...
bsd-3-clause
katarzynamazur/esxi_scripts
copy_register_vms/lifesaver.py
1
1457
#!/usr/bin/env python3 import sys def help(): print("\nUsage:\n\t./{0} {1} {2}\n\n".format(sys.argv[0], "change_from", "change_to")) if __name__ == "__main__": if len(sys.argv) != 4 : help() else: chgfrom = str(sys.argv[1]) chgto = str(sys.argv[2]) snapnum = str(sys.arg...
gpl-3.0
OpenMined/PySyft
packages/grid/apps/domain/src/main/core/manager/user_manager.py
2
4499
# stdlib from typing import Dict from typing import List from typing import Union # third party from bcrypt import checkpw from bcrypt import gensalt from bcrypt import hashpw # grid relative from ..database.users.user import User from ..exceptions import AuthorizationError from ..exceptions import InvalidCredentials...
apache-2.0
rukin5197/android_kernel_lge_m3s
tools/perf/scripts/python/syscall-counts.py
944
1429
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
crazy-canux/xplugin_nagios
plugin/plugins/exchange_2010/src/check_exchange_mounts.py
1
1410
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # Copyright (C) Canux CHENG <canuxcheng@gmail.com> # # 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 li...
gpl-2.0
Tithen-Firion/youtube-dl
youtube_dl/extractor/unistra.py
87
2158
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import qualities class UnistraIE(InfoExtractor): _VALID_URL = r'https?://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(?P<id>\d+)' _TESTS = [ { 'url': 'http://utv.unistra.fr/video.php?id...
unlicense
pyecs/servo
components/script/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py
106
1379
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" callback Function = any(any... arguments); interface TestTreatNonCallableAsNull1 { [TreatNonCallableAsNull] attribute Function? onfoo; attribute Function? onbar; }; """) results = parser.finish() ...
mpl-2.0
Dhivyap/ansible
lib/ansible/plugins/action/slxos_config.py
13
1149
# # (c) 2018 Extreme Networks 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. # # Ans...
gpl-3.0
comocheng/RMG-Py
examples/rmg/liquid_phase/input.py
2
1093
# Data sources database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = ['training'], kineticsFamilies = 'default', kineticsEstimator = 'rate rules', ) # Constraints on generated species generatedSpeciesConstraints( maximumRad...
mit
jelugbo/ddi
common/djangoapps/util/tests/test_date_utils.py
52
7723
# -*- coding: utf-8 -*- """ Tests for util.date_utils """ from datetime import datetime, timedelta, tzinfo import unittest import ddt from mock import patch from nose.tools import assert_equals, assert_false # pylint: disable=E0611 from pytz import UTC from util.date_utils import ( get_default_time_display, get...
agpl-3.0
MetSystem/shadowsocks
shadowsocks/shell.py
10
12590
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
vickyting0910/opengeocoding
2reinter.py
1
3991
import pandas as pd import glob import time import numpy as num inter=sorted(glob.glob('*****.csv')) w='*****.xlsx' table1=pd.read_excel(w, '*****', index_col=None, na_values=['NA']).fillna(0) w='*****.csv' tab=pd.read_csv(w).fillna(0) tab.is_copy = False pd.options.mode.chained_assignment = None t1=time.time() ...
bsd-2-clause
sodexis/odoo
addons/purchase/__openerp__.py
259
3787
# -*- 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
b0ri5/fssw-googlecode
scons/scons-local-2.0.1/SCons/Scanner/LaTeX.py
61
15879
"""SCons.Scanner.LaTeX This module implements the dependency scanner for LaTeX code. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation f...
lgpl-3.0
AnthonyBroadCrawford/servo
tests/wpt/harness/wptrunner/metadata.py
38
11541
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import shutil import sys import tempfile import types import uuid from collections import defaultdict from mo...
mpl-2.0
farert/farert
db/scripts/distance_exp.py
1
4515
#!python3.0.1 # -*- coding: utf-8 -*- """ 指定路線、駅1から駅2までの営業キロ、計算キロを得る """ import sys import os import jrdb import time t0 = time.time() sql = """ select (select max(sales_km) from t_lines where line_id=?1 and (station_id=?2 or station_id=?3))- (select min(sales_km) from t_lines where line_id=?1 and (station_id=...
gpl-3.0
EricMuller/mynotes-backend
requirements/twisted/Twisted-17.1.0/docs/core/examples/simpleclient.py
2
1262
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ An example client. Run simpleserv.py first before running this. """ from __future__ import print_function from twisted.internet import reactor, protocol # a client protocol class EchoClient(protocol.Protocol): """Once connected, send...
mit
yrizk/yrizk.github.io
myvenv/lib/python3.4/site-packages/pip/_vendor/distlib/util.py
203
51453
# # Copyright (C) 2012-2014 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import shutil import socket import...
apache-2.0
askeing/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_handshake.py
452
7134
#!/usr/bin/env python # # Copyright 2012, 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...
mpl-2.0
fredericlepied/ansible
lib/ansible/modules/storage/netapp/netapp_e_hostgroup.py
10
13965
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, NetApp, Inc # 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.0', 'sta...
gpl-3.0
gemmaan/moviesenal
Hasil/Lib/site-packages/pip/_vendor/cachecontrol/controller.py
327
13024
""" The httplib2 algorithms ported for use with requests. """ import logging import re import calendar import time from email.utils import parsedate_tz from pip._vendor.requests.structures import CaseInsensitiveDict from .cache import DictCache from .serialize import Serializer logger = logging.getLogger(__name__) ...
mit
jeenalee/servo
tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/msgutil.py
658
7598
# Copyright 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 f...
mpl-2.0
olegk0/rk3188-kernel
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
gdgellatly/OCB1
addons/pad/py_etherpad/__init__.py
505
7804
"""Module to talk to EtherpadLite API.""" import json import urllib import urllib2 class EtherpadLiteClient: """Client to talk to EtherpadLite API.""" API_VERSION = 1 # TODO probably 1.1 sometime soon CODE_OK = 0 CODE_INVALID_PARAMETERS = 1 CODE_INTERNAL_ERROR = 2 CODE_INVALID_FUNCTION = 3 ...
agpl-3.0
AndiDog/git-cola
cola/widgets/common.py
3
2073
from __future__ import division, absolute_import, unicode_literals from ..i18n import N_ from .. import cmds from .. import hotkeys from .. import icons from .. import qtutils from .. import utils def cmd_action(parent, cmd, context, fn, *keys): """Wrap a standard Command object in a QAction This function a...
gpl-2.0
jimsimon/sky_engine
build/android/pylib/sdk/aapt.py
25
1183
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This module wraps the Android Asset Packaging Tool.""" import os from pylib import cmd_helper from pylib import constants from pylib.utils import timeou...
bsd-3-clause
appcelerator/entourage
components/services/pylons/appcelerator-module/setup.py
1
1264
from setuptools import setup, find_packages setup(name='Appcelerator', version='0.0.0', description="Python version of the Appcelerator web application framework for building fast, dynamic, AJAX based web 2.0 applications.", long_description=""" """, classifiers=[ 'Development S...
apache-2.0
olapaola/olapaola-android-scripting
python/src/Lib/CGIHTTPServer.py
59
12687
"""CGI-savvy HTTP Server. This module builds on SimpleHTTPServer by implementing GET and POST requests to cgi-bin scripts. If the os.fork() function is not present (e.g. on Windows), os.popen2() is used as a fallback, with slightly altered semantics; if that function is not present either (e.g. on Macintosh), only Py...
apache-2.0
AICP/external_chromium_org
build/android/pylib/utils/reraiser_thread_unittest.py
99
2368
# 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. """Unittests for reraiser_thread.py.""" import threading import unittest from pylib.utils import reraiser_thread from pylib.utils import watchdog_timer c...
bsd-3-clause
leansoft/edx-platform
common/djangoapps/course_modes/migrations/0008_auto__del_field_coursemodesarchive_description__add_field_coursemode_s.py
102
3098
# -*- 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 'CourseMode.sku' db.add_column('course_modes_coursemode', 'sku', self.g...
agpl-3.0
mic4ael/indico
indico/modules/rb/notifications/blockings.py
1
1361
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from flask import render_template from indico.core.notifications import email_sender, make_email @email...
mit