text
stringlengths
475
200k
import os import six import logging from collections import defaultdict from scrapy.exceptions import NotConfigured from scrapy.http import Response from scrapy.http.cookies import CookieJar from scrapy.utils.python import to_native_str logger = logging.getLogger(__name__) class CookiesMiddleware(object): """Th...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import slugify from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class SlugifyTests(SimpleTestCase): """ Running slugify on a pre-escaped string le...
# -*- coding: utf-8 -*- from datetime import datetime import openerp from openerp import tools from openerp import SUPERUSER_ID from openerp.addons.website.models.website import slug from openerp.osv import osv, fields from openerp.tools import html2plaintext from openerp.tools.translate import _ class KarmaError(V...
import tensorflow as tf class AssignmentView: def __init__(self): self.variables = {} self.variables["total_vertex_count"] = tf.placeholder(tf.int32) self.variables["vertex_indices"] = tf.placeholder(tf.int32) self.variables["from_range"] = tf.placeholder(tf.int32) def get_al...
""" Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.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 d...
# -*- coding: utf-8 -*- ############################################################################## # # This program 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 L...
"""Bayesian Data Analysis, 3rd ed Chapter 5, demo 2 Hierarchical model for SAT-example data (BDA3, p. 102) """ from __future__ import division import numpy as np from scipy.stats import norm import scipy.io # For importing a matlab file import matplotlib.pyplot as plt # Edit default plot settings (colours from colo...
from django.contrib.auth.models import User, Group from rest_framework import serializers from accounts.models import * from album.models import * from comment.models import * from notification.models import * from post.models import * from tag.models import * # accout class UserSerializer(serializers.HyperlinkedMode...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.test import TestCase, override_settings from django.test.client import RequestFactory from django.views.generic.base import View from django.views.gen...
""" Unit tests for stem.descriptor.export. """ import unittest try: from StringIO import StringIO except ImportError: from io import StringIO import stem.prereq import test.runner from stem.descriptor.export import export_csv, export_csv_file from test.mocking import ( get_relay_server_descriptor, get_brid...
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
# encoding: utf-8 """ Utilities for version comparison It is a bit ridiculous that we need these. """ #----------------------------------------------------------------------------- # Copyright (C) 2013 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the f...
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Implements ThreadPoolExecutor.""" from __future__ import with_statement import atexit import threading import weakref import sys from concurrent.futures import _base try: import queue except ImportError: ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import absolute_import, division, print_function import sys import re import datetime import types impor...
"""Functions copypasted from newer versions of numpy. """ from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy._lib._version import NumpyVersion if NumpyVersion(np.__version__) > '1.7.0.dev': _assert_warns = np.testing.assert_warns else: def _assert...
# Copyright (c) 2006 The Regents of The University of Michigan # 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 ...
from django.test import Client, SimpleTestCase, override_settings from django.utils.translation import override @override_settings(ROOT_URLCONF="view_tests.urls") class CsrfViewTests(SimpleTestCase): def setUp(self): super(CsrfViewTests, self).setUp() self.client = Client(enforce_csrf_checks=True...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2017 OSGeo # # 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 ...
from __future__ import division, print_function, absolute_import _have_pil = True try: from scipy.misc.pilutil import imread as _imread except ImportError: _have_pil = False __all__ = ['imread'] # Use the implementation of `imread` in `scipy.misc.pilutil.imread`. # If it weren't for the different names of...
from __future__ import absolute_import, unicode_literals from operator import attrgetter from django.core.exceptions import FieldError from django.db import connection from django.test import TestCase from django.test.utils import CaptureQueriesContext from django.utils import six from .models import (Chef, CommonIn...
#----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this softwa...
import sqlalchemy as sa from sqlalchemy import testing, util from sqlalchemy.orm import mapper, deferred, defer, undefer, Load, \ load_only, undefer_group, create_session, synonym, relationship, Session,\ joinedload, defaultload, aliased, contains_eager, with_polymorphic from sqlalchemy.testing import eq_, Asse...
# Copyright (C) 2010 Chris Jerdonek ([EMAIL]) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the followin...
# Copyright (c) 2011, Thomas Paviot ([EMAIL]) # All rights reserved. # This file is part of the StepClassLibrary (SCL). # # 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 t...
import collections import os import sys from optparse import OptionParser, NO_DEFAULT import imp import warnings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError, handle_default_options from django.core.management.color import color_style from dj...
from types import NoneType import copy import re import sys import pymongo from pulp.common.dateutils import parse_iso8601_datetime from pulp.server import exceptions as pulp_exceptions from pulp.server.db.model.base import Model class Criteria(Model): def __init__(self, filters=None, sort=None, limit=None, ski...
#!/usr/bin/env python # # Copyright 2012 Fairwaves # # 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...
#!/opt/datadog-agent/embedded/bin/python ''' Datadog www.datadoghq.com ---- Make sense of your IT Data Licensed under Simplified BSD License (see LICENSE) (C) Boxed Ice 2010 all rights reserved (C) Datadog, Inc. 2010-2014 all rights reserved ''' # set up logging before importing any other c...
#!/usr/bin/env python ''' Ansible module for mediatype ''' # vim: expandtab:tabstop=4:shiftwidth=4 # # Zabbix mediatype ansible module # # # Copyright 2015 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...
# Copyright 2021 The FedLearner 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...
# file findingaids/fa/tests/models.py # # Copyright 2012 Emory University Library # # 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 ...
"""multiple comments Remove all comment column and add 2 new tables: * one comment table * one table to make the link between pt object and the comments Revision ID: 538bc4ea9cd1 Revises: 29fc422c56cb Create Date: 2015-05-05 11:03:45.982893 """ # revision identifiers, used by Alembic. revision = '538bc4ea9cd...
"""Bisection algorithms.""" def insort_right(a, x, lo=0, hi=None): """Insert item x in list a, and keep it sorted assuming a is sorted. If x is already in a, insert it to the right of the rightmost x. Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched. """ ...
#!/usr/bin/env python # # Copyright 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 (at your option) # ...
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import int_or_none class MusicPlayOnIE(InfoExtractor): _VALID_URL = r'https?://(?:.+?\.)?musicplayon\.com/play(?:-touch)?\?(?:v|pl=100&play)=(?P<id>\d+)' _TEST = { 'url': 'http://en.mu...
# -*- coding: utf-8 -*- from contextlib import contextmanager from django.utils import six from django.utils.encoding import force_text from django.utils.translation import get_language as _get_language from django.utils.translation import get_language_info from django.utils.functional import lazy from modeltranslati...
# -*- coding: utf-8 -*- # # spikeplot - plot_xvf_tensor.py # # Philipp Meier <pmeier82 at googlemail dot com> # 2011-09-29 # """plot the xi vs f tensor in a grid""" __docformat__ = 'restructuredtext' __all__ = ['xvf_tensor'] ##---IMPORTS from .common import save_figure, check_plotting_handle, plt ##---FUNCTION ...
""" XML serializer. """ from __future__ import unicode_literals from collections import OrderedDict from xml.dom import pulldom from xml.sax import handler from xml.sax.expatreader import ExpatParser as _ExpatParser from django.apps import apps from django.conf import settings from django.core.serializers import bas...
# -*- 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...
# -*- 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...
"""Configuration classes.""" from __future__ import absolute_import, print_function import os import sys from lib.util import ( CommonConfig, is_shippable, docker_qualify_image, ) from lib.metadata import ( Metadata, ) class EnvironmentConfig(CommonConfig): """Configuration common to all comma...
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
#!/usr/bin/env python import argparse import json import logging import multiprocessing as mp import os import signal import time from collections import defaultdict from random import sample from insights.core import archives from insights.core import load_package from insights.core.evaluators import MultiEvaluator,...
"""Package Index Tests """ import sys import os import unittest import pkg_resources from setuptools.compat import urllib2, httplib, HTTPError, unicode, pathname2url import distutils.errors import setuptools.package_index from setuptools.tests.server import IndexServer class TestPackageIndex(unittest.TestCase): d...
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join def configuration(parent_package='',top_path=None): from numpy.distutils.system_info import get_info, NotFoundError from numpy.distutils.misc_util import Configuration from scipy._build_utils i...
#!/usr/bin/python # # Copyright: Ansible Team # 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'], ...
import json from xmodule_django.models import UsageKey from xmodule.modulestore.django import SignalHandler from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from openedx.core.djangoapps.content.course_structures.models imp...
""" homeassistant.components.device_tracker.owntracks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OwnTracks platform for the device tracker. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.owntracks/ """ import json import logging im...
""" Course Goals Views - includes REST API """ import analytics from django.contrib.auth import get_user_model from django.conf import settings from django.db.models.signals import post_save from django.dispatch import receiver from django.http import JsonResponse from edx_rest_framework_extensions.authentication impo...
#_*_ coding:utf-8 _*_ import sys,os,getpass ####################################################################### def start_screen(): print (''' ***************************************************************************** If you have one account,then choose "登录(L)";if none, please choose "注册(R)" ...
# AnkiServer - A personal Anki sync server # Copyright (C) 2013 David Snopek # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any...
# -*- 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...
# -*- 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...
#! /usr/bin/python # -*- coding: latin-1 -*- # $Id: Message.py 662 2007-02-06 13:59:26Z mtr $ """ An implementation of the TUC Transfer Protocol. This module contains a TTP message class and an XML parser that transforms XML into a TTP message. Copyright (C) 2004, 2007 by Lingit AS Modified 25-may-2007, Kristian Ska...
""" Tests common to list and UserList.UserList """ import sys import os import unittest from test import test_support, seq_tests class CommonTest(seq_tests.CommonTest): def test_init(self): # Iterable arg is optional self.assertEqual(self.type2test([]), self.type2test()) # Init clears p...
# (c) 2016, James Cammarata <[EMAIL]> # # 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. # # ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.account.tests.common import AccountTestInvoicingCommon from odoo.tests import tagged @tagged('post_install', '-at_install') class TestProductMargin(AccountTestInvoicingCommon): def test_product_mar...
"""tzinfo implementations for psycopg2 This module holds two different tzinfo implementations that can be used as the 'tzinfo' argument to datetime constructors, directly passed to psycopg functions or used to set the .tzinfo_factory attribute in cursors. """ # psycopg/tz.py - tzinfo implementation # # Copyright (C) 2...
from __future__ import with_statement import os from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file ...
# Copyright 2016, 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...
"""Probability data from various sources. In this module, the "Essen corpus" refers to a corpus of 6,217 European folk songs from the Essen Folksong Collection. The songs are available at http://kern.ccarh.org/cgi-bin/ksbrowse?l=/essen and the list of songs used to train the monophonic key and meter programs is publis...
""" YAML serializer. Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__. """ from StringIO import StringIO import decimal import yaml from django.db import models from django.core.serializers.python import Serializer as PythonSerializer from django.core.serializers.python import Deserializer as...
from route_formatter_mixin import RouteFormatterMixin from ryu.services.protocols.bgp.operator.command import Command from ryu.services.protocols.bgp.operator.command import CommandsResponse from ryu.services.protocols.bgp.operator.command import STATUS_ERROR from ryu.services.protocols.bgp.operator.command import STA...
#!/usr/bin/env python2 # # Copyright (c) 2016 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementati...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from django.core.urlre...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import uni...
# 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...
#/u/Goldensights import praw import time import datetime '''USER CONFIG''' USERNAME = "" #This is the bot's Username. In order to send mail, he must have some amount of Karma. PASSWORD = "" #This is the bot's Password. USERAGENT = "" #This is a short description of what the bot does. For example "/u/GoldenSights'...
"""List package items.""" # :license: MIT, see LICENSE for more details. import click from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.managers import ordering from SoftLayer.utils import lookup COLUMNS = ['category', 'keyName', 'description', 'priceId'] COLUMNS_ITEM_PRICES = ...
import fnmatch import glob import os import re import sys from itertools import dropwhile from optparse import make_option from subprocess import PIPE, Popen from django.core.management.base import CommandError, BaseCommand from django.utils.text import get_text_list pythonize_re = re.compile(r'(?:^|\n)\s*//') plural...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jeroen Hoekx <[EMAIL]>, Alexander Bulimov <[EMAIL]> # # 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 ve...
""" Many-to-many relationships via an intermediary table For many-to-many relationships that need extra fields on the intermediary table, use an intermediary model. In this example, an ``Article`` can have multiple ``Reporter`` objects, and each ``Article``-``Reporter`` combination (a ``Writer``) has a ``position`` f...
""" Audio Interchange File Format (AIFF) parser. Author: Victor Stinner Creation: 27 december 2006 """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, UInt16, UInt32, Float80, TimestampMac32, RawBytes, NullBytes, String, Enum, PascalString32) from lib.hachoir_core.endia...
# # Builtin Definitions # from Symtab import BuiltinScope, StructOrUnionScope from Code import UtilityCode from TypeSlots import Signature import PyrexTypes import Options # C-level implementations of builtin types, functions and methods iter_next_utility_code = UtilityCode.load("IterNext", "ObjectHandling.c") ge...
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import atexit import sys from .ansitowin32 import AnsiToWin32 orig_stdout = sys.stdout orig_stderr = sys.stderr wrapped_stdout = sys.stdout wrapped_stderr = sys.stderr atexit_done = False def reset_all(): AnsiToWin32(orig_stdout).rese...
#### # Copyright 2000 by Timothy O'Malley <[EMAIL]> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and that both that cop...
# -*- coding: utf-8 -*- import os """ Merge Sort ---------- Uses divide and conquer to recursively divide and sort the list Time Complexity: O(n log n) Space Complexity: O(n) Auxiliary Stable: Yes Psuedo Code: CLRS. Introduction to Algorithms. 3rd ed. """ def merge(left, right): """ ...
#!/usr/bin/env python # NetView P v.0.7 - Linux # Dependencies: PLINK # Eike Steinig # Zenger Lab, JCU # https://github.com/esteinig/netview import os import time import shutil import argparse import subprocess import numpy as np import multiprocessing as mp import scipy.sparse.csgraph as csg import scipy.spatial.dist...
""" Decorators for views based on HTTP headers. """ try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from calendar import timegm from datetime import timedelta from email.Utils import formatdate from django.utils.decorators import decorato...
"""Profiler tools for CherryPy. CherryPy users ============== You can profile any of your pages as follows:: from cherrypy.lib import profiler class Root: p = profile.Profiler("/path/to/profile/dir") def index(self): self.p.run(self._index) index.exposed = Tr...
from datetime import timedelta, datetime import queue from urllib import error from functools import partial import logging from PyQt5 import QtWidgets, QtCore, QtGui from pyjtt import base_classes, core, utils, workers from pyjtt.widgets import login_window, main_window, worklog_window __author__ = "Nikolay Golub (...
# copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google Inc. # # Licensed under the Apache License Version 2.0 = uthe "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http //www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
""" Backport of Python 3's int, based on Py2's long. They are very similar. The most notable difference is: - representation: trailing L in Python 2 removed in Python 3 """ from __future__ import division import struct import collections from future.types.newbytes import newbytes from future.types.newobject import ...
import sys import os sys.path.append('../../software/models/') from utilFunctions import wavread import scipy.io.wavfile import numpy as np """ A1-Part-2: Basic operations with audio Write a function that reads an audio file and returns the minimum and the maximum values of the audio samples in that file. The in...
# Copyright (c) 2012 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 re from telemetry.core import util from telemetry.core import exceptions from telemetry.page.actions import page_action def _EscapeSelector(sele...
# Copyright 2021 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, ...
""" Views used by XQueue certificate generation. """ import json import logging from django.contrib.auth.models import User from django.http import HttpResponse, Http404, HttpResponseForbidden from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST import dogstats_wra...
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:[EMAIL] # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by th...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- try: # Change main dir to this (need for Pentest Box) import os os.path.abspath(__file__) from Classes import (Credits, OKadminFinderClass, MessengerClass) import argparse from colorama import Fore,...
from __future__ import unicode_literals import re from django.core.exceptions import ValidationError from django.utils import six from django.utils.deconstruct import deconstructible from django.utils.encoding import force_text from django.utils.functional import SimpleLazyObject from django.utils.ipv6 import is_vali...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import atexit import...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011 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 Free Software Foundation; either version 2 of the ## Licens...
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
# -*- coding: utf-8 -*- IS_POSTALCODES = ( ('101', u'101 Reykjavík'), ('103', u'103 Reykjavík'), ('104', u'104 Reykjavík'), ('105', u'105 Reykjavík'), ('107', u'107 Reykjavík'), ('108', u'108 Reykjavík'), ('109', u'109 Reykjavík'), ('110', u'110 Reykjavík'), ('111', u'111 Reykjavík'...
#! /usr/bin/python3 import sys import json import os import subprocess import apt import apt_pkg import apt.progress.text import apt.progress.base from urllib.request import urlretrieve from gi.repository import Gtk # harus diganti saat rilis PREFIX = '/home/mnirfan/Projects/modularitea/' # executable apt APT_PATH =...
# coding: UTF-8 # !/usr/bin/env python from __future__ import absolute_import try: from setuptools import setup except ImportError: from distutils.core import setup import usig_normalizador_amba with open('README.rst', 'r') as f: readme = f.read() setup( name=usig_normalizador_amba.__title__, ver...
# -*- coding: utf-8 -*- """ Sahana Eden Messaging Model @copyright: 2009-2015 (c) Sahana Software Foundation @license: MIT 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 wit...
#runas solve() #unittest.skip recursive generator #pythran export solve() ''' From O'Reilly's Python Cookbook ''' def _combinators(_handle, items, n): if n==0: yield [] return for i, item in enumerate(items): this_one = [ item ] for cc in _combinators(_handle, _handle(items, i),...
import os import pickle import copy import numpy as np CODES = {'<PAD>': 0, '<EOS>': 1, '<UNK>': 2, '<GO>': 3 } def load_data(path): """ Load Dataset from File """ input_file = os.path.join(path) with open(input_file, 'r', encoding='utf-8') as f: return f.read() def preprocess_and_save...