repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
mingrammer/pyreportcard
tests/test_vcs.py
1
3355
import os import shutil import unittest from config import Config from db.collection import get_repo_collection from vcs.repository import cache, clear, clone, create_repository, is_cached, parse_url class RepositoryTest(unittest.TestCase): def setUp(self): self.repositories = get_repo_collection() ...
mit
dancingdan/tensorflow
tensorflow/python/data/experimental/kernel_tests/tf_record_writer_test.py
8
4406
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
darkleons/lama
addons/account_chart/__openerp__.py
313
1451
# -*- 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
wenwei202/terngrad
terngrad/inception/slim/inception_utils.py
66
2630
# 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
syaiful6/django
tests/generic_views/models.py
382
1631
from django.core.urlresolvers import reverse from django.db import models from django.db.models import QuerySet from django.db.models.manager import BaseManager from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Artist(models.Model): name = models.CharField(max_length...
bsd-3-clause
affo/nova
nova/tests/unit/api/openstack/compute/contrib/test_multiple_create.py
4
22862
# Copyright 2013 IBM Corp. # 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 app...
apache-2.0
memtoko/django
tests/basic/tests.py
3
29074
from __future__ import unicode_literals import threading import warnings from datetime import datetime, timedelta from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections from django.db.models.fields import Field from django.db.m...
bsd-3-clause
nlamirault/python-freeboxclient
doc/source/conf.py
1
8617
# # Copyright 2013 Nicolas Lamirault <nicolas.lamirault@gmail.com>. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
cindyyu/kuma
kuma/search/models.py
22
7642
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.dispatch import receiver from django.utils import timezone from django.utils.functional import cac...
mpl-2.0
jamestwebber/scipy
scipy/spatial/transform/tests/test_rotation_groups.py
3
5626
from __future__ import division, print_function, absolute_import import pytest import numpy as np from numpy.testing import assert_array_almost_equal from scipy.spatial.transform import Rotation from scipy.optimize import linear_sum_assignment from scipy.spatial.distance import cdist from scipy.constants import golde...
bsd-3-clause
StuartJSquires/markov_slackbot
markov_slackbot/message_interpreter.py
1
5241
# -*- coding: utf-8 -*- from itertools import chain import logging import re class MessageInterpreter(object): def __init__(self, user_id, username, command_names, external_texts): self.logger = logging.getLogger(__name__) self.user_id = user_id self.username = username self.exter...
mit
alexus37/AugmentedRealityChess
pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/GL/EXT/stencil_two_side.py
9
1147
'''OpenGL extension EXT.stencil_two_side This module customises the behaviour of the OpenGL.raw.GL.EXT.stencil_two_side to provide a more Python-friendly API Overview (from the spec) This extension provides two-sided stencil testing where the stencil-related state (stencil operations, reference value, compare ...
mit
jorgefernandes/lighthouseads
node_modules/node-gyp/gyp/tools/pretty_sln.py
1831
5099
#!/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. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependenci...
mit
neavouli/yournextrepresentative
candidates/management/commands/candidates_import_statements_of_persons_nominated.py
3
7018
from __future__ import print_function, unicode_literals import errno import hashlib import magic import mimetypes import os from os.path import dirname, join, exists import requests from django.core.management.base import BaseCommand, CommandError from django.core.files.storage import FileSystemStorage from official...
agpl-3.0
jedie/django-cms-tools
django_cms_tools/cms_apps_helper.py
1
2388
""" :create: 2018 by Jens Diemer :copyleft: 2018 by the django-cms-tools team, see AUTHORS for more details. :license: GNU GPL v3 or above, see LICENSE for more details. """ import logging from django.utils.translation import ugettext_lazy as _ from cms.models import Page from cms.utils.i18n import forc...
gpl-3.0
ryfeus/lambda-packs
Keras_tensorflow/source/numpy/ma/tests/test_core.py
10
167619
# pylint: disable-msg=W0401,W0511,W0611,W0612,W0614,R0201,E1102 """Tests suite for MaskedArray & subclassing. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu """ from __future__ import division, absolute_import, print_function __author__ = "Pierre GF Gerard-Marchant" import warnings import pickle i...
mit
whip112/Whip112
vendor/packages/pygments/formatters/svg.py
76
5840
# -*- coding: utf-8 -*- """ pygments.formatters.svg ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for SVG output. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.util import get_bool_opt, get...
mpl-2.0
ameihm0912/MozDef
mq/esworker.papertrail.py
1
22026
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Copyright (c) 2015 Mozilla Corporation # # Contributors: # Aaron Meihm ameihm@mozilla.com # Rea...
mpl-2.0
jlspyaozhongkai/Uter
third_party_build/Python-2.7.9/lib/python2.7/idlelib/run.py
30
12387
import sys import io import linecache import time import socket import traceback import thread import threading import Queue from idlelib import CallTips from idlelib import AutoComplete from idlelib import RemoteDebugger from idlelib import RemoteObjectBrowser from idlelib import StackViewer from idlelib import rpc ...
gpl-3.0
evansd/django
tests/template_tests/filter_tests/test_stringformat.py
73
1191
from django.template.defaultfilters import stringformat from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class StringformatTests(SimpleTestCase): """ Notice that escaping is applied *after* any filters, so the string formatting here only needs...
bsd-3-clause
JioCloud/tempest
tempest/services/compute/json/volumes_extensions_client.py
6
4245
# Copyright 2012 OpenStack Foundation # 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
fchauvel/MAD
mad/simulation/tasks.py
1
8578
#!/usr/bin/env python # # This file is part of MAD. # # MAD 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. # # MAD is distributed in ...
gpl-3.0
mikebentley15/cs6350_project_ml
indexing/src/TrainingExample.py
1
1448
''' Provides a TrainingExample named tuple for convenience. Also, factory functions exist such as trainingExamplesFromSvm(). ''' from collections import namedtuple import numpy TrainingExample = namedtuple('TrainingExample', ('label', 'features')) # ''' # TrainingExample: NamedTuple to contain a single training exam...
mit
fenginx/django
tests/urlpatterns_reverse/urls.py
61
4778
from django.urls import include, path, re_path from .views import ( absolute_kwargs_view, defaults_view, empty_view, empty_view_nested_partial, empty_view_partial, empty_view_wrapped, nested_view, ) other_patterns = [ path('non_path_include/', empty_view, name='non_path_include'), path('nested_path/',...
bsd-3-clause
HydrelioxGitHub/home-assistant
tests/components/nuheat/test_init.py
12
1431
"""NuHeat component tests.""" import unittest from unittest.mock import patch from tests.common import get_test_home_assistant, MockDependency from homeassistant.components import nuheat VALID_CONFIG = { "nuheat": { "username": "warm", "password": "feet", "devices": "thermostat123" } ...
apache-2.0
charbeljc/e-commerce
__unported__/product_links_goodies/purchase.py
18
9124
# -*- encoding: utf-8 -*- ############################################################################### # # # purchase_outillage for OpenERP # # Copyright (C) 2011 Akretion Sébastien BEAU <se...
agpl-3.0
ahaberlie/MetPy
tests/plots/test_cartopy_utils.py
3
2612
# Copyright (c) 2018 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Test the cartopy utilities.""" import cartopy.crs as ccrs import matplotlib import matplotlib.pyplot as plt import pytest from metpy.plots import USCOUNTIES, USSTATES # Fixtures...
bsd-3-clause
mfherbst/spack
var/spack/repos/builtin/packages/libxmu/package.py
5
1935
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
SurfasJones/djcmsrc3
venv/lib/python2.7/site-packages/cms/migrations/0024_added_placeholder_model.py
525
20033
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
mit
Pablomoto1000/Pablosity
node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
1284
100329
# Copyright (c) 2013 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 copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp imp...
gpl-2.0
jaywreddy/django
tests/logging_tests/tests.py
72
17601
# -*- coding:utf-8 -*- from __future__ import unicode_literals import logging import warnings from admin_scripts.tests import AdminScriptTestCase from django.conf import settings from django.core import mail from django.core.files.temp import NamedTemporaryFile from django.test import RequestFactory, SimpleTestCase,...
bsd-3-clause
dpshelio/sunpy
examples/units_and_coordinates/AIA_limb_STEREO.py
1
3832
# -*- coding: utf-8 -*- """ =========================================== Drawing the AIA limb on a STEREO EUVI image =========================================== In this example we use a STEREO-B and an SDO image to demonstrate how to overplot the limb as seen by AIA on an EUVI-B image. Then we overplot the AIA coordina...
bsd-2-clause
beni55/django
django/core/checks/security/base.py
135
6076
from django.conf import settings from .. import Tags, Warning, register SECRET_KEY_MIN_LENGTH = 50 SECRET_KEY_MIN_UNIQUE_CHARACTERS = 5 W001 = Warning( "You do not have 'django.middleware.security.SecurityMiddleware' " "in your MIDDLEWARE_CLASSES so the SECURE_HSTS_SECONDS, " "SECURE_CONTENT_TYPE_NOSNIFF...
bsd-3-clause
scs/uclinux
lib/boost/boost_1_38_0/libs/python/test/pickle3.py
46
1566
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) r'''>>> import pickle3_ext >>> import pickle >>> pickle3_ext.world.__module__ 'pickle3_ext' >>> pickle3_ext.world.__safe...
gpl-2.0
kenwang76/readthedocs.org
readthedocs/redirects/models.py
26
2513
from django.db import models from django.utils.translation import ugettext from django.utils.translation import ugettext_lazy as _ from readthedocs.projects.models import Project HTTP_STATUS_CHOICES = ( (301, _('301 - Permanent Redirect')), (302, _('302 - Temporary Redirect')), ) STATUS_CHOICES = ( (True...
mit
75651/kbengine_cloud
kbe/res/scripts/common/Lib/multiprocessing/process.py
98
9144
# # Module providing the `Process` class which emulates `threading.Thread` # # multiprocessing/process.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = ['BaseProcess', 'current_process', 'active_children'] # # Imports # import os import sys import signal import i...
lgpl-3.0
vaporry/pydevp2p
devp2p/tests/test_multiplexer.py
3
6454
from devp2p.multiplexer import Multiplexer, Packet, Frame, DeserializationError def test_frame(): mux = Multiplexer() p0 = 0 mux.add_protocol(p0) # test normal packet packet0 = Packet(p0, cmd_id=0, payload='x' * 100) mux.add_packet(packet0) frames = mux.pop_frames() assert len(frames)...
mit
ilexius/odoo
addons/delivery/models/stock_move.py
11
1843
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import api, fields, models import openerp.addons.decimal_precision as dp class StockMove(models.Model): _inherit = 'stock.move' def _default_uom(self): uom_categ_id = self.env.ref('produc...
gpl-3.0
wasade/networkx
networkx/algorithms/connectivity/tests/test_connectivity.py
44
15871
import itertools from nose.tools import assert_equal, assert_true, assert_false, assert_raises import networkx as nx from networkx.algorithms.flow import (edmonds_karp, preflow_push, shortest_augmenting_path) flow_funcs = [edmonds_karp, preflow_push, shortest_augmenting_path] # connectivity functions not import...
bsd-3-clause
chemelnucfin/tensorflow
tensorflow/python/data/experimental/kernel_tests/copy_to_device_test.py
5
22457
# 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...
apache-2.0
NervanaSystems/neon
examples/mnist_hdf5.py
1
3625
#!/usr/bin/env python # ****************************************************************************** # Copyright 2014-2018 Intel Corporation # # 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
tangfeixiong/nova
nova/tests/unit/api/ec2/test_ec2_validate.py
60
11301
# Copyright 2012 Cloudscaling, Inc. # All Rights Reserved. # 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/L...
apache-2.0
CiscoSystems/fabric_enabler
dfa/db/dfa_db_api.py
1
1275
# Copyright 2014 Cisco Systems, 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 requi...
apache-2.0
sagangwee/sagangwee.github.io
build/pygments/build/lib.linux-i686-2.7/pygments/__init__.py
43
3114
# -*- coding: utf-8 -*- """ Pygments ~~~~~~~~ Pygments is a syntax highlighting package written in Python. It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are: * a ...
mit
polymeris/qgis
python/plugins/fTools/tools/doVectorGrid.py
2
14136
# -*- coding: utf-8 -*- #----------------------------------------------------------- # # fTools # Copyright (C) 2008-2011 Carson Farmer # EMAIL: carson.farmer (at) gmail.com # WEB : http://www.ftools.ca/fTools.html # # A collection of data management and analysis tools for vector data # #-----------------------------...
gpl-2.0
Atheros1/PyBitmessage
src/message_data_reader.py
10
3977
#This program can be used to print out everything in your Inbox or Sent folders and also take things out of the trash. #Scroll down to the bottom to see the functions that you can uncomment. Save then run this file. #The functions which only read the database file seem to function just fine even if you have Bitmessage ...
mit
pwong-mapr/private-hue
desktop/core/ext-py/python-ldap-2.3.13/Lib/dsml.py
44
8418
""" dsml - generate and parse DSMLv1 data (see http://www.oasis-open.org/committees/dsml/) See http://www.python-ldap.org/ for details. $Id: dsml.py,v 1.16 2010/05/07 08:15:47 stroeder Exp $ Python compability note: Tested with Python 2.0+. """ __version__ = '2.3.12' import string,base64 def list_dict(l): """ ...
apache-2.0
achadwick/mypaint
gui/quickchoice.py
3
12339
# This file is part of MyPaint. # Copyright (C) 2013 by Andrew Chadwick <a.t.chadwick@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 License, or # (at your ...
gpl-2.0
DonBeo/scikit-learn
benchmarks/bench_mnist.py
154
6006
""" ======================= MNIST dataset benchmark ======================= Benchmark on the MNIST dataset. The dataset comprises 70,000 samples and 784 features. Here, we consider the task of predicting 10 classes - digits from 0 to 9 from their raw images. By contrast to the covertype dataset, the feature space is...
bsd-3-clause
grnet/synnefo
snf-cyclades-app/synnefo/db/migrations/old/0092_auto__add_field_subnet_created__add_field_subnet_updated.py
10
19687
# -*- 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): # Adding field 'Subnet.created' db.add_column('db_subnet', 'created', self.gf('django....
gpl-3.0
stianvi/ansible-modules-core
database/postgresql/postgresql_user.py
15
25233
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0
michaelhowden/eden
modules/tests/volunteer/export_volunteers.py
25
1890
# -*- coding: utf-8 -*- """ Sahana Eden Volunteer Module Automated Tests @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT 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...
mit
zjuwangg/scrapy
scrapy/utils/spider.py
151
1911
import logging import inspect import six from scrapy.spiders import Spider from scrapy.utils.misc import arg_to_iter logger = logging.getLogger(__name__) def iterate_spider_output(result): return arg_to_iter(result) def iter_spider_classes(module): """Return an iterator over all spider classes defined i...
bsd-3-clause
xjsender/HaoGist
requests/structures.py
1160
2977
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections class CaseInsensitiveDict(collections.MutableMapping): """ A case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableMapping...
mit
krintoxi/NoobSec-Toolkit
NoobSecToolkit - MAC OSX/tools/inject/plugins/dbms/oracle/__init__.py
10
1039
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.enums import DBMS from lib.core.settings import ORACLE_SYSTEM_DBS from lib.core.unescaper import unescaper from plugins.dbms.oracle.enumeration import Enumeratio...
gpl-2.0
Cajoline/mezzanine
mezzanine/twitter/__init__.py
26
1024
""" Provides models and utilities for displaying different types of Twitter feeds. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from mezzanine import __version__ # Constants/choices for the different query types. QUERY_TYPE_USER = "user" QUERY_TYPE_LIST = "lis...
bsd-2-clause
Jusedawg/SickRage
lib/tornado/escape.py
120
14441
#!/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...
gpl-3.0
vberaudi/scipy
scipy/integrate/setup.py
90
3250
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join from scipy._build_utils import numpy_nodepr_api def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_...
bsd-3-clause
skycucumber/restful
python/venv/lib/python2.7/site-packages/pymongo/ssl_context.py
67
3660
# Copyright 2014-2015 MongoDB, 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...
gpl-2.0
Yelp/security_monkey
security_monkey/exceptions.py
15
3899
# Copyright 2014 Netflix, 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...
apache-2.0
moreati/pylons
pylons/docs/uploader.py
4
3700
import cPickle import mimetypes import os import sys import socket from os import path import httplib2 import simplejson socket.setdefaulttimeout(60) HERE_DIR = os.getcwd() BUILD_DIR = path.join(HERE_DIR, '_build') #host = 'http://localhost:25050' host = 'http://pylonshq.com' post_uri = '%s/docs/upload' % host ima...
bsd-3-clause
hmoco/osf.io
api/applications/serializers.py
7
4204
from django.core.validators import URLValidator from rest_framework import serializers as ser from modularodm import Q from website.models import ApiOAuth2Application from api.base.serializers import JSONAPISerializer, LinksField, IDField, TypeField, DateByVersion from api.base.utils import absolute_reverse class ...
apache-2.0
big-pegasus/spark
python/pyspark/broadcast.py
17
4630
# # 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 us...
apache-2.0
hasanferit/trumpcrawler
crawlenv/lib/python3.5/site-packages/pip/_vendor/requests/models.py
360
30532
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
mit
DeNeutoy/deep_qa
deep_qa/data/tokenizers/character_tokenizer.py
3
2914
from typing import Callable, Dict, List, Tuple from keras.layers import Layer from overrides import overrides from .tokenizer import Tokenizer from ..data_indexer import DataIndexer from ...common.params import Params class CharacterTokenizer(Tokenizer): """ A CharacterTokenizer splits strings into character...
apache-2.0
pysmt/pysmt
pysmt/solvers/z3.py
1
40275
# # This file is part of pySMT. # # Copyright 2014 Andrea Micheli and Marco Gario # # 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 ...
apache-2.0
tbetbetbe/grpc
src/python/grpcio_test/grpc_test/framework/face/testing/stock_service.py
17
12184
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
PuZheng/cloud-dashing
cloud_dashing/portal/user/views.py
1
3864
# -*- coding: UTF-8 -*- from flask import (jsonify, request, render_template, redirect, session, current_app) from flask.ext.wtf import Form from flask.ext.babel import _ from wtforms import TextField, PasswordField from wtforms.validators import DataRequired from werkzeug.security import generate_pa...
gpl-2.0
fsufitch/eve-shipspinning
modules/eveapi.py
1
26931
#----------------------------------------------------------------------------- # eveapi - EVE Online API access # # Copyright (c)2007 Jamie "Entity" van den Berge <entity@vapor.com> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files ...
mit
saruberoz/photodl
scripts/get_instagram_access_token.py
1
1438
# Taken from: # https://github.com/Instagram/python-instagram/blob/master/get_access_token.py from instagram.client import InstagramAPI import sys if len(sys.argv) > 1 and sys.argv[1] == 'local': try: from test_settings import * InstagramAPI.host = test_host InstagramAPI.base_path = test_...
mit
GoogleCloudPlatform/mlops-on-gcp
workshops/kfp-caip-sklearn/lab-02-kfp-pipeline/pipeline/helper_components.py
12
2846
# Copyright 2019 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
hobson/aima
aima/logic.py
2
41430
"""Representations and Inference for Logic (Chapters 7-9, 12) Covers both Propositional and First-Order Logic. First we have four important data types: KB Abstract class holds a knowledge base of logical expressions KB_Agent Abstract class subclasses agents.Agent Expr A logical ex...
mit
dommert/death_turtle
death_turtle/flask_turboduck/tests/auth.py
4
8634
from __future__ import with_statement import datetime try: import urlparse except ImportError: from urllib import parse as urlparse from flask import get_flashed_messages from flask import request from flask import session from flask import url_for from flask_turboduck.auth import Auth from flask_turboduck.a...
apache-2.0
Alberto-Beralix/Beralix
i386-squashfs-root/usr/lib/python2.7/lib2to3/refactor.py
75
27530
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Refactoring framework. Used as a main program, this can refactor any number of files and/or recursively descend down directories. Imported as a module, this provides infrastructure to write your own refactoring too...
gpl-3.0
sergiopasra/pyemir
emirdrp/recipes/image/tests/test_dither.py
3
4803
import pytest import astropy.io.fits as fits from astropy import wcs from astropy.modeling.functional_models import Gaussian2D import numpy import numpy.random import numina.core import numina.exceptions from ..join import JoinDitheredImagesRecipe def create_wcs(crpix=None): w = wcs.WCS(naxis=2) crpix = ...
gpl-3.0
magvugr/AT
EntVirtual/lib/python2.7/site-packages/django/db/models/fields/__init__.py
33
87855
# -*- coding: utf-8 -*- from __future__ import unicode_literals import collections import copy import datetime import decimal import itertools import uuid import warnings from base64 import b64decode, b64encode from functools import total_ordering from django import forms from django.apps import apps from django.conf...
gpl-3.0
hyperized/ansible
lib/ansible/modules/storage/netapp/na_ontap_cluster_peer.py
37
12647
#!/usr/bin/python # (c) 2018-2019, NetApp, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
gohin/django
tests/builtin_server/tests.py
368
5230
from __future__ import unicode_literals import sys import traceback from io import BytesIO from unittest import TestCase from wsgiref import simple_server # If data is too large, socket will choke, so write chunks no larger than 32MB # at a time. The rationale behind the 32MB can be found on Django's Trac: # https://...
bsd-3-clause
lgarren/spack
lib/spack/external/py/_apipkg.py
210
5855
""" apipkg: control the exported namespace of a python package. see http://pypi.python.org/pypi/apipkg (c) holger krekel, 2009 - MIT license """ import os import sys from types import ModuleType __version__ = '1.3.dev' def _py_abspath(path): """ special version of abspath that will leave paths from jyth...
lgpl-2.1
Fshem/micro_bank_system
bank/migrations/0001_initial.py
3
4092
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2017-02-27 20:21 from __future__ import unicode_literals import django.db.models.deletion import django.utils.timezone from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations ...
agpl-3.0
edxzw/edx-platform
openedx/core/djangoapps/profile_images/images.py
26
5907
""" Image file manipulation functions related to profile images. """ from cStringIO import StringIO from collections import namedtuple from django.conf import settings from django.core.files.base import ContentFile from django.utils.translation import ugettext as _, ugettext_noop as _noop from PIL import Image from o...
agpl-3.0
ibm-messaging/iot-python
samples/customMessageFormat/myCustomCodec.py
2
1936
# ***************************************************************************** # Copyright (c) 2019 IBM Corporation and other Contributors. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution,...
epl-1.0
waytai/odoo
addons/l10n_ar/__openerp__.py
260
1695
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
connorimes/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/test_handshake_hybi00.py
466
17345
#!/usr/bin/env python # # Copyright 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...
mpl-2.0
robinro/ansible-modules-extras
infrastructure/foreman/katello.py
18
17104
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Eric D Helms <ericdhelms@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Li...
gpl-3.0
binaryage/drydrop
dryapp/pygments/formatter.py
27
2607
# -*- coding: utf-8 -*- """ pygments.formatter ~~~~~~~~~~~~~~~~~~ Base formatter class. :copyright: 2006-2007 by Georg Brandl, Armin Ronacher. :license: BSD, see LICENSE for more details. """ from pygments.util import get_bool_opt from pygments.styles import get_style_by_name __all__ = ['Formatt...
bsd-3-clause
Ropes/PDX-Council-Minutes-Data
orm/tables.py
1
1641
# coding: utf-8 from sqlalchemy import BigInteger, Column, Date, ForeignKey, Index, Integer, String from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() metadata = Base.metadata class Meetingdate(Base): __tablename__ = 'MeetingDate' __tabl...
mit
hajgato/easybuild-easyblocks
easybuild/easyblocks/h/hypre.py
4
2250
## # Copyright 2009-2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
vitan/django
django/contrib/gis/db/backends/oracle/introspection.py
539
1977
import sys import cx_Oracle from django.db.backends.oracle.introspection import DatabaseIntrospection from django.utils import six class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDS...
bsd-3-clause
AlexHill/django
django/utils/dates.py
115
2296
"Commonly-used date structures" from django.utils.translation import ugettext_lazy as _, pgettext_lazy WEEKDAYS = { 0: _('Monday'), 1: _('Tuesday'), 2: _('Wednesday'), 3: _('Thursday'), 4: _('Friday'), 5: _('Saturday'), 6: _('Sunday') } WEEKDAYS_ABBR = { 0: _('Mon'), 1: _('Tue'), 2: _('Wed'), 3: _('Thu'),...
bsd-3-clause
julen/translate
translate/convert/ini2po.py
25
5481
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2007 Zuza Software Foundation # # This file is part of translate. # # translate 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 t...
gpl-2.0
KohlsTechnology/ansible
lib/ansible/modules/network/nxos/nxos_ntp_auth.py
18
9573
#!/usr/bin/python # # 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 distribut...
gpl-3.0
rahushen/ansible
test/runner/lib/powershell_import_analysis.py
102
2276
"""Analyze powershell import statements.""" from __future__ import absolute_import, print_function import os import re from lib.util import ( display, ) def get_powershell_module_utils_imports(powershell_targets): """Return a dictionary of module_utils names mapped to sets of powershell file paths. :ty...
gpl-3.0
PopCap/GameIdea
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/Bindings.py
130
3295
"""Define the menu contents, hotkeys, and event bindings. There is additional configuration information in the EditorWindow class (and subclasses): the menus are created there based on the menu_specs (class) variable, and menus not created are silently skipped in the code here. This makes it possible, for example, to...
bsd-2-clause
Qalthos/ansible
lib/ansible/modules/commands/command.py
14
11529
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # Copyright: (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, div...
gpl-3.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/packages/chardet/sjisprober.py
1777
3764
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-3.0
RuiNascimento/krepo
script.module.lambdascrapers/lib/lambdascrapers/sources_placenta/en_placenta-1.7.8/to_be_fixed/needsfixing/streamlord.py
2
6515
# -*- coding: UTF-8 -*- ####################################################################### # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # @Daddy_Blamo wrote this file. As long as you retain this notice you # can do whatever you want wi...
gpl-2.0
nonnib/eve-metrics
web2py/applications/evemetrics/controllers/servicemonitor.py
2
4397
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations import types, locale, datetime, collections, pyodbc import time from pprint import pprint import sys INFO_BY_STATUS = { -1 : {"background": "row_none", "icon": "monitor_notrun.png"}, # Pending 0 : ...
mit
etzhou/edx-platform
common/djangoapps/dark_lang/migrations/0001_initial.py
114
4801
# -*- 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): # Adding model 'DarkLangConfig' db.create_table('dark_lang_darklangconfig', ( ('id', self.gf('dj...
agpl-3.0
stanonyime/pynojo
pynojo/view/navbar.py
3
1516
# $File: navbar.py # $Date: Fri Feb 17 00:18:20 2012 +0800 # # Copyright (C) 2012 the pynojo development team <see AUTHORS file> # # Contributors to this file: # Kai Jia <jia.kai66@gmail.com> # # This file is part of pynojo # # pynojo is free software: you can redistribute it and/or modify # it under the terms of ...
gpl-3.0