repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
bxshi/gem5
src/arch/x86/isa/insts/general_purpose/compare_and_test/compare.py
91
3017
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
Lukc/ospace-lukc
server/lib/medusa/mime_type_table.py
4
3941
# -*- Python -*- # Converted by ./convert_mime_type_table.py from: # /usr/src2/apache_1.2b6/conf/mime.types # content_type_map = \ { 'ai': 'application/postscript', 'aif': 'audio/x-aiff', 'aifc': 'audio/x-aiff', 'aiff': 'audio/x-aiff', 'au': 'audio/basic', 'avi': 'video...
gpl-2.0
KousikaGanesh/purchaseandInventory
openerp/tools/lru.py
204
2946
# -*- coding: utf-8 -*- # taken from http://code.activestate.com/recipes/252524-length-limited-o1-lru-cache-implementation/ import threading from func import synchronized __all__ = ['LRU'] class LRUNode(object): __slots__ = ['prev', 'next', 'me'] def __init__(self, prev, me): self.prev = prev ...
agpl-3.0
gloaec/trifle
src/trifle/anyconfig/backend/tests/backends.py
1
1243
# # Copyright (C) 2012 Satoru SATOH <ssato @ redhat.com> # License: MIT # import anyconfig.backend.backends as T import unittest class Test_00_pure_functions(unittest.TestCase): def test_10_find_by_file(self): ini_cf = "/a/b/c.ini" unknown_cf = "/a/b/c.xyz" jsn_cfs = ["/a/b/c.jsn", "/a/b/...
gpl-3.0
JioCloud/nova
nova/objects/numa.py
24
8397
# Copyright 2014 Red Hat 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 ag...
apache-2.0
AlgoHunt/nerual_style_transfer
nets/nets_factory.py
31
5146
# 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 applicable ...
apache-2.0
Pikecillo/genna
external/4Suite-XML-1.0.2/test/Xml/Core/__init__.py
1
1056
__revision__ = '$Id: __init__.py,v 1.12 2005/11/15 02:22:41 jkloth Exp $' def PreprocessFiles(dirs, files): """ PreprocessFiles(dirs, files) -> (dirs, files) This function is responsible for sorting and trimming the file and directory lists as needed for proper testing. """ from Ft.Lib.TestSui...
gpl-2.0
groutr/conda-tools
src/conda_tools/environment/history.py
1
7101
""" Adapted from conda/history.py Licensed under BSD 3-clause license. """ from __future__ import print_function import re import time from json import loads from os.path import isfile, join from functools import lru_cache from ..common import lazyproperty class CondaHistoryException(Exception): pass class Co...
bsd-3-clause
jordanemedlock/psychtruths
temboo/Library/Basecamp/UpdateEntry.py
5
5739
# -*- coding: utf-8 -*- ############################################################################### # # UpdateEntry # Updates a calendar event or milestone in a project you specify. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License")...
apache-2.0
youprofit/zato
code/zato-web-admin/src/zato/admin/web/forms/load_balancer.py
7
3670
# -*- coding: utf-8 -*- """ Copyright (C) 2010 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 from operator import itemgetter # Django from django import forms # Za...
gpl-3.0
gVallverdu/pymatgen
pymatgen/alchemy/materials.py
4
14429
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module provides various representations of transformed structures. A TransformedStructure is a structure that has been modified by undergoing a series of transformations. """ import os import re impor...
mit
misterhat/youtube-dl
youtube_dl/extractor/hellporno.py
153
2279
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( js_to_json, remove_end, ) class HellPornoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?hellporno\.com/videos/(?P<id>[^/]+)' _TEST = { 'url': 'http://hellporno.com/videos/dixie-is-...
unlicense
farmisen/electron
script/create-dist.py
65
5723
#!/usr/bin/env python import os import re import shutil import subprocess import sys import stat from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ get_target_arch, get_chromedriver_version from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \ ...
mit
jorik041/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py
122
4889
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
TeamExodus/kernel_google_msm
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
nazoking/DNC-tensorflow
dnc/controller.py
1
9060
import tensorflow as tf import numpy as np class BaseController: def __init__(self, input_size, output_size, memory_read_heads, memory_word_size, batch_size=1): """ constructs a controller as described in the DNC paper: http://www.nature.com/nature/journal/vaop/ncurrent/full/nature20101.ht...
mit
brezerk/taverna
userauth/tests.py
2
1309
# -*- coding: utf-8 -*- # Copyright (C) 2010 by Alexey S. Malakhov <brezerk@gmail.com> # Opium <opium@jabber.com.ua> # # This file is part of Taverna # # Taverna is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fr...
gpl-3.0
kvar/ansible
test/units/modules/network/nso/test_nso_verify.py
40
5452
# # Copyright (c) 2017 Cisco and/or its affiliates. # # 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...
gpl-3.0
vlinhd11/vlinhd11-android-scripting
python/src/Lib/_LWPCookieJar.py
267
6553
"""Load / save to libwww-perl (LWP) format files. Actually, the format is slightly extended from that used by LWP's (libwww-perl's) HTTP::Cookies, to avoid losing some RFC 2965 information not recorded by LWP. It uses the version string "2.0", though really there isn't an LWP Cookies 2.0 format. This indicates that ...
apache-2.0
tedder/ansible
test/units/modules/network/f5/test_bigip_pool.py
25
17853
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2, ...
gpl-3.0
nfredrik/pyModelStuff
pymodel/StateCoverage.py
2
2493
""" StateCoverage: choose the (aname, args) whose next state has been used least """ import sys import random # Tester state is a bag of states: [ ( state , n of times used ), ... ] # Implement bag of states as list of pairs, not dictionary with state keys # because our states are themselves dictionaries, w...
bsd-3-clause
duncanmmacleod/gwpy
gwpy/timeseries/io/hdf5.py
3
4214
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2014-2020) # # This file is part of GWpy. # # GWpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option)...
gpl-3.0
cchurch/ansible
test/units/modules/network/fortimanager/test_fmgr_fwpol_package.py
38
4044
# Copyright 2018 Fortinet, Inc. # # 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 in the...
gpl-3.0
adngdb/socorro
webapp-django/crashstats/tokens/tests/test_middleware.py
3
4138
import datetime import json from nose.tools import eq_, ok_, assert_raises from django.contrib.auth.models import User, Permission from django.conf import settings from django.test.client import RequestFactory from django.contrib.auth.middleware import AuthenticationMiddleware from django.contrib.sessions.middleware ...
mpl-2.0
svirusxxx/cjdns
node_build/dependencies/libuv/build/gyp/pylib/gyp/generator/dump_dependency_json.py
899
2768
# 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. import collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
gpl-3.0
coala-analyzer/coala-quickstart
coala_quickstart/coala_quickstart.py
1
5542
import argparse import logging import os import sys from pyprint.ConsolePrinter import ConsolePrinter from coala_utils.FilePathCompleter import FilePathCompleter from coala_utils.Question import ask_question from coala_quickstart import __version__ from coala_quickstart.interaction.Logo import print_welcome_message ...
agpl-3.0
mytliulei/DCNRobotInstallPackages
windows/win32/pygal-1.7.0/setup.py
1
2698
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of pygal # # A python svg graph plotting library # Copyright © 2012-2014 Kozea # # This library 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 Foun...
apache-2.0
srajag/nova
nova/tests/virt/baremetal/test_volume_driver.py
11
11573
# Copyright (c) 2012 NTT DOCOMO, 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 requ...
apache-2.0
simonwydooghe/ansible
lib/ansible/modules/cloud/podman/podman_image_info.py
21
9173
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2018 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', 'sta...
gpl-3.0
dhoffman34/django
django/utils/lorem_ipsum.py
81
4910
""" Utility functions for generating "lorem ipsum" Latin text. """ from __future__ import unicode_literals import random COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ...
bsd-3-clause
ESS-LLP/erpnext
erpnext/patches/v11_0/change_healthcare_desktop_icons.py
4
2450
import frappe from frappe import _ change_icons_map = [ { "module_name": "Patient", "color": "#6BE273", "icon": "fa fa-user", "doctype": "Patient", "type": "link", "link": "List/Patient", "label": _("Patient") }, { "module_name": "Patient Encounter", "color": "#2ecc71", "icon": "fa fa-stethoscop...
gpl-3.0
HesselTjeerdsma/Cyber-Physical-Pacman-Game
Algor/flask/lib/python2.7/site-packages/urllib3/contrib/_securetransport/low_level.py
136
12062
""" Low-level helpers for the SecureTransport bindings. These are Python functions that are not directly related to the high-level APIs but are necessary to get them to work. They include a whole bunch of low-level CoreFoundation messing about and memory management. The concerns in this module are almost entirely abou...
apache-2.0
wolfv/AutobahnPython
examples/twisted/websocket/streaming/frame_based_server.py
18
2612
############################################################################### ## ## Copyright (C) 2011-2013 Tavendo GmbH ## ## 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 ## #...
apache-2.0
klmitch/nova
nova/tests/functional/api_sample_tests/test_security_groups.py
4
6316
# 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
OpringaoDoTurno/airflow
airflow/migrations/versions/8504051e801b_xcom_dag_task_indices.py
46
1080
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
mathwuyue/py-wireless-sys-sim
d2d/rrm.py
1
8801
import operator import itertools import numpy as np import scipy.optimize from core import cal_thermal_noise, cal_umi_nlos, cal_umi_exp_los from functools import reduce def _sum(func, *args): return reduce(operator.add, map(func, *args), 0) def cal_D2D_basic_tp(d2d_ues, g_d2d_bs, kappa, bw, alpha, freq): "...
mit
artefactual/archivematica-history
src/MCPClient/lib/clientScripts/checkForSubmissionDocumenation.py
1
1358
#!/usr/bin/python -OO # This file is part of Archivematica. # # Copyright 2010-2012 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, e...
agpl-3.0
repotvsupertuga/tvsupertuga.repository
script.module.resolveurl/lib/resolveurl/plugins/speedwatch.py
2
1350
''' SpeedWatch.io resolveurl plugin Copyright (C) 2019 gujal 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 d...
gpl-2.0
vivekanand1101/anitya
tests/test_plugins.py
2
2944
# -*- coding: utf-8 -*- # # Copyright © 2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed in t...
gpl-2.0
Br1an6/ACS_Netplumber_Implementation
hsa-python/net_plumbing/examples/load_stanford_backbone.py
5
12031
''' <Loads Stanford backbone network into appropriate objects (e.g. emulated_tf)> Copyright 2012, Stanford University. This file is licensed under GPL v2 plus a special exception, as described in included LICENSE_EXCEPTION.txt. Created on Aug 13, 2011 @author: Peyman Kazemian ''' from headerspace.tf ...
gpl-2.0
PaloAltoNetworks-BD/ansible-pan
library/panos_email_server.py
1
4152
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function __metaclass__ = type # Copyright 2019 Palo Alto Networks, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ...
isc
xHeliotrope/injustice_dropper
env/lib/python3.4/site-packages/django/db/models/query.py
10
71207
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import sys import warnings from collections import OrderedDict, deque from django.conf import settings from django.core import exceptions from django.db import ( DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, ...
mit
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/test/test_heapq.py
111
14475
"""Unittests for heapq.""" import sys import random import unittest from test import support from unittest import TestCase, skipUnless py_heapq = support.import_fresh_module('heapq', blocked=['_heapq']) c_heapq = support.import_fresh_module('heapq', fresh=['_heapq']) # _heapq.nlargest/nsmallest are saved in heapq._...
gpl-2.0
spvkgn/youtube-dl
youtube_dl/extractor/lecture2go.py
87
2402
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, determine_protocol, parse_duration, int_or_none, ) class Lecture2GoIE(InfoExtractor): _VALID_URL = r'https?://lecture2go\.uni-hamburg\.de/veranstaltungen/-/v/(...
unlicense
sjerdo/letsencrypt
acme/acme/fields.py
53
1742
"""ACME JSON fields.""" import logging import pyrfc3339 from acme import jose logger = logging.getLogger(__name__) class Fixed(jose.Field): """Fixed field.""" def __init__(self, json_name, value): self.value = value super(Fixed, self).__init__( json_name=json_name, default=val...
apache-2.0
karan1276/servo
tests/wpt/web-platform-tests/tools/py/bench/localpath.py
215
1883
import py import timeit class Listdir: numiter = 100000 numentries = 100 def setup(self): tmpdir = py.path.local.make_numbered_dir(self.__class__.__name__) for i in range(self.numentries): tmpdir.join(str(i)) self.tmpdir = tmpdir def run(self): return self...
mpl-2.0
trondhindenes/ansible
lib/ansible/modules/network/avi/avi_controllerproperties.py
20
16486
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.2 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
gpl-3.0
costadorione/purestream
core/tmdb.py
1
65766
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # streamondemand 5 # Copyright 2015 tvalacarta@gmail.com # http://www.mimediacenter.info/foro/viewforum.php?f=36 # # Distributed under the terms of GNU General Public License v3 (GPLv3) # http://www.gnu.org/licenses/gpl-3.0.html # -...
gpl-3.0
ygol/odoo
addons/project_issue_sheet/project_issue_sheet.py
381
2875
#-*- 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
mattpap/sympy-polys
sympy/physics/paulialgebra.py
10
1595
""" This module implements Pauli algebra by subclassing Symbol. Only algebraic properties of Pauli matrices are used (we don't use the Matrix class). See the documentation to the class Pauli for examples. See also: http://en.wikipedia.org/wiki/Pauli_matrices """ from sympy import Symbol, I def delta(i,j): i...
bsd-3-clause
openstack/nova
nova/api/validation/extra_specs/pci_passthrough.py
3
1271
# Copyright 2020 Red Hat, 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 o...
apache-2.0
bright-sparks/chromium-spacewalk
chrome/common/extensions/docs/server2/caching_file_system.py
4
5389
# Copyright (c) 2012 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 posixpath import sys from file_system import FileSystem, StatInfo, FileNotFoundError from future import Future from path_util import IsDirectory,...
bsd-3-clause
ktosiek/spacewalk
client/solaris/smartpm/smart/commands/update.py
5
3102
# # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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 Fou...
gpl-2.0
MobinRanjbar/hue
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/PublicKey/__init__.py
124
1876
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
apache-2.0
evensonbryan/yocto-autobuilder
lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_changes_pb.py
4
9572
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
strk/mapnik
scons/scons-local-2.2.0/SCons/Variables/PathVariable.py
14
5703
"""SCons.Variables.PathVariable This file defines an option type for SCons implementing path settings. To be used whenever a a user-specified path override should be allowed. Arguments to PathVariable are: option-name = name of this option on the command line (e.g. "prefix") option-help = help string for optio...
lgpl-2.1
rlouf/patterns-of-segregation
bin/plot_scaling_classes.py
1
3443
"""plot_income_scaling.py Plot the number of households from a given class as a function of the total number of households per city """ import csv import math from matplotlib import pylab as plt from scipy.stats import linregress colours = {'Lower':'#4F8F6B', 'Higher':'#C1A62E', 'Middle':'#4B453C'} ...
bsd-3-clause
rsteca/python-social-auth
social/backends/persona.py
70
1845
""" Mozilla Persona authentication backend, docs at: http://psa.matiasaguirre.net/docs/backends/persona.html """ from social.utils import handle_http_errors from social.backends.base import BaseAuth from social.exceptions import AuthFailed, AuthMissingParameter class PersonaAuth(BaseAuth): """BrowserID authen...
bsd-3-clause
MarcosCommunity/odoo
comunity_modules/hr_payroll_cancel/__openerp__.py
3
1902
# -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # # Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/ # All Rights Reserved. # info Vauxoo (info@vauxoo.com) ####################################...
agpl-3.0
tensorflow/tensorflow
tensorflow/python/ops/image_ops_impl.py
6
226930
# 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
motion2015/edx-platform
cms/lib/xblock/authoring_mixin.py
163
1500
""" Mixin class that provides authoring capabilities for XBlocks. """ import logging from django.conf import settings from xblock.core import XBlock from xblock.fields import XBlockMixin from xblock.fragment import Fragment log = logging.getLogger(__name__) VISIBILITY_VIEW = 'visibility_view' @XBlock.needs("i18n...
agpl-3.0
stonebig/bokeh
bokeh/models/axes.py
2
11338
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
sopier/django
django/contrib/contenttypes/management.py
476
2521
from django.apps import apps from django.db import DEFAULT_DB_ALIAS, router from django.utils import six from django.utils.six.moves import input def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS, **kwargs): """ Creates content types for models in the given app, removin...
bsd-3-clause
datalogics-robb/scons
test/Scanner/parallel-rescan.py
2
2125
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
mit
Bristol-Braille/canute-ui
ui/i18n.py
1
2127
import gettext import logging from collections import namedtuple, OrderedDict log = logging.getLogger(__name__) def install(locale_code): try: translations = gettext.translation( 'canute', localedir='ui/locale', languages=[locale_code], fallback=False ) except OSError ...
gpl-3.0
super3/PyDev
Old Workspace/EndlessScroll.py
1
1826
# EndlessScroll.py # Objective: Make an endless scrollable world. # Author: Super3boy (super3.org) # Imports import pygame # Start PyGame pygame.init() # Define Colors black = [0, 0 ,0] white = [255, 255, 255] blue = [ 0, 0 , 255] green = [ 0, 255, 0] red = [255, 0, 0] class Block(pygame.sprite.Sprite): def __ini...
mit
Tithen-Firion/youtube-dl
youtube_dl/extractor/fivemin.py
79
1917
from __future__ import unicode_literals from .common import InfoExtractor class FiveMinIE(InfoExtractor): IE_NAME = '5min' _VALID_URL = r'(?:5min:|https?://(?:[^/]*?5min\.com/|delivery\.vidible\.tv/aol)(?:(?:Scripts/PlayerSeed\.js|playerseed/?)?\?.*?playList=)?)(?P<id>\d+)' _TESTS = [ { ...
unlicense
CloudI/cloudi_api_python
cloudi.py
2
34829
#!/usr/bin/env python #-*-Mode:python;coding:utf-8;tab-width:4;c-basic-offset:4;indent-tabs-mode:()-*- # ex: set ft=python fenc=utf-8 sts=4 ts=4 sw=4 et nomod: # # MIT License # # Copyright (c) 2011-2021 Michael Truog <mjtruog at protonmail dot com> # # Permission is hereby granted, free of charge, to any person obtain...
mit
bopo/tablib
tablib/packages/xlwt/antlr.py
57
84201
## This file is part of PyANTLR. See LICENSE.txt for license ## details..........Copyright (C) Wolfgang Haefelinger, 2004. ## This file was copied for use with xlwt from the 2.7.7 ANTLR distribution. Yes, it ## says 2.7.5 below. The 2.7.5 distribution version didn't have a ## version in it. ## Here is the contents of...
mit
GitAngel/django
django/contrib/admin/templatetags/admin_urls.py
553
1812
from django import template from django.contrib.admin.utils import quote from django.core.urlresolvers import Resolver404, get_script_prefix, resolve from django.utils.http import urlencode from django.utils.six.moves.urllib.parse import parse_qsl, urlparse, urlunparse register = template.Library() @register.filter ...
bsd-3-clause
tmm1/pygments.rb
vendor/pygments-main/pygments/lexers/rust.py
1
8235
# -*- coding: utf-8 -*- """ pygments.lexers.rust ~~~~~~~~~~~~~~~~~~~~ Lexers for the Rust language. :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups, words, default from pygments...
mit
UCL-RITS/django-shibboleth-remoteuser
shibboleth/views.py
10
2867
from django.conf import settings from django.contrib import auth from django.contrib.auth.decorators import login_required from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse from django.shortcuts import redirect from django.utils.decorators import method_decorator fr...
mit
v-iam/azure-sdk-for-python
azure-mgmt-web/azure/mgmt/web/models/recover_response.py
3
1933
# 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
silviolima/EstudoAppengine
tekton/tekton-master/src/tekton/gae/middleware/email_errors.py
4
2552
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import json import logging import traceback import time from google.appengine.api import app_identity, mail, capabilities from google.appengine.runtime import DeadlineExceededError from tekton.router import PathNotFound def get_apis_st...
mit
zielmicha/freeciv-android
lib/freeciv/maptiles.py
4
6047
import ui import graphics import time import contextlib from ui import stream from ui import ctrl from client import freeciv SELECT_POPUP = 0 class MapWidget(ui.Widget): def __init__(self, client): self.client = client self.size = (0, 0) self.drawer = TileDrawer(client) self.tile_...
gpl-2.0
Distrotech/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/tests/test_spatialrefsys.py
94
6686
from django.db import connection from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite from django.utils import unittest test_srs = ({'srid' : 4326, 'auth_name' : ('EPSG', True), 'auth_srid' : 4326, 'srtext' : 'GEOGCS["WGS 84",DATUM["WGS_1984",S...
apache-2.0
MelanieBittl/dolfin
demo/undocumented/functional/python/demo_functional.py
3
1638
"""This demo program computes the value of the functional M(v) = int v^2 + (grad v)^2 dx on the unit square for v = sin(x) + cos(y). The exact value of the functional is M(v) = 2 + 2*sin(1)*(1 - cos(1)) The functional M corresponds to the energy norm for a simple reaction-diffusion equation.""" # Copyright (C) ...
gpl-3.0
CalSol/Impulse
Tracker/register.py
1
3076
# Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
livc/Paddle
python/paddle/utils/preprocess_util.py
18
13149
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
erikr/django
django/db/migrations/operations/models.py
12
33007
from __future__ import unicode_literals from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.db.models.options import normalize_together from django.utils import six from django.utils.functional import cached_property fro...
bsd-3-clause
deniszgonjanin/ckanext-geojsonview
ckanext/geojsonview/plugin.py
1
1204
import ckan.plugins as plugins import ckan.plugins.toolkit as toolkit import ckanext.resourceproxy.plugin as proxy import ckan.lib.datapreview as datapreview from ckan.common import json class GeojsonviewPlugin(plugins.SingletonPlugin): plugins.implements(plugins.IConfigurer, inherit=True) plugins.implements(...
agpl-3.0
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price
data/13 Honeywell/parseJSON.py
26
1412
def getSocialData(post): # Get Thread Object threadObject = post["thread"] domain_rank = threadObject["domain_rank"] #domain_rank #print 'domain_rank:' + str(domain_rank) socialObject = threadObject["social"] #social data object facebookData = socialObject["facebook"] #facebook data #print 'facebook data...
mit
tmpgit/intellij-community
plugins/hg4idea/testData/bin/mercurial/pvec.py
94
5989
# pvec.py - probabilistic vector clocks for Mercurial # # Copyright 2012 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. ''' A "pvec" is a changeset property based on the theory of vector clocks that...
apache-2.0
mbareta/edx-platform-ft
common/lib/calc/calc/tests/test_preview.py
257
8723
# -*- coding: utf-8 -*- """ Unit tests for preview.py """ import unittest from calc import preview import pyparsing class LatexRenderedTest(unittest.TestCase): """ Test the initializing code for LatexRendered. Specifically that it stores the correct data and handles parens well. """ def test_sim...
agpl-3.0
nicanor-romero/OctoPrint
src/octoprint/printer/standard.py
7
31006
# coding=utf-8 """ This module holds the standard implementation of the :class:`PrinterInterface` and it helpers. """ from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C...
agpl-3.0
stevekuznetsov/ansible
test/units/modules/network/nxos/test_nxos_system.py
51
6189
# # (c) 2016 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 option) any later version. # # Ansible is d...
gpl-3.0
vponomaryov/manila
manila/share/drivers/hpe/hpe_3par_mediator.py
1
70220
# Copyright 2015 Hewlett Packard Enterprise Development LP # # 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 requir...
apache-2.0
Opentaste/bombolone
bombolone/routes/content.py
1
5760
# -*- coding: utf-8 -*- """ content.py ~~~~~~ :copyright: (c) 2014 by @zizzamia :license: BSD (See LICENSE for details) """ from flask import (Blueprint, abort, request, session, g, current_app, render_template, send_from_directory) # Imports inside Bombolone import bombolone.model.pa...
bsd-3-clause
fujunwei/chromium-crosswalk
tools/resources/find_used_resources.py
24
2073
#!/usr/bin/env python # 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 argparse import re import sys USAGE = """find_used_resources.py [-h] [-i INPUT] [-o OUTPUT] Outputs the sorted list of resourc...
bsd-3-clause
mavenlin/tensorflow
tensorflow/contrib/slim/python/slim/data/data_decoder.py
146
2302
# 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
BryceBrown/LinkstrDjango
rest_framework/tests/hyperlinkedserializers.py
1
9456
from __future__ import unicode_literals import json from django.test import TestCase from django.test.client import RequestFactory from rest_framework import generics, status, serializers from rest_framework.compat import patterns, url from rest_framework.tests.models import Anchor, BasicModel, ManyToManyModel, BlogPos...
apache-2.0
bisphon/pontiac
settings.py
1
5654
import multiprocessing from six.moves import queue DEBUG = True LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'simple': { 'format': '%(levelname)s %(message)s' }, 'standard': { 'format': '[%(asctime)s] %(levelname)s [%(name)s:%...
mit
sontek/rethinkdb
test/interface/table_wait.py
13
5807
#!/usr/bin/env python # Copyright 2014 RethinkDB, all rights reserved. """The `interface.table_wait` test checks that waiting for a table returns when the table is available for writing.""" from __future__ import print_function import multiprocessing, os, sys, time, traceback, pprint startTime = time.time() sys.pa...
agpl-3.0
Impactstory/sherlockoa
endpoint.py
1
25387
import datetime import json import os from random import random from time import sleep from time import time import requests import shortuuid from sickle import Sickle, oaiexceptions from sickle.iterator import OAIItemIterator from sickle.models import ResumptionToken from sickle.oaiexceptions import NoRecordsMatch, B...
mit
xavfernandez/pip
tests/functional/test_search.py
2
5507
import logging import pretend import pytest from pip._internal.cli.status_codes import NO_MATCHES_FOUND, SUCCESS from pip._internal.commands import create_command from pip._internal.commands.search import ( highest_version, print_results, transform_hits, ) from tests.lib import pyversion if pyversion >= ...
mit
kbrebanov/ansible
lib/ansible/modules/monitoring/honeybadger_deployment.py
49
3829
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014 Benjamin Curtis <benjamin.curtis@gmail.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_versi...
gpl-3.0
youdonghai/intellij-community
python/lib/Lib/posixfile.py
87
7843
"""Extended file operations available in POSIX. f = posixfile.open(filename, [mode, [bufsize]]) will create a new posixfile object f = posixfile.fileopen(fileobject) will create a posixfile object from a builtin file object f.file() will return the original builtin file object f.dup() will r...
apache-2.0
Distrotech/qtwebkit
Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
115
3011
#!/usr/bin/env python # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above # copyright n...
lgpl-3.0
jaehyuk/High-Frequency-Trading-Model-with-IB
params/ib_data_types.py
7
1835
""" Author: James Ma Email stuff here: jamesmawm@gmail.com """ """ API doumentation: https://www.interactivebrokers.com/en/software/api/apiguide/java/reqhistoricaldata.htm https://www.interactivebrokers.com/en/software/api/apiguide/tables/tick_types.htm """ FIELD_BID_SIZE = 0 FIELD_BID_PRICE = 1 FIELD_ASK_PRICE = 2 F...
mit
arante/pyloc
microblog/flask/lib/python3.5/site-packages/whoosh/support/base85.py
95
2473
""" This module contains generic base85 encoding and decoding functions. The whoosh.util.numeric module contains faster variants for encoding and decoding integers. Modified from: http://paste.lisp.org/display/72815 """ import struct from whoosh.compat import xrange # Instead of using the character set from the as...
gpl-3.0