repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
nthall/pip
pip/index.py
1
37111
"""Routines related to PyPI, indexes""" from __future__ import absolute_import import logging import cgi from collections import namedtuple import itertools import sys import os import re import mimetypes import posixpath import warnings from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor....
mit
MIPS/external-chromium_org
tools/telemetry/telemetry/core/chrome/tab_list_backend.py
23
4743
# 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 json import urllib2 import weakref from telemetry.core import util from telemetry.core import tab from telemetry.core.chrome import inspector_back...
bsd-3-clause
avanov/django
django/db/migrations/operations/special.py
374
7425
from __future__ import unicode_literals from django.db import router from .base import Operation class SeparateDatabaseAndState(Operation): """ Takes two lists of operations - ones that will be used for the database, and ones that will be used for the state change. This allows operations that don't ...
bsd-3-clause
axltxl/kaoru
kaoru/commands/hello.py
1
1196
# -*- coding: utf-8 -*- """ kaoru.commands.hello ~~~~~~~~ /hello command implementation :copyright: (c) 2015 by Alejandro Ricoveri :license: MIT, see LICENSE for more details. """ from telegram import Update from .. import utils from . import bot_command _greetings = [ # English 'Affirmative Dave, I read ...
mit
kentaro0919/billing
app/entries/forms.py
1
1990
"""doc.""" import wtforms from wtforms.validators import DataRequired from models import Entry, Tag class ImageForm(wtforms.Form): file = wtforms.FileField('Image file') class TagField(wtforms.StringField): """doc.""" def _value(self): """doc.""" if self.data: # Display tag...
mit
ga7g08/sympy
sympy/core/tests/test_function.py
33
23495
from sympy import (Lambda, Symbol, Function, Derivative, Subs, sqrt, log, exp, Rational, Float, sin, cos, acos, diff, I, re, im, E, expand, pi, O, Sum, S, polygamma, loggamma, expint, Tuple, Dummy, Eq, Expr, symbols, nfloat) from sympy.utilities.pytest import XFAIL, raises from sympy.abc import ...
bsd-3-clause
kawamuray/ganeti
lib/hypervisor/__init__.py
11
2038
# # # Copyright (C) 2006, 2007, 2008 Google 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 2 of the License, or # (at your option) any later version. # # This program is ...
gpl-2.0
MarkusH/rinse
rinse/message.py
3
3165
"""SOAP client.""" from __future__ import print_function from lxml import etree import requests from rinse import NS_SOAPENV from rinse.util import ElementMaker class SoapMessage(object): """SOAP message. >>> from rinse.message import SoapMessage >>> from lxml import etree >>> from rinse.util import...
mit
chemelnucfin/tensorflow
tensorflow/python/keras/regularizers_test.py
1
7803
# 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
JiscPER/magnificent-octopus
octopus/modules/es/initialise.py
1
4362
import esprit from octopus.lib import plugin from octopus.core import app def _default_mapping(): default_mapping = app.config.get("ELASTIC_SEARCH_DEFAULT_MAPPING") if default_mapping is None: return None if "mappings" in default_mapping: return default_mapping if "_default_" in defau...
apache-2.0
reyoung/Paddle
python/paddle/fluid/tests/unittests/test_roi_pool_op.py
5
5328
# Copyright (c) 2018 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 app...
apache-2.0
rhblind/django-rest-framework
rest_framework/viewsets.py
82
5628
""" ViewSets are essentially just a type of class based view, that doesn't provide any method handlers, such as `get()`, `post()`, etc... but instead has actions, such as `list()`, `retrieve()`, `create()`, etc... Actions are only bound to methods at the point of instantiating the views. user_list = UserViewSet.a...
bsd-2-clause
Ictp/indico
indico/MaKaC/common/log.py
1
8114
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico 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; eith...
gpl-3.0
bowlofstew/changes
tests/changes/models/test_testresult.py
2
11445
from base64 import b64encode from changes.constants import Result from changes.models import FailureReason, ItemStat from changes.models.testresult import TestResult, TestResultManager from changes.testutils.cases import TestCase def _stat(jobstep, name): id = jobstep.id return ItemStat.query.filter_by(name=...
apache-2.0
toooooper/oppia
extensions/interactions/Continue/Continue.py
9
1209
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
programadorjc/django
django/utils/six.py
408
30194
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # 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 with...
bsd-3-clause
palankai/baluster
tests/test_nested.py
1
1212
from baluster import Baluster, placeholders class CompositeRoot(Baluster): @placeholders.factory def value(self, root): return 2 class subns(Baluster): _closed = False @placeholders.factory def value(self, root): return 1 @value.close def cl...
mit
crossroadchurch/paul
openlp/core/ui/settingsdialog.py
1
3292
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
gpl-2.0
pytroll/mpop
test/test_readers.py
2
2484
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Author(s): # # Panu Lahtinen <panu.lahtinen@fmi.fi # # This file is part of mpop. # # mpop 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...
gpl-3.0
BellScurry/gem5-fault-injection
tests/configs/base_config.py
4
10648
# Copyright (c) 2012-2013 ARM Limited # 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 implementation of the functiona...
bsd-3-clause
icereval/scrapi
scrapi/base/__init__.py
1
6929
# Classes for scrAPI Harvesters from __future__ import unicode_literals import abc import json import logging from datetime import timedelta, date from lxml import etree from scrapi import util from scrapi import requests from scrapi import registry from scrapi import settings from scrapi.base.schemas import OAISCHE...
apache-2.0
mhnatiuk/phd_sociology_of_religion
scrapper/lib/python2.7/site-packages/scrapy/contrib/spidermiddleware/httperror.py
25
1708
""" HttpError Spider Middleware See documentation in docs/topics/spider-middleware.rst """ from scrapy.exceptions import IgnoreRequest from scrapy import log class HttpError(IgnoreRequest): """A non-200 response was filtered""" def __init__(self, response, *args, **kwargs): self.response = response ...
gpl-2.0
Pablo126/SSBW
Tarea3/tarea3/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py
2924
3268
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
tchellomello/home-assistant
homeassistant/components/template/trigger.py
1
3430
"""Offer template automation rules.""" import logging import voluptuous as vol from homeassistant import exceptions from homeassistant.const import CONF_FOR, CONF_PLATFORM, CONF_VALUE_TEMPLATE from homeassistant.core import callback from homeassistant.helpers import config_validation as cv, template from homeassistan...
apache-2.0
daniel-j/lutris
lutris/runners/__init__.py
1
2119
"""Generic runner functions.""" # from lutris.util.log import logger __all__ = ( # Native "linux", "steam", "browser", "web", # Microsoft based "wine", "winesteam", "dosbox", # Multi-system "mame", "mess", "mednafen", "scummvm", "residualvm", "libretro", ...
gpl-3.0
PreNa/liveconftv
etherpad-lite/src/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
566
9386
# 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. """Utility functions shared amongst the Windows generators.""" import copy import os _TARGET_TYPE_EXT = { 'executable': '.exe', 'loadable_module': '.dll', ...
mit
Diti24/python-ivi
ivi/agilent/agilent3000A.py
1
6792
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2016 Alex Forencich 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...
mit
scigghia/account-invoicing
account_invoice_supplier_ref_unique/account_invoice.py
26
2461
# -*- encoding: utf-8 -*- ############################################################################### # # Odoo, Open Source Management Solution # This module copyright (C) 2010 - 2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # Copyright (C) 2015 Akretion (http://www.akretion.com) # @...
agpl-3.0
freenas/samba
python/samba/provision/backend.py
7
33228
# # Unix SMB/CIFS implementation. # backend code for provisioning a Samba4 server # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008 # Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008-2009 # Copyright (C) Oliver Liebel <oliver@itc.li> 2008-2009 # # Based on the original in EJS: # Copyright (C) Andrew ...
gpl-3.0
dhzhd1/road_obj_detect
rfcn/operator_py/proposal_target.py
3
4562
# -------------------------------------------------------- # Deformable Convolutional Networks # Copyright (c) 2016 by Contributors # Copyright (c) 2017 Microsoft # Licensed under The Apache-2.0 License [see LICENSE for details] # Modified by Yuwen Xiong # -------------------------------------------------------- """ P...
apache-2.0
koomik/CouchPotatoServer
libs/requests/packages/urllib3/fields.py
404
5976
# urllib3/fields.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import email.utils import mimetypes from .packages import six def guess_content_type(filename...
gpl-3.0
HazyResearch/metal
metal/contrib/info_extraction/mentions.py
1
6222
import numpy as np class EntityMention(object): """A mention of an entity (span of text) in a document Args: doc_id: a unique identifier for the document text: a single string of text corresponding to the document char_start: the integer offset of the first character in the entity ...
apache-2.0
broferek/ansible
test/units/vars/test_module_response_deepcopy.py
118
1473
# -*- coding: utf-8 -*- # (c) 2018 Matt Martz <matt@sivel.net> # 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 from ansible.vars.clean import module_response_deepcopy import pytest def...
gpl-3.0
SnakeHunt2012/word2vec
word-word/word-word.py
1
3317
#!/usr/bin/env python # -*- coding: utf-8 -*- from sys import stdout from codecs import open from json import loads from numpy import zeros, dot, sqrt from argparse import ArgumentParser from heapq import nlargest import cudamat as cm def debug(debug_str): stdout.write(debug_str) stdout.flush() def load_vec...
apache-2.0
beniwohli/apm-agent-python
tests/contrib/django/__init__.py
40
1591
# BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # 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, t...
bsd-3-clause
monkiineko/mbed-os
tools/test_webapi.py
66
9319
""" mbed SDK Copyright (c) 2011-2014 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
apache-2.0
MoKee/android_kernel_google_msm
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
scrlys/AWSW-Modtools
testing/test.py
2
3082
import renpy import renpy.display.screen import renpy.sl2.slast import renpy.ast from modloader import modast def test_get_screen(): result = modast.get_screen("screen_test_get_screen") return result is not None and isinstance(result, renpy.display.screen.Screen) def test_get_slscreen(): re...
gpl-3.0
antonioUnina/neutron
neutron/extensions/l3_ext_ha_mode.py
19
3301
# Copyright (C) 2014 eNovance SAS <licensing@enovance.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 applicabl...
apache-2.0
gopal1cloud/neutron
neutron/tests/unit/test_dhcp_agent.py
3
63939
# 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
Telestream/telestream-cloud-python-sdk
telestream_cloud_qc_sdk/test/test_drop_frame_type.py
1
1328
# coding: utf-8 """ Qc API Qc API # noqa: E501 The version of the OpenAPI document: 3.0.0 Contact: cloudsupport@telestream.net Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import datetime import telestream_cloud_qc from telestream_cl...
mit
taiwanlennon/flask-master
examples/flaskr/flaskr_tests.py
19
2355
# -*- coding: utf-8 -*- """ Flaskr Tests ~~~~~~~~~~~~ Tests the Flaskr application. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import flaskr import unittest import tempfile class FlaskrTestCase(unittest.TestCase): def setUp(self): ...
bsd-3-clause
ds-hwang/chromium-crosswalk
ui/ozone/generate_ozone_platform_list.py
102
4432
#!/usr/bin/env python # Copyright 2013 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. """Code generator for Ozone platform list. This script takes as arguments a list of platform names and generates a C++ source file con...
bsd-3-clause
nburn42/tensorflow
tensorflow/python/kernel_tests/identity_n_op_py_test.py
58
2742
# 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
bearstech/modoboa
modoboa/lib/form_utils.py
1
12669
# coding: utf-8 """Form management utilities.""" from __future__ import unicode_literals import abc from collections import OrderedDict import re from django.forms import TypedChoiceField from django.forms.fields import Field from django.forms.widgets import RadioSelect from django.forms.widgets import RadioChoiceI...
isc
abdoosh00/edx-platform
scripts/run_watch_data.py
46
1670
#! /usr/bin/env python # This script requires that you have watchdog installed. You can install # watchdog via 'pip install watchdog' import sys import time import logging import os from subprocess import Popen from signal import SIGTERM from watchdog.observers import Observer from watchdog.events import LoggingEvent...
agpl-3.0
tuanvu216/udacity-course
intro_to_machine_learning/lesson/lesson_3_decision_trees/prep_terrain_data.py
10
1779
#!/usr/bin/python import random def makeTerrainData(n_points=1000): ############################################################################### ### make the toy dataset random.seed(42) grade = [random.random() for ii in range(0,n_points)] bumpy = [random.random() for ii in range(0,n_points)] error...
mit
dnbaker/emp
python/hll_sketch.py
1
1366
import argparse import os import shlex import subprocess import multiprocessing import sys def sketch_call(tup): ss, ks, paths = tup cstr = "flashdans sketch -p1 -k%i -S%i %s" % (ss, ks, " ".join(paths)) subprocess.check_call(shlex.split(cstr)) if __name__ == "__main__": sketch_range = range(10, 24,...
gpl-3.0
tanghaibao/goatools
goatools/cli/docopt_parse.py
1
3852
"""Run docopt in GOATOOLS.""" from __future__ import print_function __copyright__ = "Copyright (C) 2016-present, DV Klopfenstein, H Tang, All rights reserved." __author__ = "DV Klopfenstein" import sys import re from docopt import docopt from goatools.gosubdag.utils import get_kwargs #pylint: disable=too-few-publi...
bsd-2-clause
axilleas/ansible
test/units/playbook/test_taggable.py
293
4452
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or # (at your option) an...
gpl-3.0
Asana/boto
tests/unit/test_connection.py
1
23327
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
eceglov/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/outputtee_unittest.py
124
1987
# Copyright (C) 2012 Zan Dobersek <zandobersek@gmail.com> # # 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 t...
bsd-3-clause
torufuru/oolhackathon
ryu/lib/sockaddr.py
48
1871
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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:...
apache-2.0
louisrli/grabrc-client
tests/testbase.py
1
1922
import unittest import os import shutil import subprocess from client import const class BaseIntegrationTest(unittest.TestCase): def setUp(self): """ Clears out old temporary test directories, then creates a new one. """ self.TMPDIR = "tmp-grabrc-test" self.BACKUP_...
gpl-3.0
t0in4/django
tests/model_formsets/tests.py
192
74306
from __future__ import unicode_literals import datetime import re from datetime import date from decimal import Decimal from django import forms from django.core.exceptions import ImproperlyConfigured from django.db import models from django.forms.models import ( BaseModelFormSet, _get_foreign_key, inlineformset_...
bsd-3-clause
hufyhang/nover-hypernode
server/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py
806
5092
#!/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
onceuponatimeforever/oh-mainline
vendor/packages/mechanize/test-tools/twisted-ftpserver.py
22
2670
import optparse import sys import twisted.cred.checkers import twisted.cred.credentials import twisted.cred.portal import twisted.internet import twisted.protocols.ftp from twisted.python import filepath, log from zope.interface import implements def make_ftp_shell(avatar_id, root_path): if avatar_id is twisted...
agpl-3.0
ycaihua/kbengine
kbe/res/scripts/common/Lib/test/test_pty.py
84
11286
from test.support import verbose, run_unittest, import_module, reap_children #Skip these tests if either fcntl or termios is not available fcntl = import_module('fcntl') import_module('termios') import errno import pty import os import sys import select import signal import socket import unittest TEST_STRING_1 = b"I...
lgpl-3.0
kingvuplus/italysat-enigma2
lib/python/Components/Converter/ServiceInfo.py
3
9541
from Components.Converter.Converter import Converter from enigma import iServiceInformation, iPlayableService from Components.Element import cached from os import path WIDESCREEN = [3, 4, 7, 8, 0xB, 0xC, 0xF, 0x10] class ServiceInfo(Converter, object): HAS_TELETEXT = 1 IS_MULTICHANNEL = 2 AUDIO_STEREO = 3 IS_CRY...
gpl-2.0
aabbox/kbengine
kbe/src/lib/python/Lib/test/test_asyncore.py
72
27407
import asyncore import unittest import select import os import socket import sys import time import errno import struct import warnings from test import support from io import BytesIO try: import threading except ImportError: threading = None TIMEOUT = 3 HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX') class d...
lgpl-3.0
heeraj123/oh-mainline
vendor/packages/Django/django/core/mail/backends/smtp.py
130
4312
"""SMTP email backend class.""" import smtplib import ssl import threading from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.utils import DNS_NAME from django.core.mail.message import sanitize_address from django.utils.encoding import force_bytes class...
agpl-3.0
bradwoo8621/Swift-Study
Instagram/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/configurations/target_platform/gyptest-target_platform.py
351
1112
#!/usr/bin/env python # Copyright (c) 2009 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. """ Tests the msvs specific msvs_target_platform option. """ import TestGyp import TestCommon def RunX64(exe, stdout): try: test.ru...
mit
uclapi/uclapi
backend/uclapi/roombookings/models.py
1
8730
from __future__ import unicode_literals from django.db import models models.options.DEFAULT_NAMES += ('_DATABASE',) class Booking(models.Model): setid = models.CharField(max_length=40, blank=True, null=True) siteid = models.CharField(max_length=40, blank=True, null=True) roomid = models.CharField(max_l...
mit
rowillia/buck
third-party/py/unittest2/unittest2/signals.py
155
1684
import signal import weakref from unittest2.compatibility import wraps __unittest = True class _InterruptHandler(object): def __init__(self, default_handler): self.called = False self.default_handler = default_handler def __call__(self, signum, frame): installed_handler = signal.get...
apache-2.0
frreiss/tensorflow-fred
tensorflow/python/autograph/pyct/origin_info.py
14
9963
# 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
mdsafwan/Deal-My-Stuff
Lib/site-packages/django/contrib/gis/gdal/prototypes/srs.py
471
3513
from ctypes import POINTER, c_char_p, c_int, c_void_p from django.contrib.gis.gdal.libgdal import lgdal, std_call from django.contrib.gis.gdal.prototypes.generation import ( const_string_output, double_output, int_output, srs_output, string_output, void_output, ) # Shortcut generation for routines with known...
apache-2.0
cmichal/python-social-auth
social/backends/yahoo.py
70
6000
""" Yahoo OpenId, OAuth1 and OAuth2 backends, docs at: http://psa.matiasaguirre.net/docs/backends/yahoo.html """ from requests.auth import HTTPBasicAuth from social.utils import handle_http_errors from social.backends.open_id import OpenIdAuth from social.backends.oauth import BaseOAuth2, BaseOAuth1 class YahooO...
bsd-3-clause
danieldresser/cortex
test/IECoreRI/IlluminateTest.py
6
3618
########################################################################## # # Copyright (c) 2008-2013, 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...
bsd-3-clause
jordy33/yowsup
yowsup/stacks/__init__.py
64
2636
from .yowstack import YowStack, YowStackBuilder from yowsup.layers.auth import YowCryptLayer, YowAuthenticationProtocolLayer, AuthError from yowsup.layers.coder import YowCoderLayer from yowsup.layers.logger import YowLoggerLayer from yowsup.layers.netw...
gpl-3.0
maciekcc/tensorflow
tensorflow/contrib/keras/python/keras/layers/convolutional_recurrent.py
25
24296
# 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
jrper/fluidity
python/fluidity/diagnostics/simplices.py
5
4311
#!/usr/bin/env python # 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 Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the ...
lgpl-2.1
rogeriofalcone/treeio
services/forms.py
1
24922
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license """ Services module forms """ from django import forms from django.db.models import Q from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.utils.html im...
mit
openbaoz/titanium_mobile
node_modules/ioslib/node_modules/node-ios-device/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py
1835
12124
# 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. """New implementation of Visual Studio project generation.""" import os import random import gyp.common # hashlib is supplied as of Python 2.5 as the replacemen...
apache-2.0
scalyr/scalyr-agent-2
tests/distribution/python_version_change_tests/centos7/centos7_with_py3_test.py
2
4238
# Copyright 2014-2020 Scalyr Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
quarkslab/arybo
tests/arybo/llvm.py
1
3837
import unittest import operator import six import random from six.moves import range,reduce import ctypes from ctypes import CFUNCTYPE from arybo.lib.exprs_asm import llvmlite_available if llvmlite_available: import llvmlite.binding as llvm import arybo.lib.mba_exprs as EX from arybo.lib import MBA from arybo.l...
bsd-3-clause
mvo5/snapcraft
snapcraft/plugins/kbuild.py
1
9392
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
gpl-3.0
wunderlins/learning
python/django/lib/python2.7/site-packages/django/core/management/base.py
39
23985
# -*- coding: utf-8 -*- """ Base classes for writing management commands (named commands which can be executed through ``django-admin`` or ``manage.py``). """ from __future__ import unicode_literals import os import sys import warnings from argparse import ArgumentParser from optparse import OptionParser import djang...
gpl-2.0
sliwhu/UWHousingTeam
model/house_price_model.py
1
6622
""" Contains the house price model. DON'T USE THIS MODEL! Use the HousePriceModel in house_price_model_2.py. """ import os import numpy as np import pandas as pd from sklearn.ensemble import RandomForestRegressor from sklearn.linear_model import RidgeCV # Constants BASE_DATE = pd.to_datetime('20140101', format='%Y%...
mit
andysim/psi4
psi4/driver/qcdb/interface_gcp.py
2
11924
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2017 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This program is free software; you can redistribute it and/or modify # it under the terms of ...
gpl-2.0
ufosky-server/zulip
bots/zephyr_mirror.py
114
2868
#!/usr/bin/env python # Copyright (C) 2012 Zulip, Inc. # # 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, m...
apache-2.0
ychen820/microblog
flask/lib/python2.7/site-packages/sqlalchemy/engine/interfaces.py
21
32558
# engine/interfaces.py # Copyright (C) 2005-2015 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 """Define core interfaces used by the engine system.""" from .. import util, e...
bsd-3-clause
RunningLight/machinekit
configs/sim/axis/orphans/pysubs/oword.py
56
3677
import sys,os import interpreter import emccanon if 'emctask' in sys.builtin_module_names: import emctask import task from embedding import * #define EMC_DEBUG_CONFIG 0x00000002 #define EMC_DEBUG_VERSIONS 0x00000008 #define EMC_DEBUG_TASK_ISSUE 0x00000010 #define EMC_DEBUG_NML ...
lgpl-2.1
nvoron23/hue
desktop/core/ext-py/Django-1.6.10/django/utils/dates.py
488
2237
"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'), 4:_('Fri')...
apache-2.0
analogdevicesinc/gnuradio
grc/python/Platform.py
3
6500
""" Copyright 2008-2015 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any l...
gpl-3.0
freakboy3742/django
tests/serializers/test_jsonl.py
22
9797
import decimal import json import re from django.core import serializers from django.core.serializers.base import DeserializationError from django.db import models from django.test import TestCase, TransactionTestCase from django.test.utils import isolate_apps from .models import Score from .tests import SerializersT...
bsd-3-clause
elastic-event-components/e2c
source/python/e2c.examples/web_mud/contracts/token.py
1
1166
# # Copyright 2017 The E2C 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 l...
apache-2.0
ThomasZh/legend-league-portal
foo/auth/auth_newsup.py
1
3243
#!/usr/bin/env python # _*_ coding: utf-8_*_ # # Copyright 2016 7x24hs.com # thomas@7x24hs.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...
apache-2.0
toggle-corp/shelter-database
src/manager.py
2
5448
#! /usr/bin/env python #-*- coding: utf-8 -*- # ***** BEGIN LICENSE BLOCK ***** # This file is part of Shelter Database. # Copyright (c) 2016 Luxembourg Institute of Science and Technology. # All rights reserved. # # # # ***** END LICENSE BLOCK ***** __author__ = "Cedric Bonhomme" __version__ = "$Revision: 0.1 $" __d...
mit
ncliam/serverpos
openerp/addons/website_blog/wizard/__init__.py
373
1077
# -*- 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
hejuna/bite-project
deps/gdata-python-client/samples/oauth/oauth_on_appengine/main_rsa.py
126
7137
#!/usr/bin/python # # Copyright (C) 2009 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 appli...
apache-2.0
renatopp/liac
liac/dataset/__init__.py
1
3050
# ============================================================================= # Federal University of Rio Grande do Sul (UFRGS) # Connectionist Artificial Intelligence Laboratory (LIAC) # Renato de Pontes Pereira - rppereira@inf.ufrgs.br # ============================================================================= ...
mit
reprogrammer/pbbs
benchmarks/maximalMatching/incrementalMatching/runTests.py
98
10981
import subprocess import sys import random import os def onPprocessors(command,p) : if os.environ.has_key("OPENMP"): os.putenv("OMP_NUM_THREADS", "%d" %p) return command elif os.environ.has_key("CILK"): return command + " -cilk_set_worker_count " + `p` elif os.environ.has_key("MKLROOT"): return...
mit
VeritasOS/cloud-custodian
tests/test_sqs.py
2
2848
# Copyright 2016 Capital One Services, 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...
apache-2.0
ewitz/PhotoHaus
venv/lib/python2.7/site-packages/werkzeug/testsuite/contrib/securecookie.py
146
1770
# -*- coding: utf-8 -*- """ werkzeug.testsuite.securecookie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the secure cookie. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from werkzeug.testsuite import WerkzeugTestCase from werkzeug.utils import...
mit
paaschpa/badcomputering
docutils/math/unimathsymbols2tex.py
6
17496
# Translation table for Unicode symbols to LaTeX math commands # for use with the translate() method of unicode objects. # Includes commands from: standard LaTeX, amssymb, amsmath uni2tex_table = { 160: u'~', 163: u'\\pounds ', 165: u'\\yen ', 172: u'\\neg ', 174: u'\\circledR ', 177: u'\\pm ', 215: u'\\times ', 240:...
bsd-3-clause
thanatoskira/AndroGuard
elsim/elsim/elsim_db.py
1
7471
#!/usr/bin/env python # This file is part of Elsim. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Elsim is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either ve...
lgpl-3.0
Maaack/Silent-Night-API
game_api/migrations/0002_auto_20160207_1603.py
1
1928
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-02-08 00:03 from __future__ import unicode_literals import django.contrib.postgres.fields.jsonb from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('game_api', '0001...
gpl-3.0
queria/my-tempest
tempest/api/compute/admin/test_hypervisor_negative.py
2
4833
# Copyright 2013 Huawei Technologies Co.,LTD. # 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 # # Unl...
apache-2.0
yashu-seth/networkx
examples/advanced/parallel_betweenness.py
51
2510
""" Example of parallel implementation of betweenness centrality using the multiprocessing module from Python Standard Library. The function betweenness centrality accepts a bunch of nodes and computes the contribution of those nodes to the betweenness centrality of the whole network. Here we divide the network in chu...
bsd-3-clause
tommo/gii
support/waf/waflib/Tools/xlcxx.py
3
1643
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) # Ralf Habacker, 2006 (rh) # Yinon Ehrlich, 2009 # Michael Kuhn, 2009 from waflib.Tools import ccroot, ar from waflib.Configure import conf @conf def find_xlcxx(conf): """ Detect the Aix C++ compiler """ cxx = conf.find_program(['xlc++_r', 'xl...
mit