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
BenjamenMeyer/HTTPretty
tests/functional/base.py
8
3188
# #!/usr/bin/env python # -*- coding: utf-8 -*- # <HTTPretty - HTTP client mock for Python> # Copyright (C) <2011-2013> Gabriel Falcão <gabriel@nacaolivre.org> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to ...
mit
smenon8/AlgDataStruct_practice
practice_problems/MorePractice.py
1
2289
# Divide and Conquer Algorithm for finding the maximum sub array sum def maxSubArraySum(arr,h,t): if h == t: return arr[h] m = (h+t)//2 # 1. find max in left subarray leftSum = maxSubArraySum(arr,h,m) # 2. find max in right subarray rightSum = maxSubArraySum(arr,m+1,t) # 3. find max in mid-point crossin...
mit
StormTrooper/osmc
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x0ad.py
253
4766
data = ( 'gwan', # 0x00 'gwanj', # 0x01 'gwanh', # 0x02 'gwad', # 0x03 'gwal', # 0x04 'gwalg', # 0x05 'gwalm', # 0x06 'gwalb', # 0x07 'gwals', # 0x08 'gwalt', # 0x09 'gwalp', # 0x0a 'gwalh', # 0x0b 'gwam', # 0x0c 'gwab', # 0x0d 'gwabs', # 0x0e 'gwas', # 0x0f 'gwass', #...
gpl-2.0
argv-minus-one/obnam
obnamlib/encryption.py
1
7876
# Copyright 2011 Lars Wirzenius # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in th...
gpl-3.0
adamjmcgrath/glancydesign
src/django-nonrel/django/contrib/gis/maps/google/gmap.py
321
9000
from django.conf import settings from django.contrib.gis import geos from django.template.loader import render_to_string from django.utils.safestring import mark_safe class GoogleMapException(Exception): pass from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker, GIcon # The default Google ...
bsd-3-clause
sabi0/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/management/commands/inspectdb.py
311
1553
from optparse import make_option from django.core.management.base import CommandError from django.core.management.commands.inspectdb import Command as InspectDBCommand class Command(InspectDBCommand): db_module = 'django.contrib.gis.db' gis_tables = {} def get_field_type(self, connection, table_name, row...
apache-2.0
goldcoin/goldcoin
qa/rpc-tests/walletbackup.py
2
7322
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Exercise the wallet backup code. Ported from walletbackup.sh. Test case is: 4 nodes. 1 2 and 3 send...
mit
sergeyglazyrindev/python-instagram
instagram/models.py
30
7340
from .helper import timestamp_to_datetime import six class ApiModel(object): @classmethod def object_from_dictionary(cls, entry): # make dict keys all strings if entry is None: return "" entry_str_dict = dict([(str(key), value) for key, value in entry.items()]) ret...
bsd-3-clause
tuxar-uk/Merlyn
Merlyn.py
1
6041
""" Merlyn Speech Control for PC We load in commands (& spells) generated by lmtool.py and also language files generated by the Sphinx lmtool http://www.speech.cs.cmu.edu/tools/lmtool-new.html then open up a stream of words from the mic via LiveSpeech and try to parse it into commands and possibly some parameters...
mit
raildo/nova
nova/db/sqlalchemy/api_models.py
43
2611
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
DasIch/django
django/test/utils.py
14
20974
import logging import re import sys import time import warnings from contextlib import contextmanager from functools import wraps from unittest import skipIf, skipUnless from xml.dom.minidom import Node, parseString from django.apps import apps from django.conf import UserSettingsHolder, settings from django.core impo...
bsd-3-clause
ShinyROM/android_external_chromium_org
chrome/common/extensions/docs/server2/api_models_test.py
23
6016
#!/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. import json import unittest from api_models import APIModels from compiled_file_system import CompiledFileSystem from extensions_paths...
bsd-3-clause
occrp/loom
loom/elastic.py
2
1502
from jsonmapping.elastic import generate_schema_mapping BASE_MAPPING = { "_id": {"path": "id"}, "_all": {"enabled": True}, "properties": { "$schema": {"type": "string", "index": "not_analyzed"}, "$sources": {"type": "integer", "index": "not_analyzed"}, "$collections": {"type": "int...
agpl-3.0
abomyi/django
django/db/backends/postgresql_psycopg2/version.py
632
1517
""" Extracts the version of the PostgreSQL server. """ import re # This reg-exp is intentionally fairly flexible here. # Needs to be able to handle stuff like: # PostgreSQL #.#.# # EnterpriseDB #.# # PostgreSQL #.# beta# # PostgreSQL #.#beta# VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?') def _parse_...
bsd-3-clause
thoraxe/openshift-ansible
roles/openshift_health_checker/openshift_checks/ovs_version.py
2
2886
""" Ansible module for determining if an installed version of Open vSwitch is incompatible with the currently installed version of OpenShift. """ from openshift_checks import OpenShiftCheck, OpenShiftCheckException, get_var from openshift_checks.mixins import NotContainerizedMixin class OvsVersion(NotContainerizedMi...
apache-2.0
KuoE0/one-line-mac
install.py
2
1583
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Filename: install.py # Author: KuoE0 <kuoe0.tw@gmail.com> # # Copyright (C) 2018 # # Distributed under terms of the MIT license. """ """ import json import os import sys import subprocess install_cmd_collection = { 'apt': ['sudo', 'apt', 'inst...
mit
DLR-SC/DataFinder
contrib/script_examples/command_line/items.py
1
4139
# $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2003-2011, German Aerospace Center (DLR) # All rights reserved. # # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions are #met: # ...
bsd-3-clause
barachka/odoo
addons/report/tests/test_reports.py
385
2251
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-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
Rosy-S/twilio-python
tests/test_unicode.py
14
2466
# -*- coding: utf-8 -*- from mock import patch, Mock from six import u from twilio.rest import resources @patch("httplib2.Http") @patch("twilio.rest.resources.base.Response") def test_ascii_encode(resp_mock, mock): http = mock.return_value http.request.return_value = (Mock(), Mock()) data = { "bo...
mit
quattromani/officefootball
node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py
1869
1247
# Copyright 2014 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
mit
plotly/python-api
packages/python/plotly/plotly/graph_objs/scatterpolargl/_selected.py
2
4497
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Selected(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scatterpolargl" _path_str = "scatterpolargl.selected" _valid_props = {"marker", "textfont"...
mit
visionegg/visionegg
docs/conf.py
1
8232
# -*- coding: utf-8 -*- # # Vision Egg documentation build configuration file, created by # sphinx-quickstart on Fri Aug 29 21:31:07 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
lgpl-2.1
QijunPan/ansible
lib/ansible/modules/network/netvisor/pn_show.py
18
5432
#!/usr/bin/python """ PN CLI show commands """ # # 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 ver...
gpl-3.0
soybean217/lora-python
UServer/http_api_no_auth/api/api_gateway.py
1
5817
import json from http_api_no_auth.api import api, root from http_api_no_auth.api.decorators import gateway_belong_to_user from userver.object.gateway import Gateway, Location from utils.errors import KeyDuplicateError, PatchError from .forms.form_gateway import AddGatewayForm, PatchGateway from ..http_auth import auth...
mit
PepperPD/edx-pepper-platform
common/lib/xmodule/xmodule/modulestore/django.py
6
3978
""" Module that provides a connection to the ModuleStore specified in the django settings. Passes settings.MODULESTORE as kwargs to MongoModuleStore """ from __future__ import absolute_import from importlib import import_module from django.conf import settings from django.core.cache import get_cache, InvalidCacheBac...
agpl-3.0
mravikumar281/staging-server
baseapp/views/educational_district_views.py
3
1831
from django.views.generic import ListView, DetailView, CreateView, \ DeleteView, UpdateView from baseapp.models import Educational_district class Educational_districtView(object): model = Educational_district def get_template_names(self): """Nest templates within ed...
mit
CasparLi/calibre
src/tinycss/fonts3.py
14
1692
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' from tinycss.css21 import CSS21Parser, ParseError class FontFaceRule(objec...
gpl-3.0
dkodnik/Ant
addons/pad_project/__openerp__.py
119
1478
# -*- 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
valeriansaliou/django-gitlab-logging
gitlab_logging/handlers.py
1
2294
import logging class GitlabIssuesHandler(logging.Handler): """ Handles logs as issues with GitLab API """ def __init__(self): logging.Handler.__init__(self) def __open_issue(self, title, content, trace_raw): """ Open an issue on GitLab with given content """ ...
mit
zxtstarry/src
book/Recipes/tpx.py
5
1546
from rsf.proj import * def FPX(fpx,data, np, # number of slopes nw, # number of frequencies p0=-1, # first slope dp=None, # slope increment v0=0, # velocity continuation ): if not dp: dp=-2.0*p0/(np...
gpl-2.0
tkerola/chainer
tests/chainer_tests/functions_tests/math_tests/test_batch_l2_norm_squared.py
8
1924
import unittest import numpy as np import six import chainer from chainer import functions from chainer import testing from chainer.utils import type_check def _as_two_dim(x): if x.ndim == 2: return x return x.reshape((len(x), -1)) @testing.parameterize(*testing.product({ 'dtype': [np.float16,...
mit
jeremiahmarks/sl4a
python/src/Lib/lib2to3/tests/test_parser.py
50
5442
#!/usr/bin/env python2.5 """Test suite for 2to3's parser and grammar files. This is the place to add tests for changes to 2to3's grammar, such as those merging the grammars for Python 2 and 3. In addition to specific tests for parts of the grammar we've changed, we also make sure we can parse the test_grammar.py files...
apache-2.0
cpieloth/GPGPU-on-Hadoop
hadoop_ocl_link_test/runTime/runtime.py
1
1118
#!/usr/bin/env python # Python 3 import shlex import subprocess import re import sys import time # read command line arguments if len(sys.argv) < 3: print('Usage: <program> <outputfile> <value name>') sys.exit(1) # Variables PRG_NAME = sys.argv[1] DATA_NAME = sys.argv[2] VAL_NAME = sys.argv[3] RUNS...
apache-2.0
freedomtan/tensorflow
tensorflow/python/debug/lib/grpc_large_data_test.py
8
8382
# 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
cshallue/models
samples/cookbook/regression/dnn_regression.py
6
3741
# 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
msiedlarek/qtwebkit
Tools/Scripts/webkitpy/test/main.py
120
10405
# Copyright (C) 2012 Google, Inc. # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # n...
lgpl-3.0
japeto/Vigtech-Services
env/lib/python2.7/site-packages/django/contrib/messages/storage/fallback.py
704
2172
from django.contrib.messages.storage.base import BaseStorage from django.contrib.messages.storage.cookie import CookieStorage from django.contrib.messages.storage.session import SessionStorage class FallbackStorage(BaseStorage): """ Tries to store all messages in the first backend, storing any unstored me...
lgpl-3.0
MrLoick/python-for-android
python-build/python-libs/gdata/src/gdata/gauth.py
135
41554
#!/usr/bin/env 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 applicable ...
apache-2.0
duyuan11/glumpy
glumpy/app/window/backends/backend_sdl2.py
1
14801
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- import sys, ctypes fr...
bsd-3-clause
acfogarty/espressopp
src/bc/SlabBC.py
7
2456
# Copyright (C) 2014 # Pierre de Buyl # Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it ...
gpl-3.0
hachard/Cra-Magnet
flask/lib/python3.5/site-packages/setuptools/command/upload_docs.py
80
6815
# -*- coding: utf-8 -*- """upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). """ from base64 import standard_b64encode from distutils import log from distutils.errors import DistutilsOptionError import os import socket import zipfile import tempfile import ...
gpl-3.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/GL/NV/present_video.py
9
2133
'''OpenGL extension NV.present_video This module customises the behaviour of the OpenGL.raw.GL.NV.present_video to provide a more Python-friendly API Overview (from the spec) This extension provides a mechanism for displaying textures and renderbuffers on auxiliary video output devices. It allows an applicati...
gpl-3.0
duqiao/django
django/core/management/base.py
83
23884
# -*- 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...
bsd-3-clause
QijunPan/ansible
lib/ansible/modules/cloud/misc/virt_net.py
25
19391
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Maciej Delmanowski <drybjed@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 th...
gpl-3.0
Dishwishy/beets
beetsplug/badfiles.py
12
4575
# This file is part of beets. # Copyright 2015, François-Xavier Thomas. # # 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...
mit
lepricon49/CouchPotatoServer
couchpotato/core/downloaders/putio/__init__.py
12
2735
from .main import PutIO def autoload(): return PutIO() config = [{ 'name': 'putio', 'groups': [ { 'tab': 'downloaders', 'list': 'download_providers', 'name': 'putio', 'label': 'Put.io', 'description': 'This will start a torrent download...
gpl-3.0
rhurkes/chasegame
venv/lib/python2.7/site-packages/flask/testing.py
783
5003
# -*- coding: utf-8 -*- """ flask.testing ~~~~~~~~~~~~~ Implements test support helpers. This module is lazily imported and usually not used in production environments. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from contextlib import contextmana...
mit
Jionglun/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/shutil.py
720
39101
"""Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os.path import abspath import fnmatch import collections import errno import tarfile try: import bz2 del bz2 _...
agpl-3.0
privateip/ansible
lib/ansible/modules/windows/win_webpicmd.py
23
1852
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Peter Mounce <public@neverrunwithscissors.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...
gpl-3.0
marbindrakon/eve-wspace
evewspace/Map/migrations/0005_wsystem_statics.py
2
2551
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def combine_statics(apps, schema_editor): """ Custom function that combines the old static1, static2, and static3 into a ManyToManyField called statics. Doesn't use .add() because django doesn't l...
apache-2.0
NeurodataWithoutBorders/api-python
examples/create_scripts/general-e.py
1
2091
#!/usr/bin/python import sys from nwb import nwb_file from nwb import nwb_utils as utils """ Example using extension to add metadata to group /general Group /general contains general metadata, i.e. metadata that applies to the entire session. This example uses the extension defined in extensions/e-general.py to add ...
bsd-3-clause
themurph/openshift-tools
openshift/installer/vendored/openshift-ansible-3.5.45/roles/openshift_health_checker/openshift_checks/package_availability.py
15
2100
# pylint: disable=missing-docstring from openshift_checks import OpenShiftCheck, get_var from openshift_checks.mixins import NotContainerizedMixin class PackageAvailability(NotContainerizedMixin, OpenShiftCheck): """Check that required RPM packages are available.""" name = "package_availability" tags = [...
apache-2.0
guildai/guild
guild/remotes/gist.py
1
20430
# Copyright 2017-2021 TensorHub, 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 writ...
apache-2.0
NMGRL/pychron
pychron/core/ui/double_spinner.py
2
1171
# =============================================================================== # Copyright 2013 Jake Ross # # 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/licens...
apache-2.0
instinct-vfx/rez
src/rez/tests/data/builds/packages/foo/1.1.0/package.py
3
1033
name = 'foo' version = '1.1.0' authors = ["joe.bloggs"] uuid = "8031b8a1b1994ea8af86376647fbe530" description = "foo thing" build_requires = ["floob"] private_build_requires = ["build_util"] @include("late_utils") def commands(): env.PYTHONPATH.append('{root}/python') env.FOO_IN_DA_HOUSE = "1" late_util...
lgpl-3.0
ofer43211/unisubs
apps/thirdpartyaccounts/migrations/0002_move_twitter_facebook_profiles_to_tpa.py
5
25499
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." for profile in orm['socialauth.TwitterUserProfile'].objects.all(): orm....
agpl-3.0
pythonvietnam/scikit-learn
sklearn/utils/tests/test_random.py
230
7344
from __future__ import division import numpy as np import scipy.sparse as sp from scipy.misc import comb as combinations from numpy.testing import assert_array_almost_equal from sklearn.utils.random import sample_without_replacement from sklearn.utils.random import random_choice_csc from sklearn.utils.testing import ...
bsd-3-clause
Barmaley-exe/scikit-learn
examples/tree/plot_tree_regression_multioutput.py
43
1791
""" =================================================================== Multi-output Decision Tree Regression =================================================================== An example to illustrate multi-output regression with decision tree. The :ref:`decision trees <tree>` is used to predict simultaneously the ...
bsd-3-clause
eestay/edx-ora2
openassessment/xblock/student_training_mixin.py
5
9451
""" Student training step in the OpenAssessment XBlock. """ import logging from webob import Response from xblock.core import XBlock from openassessment.assessment.api import student_training from openassessment.workflow import api as workflow_api from openassessment.workflow.errors import AssessmentWorkflowError from ...
agpl-3.0
suyashphadtare/sajil-frappe
frappe/utils/csvutils.py
33
4593
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import msgprint, _ import json import csv, cStringIO from frappe.utils import encode, cstr, cint, flt, comma_or def read_csv_content_from_uploaded_fi...
mit
brchiu/tensorflow
tensorflow/python/kernel_tests/pad_op_test.py
2
15295
# 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
chiffa/numpy
numpy/polynomial/hermite.py
30
57824
""" Objects for dealing with Hermite series. This module provides a number of objects (mostly functions) useful for dealing with Hermite series, including a `Hermite` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in the d...
bsd-3-clause
sheafferusa/erpnext
erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
6
17469
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint, formatdate, flt, getdate from frappe import msgprint, _, throw from erpnext.setup.utils import get_company_...
agpl-3.0
bdh1011/cupeye
venv/lib/python2.7/site-packages/sqlalchemy/sql/schema.py
2
141950
# sql/schema.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 """The schema module provides the building blocks for database metadata. Each element...
bsd-3-clause
wanam/Adam-Kernel-GS4-LTE
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
adamcandy/Gaia
FileTodo.py
1
56922
#!/usr/bin/env python # -*- coding: utf-8 -*- ########################################################################## # # Gaia, task list organiser in with Caldav server sync. # # Copyright (C) 2013-2014 Dr Adam S. Candy. # Dr Adam S. Candy, contact@gaiaproject.org # # This file is part of the Gaia project...
gpl-3.0
Azure/azure-sdk-for-python
sdk/cognitiveservices/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/__init__.py
1
5495
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
edolstra/systemd
.ycm_extra_conf.py
129
1551
import itertools import os import subprocess def GetFlagsFromMakefile(varname): return subprocess.check_output([ "make", "-s", "print-%s" % varname]).decode().split() def Flatten(lists): return list(itertools.chain.from_iterable(lists)) def DirectoryOfThisScript(): return os.path.dirname(os.path.abspat...
gpl-2.0
gunan/tensorflow
tensorflow/lite/testing/op_tests/softmax.py
17
2188
# Copyright 2019 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
mlk/thefuck
tests/rules/test_dirty_unzip.py
1
2175
# -*- coding: utf-8 -*- import os import pytest import zipfile from thefuck.rules.dirty_unzip import match, get_new_command, side_effect from tests.utils import Command from unicodedata import normalize @pytest.fixture def zip_error(tmpdir): def zip_error_inner(filename): path = os.path.join(str(tmpdir),...
mit
Thortoise/Super-Snake
Blender/animation_nodes-master/sockets/shape_key.py
1
2668
import bpy from bpy.props import * from bpy.types import ShapeKey from .. events import propertyChanged from .. base_types.socket import AnimationNodeSocket from .. utils.id_reference import tryToFindObjectReference class ShapeKeySocket(bpy.types.NodeSocket, AnimationNodeSocket): bl_idname = "an_ShapeKeySocket" ...
gpl-3.0
hurricanerix/swift
test/unit/common/middleware/test_acl.py
21
9650
# Copyright (c) 2010-2012 OpenStack Foundation # # 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 agree...
apache-2.0
tswsl1989/Minecraft-Overviewer
overviewer_core/dispatcher.py
4
15121
# This file is part of the Minecraft Overviewer. # # Minecraft Overviewer 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
stanfordnmbl/osim-rl
tests/test.round2.py
1
1833
from osim.env import ProstheticsEnv, rect import numpy as np import unittest import math class SimulationTest(unittest.TestCase): def test_reset(self): env = ProstheticsEnv(visualize=False, difficulty=0) o = env.reset() self.assertEqual(type(o), list) o = env.reset(project = False) ...
mit
waltBB/neutron_read
neutron/services/l3_router/brocade/vyatta/vrouter_neutron_plugin.py
13
3334
# Copyright 2015 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 req...
apache-2.0
basho-labs/riak-cxx-client
deps/boost-1.47.0/tools/build/v2/tools/darwin.py
49
2455
# Copyright (C) Christopher Currie 2003. Permission to copy, use, # modify, sell and distribute this software is granted provided this # copyright notice appears in all copies. This software is provided # "as is" without express or implied warranty, and with no claim as to # its suitability for any purpose. # Ple...
apache-2.0
d3banjan/polyamide
webdev/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py
156
1864
""" urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' __license__ = 'MIT' __version__ = 'dev' from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encod...
bsd-2-clause
ferriman/SSandSP
pyxel-test/venv/lib/python3.8/site-packages/pip/_vendor/urllib3/poolmanager.py
27
19763
from __future__ import absolute_import import collections import functools import logging from ._collections import RecentlyUsedContainer from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, port_by_scheme from .exceptions import ( LocationValueError, MaxRetryError, ProxySchemeUnknown, ...
gpl-3.0
sachinkum/Bal-Aveksha
WebServer/BalAvekshaEnv/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer.py
328
14177
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import re from codecs import register_error, xmlcharrefreplace_errors from .constants import voidElements, booleanAttributes, spaceCharacters from .constants import rcdataElements, entities, xmlEntities from . im...
gpl-3.0
evast/XNATImageViewer
src/main/scripts/viewer/X/utils/_core/_jsfilefinder.py
5
1088
# # The XBUILD JS File finder. # # (c) 2012 The XTK Developers <dev@goXTK.com> # import sys import config # # # class JSFileFinder( object ): ''' Finds JS Files in directory. ''' def run( self, options=None ): ''' Performs the action. ''' # we need to import some closure python classes here...
bsd-3-clause
TwoD/ansible
lib/ansible/utils/module_docs.py
27
3899
#!/usr/bin/env python # (c) 2012, Jan-Piet Mens <jpmens () 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...
gpl-3.0
almostearthling/when-wizard
share/when-wizard/plugins/cond-event-batterylow.py
1
1402
# file: share/when-wizard/templates/cond-event-batterylow.py # -*- coding: utf-8 -*- # # Condition plugin for the low battery event # Copyright (c) 2015-2018 Francesco Garosi # Released under the BSD License (see LICENSE file) import locale from plugin import EventConditionPlugin, PLUGIN_CONST, plugin_name # setup i1...
bsd-3-clause
siddartha1992/cloud-custodian
tools/c7n_mailer/tests/test_email.py
1
9174
# 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
andreparrish/python-for-android
python3-alpha/python3-src/Lib/multiprocessing/forking.py
45
16312
# # Module for starting a process object using os.fork() or CreateProcess() # # multiprocessing/forking.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: ...
apache-2.0
gilbertron/whidbeysci
boilerplate/external/requests/api.py
637
4333
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. Retur...
lgpl-3.0
JosmanPS/scikit-learn
examples/cluster/plot_lena_ward_segmentation.py
271
1998
""" =============================================================== A demo of structured Ward hierarchical clustering on Lena image =============================================================== Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spatially constrained in order ...
bsd-3-clause
ghackebeil/PyORAM
src/pyoram/storage/block_storage.py
1
3293
__all__ = ('BlockStorageTypeFactory',) import logging log = logging.getLogger("pyoram") def BlockStorageTypeFactory(storage_type_name): if storage_type_name in BlockStorageTypeFactory._registered_devices: return BlockStorageTypeFactory.\ _registered_devices[storage_type_name] else: ...
mit
atondwal/linux-2
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
liuqr/edx-xiaodun
lms/djangoapps/certificates/migrations/0010_auto__del_field_generatedcertificate_enabled__add_field_generatedcerti.py
188
5338
# -*- 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): # Deleting field 'GeneratedCertificate.enabled' db.delete_column('certificates_generatedcertificate', 'enabl...
agpl-3.0
KyleJamesWalker/ansible
lib/ansible/module_utils/vmware.py
51
16732
# -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 yo...
gpl-3.0
smart-developerr/my-first-blog
Lib/site-packages/django/template/context_processors.py
55
2497
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the 'context_processors' option of the configuration of a DjangoTemplates backend and use...
gpl-3.0
modulexcite/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/uu_codec.py
83
3867
""" Python 'uu_codec' Codec - UU content transfer encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were adapted from uu.py which was written by Lan...
apache-2.0
willzhang05/postgrestesting1
postgrestesting1/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py
2931
1675
######################## 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...
mit
aishraj/pykons_solution
python2/koans/about_none.py
2
1573
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based on AboutNil in the Ruby Koans # from runner.koan import * class AboutNone(Koan): def test_none_is_an_object(self): "Unlike NULL in a lot of languages" self.assertEqual(True, isinstance(None, object)) def test_none_is_universal(self): ...
mit
manashmndl/LearningPyQt
pyqt/chap16/richtextlineedit.py
3
10340
#!/usr/bin/env python # Copyright (c) 2008-14 Qtrac Ltd. All rights reserved. # This program or module 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 # version 3 of the Lic...
mit
henriquegemignani/randovania
randovania/cli/__init__.py
1
1781
import argparse import logging import os import sys from pathlib import Path import randovania def create_subparsers(root_parser): from randovania.cli import echoes, server, gui, prime_database echoes.create_subparsers(root_parser) prime_database.create_subparsers(root_parser) server.create_subparser...
gpl-3.0
FABtotum/FAB-UI
recovery/python/boot.py
1
1621
import os, sys import time import serial import json import ConfigParser from subprocess import call config = ConfigParser.ConfigParser() config.read('/var/www/lib/config.ini') #startup script (see crontab) #print "Boot script" #time.sleep(60) #wait 60 seconds so connections can be made. #print "Sta...
gpl-2.0
elieux/kaira
gui/mainwindow.py
2
11694
# # Copyright (C) 2010, 2011 Stanislav Bohm # 2011 Ondrej Garncarz # # This file is part of Kaira. # # Kaira is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of t...
gpl-3.0
Abhinav1997/kernel_sony_msm8930
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # 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. from collections import defaultdict def aut...
gpl-2.0
spblightadv/rethinkdb
external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-ltcg.py
204
1097
#!/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. """ Make sure LTCG is working properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.TestGyp(formats=['msvs...
agpl-3.0