content stringlengths 4 20k |
|---|
##################################################
######scikit_learn to do the classifications######
##################################################
##################################################
from sklearn import svm
##################################################
#####Hard coded (currently) where the d... |
import CatalogItem
import time
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from otp.otpbase import OTPLocalizer
from direct.interval.IntervalGlobal import *
from toontown.toontowngui import TTDialog
from toontown.estate import GardenTutorial
class CatalogGardenStarterItem(Ca... |
# -*- coding: utf-8 -*-
import operator
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
from django.core.cache import cache
from django.utils import timezone
from django.conf import settings
from djan... |
"""
Testing for Theil-Sen module (sklearn.linear_model.theil_sen)
"""
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import os
import sys
from contextlib import contextmanager
import numpy as np
from numpy.testing import assert_array_equal, assert_array_less
from numpy.testi... |
"""
Originally coded by @xtr4nge
"""
#import multiprocessing
import threading
import logging
import json
import sys
from flask import Flask
from core.configwatcher import ConfigWatcher
from core.proxyplugins import ProxyPlugins
app = Flask(__name__)
class mitmfapi(ConfigWatcher):
__shared_state = {}
def ... |
#!/usr/bin/python
###################################################
### THE VALUES BELOW CAN BE EDITED AS NEEDED ######
###################################################
writeClassesFile = True # TRUE: Writes mark classes to external file. FALSE: Writes mark classes as part of mark.fea file.
genMkmkFeature = ... |
from footprint.main.models.keys.keys import Keys
__author__ = 'calthorpe_analytics'
class GeometryTypeKey(Keys):
"""
A Key class to key Geometry Type instances
"""
class Fab(Keys.Fab):
@classmethod
def prefix(cls):
# No prefix since these are so fundamental and are use... |
# -*- coding: utf-8 -*-
import os
# The paths that contain custom static files (such as style sheets).
html_static_path = ['_static']
# Check whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
# Only import and set the theme if we're building docs locally; otherwise,
# readthed... |
"""\
Guitar
By Joe Esposito
Contains classes for storing and manipulating guitar tabs in a structured manor.
"""
from collections import OrderedDict
from itertools import product
from StringIO import StringIO
# TODO: str(song), len(song.staffs), song.song_info, song.errors
# def __str__(self):
# head = str(self.... |
"""
=============================
Recursive feature elimination
=============================
A recursive feature elimination example showing the relevance of pixels in
a digit classification task.
.. note::
See also :ref:`sphx_glr_auto_examples_feature_selection_plot_rfe_with_cross_validation.py`
"""
print(__d... |
import datetime
import gspread
from xml.dom.minidom import parse
import sys
import re
import os
class ModuleCoverage():
def __init__(self, name, exprs, toplevel):
self.name = name
self.exprs = exprs
self.toplevel = toplevel
def find(f, seq):
"""Return first item in sequence where f(ite... |
"""
Summary
=======
Plugin for breaking up long index pages with many entries into pages.
Install
=======
This plugin comes with douglas. To install, do the following:
1. Add ``douglas.plugins.paginate`` to your ``load_plugins`` list
variable in your ``config.py`` file.
Make sure it's the first plugin in t... |
import taskflow.engines
from taskflow.patterns import linear_flow
from taskflow import task as base
from taskflow import test
def add(a, b):
return a + b
class BunchOfFunctions(object):
def __init__(self, values):
self.values = values
def run_one(self, *args, **kwargs):
self.values.app... |
"""client.py - client for wikitweets"""
import os
import re
import sys
import random
import getopt
import logging
import logging.config
import ConfigParser
import twitter # pip install python-twitter
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol
from twisted.python import log a... |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import grpc_helpers # type: ignore
from google.api_core import gapic_v1 # type: ignore
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type... |
from bcc import BPF
from time import strftime
# linux stats
loadavg = "/proc/loadavg"
# define BPF program
bpf_text = """
#include <uapi/linux/ptrace.h>
#include <linux/oom.h>
struct data_t {
u32 fpid;
u32 tpid;
u64 pages;
char fcomm[TASK_COMM_LEN];
char tcomm[TASK_COMM_LEN];
};
BPF_PERF_OUTPUT(... |
"""
This module is installed as the `shoop_admin` template function namespace.
"""
import itertools
from django.core.urlresolvers import NoReverseMatch, reverse
from django.middleware.csrf import get_token
from jinja2.utils import contextfunction
from shoop.admin import menu
from shoop.admin.breadcrumbs import Bread... |
import tacticenv
from pyasm.common import Common, Environment
from tactic.command import JobTask
import time
import sys
import os
def main(options, site=None):
#print "Starting Job Queue ..."
from pyasm.security import Batch
Batch(site=site)
idx = 0
if 'index' in options:
idx = options['... |
import os
import sys
import platform
node = platform.node()
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
BASE_URL = 'http://mu.ludolo.it'
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('ludo', '<EMAIL>'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysq... |
import builtins
import os
from subprocess import CalledProcessError
from textwrap import dedent
import dockerfile_parse
import pytest
from dockerfile_parse import constants as dfp_constants
from unittest.mock import MagicMock, call, sentinel, create_autospec
from stdci_tools import dockerfile_utils
from stdci_tools.d... |
#!/usr/bin/env python
''' Tests for matrix functionality. '''
from __future__ import division
__author__ = 'Tom Wright <<EMAIL>>'
# Copyright 2012 Thomas Wright <<EMAIL>>
# This file is part of C1000 Intelligent Calculator.
#
# C1000 Intelligent Calculator is free software: you can redistribute it
# and/or modify it un... |
from oldowan.mtconvert import seq2sites, sites2seq, str2sites
from string import translate
import pandas as pd
import numpy as np
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,'SeqRange'])
with ... |
"""Firefox Profile management."""
import ConfigParser
import logging
import os
import re
import shutil
import subprocess
import tempfile
import utils
DEFAULT_PORT = 7055
ANONYMOUS_PROFILE_NAME = "WEBDRIVER_ANONYMOUS_PROFILE"
def get_profile_ini():
app_data_dir = utils.get_firefox_app_data_dir()
prof... |
# -*- coding: utf-8 -*-
"""
sphinx.util.pycompat
~~~~~~~~~~~~~~~~~~~~
Stuff for Python version compatibility.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import io
import sys
import codecs
import warnings
from six import class_type... |
"""Allows the use of an intermediary inner test runner."""
import os
import sys
import shlex
from . import plugin
from .. import test
from .. import output
from .. import exit_codes
class InnerRunner(plugin.Plugin):
"""
Allows the use of an intermediary inner test runner
"""
name = 'inner_runner'
... |
from test_framework.mininode import *
from test_framework.test_framework import DashTestFramework
from test_framework.util import *
from time import *
'''
autois-mempool.py
Checks if automatic InstantSend locks stop working when transaction mempool
is full (more than 0.1 part from max value).
'''
MAX_MEMPOOL_SIZE... |
from troposphere import Tags
from . import AWSObject, AWSProperty
from .validators import boolean, double
def resolver_kind_validator(x):
valid_types = ["UNIT", "PIPELINE"]
if x not in valid_types:
raise ValueError("Kind must be one of: %s" % ", ".join(valid_types))
return x
class ApiCache(AWSO... |
from __future__ import print_function
from lib.iso14229_1 import Constants, Iso14229_1, NegativeResponseCodes, ServiceID, Services
from tests.mock.mock_ecu_uds import MockEcuIso14229
from modules import uds
import unittest
class UdsModuleTestCase(unittest.TestCase):
ARB_ID_REQUEST = 0x300E
ARB_ID_RESPONSE = 0... |
#! /usr/bin/env python
# encoding: utf-8
# harald at klimachs.de
import re
from waflib import Utils
from waflib.Tools import fc,fc_config,fc_scan
from waflib.Configure import conf
from waflib.Tools.compiler_fc import fc_compiler
fc_compiler['linux'].append('fc_solstudio')
@conf
def find_solstudio(conf):
"""Find the... |
from PySide2 import QtCore, QtGui, QtWidgets
import os
import logging
logger = logging.getLogger(__name__)
from hyo2.soundspeedmanager.dialogs.dialog import AbstractDialog
from hyo2.soundspeedmanager.dialogs.raw_data_model import RawDataModel
from hyo2.soundspeedmanager.dialogs.proc_data_model import ProcDataModel
... |
# I downloaded many pdfs by observing the url pattern of the pdf
# `seq 160000 # 169999 | parallel wget http://egazette.nic.in/Write^CadData/2016/{}.pdf`
from splinter import Browser
from bs4 import BeautifulSoup
import time
import json
url = "http://egazette.nic.in"
browser = Browser()
browser.visit(url)
browser.cli... |
import os
import environ
# PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
# PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
# BASE_DIR = PACKAGE_ROOT
# PROJECT_ROOT = environ.Path(__file__) - 2
ROOT_DIR = environ.Path(__file__) - 4
APP_DIR = ROOT_DIR.path('src')
PROJECT_R... |
# -*- coding: utf-8 -*-
import os
import re
from module.PyFile import PyFile
class ArchiveError(Exception):
pass
class CRCError(Exception):
pass
class PasswordError(Exception):
pass
class Extractor:
__name__ = "Extractor"
__version__ = "0.24"
__description__ = """Base extractor plu... |
import smtplib
import logging
import mimetypes
from email.mime.multipart import MIMEMultipart
from email import encoders
from email.mime.audio import MIMEAudio
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.text import MIMEText
from jobcrawl import settings
import os
email_... |
#!/usr/bin/env python
import pytest
numpy = pytest.importorskip('numpy')
scipy = pytest.importorskip('scipy')
import networkx as nx
from networkx.algorithms import node_classification
class TestHarmonicFunction:
def test_path_graph(self):
G = nx.path_graph(4)
label_name = 'label'
G.nodes... |
#!/usr/bin/env python
# encoding: utf-8
from abc import abstractmethod, ABCMeta
import datetime
import random
import time
import unittest
class PRNG:
"""
Represents default PRNG (currently, wrapper class for random module).
"""
def __init__(self):
"""
Constructs PRNG instance
"""
# Default se... |
"""
The I{soaparray} module provides XSD extensions for handling
soap (section 5) encoded arrays.
"""
from suds import *
from logging import getLogger
from suds.xsd.sxbasic import Factory as SXFactory
from suds.xsd.sxbasic import Attribute as SXAttribute
class Attribute(SXAttribute):
"""
Represents an XSD <a... |
"""
Tests that skipped rows are properly handled during
parsing for all of the parsers defined in parsers.py
"""
from datetime import datetime
from io import StringIO
import numpy as np
import pytest
from pandas.errors import EmptyDataError
from pandas import DataFrame, Index
import pandas._testing as tm
@pytest.... |
"""
Perceptron training example
This is example has 3 binary inputs and a single output.
"""
def fire(xVec,wVec):
"""
Implements a single threshold perceptron
xVec is the input vector
wVec is the weight vector of the neuron connections
The size of wVec ... |
from primaires.interpreteur.contexte import Contexte
from reseau.connexions.client_connecte import ENCODAGES
class ChangerEncodage(Contexte):
"""Contexte de changement d'encodage.
On affiche au client plusieurs possibilités d'encodage.
Il est censé choisir celui qu'il voit correctement.
On part du prin... |
TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
# An envvar key for determining the project id to use. ... |
"""Unit test for treadmill.appcfg
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import shutil
import tempfile
import unittest
from treadmill import appcfg
from treadmill import fs
class AppCfgTest(u... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Customer',
fields=[
('created', models.DateTime... |
"""Camera abstraction layer for Windows.
The Capture class provided from this module encapsules the VideoCapture module
by Markus Gritsch for Win32: http://videocapture.sourceforge.net/
Author: Bjoern Barz
"""
from VideoCapture import Device
class Capture(object):
"""Provides access to video device... |
"""Tests for Keras' base preprocessing layer."""
import json
import os
from absl.testing import parameterized
import numpy as np
from tensorflow.python import keras
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.eager import context
from tensorflow.python.framework import constant_op
from... |
try:
from urllib.parse import urljoin
from urllib.parse import urlencode
import urllib.request as urlrequest
except ImportError:
from urlparse import urljoin
from urllib import urlencode
import urllib2 as urlrequest
import json
import datetime
API_URL_DEFAULT = 'https://api.hipchat.com/v1/'
FOR... |
"""Forms for API management."""
from django import forms
from django.utils.translation import ugettext as _
from openedx.core.djangoapps.api_admin.models import ApiAccessRequest
from openedx.core.djangoapps.api_admin.widgets import TermsOfServiceCheckboxInput
class ApiAccessRequestForm(forms.ModelForm):
"""Form ... |
from invoke import task
from paramiko import SSHClient, AutoAddPolicy
import os
@task
def getkeys(ctx):
ctx.run("cp ~/.docker/machine/machines/bootstrap01/ca.pem ca.pem", pty=True)
ctx.run("cp ~/.docker/machine/machines/bootstrap01/cert.pem cert.pem", pty=True)
ctx.run("cp ~/.docker/machine/machines/boots... |
import os
import unittest
from rope.base import exceptions
from ropetest import testutils
class PythonFileRunnerTest(unittest.TestCase):
def setUp(self):
super(PythonFileRunnerTest, self).setUp()
self.project = testutils.sample_project()
self.pycore = self.project.pycore
def tearDow... |
import pytest
from share.models import SourceConfig
data = r'''
{
"record": [
"OpenTeQ - Opening the black box of Teacher Quality",
"https://www.socialscienceregistry.org/trials/1638",
"June 06, 2017",
"2017-06-06 11:59:10 -0400",
"2017-06-06",
"AEARCTR-0001638",
... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from past.utils import old_div
from future.moves.urllib.parse import urlencode
import logging
from flexget import plugin
from flexget.entry import Entry
from flexget.event impo... |
import os
import virtualenv
import textwrap
import re
def gather_deps(dir):
depfiles = []
for (dirpath, dirnames, filenames) in os.walk(dir):
if 'depends.py' in filenames:
depfiles.append(os.path.join(dirpath, 'depends.py'))
dependencies = {}
dep_re = re.compile(r"^\s*ms.version.ad... |
from rest_framework import serializers as ser
from framework.auth.core import Auth
from website.project.model import Comment
from rest_framework.exceptions import ValidationError, PermissionDenied
from api.base.exceptions import InvalidModelValueError
from api.base.utils import absolute_reverse
from api.base.serializer... |
from mock import Mock
import unittest
from nav.models.manage import Netbox, Interface
from nav.web.portadmin.utils import *
from nav.portadmin.snmputils import *
###############################################################################
class PortadminResponseTest(unittest.TestCase):
def setUp(self):
... |
import handlers.baseHandler as base
import handlers.mainHandler as main
import handlers.postHandler as post
import handlers.userHandler as user
import handlers.categoryHandler as cate
import handlers.api.postApiHandler as postApi
urls = [
(r'/', main.IndexHandler),
(r'/site/(\w+)', main.IndexHandler),
(r'/... |
from graphene.storage import GeneralStore, Relationship, Property
from graphene.storage.intermediate import GeneralStoreManager
class RelationshipPropertyStore:
def __init__(self, storage_manager):
"""
Set up the relationship-property store, which associates
relationships with their propert... |
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django import forms
from django_bolts.utils import make_unique_name,modify_request_query, init_constructor
from collections import OrderedDict
from django.contrib.auth import login
from django.db.models.query import QuerySet
__all__ = ['Lis... |
"""
Utilities for working with numpy arrays.
"""
from numpy.lib.stride_tricks import as_strided
def repeat_first_axis(array, count):
"""
Restride `array` to repeat `count` times along the first axis.
Parameters
----------
array : np.array
The array to restride.
count : int
Num... |
"""
Compile Tensorflow Models
=========================
This article is an introductory tutorial to deploy tensorflow models with TVM.
For us to begin with, tensorflow python module is required to be installed.
Please refer to https://www.tensorflow.org/install
"""
# tvm and nnvm
import nnvm
import tvm
# os and num... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
SagaAlgorithm.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... |
"""
usage: python ./pca_space.py name data roifile cond tr [, filtfile]
"""
import sys, os
import numpy as np
from fmrilearn.analysis import fir
from sklearn.decomposition import PCA
from wheelerexp.base import Space
from wheelerexp.base import DecomposeExp
from wheelerexp.common import process_exp_argv
from wheel... |
from openmdao.api import Group, Component, Problem, IndepVarComp, ExecComp, ScipyOptimizer
from hyperloop.Python.pod.magnetic_levitation.breakpoint_levitation import BreakPointDrag
from hyperloop.Python.pod.magnetic_levitation.breakpoint_levitation import MagMass
from hyperloop.Python.pod.magnetic_levitation.magneti... |
from pykickstart.base import KickstartCommand
from pykickstart.options import KSOptionParser
from pykickstart.version import F28
class F28_Authselect(KickstartCommand):
removedKeywords = KickstartCommand.removedKeywords
removedAttrs = KickstartCommand.removedAttrs
def __init__(self, writePriority=0, *arg... |
from . import _
from enigma import *
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Sources.List import List
from Tools.Directories import resolveFilename, SCOPE_CURRENT_PLUGIN
from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest
from ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... |
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict # Python 2.6
from django.utils.translation import ugettext_lazy as _t
from desktop import appmanager
from desktop.conf import is_hue4
from desktop.lib.conf import Config, UnspecifiedConfigSection, ConfigSection,\
c... |
from rdfextras import sparql
import rdfextras.sparql.parser
from rdfextras.sparql.algebra import TopEvaluate
from rdflib.namespace import RDFS, RDF, OWL
from rdfextras.sparql.components import Query, Prolog
class Processor(sparql.Processor):
def __init__(self, graph):
self.graph = graph
def query(sel... |
#!/usr/bin/env python3
"""
Use paired T-test to test the balance of reads coverage for ref. and alt allele.
Only use data from heterozygous sites, all homo or all missing return pvalue 1.
TWO INDEPENDENT samples T-test, Unequal variance.
http://docs.scipy.org/doc/scipy-0.16.0/reference/generated/scipy... |
# -*- coding: utf-8 -*-
"""
Abstract: Turns earthquake objects from RDF into python objects.
Using RDFlib it parses a RDF file and turns each Earthquake RDF object in that file to a Python Earthquake objects.
The Python Earthquake objects will be returned as an array.
This class inherits from RdfReader!
"""
__auth... |
from __future__ import division, unicode_literals
import re
import math
import subprocess
import itertools
import logging
import glob
import warnings
import numpy as np
from monty.fractions import lcm
import fractions
from six.moves import reduce
from pymatgen.io.vasp.inputs import Poscar
from pymatgen.core.sites i... |
"""
Tool to bootload the power modules from the command line.
"""
from __future__ import absolute_import
from platform_utils import System
System.import_libs()
import intelhex
import sys
import argparse
import logging
import time
from ioc import INJECTED, Inject
from logs import Logs
from serial_utils import Communica... |
# -*- coding: utf-8 -*-
"""This module tests HaloNotebook spinners.
"""
import os
import re
import sys
import time
import unittest
from spinners.spinners import Spinners
from halo import HaloNotebook
from halo._utils import get_terminal_columns, is_supported
from tests._utils import decode_utf_8_text, encode_utf_8_te... |
import os
from datetime import datetime, timedelta
from django.db import models
from django.core.exceptions import PermissionDenied, ValidationError
from mezzanine.conf import settings
from hs_core.signals import pre_check_bag_flag
class ResourceIRODSMixin(models.Model):
""" This contains iRODS methods to be i... |
# coding=utf-8
"""DockWidget test.
.. 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 License, or
(at your option) any later version.
"""
__author__ = ... |
import math
from datetime import datetime
import json
import os
#from decimal import Decimal
# See here for description of Jensen-Shannon Divergence http://enterotype.embl.de/enterotypes.html
# Jensen-Shannon "Distance" may be further calculated as SQRT(Jensen-Shannon Divergence)
# NOTE: Functions assume len(prob_dist... |
#####################################################
# Thanks to xunity maintenance tool for this code #
# We have edited slightly, original was checking #
# for any thumbs older than 28 days. Changed to 14 #
# which should hopefully help AFTV devices. #
##################################################... |
import os
import pytest
import stat
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
# Define fixture for dynamic ansible role variables.
# @see https://github.com/philpep/testinfra/issues/345#issuecomme... |
"""
EasyBuild support for building and installing Go, implemented as an easyblock
@author: Adam DeConinck (NVIDIA)
@author: Kenneth Hoste (HPC-UGent)
"""
import os
import shutil
from easybuild.easyblocks.generic.configuremake import ConfigureMake
from easybuild.tools.filetools import rmtree2, run_cmd
class EB_Go(Con... |
import random
from apache_beam.io.gcp.datastore.v1new import util
class AdaptiveThrottler(object):
"""Implements adaptive throttling.
See
https://landing.google.com/sre/book/chapters/handling-overload.html#client-side-throttling-a7sYUg
for a full discussion of the use case and algorithm applied.
"""
# ... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch, MagicMock
from ansible.errors import AnsibleError, AnsibleParserError
from ansible.executor.task_executor import TaskExecutor
from ansible.play... |
import math
__author__ = 'Celery'
import gtk
from base_widg import BaseWidg
from option_widg import OptionWidg
import midi.defaults.defaults as d
class PotWidg(BaseWidg):
def __init__(self, parent, engine):
BaseWidg.__init__(self, parent, engine)
self.option_widg = OptionWidg(self)
self... |
"""Search state manager object"""
import re
import urllib
import copy
from django.core import urlresolvers
from django.utils.http import urlencode
from django.utils.encoding import smart_str
import askbot
import askbot.conf
from askbot.conf import settings as askbot_settings
from askbot import const
from askbot.utils... |
{
'name': 'Custom Product parent code',
'version': '0.0.1',
'category': 'Generic Modules / Customization',
'description': """
Add extra 2 fields calculated only for one customer
used for categorize partner element:
- granfather default_code[:3]
- father default_code[... |
# 350. Intersection of Two Arrays II Add to List
# DescriptionSubmissionsSolutions
# Total Accepted: 58301
# Total Submissions: 132110
# Difficulty: Easy
# Contributor: LeetCode
# Given two arrays, write a function to compute their intersection.
#
# Example:
# Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].... |
import sys
import os
import marshal
import imp
import struct
import time
import unittest
from test import support
from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co
# some tests can be ran even without zlib
try:
import zlib
except ImportError:
zlib = None
from zipfi... |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.colors as colors
length_of_vecs = 100
histData = np.load('hidden_activations.npy')
my_data = histData # Replace with data to be used.
pca = PCA(n_components=length_of_vec... |
# Create your views here.
from datetime import datetime, time, timedelta
from itertools import groupby
import json
from django.db.models import Count
from django.http import HttpResponse
from django.template import Context, RequestContext
from django.template.loader import get_template
from django.utils import formats... |
#!/usr/bin/env python3
import os
import re
import sys
import subprocess
import xml.etree.ElementTree as ET
checkstyleJar = 'git-tools/lib/checkstyle-5.6-all.jar'
checkstyleStyle = 'git-tools/lib/tnoodle-java.xml'
# These third party directories are just littered with crap that I don't want to deal with
lintIgnoredDi... |
__doc__ = ""
import types
from nive.tools import Tool
from nive.definitions import ToolConf, IApplication
from nive.i18n import _
configuration = ToolConf(
id = "gcdump",
context = "nive.components.tools.gcdump.gcdump",
name = _(u"Object dump"),
description = _("This function dumps a list of all obj... |
import math
from django.shortcuts import render, redirect
from meals.models import Meal, Wbw_list, Participant, Participation, Bystander
from meals.forms import MealForm, WbwListsForm, ParticipationForm, BystanderForm
from django.conf import settings
from django.contrib import messages
from django.utils.timezone impor... |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... |
#!/usr/bin/env python
# encoding: utf-8
import jinja2
import os
import webapp2
import logging
# from google.appengine.api import memcache
from webapp2_extras import sessions
from webapp2_extras import sessions_memcache
from django.utils import simplejson
TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), 'templ... |
from __future__ import unicode_literals
import json
import re
from django.conf import settings
from django.db.models import Sum
from django.http import FileResponse
from django.http import HttpResponse
from django.http import HttpResponseForbidden
from django.http import UnreadablePostError
from django.utils import t... |
import os
import unittest
from telemetry import page as page_module
from telemetry.page import page_set
from telemetry.value import list_of_scalar_values
from telemetry.value import merge_values
from telemetry.value import scalar
class TestBase(unittest.TestCase):
def setUp(self):
ps = page_set.PageSet(file_pa... |
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from grappelli.dashboard import modules, Dashboard
from grappelli.dashboard.utils import get_admin_site_name
class DashboardIndex(Dashboard):
def init_with_context(self, context):
site_name = get_admi... |
import json
import inspect
from functools import partial
from collections import OrderedDict
from coalib.bears.LocalBear import LocalBear
from coala_utils.decorators import enforce_signature
from coalib.misc.Shell import run_shell_command
from coalib.results.Diff import Diff
from coalib.results.Result import Result
fr... |
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.colors as colors
import matplotlib.cm as cmx
import matplotlib as mpl
def create_dist_plots():
for n in [4,5,6,7,8,9,10]:
G = nx.read_gpickle('G_%i.gpickle' % n)
radi... |
"""Unit tests for the access_control_firerole library."""
__revision__ = "$Id$"
from invenio.base.wrappers import lazy_import
from invenio.testsuite import make_test_suite, run_test_suite, InvenioTestCase
acc_firerole_check_user = lazy_import('invenio_access.firerole:acc_firerole_check_user')
compile_role_definitio... |
from setuptools import find_packages, setup
VERSION = '0.6'
setup(
name = 's3rap',
packages = find_packages(),
version = VERSION,
platforms=['any'],
description = 'AWS S3 convenience functions based on boto3.',
author = 'Bob Colner',
author_email = '<EMAIL>',
url = 'https://github.com/... |
#!/usr/bin/python
import os
from parse import parse
from translate import translate
import json
import argparse
def translateExamples(inputDir, outputDir, targetsDir, includedTargets=None):
# Load all target dictionaries
targets = []
for target in os.listdir(targetsDir):
# Ignore targets not in in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.