src stringlengths 721 1.04M |
|---|
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# https://leetcode.com/problems/word-search-ii/
class Solution(object):
def findWords(self, board, words):
"""
:type board: List[List[str]]
:type words: List[str]
:rtype: List[str]
"""
trie = Trie()
for w in words:
trie.insert(w)
res = set... |
#!/usr/bin/python2.4
import sys
import math
localfloor = math.floor
class SpatialHash3D:
# Optimized version of SpatialHash for three dimensional space
# Optimizations work by assuming the following:
# The space is three dimensional;
# The area of a quadrant is r*r*r and r is always used as the radi... |
from __future__ import absolute_import
import six
class EventError(object):
# Generic
UNKNOWN_ERROR = "unknown_error"
# Schema validation
INVALID_DATA = "invalid_data"
INVALID_ATTRIBUTE = "invalid_attribute"
MISSING_ATTRIBUTE = "missing_attribute"
VALUE_TOO_LONG = "value_too_long"
FU... |
# (c) 2017, Jon Hadfield <jon@lessknown.co.uk>
"""
Description: This lookup takes an AWS region and a list of one or more
subnet names and returns a list of matching subnet ids.
Example Usage:
{{ lookup('aws_subnet_ids_from_names', ('eu-west-1', ['subnet1', 'subnet2'])) }}
"""
from __future__ import (absolute_import, ... |
from django.db import models
from django.conf import settings
from model_utils.models import TimeStampedModel
class WeeklyStats(TimeStampedModel):
player = models.ForeignKey('core.Player', related_name='player_stats')
season = models.ForeignKey('core.Season')
week = models.ForeignKey('core.Week', related... |
# coding: utf8
import rpw
# noinspection PyUnresolvedReferences
from rpw import revit, DB
from pyrevit.forms import WPFWindow
from pyrevit import script
from pyrevitmep.workset import Workset
# noinspection PyUnresolvedReferences
from System.Collections.ObjectModel import ObservableCollection
__doc__ = "Batch create ... |
import os
import logging
from datetime import datetime
from functools import partial
import plow.client
from plow.gui import constants
from plow.gui.manifest import QtCore, QtGui
from plow.gui.panels import Panel
from plow.gui.event import EventManager
from plow.gui.common import models
from plow.gui.common.widgets... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Paso'
db.create_table('paso', (
('clave_trabajador', self.gf('django.db.models.f... |
from chimera.core.chimeraobject import ChimeraObject
from chimera.util.position import Position
import os
import time
from select import select
class XEphem (ChimeraObject):
__config__ = {"telescope": "/Telescope/0",
"fifo_dir": "/usr/local/share/xephem/fifos"}
def __init__(self):
... |
# coding: utf-8
import requests
from utils import rest
class Stash(object):
def __init__(self, server):
self.__server = server
def get_stash_branches(self, repos, project, filter):
results = []
for repo in repos:
path = '/rest/api/1.0/projects/{project}/repos/{repo}/branc... |
from functools import total_ordering
def _less_than(first, second):
if first == second:
return False
if first is None:
return True
if second is None:
return False
return first < second
def _score_difference_multiplier(old, new):
new = 0 if new is None else new
old = 1 if old is None or old == 0 else old... |
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
# -*- coding: utf-8 -*-
#
# XWorkflows documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 20 14:00:10 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
#!/usr/bin/env python
# Copyright NumFOCUS
#
# 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.txt
#
# Unless required by applicable law or ... |
# taken from from django.http import HttpResponseRedirect
from django.http import HttpResponseRedirect
from django.conf import settings
from re import compile
EXEMPT_URLS = [compile(settings.LOGIN_URL.lstrip('/'))]
if hasattr(settings, 'LOGIN_EXEMPT_URLS'):
EXEMPT_URLS += [compile(expr) for expr in settings.LOGIN_... |
from .database_utility import get_action_params, insert_table
class QueryCreator(object):
"""
We put here complex queries.
"""
def __init__(self):
pass
@staticmethod
def substitute(query, args, arg_list):
if arg_list is not None:
arg_list.extend(args)
else... |
"""
Created on Wed Jul 20 2016
This tutorial is on:
landlab/tutorials/ecohydrology/cellular_automaton_vegetation_flat_surface.ipynb
Creating a (.py) version of the same.
@author: Sai Nudurupati & Erkan Istanbulluoglu
"""
import os
import time
import numpy as np
from landlab import RasterModelGrid, load_params
fro... |
from __future__ import print_function
import functools
import json
import logging
import os
import sys
import runpy
from insights.client import InsightsClient
from insights.client.config import InsightsConfig
from insights.client.constants import InsightsConstants as constants
from insights.client.support import Insig... |
import numpy as np
import scipy.sparse as sp
import pdb
from readpvpheader import headerPattern, extendedHeaderPattern
def checkData(data):
#Check if dictionary
if not isinstance(data, dict):
raise ValueError("Input data structure must be a dictionary with the keys \"values\" and \"time\"")
#Check... |
class Storage(dict):
def __getattr__(self, key):
return self[key]
def __setattr__(self, key, value):
self[key] = value
def __hasattr__(self, key):
return key in self
class CLIArgumentsTreeParser(object):
def __init__(self, config, root_name, parser):
self.parser = p... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Page'
db.create_table(u'content_page', (
(u'id', self.gf('django.db.models.field... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Comunitea Servicios Tecnológicos <www.comunitea.com>
# $Omar Castiñeira Saavedra <omar@comunitea.com>$
#
# This program is free software: you can redistribute it and/or modify
# it u... |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... |
from subprocess import call
BUILD_DIR='build'
FONTa='Fake Receipt'
LANG='hb'
OUTPUTBASE = LANG + '.' + FONTa
def call_shell(command):
splitted = command.split()
call(splitted)
print(command)
def text2image(text_file):
splitted = str('text2image --text=' + text_file + ' --fonts_dir ..').split()
... |
# -*- coding: utf-8 -*-
"""
Test sif2hdf5 function for different filetypes.
"""
import unittest
import freesif as fs
import os
import shutil
FILES = os.path.join(os.path.dirname(__file__), 'files')
class TestSIF2HDF5(unittest.TestCase):
"""Test *sif2hdf5* function for different filetypes. It is only checked tha... |
#!/usr/bin/env python
import unittest
import os
from test import test_support
from Tkinter import Tcl
from _tkinter import TclError
class TclTest(unittest.TestCase):
def setUp(self):
self.interp = Tcl()
def testEval(self):
tcl = self.interp
tcl.eval('set a 1')
... |
"""
Helper for looping over sequences, particular in templates.
Often in a loop in a template it's handy to know what's next up,
previously up, if this is the first or last item in the sequence, etc.
These can be awkward to manage in a normal Python loop, but using the
looper you can get a better sense of the context.... |
# This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import uuid
from tornado import gen
from gosa.common import Environment
from gosa.common.components... |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... |
import numpy as np
import collections,dusts
__ver__ = '1.0'
class sfh_wrapper(object):
""" sfh_wrapper class. EzGal wraps this class around the sfh function. It takes care of the
details of passing or not passing parameters """
func = '' # sfh function
args = () # extra arguments to pass on call
has_args = ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import db
import ub
from flask import current_app as app
import logging
import smtplib
from tempfile import gettempdir
import socket
import sys
import os
import traceback
import re
import unicodedata
try:
from StringIO import StringIO
from email.MIMEBase import MIM... |
##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2017 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors: Kyle A Beauchamp, Matthew Harr... |
from discord.ext import commands
from .utils.chat_formatting import box
import aiohttp
import html
import os
import re
try:
from PIL import Image, ImageDraw, ImageFont
PIL = True
except:
PIL = False
class Horoscope:
def __init__(self, bot):
self.bot = bot
self.session = aiohttp.Clien... |
import yaml
import json
import os
from functools import partial
from combaine.common.loggers import CommonLogger
from combaine.common import constants
__all__ = ["FormatError", "MissingConfigError", "parse_agg_cfg", "parse_parsing_cfg", "parse_common_cfg"]
class ConfigError(Exception):
pass
class FormatError(C... |
# Copyright 2019 The Meson development team
# 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 ... |
# Copyright 2015 0xc0170
#
# 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, soft... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# 从配置文件中读取压缩设置
import json
from lib_apk_shrink.model import CompressConfig, CompressState, WebPConfig, \
DecompileConfig, UselessLayoutConfig, UselessDrawableConfig
from lib_apk_shrink.utils import shrink_utils
def init_compress_config(file_path):
_json = shri... |
# -*- coding: utf-8 -*-
#
# ns-3 documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... |
# Create your views here.
import logging
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import render, redirect
from pastebin.forms.paste_forms import PasteForm
logger = logging.getLogger(__name_... |
#!/usr/bin/env perl
# Find all contacts beween domains..
import sys, os, re, string
import argparse
from os.path import expanduser
home = expanduser("~")
sys.path.append(home + '/bioinfo-toolbox/parsing')
sys.path.append(home + '/git/bioinfo-toolbox/parsing')
import parse_contacts
import numpy as np
import matplotl... |
import numpy as np
class Signal(object):
def __init__(self, D, L, dt, max_freq, seed=None):
rng = np.random.RandomState(seed=seed)
steps = int(max_freq * L)
self.w = 2 * np.pi * np.arange(steps) / L
self.A = rng.randn(D, steps) + 1.0j * rng.randn(D, steps)
power = np.sqrt(... |
"""Reads CSV file for information, provides basic cleaning of data and then
runs analysis on said data."""
import csv
import re
from collections import Counter
from statistics import mean, mode, median_low, median, median_high, \
StatisticsError, Decimal
# Config
threshold = 0.9
invalid_values = ['-', '*', '_']... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and Contributors
# See license.txt
import frappe
import unittest
from frappe.utils import set_request
from frappe.website.serve import get_response
test_dependencies = ['Blog Post']
class TestWebsiteRouteMeta(unittest.TestCase):
def test_meta_tag_gener... |
'''
Copyright (C) 2015 Jacob Bieker, jacob@bieker.us, www.jacobbieker.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.
Thi... |
from django import forms
from django.conf import settings
from django.utils.encoding import force_unicode
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from tower import ugettext as _
from addons.models import Category
class IconWidgetRenderer(forms.RadioSelect.rende... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2003 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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 th... |
# The following is a Python translation of a MATLAB file originally written principally by Mike Tipping
# as part of his SparseBayes software library. Initially published on GitHub on July 21st, 2015.
# SB2_PARAMETERSETTINGS User parameter initialisation for SPARSEBAYES
#
# SETTINGS = SB2_PARAMETERSETTINGS(parameter... |
from exceptions import ConnectionError
from ircmess import IRCLine
from select import select
import socket
import ssl
class IRCBot:
"""
An IRCBot is a class that maintains a connection with a remote IRC server
and keeps track of channel members, information about the remote server,
and other things th... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import re
from pathlib import Path
taxo_level = {
'k': 'kingdom',
'p': 'phylum',
'c': 'class',
'o': 'order',
'f': 'family',
'g': 'genus',
's': 'species',
't': 'strains'}
def split_levels(metaphlan_output_fp, out_dp, legacy... |
# Copyright 2012 OpenStack Foundation.
# 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 requ... |
"""
Discover AWS load balancer.
"""
import boto3
from botocore.client import ClientError
from common.methods import set_progress
from resourcehandlers.aws.models import AWSHandler
RESOURCE_IDENTIFIER = 'load_balancer_name'
def discover_resources(**kwargs):
discovered_load_balancers = []
for handler in AWSHa... |
from zope.interface import implements
from twisted.python import usage
from twisted.plugin import IPlugin
from twisted.application import internet
from twisted.application.service import IServiceMaker
from mamba.utils import config
from mamba.enterprise import database
from mamba.core.session import Session
from mamb... |
'''This script will display a histogram of a single sphere's height when next to a wall using sphere.py.
1,000,000 heights will be generated by iterating over n_steps, and written to a text file: rejection_locations.txt
On top of the histogram is a plot of the analytical GB distribution
Prints the time taken for all ... |
import io
from setuptools import setup
with io.open('README.md', encoding='utf-8') as f:
README = f.read()
setup(
name='bkkcsirip',
version='1.1.0',
url='https://github.com/underyx/bkkcsirip',
author='Bence Nagy',
author_email='bence@underyx@me',
maintainer='Bence Nagy',
maintainer_ema... |
# test_doccode.py
# Copyright (c) 2013-2016 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111,C0302,E1129,R0914,R0915,W0212,W0640
# Standard library imports
from __future__ import print_function
import os
import shutil
import subprocess
import sys
# PyPI imports
import matplotlib
# Putil imports
... |
#!/usr/bin/env python
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] tags will be kept. ... |
"""
make alist of all contrasts/tasks
"""
import pickle
from get_contrasts_to_use import *
c=get_contrasts_to_use()
outdir='/corral-repl/utexas/poldracklab/openfmri/analyses/paper_analysis_Dec2012/data_prep'
infodir='/corral-repl/utexas/poldracklab/openfmri/analyses/paper_analysis_Dec2012/data_prep'
f=open(os.path.... |
import unittest
from kafka.tools.exceptions import ProgrammingException
from kafka.tools.assigner.batcher import split_partitions_into_batches
from kafka.tools.models.broker import Broker
from kafka.tools.models.topic import Topic
from kafka.tools.assigner.models.reassignment import Reassignment
from kafka.tools.assig... |
# Copyright (c) 2016, Matt Layman
import json
import hashlib
import os
from markwiki.exceptions import UserStorageError
from markwiki.models.user import User
from markwiki.storage.user import UserStorage
class FileUserStorage(UserStorage):
'''A file system based user storage'''
def __init__(self, config):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
import distribute_setup
distribute_setup.use_setuptools()
from setuptools import setup
import os
import sys
try:
import py2exe
PY2EXE_ACTIVE = 1
except:
#no windows platform
PY2EXE_ACTIVE... |
"""
Copyright 2016, Paul Powell, All rights reserved.
"""
import random
from matchup import Matchup
#
# Implement a matchup between two teams
# This is an example of implementing Matchup, which determines
# the winner when two teams play in the tournament.
#
class FiftyFifty(Matchup):
# teams: tuple of Team object... |
from setuptools import setup, find_packages
from distutils.extension import Extension
from Cython.Build import cythonize
extension_defaults = {
'extra_compile_args': [
'-std=gnu++11',
'-O3',
'-Wall',
'-Wextra',
'-Wconversion',
'-fno-strict-aliasing'
],
'langu... |
import numpy as np
# from matplotlib.colors import hsv_to_rgb, rgb_to_hsv
__all__ = ['COLORMAP', 'HIGHLIGHT_COLORMAP', 'COLORS', 'COLORS_COUNT', 'generate_colors']
# Color creation routines
# -----------------------
def hue(H):
H = H.reshape((-1, 1))
R = np.abs(H * 6 - 3) - 1;
G = 2 - np.abs(H * 6 - 2);... |
#!/usr/bin/env python
'''
@author: Tim Giguere <tgiguere@asascience.com>
@description: New Implementation for TransformFunction classes
'''
from pyon.public import log
from pyon.core.exception import BadRequest
from interface.objects import Granule
class TransformFunction(object):
"""
The execute function r... |
from django.db import models
from django.db.models.fields import CharField
from django.utils.safestring import mark_safe
from markdown import markdown
from pygments import highlight
from pygments.formatters import get_formatter_by_name
from pygments.lexers import get_lexer_by_name
from wagtail.core import blocks
fro... |
"""detection_from_raw_pred.py
* not super useful, a simple script that plots a) raw pred, b) gt pnr, c) detector output
at 1 single setting
Usage:
detection_from_raw_pred.py <fold_index> <f_data_config> <f_model_config> <f_detect_config> --train
Arguments:
Example:
"""
from __future__ import absolute_import
from ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pylid
from collections import Counter
el = pylid.PyLID(3)
el.total_ngrams = 207365496
el.lang = 'el'
el.ngrams = Counter({
u'\u03b1\u03b9#': 1833955,
u'#\u03c4\u03b7': 1792914,
u'#\u03ba\u03b1': 1652081,
u'#\u03c4\u03bf': 1512455,
u'\u03bf\u03c5... |
"""Import and export collision data"""
class TestBhkCollisionSphereShape(TestBaseGeometry, TestBhkCollision):
n_name = "collisions/base_bhkcollision_sphere" #name of nif
b_name = "Cube" #name of blender mesh object
def b_create_object(self):
b_obj = TestBaseGeometry.b_create_object(self)
... |
# author : Johann-Mattis List
# email : mattis.list@uni-marburg.de
# created : 2015-04-27 13:03
# modified : 2015-04-27 13:03
"""
import new data (TBL)
"""
__author__="Johann-Mattis List"
__date__="2015-04-27"
from lingpy import *
from lingpyd.plugins.lpserver.lexibase import LexiBase,load_sqlite
changes = dic... |
import os
import subprocess
import yaml
import util
from django.conf import settings
from bioblend.cloudman import CloudManInstance
def load_instance_metadata():
try:
with open("/opt/cloudman/boot/userData.yaml", "r") as stream:
ud = yaml.load(stream)
return ud
except:
... |
#!/usr/bin/env python
import functools
import logging
import unittest
import converge
import converge.processes
from converge.framework import datastore
from converge.framework import scenario
def with_scenarios(TestCase):
loader = unittest.defaultTestLoader
def create_test_func(generic_test, params):
... |
import logging
from flask import jsonify, request
import flask_login
import mediacloud.error
from server import app, mc
from server.auth import user_mediacloud_client
from server.util.request import form_fields_required, api_error_handler, json_error_response, arguments_required
from server.views.topics.topic import ... |
"""
Methods to characterize image textures.
"""
import math
import numpy as np
from scipy import ndimage
from ._texture import _glcm_loop, _local_binary_pattern
def greycomatrix(image, distances, angles, levels=256, symmetric=False,
normed=False):
"""Calculate the grey-level co-occurrence matri... |
import sys
if sys.version_info > (3, 0):
from urllib.request import urlopen
from urllib.error import URLError
from io import StringIO
else:
from urllib2 import urlopen, URLError
from StringIO import StringIO
import gzip
import re
import six
def extract_residues_by_resnum(output_file, pdb_input_file... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ChromeOS Uart Stress Test
This tester runs the command 'chargen' on EC and/or AP, captures the
output, ... |
import os
import tempfile
from mock import patch
import dusty.constants
from dusty.systems.known_hosts import ensure_known_hosts
from ....testcases import DustyTestCase
@patch('dusty.systems.known_hosts._get_known_hosts_path')
@patch('dusty.systems.known_hosts.check_output')
class TestKnownHostsSystem(DustyTestCase)... |
"""
Dataset for images and related functionality.
This module does not have dependencies inside pyl2extra package, so you
can just copy-paste it inside your source tree.
To use this dataset prepare a .csv file with targets (integers or real numbers)
on first column and file paths on the second column:
.. code::
... |
# This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
import struct
from .parse import OpenTypeTable, MultiFo... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors.
#
# 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 appl... |
#
# This file is part of Bluepass. Bluepass is Copyright (c) 2012-2013
# Geert Jansen.
#
# Bluepass is free software available under the GNU General Public License,
# version 3. See the file LICENSE distributed with this file for the exact
# licensing terms.
from __future__ import absolute_import, print_function
from... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from collections import OrderedDict
from operator import attrgett... |
"""A Pandora Client Written in Python EFLs/Elm
Uses VLC as a streaming backend
By: Jeff Hoogland (JeffHoogland@Linux.com)
Started: 12/20/12
"""
import os
import elementary
import edje
import ecore
import evas
import time
import pandora
import vlc
import urllib
import webbrowser
def openBrowser(url):
print "Open... |
import pandas
def getColRenameDict(mergersheet,sheet):
colrenamedict={}
originalcolnames=mergersheet[sheet].fillna("NA")
newcolnames=mergersheet[mergersheet.columns[0]]
for i in range(0,len(originalcolnames)):
colrenamedict[originalcolnames[i]]=newcolnames[i]
# if originalcolnames[i]!="NA":
# colrenamedict[... |
from tabulate import tabulate
from pprint import pprint
FLOAT_FORMAT = '.1f'
class Hero(object):
"""Analyze how a specific hero performs.
Output is preformatted for reddit.
For reddit formatting tips see: https://www.reddit.com/r/reddit.com/comments/6ewgt/reddit_markdown_primer_or_how_do_you_do_al... |
"""
streams module contains classes, programs, tools for creating
and processing audio streams.
"""
import os
import wave
from glob import glob
import sys
import matplotlib.pyplot as plt
from tqdm import trange
import numpy as np
import taglib
from nltk import distance
import itunespy
from clamm import config
from c... |
# Copyright (c) 2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
import base64
import logging
import hashlib
import itertools
import operator
import zookeeper
from zope import interface
from twisted.application import service
from twisted.python import failure
from twisted.internet import ... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from __future__ import absolute_import
from TurEng import TurEng
import sys
import os
args = sys.argv
if len(args)==4:
dic = args[1]
lang = args[2]
query = args[3]
dic_obj = TurEng()
dic_obj.change_url(dic)
if lang == "en":
result = dic_obj.get_meaning(query,"tr ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... |
from neon.layers.layer import Layer, ParameterLayer
import numpy as np
from neon.transforms import Softmax
from neon.initializers.initializer import Constant
import math
from collections import OrderedDict
class Normalize(ParameterLayer):
def __init__(self, init=Constant(20.0), name=None):
super(Normalize... |
# -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.views.generic import TemplateView
from django.http import Http404
from django.db.models import Count
from app.problem.models import Problem, Category
from app.recor... |
# vim:ts=4:sw=4:et:
# Copyright 2015-present Facebook, Inc.
# Licensed under the Apache License, Version 2.0
# no unicode literals
from __future__ import absolute_import, division, print_function
import json
import os
import os.path
import pywatchman
import WatchmanTestCase
from path_utils import norm_relative_path
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sqlite3
from datetime import datetime
from datetime import timedelta
from telebot import types
import telebot
import logging
import emoji
import inits
tb = telebot.TeleBot(inits.bot_address)
announce_message="""Hey everybody,
Finally, the moment we have all been... |
import asyncio
import html
import logging
from datetime import datetime
from textwrap import TextWrapper
import os
import pytz
import re
import sys
from slackclient import SlackClient
from sortedcontainers import SortedDict
from websocket import WebSocketConnectionClosedException
class LackManager:
# loglines =... |
# -*- coding: utf-8 -*-
from gluon import current
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
# =============================================================================
class S3MainMenu(default.S3MainMenu):
""" Custom Applica... |
# 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 posixpath
import sys
from file_system import FileSystem, StatInfo, FileNotFoundError
from future import Future
from object_store_creator import O... |
from functools import partial
import numpy as np
import torch
from catalyst.dl import Callback, RunnerState, MetricCallback, CallbackOrder
from pytorch_toolbelt.utils.catalyst.visualization import get_tensorboard_logger
from pytorch_toolbelt.utils.torch_utils import to_numpy
from pytorch_toolbelt.utils.visualization i... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution, third party addon
# Copyright (C) 2004-2015 Vertel AB (<http://vertel.se>).
#
# This program is free software: you can redistribute it and/or modify
# it under... |
from django.contrib import messages
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext
from... |
# -*- coding: utf8 -*-
from django.contrib import admin
from blog.models import Categorie, Article, Comment
class ArticleAdmin(admin.ModelAdmin):
list_display = ('titre', 'auteur', 'date', 'categorie', 'apercu_contenu')
list_filter = ('auteur','categorie',)
date_hierarchy = 'date'
ordering =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.