repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
Moriadry/tensorflow
tensorflow/python/kernel_tests/logging_ops_test.py
92
2860
# 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
IllusionRom-deprecated/android_platform_tools_idea
python/lib/Lib/site-packages/django/conf/project_template/settings.py
71
4756
# Django settings for {{ project_name }} project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
apache-2.0
Kapim/ar-table-itable
art_projected_gui/scripts/test_brain.py
6
5129
#!/usr/bin/env python import sys import rospy from art_msgs.srv import ProgramIdTrigger, ProgramIdTriggerResponse from art_msgs.msg import InterfaceState, LearningRequestAction, LearningRequestFeedback,\ LearningRequestResult from art_helpers import InterfaceStateManager, ProgramHelper from art_utils import ArtApi...
lgpl-2.1
dabura667/electrum
gui/kivy/uix/dialogs/wallets.py
8
1773
import os from kivy.app import App from kivy.factory import Factory from kivy.properties import ObjectProperty from kivy.lang import Builder from electrum.util import base_units from ...i18n import _ from .label_dialog import LabelDialog Builder.load_string(''' #:import os os <WalletDialog@Popup>: title: _('Wal...
mit
meteorcloudy/tensorflow
tensorflow/contrib/integrate/python/ops/odes.py
10
28221
# 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
minhphung171093/GreenERP_V7
openerp/addons/portal_project/tests/__init__.py
170
1124
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
mdblv2/joatu-django
application/site-packages/django/contrib/gis/management/commands/ogrinspect.py
126
6065
import os from optparse import make_option from django.contrib.gis import gdal from django.core.management.base import LabelCommand, CommandError def layer_option(option, opt, value, parser): """ Callback for `make_option` for the `ogrinspect` `layer_key` keyword option which may be an integer or a string....
apache-2.0
cloud9ers/gurumate
environment/lib/python2.7/site-packages/IPython/parallel/tests/test_magics.py
3
12999
# -*- coding: utf-8 -*- """Test Parallel magics Authors: * Min RK """ #------------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as pa...
lgpl-3.0
tsl143/addons-server
src/olympia/reviewers/templatetags/jinja_helpers.py
1
8636
import datetime from django.conf import settings from django.utils.encoding import force_text from django.utils.translation import ugettext, ugettext_lazy as _, ungettext from django_jinja import library import jinja2 from olympia import amo from olympia.access import acl from olympia.addons.templatetags.jinja_helpe...
bsd-3-clause
XiaominZhang/Impala
thirdparty/hive-1.1.0-cdh5.7.0-SNAPSHOT/lib/py/thrift/server/TServer.py
71
8153
# # 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...
apache-2.0
abulbakha/sed
website/models.py
1
7333
# -*- coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible # Create your models here. from django.utils.timezone import now @python_2_unicode_compatible class Department(models.Model): class Meta(): db_table = 'departament' name = models.CharF...
apache-2.0
rzambre/servo
tests/wpt/web-platform-tests/tools/pytest/extra/get_issues.py
195
2286
import json import py import textwrap issues_url = "http://bitbucket.org/api/1.0/repositories/pytest-dev/pytest/issues" import requests def get_issues(): chunksize = 50 start = 0 issues = [] while 1: post_data = {"accountname": "pytest-dev", "repo_slug": "pytest", ...
mpl-2.0
ZENGXH/scikit-learn
examples/linear_model/plot_theilsen.py
232
3615
""" ==================== Theil-Sen Regression ==================== Computes a Theil-Sen Regression on a synthetic dataset. See :ref:`theil_sen_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the Theil-Sen estimator is robust against outliers. It has a breakd...
bsd-3-clause
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price
data/01 amazon/parseJSON.py
26
1412
def getSocialData(post): # Get Thread Object threadObject = post["thread"] domain_rank = threadObject["domain_rank"] #domain_rank #print 'domain_rank:' + str(domain_rank) socialObject = threadObject["social"] #social data object facebookData = socialObject["facebook"] #facebook data #print 'facebook data...
mit
ruchee/vimrc
vimfiles/bundle/vim-python/submodules/rope/setup.py
2
2316
import io import os.path try: from setuptools import setup except ImportError: from distutils.core import setup classifiers = [ 'Development Status :: 4 - Beta', 'Operating System :: OS Independent', 'Environment :: X11 Applications', 'Environment :: Win32 (MS Windows)', 'Environment :: M...
mit
isislovecruft/scramblesuit
state.py
1
4629
""" Provide a way to store the server's state information on disk. The server possesses state information which should persist across runs. This includes key material to encrypt and authenticate session tickets, replay tables and PRNG seeds. This module provides methods to load, store and generate such state informa...
bsd-3-clause
FireBladeNooT/Medusa_1_6
lib/unidecode/x068.py
252
4674
data = ( 'Zhi ', # 0x00 'Liu ', # 0x01 'Mei ', # 0x02 'Hoy ', # 0x03 'Rong ', # 0x04 'Zha ', # 0x05 '[?] ', # 0x06 'Biao ', # 0x07 'Zhan ', # 0x08 'Jie ', # 0x09 'Long ', # 0x0a 'Dong ', # 0x0b 'Lu ', # 0x0c 'Sayng ', # 0x0d 'Li ', # 0x0e 'Lan ', # 0x0f 'Yong ', # 0x10...
gpl-3.0
ioef/tlslite-ng
tlslite/recordlayer.py
1
29445
# Copyright (c) 2014, Hubert Kario # # Efthimios Iosifidis - Speck Cipher Additions # See the LICENSE file for legal information regarding use of this file. """Implementation of the TLS Record Layer protocol""" import socket import errno import hashlib from .constants import ContentType, CipherSuite from .messages i...
lgpl-2.1
xadahiya/django
tests/multiple_database/models.py
99
2406
from django.contrib.auth.models import User from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible clas...
bsd-3-clause
xiaoxiamii/scikit-learn
sklearn/cross_decomposition/tests/test_pls.py
215
11427
import numpy as np from sklearn.utils.testing import (assert_array_almost_equal, assert_array_equal, assert_true, assert_raise_message) from sklearn.datasets import load_linnerud from sklearn.cross_decomposition import pls_ from nose.tools import assert_equal def test_pls(): d =...
bsd-3-clause
suyashphadtare/vestasi-erp-final
erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py
40
2186
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, os, json from frappe.utils import cstr from unidecode import unidecode from frappe.model.document import Document class ChartofAccoun...
agpl-3.0
felipenaselva/felipe.repository
script.module.urlresolver/lib/urlresolver/plugins/vidtodo.py
2
2046
""" Kodi urlresolver plugin Copyright (C) 2016 script.module.urlresolver This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) ...
gpl-2.0
AlbertoPeon/invenio
modules/bibformat/lib/elements/bfe_date_rec.py
39
1053
## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option...
gpl-2.0
GehenHe/Recognize-Face-on-Android
tensorflow/contrib/layers/python/layers/__init__.py
104
1728
# 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
totallybradical/temp_servo2
tests/wpt/css-tests/tools/py/testing/code/test_code.py
216
4212
import py import sys def test_ne(): code1 = py.code.Code(compile('foo = "bar"', '', 'exec')) assert code1 == code1 code2 = py.code.Code(compile('foo = "baz"', '', 'exec')) assert code2 != code1 def test_code_gives_back_name_for_not_existing_file(): name = 'abc-123' co_code = compile("pass\n", ...
mpl-2.0
sssunsha/jira-man
node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
1407
47697
# 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. """ This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import os import re import subprocess import sys fr...
mit
jeasoft/odoo
openerp/report/__init__.py
380
1513
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
Azulinho/ansible
lib/ansible/modules/cloud/ovirt/ovirt_group.py
35
5488
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (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 #...
gpl-3.0
xinjiguaike/edx-platform
common/djangoapps/third_party_auth/tests/test_provider.py
87
4949
"""Unit tests for provider.py.""" from mock import Mock, patch from third_party_auth import provider from third_party_auth.tests import testutil import unittest @unittest.skipUnless(testutil.AUTH_FEATURE_ENABLED, 'third_party_auth not enabled') class RegistryTest(testutil.TestCase): """Tests registry discovery a...
agpl-3.0
DataKitchen/DKCloudCommand
DKCloudCommand/tests/TestDKCloudCommandConfig.py
1
1339
import unittest import sys import os from datetime import datetime from DKCloudCommandConfig import DKCloudCommandConfig __author__ = 'DataKitchen, Inc.' class TestDKCloudCommandConfig(unittest.TestCase): _TEMPFILE_LOCATION = '/var/tmp' def test_read_config_from_disk(self): cfg = DKCloudCommandConf...
agpl-3.0
NolanBecker/aima-python
submissions/Johnson/myLogic.py
17
1610
bartending = { 'kb': ''' OldEnough(Tim) Father(Jim, Tim) ID(TimsID, Tim) ID(JimsID, Jim) OrdersAlcohol(Tim) OrdersAlcohol(Jim) Differs(Jim, Tim) Differs(Tim, Jim) OldEnough(James) Father(John, James) ID(JamesID, James) ID(JamesID, John) Differs(James, John) Differs(John, James) OldEnough(Tyler) OldEnough(Chris) ...
mit
WSCU/crazyflie_ros
src/crazyflie/msg/_GyroData.py
1
5832
"""autogenerated by genpy from crazyflie/GyroData.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct import std_msgs.msg class GyroData(genpy.Message): _md5sum = "5defbd163657b4f6f639ba6d5676cc01" _type = "crazyflie/GyroData" _has_header = True #f...
gpl-2.0
aje/POT
examples/test_gpu.py
1
2268
# -*- coding: utf-8 -*- import time import numpy as np import cupy as cp from scipy.spatial.distance import cdist import ot def benchDistance(a, b): # First compare computation time for computing pairwise euclidean matrix time1 = time.time() M1 = cdist(a, b, metric="sqeuclidean") time2 = time.time()...
mit
bhargavipatel/808X_VO
vendor/googletest/googlemock/test/gmock_test_utils.py
769
3684
#!/usr/bin/env python # # Copyright 2006, 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...
mit
sbidoul/buildbot
master/buildbot/test/unit/test_clients_sendchange.py
10
10198
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
trademob/boto
boto/sqs/batchresults.py
191
3515
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011 Eucalyptus Systems, 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...
mit
maxive/erp
addons/mrp/models/mrp_bom.py
1
15428
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ from odoo.addons import decimal_precision as dp from odoo.exceptions import UserError, ValidationError from odoo.tools import float_round class MrpBom(models.Model): """ Defi...
agpl-3.0
leiferikb/bitpop
src/tools/telemetry/telemetry/util/global_hooks.py
17
2275
# 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. """Hooks that apply globally to all scripts that import or use Telemetry.""" import os import signal import sys from telemetry.core import util from teleme...
gpl-3.0
pajlada/tyggbot
pajbot/modules/linktracker.py
1
3139
import logging from urllib.parse import urlsplit from sqlalchemy_utc import UtcDateTime from sqlalchemy import Column, INT, TEXT from pajbot import utils from pajbot.managers.db import Base from pajbot.managers.db import DBManager from pajbot.managers.handler import HandlerManager from pajbot.modules import BaseMod...
mit
springmeyer/gyp
test/mac/gyptest-strip-default.py
232
2448
#!/usr/bin/env python # 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. """ Verifies that the default STRIP_STYLEs match between different generators. """ import TestGyp import re import subprocess import sys i...
bsd-3-clause
cherusk/ansible
lib/ansible/module_utils/openswitch.py
87
7773
# # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
qtumproject/qtum
contrib/verify-commits/verify-commits.py
47
8232
#!/usr/bin/env python3 # Copyright (c) 2018-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Verify commits against a trusted keys list.""" import argparse import hashlib import logging import os ...
mit
jimsimon/sky_engine
sky/tools/webkitpy/layout_tests/controllers/layout_test_finder.py
11
7351
# Copyright (C) 2012 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
GeosoftInc/gxapi
tests/python/base.py
1
3977
import os import shutil import unittest import inspect import subprocess from tkinter import Tk, messagebox import win32con import win32gui os.environ['GEOSOFT_FORCE_MESA_3D'] = '1' os.environ['GEOSOFT_TEST_MODE'] = '1' os.environ['GEOSOFT_TESTSYSTEM_MODE'] = '1' def set_geosoft_bin_path(): if 'GX_GEOSOFT_BIN_PAT...
bsd-2-clause
nhenezi/kuma
vendor/packages/sqlalchemy/test/orm/test_selectable.py
8
2054
"""Generic mapping to Select statements""" from sqlalchemy.test.testing import assert_raises, assert_raises_message import sqlalchemy as sa from sqlalchemy.test import testing from sqlalchemy import String, Integer, select from sqlalchemy.test.schema import Table, Column from sqlalchemy.orm import mapper, create_sessio...
mpl-2.0
davebx/tools-iuc
tools/qiime/qiime_core/beta_diversity_through_plots_html_generation.py
21
1864
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import re def generate_index_html(dir_list, args): with open(args.html_file, 'w') as index_html_file: s = "" s += '<html>\n' s += '\t<head><title>PCoA beta diversity results</title></head>\n' s += '\t<body>\n'...
mit
Elbagoury/odoo
addons/stock_landed_costs/__init__.py
373
1087
# -*- 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
poldrack/myconnectome
myconnectome/rnaseq/get_ImmPort_eigengenes.py
2
2781
""" get eigengene for each cluster """ import os,sys import numpy from sklearn.decomposition import PCA import sklearn.linear_model stdir=os.environ['MYCONNECTOME_DIR'] rnaseqdir=os.path.join(stdir,'rna-seq') immportdir=os.path.join(rnaseqdir,'ImmPort') def get_ImmPort_eigengenes(): if not os.path.exists(immpor...
mit
Cognexa/cxflow
cxflow/cli/dataset.py
1
1712
import logging import os.path as path from typing import Iterable from .util import fallback, validate_config, find_config from .common import create_dataset, create_output_dir from ..utils.config import load_config def invoke_dataset_method(config_path: str, method_name: str, output_root: str, cl_arguments: Iterab...
mit
apollo13/ansible
test/units/module_utils/facts/test_utils.py
78
1517
# 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 distributed in the hope that ...
gpl-3.0
jimjag/minio
docs/select/select.py
11
1043
#!/usr/bin/env/env python3 import boto3 s3 = boto3.client('s3', endpoint_url='http://localhost:9000', aws_access_key_id='minio', aws_secret_access_key='minio123', region_name='us-east-1') r = s3.select_object_content( Bucket='mycsvbucket', ...
apache-2.0
mrkm4ntr/incubator-airflow
tests/providers/salesforce/hooks/test_tableau.py
7
4091
# 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...
apache-2.0
rzambre/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/echo_noext_wsh.py
465
2404
# Copyright 2013, 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...
mpl-2.0
CastillaRicardo/gapps_utils
SendEmail.py
1
1071
#!/usr/bin/env python import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText def SendEmail(_to, _from, _subject, _htmlmsg, _plainmsg, _username, _password, _server="localhost", _port=25, _enctype="none"): COMMASPACE = ', ' msg = MIMEMultipart('alternative') msg['F...
unlicense
jangorecki/h2o-3
py2/h2o_ray.py
20
26500
import time import h2o_methods, h2o_print as h2p, h2o_sandbox, h2o_args from h2o_test import verboseprint, dump_json from h2o_xl import Key ################### # REST API ACCESSORS # TODO: remove .json def jobs(self, job_key=None, timeoutSecs=10, **kwargs): ''' Fetch all the jobs or a single job from the /Jo...
apache-2.0
cainmatt/django
tests/model_package/tests.py
380
2668
from __future__ import unicode_literals from django.db import connection, models from django.db.backends.utils import truncate_name from django.test import TestCase from .models.article import Article, Site from .models.publication import Publication class Advertisement(models.Model): customer = models.CharFiel...
bsd-3-clause
equitania/myodoo-addons-v10
pragma_customer_number/models/partner.py
1
8044
# -*- coding: utf-8 -*- ############################################################################## # # odoo (formerly known as OpenERP), Open Source Business Applications # Copyright (C) 2012-now Josef Kaser (<http://www.pragmasoft.de>). # # This program is free software: you can redistribute it and/or mo...
agpl-3.0
andnovar/networkx
networkx/algorithms/bipartite/edgelist.py
17
11505
""" ********** Bipartite Edge Lists ********** Read and write NetworkX graphs as bipartite edge lists. Format ------ You can read or write three formats of edge lists with these functions. Node pairs with no data:: 1 2 Python dictionary as data:: 1 2 {'weight':7, 'color':'green'} Arbitrary data:: 1 2 7 green ...
bsd-3-clause
aimas/TuniErp-8.0
addons/website_event/controllers/main.py
209
11805
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
josesanch/django-oscar
src/oscar/apps/promotions/context_processors.py
38
1592
from itertools import chain from oscar.apps.promotions.models import PagePromotion, KeywordPromotion def promotions(request): """ For adding bindings for banners and pods to the template context. """ promotions = get_request_promotions(request) # Split the promotions into separate lists for ...
bsd-3-clause
javachengwc/hue
desktop/core/ext-py/Django-1.6.10/django/db/models/deletion.py
47
12380
from operator import attrgetter from django.db import connections, transaction, IntegrityError from django.db.models import signals, sql from django.utils.datastructures import SortedDict from django.utils import six class ProtectedError(IntegrityError): def __init__(self, msg, protected_objects): self.p...
apache-2.0
TimBuckley/effective_django
tests/model_package/tests.py
26
2560
from __future__ import unicode_literals from django.contrib.sites.models import Site from django.db import models from django.test import TestCase from .models.publication import Publication from .models.article import Article class Advertisment(models.Model): customer = models.CharField(max_length=100) pub...
bsd-3-clause
libornovax/master_thesis_code
scripts/data/kitti2pgp.py
1
5330
""" Script for translating the KITTI camera calibration files into our PGP format. The PGP file contatins one line for each image with the 3x4 image projection matrix P and the ground plane equation ax+by+cz+d=0 coefficients: filename1 p00 p01 p02 p03 p10 p11 p12 p13 p20 p21 p22 p23 a b c d filename2 p00 p01 p02 p03 p...
mit
epandurski/django
django/contrib/gis/geos/coordseq.py
129
5502
""" This module houses the GEOSCoordSeq object, which is used internally by GEOSGeometry to house the actual coordinates of the Point, LineString, and LinearRing geometries. """ from ctypes import byref, c_double, c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.base import...
bsd-3-clause
LordDamionDevil/Lony
lib/youtube_dl/extractor/viceland.py
11
1086
# coding: utf-8 from __future__ import unicode_literals from .vice import ViceBaseIE class VicelandIE(ViceBaseIE): _VALID_URL = r'https?://(?:www\.)?viceland\.com/[^/]+/video/[^/]+/(?P<id>[a-f0-9]+)' _TEST = { 'url': 'https://www.viceland.com/en_us/video/trapped/588a70d0dba8a16007de7316', 'in...
gpl-3.0
foreverwind/Script
ASO/archive/aso_title.py
1
10083
#!/usr/bin/python # -*- coding: utf-8 -*- from openpyxl import * from datetime import * import sys import os import shutil reload(sys) sys.setdefaultencoding('utf-8') if len(sys.argv) != 3: print 'parameters error! aso.py [aso_xlsx] [aso_screenshots]' exit() def aso_write(filename, content): if content !...
apache-2.0
smart-developerr/my-first-blog
Lib/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py
2763
11318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
gpl-3.0
leppa/home-assistant
homeassistant/components/sesame/lock.py
5
2768
"""Support for Sesame, by CANDY HOUSE.""" from typing import Callable import pysesame2 import voluptuous as vol from homeassistant.components.lock import PLATFORM_SCHEMA, LockDevice from homeassistant.const import ( ATTR_BATTERY_LEVEL, CONF_API_KEY, STATE_LOCKED, STATE_UNLOCKED, ) import homeassistant...
apache-2.0
dmugtasimov/django_audit_trail
audit_trail/migrations/0001_initial.py
2
1340
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '0001_initial'), ] ...
apache-2.0
thomasrogers03/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/comments.py
148
2030
# Copyright (c) 2009 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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...
bsd-3-clause
QijunPan/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_igw_facts.py
21
5324
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that i...
gpl-3.0
alangwansui/mtl_ordercenter
openerp/addons/account/wizard/account_move_line_unreconcile_select.py
56
1903
# -*- 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
dkthompson/MSM-8x60-ICS
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
jasoncalabrese/openaps-mmhistorytools
setup.py
5
1326
from setuptools import setup, find_packages long_description ='''openaps MMHistoryTools plugin ============================== This package is a vendor plugin for openaps that provides tools for cleaning, condensing, and reformatting history data. ''' requires = ['openaps', 'python-dateutil'] __version__ = None exec(...
mit
AnnalisaS/migration_geonode
geonode/security/models.py
7
9603
# -*- coding: utf-8 -*- ######################################################################### # # 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 versio...
gpl-3.0
ridfrustum/lettuce
tests/integration/lib/Django-1.3/django/contrib/flatpages/tests/middleware.py
152
3308
import os from django.conf import settings from django.contrib.auth.models import User from django.test import TestCase class FlatpageMiddlewareTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): self.old_MIDDLEWARE_CLASSES = settings.MIDD...
gpl-3.0
Fireblend/chromium-crosswalk
third_party/opus/convert_rtcd_assembler.py
89
1531
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Script for converting celt_pitch_xcorr_arm.s -> celt_pitch_xcorr_arm.S # using the arm2gnu.pl script. import os import sys USAGE =...
bsd-3-clause
kubov/pyNES
pynes/tests/movingsprite_translated_test.py
28
3234
from pynes.tests import HexTestCase from pynes.compiler import lexical, syntax, semantic from pynes.cartridge import Cartridge ''' from pynes.examples.movingsprite_translated import game class MovingSpriteTranslatedTest(HexTestCase): def __init__(self, testname): super(MovingSpriteTranslatedTest, self)....
bsd-3-clause
gojira/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/models/forest_to_data_then_nn_test.py
159
3275
# 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
Akshay0724/scikit-learn
sklearn/gaussian_process/tests/test_gpr.py
36
11813
"""Testing for Gaussian process regression """ # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from scipy.optimize import approx_fprime from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels \ import RBF, Constan...
bsd-3-clause
r-o-b-b-i-e/pootle
tests/commands/set_filetype.py
2
3426
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import pytest from django.core.management i...
gpl-3.0
idovear/odoo
addons/website_forum/models/res_users.py
281
5198
# -*- coding: utf-8 -*- from datetime import datetime from urllib import urlencode import hashlib from openerp import SUPERUSER_ID from openerp.osv import osv, fields class Users(osv.Model): _inherit = 'res.users' def __init__(self, pool, cr): init_res = super(Users, self).__init__(pool, cr) ...
agpl-3.0
sanjeevtripurari/hue
desktop/core/ext-py/Django-1.6.10/django/db/backends/mysql/compiler.py
105
1305
from django.db.models.sql import compiler from django.utils.six.moves import zip_longest class SQLCompiler(compiler.SQLCompiler): def resolve_columns(self, row, fields=()): values = [] index_extra_select = len(self.query.extra_select) for value, field in zip_longest(row[index_extra_select:...
apache-2.0
coderbone/SickRage-alt
lib/github/tests/Issue50.py
9
3925
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
feroda/odoo
addons/mrp_operations/report/mrp_wc_barcode.py
381
1501
# -*- 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...
agpl-3.0
Rhoana/rh_aligner
scripts/wrappers/pre_match_3d_incremental.py
1
1734
from __future__ import print_function from rh_aligner.alignment.pre_match_3d_incremental import match_layers_sift_features import argparse def main(): # Command line parser parser = argparse.ArgumentParser(description='Iterates over the mfovs in 2 tilespecs of two sections, computing matches for each overlappi...
mit
Eaglemania/ASS
pyglet/lib.py
3
12344
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
gpl-2.0
1729org/Hadron
SimpleCIServer/simple_ci_server.py
1
1742
import web import json import hashlib import os import subprocess ENV = os.environ if not ENV.get("SECRET_TOKEN", None): import copy ENV = copy.deepcopy(ENV) ENV["SECRET_TOKEN"] = "" urls = ( '/', 'HandleGitWebHook' ) def check_signature(request_headers): raw_header = request_headers.get("environ"...
mit
mikeireland/chronostar
scripts/prepare_fits_file_with_results.py
1
2943
""" MZ (2020 - 01 - 20) Take files with results of the fit and put them in a fits file. Some results from the naivefit are left in the npy format as they are a supplementary results. Columns: object_id membership_1 ... membership_N for N components membership_bg. Do the same for the components. Apart from XYZUVW for ...
mit
ZhangXinNan/tensorflow
tensorflow/python/kernel_tests/distributions/kullback_leibler_test.py
31
5251
# 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
fernandoacorreia/DjangoWAWSLogging
DjangoWAWSLogging/env/Lib/site-packages/django/middleware/transaction.py
143
2311
from django.db import transaction class TransactionMiddleware(object): """ Transaction middleware. If this is enabled, each view function will be run with commit_on_response activated - that way a save() doesn't do a direct commit, the commit is done when a successful response is created. If an exc...
mit
coarse/NGSE
ngse/validators.py
1
1681
from utils import decode from pyramid.httpexceptions import ( HTTPNoContent, HTTPBadRequest, HTTPUnauthorized, HTTPForbidden, ) def has_admin_rights(request, **kwargs): token = request.authorization[1] payload = decode(token) if payload['level'] != 1: raise HTTPForbidden def has_representativ...
gpl-3.0
hgl888/chromium-crosswalk-efl
build/android/pylib/ports.py
44
6341
# 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. """Functions that deal with local and device ports.""" import contextlib import fcntl import httplib import logging import os import re import socket im...
bsd-3-clause
Mazecreator/tensorflow
tensorflow/python/kernel_tests/dynamic_partition_op_test.py
97
6138
# 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
rahul67/hue
desktop/core/src/desktop/lib/exceptions.py
39
2400
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
reembs/fusepy-flatfs
key_val_store.py
1
2111
import os import errno from fuse import FuseOSError import hashlib import pickle import pylru from bsddb3 import db CACHE_SIZE = 50000 def hash_path(partial): return hashlib.sha224(partial.encode('utf-8')).hexdigest() class HandleStore: def __init__(self, path, stv): self._path = path self.r...
apache-2.0
Tesora-Release/tesora-horizon
openstack_dashboard/dashboards/project/images/views.py
47
1877
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use t...
apache-2.0
BhallaLab/moose-examples
snippets/mgblock.py
2
4799
# mgblock.py --- # # Filename: mgblock.py # Description: # Author:Upi Bhalla # Maintainer: # Created: Wed Jul 3 09:36:06 2013 (+0530) # Version: # Last-Updated: Fri Sep 12 10:56:18 2014 (+0530) # By: Upi # Update #: # URL: # Keywords: # Compatibility: # # # Commentary: # # # # # Change log: # # # # # T...
gpl-2.0
bio-tools/biotoolsregistry
backend/elixir/image_field.py
2
1780
from rest_framework import serializers class Base64ImageField(serializers.ImageField): """ A Django REST framework field for handling image-uploads through raw post data. It uses base64 for encoding and decoding the contents of the file. Heavily based on https://github.com/tomchristie/django-rest-...
gpl-3.0
thedep2/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/orf.py
17
6823
# coding: utf-8 from __future__ import unicode_literals import json import re import calendar import datetime from .common import InfoExtractor from ..utils import ( HEADRequest, unified_strdate, ExtractorError, ) class ORFTVthekIE(InfoExtractor): IE_NAME = 'orf:tvthek' IE_DESC = 'ORF TVthek' ...
gpl-3.0