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
google-research/google-research
poem/core/keypoint_profiles.py
1
48752
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
apache-2.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/boto/sqs/queue.py
60
17724
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
montagnero/political-affiliation-prediction
newsreader.py
2
11936
# -*- coding: utf-8 -*- from sklearn.decomposition import KernelPCA from sklearn.metrics.pairwise import pairwise_distances from scipy.stats.mstats import zscore import glob import json import re import datetime import os import cPickle import codecs import itertools from sklearn.feature_extraction.text import TfidfVec...
mit
nrwahl2/ansible
lib/ansible/module_utils/crypto.py
8
4967
# -*- coding: utf-8 -*- # # (c) 2016, Yanis Guenane <yanis+ansible@guenane.org> # # 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 vers...
gpl-3.0
IndonesiaX/edx-platform
lms/djangoapps/django_comment_client/base/urls.py
63
2810
""" Base urls for the django_comment_client. """ from django.conf.urls import url, patterns urlpatterns = patterns( 'django_comment_client.base.views', url(r'upload$', 'upload', name='upload'), url(r'threads/(?P<thread_id>[\w\-]+)/update$', 'update_thread', name='update_thread'), url(r'threads/(?P<thr...
agpl-3.0
stilobique/UE4-Tools
controllers/data_buffer.py
1
3448
import bpy import pyperclip from math import degrees class DataBuffer(bpy.types.Operator): """Export data Position, Rotation and Scale of all selected element""" bl_idname = "object.data_buffer" bl_label = "Paste information buffer" def execute(self, context): objs = context.selected_objects...
gpl-3.0
stephane-martin/salt-debian-packaging
salt-2016.3.3/salt/pillar/http_yaml.py
2
1157
# -*- coding: utf-8 -*- """ A module that adds data to the Pillar structure retrieved by an http request Configuring the HTTP_YAML ext_pillar ==================================== Set the following Salt config to setup Foreman as external pillar source: .. code-block:: yaml ext_pillar: - http_yaml: ur...
apache-2.0
CTSRD-SOAAP/chromium-42.0.2311.135
native_client/pnacl/driver/tests/pnacl_ld_options_test.py
4
2777
#!/usr/bin/python # Copyright (c) 2014 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tests of the pnacl driver. This tests that pnacl-ld manages linking and LLVM opt flags correctly. """ import cStringIO import...
bsd-3-clause
dstrockis/outlook-autocategories
lib/google/api/billing_pb2.py
17
4489
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/api/billing.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflectio...
apache-2.0
tensorflow/tensorflow
tensorflow/python/debug/wrappers/grpc_wrapper.py
25
8662
# 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
sgerhart/ansible
lib/ansible/plugins/cliconf/iosxr.py
21
9274
# # (c) 2017 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
mit
naresh21/synergetics-edx-platform
common/test/acceptance/tests/lms/test_lms_user_preview.py
7
17053
# -*- coding: utf-8 -*- """ Tests the "preview" selector in the LMS that allows changing between Staff, Student, and Content Groups. """ from nose.plugins.attrib import attr from common.test.acceptance.tests.helpers import UniqueCourseTest, create_user_partition_json from common.test.acceptance.pages.studio.auto_aut...
agpl-3.0
umitproject/site-status
django/db/models/sql/where.py
289
13163
""" Code to manage the creation and SQL rendering of 'where' constraints. """ import datetime from itertools import repeat from django.utils import tree from django.db.models.fields import Field from django.db.models.query_utils import QueryWrapper from datastructures import EmptyResultSet, FullResultSet # Connection...
agpl-3.0
neudesk/neucloud
openstack_dashboard/dashboards/admin/roles/tests.py
8
4038
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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....
apache-2.0
Didacti/botornado
boto/ec2/autoscale/activity.py
57
3059
# Copyright (c) 2009-2011 Reza Lotun http://reza.lotun.name/ # # 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, mod...
mit
posquit0/dotfiles
vim/.vim/ycm_extra_conf.py
1
6657
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
mit
liamgh/liamgreenhughes-sl4a-tf101
python-build/python-libs/gdata/src/gdata/tlslite/utils/Cryptlib_AES.py
359
1364
"""Cryptlib AES implementation.""" from cryptomath import * from AES import * if cryptlibpyLoaded: def new(key, mode, IV): return Cryptlib_AES(key, mode, IV) class Cryptlib_AES(AES): def __init__(self, key, mode, IV): AES.__init__(self, key, mode, IV, "cryptlib") sel...
apache-2.0
mrquim/mrquimrepo
repo/script.module.youtube.dl/lib/youtube_dl/downloader/__init__.py
59
1576
from __future__ import unicode_literals from .common import FileDownloader from .f4m import F4mFD from .hls import HlsFD from .http import HttpFD from .rtmp import RtmpFD from .dash import DashSegmentsFD from .rtsp import RtspFD from .ism import IsmFD from .external import ( get_external_downloader, FFmpegFD, ...
gpl-2.0
oinopion/django
django/db/migrations/state.py
20
24499
from __future__ import unicode_literals import copy from collections import OrderedDict from contextlib import contextmanager from django.apps import AppConfig from django.apps.registry import Apps, apps as global_apps from django.conf import settings from django.db import models from django.db.models.fields.proxy im...
bsd-3-clause
Jack-Q/GYP-copy
pylib/gyp/MSVSSettings_test.py
395
65937
#!/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. """Unit tests for the MSVSSettings.py file.""" import StringIO import unittest import gyp.MSVSSettings as MSVSSettings class TestSequence...
bsd-3-clause
prefetchnta/questlab
bin/x64bin/python/37/Lib/ctypes/util.py
1
13437
import os import shutil import subprocess import sys # find_library(name) returns the pathname of a library, or None. if os.name == "nt": def _get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in ...
lgpl-2.1
maftieu/CouchPotatoServer
libs/dateutil/relativedelta.py
216
17224
""" Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard Python datetime module. """ __license__ = "Simplified BSD" import datetime import calendar from six import integer_types __all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"] class wee...
gpl-3.0
Gamecredits-Universe/Gamecredits-electrum-client
lib/msqr.py
59
2368
# from http://eli.thegreenplace.net/2009/03/07/computing-modular-square-roots-in-python/ def modular_sqrt(a, p): """ Find a quadratic residue (mod p) of 'a'. p must be an odd prime. Solve the congruence of the form: x^2 = a (mod p) And returns x. Note that p - x is also a root. 0 is returned ...
gpl-3.0
AloneRoad/Inforlearn
django/core/serializers/xml_serializer.py
16
8737
""" XML serializer. """ from django.conf import settings from django.core.serializers import base from django.db import models from django.utils.xmlutils import SimplerXMLGenerator from django.utils.encoding import smart_unicode from xml.dom import pulldom class Serializer(base.Serializer): """ Serializes a Q...
apache-2.0
malkavi/Flexget
flexget/tests/test_plugin_interfaces.py
3
1272
from flexget import plugin class TestInterfaces: """Test that any plugins declaring certain interfaces at least superficially comply with those interfaces.""" @staticmethod def get_plugins(interface): plugins = list(plugin.get_plugins(interface=interface)) assert plugins, 'No plugins for ...
mit
AceSrc/datagon
datagon/generator/translator.py
1
3802
import parser import random result = '' symbol = {} cnt = 0 def Translator(ast): def PrintError(x): print(x) exit(1) def PrintMsg(x): print(x) def Output(x): global result result += str(x) + ' ' def GetRandomInt(interval): if isinstance(interval, str)...
mit
thatneat/dotfiles
other_applications/sublime-text-3/Packages/Anaconda/anaconda_lib/linting/pep257.py
3
59998
#! /usr/bin/env python """Static analysis tool for checking docstring conventions and style. Implemented checks cover PEP257: http://www.python.org/dev/peps/pep-0257/ Other checks can be added, e.g. NumPy docstring conventions: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt The repository is l...
mit
bdh1011/wau
venv/lib/python2.7/site-packages/requests/packages/urllib3/connection.py
483
9011
import datetime import sys import socket from socket import timeout as SocketTimeout import warnings from .packages import six try: # Python 3 from http.client import HTTPConnection as _HTTPConnection, HTTPException except ImportError: from httplib import HTTPConnection as _HTTPConnection, HTTPException cla...
mit
dstockwell/catapult
tracing/third_party/tvcm/third_party/rjsmin/_setup/py2/util.py
37
2011
# -*- coding: ascii -*- # # Copyright 2007, 2008, 2009, 2010, 2011 # Andr\xe9 Malo or his licensors, as applicable # # 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.or...
bsd-3-clause
rpeyron/viking
tools/gctrackbyarc.py
12
4096
#!/usr/bin/env python # WARNING: I haven't thought much about the best way of doing # this. it may get lots of extra caches, or take a long # time if your path goes thru a city. # there's probably a better algorithm. # in meters. maxdist = 2500.0 # get geocaches, circles of "radius", then go ahead advance_dist...
gpl-2.0
sesh/djver
djver/djver.py
1
6137
#!/usr/bin/env python """ djver. Usage: djver.py [<url>] [--static-path=<static-path>] [--find-diffs] [--verbose] Options: --static-path=<static-path> URL path to the site's static files [default: /static/]. --find-diffs Attempt to find differences between the known versions of Django ...
mit
wdv4758h/ZipPy
lib-python/3/test/test_kqueue.py
59
7048
""" Tests for kqueue wrapper. """ import errno import os import select import socket import sys import time import unittest from test import support if not hasattr(select, "kqueue"): raise unittest.SkipTest("test works only on BSD") class TestKQueue(unittest.TestCase): def test_create_queue(self): kq ...
bsd-3-clause
eevee/urwid
urwid/widget.py
8
60739
#!/usr/bin/python # # Urwid basic widget classes # Copyright (C) 2004-2012 Ian Ward # # 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, ...
lgpl-2.1
jfpla/odoo
addons/project_timesheet/__openerp__.py
260
2151
# -*- 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
bikong2/scikit-learn
benchmarks/bench_plot_approximate_neighbors.py
244
6011
""" Benchmark for approximate nearest neighbor search using locality sensitive hashing forest. There are two types of benchmarks. First, accuracy of LSHForest queries are measured for various hyper-parameters and index sizes. Second, speed up of LSHForest queries compared to brute force method in exact nearest neigh...
bsd-3-clause
teamtuga4/teamtuga4ever.repository
plugin.video.traquinas/resources/lib/sources/movietv10_mv_tv.py
30
7086
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
chandranaik/Aligning-of-PIE-with-rfc8033-in-ns3
src/lte/doc/source/conf.py
28
7622
# -*- coding: utf-8 -*- # # ns-3 documentation build configuration file, created by # sphinx-quickstart on Tue Dec 14 09:00:39 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
gpl-2.0
andrius-preimantas/odoo
addons/account_voucher/invoice.py
382
2496
# -*- 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
luther07/dak
dak/rm.py
2
32615
#!/usr/bin/env python """ General purpose package removal tool for ftpmaster """ # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 James Troup <james@nocrew.org> # Copyright (C) 2010 Alexander Reichle-Schmehl <tolimar@debian.org> # This program is free software; you can redistribute it and/or modify # it under the ...
gpl-2.0
marrow/mongo
test/trait/test_collection.py
1
3008
# encoding: utf-8 from __future__ import unicode_literals import pytest from pymongo.errors import WriteError from marrow.mongo import Field, Index from marrow.mongo.trait import Collection @pytest.fixture def db(request, connection): return connection.test @pytest.fixture def coll(request, db): return db.coll...
mit
julienr/vispy
vispy/visuals/collections/raw_path_collection.py
14
4142
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- import numpy as np fr...
bsd-3-clause
heeraj123/oh-mainline
vendor/packages/ghettoq/docs/conf.py
17
5731
# -*- coding: utf-8 -*- # import sys import os # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. sys.path.insert(0, "../") import ghettoq from django.conf import settings if not settings.con...
agpl-3.0
git001/openshift-ansible
utils/test/openshift_ansible_tests.py
14
2542
import os import unittest import tempfile import shutil from six.moves import configparser from ooinstall import openshift_ansible from ooinstall.oo_config import Host, OOConfig BASE_CONFIG = """ --- variant: openshift-enterprise variant_version: 3.3 version: v2 deployment: ansible_ssh_user: cloud-user host...
apache-2.0
nlholdem/icodoom
.venv/lib/python2.7/site-packages/tensorflow/contrib/slim/__init__.py
63
2301
# 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...
gpl-3.0
sbuss/voteswap
lib/setuptools/command/install_egg_info.py
112
4035
from distutils import log, dir_util import os from setuptools.extern.six.moves import map from setuptools import Command from setuptools.archive_util import unpack_archive import pkg_resources class install_egg_info(Command): """Install an .egg-info directory for the package""" description = "Install an .e...
mit
kant/videonotes
lib/thrift/Thrift.py
62
4077
# # 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...
mit
ICTU/quality-time
components/server/src/initialization/report.py
1
2301
"""Report loaders.""" import json import logging import pathlib from pymongo.database import Database from database.reports import insert_new_report, insert_new_reports_overview, latest_reports_overview, report_exists def initialize_reports_overview(database: Database) -> None: """Initialize the reports overvi...
apache-2.0
matthew-tucker/mne-python
mne/datasets/utils.py
6
10755
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # Denis Egnemann <denis.engemann@gmail.com> # License: BSD Style. import os import os.path as op import shutil import tarfile from war...
bsd-3-clause
TheJJ100100/bedrock
bedrock/tabzilla/urls.py
8
1127
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from django.conf import settings from django.conf.urls import url from pipeline.collector import default_collector from...
mpl-2.0
minhphung171093/OpenERP_V8
openerp/addons/web/controllers/main.py
40
65803
# -*- coding: utf-8 -*- import ast import base64 import csv import functools import glob import itertools import jinja2 import logging import operator import datetime import hashlib import os import re import simplejson import sys import time import urllib2 import zlib from xml.etree import ElementTree from cStringIO ...
agpl-3.0
manipopopo/tensorflow
tensorflow/contrib/model_pruning/python/pruning_utils.py
14
11088
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
DmitryADP/diff_qc750
vendor/nvidia/tegra/3rdparty/python-support-files/src/Lib/mutex.py
60
1866
"""Mutual exclusion -- for use with module sched A mutex has two pieces of state -- a 'locked' bit and a queue. When the mutex is not locked, the queue is empty. Otherwise, the queue contains 0 or more (function, argument) pairs representing functions (or methods) waiting to acquire the lock. When the mutex is unlocke...
gpl-2.0
patrickcurl/ztruck
dj/lib/python2.7/site-packages/django/core/handlers/base.py
92
12054
from __future__ import unicode_literals import logging import sys import types from django import http from django.conf import settings from django.core import signals, urlresolvers from django.core.exceptions import ( MiddlewareNotUsed, PermissionDenied, SuspiciousOperation, ) from django.db import connections, ...
apache-2.0
fangxingli/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/yaml3/dumper.py
277
2723
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper'] from .emitter import * from .serializer import * from .representer import * from .resolver import * class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): def __init__(self, stream, default_style=None, default_flow_style=None, ...
apache-2.0
meefik/tinykernel-flo
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
chrsmithdemos/selenium
py/test/selenium/webdriver/common/element_attribute_tests.py
15
12232
#!/usr/bin/python # Copyright 2008-2010 WebDriver committers # Copyright 2008-2010 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...
apache-2.0
apechimp/servo
tests/wpt/harness/wptrunner/wptmanifest/tests/test_static.py
139
2863
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import unittest from cStringIO import StringIO from ..backends import static # There aren't many tests here because i...
mpl-2.0
pythonbyexample/PBE
dbe/classviews/edit_custom.py
1
5732
from django.forms import formsets from django.contrib import messages from django.db.models import Q from detail import * from edit import * from dbe.shared.utils import * class SearchFormViewMixin(BaseFormView): ignore_get_keys = ["page"] def get_form_kwargs(self): """ Returns the keyword arguments...
bsd-3-clause
shnergle/ShnergleServer
site-packages/cherrypy/process/plugins.py
37
25462
"""Site services for use with a Web Site Process Bus.""" import os import re import signal as _signal import sys import time import threading from cherrypy._cpcompat import basestring, get_daemon, get_thread_ident, ntob, set, Timer, SetDaemonProperty # _module__file__base is used by Autoreload to make # absolute any...
mit
Tatsh-ansible/ansible
lib/ansible/modules/net_tools/omapi_host.py
9
11915
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Loic Blot <loic.blot@unix-experience.fr> # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ impo...
gpl-3.0
nwalters512/the-blue-alliance
tests/test_team_manipulator.py
8
2481
import unittest2 from google.appengine.ext import ndb from google.appengine.ext import testbed from helpers.team_manipulator import TeamManipulator from models.team import Team class TestTeamManipulator(unittest2.TestCase): def setUp(self): self.testbed = testbed.Testbed() self.testbed.activate(...
mit
sparkprime/helm
expansion/schema_validation_test.py
2
22296
# Copyright 2015 The Kubernetes 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 ap...
apache-2.0
matejkloska/django-registration
registration/forms.py
28
3199
""" Forms and validation code for user registration. Note that all of these forms assume Django's bundle default ``User`` model; since it's not possible for a form to anticipate in advance the needs of custom user models, you will need to write your own forms if you're using a custom model. """ from __future__ import...
bsd-3-clause
PoornimaNayak/autotest-client-tests
linux-tools/celt051/celt051.py
4
1244
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error class celt051(test.test): """ Autotest module for testing basic functionality of celt051 @author Gopal Kalita <gokalita@in.ibm.com> ## """ ...
gpl-2.0
CINPLA/expipe-dev
expipe-templates-cinpla/get_templates.py
1
1153
import expipe import os.path as op import os import json overwrite = True base_dir = op.join(op.abspath(op.dirname(op.expanduser(__file__))), 'templates') templates = expipe.core.FirebaseBackend("/templates").get() for template, val in templates.items(): identifier = val.get('identifier') if identifier is No...
gpl-3.0
prontodev/stillwithus
stillwithus/clientsites/tests.py
1
6014
from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase from .models import ClientSite from servers.models import Server class ClientSiteTest(TestCase): def test_create_new_clientsite(self): clientsite = ClientSite() clientsite.dom...
mit
archifix/settings
sublime/Packages/mdpopups/st3/mdpopups/mdx/highlight.py
3
15749
""" Highlight. A library for managing code highlighting. All Changes Copyright 2014-2017 Isaac Muse. --- CodeHilite Extension for Python-Markdown ======================================== Adds code/syntax highlighting to standard Python-Markdown code blocks. See <https://pythonhosted.org/Markdown/extensions/code_h...
mit
konefalg/whylog
whylog/tests/test_regex_assistant/__init__.py
5
5707
import re from unittest import TestCase from whylog.assistant.regex_assistant import RegexAssistant from whylog.assistant.regex_assistant.exceptions import NotMatchingRegexError from whylog.assistant.regex_assistant.regex import ( create_date_regex, create_obvious_regex, regex_from_group_spans, regex_groups, verif...
bsd-3-clause
peterbe/bramble
vendor-local/lib/python/redis/client.py
2
60782
from __future__ import with_statement import datetime import time import warnings from itertools import imap, izip, starmap from redis.connection import ConnectionPool, UnixDomainSocketConnection from redis.exceptions import ( ConnectionError, DataError, RedisError, ResponseError, WatchError, ) def...
mpl-2.0
manazhao/tf_recsys
tensorflow/python/ops/distributions/dirichlet_multinomial.py
39
13187
# 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
sudheesh001/oh-mainline
vendor/packages/PyYaml/examples/yaml-highlight/yaml_hl.py
95
4429
#!/usr/bin/python import yaml, codecs, sys, os.path, optparse class Style: def __init__(self, header=None, footer=None, tokens=None, events=None, replaces=None): self.header = header self.footer = footer self.replaces = replaces self.substitutions = {} for doma...
agpl-3.0
pedro2d10/SickRage-FR
lib/hachoir_parser/file_system/ntfs.py
86
11594
""" New Technology File System (NTFS) file system parser. Sources: - The NTFS documentation http://www.linux-ntfs.org/ - NTFS-3G driver http://www.ntfs-3g.org/ Creation date: 3rd january 2007 Author: Victor Stinner """ SECTOR_SIZE = 512 from hachoir_parser import Parser from hachoir_core.field import (FieldSet,...
gpl-3.0
holygits/incubator-airflow
airflow/executors/sequential_executor.py
46
1862
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
dakr/xbmc
lib/gtest/scripts/fuse_gtest_files.py
2577
8813
#!/usr/bin/env python # # Copyright 2009, 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...
gpl-2.0
Evervolv/android_external_chromium_org
build/gyp_helper.py
57
1598
# 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. # This file helps gyp_chromium and landmines correctly set up the gyp # environment from chromium.gyp_env on disk import os SCRIPT_DIR = os.path.dirnam...
bsd-3-clause
yubo/lxc
src/python-lxc/examples/pyconsole.py
29
1653
#!/usr/bin/python3 # # pyconsole: Example program showing use of console functions # in the lxc python binding # # (C) Copyright Oracle. 2013 # # Authors: # Dwight Engen <dwight.engen@oracle.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser G...
lgpl-2.1
wxiang7/airflow
airflow/utils/dates.py
21
7078
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
mmazanec22/too-windy
env/lib/python3.5/site-packages/requests/packages/urllib3/contrib/ntlmpool.py
312
4478
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ from __future__ import absolute_import from logging import getLogger from ntlm import ntlm from .. import HTTPSConnectionPool from ..packages.six.moves.http_client import HTTPSConnecti...
gpl-3.0
alianmohammad/gem5-linux-kernel
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/numpy/distutils/msvccompiler.py
26
1991
from __future__ import division, absolute_import, print_function import os from distutils.msvccompiler import MSVCCompiler as _MSVCCompiler from .system_info import platform_bits def _merge(old, new): """Concatenate two environment paths avoiding repeats. Here `old` is the environment string before the bas...
bsd-2-clause
hsuantien/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py
254
2253
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
MMohan1/dwitter
dwitter_app/models.py
1
1342
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User import hashlib class Dweet(models.Model): content = models.CharField(max_length=140) user = models.ForeignKey(User) creation_date = models.DateTimeField(auto_now=True, ...
mit
pyzaba/pyzaba
lib/requests/packages/urllib3/exceptions.py
374
3274
# urllib3/exceptions.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 ## Base Exceptions class HTTPError(Exception): "Base exception used by this module." ...
bsd-3-clause
domeger/SplunkTAforPuppetEnterprise
bin/splunktaforpuppetenterprise/requests/exceptions.py
155
2976
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request. ...
apache-2.0
moreati/django
django/http/multipartparser.py
332
24331
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ from __future__ import unicode_literals import base64 import binascii import cgi import sys from django.conf import settings from django.core.exceptions imp...
bsd-3-clause
CCI-MOC/nova
nova/tests/unit/virt/ironic/test_client_wrapper.py
26
8277
# Copyright 2014 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
barbuza/django
tests/model_formsets_regress/tests.py
25
20696
from __future__ import unicode_literals from django import forms from django.forms.formsets import DELETION_FIELD_NAME, BaseFormSet from django.forms.models import ( BaseModelFormSet, inlineformset_factory, modelform_factory, modelformset_factory, ) from django.forms.utils import ErrorDict, ErrorList from djan...
bsd-3-clause
wenottingham/ansible
lib/ansible/plugins/lookup/hashi_vault.py
27
3678
# (c) 2015, Jonathan Davila <jdavila(at)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
PaulWay/spacewalk
client/solaris/rhnclient/rhn/actions/__init__.py
2
1886
"""Export allowable xmlrpc actions and do_call method""" # RHN Action exporter # Copyright (c) 1999--2013 Red Hat, Inc. Distributed under GPL. def do_call(method, params): """Find and execute an allowable xmlrpc method. <method> format is "ACTION_FILE.METHOD_NAME".""" parts = method.split(".") if le...
gpl-2.0
scotthartbti/android_external_chromium_org
tools/telemetry/telemetry/core/backends/chrome/extension_dict_backend.py
23
2641
# 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 re import weakref from telemetry.core import extension_page from telemetry.core.backends.chrome import inspector_backend class ExtensionN...
bsd-3-clause
scrollback/kuma
settings.py
2
38287
# Django settings for kuma project. from collections import namedtuple import json import logging import os import platform import sys from django.utils.functional import lazy from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse_lazy _Language = namedtuple(u'Language', ...
mpl-2.0
opensemanticsearch/open-semantic-etl
src/opensemanticetl/enhance_extract_law.py
1
5028
#!/usr/bin/python # -*- coding: utf-8 -*- import re import etl_plugin_core # # get taxonomy for aggregated facets / filters # # example: '§ 153 Abs. 1 Satz 2' -> ['§ 153', '§ 153 Absatz 1', '§ 153 Absatz 1 Satz 2'] # todo: def get_taxonomy(law_clause, law_code = None): law_clauses = [law_clause] ret...
gpl-3.0
chongtianfeiyu/kbengine
kbe/src/lib/python/Lib/test/test_pulldom.py
118
12467
import io import unittest import sys import xml.sax from xml.sax.xmlreader import AttributesImpl from xml.dom import pulldom from test.support import run_unittest, findfile tstfile = findfile("test.xml", subdir="xmltestdata") # A handy XML snippet, containing attributes, a namespace prefix, and a # self-closing ta...
lgpl-3.0
cloverstd/wechatpy
wechatpy/oauth/__init__.py
2
6592
# -*- coding: utf-8 -*- """ wechatpy.oauth ~~~~~~~~~~~~~~~ This module provides OAuth2 library for WeChat :copyright: (c) 2014 by messense. :license: MIT, see LICENSE for more details. """ from __future__ import absolute_import, unicode_literals import requests from six.moves.urllib.parse import ...
mit
souravbadami/zulip
zerver/views/realm_emoji.py
12
1372
from __future__ import absolute_import from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from typing import Text from zerver.models import UserProfile from zerver.lib.emoji import check_emoji_admin, check_valid_emoji_name, check_valid_emoji from zerver.lib.request im...
apache-2.0
gibiansky/tensorflow
tensorflow/contrib/learn/python/learn/ops/array_ops.py
7
2063
# 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
albertomurillo/ansible
lib/ansible/modules/windows/win_file.py
33
2185
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], ...
gpl-3.0
sjsucohort6/openstack
python/venv/lib/python2.7/site-packages/tablib/packages/openpyxl3/shared/password_hasher.py
118
1850
# file openpyxl/shared/password_hasher.py # Copyright (c) 2010 openpyxl # # 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 us...
mit
irinabov/debian-qpid-dispatch
tests/system_test.py
1
46655
# # 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...
apache-2.0
LeonidasAntoniou/dk-plus
test files/beacon.py
1
1799
""" A simple program that sends/listens broadcast packets through UDP socket Used to test the system if it is able to send/receive packets """ import time, math, sys, socket, threading, select, uuid from collections import namedtuple import cPickle as pickle from params import Params MAX_STAY = 5 #seconds until entry...
gpl-3.0