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 |
|---|---|---|---|---|---|
loic/django | django/utils/termcolors.py | 87 | 7302 | """
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink... | bsd-3-clause |
maohongyuan/kbengine | kbe/res/scripts/common/Lib/encodings/cp500.py | 266 | 13121 | """ Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.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,input... | lgpl-3.0 |
liorvh/Empire | lib/modules/credentials/mimikatz/golden_ticket.py | 9 | 5052 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Mimikatz Golden Ticket',
'Author': ['@JosephBialek', '@gentilkiwi'],
'Description': ("Runs PowerSploit's Invoke-Mimikatz function "
... | bsd-3-clause |
ltilve/chromium | chrome/common/extensions/docs/server2/render_refresher.py | 41 | 3514 | # Copyright 2014 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 posixpath
from custom_logger import CustomLogger
from extensions_paths import EXAMPLES
from file_system_util import CreateURLsFromPath... | bsd-3-clause |
ee08b397/HackerRankAlgorithms | Building a List.py | 1 | 1417 | """
Problem Statement
Chan has decided to make a list of all possible combinations of letters of a given string S. If there are two strings
with the same set of characters, print the lexicographically smallest arrangement of the two strings.
abc acb cab bac bca
all the above strings' lexicographically smallest... | apache-2.0 |
smartdevice475/sdl_core_346_wince | src/3rd_party-static/gmock-1.7.0/gtest/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
magicrub/MissionPlanner | Lib/_strptime.py | 61 | 20208 | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the ... | gpl-3.0 |
nuxeh/morph | morphlib/cachedrepo.py | 1 | 9251 | # Copyright (C) 2012-2015 Codethink Limited
#
# 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... | gpl-2.0 |
dimazalfrianz/namebench | libnamebench/base_ui.py | 172 | 10284 | # Copyright 2009 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 ... | apache-2.0 |
codekaki/odoo | addons/account/company.py | 56 | 2828 | # -*- 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 |
lukemetz/cuboid | cuboid/bricks/batch_norm.py | 1 | 10524 | from blocks.main_loop import MainLoop
from blocks.algorithms import TrainingAlgorithm
from blocks.roles import add_role, AuxiliaryRole
import numpy as np
from blocks.bricks.base import Brick, lazy, application
from blocks.config import config
from blocks.utils import shared_floatx_nans
from blocks.roles import WEIGHT,... | mit |
datacommonsorg/website | server/webdriver_tests/base_test.py | 1 | 3177 | # Copyright 2020 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, ... | apache-2.0 |
gdetrez/MyConf | apps/signup/views.py | 1 | 1334 | from django.forms import ModelForm
from signup.models import SessionSignup
from schedule.models import Session
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.template import loader, RequestContext
from django.forms.widgets impor... | agpl-3.0 |
lucidmotifs/auto-aoc | .venv/lib/python3.5/site-packages/pylint/test/functional/invalid_sequence_index.py | 5 | 7143 | """Errors for invalid sequence indices"""
# pylint: disable=too-few-public-methods, no-self-use, import-error, missing-docstring
import six
from unknown import Unknown
TESTLIST = [1, 2, 3]
TESTTUPLE = (1, 2, 3)
TESTSTR = '123'
# getitem tests with bad indices
def function1():
"""list index is a function"""
re... | mit |
yg257/Pangea | lib/boto-2.34.0/boto/dynamodb/table.py | 153 | 21808 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without ... | apache-2.0 |
dannyperry571/theapprentice | script.module.youtube.dl/lib/youtube_dl/extractor/tlc.py | 12 | 1644 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .brightcove import BrightcoveLegacyIE
from ..compat import (
compat_parse_qs,
compat_urlparse,
)
class TlcDeIE(InfoExtractor):
IE_NAME = 'tlc.de'
_VALID_URL = r'https?://(?:www\.)?tlc\.de/(?:[^/]... | gpl-2.0 |
eharney/cinder | cinder/backup/__init__.py | 6 | 1026 | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | apache-2.0 |
podsvirov/grpc | src/python/grpcio/grpc/framework/interfaces/face/__init__.py | 1496 | 1530 | # Copyright 2015, 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 f... | bsd-3-clause |
philipp-sumo/kitsune | kitsune/messages/tests/test_notifications.py | 17 | 2514 | from django.contrib.sites.models import Site
from django.core import mail
import mock
from kitsune.kbforums.tests import KBForumTestCase
from kitsune.sumo.tests import post, attrs_eq, starts_with
from kitsune.users.models import Setting
from kitsune.users.tests import user
PRIVATE_MESSAGE_EMAIL = '{sender} sent you ... | bsd-3-clause |
pierg75/pier-sosreport | sos/plugins/lightdm.py | 2 | 1737 | # Copyright (C) 2015 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# ... | gpl-2.0 |
Frikanalen/frikanalen | packages/fkweb/api/serializers.py | 1 | 12070 | # Copyright (c) 2012-2013 Benjamin Bruheim <grolgh@gmail.com>
# This file is covered by the LGPLv3 or later, read COPYING for details.
from django.conf import settings
from django.contrib.auth import get_user_model
from rest_framework import serializers
from rest_framework.authtoken.models import Token
import logging... | lgpl-3.0 |
NYU-CS6313-Projects/Charts-for-CompStat | data/crash_cleaner.py | 1 | 3650 | #!/user/bin/python
# this python script cleans raw crash data and subsets the last n days of observations
# if n=-1 all rows of the raw dataset are kept
# WEEK and YEAR attributes are derived
import pandas as pd
import numpy as np
import datetime as dt
import re
import os
import logging
dpath = './'
def date_parser... | mit |
skidzo/sympy | sympy/core/tests/test_diff.py | 115 | 2793 | from sympy import Symbol, Rational, cos, sin, tan, cot, exp, log, Function, \
Derivative, Expr, symbols, pi, I, S
from sympy.utilities.pytest import raises
def test_diff():
x, y = symbols('x, y')
assert Rational(1, 3).diff(x) is S.Zero
assert I.diff(x) is S.Zero
assert pi.diff(x) is S.Zero
ass... | bsd-3-clause |
tannishk/airmozilla | airmozilla/manage/tests/views/test_permissions.py | 6 | 3637 | from nose.tools import eq_
import mock
from django.conf import settings
from django.contrib.auth.models import User, Group, Permission
from funfactory.urlresolvers import reverse
from airmozilla.main.models import UserProfile, Event, CuratedGroup
from airmozilla.base.tests.test_mozillians import Response, IN_GROUPS
... | bsd-3-clause |
bitcity/django | tests/gis_tests/maps/tests.py | 322 | 2099 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.test import SimpleTestCase
from django.test.utils import modify_settings, override_settings
from django.utils.encoding import force_text
GOOGLE_MAPS_API_KEY = 'XXXX... | bsd-3-clause |
tangfeixiong/nova | nova/tests/unit/virt/ironic/utils.py | 42 | 4038 | # Copyright 2014 Red Hat, 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... | apache-2.0 |
annapowellsmith/openpresc | openprescribing/frontend/tests/commands/test_generate_presentation_replacements.py | 1 | 4653 | from django.core.management import call_command
from django.test import TestCase
from frontend.models import Chemical
from frontend.models import Presentation
from frontend.models import Product
from frontend.models import Section
from mock import patch
@patch('frontend.management.commands.generate_presentation_repl... | mit |
hsuantien/scikit-learn | examples/cluster/plot_agglomerative_clustering_metrics.py | 402 | 4492 | """
Agglomerative clustering with different metrics
===============================================
Demonstrates the effect of different metrics on the hierarchical clustering.
The example is engineered to show the effect of the choice of different
metrics. It is applied to waveforms, which can be seen as
high-dimens... | bsd-3-clause |
JoshAshby/seshat_addons | seshat_addons/view/template.py | 1 | 9852 | #!/usr/bin/env python
"""
TEMPLATE ALL THE THINGS WITH Jinja (And Mustache)!!!!
Uses the Jinja templating language to make a base template object by which is
easy to work with in the controllers, and a walker and templateFile objects
which provide automatic reading and rereading in debug mode of template files.
For mo... | gpl-3.0 |
edunham/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/headerparserhandler.py | 638 | 9836 | # Copyright 2011, 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 f... | mpl-2.0 |
mancoast/CPythonPyc_test | fail/324_test_structseq.py | 57 | 4010 | import os
import time
import unittest
from test import support
class StructSeqTest(unittest.TestCase):
def test_tuple(self):
t = time.gmtime()
self.assertIsInstance(t, tuple)
astuple = tuple(t)
self.assertEqual(len(t), len(astuple))
self.assertEqual(t, astuple)
# ... | gpl-3.0 |
chromium/chromium | tools/perf/core/results_processor/util.py | 5 | 5278 | # Copyright 2019 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 calendar
import datetime
import json
import logging
import os
import requests # pylint: disable=import-error
import multiprocessing
from multiproce... | bsd-3-clause |
psav/cfme_tests | cfme/infrastructure/pxe.py | 5 | 36894 | # -*- coding: utf-8 -*-
""" A model of a PXE Server in CFME
"""
import attr
from navmazing import NavigateToSibling, NavigateToAttribute
from selenium.common.exceptions import NoSuchElementException
from widgetastic.widget import View, Text, Checkbox
from widgetastic_patternfly import Dropdown, Accordion, BootstrapSele... | gpl-2.0 |
sdcooke/django | tests/dispatch/tests.py | 346 | 6627 | import gc
import sys
import time
import unittest
import weakref
from types import TracebackType
from django.dispatch import Signal, receiver
if sys.platform.startswith('java'):
def garbage_collect():
# Some JVM GCs will execute finalizers in a different thread, meaning
# we need to wait for that t... | bsd-3-clause |
floatec/ProsDataBase | ProsDataBase/database/tests/usertest.py | 1 | 4552 | from django.test import TestCase
from ..models import *
from django.test.client import Client
from ..tests.factory import *
from ..views.api import *
class UserTest(TestCase):
def test_serializeAll(self):
listofuser = list()
listofuser2 = list()
for i in range(1,101):
listofus... | bsd-2-clause |
grundprinzip/rekind- | Resources/pyPdf/pdf.py | 2 | 63897 | # vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# Copyright (c) 2007, Ashish Kulkarni <kulkarni.ashish@gmail.com>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met... | mit |
adaur/SickRage | lib/unidecode/x08f.py | 252 | 4651 | data = (
'Er ', # 0x00
'Qiong ', # 0x01
'Ju ', # 0x02
'Jiao ', # 0x03
'Guang ', # 0x04
'Lu ', # 0x05
'Kai ', # 0x06
'Quan ', # 0x07
'Zhou ', # 0x08
'Zai ', # 0x09
'Zhi ', # 0x0a
'She ', # 0x0b
'Liang ', # 0x0c
'Yu ', # 0x0d
'Shao ', # 0x0e
'You ', # 0x0f
'Huan ', # 0x1... | gpl-3.0 |
nhicher/ansible | lib/ansible/plugins/terminal/edgeos.py | 87 | 1126 | # Copyright: (c) 2018, 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
import os
import re
from ansible.plugins.terminal import TerminalBase
from ansible.errors import ... | gpl-3.0 |
meteorcloudy/tensorflow | tensorflow/contrib/estimator/python/estimator/dnn.py | 1 | 6739 | # 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 |
damonkohler/sl4a | python/src/Lib/encodings/iso8859_3.py | 593 | 13345 | """ Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.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,input,errors='... | apache-2.0 |
heeraj123/oh-mainline | mysite/profile/migrations/0089_auto__add_field_person_irc_nick.py | 17 | 16925 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Person.irc_nick'
db.add_column('profile_person', 'irc_nick', self.gf('django.db.models.fie... | agpl-3.0 |
berquist/cclib | cclib/method/nuclear.py | 3 | 7039 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2020, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Calculate properties of nuclei based on data parsed by cclib."""
import logging
import numpy as np
from cclib.method... | bsd-3-clause |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/scipy/stats/tests/test_mstats_basic.py | 16 | 53339 | """
Tests for the stats.mstats module (support for masked arrays)
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy import nan
import numpy.ma as ma
from numpy.ma import masked, nomask
import scipy.stats.mstats as mstats
from scipy import stats
from co... | agpl-3.0 |
Dziolas/invenio | modules/miscutil/lib/dateutils.py | 11 | 18834 | # -*- coding: utf-8 -*-
##
## Some functions about dates
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 CERN.
##
## Invenio 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-2.0 |
laurensstoop/HiSPARC-BONZ | egg/legacy/egg_saskia_v4.2.py | 1 | 9204 | # -*- coding: utf-8 -*-
#
#################################################################################################
# #
# Program for analysing HiSPARC data #
# #
# This software is made under the GNU General Public License, version 3 (GPL-3.0) #
#... | gpl-3.0 |
karesansui/karesansui | bin/get_iscsi.py | 1 | 5464 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Karesansui.
#
# Copyright (C) 2012 HDE, Inc.
#
# 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, incl... | mit |
felixfontein/ansible | test/lib/ansible_test/_internal/commands/sanity/import.py | 13 | 9115 | """Sanity test for proper import exception handling."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ... import types as t
from . import (
SanityMultipleVersion,
SanityMessage,
SanityFailure,
SanitySuccess,
SanitySkipped,
SANITY_ROOT,
... | gpl-3.0 |
gunan/tensorflow | tensorflow/python/framework/op_def_registry.py | 16 | 1842 | # 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 |
gsrp/opengsrp | gsrp/services/cursor.py | 1 | 4564 | # --*-- coding: utf-8 --*--
import psycopg2
import psycopg2.extras
from psycopg2 import Error
from tools.translations import trlocal as _
class Cursor(object):
conn = None
cr = None
def _connect(self, dsn, database, user, password, host, port):
if self.conn:
if self.conn.closed:
self.conn = psycopg2.conne... | agpl-3.0 |
rychipman/858-labs | symex/z3py/z3types.py | 2 | 3379 | import ctypes, z3core
class Z3Exception(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class ContextObj(ctypes.c_void_p):
def __init__(self, context): self._as_parameter_ = context
def from_param(obj): return obj
class Config(ctypes.c_... | mit |
alexandrul-ci/robotframework | utest/utils/test_unic.py | 3 | 7030 | import unittest
import re
from robot.utils import unic, prepr, DotDict, JYTHON, IRONPYTHON, PY2, PY3
from robot.utils.asserts import assert_equal, assert_true
if JYTHON:
from java.lang import String, Object, RuntimeException
import JavaObject
import UnicodeJavaLibrary
class TestJavaUnic(unittest.T... | apache-2.0 |
windedge/odoomrp-wip | stock_quant_manual_assign/wizard/assign_manual_quants.py | 9 | 3737 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import fields, models, api, exceptions, _
cl... | agpl-3.0 |
wanmaple/MWFrameworkForCocosJs | frameworks/runtime-src/proj.android/build_native.py | 43 | 5988 | #!/usr/bin/python
'''
build_native.py
This script will copy resources to assets and build native code with NDK.
'''
import sys
import os, os.path
import shutil
from optparse import OptionParser
def get_num_of_cpu():
''' The build process can be accelerated by running multiple concurrent job processes using the -... | apache-2.0 |
richardnpaul/FWL-Website | lib/python2.7/site-packages/django/core/files/uploadedfile.py | 223 | 4156 | """
Classes representing uploaded files.
"""
import os
from io import BytesIO
from django.conf import settings
from django.core.files.base import File
from django.core.files import temp as tempfile
from django.utils.encoding import force_str
__all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',... | gpl-3.0 |
jarshwah/django | django/db/backends/oracle/compiler.py | 59 | 2044 | from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
"""
Creates the SQL for this query. Returns the SQL string and list
of parameters. This is overridden from the original Query clas... | bsd-3-clause |
edx/course-discovery | course_discovery/apps/api/v1/tests/test_views/test_program_types.py | 1 | 1862 | from django.urls import reverse
from course_discovery.apps.api.v1.tests.test_views.mixins import APITestCase, SerializationMixin
from course_discovery.apps.core.tests.factories import USER_PASSWORD, UserFactory
from course_discovery.apps.course_metadata.models import ProgramType
from course_discovery.apps.course_metad... | agpl-3.0 |
vincent-noel/libSigNetSim | libsignetsim/numl/tests/test_example_notes.py | 1 | 1937 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2017 Vincent Noel (vincent.noel@butantan.gov.br)
#
# This file is part of libSigNetSim.
#
# libSigNetSim 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 Fou... | gpl-3.0 |
47lining/ansible-modules-core | packaging/language/easy_install.py | 73 | 6261 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Matt Wright <matt@nobien.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 License... | gpl-3.0 |
Cl3MM/metagoofil | hachoir_parser/archive/tar.py | 95 | 4443 | """
Tar archive parser.
Author: Victor Stinner
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet,
Enum, UInt8, SubFile, String, NullBytes)
from hachoir_core.tools import humanFilesize, paddingSize, timestampUNIX
from hachoir_core.endian import BIG_ENDIAN
import re
class FileEntry(Fie... | gpl-2.0 |
coderbone/SickRage-alt | lib/hachoir_parser/file_system/reiser_fs.py | 74 | 6910 | """
ReiserFS file system version 3 parser (other version have not been tested).
Author: Frederic Weisbecker
Creation date: 8 december 2006
Sources:
- http://p-nand-q.com/download/rfstool/reiserfs_docs.html
- http://homes.cerias.purdue.edu/~florian/reiser/reiserfs.php
- file://usr/src/linux-2.6.16.19/include/linux/... | gpl-3.0 |
korepwx/tfsnippet | tests/scaffold/test_checkpoint.py | 1 | 6954 | import os
import pytest
import tensorflow as tf
from mock import Mock
from tfsnippet.scaffold import *
from tfsnippet.scaffold.checkpoint import CHECKPOINT_VAR_NAME
from tfsnippet.utils import ensure_variables_initialized, TemporaryDirectory
class CheckpointSaverTestCase(tf.test.TestCase):
def test_constructor... | mit |
praba230890/PYPOWER | pypower/case6ww.py | 2 | 2963 | # Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Power flow data for 6 bus, 3 gen case from Wood & Wollenberg.
"""
from numpy import array
def case6ww():
"""Power flow data for 6 bus, 3 gen case from Woo... | bsd-3-clause |
tomholub/tooth | tooth/log.py | 1 | 6337 | __author__ = 'Tom James Holub'
import sys
import pprint
import traceback
import string
import os
import datetime
import json
import thread
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from .config import Config
config = Config()
ACCESSDIR = config.get('path', 'a... | bsd-3-clause |
theblacklion/pyglet | contrib/scene2d/examples/text_wrap.py | 29 | 1069 | #!/usr/bin/env python
'''Example of simple text wrapping without using layout.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from pyglet.gl import *
from pyglet.window import Window
from pyglet.window import key
from pyglet import clock
from pyglet import font
from scene2d.textsprite import *
window =... | bsd-3-clause |
JulianH99/pygame2017 | Mundo/Escenario.py | 1 | 13586 | import sys as s
from math import floor
from pygame import *
from pygame.locals import *
from random import randint
from Obstaculo import *
from Laser import *
# clase escenrario
class Escenario():
# constantes
ORIENT_IZQ_DER = 0
ORIENT_DER_IZQ = 1
ORIENT_G_NOR = 2
ORIENT_G_INVER = 3
FONDO... | gpl-3.0 |
couchbaselabs/litmus | lib/pymongo/errors.py | 3 | 2626 | # Copyright 2009-2010 10gen, 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 |
felixma/nova | nova/tests/unit/objects/test_dns_domain.py | 70 | 3002 | # Copyright (C) 2014, Red Hat, 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... | apache-2.0 |
ryanraaum/african-mtdna | popdata_sources/lippold2014/process.py | 1 | 1543 | from oldowan.mtconvert import seq2sites, sites2seq, str2sites
from oldowan.fasta import fasta
from string import translate
import pandas as pd
import sys
sys.path.append('../../scripts')
from utils import *
## load metadata
metadata = pd.read_csv('metadata.csv', index_col=0)
region = range2region(metadata.ix[0, 'SeqR... | cc0-1.0 |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/scipy/signal/ltisys.py | 7 | 116413 | """
ltisys -- a collection of classes and functions for modeling linear
time invariant systems.
"""
from __future__ import division, print_function, absolute_import
#
# Author: Travis Oliphant 2001
#
# Feb 2010: Warren Weckesser
# Rewrote lsim2 and added impulse2.
# Apr 2011: Jeffrey Armstrong <jeff@approximatrix.co... | mit |
ManiacalLabs/BiblioPixel | bibliopixel/control/routing.py | 2 | 2424 | from .. project import construct
from .. util import deprecated, flatten
from . action import ActionList
from . receiver import Receiver
class Routing(Receiver):
"""
A dict that routes a message to an ActionList.
"""
def __init__(self, routing, default, python_path):
"""
:param dict r... | mit |
zhjunlang/kbengine | kbe/res/scripts/common/Lib/pickletools.py | 74 | 91170 | '''"Executable documentation" for the pickle module.
Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here. Some functions meant for external use:
genops(pickle)
Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
dis(pickle, out=None, memo=None, indentl... | lgpl-3.0 |
patmcb/odoo | openerp/addons/test_access_rights/tests/test_ir_rules.py | 299 | 1220 | import openerp.exceptions
from openerp.tests.common import TransactionCase
class TestRules(TransactionCase):
def setUp(self):
super(TestRules, self).setUp()
self.id1 = self.env['test_access_right.some_obj']\
.create({'val': 1}).id
self.id2 = self.env['test_access_right.some_obj... | agpl-3.0 |
kurtdawg24/robotframework | atest/robot/output/html_output_stats.py | 30 | 1180 | from robot.api import logger
class WrongStat(AssertionError):
ROBOT_CONTINUE_ON_FAILURE = True
def get_total_stats(path):
return get_all_stats(path)[0]
def get_tag_stats(path):
return get_all_stats(path)[1]
def get_suite_stats(path):
return get_all_stats(path)[2]
def get_all_stats(path):
logg... | apache-2.0 |
etaos/etaos | kernel/python/lib/dict.py | 1 | 4692 | #
# ETA/OS - CPU class
# Copyright (C) 2017 Dean Hall
#
# This program 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 3 of the License, or
# (at your option) any later v... | lgpl-3.0 |
171121130/SWI | venv/Lib/encodings/cp737.py | 272 | 34681 | """ Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.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_map)
def decode(self,input,errors='strict... | mit |
paukenba/youtube-dl | youtube_dl/extractor/xbef.py | 105 | 1444 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
class XBefIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?xbef\.com/video/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://xbef.com/video/5119-glamourous-lesbians-smoking-drinking-and... | unlicense |
npdoty/pywikibot | pywikibot/proofreadpage.py | 3 | 33142 | # -*- coding: utf-8 -*-
"""
Objects used with ProofreadPage Extension.
The extension is supported by MW 1.21+.
This module includes objects:
* ProofreadPage(Page)
* FullHeader
* IndexPage(Page)
OCR support of page scans via:
- https://tools.wmflabs.org/phetools/hocr_cgi.py
- https://tools.wmflabs.org/phetools/ocr.... | mit |
CloudWareChile/OpenChile | openerp/addons/event/res_partner.py | 9 | 1403 | # -*- 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 |
gnmiller/craig-bot | craig-bot/lib/python3.6/site-packages/google/oauth2/id_token.py | 12 | 5590 | # Copyright 2016 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,... | mit |
nop33/indico | indico/modules/events/papers/__init__.py | 2 | 4743 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
pantonov/serna-free | tools/buildsys/buildver.py | 5 | 4025 | ##
## Copyright(c) 2009 Syntext, Inc. All Rights Reserved.
## Contact: info@syntext.com, http://www.syntext.com
##
## This file is part of Syntext Serna XML Editor.
##
## COMMERCIAL USAGE
## Licensees holding valid Syntext Serna commercial licenses may use this file
## in accordance with the Syntext Serna Commercial... | gpl-3.0 |
richhaase/kafka | tests/kafkatest/tests/client/consumer_rolling_upgrade_test.py | 23 | 4200 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
MaxVanDeursen/tribler | Tribler/Test/Core/Upgrade/test_torrent_upgrade_64_65.py | 1 | 1920 | import os
import shutil
from twisted.internet.defer import inlineCallbacks
from Tribler.Core.Upgrade.torrent_upgrade65 import TorrentMigrator65
from Tribler.Core.leveldbstore import LevelDbStore
from Tribler.Test.Core.Upgrade.test_torrent_upgrade_63_64 import AbstractTorrentUpgrade63to64
from Tribler.dispersy.util im... | lgpl-3.0 |
cselis86/edx-platform | common/test/acceptance/pages/lms/matlab_problem.py | 179 | 1024 | """
Matlab Problem Page.
"""
from bok_choy.page_object import PageObject
class MatlabProblemPage(PageObject):
"""
View of matlab problem page.
"""
url = None
def is_browser_on_page(self):
return self.q(css='.ungraded-matlab-result').present
@property
def problem_name(self):
... | agpl-3.0 |
dahool/vertaal | grappelli/dashboard/dashboards.py | 6 | 6370 | # coding: utf-8
"""
Module where grappelli dashboard classes are defined.
"""
# DJANGO IMPORTS
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django import forms
# GRAPPELLI IMPORTS
from grappelli.dashboard import modules
from grappelli.dashboard.utils impor... | gpl-3.0 |
gotlium/django-geoip-redis | demo/demo/settings.py | 1 | 5146 | # Django settings for demo project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('root', 'root@localhost'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite',
'USER': '',
'PASSWORD': '',
'HOST': '',
'... | gpl-3.0 |
Wilee999/panda3d | direct/src/leveleditor/AnimGlobals.py | 8 | 1326 | """
This contains data structure and constants related with animation handling.
"""
# index for keyFramesInfo list structure
# data strucrure: {[nodeUID, propertyName] : [frameNum,
# value,
# [inSlopeX, inSlopeY],
# ... | bsd-3-clause |
ymow/nowin_core | nowin_core/message_bus/stomp.py | 2 | 4795 | import logging
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twisted.internet.defer import maybeDeferred
from twisted.internet.defer import returnValue
from nowin_core.patterns import observer
from nowin_core.stomp import async_client
class STOMPMessageBus(object):
... | mit |
falstaff84/u-boot | tools/patman/checkpatch.py | 31 | 6898 | # Copyright (c) 2011 The Chromium OS Authors.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# 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
# t... | gpl-2.0 |
ujenmr/ansible | lib/ansible/modules/network/aci/aci_tenant_action_rule_profile.py | 27 | 6462 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... | gpl-3.0 |
aioue/ansible | lib/ansible/modules/network/nxos/nxos_smu.py | 40 | 5987 | #!/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 |
TathagataChakraborti/resource-conflicts | PLANROB-2015/seq-sat-lama/Python-2.5.2/Lib/plat-mac/lib-scriptpackages/SystemEvents/Hidden_Suite.py | 82 | 1253 | """Suite Hidden Suite: Hidden Terms and Events for controlling the System Events application
Level 1, version 1
Generated from /System/Library/CoreServices/System Events.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'tpnm'
from StdSuites.Type_Names_Suite import *
c... | mit |
untitaker/beets | test/test_importadded.py | 25 | 7186 | # This file is part of beets.
# Copyright 2015, Stig Inge Lea Bjornsen.
#
# 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... | mit |
antepsis/anteplahmacun | sympy/categories/tests/test_baseclasses.py | 98 | 5704 | from sympy.categories import (Object, Morphism, IdentityMorphism,
NamedMorphism, CompositeMorphism,
Diagram, Category)
from sympy.categories.baseclasses import Class
from sympy.utilities.pytest import raises
from sympy import FiniteSet, EmptySet, Dict, Tuple
... | bsd-3-clause |
katrid/django | django/middleware/clickjacking.py | 87 | 1988 | """
Clickjacking Protection Middleware.
This module provides a middleware that implements protection against a
malicious site loading resources from your site in a hidden frame.
"""
from django.conf import settings
class XFrameOptionsMiddleware(object):
"""
Middleware that sets the X-Frame-Options HTTP head... | bsd-3-clause |
rafiqsaleh/VERCE | verce-hpc-pe/src/networkx/generators/tests/test_geometric.py | 88 | 1036 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestGeneratorsGeometric():
def test_random_geometric_graph(self):
G=nx.random_geometric_graph(50,0.25)
assert_equal(len(G),50)
def test_geographical_threshold_graph(self):
G=nx.geographical_threshold_graph(50,10... | mit |
remitamine/youtube-dl | youtube_dl/extractor/br.py | 30 | 11903 | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
parse_duration,
parse_iso8601,
xpath_element,
xpath_text,
)
class BRIE(InfoExtractor):
IE_DESC = 'Bayerisc... | unlicense |
apradhn/python_koans | python3/koans/about_classes.py | 68 | 4778 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutClasses(Koan):
class Dog:
"Dogs need regular walkies. Never, ever let them drive."
def test_instances_of_classes_can_be_created_adding_parentheses(self):
# NOTE: The .__name__ attribute will convert the class
... | mit |
kostya-sh/FrameworkBenchmarks | toolset/setup/linux/setup_util.py | 40 | 5611 | import re
import os
import sys
import subprocess
import platform
from threading import Thread
from Queue import Queue, Empty
class NonBlockingStreamReader:
'''
Enables calling readline in a non-blocking manner with a blocking stream,
such as the ones returned from subprocess.Popen
Originally written by Eyal... | bsd-3-clause |
madan96/sympy | sympy/solvers/pde.py | 13 | 35505 | """
This module contains pdsolve() and different helper functions that it
uses. It is heavily inspired by the ode module and hence the basic
infrastructure remains the same.
**Functions in this module**
These are the user functions in this module:
- pdsolve() - Solves PDE's
- classify_pde() - Classif... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.