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
lz1988/company-site
django/db/models/fields/__init__.py
52
47946
from __future__ import unicode_literals import copy import datetime import decimal import math import warnings from itertools import tee from django.db import connection from django.db.models.query_utils import QueryWrapper from django.conf import settings from django import forms from django.core import exceptions, ...
bsd-3-clause
openstack/senlin
senlin/engine/receivers/message.py
1
11484
# 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 # distributed unde...
apache-2.0
XXMrHyde/android_external_chromium_org
tools/telemetry/telemetry/core/chrome/png_bitmap.py
26
2166
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import os import base64 def _EnsurePngIsInPath(): png_path = os.path.join(os.path.dirname(__file__), '..', '..', '...
bsd-3-clause
yury-s/v8-inspector
Source/chrome/build/android/gyp/copy_ex.py
40
2153
#!/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. """Copies files to a directory.""" import optparse import os import shutil import sys from util import build_utils def _get_all_f...
bsd-3-clause
xNovax/SickRage
sickbeard/providers/tvchaosuk.py
1
9907
# This file is part of SickRage. # # SickRage 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. # # SickRage is distributed in the hope t...
gpl-3.0
authomatic/authomatic
authomatic/six.py
2
29751
# -*- coding: utf-8 -*- """Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without res...
mit
sbtlaarzc/vispy
examples/basics/visuals/line_transform.py
17
3270
# -*- coding: utf-8 -*- # vispy: gallery 1 # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Demonstration of Line visual with arbitrary transforms. Several Line visuals are displayed that all have the same vertex position information, but diff...
bsd-3-clause
liavkoren/djangoDev
django/db/migrations/operations/special.py
6
5660
import re from .base import Operation class SeparateDatabaseAndState(Operation): """ Takes two lists of operations - ones that will be used for the database, and ones that will be used for the state change. This allows operations that don't support state change to have it applied, or have operations ...
bsd-3-clause
mpw1337/RocketMap
pogom/fakePogoApi.py
32
1370
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests import struct from time import time from .utils import get_args class FakePogoApi: def __init__(self, mock): # Fake a 24 hour auth token. self._auth_provider = type('', (object,), { "_ticket_expire": (time() + (3600 * 24))...
agpl-3.0
mamaddeveloper/tg
tg-test.py
199
1450
import tgl import pprint from functools import partial our_id = 0 pp = pprint.PrettyPrinter(indent=4) binlog_done = False; def on_binlog_replay_end(): binlog_done = True; def on_get_difference_end(): pass def on_our_id(id): our_id = id return "Set ID: " + str(our_id) def msg_cb(success, msg): ...
gpl-2.0
ilya-epifanov/ansible
lib/ansible/parsing/__init__.py
12
9352
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
StefanRijnhart/odoo
addons/point_of_sale/report/__init__.py
381
1238
# -*- 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
fooelisa/ansible-modules-extras
windows/win_chocolatey.py
28
3244
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Trond Hindenes <trond@hindenes.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 L...
gpl-3.0
wdxzzia/autokey
src/lib/gtkui/notifier.py
47
12947
# -*- coding: utf-8 -*- # Copyright (C) 2011 Chris Dekter # # 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 pr...
gpl-3.0
arikpoz/mxnet
example/profiler/profiler_executor.py
15
5490
import mxnet as mx import argparse import os, sys import time import numpy as np from mxnet import profiler def parse_args(): parser = argparse.ArgumentParser(description='Set network parameters for benchmark test.') parser.add_argument('--profile_filename', type=str, default='profile_executor_5iter.json') ...
apache-2.0
patengelbert/speaker-recognition
speaker_recognition/speaker-recognition.py
1
3001
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- # File: speaker-recognition.py # Date: Sun Feb 22 22:36:46 2015 +0800 # Author: Yuxin Wu <ppwwyyxxc@gmail.com> import argparse import glob import itertools import os import sys from speech_recognition import AudioFile sys.path.append(os.path.join(os.path.dirname(os.path...
apache-2.0
indiependente/Social-Networks-Structure
GenWattsStrogatzGrid.py
1
4216
# coding: utf-8 # # Generalized Watts-Strogatz direct graph on grid with clustering exponent *q* = 2 # In[1]: import sys # get_ipython().magic('matplotlib inline') import random # import matplotlib.pyplot as plt from dgraph import standardize from lesson1 import averageClustering as ac from lesson2 import countEdges...
mit
zwaters/CLAtoolkit
clatoolkit_project/clatoolkit/urls.py
2
2093
from django.conf.urls import patterns, url, include from django.contrib import admin from rest_framework.routers import DefaultRouter import views router = DefaultRouter() router.register(r'learningrecord', views.LearningRecordViewSet) router.register(r'socialrelationship', views.SocialRelationshipViewSet) rou...
gpl-3.0
ToontownUprising/src
toontown/classicchars/DistributedDaisy.py
6
3473
from direct.showbase.ShowBaseGlobal import * import DistributedCCharBase from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM from direct.fsm import State import CharStateDatas from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from toontown.hood impo...
mit
annahs/atmos_research
AL_1h_timeseries_HG_LG.py
1
6256
import sys import os import numpy as np from pprint import pprint from datetime import datetime from datetime import timedelta import mysql.connector import math import calendar import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib import dates SP2_ID = 58 saved_1_of_every = 10 start = datetime(...
mit
dahlstrom-g/intellij-community
python/testData/inspections/PyNumpyType/ArgSort.py
79
2403
def argsort(a, axis=-1, kind='quicksort', order=None): """ Returns the indices that would sort an array. Perform an indirect sort along the given axis using the algorithm specified by the `kind` keyword. It returns an array of indices of the same shape as `a` that index data along the given axis ...
apache-2.0
pidydx/grr
grr/parsers/config_file.py
1
38530
#!/usr/bin/env python """Simple parsers for configuration files.""" import collections import re import logging from grr.lib import lexer from grr.lib import parsers from grr.lib import utils from grr.lib.rdfvalues import anomaly as rdf_anomaly from grr.lib.rdfvalues import client as rdf_client from grr.lib.rdfvalues...
apache-2.0
numerigraphe/odoo
addons/account/report/report_vat.py
25
11326
# -*- 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
remiolsen/NouGAT
utils/prepare_validation_config.py
3
5461
import sys, os, yaml, glob import subprocess import argparse def main(args): workingDir = os.getcwd() samples_data_dir = args.sample_data_dir assemblies_data_dir = args.assemblies_data_dir assemblers = sum(args.assemblers, []) for sample_dir_name in [dir for dir in os.listdir(samples_data_d...
mit
ugursogukpinar/keyjen
scripts/generator.py
1
3011
#!/usr/bin/env python3 # -*- coding:utf-8 -*- """ It generates plenty of keys with different length and count. You can create random passwords, client_keys or secrets Author: Uğur Soğukpınar Date: 1 July 2015 Python Version: 3.4.3 """ import random class Generator(object): VERSION = '0.2.0' # ...
gpl-3.0
KendyllD/boukenda-project
makahiki/apps/widgets/smartgrid/management/commands/verify_smartgrid.py
6
1233
"""Invocation: python manage.py verify_smartgrid Verifies that all of the existing smartgrid unlock condition strings are valid. Prints out the names of any invalid conditions.""" from apps.managers.challenge_mgr.challenge_mgr import MakahikiBaseCommand from apps.utils import utils from apps.widgets.smartgrid.model...
mit
Hons/troposphere
troposphere/autoscaling.py
2
6662
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSHelperFn, AWSObject, AWSProperty, Ref from .validators import boolean, integer from . import cloudformation EC2_INSTANCE_LAUNCH = "autoscaling:EC2_INSTANCE_LAUNCH" EC2_INSTANCE_LAUNCH_E...
bsd-2-clause
Richard-West/RootTheBox
handlers/__init__.py
4
8806
# -*- coding: utf-8 -*- ''' Created on Mar 13, 2012 @author: moloch Copyright 2012 Root the Box 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/licen...
apache-2.0
ToAruShiroiNeko/revscoring
revscoring/utilities/extract_features.py
1
5220
""" ``revscoring extract_features -h`` :: Adds features to a set of labeled revisions. Reads a TSV file of <rev_id>\t<label> pairs and replaces the <rev_id> field with the extracted feature values. Input: <rev_id>[TAB]<label> Output: <feature_1>[TAB]<feature_2>[TAB]...[TAB]<label> Usage: ...
mit
earshel/PokeyPyManager
POGOProtos/Data/Capture/CaptureAward_pb2.py
12
4678
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Data/Capture/CaptureAward.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.protobu...
mit
commtrack/temp-aquatest
apps/requestlogger/decorators.py
1
2135
from __future__ import absolute_import from django.http import HttpRequest from requestlogger.models import RequestLog import logging def log_request(): """Decorator for views that logs information about the request before passing it to the view.""" # this is loosely modeled after example n...
bsd-3-clause
vponomaryov/rally
rally/plugins/openstack/scenarios/nova/servers.py
1
29993
# Copyright 2013: Mirantis 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 b...
apache-2.0
VitalPet/c2c-rd-addons
c2c_account_payment_extension/wizard/__init__.py
4
1478
# -*- coding: utf-8 -*- ############################################## # # Swing Entwicklung betrieblicher Informationssysteme GmbH # (<http://www.swing-system.com>) # Copyright (C) ChriCar Beteiligungs- und Beratungs- GmbH # all rights reserved # 08-JUN-2012 (GK) created # # WARNING: This program as such is intende...
agpl-3.0
google/mediapipe
mediapipe/examples/desktop/youtube8m/generate_vggish_frozen_graph.py
1
2149
# Copyright 2019 The MediaPipe 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 applicable law or agreed to ...
apache-2.0
gangadharkadam/saloon_erp
erpnext/accounts/doctype/payment_tool/payment_tool.py
11
5401
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _, scrub from frappe.utils import flt from frappe.model.document import Document import json from erpnext.acco...
agpl-3.0
40223101/w17test
static/Brython3.1.3-20150514-095342/Lib/encodings/aliases.py
726
15414
""" Encoding Aliases Support This module is used by the encodings package search function to map encodings names to module names. Note that the search function normalizes the encoding names before doing the lookup, so the mapping will have to map normalized encoding names to module names. Con...
gpl-3.0
sanchousese/Flask-User-starter-app
migrations/versions/0001c8ac1a69_initial_version.py
13
2050
"""Initial version Revision ID: 0001c8ac1a69 Revises: None Create Date: 2015-07-14 17:46:32.620018 """ # revision identifiers, used by Alembic. revision = '0001c8ac1a69' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! #...
bsd-2-clause
braghiere/JULESv4.6_clump
examples/us-me2/output/readflux.py
1
11976
from mpl_toolkits.basemap import Basemap from netCDF4 import Dataset, date2index import numpy as np import matplotlib.pyplot as plt import pandas as pd import os import sys os.getcwd() from datetime import date, datetime, timedelta data = pd.read_csv("/glusterfs/phd/users/mn811042/obs_data/FLUXNET2015/US-Me2/FLX_US-M...
gpl-2.0
rgeleta/odoo
addons/auth_signup/controllers/main.py
144
6049
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
yishayv/lyacorr
mpi_helper.py
1
2068
from __future__ import print_function import time import numpy as np from mpi4py import MPI from python_compat import range comm = MPI.COMM_WORLD def r_print(*args): """ print message on the root node (rank 0) :param args: :return: """ if comm.rank == 0: print('ROOT:', end=' ') ...
mit
diegobanol/VentasPc
requests/packages/urllib3/contrib/securetransport.py
42
30369
""" SecureTranport support for urllib3 via ctypes. This makes platform-native TLS available to urllib3 users on macOS without the use of a compiler. This is an important feature because the Python Package Index is moving to become a TLSv1.2-or-higher server, and the default OpenSSL that ships with macOS is not capable...
apache-2.0
wenderen/servo
tests/wpt/web-platform-tests/tools/html5lib/utils/entities.py
438
2734
import json import html5lib def parse(path="html5ents.xml"): return html5lib.parse(open(path), treebuilder="lxml") def entity_table(tree): return dict((entity_name("".join(tr[0].xpath(".//text()"))), entity_characters(tr[1].text)) for tr in tree.xpath("//h:tbody/h:tr", ...
mpl-2.0
sodafree/backend
tests/regressiontests/generic_views/edit.py
42
14497
from __future__ import absolute_import from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django import forms from django.test import TestCase from django.utils.unittest import expectedFailure from django.views.generic.edit import FormMixin from . import views fr...
bsd-3-clause
gorjuce/odoo
addons/account/account_move_line.py
23
78559
# -*- 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
shepdelacreme/ansible
lib/ansible/plugins/connection/winrm.py
14
30434
# (c) 2014, Chris Church <chris@ninemoreminutes.com> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ author: Ansible Core Te...
gpl-3.0
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/net/data/verify_certificate_chain_unittest/generate-intermediate-unknown-non-critical-extension.py
5
1086
#!/usr/bin/python # Copyright (c) 2015 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. """Certificate chain with 1 intermediate and a trusted root. The intermediate has an unknown X.509v3 extension that is marked as non-cr...
gpl-3.0
aerickson/ansible
lib/ansible/modules/monitoring/logentries.py
77
4811
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Ivan Vanderbyl <ivan@app.io> # # This 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 3 of the License, or # (at your option) any la...
gpl-3.0
hubert667/AIR
build/celery/build/lib.linux-i686-2.7/celery/utils/mail.py
9
4944
# -*- coding: utf-8 -*- """ celery.utils.mail ~~~~~~~~~~~~~~~~~ How task error emails are formatted and sent. """ from __future__ import absolute_import import smtplib import socket import traceback import warnings from email.mime.text import MIMEText from .functional import maybe_list try: from s...
gpl-3.0
Ferrari-lee/firefox-ios
scripts/update-xliff.py
29
5486
#! /usr/bin/env python # # update-xliff.py <base_l10n_folder> # # For each folder (locale) available in base_l10n_folder: # # 1. Read existing translations, store them in an array: IDs use the structure # file_name:string_id:source_hash. Using the hash of the source string # prevent from keeping an existing ...
mpl-2.0
gptech/ansible
lib/ansible/plugins/test/core.py
26
4648
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
mapleoin/braintree_python
tests/integration/test_credit_card.py
2
49864
from tests.test_helper import * from braintree.test.credit_card_defaults import CreditCardDefaults from braintree.test.credit_card_numbers import CreditCardNumbers import braintree.test.venmo_sdk as venmo_sdk class TestCreditCard(unittest.TestCase): def test_create_adds_credit_card_to_existing_customer(self): ...
mit
jakirkham/bokeh
bokeh/_version.py
14
18744
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains th...
bsd-3-clause
psiwczak/quantum
quantum/openstack/common/rpc/matchmaker.py
6
7538
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Cloudscaling Group, 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/LI...
apache-2.0
xiaoyaozi5566/GEM5_DRAMSim2
src/arch/x86/isa/insts/general_purpose/cache_and_memory_management.py
85
2927
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
Fokko/incubator-airflow
airflow/contrib/operators/gcp_text_to_speech_operator.py
1
1177
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
a25kk/dop
src/dop.sitecontent/dop/sitecontent/browser/frontpage.py
1
3385
# -*- coding: utf-8 -*- """Module providing views for the site navigation root""" from Products.Five.browser import BrowserView from Products.ZCatalog.interfaces import ICatalogBrain from plone import api from plone.app.contentlisting.interfaces import IContentListing from plone.app.contentlisting.interfaces import ICo...
mit
jteehan/cfme_tests
cfme/tests/test_ui_problems.py
3
1757
# -*- coding: utf-8 -*- import fauxfactory import pytest from cfme.services.catalogs import service_catalogs # NOQA from cfme.services.catalogs.catalog import Catalog from cfme.services.catalogs.catalog_item import CatalogItem from cfme.web_ui import AngularSelect, fill from utils.appliance.implementations.ui import ...
gpl-2.0
tvtsoft/odoo8
addons/stock/wizard/orderpoint_procurement.py
46
1897
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # # Order Point Method: # - Order if the virtual stock of today is bellow the min of the defined order point # import threading from openerp.osv import fields,osv from openerp.api import Environment class procuremen...
agpl-3.0
douggeiger/gnuradio
gr-wxgui/python/wxgui/histosink_gl.py
58
3472
# # Copyright 2009,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version...
gpl-3.0
benoitsteiner/tensorflow
tensorflow/contrib/cluster_resolver/python/training/cluster_resolver.py
10
6775
# 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 applicable ...
apache-2.0
Makohoek/parameter-framework
test/functional-tests/PfwTestCase/Types/__init__.py
20
1526
""" Types Package : All testcases about differents types used in PFW : - bit block - boolean - enum - FP16_Q0_15 : 16bits Fixed point - 0 integer bits, 15 fractionnal bits - FP16_Q15_0 : 16bits Fixed point - 15 integer bits, 0 fractionnal bits - FP16_Q7_8 : 16bits Fixed point - 7 integer bits, 8...
bsd-3-clause
sunil07t/e-mission-server
emission/core/wrapper/trip_old.py
3
24554
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import #maps team provided get_cost function # Standard imports from future import standard_library standard_library.install_aliases() from builtins import str from builtins imp...
bsd-3-clause
minhtuancn/odoo
addons/product/report/product_pricelist.py
341
5151
# -*- 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
wakatime/sublime-wakatime
packages/wakatime/packages/py27/pygments/lexers/floscript.py
4
2667
# -*- coding: utf-8 -*- """ pygments.lexers.floscript ~~~~~~~~~~~~~~~~~~~~~~~~~ Lexer for FloScript :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include from pygments.token import Text, Commen...
bsd-3-clause
lucamar/easybuild-easyconfigs
test/easyconfigs/easyconfigs.py
5
15603
## # Copyright 2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (http://w...
gpl-2.0
40223114/w16-
static/Brython3.1.1-20150328-091302/Lib/types.py
756
3167
""" Define names for built-in types that aren't directly accessible as a builtin. """ import sys # Iterators in Python aren't a matter of type but of protocol. A large # and changing number of builtin types implement *some* flavor of # iterator. Don't check the type! Use hasattr to check for both # "__iter__" and "...
gpl-3.0
ironbox360/PyCV-time
opencv-official-samples/3.0.0/facedetect.py
4
1955
#!/usr/bin/env python import numpy as np import cv2 # local modules from video import create_capture from common import clock, draw_str help_message = ''' USAGE: facedetect.py [--cascade <cascade_fn>] [--nested-cascade <cascade_fn>] [<video_source>] ''' def detect(img, cascade): rects = cascade.detectMultiScale...
mit
eldabbagh/gae-boilerplate
bp_includes/external/pytz/__init__.py
39
32443
''' datetime.tzinfo timezone definitions generated from the Olson timezone database: ftp://elsie.nci.nih.gov/pub/tz*.tar.gz See the datetime section of the Python Library Reference for information on how to use these modules. ''' # The Olson database is updated several times a year. OLSON_VERSION = '2010h' VERSI...
lgpl-3.0
gorkinovich/DefendersOfMankind
dependencies/boost-1.46.0/boost-build/test/project_dependencies.py
4
1159
#!/usr/bin/python # Copyright 2003 Dave Abrahams # Copyright 2002, 2003, 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Test that we can specify a dependency property # in project requirements, and...
gpl-3.0
clemkoa/scikit-learn
sklearn/manifold/locally_linear.py
5
26632
"""Locally Linear Embedding""" # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) INRIA 2011 import numpy as np from scipy.linalg import eigh, svd, qr, solve from scipy.sparse import eye, csr_matrix from scipy.sparse.li...
bsd-3-clause
nextgis/nextgisweb
nextgisweb/auth/test/test_policy.py
1
2323
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function, unicode_literals from datetime import timedelta from freezegun import freeze_time def test_fixture(ngw_webtest_app, ngw_auth_administrator): resp = ngw_webtest_app.get('/api/component/auth/current_user') assert resp.sta...
gpl-3.0
thomaslam/python_koans
python3/libs/colorama/win32.py
451
4833
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. # from winbase.h STDOUT = -11 STDERR = -12 try: from ctypes import windll from ctypes import wintypes except ImportError: windll = None SetConsoleTextAttribute = lambda *_: None else: from ctypes import ( byref, Str...
mit
sklnet/opendroid-enigma2
lib/python/Plugins/Extensions/DVDBurn/DVDProject.py
9
10200
from Tools.Directories import fileExists from Components.config import config, ConfigSubsection, ConfigInteger, ConfigText, ConfigSelection, getConfigListEntry, ConfigSequence, ConfigSubList import DVDTitle import xml.dom.minidom from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_FONTS from boxbranding...
gpl-2.0
mibitzi/pwm
pwm/atom.py
1
1232
# Copyright (c) 2013 Michael Bitzi # Licensed under the MIT license http://opensource.org/licenses/MIT from pwm.ffi.xcb import xcb _atom_cache = {} _NET_WM_STATE_REMOVE = 0 # remove/unset property _NET_WM_STATE_ADD = 1 # add/set property _NET_WM_STATE_TOGGLE = 2 # toggle property def get(atom_name, only_if_exis...
mit
vidyacraghav/cplusdratchio
deps/boost_1_55_0/tools/regression/xsl_reports/test/test_boost_wide_report.py
30
1136
import unittest import sys import time sys.path.append( ".." ) import boost_wide_report class test_boost_wide_report(unittest.TestCase): def test_diff( self ): test_cases = [ ( [] , [] , ( [], [] ) ) , ( [ boost_wide_report.file_info( "a", 1, time...
gpl-3.0
rhefner1/ghidonations
xlwt/examples/unicode1.py
1
1045
#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * w = Workbook() ws1 = w.add_sheet(u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK SMALL LETTER BETA}\N{GREEK SMALL LETTER GAMMA}') ws1.write(0, 0, u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK SMALL LETTER BETA}\N{GREEK SMALL ...
apache-2.0
fighterCui/L4ReFiascoOC
l4/pkg/python/contrib/Lib/test/test_coercion.py
56
11270
import copy import warnings import unittest from test.test_support import run_unittest, TestFailed # Fake a number that implements numeric methods through __coerce__ class CoerceNumber: def __init__(self, arg): self.arg = arg def __repr__(self): return '<CoerceNumber %s>' % repr(self.arg) ...
gpl-2.0
felliott/osf.io
api_tests/users/views/test_user_list.py
6
21448
# -*- coding: utf-8 -*- import itsdangerous import mock import pytest import unittest from future.moves.urllib.parse import urlparse, parse_qs from uuid import UUID from api.base.settings.defaults import API_BASE from framework.auth.cas import CasResponse from osf.models import OSFUser, Session, ApiOAuth2PersonalToken...
apache-2.0
ganymede42/h5pyViewer
h5pyViewer/hdfImageGL.py
1
5382
#!/usr/bin/env python #*-----------------------------------------------------------------------* #| | #| Copyright (c) 2013 by Paul Scherrer Institute (http://www.psi.ch) | #| ...
bsd-2-clause
Fedik/gramps
gramps/gui/editors/displaytabs/citationrefmodel.py
4
2717
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # Copyright (C) 2011 Tim G L Lyons # # 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; eith...
gpl-2.0
delhivery/django
django/core/management/commands/startapp.py
513
1040
from importlib import import_module from django.core.management.base import CommandError from django.core.management.templates import TemplateCommand class Command(TemplateCommand): help = ("Creates a Django app directory structure for the given app " "name in the current directory or optionally in t...
bsd-3-clause
JVillella/tensorflow
tensorflow/python/kernel_tests/diag_op_test.py
35
19989
# 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
sdarji/lpthw
Lib/site-packages/pip/_vendor/html5lib/trie/py.py
1323
1775
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError...
unlicense
unreal666/outwiker
plugins/source/source/pygments/lexers/rust.py
4
7717
# -*- coding: utf-8 -*- """ pygments.lexers.rust ~~~~~~~~~~~~~~~~~~~~ Lexers for the Rust language. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups, words, default from pygments...
gpl-3.0
dolph/python-keystoneclient
tests/utils.py
2
3459
import time import httplib2 import mox import unittest2 as unittest from keystoneclient.v2_0 import client class TestCase(unittest.TestCase): TEST_TENANT_ID = '1' TEST_TENANT_NAME = 'aTenant' TEST_TOKEN = 'aToken' TEST_USER = 'test' TEST_ROOT_URL = 'http://127.0.0.1:5000/' TEST_URL = '%s%s' ...
apache-2.0
wangheda/youtube-8m
youtube-8m-wangheda/all_frame_models/wide_and_deep_model.py
1
1342
import sys import models import model_utils import math import numpy as np import video_level_models import frame_level_models import tensorflow as tf import utils import tensorflow.contrib.slim as slim from tensorflow import flags FLAGS = flags.FLAGS class WideAndDeepModel(models.BaseModel): def create_model(self,...
apache-2.0
mytliulei/DCNRobotInstallPackages
windows/win32/paramiko-1.14.0/tests/test_message.py
26
4119
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
apache-2.0
maria/PyGithub
scripts/add_attribute.py
18
4971
#!/usr/bin/env python # -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> # # ...
gpl-3.0
blackbliss/medity-expo-2014
remote-api/flask/lib/python2.7/site-packages/jinja2/testsuite/tests.py
497
2865
# -*- coding: utf-8 -*- """ jinja2.testsuite.tests ~~~~~~~~~~~~~~~~~~~~~~ Who tests the tests? :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Markup, Environment env = Environm...
mit
tekromancr/pyNES
pynes/tests/lsr_test.py
28
4099
# -*- coding: utf-8 -*- ''' LSR, Logical Shift Right Test This is an Bit Manipulation operation of the 6502 ''' import unittest from pynes.compiler import lexical, syntax, semantic class LsrTest(unittest.TestCase): def test_lsr_acc(self): tokens = list(lexical('LSR A')) self.assertEquals(2, le...
bsd-3-clause
jendap/tensorflow
tensorflow/contrib/keras/api/keras/applications/__init__.py
87
1807
# 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
itmoss/Libjingle
scons-local/scons-local-2.0.1/SCons/Tool/dvi.py
61
2388
"""SCons.Tool.dvi Common DVI Builder definition for various other Tool modules that use it. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated document...
gpl-2.0
abhinavp13/IITBX-edx-platform-dev
common/lib/xmodule/xmodule/modulestore/search.py
5
4563
from itertools import repeat from xmodule.course_module import CourseDescriptor from .exceptions import (ItemNotFoundError, NoPathToItem) from . import Location def path_to_location(modulestore, course_id, location): ''' Try to find a course_id/chapter/section[/position] path to location in modulestore....
agpl-3.0
jeremiah-c-leary/vhdl-style-guide
vsg/tests/context/test_rule_016.py
1
2046
import os import unittest from vsg.rules import context from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_016_test_input.vhd')) lExpected_lower = [] lExpected_lower.append('') utils.read_file(os.path.joi...
gpl-3.0
tomintern/tomintern.github.io
codecombat/scripts/analytics/mixpanelGetEvent.py
97
7517
# Get mixpanel event data via export API # Useful for debugging Mixpanel data weirdness targetLevels = ['dungeons-of-kithgard', 'the-raised-sword', 'endangered-burl'] targetLevels = ['dungeons-of-kithgard'] eventFunnel = ['Started Level', 'Saw Victory'] # eventFunnel = ['Saw Victory'] # eventFunnel = ['Started Level']...
mit
mith1979/ansible_automation
applied_python/applied_python/lib64/python2.7/site-packages/lazy_object_proxy/simple.py
15
8204
import operator from .compat import PY2 from .compat import PY3 from .compat import with_metaclass from .utils import cached_property from .utils import identity def make_proxy_method(code): def proxy_wrapper(self, *args): return code(self.__wrapped__, *args) return proxy_wrapper class _ProxyMetho...
apache-2.0
berrange/nova
nova/api/openstack/compute/contrib/hosts.py
18
14804
# Copyright (c) 2011 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 ...
apache-2.0
sailthru/stolos
stolos/queue_backend/read_job_state.py
1
2580
import six from stolos import exceptions from . import shared def validate_state( pending, completed, failed, skipped, all=False, multi=False): """Helper function to that raises UserWarning if user's request defines an invalid combination of job states """ cnt = pending + completed + failed +...
apache-2.0
shaunduncan/helga-newrelic
setup.py
1
1070
from setuptools import setup, find_packages version = '0.2.0' setup(name="helga-newrelic", version=version, description=('IRC bot using twisted'), classifiers=['Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT L...
mit
thnee/ansible
lib/ansible/modules/network/junos/_junos_vlan.py
21
7120
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0