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
potatolondon/django-mediagenerator
mediagenerator/utils.py
1
4864
import functools import threading from . import settings as media_settings from .settings import (GLOBAL_MEDIA_DIRS, PRODUCTION_MEDIA_URL, IGNORE_APP_MEDIA_DIRS, MEDIA_GENERATORS, DEV_MEDIA_URL, GENERATED_MEDIA_NAMES_MODULE) from django.conf import settings from django.core.exceptions import ImproperlyConfigure...
bsd-3-clause
erdc/proteus
proteus/tests/surface_tension/rising_bubble_rans3p/pressure_n.py
1
1214
from __future__ import absolute_import from proteus import * from proteus.default_n import * try: from .pressure_p import * except: from pressure_p import * triangleOptions = triangleOptions femSpaces = {0:pbasis} stepController=FixedStep #matrix type numericalFluxType = NumericalFlux.ConstantAdvection_exteri...
mit
kxliugang/edx-platform
lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py
114
7638
# -*- 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): # Changing field 'StudentModuleHistory.version' db.alter_column('courseware_studentmodulehistory', 'version...
agpl-3.0
bnbowman/HlaTools
src/pbhla/fasta/subset_sequences.py
1
1114
#! /usr/bin/env python import sys from pbcore.io.FastaIO import FastaReader, FastaWriter from pbhla.fasta.utils import write_fasta def subset_sequences( fasta_file, summary_file, output_file ): seq_ids = identify_sequences( summary_file ) sequences = subset_sequence_records( fasta_file, seq_ids ) write_f...
bsd-3-clause
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
flask/lib/python2.7/site-packages/sqlalchemy/testing/plugin/plugin_base.py
7
17335
# plugin/plugin_base.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 """Testing extensions. this module is designed to work as a testing-framework...
mit
LoHChina/nova
nova/tests/functional/v3/test_used_limits.py
36
1457
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
apache-2.0
spark-test/spark
python/pyspark/sql/tests/test_column.py
4
7120
# -*- encoding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the ...
apache-2.0
wanglongqi/sympy
sympy/combinatorics/permutations.py
40
77752
from __future__ import print_function, division import random from collections import defaultdict from sympy.core import Basic from sympy.core.compatibility import is_sequence, reduce, range from sympy.utilities.iterables import (flatten, has_variety, minlex, has_dups, runs) from sympy.polys.polytools import lcm ...
bsd-3-clause
run2/citytour
4symantec/Lib/encodings/cp861.py
593
34889
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP861.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
mit
dedalusdev/docker-registry
tests/mock_s3.py
35
1940
# -*- coding: utf-8 -*- '''Monkeypatch s3 Storage preventing parallel key stream read in unittesting. It is called from lib/storage/s3''' import six from docker_registry.core import exceptions import docker_registry.drivers.s3 as s3 from docker_registry.testing import utils @six.add_metaclass(utils.monkeypatch_...
apache-2.0
wiki-ai/revscoring
revscoring/scoring/models/util.py
2
1246
import json import numpy def normalize(v): if isinstance(v, numpy.bool_): return bool(v) elif isinstance(v, numpy.ndarray): return [normalize(item) for item in v] elif v == numpy.NaN: return "NaN" elif v == numpy.NINF: return "-Infinity" elif v == numpy.PINF: ...
mit
nhenezi/kuma
vendor/packages/html5lib/src/html5lib/filters/optionaltags.py
129
10415
import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2 = previous1 previous1 = token yield previous2, previous...
mpl-2.0
dnozay/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/gis/db/backends/postgis/adapter.py
311
1165
""" This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. """ from psycopg2 import Binary from psycopg2.extensions import ISQLQuote class PostGISAdapter(object): def __init__(self, geom): "Initializes on the geometry." # Getting the WKB (in string form, to allow easy pickling ...
gpl-3.0
shinrain/tornado
demos/websocket/chatdemo.py
14
3172
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.2/django/forms/widgets.py
45
29994
""" HTML Widget classes """ import django.utils.copycompat as copy from itertools import chain from django.conf import settings from django.utils.datastructures import MultiValueDict, MergeDict from django.utils.html import escape, conditional_escape from django.utils.translation import ugettext from django.utils.enco...
bsd-3-clause
maiklos-mirrors/jfx78
modules/web/src/main/native/Tools/Scripts/webkitpy/tool/commands/perfalizer.py
123
8751
# Copyright (c) 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 of conditions and the ...
gpl-2.0
Techcable/TechBot
plugins/amazon.py
12
3863
import requests import re from bs4 import BeautifulSoup from cloudbot import hook from cloudbot.util import web, formatting, colors SEARCH_URL = "http://www.amazon.{}/s/" REGION = "com" AMAZON_RE = re.compile(""".*ama?zo?n\.(com|co\.uk|com\.au|de|fr|ca|cn|es|it)/.*/(?:exec/obidos/ASIN/|o/|gp/product/| (?:(?:[^"\'/]...
gpl-3.0
melgor/melgor.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/foxpro.py
335
26220
# -*- coding: utf-8 -*- """ pygments.lexers.foxpro ~~~~~~~~~~~~~~~~~~~~~~ Simple lexer for Microsoft Visual FoxPro source code. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer from pygm...
mit
tmerr/bank_wrangler
bank_wrangler/bank/fidelity.py
1
2374
""" Uses OFX to fetch a 3 month window of transactions from Fidelity. Other possibibilities: * Download and parse statement PDFs. Last 10 years are available, 1 month at a time. * Download CSVs from Portfolio > Activity & Orders > History > Download. Last 5 years are available, 3 months at a time. """ from io im...
gpl-3.0
alajara/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/trie/datrie.py
785
1166
from __future__ import absolute_import, division, unicode_literals from datrie import Trie as DATrie from six import text_type from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): chars = set() for key in data.keys(): if not isinstance(key, text_type): ...
mpl-2.0
40223137/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/xml/sax/xmlreader.py
824
12612
"""An XML Reader is the SAX 2 name for an XML parser. XML Parsers should be based on this code. """ from . import handler from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException # ===== XMLREADER ===== class XMLReader: """Interface for reading an XML document using callbacks. XMLReade...
gpl-3.0
giggsey/SickRage
lib/unidecode/x060.py
250
4642
data = ( 'Huai ', # 0x00 'Tai ', # 0x01 'Song ', # 0x02 'Wu ', # 0x03 'Ou ', # 0x04 'Chang ', # 0x05 'Chuang ', # 0x06 'Ju ', # 0x07 'Yi ', # 0x08 'Bao ', # 0x09 'Chao ', # 0x0a 'Min ', # 0x0b 'Pei ', # 0x0c 'Zuo ', # 0x0d 'Zen ', # 0x0e 'Yang ', # 0x0f 'Kou ', # 0x10 ...
gpl-3.0
imsparsh/python-for-android
python3-alpha/python3-src/Tools/pynche/Switchboard.py
116
4797
"""Switchboard class. This class is used to coordinate updates among all Viewers. Every Viewer must conform to the following interface: - it must include a method called update_yourself() which takes three arguments; the red, green, and blue values of the selected color. - When a Viewer selects a colo...
apache-2.0
Dhivyap/ansible
lib/ansible/modules/network/check_point/cp_mgmt_assign_global_assignment.py
20
2701
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Check Point Firewall (c) 2019 # # 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 o...
gpl-3.0
cowai/jottalib
src/jottalib/jottafuse.py
2
13210
#!/usr/bin/env python # -*- encoding: utf-8 -*- '''Mount your JottaCloud files locally and use it with your normal file tools''' # # This file is part of jottafs. # # jottafs is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Softwar...
gpl-3.0
eleonrk/SickRage
lib/feedparser/namespaces/admin.py
43
2368
# Support for the administrative elements extension # Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is a part of feedparser. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided th...
gpl-3.0
konstruktoid/ansible-upstream
lib/ansible/modules/cloud/amazon/ec2_vpc_igw_facts.py
19
4756
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
fishscene/streamlink
src/streamlink/logger.py
41
1656
import sys from threading import Lock class Logger(object): Levels = ["none", "error", "warning", "info", "debug"] Format = "[{module}][{level}] {msg}\n" def __init__(self): self.output = sys.stdout self.level = 0 self.lock = Lock() def new_module(self, module): retu...
bsd-2-clause
kost/volatility
volatility/plugins/overlays/windows/xp_sp3_x86_vtypes.py
58
291918
ntkrnlmp_types = { 'LIST_ENTRY64' : [ 0x10, { 'Flink' : [ 0x0, ['unsigned long long']], 'Blink' : [ 0x8, ['unsigned long long']], } ], 'LIST_ENTRY32' : [ 0x8, { 'Flink' : [ 0x0, ['unsigned long']], 'Blink' : [ 0x4, ['unsigned long']], } ], '_LIST_ENTRY' : [ 0x8, { 'Flink' : [ 0x0, ['pointer', ...
gpl-2.0
apple/swift-clang
tools/scan-build-py/libscanbuild/report.py
32
17684
# -*- coding: utf-8 -*- # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """ This module is responsible to generate 'index.html' for the report. The input for this step i...
apache-2.0
piyushroshan/xen-4.3.2
tools/tests/utests/ut_xend/ut_image.py
42
5072
#=========================================================================== # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope tha...
gpl-2.0
rupran/ansible
test/units/playbook/test_helpers.py
60
19182
# (c) 2016, Adrian Likins <alikins@redhat.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) any later vers...
gpl-3.0
TheAltcoinBoard/XAB-withoutSecp256k1
share/qt/extract_strings_qt.py
7
1854
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xget...
mit
FInAT/FInAT
finat/restricted.py
1
8971
from functools import singledispatch from itertools import chain import FIAT from FIAT.polynomial_set import mis import finat from finat.fiat_elements import FiatElement from finat.physically_mapped import PhysicallyMappedElement # Sentinel for when restricted element is empty null_element = object() @singledispa...
mit
quozl/terminal-activity
terminal.py
1
22474
# Copyright (C) 2007, Eduardo Silva <edsiper@gmail.com>. # Copyright (C) 2008, One Laptop Per Child # Copyright (C) 2009, Simon Schampijer # # 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; eithe...
gpl-2.0
GehenHe/Recognize-Face-on-Android
tensorflow/contrib/distributions/python/ops/beta.py
11
11466
# 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
zenodo/zenodo
zenodo/modules/records/serializers/schemas/pidrelations.py
7
1981
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2017 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
leohmoraes/weblate
weblate/trans/machine/base.py
4
7113
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
gpl-3.0
jackkiej/SickRage
lib/sqlalchemy/interfaces.py
79
10918
# sqlalchemy/interfaces.py # Copyright (C) 2007-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # Copyright (C) 2007 Jason Kirtland jek@discorporate.us # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Deprecated core ev...
gpl-3.0
defance/edx-platform
lms/djangoapps/lti_provider/views.py
94
5813
""" LTI Provider view functions """ from django.conf import settings from django.http import HttpResponseBadRequest, HttpResponseForbidden, Http404 from django.views.decorators.csrf import csrf_exempt import logging from lti_provider.outcomes import store_outcome_parameters from lti_provider.models import LtiConsumer...
agpl-3.0
projectcalico/calico-nova
nova/db/migration.py
6
2212
# 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
losnikitos/googleads-python-lib
examples/dfp/v201502/user_team_association_service/delete_user_team_associations.py
4
2762
#!/usr/bin/python # # Copyright 2015 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 b...
apache-2.0
ennoborg/gramps
gramps/plugins/gramplet/calendargramplet.py
2
2757
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2007-2009 Douglas S. Blank <doug.blank@gmail.com> # # 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 Lic...
gpl-2.0
bathepawan/workload-automation
wlauto/workloads/power_loadtest/__init__.py
5
4947
# Copyright 2015 ARM Limited # # 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
andyzsf/django
tests/resolve_url/tests.py
33
2850
from __future__ import unicode_literals import warnings from django.core.urlresolvers import NoReverseMatch from django.contrib.auth.views import logout from django.shortcuts import resolve_url from django.test import TestCase, override_settings from django.utils.deprecation import RemovedInDjango20Warning from .mode...
bsd-3-clause
NikNitro/Python-iBeacon-Scan
sympy/solvers/ode.py
7
330554
r""" This module contains :py:meth:`~sympy.solvers.ode.dsolve` and different helper functions that it uses. :py:meth:`~sympy.solvers.ode.dsolve` solves ordinary differential equations. See the docstring on the various functions for their uses. Note that partial differential equations support is in ``pde.py``. Note t...
gpl-3.0
jupiterben/shooter-player
Thirdparty/jsoncpp/test/rununittests.py
249
2507
import sys import os import os.path import subprocess from glob import glob import optparse VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes' class TestProxy(object): def __init__( self, test_exe_path, use_valgrind=False ): self.test_exe_path = os.path.normpath( os.path.a...
gpl-2.0
vlitvak/fieldtrip
realtime/src/buffer/python/FieldTrip.py
7
17758
""" FieldTrip buffer (V1) client in pure Python (C) 2010 S. Klanke """ # We need socket, struct, and numpy import socket import struct import numpy VERSION = 1 PUT_HDR = 0x0101 PUT_DAT = 0x0102 PUT_EVT = 0x0103 PUT_OK = 0x0104 PUT_ERR = 0x0105 GET_HDR ...
gpl-2.0
siutanwong/scikit-learn
examples/cluster/plot_mini_batch_kmeans.py
265
4081
""" ==================================================================== Comparison of the K-Means and MiniBatchKMeans clustering algorithms ==================================================================== We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is faster, but give...
bsd-3-clause
StephaneP/volatility
volatility/plugins/mac/route.py
44
3443
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
gpl-2.0
GhostThrone/django
tests/known_related_objects/tests.py
363
6425
from __future__ import unicode_literals from django.test import TestCase from .models import Organiser, Pool, PoolStyle, Tournament class ExistingRelatedInstancesTests(TestCase): @classmethod def setUpTestData(cls): cls.t1 = Tournament.objects.create(name='Tourney 1') cls.t2 = Tournament.ob...
bsd-3-clause
epitron/youtube-dl
youtube_dl/extractor/abc.py
13
7543
from __future__ import unicode_literals import hashlib import hmac import re import time from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, js_to_json, int_or_none, parse_iso8601, try_get, unescapeHTML, update_url_query, ) class ABCIE(...
unlicense
Yen-Chung-En/2015cdb_g1_0623-2
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_suite.py
791
12066
import unittest import sys from .support import LoggingResult, TestEquality ### Support code for Test_TestSuite ################################################################ class Test(object): class Foo(unittest.TestCase): def test_1(self): pass def test_2(self): pass def test_3(self...
gpl-3.0
traveloka/ansible
lib/ansible/modules/cloud/amazon/ec2_lc_facts.py
23
7243
#!/usr/bin/python # -*- coding: utf-8 -*- # # This is a 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 Ansible library is distri...
gpl-3.0
WangYueFt/jieba
jieba/finalseg/__init__.py
58
2709
from __future__ import absolute_import, unicode_literals import re import os import marshal import sys from .._compat import * MIN_FLOAT = -3.14e100 PROB_START_P = "prob_start.p" PROB_TRANS_P = "prob_trans.p" PROB_EMIT_P = "prob_emit.p" PrevStatus = { 'B': 'ES', 'M': 'MB', 'S': 'SE', 'E': 'BM' } d...
mit
delving/nave
nave/void/migrations/0010_auto_20151111_1409.py
1
5725
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.utils.timezone import django_extensions.db.fields from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_nam...
gpl-2.0
emergenzeHack/emergenzeHack.github.io
node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
1569
23354
#!/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. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
mit
RossBrunton/django
django/contrib/gis/geos/prototypes/predicates.py
339
1496
""" This module houses the GEOS ctypes prototype functions for the unary and binary predicate operations on geometries. """ from ctypes import c_char, c_char_p, c_double from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import check_predicate # #...
bsd-3-clause
MikeAmy/django
django/db/models/aggregates.py
79
4984
""" Classes to represent the definitions of aggregate functions. """ from django.core.exceptions import FieldError from django.db.models.expressions import Func, Star from django.db.models.fields import FloatField, IntegerField __all__ = [ 'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance', ] ...
bsd-3-clause
google/google-ctf
third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_asyncore.py
9
22912
import asyncore import unittest import select import os import socket import sys import time import warnings import errno from test import test_support from test.test_support import TESTFN, run_unittest, unlink from StringIO import StringIO try: import threading except ImportError: threading ...
apache-2.0
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py
21
37133
"""Fallback pure Python implementation of msgpack""" from datetime import datetime as _DateTime import sys import struct PY2 = sys.version_info[0] == 2 if PY2: int_types = (int, long) def dict_iteritems(d): return d.iteritems() else: int_types = int unicode = str xrange = range de...
apache-2.0
yaroslavvb/tensorflow
tensorflow/python/ops/partitioned_variables.py
132
12318
# 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
z1gm4/desarrollo_web_udp
env/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py
175
17495
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib...
gpl-3.0
YachaoLiu/rk3288_kernel
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
Zhongqilong/kbengine
kbe/res/scripts/common/Lib/webbrowser.py
81
21421
#! /usr/bin/env python3 """Interfaces for launching and remotely controlling Web browsers.""" # Maintained by Georg Brandl. import os import shlex import shutil import sys import subprocess __all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"] class Error(Exception): pass _browsers = {} ...
lgpl-3.0
JimCircadian/ansible
lib/ansible/modules/clustering/pacemaker_cluster.py
73
7080
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Mathieu Bultel <mbultel@redhat.com> # 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...
gpl-3.0
redhatrises/freeipa
ipaclient/remote_plugins/2_164/sudocmdgroup.py
16
14989
# # Copyright (C) 2016 FreeIPA Contributors see COPYING for license # # pylint: disable=unused-import import six from . import Command, Method, Object from ipalib import api, parameters, output from ipalib.parameters import DefaultFrom from ipalib.plugable import Registry from ipalib.text import _ from ipapython.dn ...
gpl-3.0
rahuldhote/odoo
addons/sale_service/__openerp__.py
260
2447
# -*- 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
chauhanmohit/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py
130
1524
# # Copyright (C) 2011 Google Inc. All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # T...
bsd-3-clause
devigned/autorest
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/models/product.py
14
3026
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
daafgo/CourseBuilder-Xapi
tools/etl/etl_lib.py
10
7662
# Copyright 2013 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
kennedyshead/home-assistant
homeassistant/components/islamic_prayer_times/__init__.py
2
6894
"""The islamic_prayer_times component.""" from datetime import timedelta import logging from prayer_times_calculator import PrayerTimesCalculator, exceptions from requests.exceptions import ConnectionError as ConnError import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT from homeassistant....
apache-2.0
google-research/falken
service/learner/brains/brain_cache.py
1
3449
# 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 agreed to in writing, ...
apache-2.0
shyaken/cp.eaemcb
controllers/ldap/admin.py
2
6571
# Author: Zhang Huangbin <zhb@iredmail.org> import web import settings from libs import languages from libs.ldaplib import decorators, admin, domain as domainlib, connUtils session = web.config.get('_session') # # Admin related. # class List: @decorators.require_global_admin @decorators.require_login d...
gpl-2.0
PennartLoettring/Poettrix
rootfs/usr/lib/python3.4/test/multibytecodec_support.py
12
14592
# # multibytecodec_support.py # Common Unittest Routines for CJK codecs # import codecs import os import re import sys import unittest from http.client import HTTPException from test import support from io import BytesIO class TestBase: encoding = '' # codec name codec = None # codec tupl...
gpl-2.0
SnappleCap/oh-mainline
vendor/packages/requests-oauthlib/requests_oauthlib/oauth1_session.py
25
16131
from __future__ import unicode_literals try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse import logging from oauthlib.common import add_params_to_uri from oauthlib.common import urldecode as _urldecode from oauthlib.oauth1 import ( SIGNATURE_HMAC, SIGNATURE_RSA, SI...
agpl-3.0
20uf/ansible
test/integration/cleanup_rax.py
71
6516
#!/usr/bin/env python import os import re import yaml import argparse try: import pyrax HAS_PYRAX = True except ImportError: HAS_PYRAX = False def rax_list_iterator(svc, *args, **kwargs): method = kwargs.pop('method', 'list') items = getattr(svc, method)(*args, **kwargs) while items: ...
gpl-3.0
mastak/Spirit
spirit/topic/private/views.py
7
6200
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model from django.shortcuts import render, redirect, get_object_or_404 from django.views.decorators.http impor...
mit
reiven/pungabot
modules/module_alias.py
1
1945
# -*- coding: utf-8 -*- import sys aliases = {} def init(config): dbCursor.execute("SELECT alias, command FROM ALIASES") for alias, command in dbCursor.fetchall(): config_alias(alias, command) def config_alias(alias, command): mod = globals() aliases[alias] = command mod['command_' + al...
gpl-3.0
sadanandb/pmt
src/pyasm/widget/annotate_wdg.py
6
11694
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
gptech/ansible
lib/ansible/modules/windows/win_domain.py
24
2003
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your ...
gpl-3.0
iohannez/gnuradio
gr-wavelet/python/wavelet/__init__.py
7
1101
# # Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # #...
gpl-3.0
NavarraBiomed/cientifika
cientifika_app/models.py
2
14864
# coding: utf-8 # This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # Feel free to rename the models, but don't rename db_table values or field names. # # Also note...
gpl-2.0
Opentrons/labware
api/src/opentrons/drivers/serial_communication.py
3
3983
import serial # type: ignore from serial.tools import list_ports # type: ignore import contextlib import logging log = logging.getLogger(__name__) RECOVERY_TIMEOUT = 10 DEFAULT_SERIAL_TIMEOUT = 5 DEFAULT_WRITE_TIMEOUT = 30 class SerialNoResponse(Exception): pass def get_ports_by_name(device_name): '''Re...
apache-2.0
abergeron/pylearn2
pylearn2/scripts/tests/test_dbm.py
37
3931
""" Tests scripts in the DBM folder """ import os import pylearn2.scripts.dbm.show_negative_chains as negative_chains import pylearn2.scripts.dbm.show_reconstructions as show_reconstruct import pylearn2.scripts.dbm.show_samples as show_samples import pylearn2.scripts.dbm.top_filters as top_filters from pylearn2.config...
bsd-3-clause
vongochung/buiquocviet
django/contrib/gis/admin/options.py
83
5247
from django.contrib.admin import ModelAdmin from django.contrib.gis.admin.widgets import OpenLayersWidget from django.contrib.gis.gdal import OGRGeomType from django.contrib.gis.db import models class GeoModelAdmin(ModelAdmin): """ The administration options class for Geographic models. Map settings may be...
bsd-3-clause
jupierce/openshift-tools
ansible/roles/lib_yaml_editor/build/ansible/yedit.py
10
6223
#pylint: skip-file def get_curr_value(invalue, val_type): '''return the current value''' if invalue == None: return None curr_value = invalue if val_type == 'yaml': curr_value = yaml.load(invalue) elif val_type == 'json': curr_value = json.loads(invalue) return curr_va...
apache-2.0
KasenJ/CommunityPython
code/push/google/protobuf/text_format.py
1
22190
# 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: # # * Redistributions o...
gpl-2.0
2013Commons/hue
desktop/core/ext-py/PyYAML-3.09/lib/yaml/events.py
985
2445
# Abstract classes. class Event(object): def __init__(self, start_mark=None, end_mark=None): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in ['anchor', 'tag', 'implicit', 'value'] if hasattr(self, key)] argu...
apache-2.0
ketjow4/NOV
Lib/site-packages/scipy/cluster/setup.py
51
1313
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" import sys from os.path import join if sys.version_info[0] >= 3: DEFINE_MACROS = [("SCIPY_PY3K", None)] else: DEFINE_MACROS = [] def configuration(parent_package = '', top_path = None): from numpy.distuti...
gpl-3.0
ManjusakaSL/Practice
second/sunspots_roto.py
1
1140
from reportlab.lib import colors from reportlab.graphics.shapes import * from reportlab.graphics import renderPDF data = [ # Year Month Predicted High Low (2007, 8, 113.2, 114.2, 112.2), (2007, 9, 112.8, 115.8, 109.8), (2007, 10, 111.0, 116.0, 106.0), (2007, 11, 109.8, ...
gpl-3.0
Adel-Magebinary/odoo
addons/survey/wizard/survey_email_compose_message.py
57
10954
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
paulcalabro/zato
code/zato-server/test/zato/server/connection/http_soap/test_outgoing.py
5
24189
# -*- coding: utf-8 -*- """ Copyright (C) 2013 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib import httplib, ssl from datetime import datetime from logging import ge...
gpl-3.0
x2nie/odoo
openerp/modules/db.py
442
6037
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
zstackio/zstack-woodpecker
integrationtest/vm/perf/vm/test_reboot_vm_simple_scheduler_with_max_threads.py
2
1675
''' New Perf Test for rebooting KVM VMs which were stopped. The reboot number will depend on the environment variable: ZSTACK_TEST_NUM This case's max thread is 1000 @author: Carl ''' import os import time import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpecker.test_lib as test_lib f...
apache-2.0
karlnapf/shogun
examples/undocumented/python/kernel_comm_word_string.py
4
1411
#!/usr/bin/env python from tools.load import LoadMatrix import shogun as sg lm=LoadMatrix() traindat = lm.load_dna('../data/fm_train_dna.dat') testdat = lm.load_dna('../data/fm_test_dna.dat') parameter_list = [[traindat,testdat,4,0,False, False],[traindat,testdat,4,0,False,False]] def kernel_comm_word_string (fm_trai...
bsd-3-clause
OsirisSPS/osiris-sps
client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/encodings/cp1026.py
593
13369
""" Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
gpl-3.0
Leblantoine/nanocloud
photon/merge_libs_wrapper.py
5
5944
import os import sys import vs_toolchain if sys.platform == 'win32': vs_toolchain.GetToolchainDir() os.environ['PATH'] += os.pathsep + os.environ['GYP_MSVS_OVERRIDE_PATH'] + '\\VC\\bin' #!/usr/bin/env python # Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. # # Use of this source code is ...
agpl-3.0
jay-johnson/kubernetes
cluster/juju/charms/trusty/kubernetes-master/hooks/setup.py
149
1410
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
apache-2.0
margamanterola/Cinnamon
files/usr/share/cinnamon/cinnamon-settings/bin/tweenEquations.py
16
7813
""" made with the file cjs/tweener/equations.js Original copyright notice of the source file: Copyright 2008 litl, LLC. Equations Main equations for the Tweener class @author Zeh Fernando, Nate Chatellier @version 1.0.2 Disclaimer for Robert Penner's Easing ...
gpl-2.0