code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import os
import re
import codecs
from setuptools import setup, find_packages
def read(*parts):
filename = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(filename, encoding='utf-8') as fp:
return fp.read()
def find_version(*file_paths):
version_file = read(*file_paths)
vers... | metalpriest/django-constance | setup.py | Python | bsd-3-clause | 1,931 |
from fabric.api import *
from fabric.contrib.files import *
from cloudbio.flavor import Flavor
from cloudbio.custom.shared import (_fetch_and_unpack)
class BioTestFlavor(Flavor):
"""A Flavor for cross Bio* tests
"""
def __init__(self, env):
Flavor.__init__(self,env)
self.name = "Bio* cros... | heuermh/cloudbiolinux | contrib/flavor/pjotrp/biotest/biotestflavor.py | Python | mit | 1,800 |
"""Provide access to Python's configuration information.
This is actually PyPy's minimal configuration information.
The specific configuration variables available depend heavily on the
platform and configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_co... | jedie/pypyjs-standalone | website/js/pypy.js-0.3.0/lib/modules/distutils/sysconfig_pypy.py | Python | mit | 4,713 |
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
import argparse
import collections
import sys
import os
import subprocess
import io
try:
from lxml import etree
except ModuleNotFoundError as e:
etree = e
try:
from shlex import join as shlex_join
except ImportError as e:
shlex_join ... | msekletar/systemd | tools/update-dbus-docs.py | Python | gpl-2.0 | 11,862 |
# -*- coding: utf-8 -*-
#
# This file is part of Radicale Server - Calendar Server
# Copyright © 2008 Nicolas Kandel
# Copyright © 2008 Pascal Halter
# Copyright © 2008-2013 Guillaume Ayoub
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | wohnsinn2/Radicale | radicale/auth/__init__.py | Python | gpl-3.0 | 1,784 |
# Copyright 2014 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 agr... | askdaddy/PerfKitBenchmarker | perfkitbenchmarker/__init__.py | Python | apache-2.0 | 679 |
from django import http
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core.exceptions import ObjectDoesNotExist
def shortcut(request, content_type_id, object_id):
"Redirect to an object's page based on a content-type ID and an object ID."
# ... | CollabQ/CollabQ | vendor/django/contrib/contenttypes/views.py | Python | apache-2.0 | 2,734 |
#!/usr/bin/env python
# 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.
from __future__ import print_function
import glob
import os
import subprocess
import sys
from idl_option import GetOption, Option... | chromium/chromium | ppapi/generators/idl_diff.py | Python | bsd-3-clause | 9,131 |
#
# Copyright (C) 2013 Stanislav Bohm
#
# This file is part of Kaira.
#
# Kaira 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 3 of the License, or
# (at your option) any later versi... | MrPablozOne/kaira | ptp/base/analysis.py | Python | gpl-3.0 | 6,178 |
# 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... | mdrumond/tensorflow | tensorflow/contrib/rnn/python/ops/lstm_ops.py | Python | apache-2.0 | 24,027 |
"""
sentry.web.frontend.accounts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import itertools
from django.contrib import messages
from django.contrib.auth import login as lo... | boneyao/sentry | src/sentry/web/frontend/accounts.py | Python | bsd-3-clause | 10,117 |
#!/usr/bin/env python
from distutils.core import setup, Extension
import sys
if sys.version_info >= (3,):
BOOST_LIB = 'boost_python3'
else:
BOOST_LIB = 'boost_python'
module_RF24Network = Extension('RF24Network',
libraries = ['rf24network', BOOST_LIB],
sources = ['pyRF24Network.cp... | hvos234/raspberrypi.home | vendor/home/Arduino/libraries/RF24Network/RPi/pyRF24Network/setup.py | Python | bsd-3-clause | 416 |
# 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.
from infra_libs.infra_types.infra_types import freeze
from infra_libs.infra_types.infra_types import thaw
from infra_libs.infra_types.infra_types import Froz... | endlessm/chromium-browser | tools/swarming_client/third_party/infra_libs/infra_types/__init__.py | Python | bsd-3-clause | 327 |
# sql/types_api.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
"""Base types API.
"""
from .. import exc, util
from . import operators
from .vi... | pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/sqlalchemy/sql/type_api.py | Python | mit | 46,121 |
# Copyright 2014 Cloudbase Solutions Srl
#
# 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 ... | takeshineshiro/nova | nova/tests/unit/virt/hyperv/test_vmutilsv2.py | Python | apache-2.0 | 11,758 |
# -*- coding: 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
#... | subodhchhabra/airflow | airflow/contrib/hooks/segment_hook.py | Python | apache-2.0 | 3,748 |
import subprocess
import sys
import django.conf
import django.utils.encoding
import matplotlib.pyplot as plt
subprocess.Popen
sys.argv
plt.func() | smmribeiro/intellij-community | python/testData/completion/notImportedQualifiedName/UseImportPriorityWhenAddingImport/main.after.py | Python | apache-2.0 | 149 |
##########################################################################
#
# Copyright (c) 2008-2010, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... | lento/cortex | test/IECore/LayeredDictTest.py | Python | bsd-3-clause | 5,259 |
from django.core.urlresolvers import reverse
from tastypie import authorization
from tastypie.authentication import MultiAuthentication
from crits.events.event import Event
from crits.events.handlers import add_new_event
from crits.core.api import CRITsApiKeyAuthentication, CRITsSessionAuthentication
from crits.core.a... | cfossace/crits | crits/events/api.py | Python | mit | 3,519 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) | saeschdivara/myclothing | website/manage.py | Python | mit | 241 |
# Author: Ovidiu Predescu
# Date: July 2011
#
# 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 ... | tao12345666333/tornado-zh | tornado/test/twisted_test.py | Python | mit | 27,525 |
import unittest
from node.openbazaar_daemon import OpenBazaarContext
import mock
from node import transport
def get_mock_open_bazaar_context():
return OpenBazaarContext.create_default_instance()
class TestTransportLayerCallbacks(unittest.TestCase):
"""Test the callback features of the TransportLayer class.... | atsuyim/OpenBazaar | tests/test_transport.py | Python | mit | 2,556 |
# -*- coding: utf-8 -*-
"""
test_settings
~~~~~~~~~~~~~
Test the Settings object.
"""
import pytest
import h2.errors
import h2.exceptions
import h2.settings
from hypothesis import given, assume
from hypothesis.strategies import (
integers, booleans, fixed_dictionaries, builds
)
class TestSettings(object):
... | KiChjang/servo | tests/wpt/web-platform-tests/tools/third_party/h2/test/test_settings.py | Python | mpl-2.0 | 16,680 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2012-2013 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | 3dfxmadscientist/CBSS | openerp/tools/mail.py | Python | agpl-3.0 | 14,926 |
# -*- coding: 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
#... | subodhchhabra/airflow | tests/contrib/operators/test_dataflow_operator.py | Python | apache-2.0 | 7,353 |
# -*- coding: utf-8 -*-
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.db import migrations
def clear_message_sent_by_message_type_values(apps, schema_editor):
# type: (StateApps, DatabaseSchemaEditor) -> None
UserCoun... | christi3k/zulip | analytics/migrations/0010_clear_messages_sent_values.py | Python | apache-2.0 | 1,174 |
"""
Classes for easy interpolation of trajectories and Curves.
Requires Scipy installed.
"""
import numpy as np
class Interpolator:
""" Poorman's linear interpolator, doesn't require Scipy. """
def __init__(self, tt=None, ss=None, ttss = None, left=None, right=None):
if ttss is not None:
... | kerimlcr/ab2017-dpyo | ornek/moviepy/moviepy-0.2.2.12/moviepy/video/tools/interpolators.py | Python | gpl-3.0 | 2,120 |
from setuptools import setup
version = '1.4'
testing_extras = ['nose', 'coverage']
docs_extras = ['Sphinx']
setup(
name='WebOb',
version=version,
description="WSGI request and response object",
long_description="""\
WebOb provides wrappers around the WSGI request environment, and an
object to help c... | nirmeshk/oh-mainline | vendor/packages/webob/setup.py | Python | agpl-3.0 | 2,150 |
# Copyright 2013 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... | devendermishrajio/nova_test_latest | nova/tests/unit/objects/test_block_device.py | Python | apache-2.0 | 16,751 |
# Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2015 the ZAP development 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... | 0xkasun/zaproxy | python/api/src/zapv2/core.py | Python | apache-2.0 | 14,644 |
# 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 by applicable law or a... | ivano666/tensorflow | tensorflow/g3doc/how_tos/adding_an_op/zero_out_op_1.py | Python | apache-2.0 | 1,041 |
import sys
import subprocess
MODULES = [
"scipy.cluster",
"scipy.cluster.vq",
"scipy.cluster.hierarchy",
"scipy.constants",
"scipy.fft",
"scipy.fftpack",
"scipy.fftpack.convolve",
"scipy.integrate",
"scipy.interpolate",
"scipy.io",
"scipy.io.arff",
"scipy.io.harwell_boe... | WarrenWeckesser/scipy | scipy/_lib/tests/test_import_cycles.py | Python | bsd-3-clause | 1,306 |
keyBindings = { }
from keyids import KEYIDS
from Components.config import config
from Components.RcModel import rc_model
keyDescriptions = [{
KEYIDS["BTN_0"]: ("UP", "fp"),
KEYIDS["BTN_1"]: ("DOWN", "fp"),
KEYIDS["KEY_OK"]: ("OK", ""),
KEYIDS["KEY_UP"]: ("UP",),
KEYIDS["KEY_DOWN"]: ("DOWN",),
KEYIDS["KEY... | ACJTeam/enigma2 | lib/python/Tools/KeyBindings.py | Python | gpl-2.0 | 8,341 |
"""
Turtle RDF graph serializer for RDFLib.
See <http://www.w3.org/TeamSubmission/turtle/> for syntax specification.
"""
from collections import defaultdict
from rdflib.term import BNode, Literal, URIRef
from rdflib.exceptions import Error
from rdflib.serializer import Serializer
from rdflib.namespace import RDF, RDF... | gloaec/trifle | src/rdflib/plugins/serializers/turtle.py | Python | gpl-3.0 | 12,175 |
from __future__ import unicode_literals
import frappe
import frappe.website.render
def execute():
for item_code in frappe.db.sql_list("""select distinct variant_of from `tabItem`
where variant_of is not null and variant_of !='' and show_in_website=1"""):
item = frappe.get_doc("Item", item_code)
item.db_set("sh... | mahabuber/erpnext | erpnext/patches/v6_5/show_in_website_for_template_item.py | Python | agpl-3.0 | 486 |
#!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test the 'symlink' rule.
import os
import BoostBuild
if os.name != 'posix':
print "The... | mxrrow/zaicoin | src/deps/boost/tools/build/v2/test/symlink.py | Python | mit | 845 |
"""
The main QuerySet implementation. This provides the public API for the ORM.
"""
import copy
import itertools
import sys
from django.db import connections, router, transaction, IntegrityError
from django.db.models.fields import AutoField
from django.db.models.query_utils import (Q, select_related_descend,
defe... | uiri/pxqz | venv/lib/python2.7/site-packages/django/db/models/query.py | Python | gpl-3.0 | 69,558 |
from __future__ import division
import numpy as np
from bokeh.plotting import figure, HBox, output_file, show, VBox
from bokeh.models import Range1d
# create some data using python lists
x1 = [1, 2, 5, 7, -8, 5, 2, 7, 1, -3, -5, 1.7, 5.4, -5]
y1 = [5, 6, -3, 1.5, 2, 1, 1, 9, 2.4, -3, 6, 8, 2, 4]
# creat... | almarklein/bokeh | sphinx/source/tutorial/exercises/scatter.py | Python | bsd-3-clause | 2,389 |
# -*- coding: utf-8 -*-
"""
werkzeug.contrib.atom
~~~~~~~~~~~~~~~~~~~~~
This module provides a class called :class:`AtomFeed` which can be
used to generate feeds in the Atom syndication format (see :rfc:`4287`).
Example::
def atom_feed(request):
feed = AtomFeed("My Blog", feed... | gwwfps/boxrps | werkzeug/contrib/atom.py | Python | mit | 14,976 |
# Copyright 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 inspect
import os
import re
import urlparse
_next_page_id = 0
class Page(object):
def __init__(self, url, page_set=None, base_dir=None, name=''):
... | GladeRom/android_external_chromium_org | tools/telemetry/telemetry/page/__init__.py | Python | bsd-3-clause | 5,716 |
"""
Utility functions from 2to3, 3to2 and python-modernize (and some home-grown
ones).
Licences:
2to3: PSF License v2
3to2: Apache Software License (from 3to2/setup.py)
python-modernize licence: BSD (from python-modernize/LICENSE)
"""
from lib2to3.fixer_util import (FromImport, Newline, is_import,
... | hughperkins/kgsgo-dataset-preprocessor | thirdparty/future/src/libfuturize/fixer_util.py | Python | mpl-2.0 | 16,007 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | osbzr/gooderp_org | portal/wizard/portal_wizard.py | Python | agpl-3.0 | 11,851 |
# -*- coding: utf-8 -*-
API_VERSION = 'v1'
DOMAIN = {'contacts': {}}
| Jumpscale/web | pythonlib/eve/tests/test_version.py | Python | apache-2.0 | 70 |
# 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... | berrange/nova | nova/tests/virt/baremetal/db/test_bm_node.py | Python | apache-2.0 | 6,886 |
# -*- coding: utf-8 -*-
#
# pysaml2 documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 24 08:13:41 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/pysaml2-2.4.0/doc/conf.py | Python | gpl-2.0 | 6,371 |
"""passlib tests"""
| charukiewicz/beer-manager | venv/lib/python3.4/site-packages/passlib/tests/__init__.py | Python | mit | 20 |
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | Phil-LiDAR2-Geonode/pl2-geonode | geonode/catalogue/backends/geonetwork.py | Python | gpl-3.0 | 1,161 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | sambitgaan/nupic | tests/swarming/nupic/swarming/experiments/smart_speculation_temporal/description.py | Python | agpl-3.0 | 16,827 |
#!/usr/bin/env python
# coding: utf-8
import unittest
import sys
import os
PROJECT_PATH = os.path.sep.join(os.path.abspath(__file__).split(os.path.sep)[:-2])
ROOT_PATH = os.path.dirname(__file__)
if __name__ == '__main__':
if 'GAE_SDK' in os.environ:
SDK_PATH = os.environ['GAE_SDK']
sys.path.in... | renzon/gae-continuous-delivery | test/testloader.py | Python | mit | 635 |
# (c) 2017, Brian Coca
#
# 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 dist... | RackSec/ansible | lib/ansible/plugins/cache/yaml.py | Python | gpl-3.0 | 1,666 |
# 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... | mitch-kyle/message-board | support/apache-cassandra-2.2.1/pylib/cqlshlib/pylexotron.py | Python | apache-2.0 | 18,820 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestSchoolHouse(unittest.TestCase):
pass
| manqala/erpnext | erpnext/schools/doctype/school_house/test_school_house.py | Python | gpl-3.0 | 231 |
import os
filename = os.path.basename(__file__)
def main(request, response):
if request.method == 'POST':
return 302, [('Location', './%s?redirect' % filename)], ''
return [('Content-Type', 'text/plain')], request.request_path
| UK992/servo | tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-body.py | Python | mpl-2.0 | 246 |
from warnings import warn
from beaker.crypto.pbkdf2 import PBKDF2, strxor
from beaker.crypto.util import hmac, sha1, hmac_sha1, md5
from beaker import util
keyLength = None
if util.jython:
try:
from beaker.crypto.jcecrypto import getKeyLength, aesEncrypt
keyLength = getKeyLength()
except Impo... | Arno-Nymous/pyload | module/lib/beaker/crypto/__init__.py | Python | gpl-3.0 | 1,233 |
#!/usr/bin/env python3
import os
import sys
import xml.dom
from xml.dom import minidom
# STRINGTABLE DIAG TOOL
# Author: KoffeinFlummi
# ---------------------
# Counts duplicates stringtable entries
def check_module(projectpath, module):
""" Checks the given module for all the different languages. """
loca... | MikeMatrix/ACE3 | tools/stringtableduplicates.py | Python | gpl-2.0 | 1,652 |
#
# (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... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/terminal/iosxr.py | Python | bsd-3-clause | 1,889 |
#import sys, traceback
import mal_readline
import mal_types as types
from mal_types import (MalSym, MalInt, MalStr,
_symbol, _keywordu,
MalList, _list, MalVector, MalHashMap, MalFunc)
import reader, printer
from env import Env
# read
def READ(str):
return reader.read_s... | alphaKAI/mal | rpython/step3_env.py | Python | mpl-2.0 | 3,570 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Winkler <mail () winkler-alexander.de>
# based on svr4pkg by
# Boyd Adamson <boyd () boydadamson.com> (2012)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division,... | hryamzik/ansible | lib/ansible/modules/packaging/os/pkgutil.py | Python | gpl-3.0 | 6,757 |
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.migrations.loader import MigrationLoader
class Command(BaseCommand):
help = "Shows all available migrations for the current project"
def add_arguments(self, parser):
pa... | ifduyue/django | django/core/management/commands/showmigrations.py | Python | bsd-3-clause | 5,333 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/contrib/opt/python/training/drop_stale_gradient_optimizer.py | Python | bsd-2-clause | 4,333 |
# 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/python/ops/tensor_array_grad.py | Python | bsd-2-clause | 9,083 |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | cherrishes/weilai | xingxing/protobuf/python/lib/Python3.4/google/protobuf/internal/cpp_message.py | Python | apache-2.0 | 23,543 |
#!/usr/bin/env python
r"""A simple, fast, extensible JSON encoder and decoder
JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
simplejson exposes an API familiar to uses of the standard library
marshal and pickle... | fernandalavalle/mlab-ns | server/mapreduce/lib/simplejson/__init__.py | Python | apache-2.0 | 12,383 |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
parse_duration,
unified_strdate,
str_to_int,
float_or_none,
ISO639Utils,
)
class AdobeTVIE(InfoExtractor):
_VALID_URL = r'https?://tv\.adobe\.com/watch/[^/]+/(?P<id>[^/]+)'
_TEST = {
'... | apllicationCOM/youtube-dl-api-server | youtube_dl_server/youtube_dl/extractor/adobetv.py | Python | unlicense | 4,630 |
# 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 ... | klickagent/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/driver.py | Python | bsd-3-clause | 25,616 |
"""
Constants used across the ORM in general.
"""
# Separator used to split filter strings apart.
LOOKUP_SEP = '__'
| ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/db/models/constants.py | Python | bsd-3-clause | 118 |
# 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... | npuichigo/ttsflow | third_party/tensorflow/tensorflow/python/kernel_tests/base64_ops_test.py | Python | apache-2.0 | 5,658 |
# 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... | npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/tensor_forest/hybrid/python/layers/decisions_to_data_test.py | Python | apache-2.0 | 2,506 |
#!/usr/bin/env python
# encoding: utf-8
# from __future__ import unicode_literals
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
def readme():
"Falls back to just file().read() on any error, because the conversion to rst is only really relevant when up... | dwt/simplesuper | setup.py | Python | isc | 1,671 |
#/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
""" This file uses the fpga_interchange to crea... | SymbiFlow/python-fpga-interchange | tests/example_netlist.py | Python | isc | 13,854 |
import os
from celery import Celery
from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_secretary.settings')
app = Celery('test_secretary')
# Using a string here means the worker will not have to
# pickle the obje... | rs-dev/Test-Secretary | test_secretary/celery_setup.py | Python | isc | 446 |
# -*- coding: utf-8 -*-
#
# tree.py
#
# (c) D.C.-G. 2014
#
# Tree widget for albow
#
from albow.widget import Widget
from albow.menu import Menu
from albow.fields import IntField, FloatField, TextFieldWrapped
from albow.controls import CheckBox, AttrRef, Label, Button
from albow.dialogs import ask, alert, input_text_bu... | OniOniOn-/MCEdit-Unified | albow/tree.py | Python | isc | 20,845 |
import PandaProd.Producer.opts
PandaProd.Producer.opts.options.config = 'Autumn18'
from PandaProd.Producer.prod import process
| cpausmit/Kraken | pandaf/014/mc.py | Python | mit | 129 |
# -*- coding: utf-8 -*-
"""
UserBot module
Copyright 2015, Ismael R. Lugo G.
"""
import translate
reload(translate)
from sysb import commands
from translate import lang
from translate import _
commands.addHandler('translate', '(tr|translate)2 (?P<in>[^ ]+) (?P<out>[^ ]+) '
'(?P<text>.*)', {'sintax': 'tr2 <input... | IsmaelRLG/UserBot | mods/translate/__init__.py | Python | mit | 817 |
from models import Post, PostForm, Department
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, render, redirect
from django.template.loader import render_to_string
import os
from django.core.mail import send_mail
from django.core.p... | phoxicle/timboektu | timboektu/books/views.py | Python | mit | 4,914 |
import os
import unicodedata
from keras.applications import InceptionV3, VGG16, MobileNet
image_type = ['.jpg']
def check_img(file_name):
"""To check image
Args:
file_name : file name
Returns:
if this file is image
"""
file_name, file_ext = os.path.splitext(file_name)
if fil... | seongahjo/Mosaicer | mosaicer/file_util.py | Python | mit | 1,185 |
from PyQt5.QtCore import *
from PyDesignData.PyDesignObject import *
from PyDesignModel.PyDesignCalcSheetsItem import PyDesignCalcSheetsItem
from PyDesignModel.PyDesignIcons import *
from PyDesignModel.PyDesignMaterialsItem import PyDesignMaterialsItem
from PyDesignModel.PyDesignModelItem import PyDesignModelItem
from ... | pracedru/pyDesign | PyDesignModel/PyDesignAnalysisItem.py | Python | mit | 5,100 |
import arcpy, os, json, csv
from portal import additem, shareItem, generateToken, getUserContent, updateItem, getGroupID, deleteItem, getGroupContent
from metadata import metadata
from ESRImapservice import ESRImapservice
class csvportal(object):
def __init__(self, user, password, portal, worksspace, group... | warrieka/portal4argis_tools | portal/csvportal.py | Python | mit | 4,761 |
"""
This file holds the default values for the various programs.
"""
import sys
__all__ = ['defaults']
defaults = {
# filenames
'cache_file' : 'bin/cache.bin',
'log_file' : sys.stderr,
# values
'num_threads' : 16,
# flags
'debug' : False,
'https' : False,
'offline... | crypt3lx2k/Imageboard-Web-Interface | defaults.py | Python | mit | 363 |
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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, ... | beetbox/beets | test/test_dbcore.py | Python | mit | 23,723 |
import os
DEFAULT_CHARACTER_PATH = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'characters')
CHARACTER_PATH = os.environ.get('HR_CHARACTER_PATH', DEFAULT_CHARACTER_PATH)
RESET_SESSION_BY_HELLO = False
SESSION_REMOVE_TIMEOUT = 3600 # Timeout seconds for a session to be removed
CHATBOT_LOG_DIR = os.... | hansonrobotics/chatbot | src/chatbot/server/config.py | Python | mit | 1,300 |
# -*- coding: utf-8 -*-
"""Init and utils."""
from zope.i18nmessageid import MessageFactory
_ = MessageFactory('dpf.sitetheme')
def initialize(context):
"""Initializer called when used as a Zope 2 product."""
| a25kk/dpf | src/dpf.sitetheme/dpf/sitetheme/__init__.py | Python | mit | 217 |
# -*- coding: utf-8 -*-
import json
from enum import IntEnum
import requests
from wechatpy.client.api.base import BaseWeChatAPI
class FileType(IntEnum):
JSON = 1
CSV = 2
class ConflictMode(IntEnum):
INSERT = 1
UPSERT = 2
class WeChatCloud(BaseWeChatAPI):
API_BASE_URL = 'https://api.weixin.q... | messense/wechatpy | wechatpy/client/api/cloud.py | Python | mit | 12,240 |
# Copyright (c) 2013 eGauge Systems LLC
# 4730 Walnut St, Suite 110
# Boulder, CO 80301
# voice: 720-545-9767
# email: davidm@egauge.net
#
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | thecardcheat/egauge-api-examples | python/eGauge.py | Python | mit | 5,735 |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | SusannaMaria/beets | beets/autotag/mb.py | Python | mit | 18,620 |
import sys
def get_civ_leader(civ_leader_file):
"""Reads in a file with civs mapped to leaders and add it to a dict.
"""
return {leader.strip('\n'): country
for line in civ_leader_file
for (country, leader) in [line.split('\t')]}
def get_all_names(civ_leader):
"""Reads in all ... | vincentrose88/civAdder | civ_battleroyal_leader_civ_adder.py | Python | mit | 3,793 |
class UserInfoModel(object):
PartenaireID = 0
Mail = ""
CodeUtilisateur = ""
TypeAbonnement = ""
DateExpiration = ""
DateSouscription = ""
AccountExist = False
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def create_dummy_model(self):
self.Mail = "dumm... | NextINpact/LaPresseLibreSDK | python_django/sdk_lpl/models/UserInfosModel.py | Python | mit | 439 |
# Copyright 2016 Amazon Web Services, Inc. or its affiliates. All Rights Reserved.
# This file is licensed to you under the AWS Customer Agreement (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at http://aws.amazon.com/agreement/ .
# This file... | moduspwnens/boa-chat | boa-nimbus/lambda-pip-modules/cfnresponse/cfnresponse/__init__.py | Python | mit | 1,738 |
import operator
from django.db import models
from django.db.models import Q
from django.db.models import Count
from caching.base import CachingManager, CachingMixin
from emoticonvis.apps.base import models as base_models
from emoticonvis.apps.corpus import utils
import numpy
class Dataset(models.Model):
"""A to... | nanchenchen/emoticon-analysis | emoticonvis/apps/corpus/models.py | Python | mit | 5,332 |
from nider.core import Font
from nider.core import Outline
from nider.models import Header
from nider.models import Paragraph
from nider.models import Linkback
from nider.models import Content
from nider.models import TwitterPost
# TODO: change this fontpath to the fontpath on your machine
roboto_font_folder = '/hom... | pythad/nider | examples/draw_on_texture_example/script.py | Python | mit | 1,593 |
# -*- coding: utf-8 -*-
"""
MicroSAN Network Module
"""
import socket, traceback
IPADDR_BROADCAST = '<broadcast>'
IPADDR_ANY = ''
SOCK_BUF_SIZE = 8192
SOCK_TIMEOUT = 1
MICROSAN_PORT = 20001
APP_PORT = 51000
class UDPSocket(object):
def __init__(self, addr = None, reuse_addr = False):
"""
Creat... | ktomala/microsan | src/network.py | Python | mit | 1,992 |
import plugins, datetime, time, os
class BatchVersionFilter:
def __init__(self, batchSession):
self.batchSession = batchSession
def verifyVersions(self, app):
badVersion = self.findUnacceptableVersion(app)
if badVersion is not None:
raise plugins.TextTestError, "unregistere... | emilybache/texttest-runner | src/main/python/lib/default/batch/batchutils.py | Python | mit | 1,956 |
import sublime
import sublime_plugin
try:
from .sbtsettings import SBTSettings
from .util import maybe, OnePerWindow
except(ValueError):
from sbtsettings import SBTSettings
from util import maybe, OnePerWindow
import re
class SbtView(OnePerWindow):
settings = {
"line_numbers": False,
... | jarhart/SublimeSBT | sbtview.py | Python | mit | 5,229 |
from interval import interval, inf, imath, fpu
from complexinterval import ComplexInterval, _one, _zero
from complexpolynomial import ComplexPolynomial
class Newton:
def __init__(self, start, poly):
self.start = start
self.poly = poly
self.iterates = 0
self.deriv = poly.derive()
self.step = start
def ite... | yuanagain/seniorthesis | src/intervals/newton.py | Python | mit | 4,396 |
"""Debouncing provides functions for delaying or skipping a queue `push`
subject to a specified debouncing constraint. When used with idempotent
operations, this provides a safe and consistent method of throttling
queue pushes within Deferrable itself.
The debouncing constraint is defined as follows:
If `debounce_alw... | gamechanger/deferrable | deferrable/debounce.py | Python | mit | 2,641 |
#!/usr/bin/env python
from TweetGrabber import * | weilneb/twitter-utils | twutils/__init__.py | Python | mit | 48 |
from __future__ import print_function
from mnist import evaluate
import sys
model = evaluate.init()
prediction1, confidence1 = evaluate.from_local_image(sys.argv[1], model)
print("prediction: {}; confidence: {:.2f}".format(prediction1, confidence1))
prediction2, confidence2 = evaluate.from_local_image(sys.argv[1], mo... | mnannt/mnist_experiments | mnist_evaluate.py | Python | mit | 402 |
import directory
import scanner
import mapper
import board
import os
class Klopfer(object):
def __init__(self, import_dir, export_dir):
self.import_dir = import_dir
self.export_dir = export_dir
print "Klopfer class"
def run(self):
# open dir and get oldest file with the given... | slx-dev/digital-kanban | src/klopfer.py | Python | mit | 1,083 |
import svgutils.transform as sg
from common import load_svg, label_plot
fig = sg.SVGFigure("4.1in", "1.8in")
a = load_svg(snakemake.input[1])
b = load_svg(snakemake.input[0])
b.moveto(190, 0)
la = label_plot(5, 10, "a")
lb = label_plot(185, 10, "b")
fig.append([a, b, la, lb])
fig.save(snakemake.output[0])
| merfishtools/merfishtools-evaluation | scripts/fig-dataset-correlation.py | Python | mit | 311 |
#!/usr/bin/env python3
html_colors = {
"aliceblue": "f0f8ff",
"antiquewhite": "faebd7",
"aqua": "00ffff",
"aquamarine": "7fffd4",
"azure": "f0ffff",
"beige": "f5f5dc",
"bisque": "ffe4c4",
"black": "000000",
"blanchedalmond": "ffebcd",
"blue": "0000ff",
"blueviolet": "8a2be2"... | flypenguin/docker-loadummy | gray_conversion.py | Python | mit | 4,637 |