repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
JasonYao/SkullhouseNYU
letsEncrypt/Emailer.py
2
2667
import requests import secrets import os import datetime import subprocess __author__ = 'Jason Yao' def setup_logging(): log = "logs" if not os.path.exists(log): os.makedirs(log) date = datetime.datetime.now() log_file_name = "logs/" + date.strftime('%Y-%m-%d') + ".log" return open(log_...
gpl-2.0
ThinkOpen-Solutions/odoo
addons/crm_partner_assign/__openerp__.py
114
2453
# -*- 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
ZhaoCJ/django
tests/file_uploads/tests.py
3
17584
#! -*- coding: utf-8 -*- from __future__ import unicode_literals import base64 import errno import hashlib import json import os import shutil import tempfile as sys_tempfile import unittest from django.core.files import temp as tempfile from django.core.files.uploadedfile import SimpleUploadedFile from django.http.m...
bsd-3-clause
altairpearl/RIOT
dist/tools/cc2538-bsl/cc2538-bsl.py
2
42557
#!/usr/bin/env python2 # Copyright (c) 2014, Jelmer Tiete <jelmer@tiete.be>. # 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 ...
lgpl-2.1
alkyl1978/gnuradio
gr-blocks/python/blocks/qa_hier_block2.py
21
16253
#!/usr/bin/env python from gnuradio import gr, gr_unittest, blocks import numpy import time class add_ff(gr.sync_block): def __init__(self): gr.sync_block.__init__( self, name = "add_ff", in_sig = [numpy.float32, numpy.float32], out_sig = [numpy.float32], ...
gpl-3.0
Karel-van-de-Plassche/bokeh
bokeh/command/subcommands/tests/test_svg.py
6
5078
from __future__ import absolute_import import argparse import pytest import os import sys is_python2 = sys.version_info[0] == 2 import bokeh.command.subcommands.svg as scsvg from bokeh.command.bootstrap import main from bokeh.util.testing import TmpDir, WorkingDir, with_directory_contents from . import basic_svg_sc...
bsd-3-clause
comocheng/RMG-Py
rmgpy/cantherm/output.py
11
6891
#!/usr/bin/env python # encoding: utf-8 ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the # RMG Team (rmg_dev@mit.edu) # # Permission is hereby granted, free of cha...
mit
beeftornado/sentry
tests/snuba/snuba/test_query_subscription_consumer.py
1
7108
from __future__ import absolute_import from copy import deepcopy from datetime import timedelta from uuid import uuid4 import pytz from confluent_kafka import Producer from dateutil.parser import parse as parse_date from django.conf import settings from django.test.utils import override_settings from exam import fixt...
bsd-3-clause
ghchinoy/tensorflow
tensorflow/python/training/coordinator.py
36
18001
# 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
boberfly/gaffer
python/GafferVDBTest/__init__.py
7
2212
########################################################################## # # Copyright (c) 2017, Image Engine Design 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: # # * Redistrib...
bsd-3-clause
karban/agros2d
resources/python/logilab/common/daemon.py
3
6267
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
gpl-2.0
shenhzou654321/TDDDemo
pythonNotes/sort.py
2
1901
# sort three num count=0 print 'please input three num for sort' while count <3: print 'please input num%d'%(count+1) input=raw_input('num%d='%(count+1)) if input.isdigit()==False: print 'input error, not a num' continue count+=1 if count==1: num1=input #print 'num1 is',num1 elif count==2: num2=inpu...
mit
TridevGuha/django
tests/model_regress/tests.py
326
8962
from __future__ import unicode_literals import datetime from operator import attrgetter from django.core.exceptions import ValidationError from django.db import router from django.db.models.sql import InsertQuery from django.test import TestCase, skipUnlessDBFeature from django.utils import six from django.utils.time...
bsd-3-clause
google/ci_edit
app/program_window.py
1
16356
# Copyright 2018 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 or agreed to in writing, ...
apache-2.0
ImreToth/XWaves
frontend/src/main/frontend/node/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py
1825
17014
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
gpl-3.0
samsu/neutron
plugins/vmware/common/securitygroups.py
36
5218
# Copyright 2013 VMware, 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 a...
apache-2.0
saurabh6790/frappe
frappe/recorder.py
1
4779
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from collections import Counter import datetime import inspect import json import re import time import frappe import sqlparse from frappe import _ RECOR...
mit
rgeoghegan/pycco
pycco/main.py
1
18920
#!/usr/bin/env python """ "**Pycco**" is a Python port of [Docco](http://jashkenas.github.com/docco/): the original quick-and-dirty, hundred-line-long, literate-programming-style documentation generator. It produces HTML that displays your comments alongside your code. Comments are passed through [Markdown](http://dar...
mit
vivekananda/fbeats
django/contrib/flatpages/forms.py
79
1727
from django import forms from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext, ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', help_text = _("...
bsd-3-clause
smartscheduling/scikit-learn-categorical-tree
examples/applications/plot_model_complexity_influence.py
323
6372
""" ========================== Model Complexity Influence ========================== Demonstrate how model complexity influences both prediction accuracy and computational performance. The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for regression (resp. classification). For each class of models we m...
bsd-3-clause
andykimpe/chromium-test-npapi
tools/cr/cr/actions/gyp.py
59
1257
# 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. """A module to add gyp support to cr.""" import cr import os GYP_DEFINE_PREFIX = 'GYP_DEF_' class GypPrepareOut(cr.PrepareOut): """A prepare action that...
bsd-3-clause
keedio/hue
desktop/core/ext-py/Django-1.6.10/tests/model_inheritance_same_model_name/tests.py
58
1517
from __future__ import absolute_import from django.test import TestCase from model_inheritance.models import Title class InheritanceSameModelNameTests(TestCase): def setUp(self): # The Title model has distinct accessors for both # model_inheritance.Copy and model_inheritance_same_model_name.Cop...
apache-2.0
pieter-lazzaro/packer
scripts/sort-md-list.py
31
2144
#!/usr/bin/env python """ sort-md-list.py sorts markdown lists Use this script to prepare sections of the changelog. this script expects a bulleted markdown list in stdout for example ./sort-md-list.py - <<EOF * builder/amazon: Only delete temporary key if we created one. [GH-4850] * core: Correctly reject config f...
mpl-2.0
LearnEra/LearnEraPlaftform
common/djangoapps/course_action_state/managers.py
25
5737
""" Model Managers for Course Actions """ import traceback from django.db import models, transaction class CourseActionStateManager(models.Manager): """ An abstract Model Manager class for Course Action State models. This abstract class expects child classes to define the ACTION (string) field. """ ...
agpl-3.0
jaehyuk/bds-files
chapter-11-alignment/alnstat/alnstat.py
9
1169
import sys import pysam from collections import Counter if len(sys.argv) < 2: sys.exit("usage: alnstat.py in.bam") fname = sys.argv[1] mode = "rb" if fname.endswith(".bam") else "r" bamfile = pysam.AlignmentFile(fname, mode) stats = Counter() for read in bamfile: stats["total"] += 1 stats['qcfail'] += in...
mit
PaulWay/spacewalk
scripts/datasource-query-usage.py
20
2089
#!/usr/bin/python # # Copyright (c) 2008 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have ...
gpl-2.0
openilabs/falconlab
env/lib/python2.7/site-packages/tests/test_error_handlers.py
1
3233
import json import falcon import falcon.testing as testing def capture_error(ex, req, resp, params): resp.status = falcon.HTTP_723 resp.body = 'error: %s' % str(ex) def handle_error_first(ex, req, resp, params): resp.status = falcon.HTTP_200 resp.body = 'first error handler' class CustomBaseExcep...
mit
Distrotech/intellij-community
python/helpers/pydev/pydevd_reload.py
54
16015
""" Based on the python xreload. Changes ====================== 1. we don't recreate the old namespace from new classes. Rather, we keep the existing namespace, load a new version of it and update only some of the things we can inplace. That way, we don't break things such as singletons or end up with a second repres...
apache-2.0
TheTimmy/spack
var/spack/repos/builtin/packages/py-fastaindex/package.py
3
1696
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
kpanic/lymph
iris/events/simple.py
1
1201
from iris.core.interfaces import Interface from iris.core.decorators import rpc from iris.events.base import BaseEventSystem from iris.core.events import Event class SimpleBrokerClient(Interface): service_type = 'simple_broker_client' register_with_coordinator = False @rpc() def event(self, channel, ...
apache-2.0
outboxafrica/pimaa
PiMaa/sensors/lib/GrovePi/setup.py
3
1891
#!/usr/bin/python #!/usr/bin/env python # # GrovePi Python Setup # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi # # Have a question about this example? Ask on the forums here: http://forum.dexterindustries.com/c/grovepi # '...
gpl-3.0
bigdataelephants/scikit-learn
sklearn/preprocessing/label.py
8
28313
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # Joel Nothman <joel.nothman@gmail.com> # Hamzeh Alsalhi <ha258@cornell.edu> # Licens...
bsd-3-clause
cloudera/hue
desktop/core/ext-py/vine-1.2.0/t/unit/test_promises.py
2
9202
from __future__ import absolute_import, unicode_literals import pytest import sys import traceback from collections import deque from struct import pack, unpack import weakref from case import Mock from vine.funtools import wrap from vine.promises import promise class test_promise: def test_example(self): ...
apache-2.0
icloudrnd/automation_tools
openstack_dashboard/api/vpn.py
44
14830
# Copyright 2013, Mirantis 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 agre...
apache-2.0
mmeslab/linux-nctusde
tools/perf/python/twatch.py
7370
1334
#! /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
0jpq0/kbengine
kbe/src/lib/python/Lib/email/parser.py
86
5045
# Copyright (C) 2001-2007 Python Software Foundation # Author: Barry Warsaw, Thomas Wouters, Anthony Baxter # Contact: email-sig@python.org """A parser of RFC 2822 and MIME email messages.""" __all__ = ['Parser', 'HeaderParser', 'BytesParser', 'BytesHeaderParser', 'FeedParser', 'BytesFeedParser'] from io ...
lgpl-3.0
tswast/google-cloud-python
bigquery/tests/unit/test_job.py
1
231908
# Copyright 2015 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
TechBK/horizon-dev
openstack_dashboard/dashboards/project/networks/subnets/workflows.py
21
8306
# Copyright 2013 NEC Corporation # # 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 ag...
apache-2.0
onitake/ansible
lib/ansible/modules/cloud/webfaction/webfaction_db.py
51
5879
#!/usr/bin/python # # (c) Quentin Stafford-Fraser 2015, with contributions gratefully acknowledged from: # * Andy Baker # * Federico Tarantini # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # # Create a webfaction database using Ansible and the Webfaction API fro...
gpl-3.0
zodiac/incubator-airflow
tests/ti_deps/deps/not_in_retry_period_dep.py
20
2129
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
jgoclawski/django
django/template/context_processors.py
204
2465
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the 'context_processors' option of the configuration of a DjangoTemplates backend and use...
bsd-3-clause
MahmoudAbdelRahman/GH_CPython
GrasshopperSyntax/plane.py
1
14477
def DistanceToPlane(plane, point): """Returns the distance from a 3D point to a plane Parameters: plane (plane): the plane point (point): List of 3 numbers or Point3d Returns: number: The distance if successful, otherwise None Example: import rhinoscriptsyntax as rs ...
bsd-2-clause
googlemaps/property-finder
realty/admin.py
1
1926
# Copyright 2017 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 or agreed to in wr...
apache-2.0
walter79/android_kernel_sony_tsubasa
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
gabrielfalcao/lettuce
tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/localflavor/fi.py
40
16282
from django.contrib.localflavor.fi.forms import (FIZipCodeField, FISocialSecurityNumber, FIMunicipalitySelect) from utils import LocalFlavorTestCase class FILocalFlavorTests(LocalFlavorTestCase): def test_FIMunicipalitySelect(self): f = FIMunicipalitySelect() out = u'''<select name="municipal...
gpl-3.0
nvoron23/hue
desktop/core/ext-py/guppy-0.1.10/guppy/etc/tkcursors.py
37
1607
#._cv_part guppy.etc.tkcursors # A Tk window that shows what cursor shapes are available. # Moving the mouse over the cursor name shows the cursor in that shape. from Tkinter import * def tkcursors(master=None): if master is None: root = Tk() else: root = master for i, cursor in enumerate(( 'X_cursor'...
apache-2.0
nvlsianpu/mbed
tools/host_tests/wait_us_auto.py
122
2871
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
crunchmail/munch-core
src/munch/apps/tracking/tests.py
1
14581
import logging from unittest.mock import patch from datetime import timedelta from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from libfaketime import fake_time from munch.apps.campaigns.models import Mail from munch.apps.campaigns.models import MailSt...
agpl-3.0
Alwnikrotikz/pyglet
contrib/layout/layout/Plex/Lexicons.py
32
6217
#======================================================================= # # Python Lexical Analyser # # Lexical Analyser Specification # #======================================================================= import types import Actions import DFA import Errors import Machines import Regexps # debug_flags for ...
bsd-3-clause
wlamond/scikit-learn
examples/manifold/plot_manifold_sphere.py
89
5055
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================= Manifold Learning methods on a severed sphere ============================================= An application of the different :ref:`manifold` techniques on a spherical data-set. Here one can see the use of dimensionality reducti...
bsd-3-clause
epiphany27/NewsBlur
apps/rss_feeds/migrations/0064_active_subs_index.py
18
6286
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding index on 'Feed', fields ['active_subscribers'] db.create_index('feeds', ['active_subscribers']) ...
mit
ppwwyyxx/tensorflow
tensorflow/lite/python/convert.py
3
21556
# Lint as: python2, python3 # Copyright 2018 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 # ...
apache-2.0
CubicERP/odoo
addons/base_vat/base_vat.py
1
13148
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
savoirfairelinux/OpenUpgrade
openerp/openupgrade/openupgrade_70.py
21
2572
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Sylvain LE GAL # (C) 2013 Therp BV # # This program is free software: you can redistribute it and/or modify # it unde...
agpl-3.0
coolhacks/python-hacks
examples/requests/requests/packages/urllib3/filepost.py
713
2320
from __future__ import absolute_import import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_b...
mit
sputnick-dev/weboob
modules/bp/browser.py
4
7905
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Nicolas Duhamel # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
agpl-3.0
riaqn/imdb-report
sql2json.py
1
1092
import sqlite3 db = sqlite3.connect('im.db'); db.row_factory = sqlite3.Row cur = db.execute('select * from movie;'); movies = []; import json convert = {}; import csv with open('convert.csv', newline='') as csvfile: spamreader = csv.reader(csvfile) for row in spamreader: convert[int(row[0])] = float(r...
mit
fnordahl/nova
nova/tests/functional/api_sample_tests/test_networks_associate.py
17
3190
# Copyright 2012 Nebula, Inc. # Copyright 2014 IBM Corp. # # 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...
apache-2.0
yantrabuddhi/opencog
opencog/python/test_atomspace/opencog/cogserver.py
34
1174
__author__ = 'Keyvan' class MindAgent(object): def run(self, atomspace): pass class Request(object): def __init__(self): pass def run(self, args=[], atomspace=None): self.send("This is the default python request.") def send(self, msg): print str(msg)...
agpl-3.0
jhjguxin/PyCDC
Karrigell-2.3.5/modules/mod_ks.py
1
2530
import os, sys import tokenize from k_script import BaseScript, ParseError, HTTP_ERROR from k_encodings import k_encoding import urllib class Error: def __init__(self,msg,errorLine): self.msg = msg self.errorLine = errorLine class Script(BaseScript): """Karrigell Service""" def __init__(...
gpl-3.0
madelynfreed/rlundo
venv/lib/python2.7/site-packages/IPython/core/compilerop.py
30
5904
"""Compiler tools with improved interactive support. Provides compilation machinery similar to codeop, but with caching support so we can provide interactive tracebacks. Authors ------- * Robert Kern * Fernando Perez * Thomas Kluyver """ # Note: though it might be more natural to name this module 'compiler', that # ...
gpl-3.0
teeple/pns_server
work/install/node-v0.10.25/tools/gyp/pylib/gyp/MSVSVersion.py
486
15539
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
gpl-2.0
louishust/mysql5.6.14_tokudb
storage/tokudb/mysql-test/suite/tokudb/t/change_column_all.py
68
7599
import sys import random import string import re class Field: def __init__(self, name, is_nullible): self.name = name self.is_nullible = is_nullible class Field_int(Field): sizes = [ 1, 2, 3, 4, 8 ] types = [ "TINYINT", "SMALLINT", "MEDIUMINT", "INT", "BIGINT" ] uint_ranges = [ (0,(1<<...
gpl-2.0
jobiols/server-tools
auth_brute_force/__openerp__.py
16
1632
# -*- encoding: utf-8 -*- ############################################################################## # # Tracks Authentication Attempts and Prevents Brute-force Attacks module # Copyright (C) 2015-Today GRAP (http://www.grap.coop) # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # # This prog...
agpl-3.0
marrocamp/Veil-Framework-Veil-Evasion
modules/payloads/powershell/meterpreter/rev_tcp.py
6
2877
""" Custom-written pure powershell meterpreter/reverse_tcp stager. Module @harmj0y """ from modules.common import helpers class Payload: def __init__(self): # required options self.description = "pure windows/meterpreter/reverse_tcp stager, no shellcode" self.rating = "Excellent" ...
gpl-3.0
julien78910/CouchPotatoServer
couchpotato/core/media/_base/providers/nzb/nzbindex.py
16
4682
import re import time from bs4 import BeautifulSoup from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.rss import RSS from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog from couchpotato.core.event import fireEvent from couchpotato.core.medi...
gpl-3.0
cactusbin/nyt
matplotlib/examples/event_handling/trifinder_event_demo.py
7
1771
""" Example showing the use of a TriFinder object. As the mouse is moved over the triangulation, the triangle under the cursor is highlighted and the index of the triangle is displayed in the plot title. """ import matplotlib.pyplot as plt from matplotlib.tri import Triangulation from matplotlib.patches import Polygon...
unlicense
raghavrv/scikit-learn
sklearn/cluster/spectral.py
11
19173
# -*- coding: utf-8 -*- """Algorithms for spectral clustering""" # Author: Gael Varoquaux gael.varoquaux@normalesup.org # Brian Cheung # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import check_rand...
bsd-3-clause
samrocketman/proxytester
src/proxytester.py
1
7739
#!/usr/bin/env python ''' Created Dec 1, 2009 Main driver for application Author: Sam Gleske ''' import socket,sys,os.path,eventlet,binascii,urllib2,re from lib import * from time import sleep from time import ctime from sys import exit proxyRegEx=re.compile("([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3...
mit
yceruto/merchant
billing/utils/credit_card.py
1
3828
import re import datetime class InvalidCard(Exception): pass class CardNotSupported(Exception): pass class CreditCard(object): # The regexp attribute should be overriden by the subclasses. # Attribute value should be a regexp instance regexp = None # Has to be set by the user after calling...
bsd-3-clause
GLolol/Cinnamon
files/usr/lib/cinnamon-menu-editor/cme/util.py
21
6349
# -*- coding: utf-8 -*- # Alacarte Menu Editor - Simple fd.o Compliant Menu Editor # Copyright (C) 2006 Travis Watkins # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either...
gpl-2.0
cloudera/hue
desktop/core/ext-py/django-webpack-loader-1.0.0/setup.py
2
1637
import os import re from setuptools import setup def rel(*parts): '''returns the relative path to a file wrt to the current directory''' return os.path.abspath(os.path.join(os.path.dirname(__file__), *parts)) README = open('README.md', 'r').read() with open(rel('webpack_loader', '__init__.py')) as handler:...
apache-2.0
Kraxi/YTplaylist
venv/Lib/site-packages/werkzeug/formparser.py
295
21205
# -*- coding: utf-8 -*- """ werkzeug.formparser ~~~~~~~~~~~~~~~~~~~ This module implements the form parsing. It supports url-encoded forms as well as non-nested multipart uploads. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more deta...
gpl-2.0
openpolis/open_municipio
open_municipio/acts/migrations/0015_auto__add_field_transition_institution.py
1
44499
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Transition.institution' db.add_column(u'acts_transition',...
agpl-3.0
rxl194/18-327-wavelets-filter-banks
tools/kompresni.py
2
8583
## kompresni.py ## This is an example of using Wavelets to decompose an image ## using Python libraries numpy, scipy, PyWavelets ## ## ## main reference that inspired me was this webpage: ## http://kastnerkyle.github.io/blog/2014/04/17/wavelets/ ## ## ################################################################...
mit
romulocollopy/quokka
quokka/core/admin/fields.py
10
2973
# coding: utf-8 import random import sys from werkzeug.datastructures import FileStorage from flask import current_app from flask.ext.admin import form from flask.ext.admin.form.upload import ImageUploadInput from flask.ext.admin._compat import urljoin from quokka.core.models import SubContent, SubContentPurpose from...
mit
catchmrbharath/servo
tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-recovery-worker.py
143
1067
def main(request, response): # Set mode to 'init' for initial fetch. mode = 'init' if 'update-recovery-mode' in request.cookies: mode = request.cookies['update-recovery-mode'].value # no-cache itself to ensure the user agent finds a new version for each update. headers = [('Cache-Control', ...
mpl-2.0
cespare/pastedown
vendor/pygments/pygments/lexers/functional.py
3
108971
# -*- coding: utf-8 -*- """ pygments.lexers.functional ~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for functional languages. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, bygroups, incl...
mit
quickresolve/accel.ai
flask-aws/lib/python2.7/site-packages/sqlalchemy/sql/schema.py
22
134852
# sql/schema.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """The schema module provides the building blocks for database metadata. Each element...
mit
scottferg/web-console
django/contrib/contenttypes/management.py
12
2518
from django.contrib.contenttypes.models import ContentType from django.db.models import get_apps, get_models, signals from django.utils.encoding import smart_unicode def update_contenttypes(app, created_models, verbosity=2, **kwargs): """ Creates content types for models in the given app, removing any mo...
bsd-3-clause
instana/python-sensor
instana/log.py
1
2320
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2016 from __future__ import print_function import os import sys import logging logger = None def get_standard_logger(): """ Retrieves and configures a standard logger for the Instana package @return: Logger """ standard_logger = loggin...
mit
dims/cinder
cinder/tests/unit/volume/drivers/emc/scaleio/test_create_volume.py
12
4916
# Copyright (c) 2013 - 2015 EMC Corporation. # 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 # # Unle...
apache-2.0
coblo/isccbench
iscc_bench/shortid/shortid.py
1
3461
# -*- coding: utf-8 -*- import math import os from loguru import logger as log import varint import iscc from iscc_bench.shortid import bech32 from iscc_bench.shortid.utils import ( iscc_decode, HEAD_SID_PU, HEAD_SID_CB, b58i_encode, b58i_decode, ) def short_id(code: str, chain: bytes = HEAD_SID_P...
bsd-2-clause
you21979/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/to_be_moved/update_webgl_conformance_tests_unittest.py
120
4192
# Copyright (C) 2010 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 of conditions and the ...
bsd-3-clause
pvital/patchew
mod.py
2
10304
#!/usr/bin/env python3 # # Copyright 2016 Red Hat, Inc. # # Authors: # Fam Zheng <famz@redhat.com> # # This work is licensed under the MIT License. Please see the LICENSE file or # http://opensource.org/licenses/MIT. import imp import os import sys from django.conf import settings from django.template import Temp...
mit
jzoldak/edx-platform
common/djangoapps/third_party_auth/api/permissions.py
96
1032
""" Third party auth API related permissions """ from rest_framework import permissions from third_party_auth.models import ProviderApiPermissions class ThirdPartyAuthProviderApiPermission(permissions.BasePermission): """ Allow someone to access the view if they have valid OAuth client credential. """ ...
agpl-3.0
ujenmr/ansible
lib/ansible/modules/cloud/azure/azure_rm_devtestlab.py
16
9586
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, <zikalino@microsoft.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.1', ...
gpl-3.0
ptisserand/ansible
lib/ansible/modules/system/getent.py
104
3914
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Brian Coca <brian.coca+dev@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_versi...
gpl-3.0
dav1x/ansible
lib/ansible/modules/network/ordnance/ordnance_config.py
22
12932
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
faust64/ansible
lib/ansible/modules/cloud/cloudstack/cs_zone.py
48
11349
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
forseti-security/forseti-security
tests/services/test_models.py
1
9825
# Copyright 2017 The Forseti Security Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
apache-2.0
auready/django
tests/template_tests/filter_tests/test_urlize.py
65
15405
from django.template.defaultfilters import urlize from django.test import SimpleTestCase from django.utils.functional import lazy from django.utils.safestring import mark_safe from ..utils import setup class UrlizeTests(SimpleTestCase): @setup({'urlize01': '{% autoescape off %}{{ a|urlize }} {{ b|urlize }}{% en...
bsd-3-clause
snapcore/snapcraft
tests/unit/plugins/v1/test_dotnet.py
2
9340
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2017-2018-2020 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distribute...
gpl-3.0
VeNoMouS/Sick-Beard
lib/cherrypy/lib/cpstats.py
2
22932
"""CPStats, a package for collecting and reporting on program statistics. Overview ======== Statistics about program operation are an invaluable monitoring and debugging tool. Unfortunately, the gathering and reporting of these critical values is usually ad-hoc. This package aims to add a centralized place for gather...
gpl-3.0
jlmurphy3rd/code-outhouse
PythonIngest/src/root/nested/BeautifulSoup-lib.py
59
79378
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses a (possibly invalid) XML or HTML document into a tree representation. It provides methods and Pythonic idioms that make it easy to navigate, search, and modify the tree. A well-formed X...
mit
halberom/ansible
lib/ansible/modules/storage/netapp/netapp_e_storagepool.py
45
39823
#!/usr/bin/python # (c) 2016, NetApp, Inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
huchoi/edx-platform
common/lib/xmodule/xmodule/tests/rendering/core.py
55
3311
""" This module is indended to provide a pluggable way to add assertions about the rendered content of XBlocks. For each view on the XBlock, this module defines a @singledispatch function that can be used to test the contents of the rendered html. The functions are of the form: @singledispatch def assert_stu...
agpl-3.0
sjshank/spotEmployee
node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
1509
17165
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
epl-1.0
adam-iris/mailman
src/mailman/mta/decorating.py
2
1704
# Copyright (C) 2009-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
gpl-3.0
NEKTech-Labs/NEKTech-Linux
tools/perf/python/twatch.py
3213
1338
#! /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