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
haruwo/thrift-with-java-annotation-support
lib/py/src/transport/TSSLSocket.py
55
8258
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
ChrisCinelli/pgessays
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py
744
6831
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
bsd-2-clause
Intel-tensorflow/tensorflow
tensorflow/lite/tools/optimize/debugging/python/debugger_test.py
3
13121
# Copyright 2021 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
oscar810429/mysql-5.6_facebook
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_rsync_test.py
24
5247
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2011 Patrick Crews # # # 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 Softwar...
gpl-2.0
endorphinl/horizon-fork
horizon/test/tests/workflows.py
38
11000
# Copyright 2012 Nebula, 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 agree...
apache-2.0
Kazade/NeHe-Website
google_appengine/bulkloader.py
22
2907
#!/usr/bin/env python # # Copyright 2007 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 law o...
bsd-3-clause
alephdata/aleph
aleph/logic/entitysets.py
1
3835
import logging from aleph.core import cache from aleph.model import EntitySet, EntitySetItem, Events from aleph.logic.entities import upsert_entity, refresh_entity from aleph.logic.collections import index_aggregator from aleph.logic.aggregator import get_aggregator from aleph.logic.notifications import publish log =...
mit
JAOSP/aosp_platform_external_chromium_org
tools/json_schema_compiler/highlighters/pygments_highlighter.py
179
1273
# 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 try: import pygments from pygments.lexers import CppLexer from pygments.formatters import HtmlFormatter PYGMENTS_IMPORTED = True excep...
bsd-3-clause
MoltenMotherBoard/platform_kernel_samsung_cori
tools/perf/scripts/python/sctop.py
895
1936
# 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
mshafiq9/django
django/apps/config.py
224
8284
import os from importlib import import_module from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured from django.utils._os import upath from django.utils.module_loading import module_has_submodule MODELS_MODULE_NAME = 'models' class AppConfig(object): """ Class representing a Django ap...
bsd-3-clause
robertwb/incubator-beam
sdks/python/apache_beam/io/gcp/bigquery.py
4
86985
# # 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 us...
apache-2.0
jacobajit/ion
intranet/apps/eighth/forms/admin/blocks.py
1
1644
# -*- coding: utf-8 -*- from django import forms from django.core.validators import RegexValidator from ...models import EighthBlock block_letter_validator = RegexValidator(r"^[a-z A-Z0-9_-]{1,10}$", "A block letter must be less than 10 characters long, and include only alphan...
gpl-2.0
ScottBuchanan/eden
modules/s3/s3codecs/svg.py
14
9708
# -*- coding: utf-8 -*- """ S3 SVG codec @copyright: 2013-14 (c) Sahana Software Foundation @license: MIT 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 rest...
mit
HoracioAlvarado/fwd
venv/Lib/site-packages/pip/_vendor/packaging/version.py
1151
11556
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import collections import itertools import re from ._structures import In...
mit
tpodowd/boto
tests/integration/sqs/test_cert_verification.py
126
1535
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software withou...
mit
Natim/sentry
src/sentry/migrations/0003_auto__add_field_message_group__del_field_groupedmessage_server_name.py
36
4187
# encoding: 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): # Adding field 'Message.group' db.add_column('sentry_message', 'group', self.gf('sentry.db.models.fields.FlexibleF...
bsd-3-clause
peinguin/imguploader
client/lib/jQuery-File-Upload-9.5.0/server/gae-python/main.py
168
5596
# -*- coding: utf-8 -*- # # jQuery File Upload Plugin GAE Python Example 2.1.0 # https://github.com/blueimp/jQuery-File-Upload # # Copyright 2011, Sebastian Tschan # https://blueimp.net # # Licensed under the MIT license: # http://www.opensource.org/licenses/MIT # from __future__ import with_statement from google.appe...
mit
40223101/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/difflib.py
737
82544
#! /usr/bin/env python3 """ Module difflib -- helpers for computing deltas between objects. Function get_close_matches(word, possibilities, n=3, cutoff=0.6): Use SequenceMatcher to return list of the best "good enough" matches. Function context_diff(a, b): For two lists of strings, return a delta in context ...
gpl-3.0
Alex-Chizhov/python_training
home_work_7/fixture/contact.py
1
3938
class ContactHelper: def __init__(self,app): self.app = app def link_add_new(self): wd = self.app.wd wd.find_element_by_link_text("add new").click() def input_save_form(self): wd = self.app.wd wd.find_element_by_xpath("//div[@id='content']/form/input[21]").click() def fill_form(self, info_contact): ...
apache-2.0
rruebner/odoo
openerp/tools/win32.py
457
1993
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
maxdeliso/elevatorSim
Lib/test/test_dynamic.py
173
4479
# Test the most dynamic corner cases of Python's runtime semantics. import builtins import contextlib import unittest from test.support import run_unittest, swap_item, swap_attr class RebindBuiltinsTests(unittest.TestCase): """Test all the ways that we can change/shadow globals/builtins.""" def configure_...
bsd-2-clause
whitmo/prism
setup.py
1
2106
import os import sys from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand py_version = sys.version_info[:2] PY3 = py_version[0] == 3 here = os.path.abspath(os.path.dirname(__file__)) def _read(path): with open(path, 'r') as fp: return fp.read() try: RE...
bsd-3-clause
OmeGak/indico
indico/legacy/pdfinterface/base.py
2
25142
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import cgi import math import os import xml.sax.saxutils as saxutils import pkg_resources from PIL import...
mit
wxkdesky/phantomjs
src/qt/qtwebkit/Tools/BuildSlaveSupport/wait-for-SVN-server.py
118
2670
#!/usr/bin/env python # # Copyright (C) 2006 John Pye # Copyright (C) 2012 University of Szeged # # This script 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...
bsd-3-clause
Ben-Farnfield/dotdesk
action/install.py
1
2665
""" This module controls the install process for dotdesk. install() -- runs the full install process """ import utils import const from interface import prompt from interface import output from model.dot_desktop_model import DotDesktopModel from model.icon_model import IconModel import sys def install(args): "...
mit
NirantK/Twitter-Geographical-Sentiment-Analysis
IndiaHappiestState/freqAnalysis.py
2
1173
def freqAnalysis(key): # for key in happyStates.keys(): words = [] tempWords = [] rawWords = happyStates[key].tweet.split(" ") # print rawWords[0] # x = False impTweets = 0.0 for word in rawWords: for thing in things_to_strip: if thing in word: word = ...
mit
gunner08/cocosJS
JS/jsTest/tools/bindings-generator/clang/enumerations.py
307
1077
#===- enumerations.py - Python Enumerations ------------------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===--------------------------------------------------------------...
apache-2.0
jumping/Diamond
src/diamond/metric.py
20
5762
# coding=utf-8 import time import re import logging from error import DiamondException class Metric(object): # This saves a significant amount of memory per object. This only matters # due to the queue system that moves objects between processes and can end # up storing a large number of objects in the q...
mit
gmist/alice-box
main/config.py
1
2447
# coding: utf-8 import os PRODUCTION = os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Eng') DEVELOPMENT = not PRODUCTION DEBUG = DEVELOPMENT try: # This part is surrounded in try/except because the config.py file is # also used in the run.py script which is used to compile/minify the client # sid...
mit
AllenAkhaumere/DeepProtein
global_utils.py
1
14993
"""Python utilities required Keras.""" from __future__ import absolute_import import numpy as np import random import pandas as pd import time import sys import six import marshal import types as python_types import inspect import tensorflow as tf from keras.callbacks import Callback _GLOBAL_CUSTOM_OBJECTS = {} cl...
mit
bashrc/zeronet-debian
src/src/lib/rsa/prime.py
194
3905
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
gpl-2.0
rfhk/awo-custom
stock_account_adjust/stock_account.py
2
4816
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) Rooms For (Hong Kong) Limited T/A OSCG (<http://www.openerp-asia.net>). # # This program is free software: you can redistribute it and/or modify # ...
lgpl-3.0
jhseu/tensorflow
tensorflow/python/tpu/profiler/pip_package/setup.py
23
2402
# 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
destijl/grr
grr/lib/maintenance_utils.py
1
14437
#!/usr/bin/env python """This file contains utility classes related to maintenance used by GRR.""" import getpass import hashlib import os import StringIO import sys import time import zipfile import logging from grr.lib import access_control from grr.lib import aff4 from grr.lib import config_lib from grr.lib im...
apache-2.0
turingmachine/aubio
tests/python/src/spectral/fft.py
4
5844
from template import aubio_unit_template from localaubio import * import math buf_size = 1024 channels = 4 class fft_unit(aubio_unit_template): def setUp(self): self.o = new_aubio_fft(buf_size, channels) def tearDown(self): del_aubio_fft(self.o) def test_create(self): """ test creation and deleti...
gpl-3.0
h3llrais3r/SickRage
lib/tzlocal/darwin.py
6
1042
from __future__ import with_statement import os import pytz import subprocess _cache_tz = None def _get_localzone(): pipe = subprocess.Popen( "systemsetup -gettimezone", shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE ) tzname = pipe.stdout.read().replace(b'Time...
gpl-3.0
sushi-irc/tekka
tekka/lib/fading_box.py
1
6498
""" Copyright (c) 2010 Marian Tietz All rights reserved. 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 notice, this list of conditions and the following d...
bsd-2-clause
ctools/ctools
test/dev/cta_make_nodes.py
1
3101
#! /usr/bin/env python # ========================================================================== # This Python script creates the node section of the NodeFunction using # logarithmically spaced energy bins. The intensity scale is set to the # HESS Crab intensity (assuming a power law). # # Copyright (C) 2012-2016 Ju...
gpl-3.0
Panagiotis-Kon/empower-runtime
empower/core/account.py
1
3287
#!/usr/bin/env python3 # # Copyright (c) 2016 Roberto Riggio # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
kmacinnis/sympy
sympy/polys/polyquinticconst.py
117
96143
""" Solving solvable quintics - An implementation of DS Dummit's paper Paper : http://www.ams.org/journals/mcom/1991-57-195/S0025-5718-1991-1079014-X/S0025-5718-1991-1079014-X.pdf Mathematica notebook: http://www.emba.uvm.edu/~ddummit/quintics/quintics.nb """ from __future__ import print_function, division from sy...
bsd-3-clause
kerr-huang/SL4A
python/src/Lib/ctypes/__init__.py
58
17311
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """create and manipulate C data types in Python""" import os as _os, sys as _sys __version__ = "1.1.0" f...
apache-2.0
decvalts/landlab
landlab/components/flow_accum/flow_accumulation2.py
1
4383
#! /usr/env/python """ A python flow accumulation module. It is designed to be general, and to operate across multiple grids and multiple flow direction patterns. However, at the moment, only a steepest descent (single path) routing scheme is implemented. There remain some outstanding issues with the handl...
mit
koery/win-sublime
Data/Packages/Package Control/package_control/providers/schema_compat.py
2
1463
from ..download_manager import update_url def platforms_to_releases(info, debug): """ Accepts a dict from a schema version 1.0, 1.1 or 1.2 package containing a "platforms" key and converts it to a list of releases compatible with' schema version 2.0. :param info: The dict of package info ...
mit
DataONEorg/d1_python
lib_client/src/d1_client/iter/sysmeta_multi.py
1
2823
# This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (the "License"); # you ma...
apache-2.0
nanolearning/edx-platform
cms/djangoapps/contentstore/features/course-export.py
3
2228
# pylint: disable=C0111 # pylint: disable=W0621 # pylint: disable=W0613 from lettuce import world, step from component_settings_editor_helpers import enter_xml_in_advanced_problem from nose.tools import assert_true, assert_equal from xmodule.modulestore.locations import SlashSeparatedCourseKey from contentstore.utils ...
agpl-3.0
owaiskhan/Retransmission-Combining
gnuradio-examples/python/pfb/resampler.py
7
4207
#!/usr/bin/env python # # Copyright 2009 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) ...
gpl-3.0
proxysh/Safejumper-for-Mac
buildmac/Resources/env/lib/python2.7/site-packages/twisted/web/http_headers.py
14
8231
# -*- test-case-name: twisted.web.test.test_http_headers -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ An API for storing HTTP header names and values. """ from __future__ import division, absolute_import from twisted.python.compat import comparable, cmp, unicode def _dashCapitali...
gpl-2.0
lucasa/landell-fgdp
sltv/ui/output/icecastoutput.py
5
2588
# -*- coding: utf-8 -*- # Copyright (C) 2010 Holoscópio Tecnologia # Author: Luciana Fujii Pontello <luciana@holoscopio.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of...
gpl-2.0
ttfseiko/openerp-trunk
openerp/addons/mrp_byproduct/__openerp__.py
121
1847
# -*- 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
our-city-app/oca-backend
src/rogerthat/dal/service.py
1
17053
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
apache-2.0
houzhenggang/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib/python2.7/imghdr.py
259
3544
"""Recognize image file formats based on their first few bytes.""" __all__ = ["what"] #-------------------------# # Recognize image headers # #-------------------------# def what(file, h=None): if h is None: if isinstance(file, basestring): f = open(file, 'rb') h = f.read(32) ...
gpl-2.0
glatard/nipype
nipype/interfaces/afni/tests/test_auto_SkullStrip.py
9
1138
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.afni.preprocess import SkullStrip def test_SkullStrip_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ignore_exception=dict(noh...
bsd-3-clause
azatoth/scons
src/engine/SCons/Tool/mwcc.py
6
6796
"""SCons.Tool.mwcc Tool-specific initialization for the Metrowerks CodeWarrior compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to ...
mit
caseyclements/bokeh
bokeh/server/start.py
26
2775
from __future__ import absolute_import, print_function import logging log = logging.getLogger(__name__) import os import sys from tornado.httpserver import HTTPServer from tornado import ioloop from .settings import settings as server_settings from bokeh import plotting # imports custom objects for plugin from bokeh...
bsd-3-clause
iancze/JudithExcalibur
scripts/DJ_image_to_FITS.py
1
5644
#!/usr/bin/env python # Original script written by Jane Huang, CfA # Reads in an image.out file from RADMC-3D and creates a new FITS file. # Ideal for conversion from RADMC output to CASA simobserve, for ALMA proposals import argparse parser = argparse.ArgumentParser(description="Convert RADMC-3D image.out into a F...
mit
arnaudsj/suds
suds/reader.py
3
4381
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 the hope that it will ...
lgpl-3.0
gluke77/rally
rally/cli/commands/plugin.py
6
4031
# Copyright 2015: 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
wzbozon/statsmodels
statsmodels/sandbox/contrast_old.py
34
4686
import copy import numpy as np from numpy.linalg import pinv from statsmodels.sandbox import utils_old as utils class ContrastResults(object): """ Results from looking at a particular contrast of coefficients in a parametric model. The class does nothing, it is a container for the results from T and F...
bsd-3-clause
smccaffrey/blackboard_automation
tests/client_builds/PHY132_Fall2017/dueDates_V1.py
2
3882
import selenium import getpass import time import sys import logging as log import pandas as pd from selenium import webdriver as wbd from selenium.webdriver.common.by import By sys.path.append('/Users/smccaffrey/Desktop/') #from automation import test_options as prelabs from automation import assignment_options as la...
apache-2.0
ElricleNecro/LISA
LISA/gui/utils/matrices/utils.py
2
3840
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import LISA.Matrice as m import math as mm __all__ = ["Perspective", "Orthographic"] class Perspective(m.Matrix): def __init__(self, *args, **kwargs): super(Perspective, self).__init__(*args, **kwargs) self._angle = 60.0 self._ratio = 16 ...
lgpl-3.0
Pluto-tv/chromium-crosswalk
third_party/closure_linter/closure_linter/aliaspass_test.py
84
5013
#!/usr/bin/env python # # Copyright 2012 The Closure Linter 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 # #...
bsd-3-clause
XiaosongWei/chromium-crosswalk
chrome/installer/tools/shortcut_properties.py
28
2050
# Copyright 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. """Dumps a Windows shortcut's property bag to stdout. This is required to confirm correctness of properties that aren't readily available in Windows UI. """...
bsd-3-clause
evelynmitchell/pdq
python/pdq.py
1
17664
# This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.11 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path impo...
mit
erdc-cm/air-water-vv
2d/hydraulicStructures/broad_crested_weir/kappa_p.py
2
1788
from proteus.default_p import * from proteus import Context from proteus.mprans import Kappa ct = Context.get() domain = ct.domain nd = domain.nd LevelModelType = Kappa.LevelModel if ct.useOnlyVF: RD_model = None LS_model = None dissipation_model = 3 ME_model = 2 else: RD_model = 3 LS_model = 2...
mit
ammaradil/fibonacci
Lib/site-packages/django/contrib/auth/password_validation.py
57
7538
from __future__ import unicode_literals import gzip import os import re from difflib import SequenceMatcher from django.conf import settings from django.core.exceptions import ImproperlyConfigured, ValidationError from django.utils import lru_cache from django.utils._os import upath from django.utils.encoding import ...
mit
lthurlow/Boolean-Constrained-Routing
networkx-1.8.1/build/lib/networkx/algorithms/components/tests/test_biconnected.py
35
6168
#!/usr/bin/env python from nose.tools import * import networkx as nx from networkx.algorithms.components import biconnected def assert_components_equal(x,y): sx = set((frozenset([frozenset(e) for e in c]) for c in x)) sy = set((frozenset([frozenset(e) for e in c]) for c in y)) assert_equal(sx,sy) def test...
mit
evanson/yowsup
yowsup/common/tools.py
30
4444
import time,datetime,re, hashlib from dateutil import tz import os from .constants import YowConstants import codecs, sys import logging import tempfile import base64 import hashlib logger = logging.getLogger(__name__) class HexTools: decode_hex = codecs.getdecoder("hex_codec") @staticmethod def decodeHex...
gpl-3.0
orekyuu/intellij-community
python/helpers/profiler/thrift/transport/TTwisted.py
97
10563
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
apigee/edx-platform
common/test/bok_choy/edxapp_pages/lms/progress.py
4
3949
from bok_choy.page_object import PageObject from ..lms import BASE_URL class ProgressPage(PageObject): """ Student progress page. """ @property def name(self): return "lms.progress" @property def requirejs(self): return [] @property def js_globals(self): ...
agpl-3.0
OriHoch/Open-Knesset
agendas/forms.py
14
5171
from django import forms from django.forms import ModelForm from django.forms.formsets import formset_factory from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from models import (Agenda, AgendaVote, UserSuggestedVote, AGENDAVOTE_SCORE_CHOICES, ...
bsd-3-clause
Yelp/paasta
tests/cli/test_cmds_list_deploy_queue.py
1
3659
#!/usr/bin/env python # Copyright 2015-2020 Yelp 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 ...
apache-2.0
sudheesh001/oh-mainline
vendor/packages/Django/django/core/management/commands/dumpdata.py
125
9088
from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.core import serializers from django.db import router, DEFAULT_DB_ALIAS from django.utils.datastructures import SortedDict from optparse import make_option class Command(BaseCommand): ...
agpl-3.0
ayushagrawal288/zamboni
mkt/account/urls.py
10
1492
from django.conf.urls import include, patterns, url from mkt.account.views import (AccountView, FeedbackView, FxALoginView, InstalledViewSet, LoginView, LogoutView, NewsletterView, PermissionsView) from mkt.feed.views import FeedShelfViewSet from mkt.users ...
bsd-3-clause
BoltzmannBrain/nupic
tests/unit/nupic/algorithms/sp_overlap_test.py
34
7020
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
azureplus/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/yaml/nodes.py
985
1440
class Node(object): def __init__(self, tag, value, start_mark, end_mark): self.tag = tag self.value = value self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): value = self.value #if isinstance(value, list): # if len(value) == 0: ...
apache-2.0
blokhin/three.js
utils/exporters/blender/modules/msgpack/__init__.py
659
1385
# coding: utf-8 from msgpack._version import version from msgpack.exceptions import * from collections import namedtuple class ExtType(namedtuple('ExtType', 'code data')): """ExtType represents ext type in msgpack.""" def __new__(cls, code, data): if not isinstance(code, int): raise TypeE...
mit
ROGUE-JCTD/vida
vida/firestation/templatetags/vida.py
3
3225
from django import template from django.conf import settings from django.template import defaultfilters from django.utils.translation import pgettext, ugettext as _, ungettext register = template.Library() # A tuple of standard large number to their converters intword_converters = ( (3, lambda number: ( u...
mit
olivertso/moneify
source/apps/dashboard/forms.py
1
4575
import calendar from django import forms from django.utils import timezone from source.apps.dashboard.helpers import ItemHelper from source.apps.dashboard.models import Item, Scenario, Tag class BaseDatePickerInput(forms.DateInput): def __init__(self, **kwargs): super().__init__(**kwargs) self.a...
gpl-3.0
EdgarSun/Django-Demo
django/contrib/gis/geos/linestring.py
411
5568
from django.contrib.gis.geos.base import numpy from django.contrib.gis.geos.coordseq import GEOSCoordSeq from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.point import Point from django.contrib.gis.geos import prototypes as cap...
mit
anbangleo/NlsdeWeb
Python-3.6.0/Lib/test/test_ordered_dict.py
2
28115
import builtins import contextlib import copy import gc import pickle from random import randrange, shuffle import struct import sys import unittest import weakref from collections.abc import MutableMapping from test import mapping_tests, support py_coll = support.import_fresh_module('collections', blocked=['_collect...
mit
siggame/Joueur.py
games/stumped/game.py
1
6599
# Game: Gather branches and build up your lodge as beavers fight to survive. # DO NOT MODIFY THIS FILE # Never try to directly create an instance of this class, or modify its member variables. # Instead, you should only be reading its variables and calling its functions. from typing import Dict, List, Optional from j...
mit
shootstar/novatest
nova/api/openstack/compute/contrib/scheduler_hints.py
3
2087
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 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-...
apache-2.0
sarantapichos/faircoop-market
openerp/conf/deprecation.py
380
2602
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
mvidalgarcia/indico
indico/modules/events/cloning.py
2
8710
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from collections import OrderedDict from operator import attrgett...
mit
briancoutinho0905/2dsampling
src/mem/ruby/structures/WireBuffer.py
32
1833
# Copyright (c) 2010 Advanced Micro Devices, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditions...
bsd-3-clause
mlhenderson/narrative
src/biokbase/narrative/common/tests/util.py
6
3349
""" Test utility functions """ __author__ = 'Dan Gunter <dkgunter@lbl.gov>' import logging import pickle import struct import threading import time import unittest import SocketServer from biokbase.narrative.common import util _log = logging.getLogger('kbtest') _hnd = logging.StreamHandler() _hnd.setFormatter(logging...
mit
hasadna/knesset-data-pipelines
datapackage_pipelines_knesset/retry_get_response_content.py
1
3427
import logging import os import time import requests from datapackage_pipelines_knesset.dataservice.exceptions import ReachedMaxRetries, InvalidStatusCodeException def is_blocked(content): for str in ['if(u82222.w(u82222.O', 'window.rbzid=', '<html><head><meta charset="utf-8"><script>']: if str in conten...
mit
offbyone/tweetstream
stream/requests_oauthlib/oauth2_session.py
1
15013
from __future__ import unicode_literals import logging from oauthlib.common import generate_token, urldecode from oauthlib.oauth2 import WebApplicationClient, InsecureTransportError from oauthlib.oauth2 import TokenExpiredError, is_secure_transport import requests log = logging.getLogger(__name__) class TokenUpdat...
bsd-3-clause
dbertha/odoo
addons/sale_service/__openerp__.py
260
2447
# -*- 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
larsbutler/swift
test/unit/account/test_server.py
2
99400
# 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
weiawe/django
django/utils/datastructures.py
55
9177
import copy from collections import OrderedDict from django.utils import six class OrderedSet(object): """ A set which keeps the ordering of the inserted items. Currently backs onto OrderedDict. """ def __init__(self, iterable=None): self.dict = OrderedDict(((x, None) for x in iterable) ...
bsd-3-clause
Koonkie/MetaPathways_Python_Koonkie.3.0
libs/python_scripts/MetaPathways_create_biom.py
2
11847
#!/usr/bin/python # File created on Nov 27 Jan 2012 from __future__ import division __author__ = "Kishori M Konwar" __copyright__ = "Copyright 2013, MetaPathways" __credits__ = ["r"] __version__ = "1.0" __maintainer__ = "Kishori M Konwar" __status__ = "Release" try: from os import makedirs, sys, remove, rename ...
mit
JarbasAI/JarbasAI
mycroft/client/enclosure/arduino.py
1
1707
# Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 versio...
gpl-3.0
apache/beam
sdks/python/apache_beam/io/external/xlang_snowflakeio_it_test.py
5
9103
# # 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 us...
apache-2.0
akash1808/nova_test_latest
nova/tests/unit/scheduler/test_chance_scheduler.py
69
3776
# Copyright 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 requ...
apache-2.0
ladybug-analysis-tools/ladybug-core
ladybug/color.py
1
21972
# coding=utf-8 """Ladybug color, colorsets and colorrange.""" from __future__ import division try: from collections.abc import Iterable # python < 3.7 except ImportError: from collections import Iterable # python >= 3.8 class Color(object): """Ladybug RGBA color. Args: r: red value 0-255, ...
gpl-3.0
bhdouglass/clickable
tests/mocks/config.py
1
1911
from clickable.config.project import ProjectConfig from clickable.config.constants import Constants from clickable.config.file_helpers import InstallFiles from clickable import __version__ from unittest.mock import Mock class InstallFilesMock(InstallFiles): def write_manifest(self, *args): pass def g...
gpl-3.0
cxxgtxy/tensorflow
tensorflow/python/estimator/canned/dnn.py
3
15021
# 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
ychen820/microblog
src/lib/flask_debugtoolbar/__init__.py
14
6925
import os from flask import current_app, request, g from flask.globals import _request_ctx_stack from flask import send_from_directory from jinja2 import Environment, PackageLoader from werkzeug.exceptions import HTTPException from werkzeug.urls import url_quote_plus from flask_debugtoolbar.toolbar import DebugToolba...
bsd-3-clause
LogicalKnight/pywinauto
pywinauto/tests/comboboxdroppedheight.py
17
2469
# GUI Application automation and testing library # Copyright (C) 2006 Mark Mc Mahon # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the License, or (at you...
lgpl-2.1