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
brandon-rhodes/numpy
tools/win32build/build.py
81
4108
"""Python script to build windows binaries to be fed to the "superpack". The script is pretty dumb: it assumes python executables are installed the standard way, and the location for blas/lapack/atlas is harcoded. TODO: - integrate the x86analysis script to check built binaries - make the config configurable ...
bsd-3-clause
skoppisetty/secret-bugfixes
lib/sqlalchemy/connectors/pyodbc.py
5
5964
# connectors/pyodbc.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from sqlalchemy.connectors import Connector from sqlalchemy.util import asbool i...
gpl-3.0
mdrumond/tensorflow
tensorflow/python/kernel_tests/spacetodepth_op_test.py
6
12744
# 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
marcofucci/mooshell
models.py
1
9791
from datetime import date, timedelta, datetime import os from django.db import models from django.db.models.signals import pre_save, post_save from django.contrib.auth.models import User from django.conf import settings from managers import JSDependencyManager, JSLibraryManager, PastieManager, ShellManager def ne...
mit
AusTac/parma
b3/pkg_handler.py
1
4322
# # BigBrotherBot(B3) (www.bigbrotherbot.net) # Copyright (C) 2005 Michael "ThorN" Thornton # # 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 the License, or # (at your opti...
gpl-2.0
stevehof/CouchPotatoServer
libs/tornado/stack_context.py
39
13172
#!/usr/bin/env python # # Copyright 2010 Facebook # # 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 a...
gpl-3.0
nathanielvarona/airflow
airflow/providers/google/cloud/hooks/speech_to_text.py
10
4568
# # 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
SimonGriffioen/pascal
PASCAL/external/networkx/readwrite/gexf.py
33
36034
""" **** GEXF **** Read and write graphs in GEXF format. GEXF (Graph Exchange XML Format) is a language for describing complex network structures, their associated data and dynamics. This implementation does not support mixed graphs (directed and undirected edges together). Format ------ GEXF is an XML format. See ...
gpl-2.0
jessrosenfield/pants
src/python/pants/backend/jvm/tasks/jar_import_products.py
16
1986
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from collections imp...
apache-2.0
chitr/neutron
neutron/tests/api/test_extension_driver_port_security.py
34
6825
# Copyright 2015 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
kdresser/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
Chapter6_Priorities/ystockquote.py
104
3958
# # ystockquote : Python module - retrieve stock quote data from Yahoo Finance # # Copyright (c) 2007,2008,2013 Corey Goldberg (cgoldberg@gmail.com) # # license: GNU LGPL # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as pub...
mit
xiedidan/luna-network
resnext/createGroundTruth.py
1
1336
# -*- coding:utf-8 -*- import os from glob import glob import numpy as np try: import cPickle as pickle except: import pickle # create label for resnext tests # glob filename from nodules/, write label to groundTruths/ class GroundTruthCreator(object): def __init__(self, dataPath, phrase = "train"): ...
gpl-3.0
hancock-lighting/hancock.lighting
src/backend/lib/twitter/oauth2.py
8
2887
""" Twitter only supports the application-only flow of OAuth2 for certain API endpoints. This OAuth2 authenticator only supports the application-only flow right now. To authenticate with OAuth2, visit the Twitter developer page and create a new application: https://dev.twitter.com/apps/new This will get you a CO...
mit
langcog/wordbank
instruments/schemas/English_American_WG.py
1
79336
from django.db import models from instruments.base import BaseTable class English_American_WG(BaseTable): item_1_choices = [('yes', 'yes'), ('no', 'no')] item_1 = models.CharField(max_length=3, choices=item_1_choices, null=True) item_2_choices = [('yes', 'yes'), ('no', 'no')] item_2 = models.CharField...
gpl-2.0
egenerat/flight-manager
django/contrib/auth/views.py
10
8584
import re from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME # Avoid shadowing the login() view below. from django.contrib.auth import login as auth_login from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm from djan...
mit
jcstill/P4wnP1
hidtools/backdoor/ServerMethod.py
3
2430
# This file is part of P4wnP1. # # Copyright (c) 2017, Marcus Mengs. # # P4wnP1 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option...
gpl-3.0
cinemapub/bright-response
scripts/lib/tweepy/tweepy/models.py
1
12175
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. from tweepy.error import TweepError from tweepy.utils import parse_datetime, parse_html_value, parse_a_href class ResultSet(list): """A list like object that holds results from a Twitter API query.""" def __init__(self, max_id=None, s...
mit
eeshangarg/oh-mainline
vendor/packages/Jinja2/jinja2/testsuite/core_tags.py
412
11858
# -*- coding: utf-8 -*- """ jinja2.testsuite.core_tags ~~~~~~~~~~~~~~~~~~~~~~~~~~ Test the core tags like for and if. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment...
agpl-3.0
alexlo03/ansible
lib/ansible/plugins/callback/logdna.py
28
6821
# (c) 2018, Samir Musali <samir.musali@logdna.com> # 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 = ''' callback: logdna callback_type: aggregate short_descri...
gpl-3.0
kevinastone/sentry
src/sentry/models/activity.py
2
5554
""" sentry.models.activity ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.conf import settings from django.core.urlresolvers import reverse from django.db import mode...
bsd-3-clause
FEniCS/instant
test/test07.py
1
1463
from __future__ import print_function import pytest import numpy as N import time from instant import build_module import sys from functools import reduce c_code = """ void func(int n1, double* array1, int n2, double* array2){ double a; if ( n1 == n2 ) { for (int i=0; i<n1; i++) { a = arra...
gpl-3.0
dulems/hue
desktop/core/ext-py/pam/setup.py
38
1141
from setuptools import setup, find_packages import sys, os version = '0.1.3' setup(name='pam', version=version, description="PAM interface using ctypes", long_description="""\ An interface to the Pluggable Authentication Modules (PAM) library on linux, written in pure python (using ctypes)""", ...
apache-2.0
ArcherSys/ArcherSys
Lib/site-packages/zope/interface/tests/test_element.py
79
1320
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
mit
EricMuller/mynotes-backend
requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/runner/procmontap.py
65
2298
# -*- test-case-name: twisted.runner.test.test_procmontap -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Support for creating a service which runs a process monitor. """ from twisted.python import usage from twisted.runner.procmon import ProcessMonitor class Options(usage.Options): ...
mit
heke123/chromium-crosswalk
tools/vim/tests/chromium.ycm_extra_conf_unittest.py
3
12059
#!/usr/bin/env python # 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. """Tests for chromium.ycm_extra_conf. These tests should be getting picked up by the PRESUBMIT.py in /tools/vim. Currently the tests ...
bsd-3-clause
nextmovesoftware/smilesreading
scripts/WeiningerCEX.py
1
1431
import subprocess import common cex = """$D<MOL> /_P<molecule> /_V<Molecule> /_S<1M> /_L<XSMILES> /_X<Molecule represented in XSMILES (Exchange SMILES)> | $MOL<%s> | """ def isAromaticSmiles(smi): N = len(smi) for i in range(N): x = smi[i] if x == ":": return True ...
bsd-2-clause
jscn/django
django/db/backends/mysql/schema.py
19
4721
from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.models import NOT_PROVIDED class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s" sql_alter_column_null = "MODIFY %(column)s %(type)s NULL" sql_alter_column_...
bsd-3-clause
brightchen/Impala
tests/common/failure_injector.py
16
3806
# Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # Failure injection module for the Impala service. There are two main ways this module # can be used - the first is to initialize the failure injector and then call start() # which will kick off a timer that chooses a random impalad/state store process # to fai...
apache-2.0
shanot/imp
modules/rmf/test/test_geometry.py
2
3590
from __future__ import print_function import unittest import IMP.rmf import IMP.test import RMF from IMP.algebra import * class Tests(IMP.test.TestCase): def _assert_same(self, h0, h1): self.assertAlmostEqual(IMP.atom.get_mass(h0), IMP.atom.get_mass(h1), delta=1) se...
gpl-3.0
lowlevel86/wakefulness-forecaster
03_PlanRendezvous/genRendezvous.py
1
2962
import sys import datetime import time true = 1 false = 0 if len(sys.argv) != 5: print("This program creates a wake up schedule for catching an appointment.") print("Usage: ") print("python genRendezvous.py [date] [time] [minutes until end] [lengthen 'l' or shorten 's' sleep-wake cycle]") print("date format: yyyy-...
mit
botstory/todo-bot
todo/tasks/task_story_helper.py
1
1160
from botstory.ast import story_context from todo.tasks import tasks_document async def current_task(ctx): """ get current task from ctx :param ctx: :return: """ task_id = story_context.get_message_data(ctx, 'option', 'matches')[0] return await tasks_document.TaskDocument.objects.find_by_id...
mit
broferek/ansible
lib/ansible/modules/monitoring/zabbix/zabbix_maintenance.py
13
13569
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Alexander Bulimov <lazywolf0@gmail.com> # 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....
gpl-3.0
melecptp/trivial_pursuit_quiz
app.py
1
2745
# -*- coding:utf8 -*- # !/usr/bin/env python # Copyright 2017 Google 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...
apache-2.0
jjuanda/mechanize
test-tools/twisted-ftpserver.py
22
2670
import optparse import sys import twisted.cred.checkers import twisted.cred.credentials import twisted.cred.portal import twisted.internet import twisted.protocols.ftp from twisted.python import filepath, log from zope.interface import implements def make_ftp_shell(avatar_id, root_path): if avatar_id is twisted...
bsd-3-clause
yencarnacion/jaikuengine
.google_appengine/lib/django-1.4/tests/regressiontests/m2m_regress/models.py
43
1930
from django.contrib.auth import models as auth from django.db import models # No related name is needed here, since symmetrical relations are not # explicitly reversible. class SelfRefer(models.Model): name = models.CharField(max_length=10) references = models.ManyToManyField('self') related = models.ManyT...
apache-2.0
dakotabenjamin/watershed-monitor
visualization/js/OpenLayers-2.13/tools/exampleparser.py
131
7756
#!/usr/bin/env python import sys import os import re import time from xml.dom.minidom import Document try: import xml.etree.ElementTree as ElementTree except ImportError: try: import cElementTree as ElementTree except ImportError: try: import elementtree.ElementTree as Element...
gpl-2.0
NikNitro/Python-iBeacon-Scan
sympy/series/gruntz.py
9
21639
""" Limits ====== Implemented according to the PhD thesis http://www.cybertester.com/data/gruntz.pdf, which contains very thorough descriptions of the algorithm including many examples. We summarize here the gist of it. All functions are sorted according to how rapidly varying they are at infinity using the followin...
gpl-3.0
DuncanSungWKim/gtest-1.7.0
scripts/pump.py
2471
23673
#!/usr/bin/env python # # Copyright 2008, 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...
bsd-3-clause
jonathan-beard/edx-platform
lms/envs/devstack_optimized.py
44
1493
""" Settings to run LMS in devstack using optimized static assets. This configuration changes LMS to use the optimized static assets generated for testing, rather than picking up the files directly from the source tree. The following Paver command can be used to run LMS in optimized mode: paver devstack lms --opti...
agpl-3.0
primiano/depot_tools
third_party/boto/datapipeline/layer1.py
51
24236
# 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 without restriction, including # without limitation the rights ...
bsd-3-clause
chand3040/sree_odoo
openerp/addons/sale/sale.py
22
71069
# -*- 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
Novasoft-India/OperERP-AM-Motors
openerp/addons/hr_attendance/res_config.py
434
1406
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
arangodb/arangodb
3rdParty/V8/v7.9.317/test/inspector/testcfg.py
4
1726
# Copyright 2016 the V8 project 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 os from testrunner.local import testsuite from testrunner.local import utils from testrunner.objects import testcase from testrunner.outproc import...
apache-2.0
SteveHNH/ansible
lib/ansible/modules/system/iptables.py
16
22572
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2015, Linus Unnebäck <linus@folkdatorn.se> # 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_versi...
gpl-3.0
h8rift/htc8960-3.4
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (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, sys sys.path.append(os.env...
gpl-2.0
keras-team/keras-io
examples/nlp/semantic_similarity_with_bert.py
1
11604
""" Title: Semantic Similarity with BERT Author: [Mohamad Merchant](https://twitter.com/mohmadmerchant1) Date created: 2020/08/15 Last modified: 2020/08/29 Description: Natural Language Inference by fine-tuning BERT model on SNLI Corpus. """ """ ## Introduction Semantic Similarity is the task of determining how simila...
apache-2.0
ewandor/home-assistant
tests/components/sensor/test_rfxtrx.py
25
13917
"""The tests for the Rfxtrx sensor platform.""" import unittest import pytest from homeassistant.setup import setup_component from homeassistant.components import rfxtrx as rfxtrx_core from homeassistant.const import TEMP_CELSIUS from tests.common import get_test_home_assistant, mock_component @pytest.mark.skipif(...
apache-2.0
ylow/SFrame
oss_src/unity/python/sframe/meta/decompiler/__init__.py
6
2520
''' Decompiler module. This module can decompile arbitrary code objects into a python ast. ''' from .instructions import make_module, make_function import _ast import struct import time import sys import marshal def decompile_func(func): ''' Decompile a function into ast.FunctionDef node. :param...
bsd-3-clause
squidsolutions/hadoop-common
src/contrib/hod/hodlib/Common/allocationManagerUtil.py
182
1193
#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 use thi...
apache-2.0
slohse/ansible
test/sanity/code-smell/no-smart-quotes.py
28
1372
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import sys def main(): skip = set([ 'test/sanity/code-smell/%s' % os.path.basename(__file__), 'docs/docsite/rst/dev_guide/testing/sanity/no-smart-quotes.rst', 'test/integration/targets/unicode/unicode.yml', 'test/in...
gpl-3.0
palestar/medusa
ThirdParty/bullet-2.75/Extras/LibXML/regressions.py
360
12439
#!/usr/bin/python -u import glob, os, string, sys, thread, time # import difflib import libxml2 ### # # This is a "Work in Progress" attempt at a python script to run the # various regression tests. The rationale for this is that it should be # possible to run this on most major platforms, including those (such as # ...
mit
joshowen/django-allauth
allauth/socialaccount/providers/kakao/provider.py
4
1264
from allauth.account.models import EmailAddress from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class KakaoAccount(ProviderAccount): @property def properties(self): return self.account.extra_data['properties'] ...
mit
tdyas/pants
tests/python/pants_test/backend/jvm/tasks/test_jar_publish_integration.py
1
16213
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import re from pants.base.build_environment import get_buildroot from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest from pants.util.contextutil import...
apache-2.0
rbalda/neural_ocr
env/lib/python2.7/site-packages/django/views/generic/detail.py
65
6914
from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django.db import models from django.http import Http404 from django.utils.translation import ugettext as _ from django.views.generic.base import ContextMixin, TemplateResponseMixin, View class SingleObjectMixin(Conte...
mit
mandeepdhami/nova
nova/cells/weights/mute_child.py
44
2386
# Copyright (c) 2013 Rackspace Hosting # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
tuxfux-hlp-notes/python-batches
archieves/batch-64/09-modules/myenv/lib/python2.7/site-packages/django/http/__init__.py
98
1186
from django.http.cookie import SimpleCookie, parse_cookie from django.http.request import (HttpRequest, QueryDict, RawPostDataException, UnreadablePostError, build_request_repr) from django.http.response import ( HttpResponse, StreamingHttpResponse, FileResponse, HttpResponseRedirect, HttpResponsePermanentR...
gpl-3.0
TribeMedia/sky_engine
build/android/pylib/utils/timeout_retry_unittest.py
99
1149
# 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. """Unittests for timeout_and_retry.py.""" import unittest from pylib.utils import reraiser_thread from pylib.utils import timeout_retry class TestExcepti...
bsd-3-clause
badkiller/kernel_cubietruck
tools/perf/python/twatch.py
1565
1316
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
Velociraptor85/pyload
module/network/HTTPDownload.py
40
12093
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 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 prog...
gpl-3.0
yakky/django-localflavor
localflavor/us/forms.py
1
4819
""" USA-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select, CharField from django.utils.encoding import smart_text from django.u...
bsd-3-clause
ypkang/neon
neon/diagnostics/timing_decorators.py
13
9259
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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.o...
apache-2.0
YuepengGuo/backtrader
tests/test_ind_sumn.py
4
1680
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
gpl-3.0
rhyolight/nupic
tests/integration/nupic/opf/opf_checkpoint_test/experiments/backwards_compatibility/base.py
20
15012
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2012-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
agpl-3.0
stevehof/CouchPotatoServer
libs/guessit/transfo/guess_filetype.py
94
7514
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
CruGlobal/jenkins-job-builder
tests/builder/test_builder.py
11
1549
# vim: set fileencoding=utf-8 : # # - Copyright 2014 Guido Günther <agx@sigxcpu.org> # # 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
mith1979/ansible_automation
applied_python/applied_python/lib64/python2.7/site-packages/Crypto/Cipher/DES3.py
117
5130
# -*- coding: utf-8 -*- # # Cipher/DES3.py : DES3 # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, #...
apache-2.0
ckirby/django
tests/schema/tests.py
83
71412
import datetime import itertools import unittest from copy import copy from django.db import ( DatabaseError, IntegrityError, OperationalError, connection, ) from django.db.models import Model from django.db.models.deletion import CASCADE from django.db.models.fields import ( AutoField, BigIntegerField, Binary...
bsd-3-clause
osgcc/ryzom
ryzom/tools/build_gamedata/workspace/common/sky/process.py
3
2985
#!/usr/bin/python # # \file config.py # \brief Process configuration # \date 2010-08-27 17:02GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Process configuration. # # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/> # Copyright (C) 2010 Winch Gate Property Limited # # This p...
agpl-3.0
KuroeKurose/gem5
src/mem/ruby/system/WeightedLRUReplacementPolicy.py
21
2007
# # Copyright (c) 2013-2015 Advanced Micro Devices, Inc. # All rights reserved. # # For use for simulation and test purposes only # # 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 co...
bsd-3-clause
nesdis/djongo
tests/django_tests/tests/v21/tests/order_with_respect_to/base_tests.py
63
3418
""" The tests are shared with contenttypes_tests and so shouldn't import or reference any models directly. Subclasses should inherit django.test.TestCase. """ from operator import attrgetter class BaseOrderWithRespectToTests: # Hook to allow subclasses to run these tests with alternate models. Answer = None ...
agpl-3.0
rwl/PyCIM
CIM14/IEC61970/Core/ReportingGroup.py
1
5830
# Copyright (C) 2010-2011 Richard Lincoln # # 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, modify, merge, publish...
mit
ceache/treadmill
lib/python/treadmill/tests/sproc/export_reports_test.py
2
1302
"""Unit tests for treadmill.sproc.export_reports. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import io import unittest import mock # Disable W0611: Unused import import treadmill.tests.treadmill_test_skip_w...
apache-2.0
f0rk/sigdebug
sigdebug/__init__.py
1
1776
# Copyright 2011 Ryan P. Kelly <rpkelly@cpan.org> # # This code was inspired by this thread on stackoverflow: # http://stackoverflow.com/questions/132058/getting-stack-trace-from-a-running-python-application # # This code is BSD licensed, please see LICENSE for the full text. import sys import signal import traceback ...
bsd-2-clause
mswart/acme-mgmtserver
acmems/storages.py
1
2870
import os import os.path from hashlib import sha384 from datetime import datetime, timedelta from cryptography import x509 from cryptography.hazmat.backends import default_backend from acmems.config import ConfigurationError class StorageImplementor(): def __init__(self, type, name, options): self.type ...
gpl-3.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.7.2/Lib/test/test_hash.py
20
4652
# test the invariant that # iff a==b then hash(a)==hash(b) # # Also test that hash implementations are inherited as expected import unittest from test import test_support from collections import Hashable class HashEqualityTestCase(unittest.TestCase): def same_hash(self, *objlist): # Hash each object g...
mit
ujjvala-addsol/addsol_hr
openerp/addons/crm_partner_assign/wizard/crm_forward_to_partner.py
377
10606
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
sbuss/voteswap
lib/social/backends/eveonline.py
72
1413
""" EVE Online Single Sign-On (SSO) OAuth2 backend Documentation at https://developers.eveonline.com/resource/single-sign-on """ from social.backends.oauth import BaseOAuth2 class EVEOnlineOAuth2(BaseOAuth2): """EVE Online OAuth authentication backend""" name = 'eveonline' AUTHORIZATION_URL = 'https://log...
mit
arthurtyukayev/python-safer
safer/api.py
1
1255
from requests import Session SAFER_KEYWORD_URL = 'https://safer.fmcsa.dot.gov/keywordx.asp' SAFER_QUERY_URL = 'https://safer.fmcsa.dot.gov/query.asp' sess = Session() sess.headers.update({ 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate', 'Acc...
mit
tparks5/tor-stem
docs/conf.py
8
7803
# -*- coding: utf-8 -*- # # Stem documentation build configuration file, created by # sphinx-quickstart on Thu May 31 09:56:13 2012. # # 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...
lgpl-3.0
mykytamorachov/outpost
flask/lib/python2.7/site-packages/sqlalchemy/dialects/informix/informixdb.py
35
1963
# informix/informixdb.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Support for the informixdb DBAPI. informixdb is available at: http://...
gpl-2.0
bbbenja/SickRage
lib/hachoir_parser/image/gif.py
74
13877
""" GIF picture parser. Author: Victor Stinner, Robert Xiao - GIF format http://local.wasp.uwa.edu.au/~pbourke/dataformats/gif/ - LZW compression http://en.wikipedia.org/wiki/LZW """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, ParserError, Enum, UInt8, UInt16, Bit, Bits, N...
gpl-3.0
todatamining/textclassifiction
utility.py
1
3762
# -*- coding: utf-8 -*- # Author: HW <todatamining@gmail.com> # See LICENSE.txt for details. #!/usr/bin/env python import re import os import math import sys import pickle from nltk.stem.wordnet import WordNetLemmatizer import os.path,subprocess lmtzr = WordNetLemmatizer() this_dir,this_filename = os.path.split(os.pa...
gpl-2.0
derdmitry/socraticqs2
mysite/mysite/urls.py
1
1282
from django.conf.urls import patterns, include, url from django.apps import apps from mysite.views import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns( '', (r'^$', home_page), # Examples: # url(r'^$', 'mysite.views.h...
apache-2.0
gilneidp/FinalProject
ALL_FILES/pox/log/level.py
46
1439
# Copyright 2013 James McCauley # # 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 writi...
mit
Eficent/odoo-operating-unit
sale_stock_operating_unit/models/sale.py
1
2065
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Eficent (<http://www.eficent.com/>) # <contact@eficent.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
agpl-3.0
parthea/pydatalab
legacy_tests/kernel/utils_tests.py
2
10847
# Copyright 2015 Google 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 applicable law or agreed ...
apache-2.0
kevinmel2000/sl4a
python/src/Demo/scripts/find-uname.py
38
1212
#!/usr/bin/env python """ For each argument on the command line, look for it in the set of all Unicode names. Arguments are treated as case-insensitive regular expressions, e.g.: % find-uname 'small letter a$' 'horizontal line' *** small letter a$ matches *** LATIN SMALL LETTER A (97) COMBINING LATIN...
apache-2.0
peterbarker/ardupilot
Tools/ardupilotwaf/toolchain.py
12
4986
""" WAF Tool to select the correct toolchain based on the target archtecture. This tool loads compiler_c and compiler_cxx, so you don't need to load them (and you must not load them before this tool). Use the environment variable TOOLCHAIN to define the toolchain. Example:: def configure(cfg): cfg.env.TO...
gpl-3.0
fumen/gae-fumen
lib/jinja2/asyncfilters.py
217
4144
from functools import wraps from jinja2.asyncsupport import auto_aiter from jinja2 import filters async def auto_to_seq(value): seq = [] if hasattr(value, '__aiter__'): async for item in value: seq.append(item) else: for item in value: seq.append(item) return s...
bsd-3-clause
Geoportail-Luxembourg/geoportailv3
geoportal/geoportailv3_geoportal/lib/sw_helper.py
1
1302
import os import glob import time UNUSED = '/static-ngeo/UNUSED_CACHE_VERSION/build/' BUILD_PATH = '/app/geoportailv3_geoportal/static-ngeo/build' def get_built_filenames(pattern): return [os.path.basename(name) for name in glob.glob(BUILD_PATH + '/' + pattern)] def get_urls(request): main_js_url = UNUSED ...
mit
jeezybrick/django
django/contrib/gis/utils/layermapping.py
335
27300
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: https://docs.djangoproject.com/en/dev/ref/contrib/gi...
bsd-3-clause
mingwpy/scipy
scipy/interpolate/tests/test_fitpack.py
100
14248
from __future__ import division, print_function, absolute_import import os import numpy as np from numpy.testing import (assert_equal, assert_allclose, assert_, TestCase, assert_raises, run_module_suite, assert_almost_equal, assert_raises, assert_array_almost_equal) from numpy import array, asarray, pi, sin, ...
bsd-3-clause
WeblateOrg/weblate
weblate/trans/views/files.py
2
7110
# # Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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 Lice...
gpl-3.0
soldag/home-assistant
tests/components/openweathermap/test_config_flow.py
3
6775
"""Define tests for the OpenWeatherMap config flow.""" from pyowm.commons.exceptions import APIRequestError, UnauthorizedError from homeassistant import data_entry_flow from homeassistant.components.openweathermap.const import ( CONF_LANGUAGE, DEFAULT_FORECAST_MODE, DEFAULT_LANGUAGE, DOMAIN, ) from hom...
apache-2.0
wkfwkf/statsmodels
statsmodels/examples/ex_kernel_semilinear_dgp.py
33
4969
# -*- coding: utf-8 -*- """ Created on Sun Jan 06 09:50:54 2013 Author: Josef Perktold """ from __future__ import print_function if __name__ == '__main__': import numpy as np import matplotlib.pyplot as plt #from statsmodels.nonparametric.api import KernelReg import statsmodels.sandbox.nonparametr...
bsd-3-clause
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/lore/man2lore.py
3
5831
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """man2lore: Converts man page source (i.e. groff) into lore-compatible html. This is nasty and hackish (and doesn't support lots of real groff), but is good enough for converting fairly simple man pages. """ from __future__ import ne...
bsd-3-clause
sgml/popcorn_maker
vendor-local/lib/python/nose/pyversion.py
9
4634
""" This module contains fixups for using nose under different versions of Python. """ import sys import os import types import inspect import nose.util __all__ = ['make_instancemethod', 'cmp_to_key', 'sort_list', 'ClassType', 'TypeType', 'UNICODE_STRINGS', 'unbound_method', 'ismethod', 'bytes_']...
bsd-3-clause
gundalow/ansible-modules-extras
windows/win_iis_virtualdirectory.py
13
2511
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Henrik Wallström <henrik@wallstroms.nu> # # 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 t...
gpl-3.0
jmehnle/ansible
lib/ansible/parsing/dataloader.py
11
17987
# (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
jonparrott/gcloud-python
redis/synth.py
2
3080
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0