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 |
|---|---|---|---|---|---|
Mhynlo/SickRage | lib/imdb/parser/http/bsouplxml/bsoupxpath.py | 126 | 14521 | """
parser.http.bsoupxpath module (imdb.parser.http package).
This module provides XPath support for BeautifulSoup.
Copyright 2008 H. Turgut Uyar <uyar@tekir.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 Softwar... | gpl-3.0 |
briancoutinho0905/2dsampling | src/mem/slicc/ast/StateDeclAST.py | 32 | 3307 | # Copyright (c) 2011 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions... | bsd-3-clause |
bumshakabum/brint | budget/flask/lib/python3.6/site-packages/pip/_vendor/lockfile/linklockfile.py | 536 | 2652 | from __future__ import absolute_import
import time
import os
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class LinkLockFile(LockBase):
"""Lock access to a file using atomic property of link(2).
>>> lock = LinkLockFile('somefile')
>>> lock = Link... | gpl-3.0 |
NorfolkDataSci/presentations | 2018-01_chatbot/serverless-chatbots-workshop-master/LambdaFunctions/sentiment-analysis/nltk/classify/weka.py | 7 | 12625 | # Natural Language Toolkit: Interface to Weka Classsifiers
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Classifiers that make use of the external 'Weka' package.
"""
from __future__ import print_function
imp... | mit |
ygsun/async | concurrent_thread_taomm.py | 1 | 10435 | #!/usr/bin/env python3
"""
Python version: > 2.5
Dependence: requests BeautifulSoup
线程版本
爬虫类
从淘女郎网站(https://mm.taobao.com)获取图片链接并下载,按照地区、相册名、姓名分类
"""
import contextlib
import threading
import os
import re
import requests
import time
import json
import argparse
import logging
from bs4 import BeautifulSoup
# 第一页
FIR... | bsd-3-clause |
kdwink/intellij-community | python/testData/MockSdk3.2/Lib/io.py | 113 | 3624 | """The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; impl... | apache-2.0 |
paradise6/DetectMaliciousURL | model/eval.py | 1 | 5331 | import tensorflow as tf
import numpy as np
import os
import time
import datetime
import data_helper
import word2vec_helpers
from URLCNN import URLCNN
import csv
# Parameters
# ==================================================
# Data Parameters
tf.flags.DEFINE_string("input_text_file", "../data/data2.csv", "Test text ... | apache-2.0 |
bitsgalore/omSipCreator | omSipCreator/checksums.py | 2 | 1412 | #! /usr/bin/env python
"""
Checksum reading and generation
"""
import os
import logging
import hashlib
from . import config
from .shared import errorExit
def readChecksums(fileIn):
"""Read checksum file, return contents as nested list
Also strip away any file paths if they exist (return names only)
"""
... | apache-2.0 |
toumorokoshi/miura | miura/script.py | 1 | 2256 | import os
from miura import runner
from .utils import get_method_from_module, format_path_to_module
from .data import load_data_from_path, filter_data
from .template import TemplateSet
from .exceptions import MiuraException
import logging
DEFAULT_DATA_DIRECTORY = os.path.join(os.curdir, 'data')
DEFAULT_TEMPLATE_DIRE... | mit |
nkgilley/home-assistant | homeassistant/components/tado/config_flow.py | 6 | 5269 | """Config flow for Tado integration."""
import logging
from PyTado.interface import Tado
import requests.exceptions
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import callback
from .const impo... | apache-2.0 |
sanghinitin/golismero | thirdparty_libs/django/utils/html_parser.py | 231 | 4546 | from django.utils.six.moves import html_parser as _html_parser
import re
import sys
current_version = sys.version_info
use_workaround = (
(current_version < (2, 7, 3)) or
(current_version >= (3, 0) and current_version < (3, 2, 3))
)
HTMLParseError = _html_parser.HTMLParseError
if not use_workaround:
HTM... | gpl-2.0 |
eadgarchen/tensorflow | tensorflow/contrib/boosted_trees/python/utils/losses.py | 23 | 8661 | # 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 |
dpendl00/headphones | lib/requests/packages/chardet/escprober.py | 2936 | 3187 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
Textalk/poppler | regtest/TestReferences.py | 2 | 3512 | # TestReferences.py
#
# Copyright (C) 2011 Carlos Garcia Campos <carlosgc@gnome.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 2 of the License, or
# (at your option) any ... | gpl-2.0 |
zclfly/cgt | examples/bench/theano_gru.py | 22 | 3642 | import theano, theano.tensor as TT
from cgt.utils import Message
import time
import numpy as np
def normc(x):
assert x.ndim == 2
return x/norms(x,0)[None,:]
def randnf(*shp):
return np.random.randn(*shp).astype(theano.config.floatX)
def norms(x,ax):
return np.sqrt(np.square(x).sum(axis=ax))
class GRUC... | mit |
morph027/ansible-modules-extras | univention/udm_group.py | 29 | 5267 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# Copyright (c) 2016, Adfinis SyGroup AG
# Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch>
#
# 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 Fr... | gpl-3.0 |
gsehub/edx-platform | common/djangoapps/third_party_auth/tests/test_admin.py | 9 | 3683 | """
Tests third_party_auth admin views
"""
import unittest
from django.contrib.admin.sites import AdminSite
from django.core.files.uploadedfile import SimpleUploadedFile
from django.urls import reverse
from django.forms import models
from student.tests.factories import UserFactory
from third_party_auth.admin import O... | agpl-3.0 |
rochacbruno/dynaconf | dynaconf/validator_conditions.py | 1 | 1384 | # pragma: no cover
"""
Implement basic assertions to be used in assertion action
"""
def eq(value, other):
"""Equal"""
return value == other
def ne(value, other):
"""Not equal"""
return value != other
def gt(value, other):
"""Greater than"""
return value > other
def lt(value, other):
... | mit |
njwilson23/scipy | scipy/optimize/_trustregion_dogleg.py | 135 | 4449 | """Dog-leg trust-region optimization."""
from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.linalg
from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproblem)
__all__ = []
def _minimize_dogleg(fun, x0, args=(), jac=None, hess=None,
*... | bsd-3-clause |
weso/landportal-importers | IpfriExtractor/es/weso/translator/ipfri_trasnlator.py | 2 | 4614 | __author__ = 'Dani'
import xlrd
from model2xml.model2xml import ModelToXMLTransformer
from .parser.parser import Parser
from .object_builder.model_object_builder import IpfriModelObjectBuilder
import os.path
class IpfriTranslator(object):
def __init__(self, log, config, look_for_historical=True):
self... | unlicense |
1it/python-dns-failover | dns_failover/backends.py | 2 | 4136 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
class CloudFlareDNS(object):
"""
CloudFlare Backend for Python DNS Failover
"""
def __init__(self, email, key, zone, ttl=1,
url='https://www.cloudflare.com/api_json.html'):
"""
Sets up a CloudFlareDNS back... | bsd-3-clause |
amoya-dx/account-financial-tools | currency_rate_date_check/company.py | 38 | 1695 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Currency rate date check module for Odoo
# Copyright (C) 2012-2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you ... | agpl-3.0 |
michaelkirk/QGIS | tests/src/python/test_qgsfontutils.py | 20 | 2128 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for core QgsFontUtils class
From build dir: ctest -R PyQgsFontUtils -V
.. note:: 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 Li... | gpl-2.0 |
ghmajx/asuswrt-merlin | release/src/router/samba-3.5.8/source4/scripting/python/examples/winreg.py | 24 | 2812 | #!/usr/bin/python
#
# tool to manipulate a remote registry
# Copyright Andrew Tridgell 2005
# Copyright Jelmer Vernooij 2007
# Released under the GNU GPL v3 or later
#
import sys
# Find right directory when running from source tree
sys.path.insert(0, "bin/python")
from samba.dcerpc import winreg
import optparse
... | gpl-2.0 |
glennrub/micropython | ports/stm32/boards/NUCLEO_WB55/rfcore_firmware.py | 8 | 22879 | # This file is part of the MicroPython project, http://micropython.org/
#
# The MIT License (MIT)
#
# Copyright (c) 2020 Damien P. George
# Copyright (c) 2020 Jim Mussared
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwar... | mit |
duncanmmacleod/gwpy | gwpy/timeseries/io/ascii.py | 3 | 1185 | # -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2017-2020)
#
# This file is part of GWpy.
#
# GWpy 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 |
ach4m0/f1experiencealloy | plugins/ti.alloy/plugin.py | 1729 | 5251 | import os, sys, subprocess, hashlib
import subprocess
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
Backported from Python 2.7 as it's implemented as pure python on stdlib.
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.... | apache-2.0 |
yvaucher/stock-logistics-tracking | __unported__/stock_tracking_add_move/wizard/__init__.py | 4 | 1061 | # -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
mattupstate/overholt | overholt/users/models.py | 9 | 1646 | # -*- coding: utf-8 -*-
"""
overholt.users.models
~~~~~~~~~~~~~~~~~~~~~
User models
"""
from flask_security import UserMixin, RoleMixin
from ..core import db
from ..helpers import JsonSerializer
roles_users = db.Table(
'roles_users',
db.Column('user_id', db.Integer(), db.ForeignKey('users.id'))... | mit |
beck/django | tests/model_meta/test_legacy.py | 199 | 7556 | import warnings
from django import test
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import FieldDoesNotExist
from django.db.models.fields import CharField, related
from django.utils.deprecation import RemovedInDjango110Warning
from .models import BasePerson, Person
from ... | bsd-3-clause |
colinligertwood/odoo | openerp/tools/yaml_tag.py | 105 | 6204 | import yaml
import logging
class YamlTag(object):
"""
Superclass for constructors of custom tags defined in yaml file.
__str__ is overriden in subclass and used for serialization in module recorder.
"""
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def __getitem__(self, key... | agpl-3.0 |
mhei/linux | scripts/gdb/linux/symbols.py | 467 | 6343 | #
# gdb helper commands and functions for Linux kernel debugging
#
# load kernel and module symbols
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
import os
import re
from linux import module... | gpl-2.0 |
mabelcalim/tide-app | kivy/test8/.buildozer/venv/lib/python2.7/site-packages/pip/_vendor/distlib/locators.py | 191 | 46946 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... | gpl-3.0 |
naousse/odoo | addons/stock/__openerp__.py | 261 | 4008 | # -*- 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 |
jlguardi/yowsup | yowsup/layers/protocol_chatstate/protocolentities/chatstate.py | 70 | 1234 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
class ChatstateProtocolEntity(ProtocolEntity):
'''
INCOMING
<chatstate from="xxxxxxxxxxx@s.whatsapp.net">
<{{composing|paused}}></{{composing|paused}}>
</chatstate>
OUTGOING
<chatstate to="xxxxxxxxxxx@s.whatsapp.net">
<{{com... | gpl-3.0 |
flyballlabs/threatdetectionservice | agents/rpi/EnableReplay.py | 2 | 2198 | '''
This script replays pcap capture over the net to host server
Make sure to re-enable ports after
@author: devopsec
'''
import subprocess, sys
from datetime import datetime
def run():
def iptablesFLUSH():
subprocess.run("iptables -Z", shell=True)# zero counters
subprocess.run("iptables -F", ... | apache-2.0 |
softcert/vsroom | vsroom/common/sanitizers/ah.py | 1 | 1092 | import time
import re
from vsroom.common import timeconversion
from vsroom.common import sanitizer
# sanitizer.Sanitizer is the base class for a simple sanitizer bot.
class AbuseHelperSanitizer(sanitizer.Sanitizer):
# .sanitize(event) is the hook method for sanitizing events. This
# is the only method you ha... | mit |
trezorg/django | django/core/management/commands/inspectdb.py | 203 | 7614 | import keyword
from optparse import make_option
from django.core.management.base import NoArgsCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
class Command(NoArgsCommand):
help = "Introspects the database tables in the given database and outputs a Django model module."
option_list =... | bsd-3-clause |
frumiousbandersnatch/supybot-code | src/world.py | 6 | 7430 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# 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 co... | bsd-3-clause |
eckardm/archivematica | src/dashboard/src/components/advanced_search.py | 2 | 9710 | # This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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 ... | agpl-3.0 |
ereOn/loaded | loaded/main.py | 1 | 1773 | """
Scripts.
"""
import click
import logging
import platform
import six
from tornado.ioloop import (
IOLoop,
PeriodicCallback,
)
from .server import agent_application
@click.group()
@click.option('-d', '--debug/--no-debug', default=False)
@click.pass_context
def main_loaded(ctx, debug):
"""
Loaded ... | lgpl-3.0 |
lsyiverson/shadowsocks | shadowsocks/daemon.py | 694 | 5602 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 clowwindy
#
# 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 requi... | apache-2.0 |
github-borat/cinder | cinder/tests/integrated/api/client.py | 1 | 7946 | # Copyright (c) 2011 Justin Santa Barbara
#
# 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 applicab... | apache-2.0 |
apehua/pilas | pilasengine/actores/estudiante.py | 5 | 7013 | # -*- encoding: utf-8 -*-
# pilas engine: un motor para hacer videojuegos
#
# Copyright 2010-2014 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
import collections
from pilasengine import habilidades
from pilasengine import comportamientos
... | lgpl-3.0 |
jnovinger/django | tests/m2m_regress/tests.py | 273 | 4695 | from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from django.utils import six
from .models import (
Entry, Line, Post, RegressionModelSplit, SelfRefer, SelfReferChild,
SelfReferChildSibling, Tag, TagCollection, Worksheet,
)
class M2MRegre... | bsd-3-clause |
peterjoel/servo | tests/wpt/web-platform-tests/tools/third_party/py/py/_log/log.py | 60 | 6003 | """
basic logging functionality based on a producer/consumer scheme.
XXX implement this API: (maybe put it into slogger.py?)
log = Logger(
info=py.log.STDOUT,
debug=py.log.STDOUT,
command=None)
log.info("hello", "world")
log.command("... | mpl-2.0 |
emk/pyjamas | examples/addonsgallery/AddonsGallery.py | 5 | 2840 | import pyjd # dummy for pyjs
from pyjamas.ui.Button import Button
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.HTML import HTML
from pyjamas.ui.DockPanel import DockPanel
from pyjamas.ui import HasAlignment
from pyjamas.ui.Hyperlink import Hyperlink
from pyjamas.ui.VerticalPanel import VerticalPanel
from... | apache-2.0 |
sarahgrogan/scikit-learn | sklearn/utils/multiclass.py | 83 | 12343 |
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi
#
# License: BSD 3 clause
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from collections import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.... | bsd-3-clause |
avanov/django | tests/admin_changelist/tests.py | 6 | 37419 | from __future__ import unicode_literals
import datetime
from django.contrib import admin
from django.contrib.admin.models import LogEntry
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.templatetags.admin_list import pagination
from django.contrib.admin.tests import AdminS... | bsd-3-clause |
CognitionGuidedSurgery/msml-gui | src/msmlgui/text/xmllexer.py | 1 | 9663 | __author__ = 'Alexander Weigl'
# From: https://github.com/behnam/python-ply-xml/blob/master/parser.py
#
#
import sys
from UserString import UserString
from ply import lex, yacc
_VERSION = '1.0'
################################
# LEXER
class XmlLexer:
'''The XML lexer'''
# states:
# default: The... | gpl-3.0 |
singlebrook/AWS-ElasticBeanstalk-CLI | eb/macosx/python3/scli/core.py | 8 | 5504 | #!/usr/bin/env python
#==============================================================================
# Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of the... | apache-2.0 |
pcamp/google-appengine-wx-launcher | launcher/resizing_listctrl.py | 28 | 1054 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
doublebits/osf.io | website/addons/mendeley/tests/utils.py | 18 | 16261 | # -*- coding: utf-8 -*-
from modularodm import storage
from framework.mongo import set_up_storage
from website.addons.base.testing import OAuthAddonTestCaseMixin, AddonTestCase
from website.addons.base.testing.utils import MockFolder
from website.addons.mendeley.tests.factories import MendeleyAccountFactory
from webs... | apache-2.0 |
alexei-matveev/ase-local | ase/io/siesta.py | 9 | 8034 | from numpy import zeros
from os import fstat
from re import compile
from ase.io.fortranfile import FortranFile
def read_rho(fname):
"Read unformatted Siesta charge density file"
# TODO:
#
# Handle formatted and NetCDF files.
#
# Siesta source code (at least 2.0.2) can possibly also
# s... | gpl-2.0 |
theguardian/headphones | lib/beetsplug/fetchart.py | 14 | 13052 | # This file is part of beets.
# Copyright 2014, Adrian Sampson.
#
# 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, ... | gpl-3.0 |
YtvwlD/od-oe | contrib/python/generate-manifest-2.4.py | 45 | 13550 | #!/usr/bin/env python
# generate Python Manifest for the OpenEmbedded build system
# (C) 2002-2007 Michael 'Mickey' Lauer <mickey@Vanille.de>
# MIT license
import os
import sys
import time
VERSION = "2.4.4"
# increase when touching python-core
BASEREV = 2
__author__ = "Michael 'Mickey' Lauer <mickey@Vanille.de>"
__... | mit |
alfa-jor/addon | plugin.video.alfa/servers/videobb.py | 1 | 1037 | # -*- coding: utf-8 -*-
# --------------------------------------------------------
# Conector videobb By Alfa development Group
# --------------------------------------------------------
from core import httptools
from core import scrapertools
from platformcode import logger
def test_video_exists(page_url):
logg... | gpl-3.0 |
ribag/ganeti-experiments | test/py/ganeti.daemon_unittest.py | 5 | 24843 | #!/usr/bin/python
#
# Copyright (C) 2010 Google Inc.
#
# 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 option) any later version.
#
# This program... | gpl-2.0 |
ktosiek/spacewalk | client/rhel/rhn-client-tools/src/firstboot-legacy-rhel6/rhn_choose_server_gui.py | 4 | 3314 | # Copyright 2006--2010 Red Hat, Inc.
#
# 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; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT... | gpl-2.0 |
douwekiela/nncg-negation | acl17/scripts/train-test-split.py | 1 | 1925 | import json as js
import numpy as np
from argparse import ArgumentParser
def main(data_file, train_file, test_file, dev_file, num_noise):
data = js.load(open(data_file, "r"))
train_data = []
test_data = []
dev_data = []
np.random.seed(100)
test_indices = np.random.choice(a=range(len(data))... | mit |
egaxegax/django-dbcartajs | django/conf/__init__.py | 95 | 9136 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import logging
import os
import sys
import time # Needed fo... | gpl-2.0 |
maxwward/SCOPEBak | askbot/conf/settings_wrapper.py | 7 | 3878 | """
Definition of a Singleton wrapper class for askbot.deps.livesettings
with interface similar to django.conf.settings
that is each setting has unique key and is accessible
via dotted lookup.
for example to lookup value of setting BLAH you would do
from askbot.conf import settings as askbot_settings
askbot_settings... | gpl-3.0 |
jean/sentry | tests/sentry/web/frontend/test_admin.py | 7 | 1612 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from exam import fixture
from sentry.testutils import TestCase
class EnvStatusTest(TestCase):
@fixture
def path(self):
return reverse('sentry-admin-status')
def test_requires_auth(self):... | bsd-3-clause |
40223222/-2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/collections/abc.py | 739 | 16026 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
Unit tests are in test_collections.
"""
from abc import ABCMeta, abstractmethod
import sys
__all__ = ["Hashable", "Iterable", "Iterator",
... | agpl-3.0 |
xindus40223115/2015cda_g1 | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/image.py | 603 | 19603 | #!/usr/bin/env python
'''Pygame module for image transfer.
The image module contains functions for loading and saving pictures, as
well as transferring Surfaces to formats usable by other packages.
Note that there is no Image class; an image is loaded as a
Surface object. The Surface class allows manipulation (drawi... | gpl-3.0 |
tpsatish95/Python-Workshop | Python Environment Setup/Alternate/1. Python/1. Installer/Python-3.4.0(Linux)/Lib/unittest/runner.py | 195 | 7484 | """Running tests"""
import sys
import time
import warnings
from . import result
from .signals import registerResult
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self,stream):
self.stream = stream
def __ge... | apache-2.0 |
fgallina/gpycomplete | gpycomplete/helpers.py | 1 | 3526 | # This file is part of gpycomplete.
# gpycomplete 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.
# gpycomplete is distributed in the... | gpl-3.0 |
rooshilp/CMPUT410W15-project | testenv/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/schema.py | 36 | 3619 | from django.db.backends.schema import BaseDatabaseSchemaEditor
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_create_sequence = "CREATE SEQUENCE %(sequence)s"
sql_delete_sequence = "DROP SEQUENCE IF EXISTS %(sequence)s CASCADE"
sql_set_sequence_max = "SELECT setval('%(sequence)s', MAX(%(column... | gpl-2.0 |
drbild/boto | tests/unit/glacier/test_job.py | 114 | 3711 | # Copyright (c) 2013 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 ... | mit |
DimStar77/osc | tests/test_repairwc.py | 12 | 12468 | import osc.core
import osc.oscerr
import os
import sys
from common import GET, PUT, POST, DELETE, OscTestCase
from xml.etree import cElementTree as ET
FIXTURES_DIR = os.path.join(os.getcwd(), 'repairwc_fixtures')
def suite():
import unittest
return unittest.makeSuite(TestRepairWC)
class TestRepairWC(OscTestCa... | gpl-2.0 |
albertrdixon/CouchPotatoServer | libs/enzyme/mpeg.py | 180 | 30553 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Thomas Schueppel <stain@acm.org>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
#
# This file is part of enzyme.
#
# enzyme is free software; you can redistribute it and/or mod... | gpl-3.0 |
trotterdylan/grumpy | lib/random_test.py | 7 | 2609 | # Copyright 2016 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 |
yourcelf/btb | scanblog/btb/tests/live/mod_upload_tests.py | 2 | 2033 | import os
import time
from .base import BtbLiveServerTestCase, NoSuchElementException
from django.conf import settings
from scanning.models import Scan
from django.contrib.auth.models import User
class TestModUploads(BtbLiveServerTestCase):
def setUp(self):
super(TestModUploads, self).setUp()
sel... | agpl-3.0 |
sameetb-cuelogic/edx-platform-test | common/djangoapps/util/tests/test_authentication.py | 87 | 2512 | """Tests for util.authentication module."""
from mock import patch
from django.conf import settings
from rest_framework import permissions
from rest_framework.compat import patterns, url
from rest_framework.tests import test_authentication
from provider import scope, constants
from unittest import skipUnless
from ..a... | agpl-3.0 |
octocoin-project/octocoin | qa/rpc-tests/rest.py | 2 | 3259 | #!/usr/bin/env python2
# Copyright (c) 2014 The Octocoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test REST interface
#
from test_framework import BitcoinTestFramework
from util import *
import json
tr... | mit |
songmonit/CTTMSONLINE_V8 | addons/account/wizard/account_use_model.py | 341 | 3361 | # -*- 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 |
xujun10110/golismero | tools/sqlmap/thirdparty/chardet/euckrprober.py | 236 | 1672 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-2.0 |
mtougeron/python-openstacksdk | openstack/tests/unit/metric/v1/test_metric.py | 3 | 2949 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | apache-2.0 |
JVillella/tensorflow | tensorflow/contrib/boosted_trees/python/kernel_tests/ensemble_optimizer_ops_test.py | 27 | 14406 | # 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 |
rg3915/spark | spark/courses/migrations/0001_initial.py | 1 | 2869 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-05-30 01:55
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('authentication', '0003_auto_20170512_20... | mit |
hpcugent/easybuild-framework | easybuild/toolchains/__init__.py | 1 | 1244 | ##
# Copyright 2012-2019 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | gpl-2.0 |
molguin92/MoulinetteBackend | moulinette/homework/models.py | 1 | 6446 | from datetime import datetime
from moulinette import db
# This file includes all the definitions for the homework model in the
# database. Any change here must then be applied to the database using the
# migrate.py file in the root folder of this project.
class Homework(db.Model):
"""
Class Homework repres... | bsd-3-clause |
yprez/python-social-auth | social/apps/pyramid_app/models.py | 67 | 2119 | """Pyramid SQLAlchemy ORM models for Social Auth"""
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship, backref
from social.utils import setting_name, module_member
from social.storage.sqlalchemy_orm import SQLAlchemyUserMixin, \
... | bsd-3-clause |
crcresearch/osf.io | api/search/serializers.py | 9 | 1868 | from api.base.serializers import (
JSONAPISerializer
)
from api.base.utils import absolute_reverse
from api.files.serializers import FileSerializer
from api.nodes.serializers import NodeSerializer
from api.registrations.serializers import RegistrationSerializer
from api.users.serializers import UserSerializer
from ... | apache-2.0 |
jonnor/qt-creator | src/libs/3rdparty/botan/wrappers/boost-python/nisttest.py | 14 | 1898 | #!/usr/bin/python
import sys, os, botan
from os.path import join;
def validate(ca_certs, certs, crls, ee_certs):
store = botan.X509_Store()
for cert in certs:
if cert not in ee_certs:
store.add_cert(botan.X509_Certificate(cert), cert in ca_certs)
for crl in crls:
r = store.add... | lgpl-2.1 |
iedparis8/django-crispy-forms | crispy_forms/bootstrap.py | 10 | 11977 | import warnings
from random import randint
from django.template import Context, Template
from django.template.loader import render_to_string
from django.template.defaultfilters import slugify
from .compatibility import text_type
from .layout import LayoutObject, Field, Div
from .utils import render_field, flatatt, TE... | mit |
kaushik94/sympy | sympy/functions/elementary/hyperbolic.py | 1 | 48081 | from __future__ import print_function, division
from sympy.core import S, sympify, cacheit, pi, I, Rational
from sympy.core.add import Add
from sympy.core.function import Function, ArgumentIndexError, _coeff_isneg
from sympy.functions.combinatorial.factorials import factorial, RisingFactorial
from sympy.functions.elem... | bsd-3-clause |
zzeleznick/zDjango | venv/lib/python2.7/site-packages/django/utils/log.py | 108 | 5012 | import logging
import traceback
from django.conf import settings
from django.core import mail
from django.core.mail import get_connection
from django.views.debug import ExceptionReporter, get_exception_reporter_filter
# Make sure a NullHandler is available
# This was added in Python 2.7/3.2
try:
from logging imp... | mit |
837468220/python-for-android | python-modules/twisted/twisted/news/test/test_nntp.py | 55 | 3417 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.news import database
from twisted.news import nntp
from twisted.protocols import loopback
ALL_GROUPS = ('alt.test.nntp', 0, 1, 'y'),
GROUP = ('0', '1', '0', 'alt.test.nntp', 'group', 'sele... | apache-2.0 |
suyouxin/android_external_skia | make.py | 81 | 5539 | # Copyright 2011 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# "Makefile" replacement to build skia for Windows.
# More info at https://sites.google.com/site/skiadocs/
#
# Some usage examples:
# make clean
# make tests
# make benc... | bsd-3-clause |
javipalanca/Django-facebook | django_facebook/signals.py | 27 | 1132 | from django.dispatch import Signal
# Sent right after user is created
facebook_user_registered = Signal(providing_args=['user', 'facebook_data'])
# Sent after user is created, before profile is updated with data from Facebook
facebook_pre_update = Signal(
providing_args=['user', 'profile', 'facebook_data'])
face... | bsd-3-clause |
antmicro/distant-bes | distantbes/cli.py | 1 | 2632 | from distantbes import Invocation
from distantbes.enums import EXIT_CODES
from time import sleep
import argparse
H = [
"gRPC endpoint of the Build Event Service",
"gRPC endpoint of the Content Addressable Storage",
"force localhost in File message",
"build log file",
"one or mor... | apache-2.0 |
wbond/subversion | build/generator/gen_win.py | 2 | 60381 | #
#
# 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 n... | apache-2.0 |
b0noI/AIF2 | src/test/integration/python/threshold_p_for_first_filter_separator_character.py | 3 | 50964 | # data collected by PropertyBasedSettingsTest.experimentWith_threshold_p_for_first_filter_separator_character
data = [
{"value": 0.000000, "errors": 55},
{"value": 0.000500, "errors": 55},
{"value": 0.001000, "errors": 55},
{"value": 0.001500, "errors": 54},
{"value": 0.002000, "errors": 54},
{"value": 0.002500, "erro... | mit |
tony/kivy | kivy/core/text/markup.py | 16 | 32053 | '''
Text Markup
===========
.. versionadded:: 1.1.0
We provide a simple text-markup for inline text styling. The syntax look the
same as the `BBCode <http://en.wikipedia.org/wiki/BBCode>`_.
A tag is defined as ``[tag]``, and should have a corresponding
``[/tag]`` closing tag. For example::
[b]Hello [color=ff000... | mit |
tumblr/collectd | contrib/collectd_unixsock.py | 13 | 8066 | #-*- coding: ISO-8859-1 -*-
# collect.py: the python collectd-unixsock module.
#
# Requires collectd to be configured with the unixsock plugin, like so:
#
# LoadPlugin unixsock
# <Plugin unixsock>
# SocketFile "/var/run/collectd-unixsock"
# SocketPerms "0775"
# </Plugin>
#
# Copyright (C) 2008 Clay Loveless <clay@k... | gpl-2.0 |
flgiordano/netcash | +/google-cloud-sdk/lib/surface/deployment_manager/resources/describe.py | 1 | 3185 | # Copyright 2014 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 ag... | bsd-3-clause |
vivekmishra1991/scikit-learn | sklearn/metrics/classification.py | 95 | 67713 | """Metrics to assess performance on classification task given classe prediction
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gram... | bsd-3-clause |
HeraclesHX/scikit-learn | sklearn/cluster/tests/test_dbscan.py | 114 | 11393 | """
Tests for DBSCAN clustering algorithm
"""
import pickle
import numpy as np
from scipy.spatial import distance
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing im... | bsd-3-clause |
Jroque/MITMf | plugins/upsidedownternet.py | 21 | 2362 | # Copyright (c) 2014-2016 Marcello Salvati
#
# 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 program is distrib... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.