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
kit-tm/Labs
03_SDN/pox/pox/lib/packet/rip.py
47
6250
# Copyright 2012 James McCauley # Copyright 2008 (C) Nicira, 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 ap...
bsd-2-clause
camilonova/django
tests/admin_views/models.py
8
24291
import datetime import os import tempfile import uuid from django.contrib.auth.models import User from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError from django.core.fil...
bsd-3-clause
glogiotatidis/mopidy
tests/test_ext.py
3
7484
from __future__ import absolute_import, unicode_literals import mock import pkg_resources import pytest from mopidy import config, exceptions, ext from tests import IsA, any_unicode class TestExtension(ext.Extension): dist_name = 'Mopidy-Foobar' ext_name = 'foobar' version = '1.2.3' def get_defa...
apache-2.0
openprivacy/.emacs.d
elpy/rpc-venv/lib/python3.8/site-packages/pip/_vendor/cachecontrol/serialize.py
28
7091
import base64 import io import json import zlib from pip._vendor import msgpack from pip._vendor.requests.structures import CaseInsensitiveDict from .compat import HTTPResponse, pickle, text_type def _b64_decode_bytes(b): return base64.b64decode(b.encode("ascii")) def _b64_decode_str(s): return _b64_decod...
gpl-2.0
indevgr/django
django/db/migrations/serializer.py
11
14737
from __future__ import unicode_literals import collections import datetime import decimal import functools import math import types from importlib import import_module from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.utils import COMPILED_REGEX_TYPE, Re...
bsd-3-clause
venkatkorapaty/Regex
regex_functions.py
1
12678
""" # Copyright Nick Cheng, Brian Harrington, Danny Heap, Venkat Korapaty, # 2013, 2014, 2015 # Distributed under the terms of the GNU General Public License. # # This file is part of Assignment 2, CSCA48, Winter 2015 # # This is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
gpl-2.0
xzturn/tensorflow
tensorflow/python/kernel_tests/template_test.py
2
29334
# 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
ibrahimkarahan/Flexget
flexget/plugins/plugin_verbose.py
23
2318
from __future__ import unicode_literals, division, absolute_import import logging from flexget import options, plugin from flexget.event import event from flexget.task import log as task_log from flexget.utils.log import log_once log = logging.getLogger('verbose') class Verbose(object): """ Verbose entry a...
mit
dlakata/linear-algebra
app/lib/matrix.py
3
16867
from itertools import izip class MatrixException(Exception): pass class Matrix(object): """Python matrix representation""" @staticmethod def matrix_check(t): """Checks whether an input list can be turned into a matrix object""" if not any(isinstance(l, list) for l in t): ...
gpl-3.0
cle1109/scot
scot/eegtopo/warp_layout.py
4
4309
# Released under The MIT License (MIT) # http://opensource.org/licenses/MIT # Copyright (c) 2015 Martin Billinger """ Summary ------- Provides functions to warp electrode layouts. """ import numpy as np import scipy as sp def warp_locations(locations, y_center=None, return_ellipsoid=False, verbose=False): """ W...
mit
HackerTool/vivisect
vivisect/analysis/generic/switchcase.py
6
5920
''' Analysis plugin for supporting WorkspaceEmulators during analysis pass. Finds and connects Switch Cases, most specifically from Microsoft. ''' import envi import envi.archs.i386 as e_i386 import vivisect import vivisect.analysis.generic.codeblocks as vagc def analyzeJmp(amod, emu, op, starteip): ''' Top ...
apache-2.0
wldtw2008/tqdb
tools/for_web/cgi-bin/i1min_readstatus.py
1
1150
#!/usr/bin/python import time import sys import time import datetime from socket import socket from cassandra.cluster import Cluster import os import subprocess import json szCassIP1="127.0.0.1" szCassDB="tqdb1" importTicket="" querystrings=os.environ.get("QUERY_STRING", "NA=NA") mapQS={} for qs in querystrings.spli...
apache-2.0
hernangigena/corredor_django
base/migrations/0001_initial.py
1
1125
# -*- 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 model 'Code' db.create_table(u'base_code', ( (u'id', self.gf('django.db.models.fields.A...
bsd-3-clause
jlspyaozhongkai/Uter
third_party_backup/Python-2.7.9/Lib/hotshot/__init__.py
215
2670
"""High-perfomance logging profiler, mostly written in C.""" import _hotshot from _hotshot import ProfilerError from warnings import warnpy3k as _warnpy3k _warnpy3k("The 'hotshot' module is not supported in 3.x, " "use the 'profile' module instead.", stacklevel=2) class Profile: def __init__(self, logf...
gpl-3.0
haniehrajabi/ryu
ryu/lib/of_config/generated_classes.py
56
5142
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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:...
apache-2.0
bzhtux/RaccoonArtifactsManager
migrations/env.py
127
2884
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig import logging # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config ...
mit
eugena/django
django/core/signing.py
255
7151
""" Functions for creating and restoring url-safe signed JSON objects. The format used looks like this: >>> signing.dumps("hello") 'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk' There are two components here, separated by a ':'. The first component is a URLsafe base64 encoded JSON of the object passed to dumps(). T...
bsd-3-clause
YYWen0o0/python-frame-django
tests/mail/tests.py
9
45775
# -*- coding: utf-8 -*- from __future__ import unicode_literals import asyncore from email.mime.text import MIMEText import os import shutil import smtpd import sys import tempfile import threading from smtplib import SMTPException from ssl import SSLError from django.core import mail from django.core.mail import (Em...
bsd-3-clause
jemekite/p2pool-deepcoin
SOAPpy/Config.py
289
7622
""" ################################################################################ # Copyright (c) 2003, Pfizer # Copyright (c) 2001, Cayce Ullman. # Copyright (c) 2001, Brian Matthews. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provid...
gpl-3.0
sstoma/CellProfiler
cellprofiler/modules/trackobjects.py
1
137657
from cellprofiler.gui.help import USING_METADATA_HELP_REF, USING_METADATA_GROUPING_HELP_REF, LOADING_IMAGE_SEQ_HELP_REF TM_OVERLAP = 'Overlap' TM_DISTANCE = 'Distance' TM_MEASUREMENTS = 'Measurements' TM_LAP = "LAP" TM_ALL = [TM_OVERLAP, TM_DISTANCE, TM_MEASUREMENTS,TM_LAP] LT_NONE = 0 LT_PHASE_1 = 1 LT_SPLIT = 2 LT_...
gpl-2.0
TangXT/edx-platform
common/djangoapps/student/migrations/0023_add_test_center_registration.py
183
19003
# -*- 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 model 'TestCenterRegistration' db.create_table('student_testcenterregistration', ( ('id...
agpl-3.0
SerialShadow/SickRage
lib/bs4/tests/test_tree.py
292
70169
# -*- coding: utf-8 -*- """Tests for Beautiful Soup's tree traversal methods. The tree traversal methods are the main advantage of using Beautiful Soup over just using a parser. Different parsers will build different Beautiful Soup trees given the same markup, but all Beautiful Soup trees can be traversed with the me...
gpl-3.0
m110/drpython
tests/test_board.py
1
6158
#!/usr/bin/env python2 import os import sys import copy import unittest sys.path.append(os.path.join(os.path.dirname(__file__), '../')) from drpython import board from drpython.board import Board from drpython.block import Color from drpython.exceptions import * from drpython.utils import Pos class BoardTest(unitte...
gpl-2.0
nicko96/Chrome-Infra
infra_libs/event_mon/router.py
1
4771
# 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. import logging import random import time import httplib2 from infra_libs.event_mon.log_request_lite_pb2 import LogRequestLite from infra_libs.event_mon.chr...
bsd-3-clause
ojengwa/talk
venv/lib/python2.7/site-packages/django/middleware/common.py
52
7351
import hashlib import logging import re import warnings from django.conf import settings from django.core.mail import mail_managers from django.core import urlresolvers from django import http from django.utils.deprecation import RemovedInDjango18Warning from django.utils.encoding import force_text from django.utils.h...
mit
woodrow-shen/ycmd
ycmd/request_wrap.py
28
3720
#!/usr/bin/env python # # Copyright (C) 2014 Google Inc. # # YouCompleteMe 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. # # YouCompl...
gpl-3.0
caotianwei/django
django/contrib/postgres/forms/array.py
258
6743
import copy from django import forms from django.contrib.postgres.validators import ( ArrayMaxLengthValidator, ArrayMinLengthValidator, ) from django.core.exceptions import ValidationError from django.utils import six from django.utils.safestring import mark_safe from django.utils.translation import string_concat,...
bsd-3-clause
versusvoid/ugly-nlp-magic
partition.py
1
6044
#!/usr/bin/env python import operator from pattern_position import * def log(args): if type(args) == list: print() print(*args, sep='\n') print() else: print(args) debug_enabled = False def debug(args): if debug_enabled: log(args) info_enabled = False def info(args): ...
apache-2.0
ansat/genidea
lib/flask/signals.py
783
2140
# -*- coding: utf-8 -*- """ flask.signals ~~~~~~~~~~~~~ Implements signals based on blinker if available, otherwise falls silently back to a noop :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ signals_available = False try: from blinker import Name...
apache-2.0
danakj/chromium
infra/scripts/legacy/scripts/slave/build_directory.py
33
2117
# Copyright (c) 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. """Functions for discovering and clearing the build directory.""" import os import sys def IsFileNewerThanFile(file_a, file_b): """Returns True if f...
bsd-3-clause
borysiasty/inasafe
safe/utilities/test/test_gis.py
1
13233
# coding=utf-8 """Test for GIS utilities functions.""" import unittest import numpy from os.path import join # noinspection PyUnresolvedReferences import qgis # pylint: disable=unused-import from PyQt4.QtCore import QVariant from os.path import join from safe.utilities.gis import ( layer_attribute_names, is_...
gpl-3.0
cchamberlain/gyp
test/lib/TestWin.py
90
3168
# Copyright (c) 2014 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. """ TestWin.py: a collection of helpers for testing on Windows. """ import errno import os import re import sys import subprocess class Registry(object): def ...
bsd-3-clause
rishirdua/eep702-software-laboratory
03_ubuntu-weather-app/code/woeidfromcordi.py
1
1431
import MySQLdb import urllib2, urllib, re, sys import xml from datetime import datetime ##gets woeid from cordinates def getwoeid(longi, lati): try: import xml.etree.ElementTree as ET namespaces = {'yweather': 'http://www.yahooapis.com/v1/base.rng'} # add more as needed #get records proxy = urllib2.ProxyHandl...
mit
bobisme/odoo
addons/website_partner/__openerp__.py
383
1498
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
adezfouli/savigp
GP/savigp_single_comp.py
1
2840
__author__ = 'AT' from savigp import SAVIGP from GPy.util.linalg import mdot from mog_single_comp import MoG_SingleComponent import numpy as np class SAVIGP_SingleComponent(SAVIGP): """ Implementation of SAVIGP in the case that the posterior covariance is full, and the mixture has only one component. """...
apache-2.0
jabauer/projectquincy2
activities/admin.py
2
1215
#This file activates and customizes the backend admin site for the ACTIVITIES app. from django.contrib import admin from activities.models import Assignment, AssignmentTitle, AssignmentType from citations.models import Validation from django.contrib.contenttypes.admin import GenericStackedInline class ValidationInli...
gpl-3.0
vicky2135/lucious
lib/python2.7/encodings/cp874.py
593
12851
""" Python Character Mapping Codec cp874 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP874.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inpu...
bsd-3-clause
trietptm/volatility
volatility/plugins/overlays/windows/win7_sp1_x64_vtypes.py
58
503356
ntkrnlmp_types = { '_ARBITER_INTERFACE' : [ 0x30, { 'Size' : [ 0x0, ['unsigned short']], 'Version' : [ 0x2, ['unsigned short']], 'Context' : [ 0x8, ['pointer64', ['void']]], 'InterfaceReference' : [ 0x10, ['pointer64', ['void']]], 'InterfaceDereference' : [ 0x18, ['pointer64', ['void']]], 'Arb...
gpl-2.0
kiith-sa/QGIS
python/plugins/processing/gui/EditRenderingStylesDialog.py
6
3347
# -*- coding: utf-8 -*- """ *************************************************************************** EditRenderingStylesDialog.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *************...
gpl-2.0
edoko/Air_Kernel-Mako
tools/perf/scripts/python/sctop.py
11180
1924
# 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
alshedivat/tensorflow
tensorflow/contrib/model_pruning/examples/cifar10/cifar10_eval.py
61
5726
# 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
jarvis-fga/Projetos
Problema 4/Python/matplot_kmean.py
1
3623
import time import pandas import numpy import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import MiniBatchKMeans, KMeans from sklearn.metrics.pairwise import pairwise_distances_argmin from sklearn.manifold import TSNE features = [ "mean_of_the_integrated_profile", "standard_deviation_of_t...
mit
vitmod/enigma2-1
lib/python/Components/Renderer/Picon.py
4
4625
import os, re, unicodedata from Renderer import Renderer from enigma import ePixmap, ePicLoad from Tools.Alternatives import GetWithAlternative from Tools.Directories import pathExists, SCOPE_ACTIVE_SKIN, resolveFilename from Components.Harddisk import harddiskmanager from ServiceReference import ServiceReference sear...
gpl-2.0
vlukes/sfepy
examples/diffusion/poisson_parallel_interactive.py
4
19203
#!/usr/bin/env python r""" Parallel assembling and solving of a Poisson's equation, using commands for interactive use. Find :math:`u` such that: .. math:: \int_{\Omega} \nabla v \cdot \nabla u = \int_{\Omega} v f \;, \quad \forall s \;. Important Notes --------------- - This example requires petsc4py, ...
bsd-3-clause
letsgoexploring/linearsolve-package
linearsolve/__init__.py
1
32412
from __future__ import division,print_function import numpy as np import scipy.linalg as la from statsmodels.tools.numdiff import approx_fprime_cs from scipy.optimize import root,fsolve,broyden1,broyden2 import pandas as pd import sys class model: '''Defines a class -- linearsolve.model -- with associated methods...
mit
kangfend/django
django/core/management/commands/runserver.py
140
7204
from __future__ import unicode_literals import errno import os import re import socket import sys from datetime import datetime from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.core.servers.basehttp i...
bsd-3-clause
0ps/ftp_attack
ftp_attack.py
1
13590
#!/usr/local/bin/python #-*- coding: UTF-8 -*- #################################################################### #qq:316118740 #BLOG:http://hi.baidu.com/alalmn from ftplib import FTP import time import threading import socket socket.setdefaulttimeout(10) #设置了全局默认超时时间 ################################################...
epl-1.0
Lnaden/pymbar
pymbar/old_mbar.py
3
109370
############################################################################## # pymbar: A Python Library for MBAR # Copyright 2016-2017 University of Colorado Boulder # Copyright 2010-2017 Memorial Sloan-Kettering Cancer Center # Portions of this software are Copyright 2010-2014 University of Virginia, # Portions of ...
mit
prutseltje/ansible
test/units/modules/network/nso/test_nso_show.py
41
4284
# # Copyright (c) 2017 Cisco and/or its affiliates. # # 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...
gpl-3.0
hansent/kivy
kivy/lib/osc/OSC.py
14
10870
#!/usr/bin/python # # Open SoundControl for Python # Copyright (C) 2002 Daniel Holth, Clinton McChesney # # 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 Licen...
mit
HarveyHunt/ci20_upstream
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0
inspyration/odoo
addons/account/res_config.py
5
25017
# -*- 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
pwendell/mesos
third_party/boto-2.0b2/boto/services/__init__.py
782
1108
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
apache-2.0
moijes12/oh-mainline
vendor/packages/twisted/twisted/names/test/test_client.py
18
21823
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for L{twisted.names.client}. """ from twisted.names import client, dns from twisted.names.error import DNSQueryTimeoutError from twisted.trial import unittest from twisted.names.common import ResolverBase from twisted.internet impo...
agpl-3.0
t3dev/odoo
addons/survey/models/survey_survey.py
1
28822
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import uuid from collections import Counter, OrderedDict from itertools import product from werkzeug import urls import random from odoo import api, fields, models, SUPERUSER_ID, _ from odoo.exceptions import UserError...
gpl-3.0
pyannote/pyannote-workflows
pyannote_workflows/workflows/acmmm2016/subtitles.py
1
5167
import luigi import sciluigi import pyannote_workflows.tasks.speech import pyannote_workflows.tasks.evaluation import pyannote_workflows.tasks.tvd_dataset import pyannote_workflows.tasks.propagation import pyannote_workflows.utils from pprint import pprint class Subtitles(sciluigi.WorkflowTask): workdir = luigi...
mit
cloudera/hue
desktop/core/ext-py/boto-2.46.1/boto/ec2/__init__.py
22
3094
# Copyright (c) 2006-2008 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
apache-2.0
simonwydooghe/ansible
lib/ansible/modules/network/check_point/cp_publish.py
20
2198
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Check Point Firewall (c) 2019 # # 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 o...
gpl-3.0
jlnaudin/x-drone
MissionPlanner-master/packages/IronPython.StdLib.2.7.4/content/Lib/encodings/cp1026.py
593
13369
""" Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
gpl-3.0
Arcanemagus/SickRage
lib/tornado/test/auth_test.py
25
22628
# These tests do not currently do much to verify the correct implementation # of the openid/oauth protocols, they just exercise the major code paths # and ensure that it doesn't blow up (e.g. with unicode/bytes issues in # python 3) from __future__ import absolute_import, division, print_function from tornado.auth im...
gpl-3.0
akintoey/django
django/core/files/temp.py
462
2950
""" The temp module provides a NamedTemporaryFile that can be reopened in the same process on any platform. Most platforms use the standard Python tempfile.NamedTemporaryFile class, but Windows users are given a custom class. This is needed because the Python implementation of NamedTemporaryFile uses the O_TEMPORARY f...
bsd-3-clause
nsat/gnuradio
gr-filter/python/filter/qa_filter_delay_fc.py
54
4557
#!/usr/bin/env python # # Copyright 2004,2007,2010,2012,2013 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...
gpl-3.0
RedhawkSDR/omniEvents
test/CosLifeCycle_idl.py
2
17990
# Python stubs generated by omniidl from /home/alex/calvino/work/omni.d/local/share/idl/omniORB/COS/CosLifeCycle.idl import omniORB, _omnipy from omniORB import CORBA, PortableServer _0_CORBA = CORBA _omnipy.checkVersion(2,0, __file__) # #include "CosNaming.idl" import CosNaming_idl _0_CosNaming = omniORB.openModule...
lgpl-2.1
procoder317/scikit-learn
sklearn/linear_model/logistic.py
57
65098
""" Logistic Regression """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Fabian Pedregosa <f@bianp.net> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Manoj Kumar <manojkumarsivaraj334@gmail.com> # Lars Buitinck # Simon Wu <s8wu@uwaterloo.ca> imp...
bsd-3-clause
anxdpanic/plugin.video.youtube
resources/lib/youtube_plugin/kodion/constants/const_sort_methods.py
2
2389
# -*- coding: utf-8 -*- """ Copyright (C) 2014-2016 bromix (plugin.video.youtube) Copyright (C) 2016-2018 plugin.video.youtube SPDX-License-Identifier: GPL-2.0-only See LICENSES/GPL-2.0-only for more information. """ _xbmc = True try: from xbmcplugin import * except: _xbmc = False _count...
gpl-2.0
blakfeld/ansible
test/units/playbook/test_play.py
27
3871
# (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
stamaimer/Hackthon
tests/test_login.py
1
3040
# -*- coding: utf-8 -*- import random import requests from conftest import ( json_get, token_gen, url, user_store, ) def test_login_success(): uid = random.choice(list(user_store.keys())) username, password = user_store[uid] data = {"username": username, "password": password} res = ...
gpl-2.0
mpasternak/pyglet-fix-issue-518-522
contrib/layout/examples/browser.py
29
2405
#!/usr/bin/env python '''Not a browser (yet), just fetches pages and displays them. Usage:: browser.py http://meyerweb.com/eric/css/tests/css2/sec08-03a.htm Press 'v' to dump source (base file only). Press 'e' to dump elements. Press 'f' to dump frames. Press 'w' to dump frames using flowed child...
bsd-3-clause
IRC-SPHERE/HyperStream
hyperstream/tools/asset_writer/2016-11-24_v0.1.0.py
1
1632
# The MIT License (MIT) # Copyright (c) 2014-2017 University of Bristol # # 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...
mit
cc1-cloud/cc1
src/cm/settings.py
1
5699
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
apache-2.0
vovojh/gem5
src/python/m5/trace.py
15
1733
# Copyright (c) 2008 The Hewlett-Packard Development Company # 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...
bsd-3-clause
andrewmoses/ssquiz
flask/lib/python2.7/site-packages/wtforms/i18n.py
142
2175
import os def messages_path(): """ Determine the path to the 'messages' directory as best possible. """ module_path = os.path.abspath(__file__) locale_path = os.path.join(os.path.dirname(module_path), 'locale') if not os.path.exists(locale_path): locale_path = '/usr/share/locale' r...
bsd-3-clause
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/setup.py
2
2052
#!/usr/bin/env python # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Distutils installer for Twisted. """ try: # Load setuptools, to build a specific source package import setuptools # Tell Twisted not to enforce zope.interface requirement on import, since # we're going t...
mit
sbelharbi/structured-output-ae
sop_embed/experiments/lfpw_4l_in_out.py
1
15118
from sop_embed.da import DenoisingAutoencoder from sop_embed.tools import NonLinearity from sop_embed.tools import CostType from sop_embed.tools import ModelMLP from sop_embed.tools import train_one_epoch_chuncks from sop_embed.tools import theano_fns from sop_embed.tools import sharedX_value from sop_embed.tools impor...
lgpl-3.0
mattmccarthy11/vidly-development
mediadrop/bk/lib/cli_commands.py
10
2736
# This file is a part of MediaDrop (http://www.mediadrop.net), # Copyright 2009-2015 MediaDrop contributors # For the exact contribution history, see the git revision log. # The source code contained in this file is licensed under the GPLv3 or # (at your option) any later version. # See LICENSE.txt in the main project ...
gpl-3.0
jiangzhw/theHarvester
discovery/baidusearch.py
21
1298
import httplib import myparser import time import sys class search_baidu: def __init__(self, word, limit): self.word = word self.total_results = "" self.server = "www.baidu.com" self.hostname = "www.baidu.com" self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-U...
gpl-2.0
valmynd/MediaFetcher
src/plugins/youtube_dl/youtube_dl/extractor/dailymail.py
1
2647
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( int_or_none, determine_protocol, try_get, unescapeHTML, ) class DailyMailIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?dailymail\.co\.uk/(?:video/[^/]...
gpl-3.0
cchanrhiza/python-pptx
pptx/opc/constants.py
8
20169
# encoding: utf-8 """ Constant values related to the Open Packaging Convention, in particular, content types and relationship types. """ class CONTENT_TYPE(object): """ Content type URIs (like MIME-types) that specify a part's format """ BMP = ( 'image/bmp' ) DML_CHART = ( 'ap...
mit
andyzsf/django-cms
cms/south_migrations/0042_auto__del_field_title_meta_keywords__chg_field_title_meta_description_.py
48
16515
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
haudren/scipy
scipy/signal/tests/mpsig.py
8
3444
""" Some signal functions implemented using mpmath. """ from __future__ import division try: import mpmath except ImportError: try: import sympy.mpmath as mpmath except ImportError: mpmath = None def _prod(seq): """Returns the product of the elements in the sequence `seq`.""" p =...
bsd-3-clause
RaoUmer/django
django/middleware/transaction.py
447
1090
from django.db import transaction class TransactionMiddleware(object): """ Transaction middleware. If this is enabled, each view function will be run with commit_on_response activated - that way a save() doesn't do a direct commit, the commit is done when a successful response is created. If an exc...
bsd-3-clause
dmitrysmagin/qemu
scripts/tracetool/__init__.py
205
7624
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Machinery for generating tracing-related intermediate files. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __m...
gpl-2.0
nicky-ji/edx-nicky
common/lib/xmodule/xmodule/tests/test_split_test_module.py
6
20015
""" Tests for the Split Testing Module """ import ddt import lxml from mock import Mock, patch from fs.memoryfs import MemoryFS from xmodule.tests.xml import factories as xml from xmodule.tests.xml import XModuleXmlImportTest from xmodule.tests import get_test_system from xmodule.x_module import AUTHOR_VIEW, STUDENT_V...
agpl-3.0
google/material-design-icons
update/venv/lib/python3.9/site-packages/fontTools/cu2qu/ufo.py
6
11267
# 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 a...
apache-2.0
wcmitchell/insights-core
insights/parsers/osa_dispatcher_log.py
1
4173
""" OSADispatcherLog - file ``/var/log/rhn/osa-dispatcher.log`` =========================================================== """ from insights.core.plugins import parser from insights.core import LogFileOutput from datetime import datetime import re from insights.specs import osa_dispatcher_log @parser(osa_dispatcher...
apache-2.0
rowemoore/odoo
addons/l10n_be_invoice_bba/partner.py
379
2268
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Created by Luc De Meyer # Copyright (c) 2010 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribu...
agpl-3.0
meteorcloudy/tensorflow
tensorflow/python/training/checkpointable/base.py
4
32949
"""An object-local variable management scheme.""" # 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/l...
apache-2.0
Citadel-Station-13/Citadel-Station-13-6th-Port
tools/ColonCatcher/ColonCatcher.py
205
6508
# Colon Locater and Reporter, by RemieRichards V1.0 - 25/10/15 # Locates the byond operator ":", which is largely frowned upon due to the fact it ignores any type safety. # This tool produces a .txt of "filenames line,line?,line totalcolons" (where line? represents a colon in a ternary operation) from all # .dm files...
agpl-3.0
att-comdev/deckhand
deckhand/tests/unit/engine/test_document_layering_negative.py
1
13574
# Copyright 2017 AT&T Intellectual Property. All other 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...
apache-2.0
geometalab/OSM-Crosswalk-Detection
src/role/manager.py
2
2702
import math from redis import Redis from rq import Queue from src.base.bbox import Bbox from src.base.configuration import Configuration from src.base.globalmaptiles import GlobalMercator from src.role import worker_functions class Manager: def __init__(self, bbox=None, configuration=None, standalone=False): ...
mit
mrkn/iTerm2
tests/colors.py
36
1812
#!/usr/bin/python from __future__ import print_function def PrintTableHeader(fg): for num, name in fg: print("%-7s " % name, end="") def Clear(): print("%c[39;49m " % 27, end="") def PrintRowLabel(index, bg): print("%9s " % bg[index][1], end="") def PrintCell(fi, bi, fg, bg): print("%c[%d;%dm%-9s " % ...
gpl-2.0
os2webscanner/os2webscanner
webscanner_client/setup.py
1
1928
# The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS"basis, #...
mpl-2.0
7kbird/chrome
third_party/cython/src/Cython/Plex/Traditional.py
102
3502
#======================================================================= # # Python Lexical Analyser # # Traditional Regular Expression Syntax # #======================================================================= from Regexps import Alt, Seq, Rep, Rep1, Opt, Any, AnyBut, Bol, Eol, Char from Errors import Plex...
bsd-3-clause
youssef-emad/shogun
examples/undocumented/python_modular/kernel_poly_match_word_string_modular.py
26
1173
#!/usr/bin/env python from tools.load import LoadMatrix lm=LoadMatrix() traindat = lm.load_dna('../data/fm_train_dna.dat') testdat = lm.load_dna('../data/fm_test_dna.dat') parameter_list = [[traindat,testdat,2,True,3,0,False],[traindat,testdat,2,True,3,0,False]] def kernel_poly_match_word_string_modular (fm_train_dna...
gpl-3.0
carlTLR/gyp
test/ios/gyptest-archs.py
136
1786
#!/usr/bin/env python # 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. """ Verifies that device and simulator bundles are built correctly. """ import TestGyp import TestMac import collections import sys if s...
bsd-3-clause
ATIX-AG/ansible
lib/ansible/modules/commands/raw.py
72
3241
# this is a virtual module that is entirely implemented server side # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '...
gpl-3.0
chouseknecht/ansible
lib/ansible/modules/network/iosxr/iosxr_lldp_interfaces.py
20
13091
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ############################################# # WARNING # ############################################# # # This file is au...
gpl-3.0
shimizust/learning-spark
src/python/LoadCsv.py
42
1603
from pyspark import SparkContext import csv import sys import StringIO def loadRecord(line): """Parse a CSV line""" input = StringIO.StringIO(line) reader = csv.DictReader(input, fieldnames=["name", "favouriteAnimal"]) return reader.next() def loadRecords(fileNameContents): """Load all the recor...
mit
levkar/odoo-addons
product_supplier_pricelist/product.py
2
2131
# -*- coding: utf-8 -*- from openerp.osv import osv, fields from openerp import tools from openerp.tools.translate import _ class product_supplierinfo(osv.osv): _inherit = 'product.supplierinfo' def name_get(self, cr, uid, ids, context=None): if context is None: context = {} if no...
agpl-3.0
filias/django
django/template/defaulttags.py
27
49188
"""Default tags used by the template system, available to all templates.""" from __future__ import unicode_literals import re import sys import warnings from datetime import datetime from itertools import cycle as itertools_cycle, groupby from django.conf import settings from django.utils import six, timezone from dj...
bsd-3-clause