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
Argon-Zhou/django
django/conf/locale/de/formats.py
504
1100
# -*- 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 = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
bsd-3-clause
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/distutils/tests/test_install_headers.py
147
1264
"""Tests for distutils.command.install_headers.""" import sys import os import unittest import getpass from distutils.command.install_headers import install_headers from distutils.tests import support from test.support import run_unittest class InstallHeadersTestCase(support.TempdirManager, ...
apache-2.0
Medigate/cutiuta-server
cutiuta-server/env/lib/python3.4/site-packages/pip/_vendor/lockfile/linklockfile.py
466
2649
from __future__ import absolute_import import time import os from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class LinkLockFile(LockBase): """Lock access to a file using atomic property of link(2). >>> lock = LinkLockFile('somefile') >>> lock = LinkL...
gpl-3.0
Aasmi/scikit-learn
sklearn/feature_selection/variance_threshold.py
238
2594
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: 3-clause BSD import numpy as np from ..base import BaseEstimator from .base import SelectorMixin from ..utils import check_array from ..utils.sparsefuncs import mean_variance_axis from ..utils.validation import check_is_fitted class VarianceThreshold(BaseEstim...
bsd-3-clause
XENON1T/pax
pax/trigger_plugins/FindSignals.py
1
10320
import numpy as np import numba from pax.trigger import TriggerPlugin from pax.datastructure import TriggerSignal from pax.dsputils import adc_to_pe # Interrupts thrown by the signal finder # Negative, since positive numbers indicate number of signals found during normal operation SIGNAL_BUFFER_FULL = -1 SAVE_DARK_MON...
bsd-3-clause
oblique-labs/pyVM
rpython/rtyper/normalizecalls.py
1
16966
from rpython.annotator import model as annmodel, description from rpython.flowspace.argument import Signature from rpython.flowspace.model import (Variable, Constant, Block, Link, checkgraph, FunctionGraph, SpaceOperation) from rpython.rlib.objectmodel import ComputedIntSymbolic from rpython.rtyper.error import Typ...
mit
kleientertainment/ds_mod_tools
pkg/win32/Python27/Lib/CGIHTTPServer.py
2
13514
"""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), ...
mit
betatim/osf-cli
osfclient/__main__.py
1
4648
from __future__ import print_function import sys import six import argparse from textwrap import dedent from .cli import clone, fetch, list_, remove, upload, init from . import __version__ def main(): description = dedent(""" osf is a command-line program to up and download files from osf.io. These ...
bsd-3-clause
culot/homebooking
storage.py
1
15856
import logging as log import sqlite3 class Database(): "Class to manage interactions with database" def __init__(self): self.connection = sqlite3.connect('book.db') self.connection.row_factory = sqlite3.Row try: self.sanity_checks() except Exception: sel...
bsd-3-clause
rationalAgent/edx-platform-custom
cms/djangoapps/contentstore/views/requests.py
2
1047
from django.http import HttpResponse from mitxmako.shortcuts import render_to_string, render_to_response __all__ = ['edge', 'event', 'landing'] # points to the temporary course landing page with log in and sign up def landing(request, org, course, coursename): return render_to_response('temp-course-landing.html'...
agpl-3.0
eli261/jumpserver
apps/orgs/mixins/api.py
1
1880
# -*- coding: utf-8 -*- # from django.shortcuts import get_object_or_404 from rest_framework.viewsets import ModelViewSet from rest_framework_bulk import BulkModelViewSet from common.mixins import IDInCacheFilterMixin from ..utils import set_to_root_org from ..models import Organization __all__ = [ 'RootOrgViewMi...
gpl-2.0
jsteemann/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/lib-tk/tkColorChooser.py
149
1786
# tk common colour chooser dialogue # # this module provides an interface to the native color dialogue # available in Tk 4.2 and newer. # # written by Fredrik Lundh, May 1997 # # fixed initialcolor handling in August 1998 # # # options (all have default values): # # - initialcolor: colour to mark as selected when dial...
apache-2.0
CyanogenMod/android_external_chromium_org_third_party_skia
platform_tools/android/bin/download_utils.py
149
8464
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A library to assist automatically downloading files. This library is used by scripts that download tarballs, zipfiles, etc. as...
bsd-3-clause
ChinaMassClouds/copenstack-server
openstack/src/horizon-2014.2/openstack_dashboard/dashboards/project/databases/tests.py
7
14628
# Copyright 2013 Mirantis Inc. # Copyright 2013 Rackspace Hosting. # # 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 # # Unles...
gpl-2.0
beafus/Video-Player
project/server/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py
2637
9586
#!/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. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked...
mit
umangv/LitHub
LitHub/fbconnect/forms.py
1
2017
# Copyright 2011 Kalamazoo College Computer Science Club # <kzoo-cs-board@googlegroups.com> # This file is part of LitHub. # # LitHub 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 v...
gpl-3.0
indefini/linux
tools/perf/scripts/python/export-to-postgresql.py
217
17826
# export-to-postgresql.py: export perf data to a postgresql database # Copyright (c) 2014, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # Thi...
gpl-2.0
hyperwang/bitcoin
contrib/devtools/security-check.py
3
6400
#!/usr/bin/python2 ''' Perform basic ELF security checks on a series of executables. Exit status will be 0 if successful, and the program will be silent. Otherwise the exit status will be 1 and it will log which executables failed which checks. Needs `readelf` (for ELF) and `objdump` (for PE). ''' from __future__ impor...
mit
praekelt/ummeli
ummeli/base/migrations/0010_auto__add_field_skill_level.py
1
11741
# encoding: 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 'Skill.level' db.add_column('base_skill', 'level', self.gf('django.db.models.fields.Positiv...
bsd-3-clause
okolisny/integration_tests
cfme/tests/infrastructure/test_host_drift_analysis.py
1
4947
# -*- coding: utf-8 -*- import pytest from cfme import test_requirements from cfme.configure.tasks import Tasks from cfme.fixtures import pytest_selenium as sel from cfme.infrastructure import host as host_obj from cfme.infrastructure.provider import InfraProvider from cfme.web_ui import DriftGrid, toolbar as tb from...
gpl-2.0
BaconPancakes/valor
lib/websockets/client.py
11
6563
""" The :mod:`websockets.client` module defines a simple WebSocket client API. """ import asyncio import collections.abc import email.message from .exceptions import InvalidHandshake from .handshake import build_request, check_response from .http import USER_AGENT, read_response from .protocol import CONNECTING, OPE...
gpl-3.0
gumyns/home-automation
hardware_old/arm/toolchainGenerator.py
1
2209
#!/usr/bin/python import os import sys import subprocess devices = ['STM32F030x6'] template = """set(ENV{{PATH}} {gcc_dir}) set(GCC_ARM_DIRECTORY {gcc_dir}) add_definitions(-D{device}) set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_SYSTEM_PROCESSOR arm) set(CMAKE_C_COMPILER_WORKS 1) set(CMAKE_CXX_COMPILER_WORKS 1) set(C...
apache-2.0
CharlieGreenman/pixelatorV2_with_react
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 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 easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
mit
ActionAdam/osmc
package/mediacenter-addon-osmc/src/script.module.osmcsetting.apfstore/resources/lib/apf_gui.py
9
4895
# KODI modules import xbmc import xbmcaddon import xbmcgui # Standard modules import sys import os import socket import json addonid = "script.module.osmcsetting.apfstore" __addon__ = xbmcaddon.Addon(addonid) __path__ = xbmc.translatePath(xbmcaddon.Addon(addonid).getAddonInfo('path')) # Custom module path sys....
gpl-2.0
Dhivyap/ansible
lib/ansible/modules/cloud/google/gcp_filestore_instance_info.py
3
7713
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
scenarios/tensorflow
tensorflow/python/kernel_tests/ctc_loss_op_test.py
10
10795
# 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
mateuszmalinowski/visual_turing_test-tutorial
kraino/utils/print_metrics.py
1
5116
#!/usr/bin/env python from __future__ import print_function """ Selects and prints metrics. Author: Mateusz Malinowski Email: mmalinow@mpi-inf.mpg.de """ import os from uuid import uuid4 from compute_wups import get_metric_score as wups_score from compute_wups import get_class_metric_score as class_wups_score fro...
mit
manish211/coveralls-python
tests/test_cli.py
1
2270
# coding: utf-8 import os from mock import patch, call import pytest import coveralls from coveralls.api import CoverallsException import coveralls.cli @patch.dict(os.environ, {'TRAVIS': 'True'}, clear=True) @patch.object(coveralls.cli.log, 'info') @patch.object(coveralls.Coveralls, 'wear') def test_debug(mock_wear...
mit
kaedroho/django
tests/i18n/test_compilation.py
12
9956
import gettext as gettext_module import os import stat import unittest from io import StringIO from pathlib import Path from subprocess import run from unittest import mock from django.core.management import ( CommandError, call_command, execute_from_command_line, ) from django.core.management.commands.makemessage...
bsd-3-clause
ambrosef/HLx_Examples
Acceleration/memcached/regressionSims/testgen/long/memtest_regressions_long.py
2
5787
#!/usr/bin/python import memlib ## EDIT HERE ################################################################### keySizes = [1,3,4,5,7,8,9,10,12,13,15,16,17,24,25,28,84,128] #valueSizes = [1,3,4,5,8,9,10,12,13,16,17,24,28,184,208,1024] #valueSizes = [1,3,4,5,8,9,10,12,13,16,17,24,28,184,208,1015] valueSizes = [184,3...
bsd-3-clause
Cinntax/home-assistant
homeassistant/components/channels/media_player.py
2
9547
"""Support for interfacing with an instance of getchannels.com.""" import logging import voluptuous as vol from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA from homeassistant.components.media_player.const import ( DOMAIN, MEDIA_TYPE_CHANNEL, MEDIA_TYPE_EPISODE, MEDI...
apache-2.0
mewtaylor/django
django/contrib/gis/forms/fields.py
504
4316
from __future__ import unicode_literals from django import forms from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.utils.translation import ugettext_lazy as _ from .widgets import OpenLayersWidget class GeometryField(forms.Field): """ This is the basic form field for a Geometry. A...
bsd-3-clause
azul-cloud/serendipity
storages/backends/symlinkorcopy.py
19
2625
import os from django.conf import settings from django.core.files.storage import FileSystemStorage __doc__ = """ I needed to efficiently create a mirror of a directory tree (so that "origin pull" CDNs can automatically pull files). The trick was that some files could be modified, and some could be identical to the ...
mit
TeachAtTUM/edx-platform
openedx/core/djangoapps/theming/helpers.py
10
11228
""" Helpers for accessing comprehensive theming related variables. This file is imported at startup. Imports of models or things which import models will break startup on Django 1.9+. If you need models here, please import them inside the function which uses them. """ import os import re from logging import getLogger ...
agpl-3.0
tcpcloud/monitoring-for-openstack
oschecks/ceilometer.py
4
2011
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Openstack Monitoring script for Sensu / Nagios # # Copyright © 2013-2014 eNovance <licensing@enovance.com> # # Author: Mehdi Abaakouk <mehdi.abaakouk@enovance.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in ...
apache-2.0
kumar303/zamboni
mkt/site/monitors.py
3
9592
import os import socket import StringIO import tempfile import time import traceback from django.conf import settings import commonware.log import elasticsearch import requests from cache_nuggets.lib import memoize from PIL import Image from lib.crypto import packaged, receipt from lib.crypto.packaged import Signing...
bsd-3-clause
C00kiie/Youtube-Mp3-telegram-bot
youtube_dl/extractor/viki.py
29
13668
# coding: utf-8 from __future__ import unicode_literals import hashlib import hmac import itertools import json import re import time from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, parse_age_limit, parse_iso8601, sanitized_Request, ) class VikiBaseIE(InfoExt...
mit
mostaphaRoudsari/Honeybee
src/Honeybee_Read Annual Result I.py
1
44279
# # Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari # # This file is part of Honeybee. # # Copyright (c) 2013-2020, Mostapha Sadeghipour Roudsari <mostapha@ladybug.tools> # Honeybee is free software; you can redistribute it and/or modify # it under the terms of the GNU G...
gpl-3.0
grap/account-financial-tools
__unported__/account_compute_tax_amount/account_move_line.py
7
3399
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2013 Camptocamp (http://www.camptocamp.com) # All Right Reserved # # Author : Vincent Renaville (Camptocamp) # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
risteon/nimble
nimble/sources/datasets.py
1
1222
# -*- coding: utf-8 -*- from __future__ import absolute_import import os from ..composition import LabeledDataSource from .images import ImageFileSource from .labels import TransformMatrixSource class KittiOdometrySource(LabeledDataSource): """Read images and ground truth poses of the Kitti dataset. http:/...
mit
daevaorn/sentry
src/sentry/migrations/0234_auto__add_savedsearchuserdefault__add_unique_savedsearchuserdefault_pr.py
9
43642
# -*- 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 'SavedSearchUserDefault' db.create_table('sentry_savedsear...
bsd-3-clause
JackWoot/E2E-Messenger
Server/passlib/handlers/sun_md5_crypt.py
19
13964
"""passlib.handlers.sun_md5_crypt - Sun's Md5 Crypt, used on Solaris .. warning:: This implementation may not reproduce the original Solaris behavior in some border cases. See documentation for details. """ #============================================================================= # imports #========...
gpl-2.0
enotx/ebook_librarian
src/classification.py
1
13177
#!/usr/bin/env python # -*- coding: utf-8 -*- from PyQt5.QtCore import (QAbstractItemModel, QFile, QIODevice, QItemSelectionModel, QModelIndex, Qt, QRect, QCoreApplication, QMetaObject) from PyQt5 import QtWidgets from PyQt5.uic import loadUi from config import CLASSIFICATION_FILE_NAME class TreeItem(object...
gpl-3.0
Jet-Streaming/gyp
pylib/gyp/easy_xml.py
3
4960
# Copyright (c) 2011 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. import re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has cha...
bsd-3-clause
stanley89/helios-server
helios/security.py
3
5315
""" Helios Security -- mostly access control Ben Adida (ben@adida.net) """ # nicely update the wrapper function from functools import update_wrapper from django.core.urlresolvers import reverse from django.core.exceptions import * from django.http import * from django.conf import settings from models import * from ...
apache-2.0
soxfmr/engineshooter
engineshooter/spiders/engine/baidu.py
1
6685
# -*- coding: utf-8 -*- import re import os import scrapy import random import string import tempfile import webbrowser from os.path import join from urllib import urlencode from StringIO import StringIO from engineshooter.items import SearchResultItem class BaiduEngine: name = 'baidu' BASE_URL = 'https://ww...
mit
vkscool/nupic
tests/unit/nupic/algorithms/nab_detector_test.py
9
10846
#! /usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions...
gpl-3.0
ruziniu/v2ex
main.py
15
57245
#!/usr/bin/env python # coding=utf-8 import base64 import os import re import time import datetime import hashlib import urllib import string import random import pickle import math from google.appengine.ext import webapp from google.appengine.api import memcache from google.appengine.api import urlfetch from google....
bsd-3-clause
wileeam/airflow
airflow/providers/microsoft/azure/operators/adls_list.py
5
2549
# # 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...
apache-2.0
nhuthep91/aBasic
plugins/ti.alloy/plugin.py
1729
5251
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
apache-2.0
mclaughlin6464/pdnn
models/dnn_reg.py
1
11677
''' @Author Sean McLaughiln This is my copy of the dnn module. I'm adding some features so I can use DNN for regression rather than just classification. ''' import cPickle import gzip import os import sys import time import collections import numpy import theano import theano.tensor as T from theano.tensor.shared_ra...
apache-2.0
nevercast/home-assistant
homeassistant/components/sensor/sabnzbd.py
3
4100
""" homeassistant.components.sensor.sabnzbd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monitors SABnzbd NZB client API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.sabnzbd/ """ from datetime import timedelta import logging from homeassistant.help...
mit
creativcoder/servo
tests/wpt/css-tests/tools/wptserve/wptserve/constants.py
141
4619
from . import utils content_types = utils.invert_dict({"text/html": ["htm", "html"], "application/json": ["json"], "application/xhtml+xml": ["xht", "xhtm", "xhtml"], "application/xml": ["xml"], ...
mpl-2.0
jGaboardi/LP_MIP
Gurobi_Dual_Standard.py
1
3689
''' GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. ''' # Building a Standard Dual Linear Program...
lgpl-3.0
OpenMined/PySyft
packages/syft/src/syft/lib/pandas/categorical_dtype.py
1
1173
# third party import pandas as pd # syft relative from ...generate_wrapper import GenerateWrapper from ...lib.python.list import List from ...lib.python.primitive_factory import PrimitiveFactory from ...proto.lib.pandas.categorical_pb2 import ( PandasCategoricalDtype as PandasCategoricalDtype_PB, ) def object2pr...
apache-2.0
boltnev/iktomi
iktomi/forms/fields.py
3
14203
# -*- coding: utf-8 -*- import logging import six import cgi import re from . import convs, widgets from ..utils import cached_property from collections import OrderedDict from .perms import FieldPerm logger = logging.getLogger(__name__) __all__ = ['BaseField', 'Field', 'FieldBlock', 'FieldSet', 'FieldList', 'FileF...
mit
catkin/xylem
xylem/load_url.py
1
2512
# Copyright 2014 Open Source Robotics Foundation, 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 ...
apache-2.0
firebitsbr/infernal-twin
build/pillow/Scripts/painter.py
11
2037
#!/usr/bin/env python # # The Python Imaging Library # $Id$ # # this demo script illustrates pasting into an already displayed # photoimage. note that the current version of Tk updates the whole # image everytime we paste, so to get decent performance, we split # the image into a set of tiles. # try: from tkinter...
gpl-3.0
Neamar/django
django/core/files/storage.py
281
13339
import errno import os import warnings from datetime import datetime from django.conf import settings from django.core.exceptions import SuspiciousFileOperation from django.core.files import File, locks from django.core.files.move import file_move_safe from django.utils._os import abspathu, safe_join from django.utils...
bsd-3-clause
Mirantis/swift-encrypt
swift/common/db_replicator.py
3
29348
# Copyright (c) 2010-2012 OpenStack, 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 to ...
apache-2.0
acshan/odoo
openerp/addons/base/res/__init__.py
384
1261
# -*- 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 GNU...
agpl-3.0
ruschelp/cortex-vfx
python/IECoreMaya/TemporaryAttributeValues.py
12
4259
########################################################################## # # Copyright (c) 2009-2012, Image Engine Design 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: # # * Redis...
bsd-3-clause
jeremiahmarks/sl4a
python/src/Lib/test/test_netrc.py
99
1116
import netrc, os, unittest, sys from test import test_support TEST_NETRC = """ machine foo login log1 password pass1 account acct1 macdef macro1 line1 line2 macdef macro2 line3 line4 default login log2 password pass2 """ temp_filename = test_support.TESTFN class NetrcTestCase(unittest.TestCase): def setUp ...
apache-2.0
elmerdpadilla/iv
addons/hw_escpos/escpos/exceptions.py
151
1974
""" ESC/POS Exceptions classes """ import os class Error(Exception): """ Base class for ESC/POS errors """ def __init__(self, msg, status=None): Exception.__init__(self) self.msg = msg self.resultcode = 1 if status is not None: self.resultcode = status def __st...
agpl-3.0
nuagenetworks/vspk-python
vspk/v5_0/nuvirtualfirewallrule.py
1
40053
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
bsd-3-clause
jomolinare/kobocat
onadata/apps/stats/views.py
3
1326
from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.shortcuts import get_object_or_404 from django.shortcuts import render from onadata.apps.logger.models import XForm from onadata.apps...
bsd-2-clause
rangma/p2pool
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
lshain-android-source/external-chromium_org
third_party/tlslite/tlslite/utils/keyfactory.py
361
8791
"""Factory functions for asymmetric cryptography. @sort: generateRSAKey, parseXMLKey, parsePEMKey, parseAsPublicKey, parseAsPrivateKey """ from compat import * from RSAKey import RSAKey from Python_RSAKey import Python_RSAKey import cryptomath if cryptomath.m2cryptoLoaded: from OpenSSL_RSAKey import OpenSSL_RSAK...
bsd-3-clause
abergeron/pylearn2
pylearn2/training_algorithms/learning_rule.py
32
17648
""" A module containing different learning rules for use with the SGD training algorithm. """ import numpy as np import warnings from theano.compat import six from theano import config from theano import tensor as T from pylearn2.compat import OrderedDict from pylearn2.space import NullSpace from pylearn2.train_exten...
bsd-3-clause
optima-ict/odoo
openerp/addons/base/module/module.py
11
38925
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from docutils import nodes from docutils.core import publish_string from docutils.transforms import Transform, writer_aux from docutils.writers.html4css1 import Writer import importlib import logging from operator import ...
agpl-3.0
ikoula/cloudstack
test/integration/smoke/test_routers_iptables_default_policy.py
1
24995
# 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...
gpl-2.0
aksalj/kernel_rpi
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-2.0
stephen144/odoo
addons/l10n_be_invoice_bba/partner.py
47
1364
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. from openerp.osv import fields, osv import time from openerp.tools.translate import _ class res_partner(osv.osv): """ add field to indicat...
agpl-3.0
shakamunyi/solum
solum/common/safe_utils.py
37
2103
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
apache-2.0
xiaotdl/ansible
lib/ansible/plugins/callback/minimal.py
87
3499
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
sdgathman/cjdns
node_build/dependencies/libuv/build/gyp/pylib/gyp/xml_fix.py
2767
2174
# Copyright (c) 2011 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. """Applies a fix to CR LF TAB handling in xml.dom. Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 Working around this: http://bugs.python.or...
gpl-3.0
GDGLima/contentbox
third_party/django/contrib/messages/storage/fallback.py
627
2171
from django.contrib.messages.storage.base import BaseStorage from django.contrib.messages.storage.cookie import CookieStorage from django.contrib.messages.storage.session import SessionStorage class FallbackStorage(BaseStorage): """ Tries to store all messages in the first backend, storing any unstored mes...
apache-2.0
thiriel/maps
venv/lib/python2.7/site-packages/django/core/files/temp.py
536
1819
""" The temp module provides a NamedTemporaryFile that can be re-opened on any platform. Most platforms use the standard Python tempfile.TemporaryFile class, but MS Windows users are given a custom class. This is needed because in Windows NT, the default implementation of NamedTemporaryFile uses the O_TEMPORARY flag, ...
bsd-3-clause
motlib/mqtt-ts
src/sensors/sysinfo.py
1
1526
'''System info related sensor implementations.''' from sensors.sbase import SensorBase from datetime import datetime class NetTraffic(SensorBase): '''Measures the average rx and tx throughput of a network interface.''' def __init__(self, scfg): super().__init__(scfg) self.device = scfg['de...
gpl-3.0
nimbusproject/epumgmt
src/python/epumgmt/sbin/most-recent-log.py
1
1325
#!/usr/bin/env python import os import sys import time from epumgmt.sbin import sbin_common def get_logfiledir(p): logfiledir = p.get_conf_or_none("logging", "logfiledir") if not logfiledir: sys.stderr.write("There is no logfiledir configuration") return None return sbin_common.apply_vardi...
apache-2.0
Aperturedimigo/Complete
QT/GUI_Privasee_notYourFace.py
1
1271
import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import QPainter from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import * from PyQt5.QtCore import * windowSizeX = 440 windowSizeY = 250 fontMajor = "Arial" fontMinor = "Dotum" class Form(QWidget): # __init__ : 생성자 # parent : 부모객체 ...
mit
jumpstarter-io/neutron
neutron/plugins/embrane/l2base/ml2/ml2_support.py
2
2160
# Copyright 2014 Embrane, Inc. # 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...
apache-2.0
diderson/couchapp
docs/conf.py
2
9433
# -*- coding: utf-8 -*- # # CouchApp documentation build configuration file, created by # sphinx-quickstart on Wed Aug 5 15:00:02 2015. # # 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 # autogenerated file. # # ...
apache-2.0
brandond/ansible
lib/ansible/modules/cloud/opennebula/one_image.py
52
11657
#!/usr/bin/python # -*- coding: utf-8 -*- # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type """ (c) 2018, Milan Ilic <milani@nordeus.com> This file is part of Ansible Ansible is free software: you can redistribute it and/or modify it under the ter...
gpl-3.0
pferreir/indico-backup
indico/MaKaC/authentication/LocalAuthentication.py
2
2188
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico 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; eith...
gpl-3.0
foursquare/commons-old
src/python/twitter/pants/tasks/markdown_to_html.py
1
9585
# ================================================================================================== # Copyright 2012 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
kennedyshead/home-assistant
tests/components/zwave/conftest.py
6
2428
"""Fixtures for Z-Wave tests.""" from unittest.mock import AsyncMock, MagicMock, patch import pytest from homeassistant.components.zwave import const from tests.components.light.conftest import mock_light_profiles # noqa: F401 from tests.mock.zwave import MockNetwork, MockNode, MockOption, MockValue @pytest.fixtu...
apache-2.0
skia-dev/oss-fuzz
projects/urllib3/fuzz_urlparse.py
3
1029
#!/usr/bin/python3 # Copyright 2021 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 agr...
apache-2.0
RowenStipe/qTox
tools/update-server/deployUpdateFTP_64.py
21
1100
#!/usr/bin/python2.7 # This script deploys a qTox update to an FTP server. # Pass the path to the root of the local update server as argument, no spaces allowed import sys import os target = 'win64' prefix = '/qtox/'+target+'/' uploadcmd1 = "bash -c '"+'ftp -n tux3-dev.tox.chat 0<<<"`echo -ne "user qtox-win-update-u...
gpl-3.0
ICGC-TCGA-PanCancer/pancancer-sandbox
pcawg_metadata_parser/generate_all_donors.py
1
24480
#!/usr/bin/env python import sys import os import re import glob import xmltodict import json import yaml import copy import logging from argparse import ArgumentParser from argparse import RawDescriptionHelpFormatter from elasticsearch import Elasticsearch from collections import OrderedDict import datetime import d...
gpl-2.0
jeffmarcom/checkbox
checkbox/lib/conversion.py
2
5369
# # This file is part of Checkbox. # # Copyright 2008 Canonical Ltd. # # Checkbox 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. # # C...
gpl-3.0
RaoUmer/django
django/core/files/storage.py
97
10905
import os import errno try: from urllib.parse import urljoin except ImportError: # Python 2 from urlparse import urljoin import itertools from datetime import datetime from django.conf import settings from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation from django.core.files import...
bsd-3-clause
igor-rangel7l/igorrangel.repository
plugin.video.SportsDevil/lib/utils/xbmcUtils.py
27
2568
# -*- coding: utf-8 -*- import xbmcgui, xbmc, xbmcplugin enable_debug = False ####################################### # Xbmc Helpers ####################################### def select(title, menuItems): select = xbmcgui.Dialog().select(title, menuItems) if select == -1: return None else: ...
gpl-2.0
bplancher/odoo
addons/sale_stock/tests/test_sale_stock.py
18
12679
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.addons.sale.tests.test_sale_common import TestSale from openerp.exceptions import UserError class TestSaleStock(TestSale): def test_00_sale_stock_invoice(self): """ Test SO's changes whe...
agpl-3.0
tbabej/astropy
astropy/nddata/mixins/tests/test_ndslicing.py
2
5027
# Licensed under a 3-clause BSD style license - see LICENSE.rst # TEST_UNICODE_LITERALS from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from numpy.testing import assert_array_equal from ... import NDData, NDSlicingMixin from ...nduncert...
bsd-3-clause
ajs124/esp-idf
tools/idf_monitor.py
3
20709
#!/usr/bin/env python # # esp-idf serial output monitor tool. Does some helpful things: # - Looks up hex addresses in ELF file with addr2line # - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R) # - Run "make flash" (Ctrl-T Ctrl-F) # - Run "make app-flash" (Ctrl-T Ctrl-A) # - If gdbstub output is detected, gdb is automa...
apache-2.0
zicklag/godot
doc/tools/makerst.py
4
16059
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import sys import os import xml.etree.ElementTree as ET input_list = [] for arg in sys.argv[1:]: if arg.endswith(os.sep): arg = arg[:-1] input_list.append(arg) if len(input_list) < 1: print('usage: makerst.py <path to folders> and/or <p...
mit
tkaitchuck/nupic
build_system/contrib/xcode-setup-install.py
1
1372
#!/usr/bin/env python import os import sys import string doClean = ('clean' in sys.argv) or ('uninstall' in sys.argv) rootDir = os.getcwd() buildSystemDir = os.path.join(rootDir, 'build_system') # Generate the configure input files. setupCmd = 'python ' + os.path.join(buildSystemDir, 'setup.py') + ' --autogen' \ ...
gpl-3.0
boegel/easybuild-easyblocks
easybuild/easyblocks/d/dolfin.py
1
15555
## # Copyright 2009-2020 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 (F...
gpl-2.0
cpollard1001/FreeCAD_sf_master
src/Mod/TemplatePyMod/MengerSponge.py
27
3238
# Script to create a Menger sponge # (c) 2012 Werner Mayer LGPL # The script is based on the work of daxmick at # http://forum.freecadweb.org/viewtopic.php?f=3&t=2307 import threading import Mesh, MeshGui from FreeCAD import Base # Create a global mesh and make copies of them # This makes the algorithm faster by ~60...
lgpl-2.1