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
jmacmahon/invenio
modules/webstyle/lib/goto_plugins/goto_plugin_cern_hr_documents.py
3
7382
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
ankit318/appengine-mapreduce
python/test/mapreduce/status_test.py
12
20599
#!/usr/bin/env 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 o...
apache-2.0
katsikas/gnuradio
grc/gui/BlockTreeWindow.py
7
7639
""" Copyright 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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...
gpl-3.0
tsgit/invenio
modules/bibauthorid/lib/bibauthorid_rabbit.py
2
10561
from operator import itemgetter from itertools import cycle, imap, chain, izip from invenio.bibauthorid_name_utils import compare_names as comp_names, \ create_matchable_name from invenio import bibauthorid_config as bconfig from invenio.bibauthorid_backinterface import get_authors_by_name, \ add_signature, get...
gpl-2.0
stosdev/zebra-supervisor
judge/models/profile.py
1
1441
# -*- coding: utf-8 -*- """Module containing judge user profiles and various utilities.""" from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible from django.db import models from django.contrib.auth.models import User from django.db.models.signals impor...
gpl-3.0
MDPvis/rlpy
rlpy/Representations/IndependentDiscretization.py
4
2174
"""Independent Discretization""" from .Representation import Representation import numpy as np __copyright__ = "Copyright 2013, RLPy http://acl.mit.edu/RLPy" __credits__ = ["Alborz Geramifard", "Robert H. Klein", "Christoph Dann", "William Dabney", "Jonathan P. How"] __license__ = "BSD 3-Clause" __auth...
bsd-3-clause
johndpope/tensorflow
tensorflow/python/summary/writer/event_file_writer.py
104
5848
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
backmari/moose
python/chigger/tests/line/line.py
6
1115
#!/usr/bin/env python #pylint: disable=missing-docstring ################################################################# # DO NOT MODIFY THIS HEADER # # MOOSE - Multiphysics Object Oriented Simulation Environment # # #...
lgpl-2.1
phobson/bokeh
scripts/version_update.py
1
2576
import os import re import sys def check_input(new_ver): """ Ensure that user input matches the format X.X.X """ pat = r'\d+.\d+.\d+' if not re.match(pat, new_ver): print("The new version must be in the format X.X.X (ex. '0.6.0')") return True def version_update(new_ver, file_array): ...
bsd-3-clause
pigeonflight/strider-plone
docker/appengine/lib/django-1.2/django/contrib/gis/tests/test_geoip.py
290
4204
import os, unittest from django.db import settings from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis.utils import GeoIP, GeoIPException # Note: Requires use of both the GeoIP country and city datasets. # The GEOIP_DATA path should be the only setting set (the directory # should contain links or ...
mit
jonathan-beard/edx-platform
lms/djangoapps/courseware/tests/tests.py
115
6821
""" Test for LMS courseware app. """ from textwrap import dedent from unittest import TestCase from django.core.urlresolvers import reverse import mock from nose.plugins.attrib import attr from opaque_keys.edx.locations import SlashSeparatedCourseKey from courseware.tests.helpers import LoginEnrollmentTestCase from x...
agpl-3.0
hariseldon99/archives
dtwa_ising_longrange/dtwa_ising_longrange/redirect_stdout.py
2
1292
import os import sys import contextlib def fileno(file_or_fd): fd = getattr(file_or_fd, 'fileno', lambda: file_or_fd)() if not isinstance(fd, int): raise ValueError("Expected a file (`.fileno()`) or a file descriptor") return fd @contextlib.contextmanager def stdout_redirected(to=os.devnull, stdou...
gpl-2.0
ashray/VTK-EVM
ThirdParty/Twisted/twisted/internet/wxsupport.py
60
1445
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # """Old method of wxPython support for Twisted. twisted.internet.wxreactor is probably a better choice. To use:: | # given a wxApp instance called myWxAppInstance: | from twisted.internet import wxsupport | wxsupport.install(myWxA...
bsd-3-clause
nwjs/chromium.src
third_party/android_platform/development/scripts/stack_core.py
2
24484
#!/usr/bin/env python # # Copyright (C) 2013 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
bsd-3-clause
ibinti/intellij-community
python/helpers/py2only/docutils/utils/math/tex2unichar.py
120
35109
# -*- coding: utf-8 -*- # LaTeX math to Unicode symbols translation dictionaries. # Generated with ``write_tex2unichar.py`` from the data in # http://milde.users.sourceforge.net/LUCR/Math/ # Includes commands from: wasysym, stmaryrd, mathdots, mathabx, esint, bbold, amsxtra, amsmath, amssymb, standard LaTeX mathacce...
apache-2.0
pmaigutyak/mp-shop
delivery/models.py
1
2389
from django.db import models from django.utils.translation import ugettext_lazy as _ class DeliveryMethod(models.Model): name = models.CharField(_('Name'), max_length=255) code = models.CharField(_('Code'), max_length=255, unique=True) def __str__(self): return self.name class Meta: ...
isc
mabotech/mabo.task
py/report/docx_gen.py
2
1230
# -*- coding: utf-8 -*- from docx import Document from docx.shared import Inches document = Document() document.add_heading(u'FT汽车', 0) p = document.add_paragraph(u'汽车工程研究院 ') p.add_run(u'试验中心').bold = True p.add_run(u'试验数据管理系统') p.add_run(u'项目二期。').italic = True document.add_heading(u'报告说明Heading, level 2', level...
mit
jcfr/mystic
examples/constraint1_example01.py
1
1202
#!/usr/bin/env python # # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 1997-2015 California Institute of Technology. # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/mystic/LICENSE """ Example: - Minimize R...
bsd-3-clause
leiferikb/bitpop
src/tools/telemetry/telemetry/core/forwarders/cros_forwarder.py
46
2295
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import subprocess from telemetry.core import forwarders from telemetry.core import util from telemetry.core.forwarders import do_nothing_forw...
gpl-3.0
joachimmetz/plaso
tests/parsers/winreg_plugins/windows_version.py
2
7444
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the WinVer Windows Registry plugin.""" import unittest from dfdatetime import filetime as dfdatetime_filetime from dfwinreg import definitions as dfwinreg_definitions from dfwinreg import fake as dfwinreg_fake from plaso.lib import definitions from plaso.pa...
apache-2.0
msiedlarek/grpc
src/python/grpcio/tests/unit/_links/_transmission_test.py
9
10243
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
sahpat229/POLLUTION
POLLUTION/settings.py
1
3175
""" Django settings for POLLUTION project. Generated by 'django-admin startproject' using Django 1.9.1. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os ...
mit
joshblum/django-with-audit
django/contrib/gis/geometry/test_data.py
364
2994
""" This module has the mock object definitions used to hold reference geometry for the GEOS and GDAL tests. """ import gzip import os from django.contrib import gis from django.utils import simplejson # This global used to store reference geometry data. GEOMETRIES = None # Path where reference test data is located...
bsd-3-clause
typesupply/dialogKit
examples/GlyphViewDemo.py
3
3938
from FL import * from dialogKit import * class GlyphViewDemo(object): def __init__(self): self.font= fl.font self.glyphs = {} for glyph in self.font.glyphs: self.glyphs[glyph.name] = glyph glyphNames = self.glyphs.keys() glyphNames.sort() # s...
mit
vaygr/ansible
lib/ansible/module_utils/facts/system/chroot.py
40
1029
# Copyright (c) 2017 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 import os from ansible.module_utils.facts.collector import BaseFactCollector def is_chroot(): ...
gpl-3.0
Stanford-Online/edx-platform
openedx/core/djangoapps/oauth_dispatch/dot_overrides/validators.py
10
5245
""" Classes that override default django-oauth-toolkit behavior """ from __future__ import unicode_literals from datetime import datetime from django.contrib.auth import authenticate, get_user_model from django.contrib.auth.backends import AllowAllUsersModelBackend as UserModelBackend from django.db.models.signals im...
agpl-3.0
abligh/xen4.2-minideb
tools/python/xen/xend/server/BlktapController.py
26
10719
# Copyright (c) 2005, XenSource Ltd. import string, re, os from xen.xend.server.blkif import BlkifController from xen.xend.XendLogging import log from xen.util.xpopen import xPopen3 phantomDev = 0; phantomId = 0; blktap1_disk_types = [ 'aio', 'sync', 'vmdk', 'ram', 'qcow', 'qcow2', 'ioemu...
gpl-2.0
zzliujianbo/shadowsocks
shadowsocks/utils.py
1
11775
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2014 clowwindy # # 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 u...
mit
mitchrule/Miscellaneous
Django_Project/django/Lib/site-packages/wheel/signatures/ed25519py.py
565
1695
# -*- coding: utf-8 -*- import warnings import os from collections import namedtuple from . import djbec __all__ = ['crypto_sign', 'crypto_sign_open', 'crypto_sign_keypair', 'Keypair', 'PUBLICKEYBYTES', 'SECRETKEYBYTES', 'SIGNATUREBYTES'] PUBLICKEYBYTES=32 SECRETKEYBYTES=64 SIGNATUREBYTES=64 Keypair = n...
mit
philipbl/home-assistant
homeassistant/components/sensor/serial_pm.py
17
2799
""" Support for particulate matter sensors connected to a serial port. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.serial_pm/ """ import logging import voluptuous as vol from homeassistant.const import CONF_NAME from homeassistant.helpers.ent...
mit
TheTimmy/spack
lib/spack/external/_pytest/tmpdir.py
12
4124
""" support for providing temporary directories to test functions. """ import re import pytest import py from _pytest.monkeypatch import MonkeyPatch class TempdirFactory: """Factory for temporary directories under the common base temp directory. The base directory can be configured using the ``--basetemp``...
lgpl-2.1
cklb/PyMoskito
pymoskito/simulation_modules.py
1
14724
import logging from copy import copy from abc import ABCMeta, abstractmethod from collections import OrderedDict from PyQt5.QtCore import QObject pyqtWrapperType = type(QObject) __all__ = ["SimulationModule", "SimulationException", "Trajectory", "Feedforward", "Controller", "Limiter", "ModelMixe...
bsd-3-clause
mcedit/mcedit
albow/menu_bar.py
1
1799
# # Albow - Menu bar # from pygame import Rect from widget import Widget, overridable_property class MenuBar(Widget): menus = overridable_property('menus', "List of Menu instances") def __init__(self, menus=None, width=0, **kwds): font = self.predict_font(kwds) height = font.get_linesize...
isc
justinhayes/cm_api
python/src/cm_api/endpoints/roles.py
1
8270
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
apache-2.0
rememberlenny/google-course-builder
modules/oeditor/oeditor.py
9
10589
# Copyright 2012 Google 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 applicable law or ...
apache-2.0
WSDC-NITWarangal/django
tests/utils_tests/test_checksums.py
205
1267
import unittest from django.test import ignore_warnings from django.utils.deprecation import RemovedInDjango110Warning class TestUtilsChecksums(unittest.TestCase): def check_output(self, function, value, output=None): """ Check that function(value) equals output. If output is None, chec...
bsd-3-clause
nerdvegas/rez
src/rez/vendor/amqp/utils.py
36
2685
from __future__ import absolute_import import sys try: import fcntl except ImportError: fcntl = None # noqa class promise(object): if not hasattr(sys, 'pypy_version_info'): __slots__ = tuple( 'fun args kwargs value ready failed ' ' on_success on_error calls'.split() ...
lgpl-3.0
sadmansk/servo
tests/wpt/web-platform-tests/webdriver/tests/release_actions/conftest.py
41
1038
import pytest @pytest.fixture def key_chain(session): return session.actions.sequence("key", "keyboard_id") @pytest.fixture def mouse_chain(session): return session.actions.sequence( "pointer", "pointer_id", {"pointerType": "mouse"}) @pytest.fixture def none_chain(session): ret...
mpl-2.0
aptrishu/coala-bears
bears/c_languages/ClangBear.py
16
3060
from clang.cindex import Index, LibclangError from coalib.bears.LocalBear import LocalBear from coalib.results.Diff import Diff from coalib.results.Result import Result from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY from coalib.results.SourceRange import SourceRange from coalib.settings.Setting import type...
agpl-3.0
joomel1/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/config/logging.py
122
1582
# Copyright (C) 2013 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
jablonskim/jupyweave
jupyweave/output_manager.py
1
1220
from os import makedirs from os.path import join, dirname import uuid class OutputManager: """Responsible for managing """ def __init__(self, output_settings, input_filename): self.__data_dir = output_settings.data_directory(input_filename) self.__data_dir_url = output_settings.data_dir_url(i...
mit
fengshao0907/cockroach-python
cockroach/proto/errors_pb2.py
2
38352
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: cockroach/proto/errors.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf impor...
apache-2.0
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/numpy/polynomial/hermite_e.py
23
58014
""" Objects for dealing with Hermite_e series. This module provides a number of objects (mostly functions) useful for dealing with Hermite_e series, including a `HermiteE` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in ...
mit
brianhelba/pylibtiff
libtiff/tests/test_simple.py
2
1148
import os from tempfile import mktemp from numpy import * from libtiff import TIFF def test_write_read(): for itype in [uint8, uint16, uint32, uint64, int8, int16, int32, int64, float32, float64, complex64, complex128]: image = array([[1, 2, 3], [4, 5,...
bsd-3-clause
rx2130/Leetcode
python/11 Container With Most Water.py
1
3779
class Solution(object): def maxArea(self, height): """ :type height: List[int] :rtype: int """ # Op1: Brute force ans = 0 for i in range(1, len(height)): for j in range(i): area = min(height[i], height[j]) * (i - j) ...
apache-2.0
jiankers/weevely3
core/vectorlist.py
14
6460
""" The module `core.vectorlist` defines a `VectorList` object, normally used to store the module vectors. Module class executes `_register_vectors()` at init to initialize the `VectorList` object as `self.vectors` module attribute. The methods exposed by VectorList can be used to get the result of a given vector exe...
gpl-3.0
oskar456/turrisclock
fakegpio.py
1
1282
#!/usr/bin/env python # vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class,with from __future__ import print_function class GPIO: """ Class representing one fake GPIO signal for debugging purposes """ def __init__(self, name, directio...
mit
mhrivnak/pulp
bindings/pulp/bindings/consumer_groups.py
3
7364
# -*- coding: utf-8 -*- # # Copyright © 2012 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or impli...
gpl-2.0
hehongliang/tensorflow
tensorflow/tools/dist_test/scripts_allreduce/k8s_generate_yaml.py
11
2997
#!/usr/bin/python # Copyright 2018 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 r...
apache-2.0
abbeymiles/aima-python
submissions/Blue/myNN.py
10
3071
from sklearn import datasets from sklearn.neural_network import MLPClassifier import traceback from submissions.Blue import music class DataFrame: data = [] feature_names = [] target = [] target_names = [] musicATRB = DataFrame() musicATRB.data = [] targetData = [] ''' Extract data from the CORGIS Mu...
mit
chrisdunelm/grpc
test/http2_test/test_rst_after_header.py
30
1214
# Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
wgwoods/anaconda
tests/dracut_tests/test_driver_updates.py
3
27177
# test_driver_updates.py - unittests for driver_updates.py import unittest try: import unittest.mock as mock except ImportError: import mock import os import tempfile import shutil import sys sys.path.append(os.path.normpath(os.path.dirname(__file__)+'/../../dracut')) from driver_updates import copy_files, ...
gpl-2.0
airbnb/streamalert
tests/unit/streamalert/shared/test_utils.py
1
4360
"""Tests for streamalert/shared/utils.py""" import json from nose.tools import assert_equal, assert_false from streamalert.shared import utils from streamalert.shared.normalize import Normalizer MOCK_RECORD_ID = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' def test_valid_ip(): """Utils - Valid IP""" test_ip_valid...
apache-2.0
vertcoin/vertcoin
test/functional/rpc_users.py
6
4247
#!/usr/bin/env python3 # Copyright (c) 2015-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. """Test multiple RPC users.""" from test_framework.test_framework import BitcoinTestFramework from test_f...
mit
Paczesiowa/youtube-dl
youtube_dl/extractor/rtve.py
58
7807
# encoding: utf-8 from __future__ import unicode_literals import base64 import re import time from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( ExtractorError, float_or_none, remove_end, std_headers, struct_unpack, ) def _decrypt_url(png): encrypted...
unlicense
PRIMEDesigner15/PRIMEDesigner15
dependencies/Lib/test/unittests/test_threading_local.py
167
6339
import unittest from doctest import DocTestSuite from test import support import weakref import gc # Modules under test _thread = support.import_module('_thread') threading = support.import_module('threading') import _threading_local class Weak(object): pass def target(local, weaklist): weak = Weak() lo...
bsd-3-clause
mephizzle/wagtail
wagtail/wagtailredirects/models.py
8
2622
from __future__ import unicode_literals from django.db import models from django.utils.six.moves.urllib.parse import urlparse from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel, PageChooserPanel class Redirect(models.Model): old_pat...
bsd-3-clause
sivel/ansible-modules-extras
cloud/amazon/ec2_vpc_dhcp_options.py
23
15072
#!/usr/bin/python # 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 in the hope that it will be use...
gpl-3.0
nclsHart/glances
glances/plugins/glances_monitor.py
1
4261
# -*- coding: utf-8 -*- # # This file is part of Glances. # # Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com> # # Glances 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 Lic...
lgpl-3.0
adit-chandra/tensorflow
tensorflow/python/keras/optimizer_v2/nadam.py
6
10023
# Copyright 2018 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
harshilasu/GraphicMelon
y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/cloudfront/identity.py
170
4483
# Copyright (c) 2006-2009 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...
gpl-3.0
mattjmcnaughton/kubernetes
cluster/juju/layers/kubernetes-e2e/reactive/kubernetes_e2e.py
168
8148
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
minorua/QGIS
tests/src/python/test_qgsvirtuallayerdefinition.py
28
4276
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsVirtualLayerDefinition .. note:: 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 versi...
gpl-2.0
hardanimal/UFT_UPGEM
Lib/site-packages/pip-1.2.1-py2.7.egg/pip/vcs/__init__.py
19
8752
"""Handles all VCS (version control) support""" import os import shutil from pip.backwardcompat import urlparse, urllib from pip.log import logger from pip.util import (display_path, backup_dir, find_command, ask, rmtree, ask_path_exists) __all__ = ['vcs', 'get_src_requirement'] class VcsSup...
gpl-3.0
pdav/khal
khal/__main__.py
4
1179
# Copyright (c) 2013-2021 khal contributors # # 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, merge, publi...
mit
luogangyi/Ceilometer-oVirt
ceilometer/openstack/common/eventlet_backdoor.py
5
4781
# Copyright (c) 2012 OpenStack Foundation. # Administrator of the National Aeronautics and Space Administration. # 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 a...
apache-2.0
andymckay/addons-server
src/olympia/blocklist/views.py
2
7809
import base64 import collections import hashlib from datetime import datetime from operator import attrgetter import time from django.core.cache import cache from django.db.models import Q, signals as db_signals from django.db.transaction import non_atomic_requests from django.http import JsonResponse from django.shor...
bsd-3-clause
codeworldprodigy/lab4
lib/flask/flask/sessions.py
348
12882
# -*- coding: utf-8 -*- """ flask.sessions ~~~~~~~~~~~~~~ Implements cookie based sessions based on itsdangerous. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import uuid import hashlib from datetime import datetime from werkzeug.http import http_date, ...
apache-2.0
WASPACDC/hmdsm.repository
plugin.video.loganaddon/Images/resources/lib/sources/dizibox_tv.py
20
6432
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 3 of the License, or (at your option) any l...
gpl-2.0
taaviteska/django
django/contrib/auth/middleware.py
82
5399
from django.conf import settings from django.contrib import auth from django.contrib.auth import load_backend from django.contrib.auth.backends import RemoteUserBackend from django.core.exceptions import ImproperlyConfigured from django.utils.deprecation import MiddlewareMixin from django.utils.functional import Simple...
bsd-3-clause
davidmueller13/xbmc
lib/gtest/test/gtest_xml_output_unittest.py
356
13525
#!/usr/bin/env python # # Copyright 2006, 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...
gpl-2.0
jvanbrug/alanaldavista
boto/ec2/cloudwatch/datapoint.py
56
1668
# Copyright (c) 2006-2009 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...
mit
martynovp/edx-platform
common/lib/xmodule/xmodule/videoannotation_module.py
107
6445
""" Module for Video annotations using annotator. """ from lxml import etree from pkg_resources import resource_string from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor from xblock.core import Scope, String from xmodule.annotator_mixin import get_instructions, get_extension from xmodule...
agpl-3.0
jmartiuk5/python-mode
pymode/libs3/rope/refactor/method_object.py
91
3868
import warnings from rope.base import pyobjects, exceptions, change, evaluate, codeanalyze from rope.refactor import sourceutils, occurrences, rename class MethodObject(object): def __init__(self, project, resource, offset): self.pycore = project.pycore this_pymodule = self.pycore.resource_to_py...
lgpl-3.0
ghostlander/p2pool-neoscrypt
p2pool/util/p2protocol.py
216
4144
''' Generic message-based protocol used by Bitcoin and P2Pool for P2P communication ''' import hashlib import struct from twisted.internet import protocol from twisted.python import log import p2pool from p2pool.util import datachunker, variable class TooLong(Exception): pass class Protocol(protocol.Protocol):...
gpl-3.0
eXistenZNL/SickRage
lib/github/Status.py
74
2548
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> # # ...
gpl-3.0
dims/glance
glance/tests/unit/test_glare_plugin_loader.py
1
7402
# Copyright (c) 2015 Mirantis, 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 writin...
apache-2.0
savoirfairelinux/django
tests/redirects_tests/tests.py
4
3823
from django.conf import settings from django.contrib.redirects.middleware import RedirectFallbackMiddleware from django.contrib.redirects.models import Redirect from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponseForbidden, HttpRespons...
bsd-3-clause
aricchen/openHR
openerp/addons/l10n_cn/__openerp__.py
91
1827
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2009 Gábor Dukai # # 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 Foun...
agpl-3.0
thoughtpalette/thoughts.thoughtpalette.com
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_phpbuiltins.py
95
122088
# -*- coding: utf-8 -*- """ pygments.lexers._phpbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file loads the function names and their modules from the php webpage and generates itself. Do not alter the MODULES dict by hand! WARNING: the generation transfers quite much data over your ...
mit
mcgoddard/widgetr
env/Lib/site-packages/werkzeug/urls.py
216
36710
# -*- coding: utf-8 -*- """ werkzeug.urls ~~~~~~~~~~~~~ ``werkzeug.urls`` used to provide several wrapper functions for Python 2 urlparse, whose main purpose were to work around the behavior of the Py2 stdlib and its lack of unicode support. While this was already a somewhat inconvenient situat...
mit
Thor77/youtube-dl
youtube_dl/extractor/esri.py
35
2627
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( int_or_none, parse_filesize, unified_strdate, ) class EsriVideoIE(InfoExtractor): _VALID_URL = r'https?://video\.esri\.com/watch/(?P<id>[0-9]...
unlicense
blink1073/scikit-image
skimage/segmentation/tests/test_felzenszwalb.py
27
2021
import numpy as np from numpy.testing import assert_equal, assert_array_equal from skimage._shared.testing import assert_greater, test_parallel from skimage.segmentation import felzenszwalb from skimage import data @test_parallel() def test_grey(): # very weak tests. This algorithm is pretty unstable. img = n...
bsd-3-clause
thomasquintana/jobber
jobber/core/actor/mailbox.py
1
1271
# 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
Hoekz/hackness-monster
venv/lib/python2.7/site-packages/pip/vcs/bazaar.py
514
3803
from __future__ import absolute_import import logging import os import tempfile # TODO: Get this into six.moves.urllib.parse try: from urllib import parse as urllib_parse except ImportError: import urlparse as urllib_parse from pip.utils import rmtree, display_path from pip.vcs import vcs, VersionControl fro...
mit
russelmahmud/mess-account
django/contrib/sessions/backends/db.py
232
2756
import datetime from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation from django.db import IntegrityError, transaction, router from django.utils.encoding import force_unicode class SessionStore(SessionBase): ...
bsd-3-clause
huggingface/pytorch-transformers
src/transformers/modeling_flax_pytorch_utils.py
1
9873
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
Erethon/synnefo
snf-cyclades-app/synnefo/volume/util.py
2
3867
# Copyright (C) 2010-2014 GRNET S.A. # # 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 3 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-3.0
yglazko/socorro
socorro/unittest/testlib/testLoggerForTest.py
11
5192
# 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/. from socorro.unittest.testlib.loggerForTest import TestingLogger import logging class BogusLogger: def __init__(self...
mpl-2.0
jumpstarter-io/cinder
cinder/quota.py
6
37954
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
timm/sandbox
py/cocomo/poly.py
1
3693
import random def tunings(_ = None): Within(txt="loc", lo=2, hi=2000) prep([ # vlow low nom high vhigh xhigh # scale factors: 'Flex', 5.07, 4.05, 3.04, 2.03, 1.01, _],[ 'Pmat', 7.80, 6.24, 4.68, 3.12, 1.56, _],[ 'Prec', 6.20, 4.96, 3.72, 2.48, 1.24, _],[ 'Resl', 7.07, 5.65, 4.24...
bsd-3-clause
ForensicTools/GRREAT-475_2141-Chaigon-Failey-Siebert
gui/plugins/hunt_view.py
2
45904
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- # """This is the interface for managing hunts.""" import collections as py_collections import operator import StringIO import urllib import logging from grr.gui import plot_lib from grr.gui import renderers from grr.gui.plugins import crash_view from gr...
apache-2.0
jblackburne/scikit-learn
sklearn/manifold/setup.py
24
1279
import os from os.path import join import numpy from numpy.distutils.misc_util import Configuration from sklearn._build_utils import get_blas_info def configuration(parent_package="", top_path=None): config = Configuration("manifold", parent_package, top_path) libraries = [] if os.name == 'posix': ...
bsd-3-clause
JioCloud/tempest
tempest/services/volume/json/snapshots_client.py
6
8121
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
2013Commons/hue
desktop/core/ext-py/Django-1.4.5/tests/regressiontests/utils/functional.py
93
1084
from django.utils import unittest from django.utils.functional import lazy, lazy_property class FunctionalTestCase(unittest.TestCase): def test_lazy(self): t = lazy(lambda: tuple(range(3)), list, tuple) for a, b in zip(t(), range(3)): self.assertEqual(a, b) def test_lazy_base_clas...
apache-2.0
yongshengwang/hue
build/env/lib/python2.7/site-packages/setuptools/tests/test_test.py
148
2329
# -*- coding: UTF-8 -*- from __future__ import unicode_literals import os import site import pytest from setuptools.command.test import test from setuptools.dist import Distribution from .textwrap import DALS from . import contexts SETUP_PY = DALS(""" from setuptools import setup setup(name='foo', ...
apache-2.0
MTDEV-KERNEL/MOTO-KERNEL
scripts/rt-tester/rt-tester.py
904
5366
#!/usr/bin/env 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 impor...
gpl-2.0
p4datasystems/CarnotKE
jyhton/Lib/xml/dom/__init__.py
112
7194
######################################################################## # # File Name: __init__.py # # """ WWW: http://4suite.org/4DOM e-mail: support@4suite.org Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved. See http://4suite.org/COPYRIGHT for license and copyright information "...
apache-2.0
analyseuc3m/ANALYSE-v1
common/test/acceptance/fixtures/xqueue.py
206
1402
""" Fixture to configure XQueue response. """ import requests import json from . import XQUEUE_STUB_URL class XQueueResponseFixtureError(Exception): """ Error occurred while configuring the stub XQueue. """ pass class XQueueResponseFixture(object): """ Configure the XQueue stub's response t...
agpl-3.0
falau/pogom
pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/DownloadSettingsMessage_pb2.py
16
2402
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Requests/Messages/DownloadSettingsMessage.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _...
mit