src stringlengths 721 1.04M |
|---|
# wedther
# Generates tweets for the current weather in Edmonton, AB.
# Tweets the current temperature and an emoji that represents the
# current weather conditions.
# If there is a current weather alert, it also tweets that.
import tweepy
from secret_wedther import *
from get_weather import get_weather
def main():
... |
"""
This is a system to query statistics for a country by approximate name match.
Author: Tay Joc Cing
Date: 10 Mar 2015
Version: 0.1
"""
class Country:
"""
This is a class to capture statistics for a country
>>> from country import Country
>>> c = Country("Singapore", {"Population":5000000, "Den... |
import os
from couchdbkit.ext.django.loading import get_db
# corehq dependency is simplest of a few annoying options
# - move this code into corehq
# - extract corehq.preindex into its own project
# - be ok with intentionally introducing this dependency
# for something that's pretty bound to our specific deploy work... |
#!/usr/bin/python
import ConfigParser,os,sys
from subprocess import call
from glob import iglob
from shutil import move
from os.path import join
use_message = '''
Usage:
python run_analysis.py
'''
class Usage(Exception):
def __init__(self, msg):
self.msg = msg
def get_version():
return "1.2.0"
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from capstone import *
import pwndbg.arguments
import pwndbg.color
import pwndbg.disasm
import pwndbg.disasm.color
import pwndbg.functions
import pwndbg.ida
import pwndbg.regs
import pwndbg.strings
import pwndbg.symbol
import pwndbg.ui
import pwndbg.vmmap
@pwndbg.command... |
"""InfluxDB component which allows you to get data from an Influx database."""
from datetime import timedelta
import logging
from influxdb import InfluxDBClient, exceptions
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_HOST,
CONF_NA... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... |
# -*- coding: utf-8 -*-
from distutils.version import StrictVersion
from django import get_version
if StrictVersion(get_version()) < '1.4':
from django.template import Node
from django.template import NodeList
from django.template import VariableDoesNotExist
from django.template import TemplateSyntaxE... |
import uuid
import pika
import json
from pprint import pprint
__author__ = 'mffrench'
class Requestor(object):
def __init__(self, connection_, requestQ_):
self.connection = connection_
self.channel = connection.channel()
self.requestQ = requestQ_
self.channel.queue_declare(queue=r... |
# ===============================================================================
# Copyright 2019 Jake Ross
#
# 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... |
#
# This file is part of EXECTASK.
#
# EXECTASK 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.
#
# EXECTASK is distributed in the hope... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.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 Softwar... |
import logging
import time
from flask import request
from flask_restful import Resource
from marshmallow import ValidationError, post_load, validates_schema
from marshmallow_jsonapi import Schema, fields
from timeswitch.switch.model import (Pin, Sequence, is_absolute_time,
is_rela... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2008-2012 the MansOS team. 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,
# ... |
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later versi... |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... |
#############################################################################
##
## Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
## Contact: https://www.qt.io/licensing/
##
## This file is part of the Qt3D module of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:LGPL$
## Commercial License Usage
## Licensees holdin... |
from django.conf import settings
from django.http import Http404, JsonResponse
from django.urls import reverse
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.views.decorators.cache import never_cache
from django.views.decorators.http import require_GET
from repanier... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# List of namespaces.The 2nd part in the array states whether the attributes
# should be in the namespace
namespaces = {
"xhtml": ['"http://www.w3.org/1999/xhtml"', False, 0 ],
"empty": [ "DOMString()", False, 1 ],
"svg": ['"http://www.w3.org/2000/svg"', False, 2... |
import unittest
from nqueens.chessboard import Chessboard
from nqueens.solver import Solver
class TestSolver(unittest.TestCase):
def setUp(self):
self.standardBoard = Chessboard.create(8)
def testSimpleSolution(self):
board = Chessboard.create(1)
solver = Solver.create(board)
... |
#coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_O_LNA_XDXT_ENT_AUTH').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
s... |
import numpy as np
from datetime import timedelta
import datetime
#import sys
#import os
#import pickle
#debug_logs_directory =
class PercentAboveThreshold():
def __init__(self):
self.name = 'Percent Above or Below Threshold'
self.description = 'Calculates the percentage of pixels that are above... |
# Copyright 2016-2017 University of Pittsburgh
# 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 agr... |
#! /usr/bin/env python
#
# exception classes for cvmfsreplica project
class ServiceConfigurationFailure(Exception):
"""
Exception to be raised when basic service configuration
cannot be read
"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.v... |
# encoding: utf-8
"""
simulate.py -- Simulate double rotation experiments using VMOModel
Exported namespace: VMOExperiment
Created by Joe Monaco on 2010-02-03.
Copyright (c) 2009-2011 Johns Hopkins University. All rights reserved.
This software is provided AS IS under the terms of the Open Source MIT License.
See ... |
try:
import sqlite3 as sqlite
except ImportError:
from pysqlite2 import dbapi2 as sqlite
import os
from datetime import datetime
from heinzel import settings
from heinzel.core import utils
from heinzel.core.exceptions import DatabaseError, \
DatabaseSanityError, SQLSyntaxError
sqlite.registe... |
import numpy as np
import pandas as pd
from .recmat import recall_matrix
from scipy.spatial.distance import cdist
from ..helpers import check_nan
def lagcrp_helper(egg, match='exact', distance='euclidean',
ts=None, features=None):
"""
Computes probabilities for each transition distance (proba... |
"""Library for pretty-printing tables."""
import util
from util import out, nl
def print_table(table, rowsortkey=None, columnsortkey=None, defaultvalue=''):
# Get the row and column heads:
row_heads = list(table.keys())
column_heads = util.list_union(map(lambda x: x.keys(), table.values()))
if rowsor... |
from isovar import run_isovar
from isovar import ProteinSequence
from varcode import Variant
from testing_helpers import data_path
from nose.tools import eq_
def test_isovar_result_property_types():
for result in run_isovar(
variants=data_path("data/b16.f10/b16.vcf"),
alignment_file=data_... |
import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme_file:
README = readme_file.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-silk',
version='0... |
# 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... |
# Copyright (c) 2013 Calin Crisan
# This file is part of motionEye.
#
# motionEye 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.
#
#... |
import datetime
import random
import re
from django.conf import settings
from django.db import models
from django.template.loader import render_to_string
from django.utils.hashcompat import sha_constructor
from django.utils.translation import ugettext_lazy as _
from django.core.mail import EmailMultiAlternatives
from ... |
#!/usr/bin/env python3
import argparse
import base64
import errno
import hashlib
import logging
import mimetypes
import os
import random
import shutil
import ssl
import string
import sys
import time
import urllib.parse
import yaml
from sleekxmpp.componentxmpp import ComponentXMPP
from threading import Event
from thre... |
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
from tornado import ioloop
from tornado.concurrent import run_on_executor
from tornado import gen
from functools import wraps
import threading
executors = {
'short': ThreadPoolExecutor(max_workers=8), # For little things to avoid blocking the ... |
# Copyright (c) 2014 The GreenCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-greencoinrpc to module search path:
import os
import sys
sys.path.append... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
## ##
## Copyright 2010-2012, Neil Wallace <neil@openmolar.com> ##
## ... |
import bitstring
import collections
import heapq
class Node(object):
def __init__(self, left, right):
if left.weight is None:
self.weight = None
else:
self.weight = left.weight + right.weight
self.left = left
self.right = right
self.symbol = left.sym... |
import numpy as np
import re
sentencer_cfg = {'no_matching' : re.compile(
'(?i)All rights reserved'+
'|No reuse allowed'+
'|author/funder'+
'|this preprint'
)
}
phraser_cfg = {
'min_count' : 3,
'threshold' : 1.0,
'delimiter' : b'__',
'components' : True,
'common_terms' : [
'','to','and','of','the','a'... |
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .DataTestTemplate import _DataTest
import PyOpenWorm
from PyOpenWorm.evidence import Evidence
from PyOpenWorm.document import Document
from PyOpenWorm.website import Website
from PyOpenWorm.context import Context
from six.moves.urllib.parse import url... |
# -*- coding: utf-8 -*-
#
# config.py - configuration for QWeeChat (~/.qweechat/qweechat.conf)
#
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
#
# QWeeChat is free software; you can redistribute it and/or modify
# it under the terms o... |
#
# SMS test via Google Voice
#
# John Nagle
# nagle@animats.com
#
from googlevoice import Voice
import BeautifulSoup
def extractsms(htmlsms):
"""
extractsms -- extract SMS messages from BeautifulSoup
tree of Google Voice SMS HTML.
Output is a list of dictionaries, one per message.
"""
ms... |
# coding=utf-8
import logging
import threading
from contextlib import contextmanager
from pika.adapters.twisted_connection import TwistedChannel
from pika.adapters.twisted_connection import TwistedProtocolConnection
from pika.connection import Parameters
from twisted.internet import defer
from twisted.internet import ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, mapnik
from nose.tools import *
from .utilities import execution_path, run_all
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
def test_image_16_8_simp... |
# coding: utf-8
from __future__ import division
import json
import os
import random
import re
import requests
from . import helpers
from .webtrader import WebTrader, NotLoginError
log = helpers.get_logger(__file__)
VERIFY_CODE_POS = 0
TRADE_MARKET = 1
HOLDER_NAME = 0
class YHTrader(WebTrader):
config_path = ... |
"""
Quandl's API for Python.
Currently supports getting, searching, and pushing datasets.
"""
from __future__ import (print_function, division, absolute_import,
unicode_literals)
import pickle
import datetime
import json
import pandas as pd
import re
from dateutil import parser
from numpy impor... |
# **********************************************************************
#
# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# ***********************************************************... |
#
# 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 tracktotrip import Track
import tracktotrip.transportation_mode as tm
from changepy import pelt
from changepy.costs import normal_mean
import numpy as np
import matplotlib.pyplot as plt
temp_trk = [
Track.from_gpx('/Users/ruipgil/tracks/backup/2015-07-23_1.gpx')[0],
Track.from_gpx('/Users/ruipgil/tracks/... |
import unittest
from chainer.testing import condition
# The test fixtures of this TestCase is used to be decorated by
# decorator in test. So we do not run them alone.
class MockUnitTest(unittest.TestCase):
failure_case_counter = 0
success_case_counter = 0
probabilistic_case_counter = 0
probabilisti... |
#
# lasground.py
#
# (c) 2012, Martin Isenburg
# LASSO - rapid tools to catch reality
#
# uses lasground.exe to extracts the bare-earth by classifying LIDAR
# points into ground (class = 2) and non-ground points (class = 1).
#
# The LiDAR input can be in LAS/LAZ/BIN/TXT/SHP/... format.
# The LiDAR output can ... |
#!/usr/bin/env python3
import datetime
import itertools
import json
import psycopg2
import psycopg2.extras
import re
import sys
import time
psycopg2.extras.register_uuid()
psycopg2.extensions.register_adapter(dict, psycopg2.extras.Json)
def print_log(table, action, otime, ltime, old, new, idfield):
if action == ... |
import os
from collections import OrderedDict
import pyexcel
from base import PyexcelMultipleSheetBase
from nose.tools import raises
class TestOdsNxlsMultipleSheets(PyexcelMultipleSheetBase):
def setUp(self):
self.testfile = "multiple1.ods"
self.testfile2 = "multiple1.xls"
self.content =... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
import math
import mmap
import gzip
import os
import codecs
import pytz
import const
from util import ip2long
from timezone import time_zone_by_country_and_region
MMAP_CACHE = const.MMAP_CACHE
MEMORY_CACHE = const.MEMORY_CACHE
STANDARD = const.STANDARD
class GeoIPError(Exception):
pass
class GeoIPMetaclass(t... |
from asciify import asciify
import random
import time
import pygame
width, height = (60, 30)
add_per_frame = 5
render = asciify(width, height, "font", fontsize=16)
random.seed(time.time())
Particles = [
[
random.randint(0, width),
random.randint(-1, height),
... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
"""
Cross platform user creation and management
Created for testing cross user testing for the ramdisk project, specifically
unionfs functionality.
@author: Roy Nielsen
"""
import re
import os
import pty
import sys
import shutil
from subprocess import Popen
##########
# local app libraries
from lib.manage_user.pa... |
# -*- coding: iso-8859-15 -*-
"""IP4 address range set implementation.
Implements an IPv4-range type.
Copyright (C) 2006, Heiko Wundram.
Released under the MIT-license:
Copyright (c) 2006, Heiko Wundram.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated doc... |
# Copyright 2015 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
import pytest
from io import StringIO
from collections import namedtuple
import pandas as pd
from epic.blacklist.compute_poisson import compute_poisson
@pytest.fixture()
def matrix():
return pd.read_table(StringIO(u"""Chromosome Bin f1.bed f2.bed
chr1 0 1.0 1.0
chr1 200 1.0 1.0
chr1 400 1.0 10.0
chr1 600 1.0 1... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask_restplus import fields
from app import api
host_stats_fields_attributes = api.model('HostStats', {
'uptime': fields.Nested(api.model('HostUptime', {
'days': fields.Integer,
'hours': fields.Integer,
'minutes': fields.Integer,
... |
#!/usr/bin/env python
#
# Copyright 2015 Anthony Scemama
#
# 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 applic... |
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView, RedirectView
urlpatterns = patterns('scorebrd.views',
url(r'^$', 'index', name='index'),
# url(r'^login/', 'my_login', name='login'),
# url(r'^logout/', 'my_logout', name='logout'),
url(r'^results/live', ... |
import __builtin__
import operator
import string
import itertools
import copy
import collections
import random
import csv
from cStringIO import StringIO
import subprocess
import tempfile
import os
import numpy
import sys
from distutils.version import StrictVersion
import dendropy
import time
import math
import json
imp... |
import tensorflow as tf
from tensorflow.models.rnn import rnn_cell, rnn
from tensorflow.models.rnn import seq2seq
from tensorflow.models.rnn.ptb import reader
import numpy as np
class lstm_class(object):
def __init__(
self, embedding_mat, non_static, lstm_type, hidden_unit, sequence_length, num_classes, vo... |
# Generated by Django 2.0.5 on 2018-06-01 14:42
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('django_ethereum_events', '0003_auto_20180531_0836'),
]
operations = [
migrati... |
# encoding=utf-8
# Copyright © 2017 Dylan Baker
# 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 dist... |
from zope.interface import Interface
from zope.app.annotation import IAttributeAnnotatable
from zope.viewlet.interfaces import IViewletManager
# Name of a named adapter used for asynchronous cleanup.
REMOVAL_QUEUE_KEY = 'member_removal_queue'
class ICanHasRecentActivity(IViewletManager):
"""Viewlets for the recen... |
__source__ = 'https://leetcode.com/problems/longest-word-in-dictionary-through-deleting/'
# Time: O(nlogn + n*x), Sorting takes O(nlogn) and isSubsequence takes O(x)
# Space: O(logn) Sorting takes O(logn) space in average case.
#
# Description: 524. Longest Word in Dictionary through Deleting
#
# Given a string and a ... |
# Copyright 2018 Therp BV <https://therp.nl>.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import common
from ..tablib import Tab
class TestTab(common.TestCommon):
def test_create_page(self):
self.assertTrue(bool(self.tab_board))
tab_obj = Tab(self.tab_board)
... |
#!/usr/bin/env python
'''The main entry point. Invoke as `switchboard' or `python -m switchboard'.
'''
import argparse
import sys
from switchboard.config import SwitchboardConfig
from switchboard.ws_ctrl_server import WSCtrlServer
from switchboard.engine import SwitchboardEngine
from switchboard.app_manager import A... |
#!/usr/bin/python
#CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2015, Intel Corporation
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; Version 2.
#
#This program is distr... |
import numpy as np
import xarray as xr
import pf_dynamic_sph as pfs
from timeit import default_timer as timer
import time
import os
# import matplotlib
# import matplotlib.pyplot as plt
if __name__ == "__main__":
# ---- INITIALIZE GRIDS ----
# (Lx, Ly, Lz) = (60, 60, 60)
# (dx, dy, dz) = (0.25, 0.25, 0.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... |
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... |
# __all__ = ['candlestick_trades']
import numpy as np
import ctypes
import os
def _getpath():
#return r"/Users/tim/Library/Caches/clion10/cmake/generated/c57b29e0/c57b29e0/Debug/"
return r"/Users/tim/dev/signals/build"
def _load_candlestick_lib():
return np.ctypeslib.load_library("libsignals", _getpath... |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
import demistomock as demisto
from CommonServerPython import *
def get_feed_config(services: list, regions: list):
"""
Creates the configuration for each AWS service.
Args:
services: The selected services.
regions: The selected regions.
Returns:
The feed configuration.
"""... |
# -*- coding: utf-8 -*-
import time
import math
from openerp.osv import expression
from openerp.tools.float_utils import float_round as round
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.exceptions import AccessError, UserError, ValidationError
import openerp.addons.decimal_precision as dp
fr... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def _init_state(model, name, slug):
try:
model.objects.get(slug=slug)
except model.DoesNotExist:
instance = model(**dict(name=name, slug=slug))
instance.save()
instance.ful... |
# -*- coding: utf-8 -*-
import pytest
from shuup.apps.provides import override_provides
from shuup.xtheme.resources import add_resource, InlineScriptResource
from shuup.xtheme.testing import override_current_theme_class
from shuup_tests.xtheme.utils import get_jinja2_engine, get_request
def add_test_injection(contex... |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster
class QuickshareCz(SimpleHoster):
__name__ = "QuickshareCz"
__type__ = "hoster"
__version__ = "0.61"
__status__ = "testing"
__pattern__ = r'http://(?:[^/]*\.)?quickshare\.cz/stahnout-soubor/.+'
_... |
# -*- coding: utf-8 -*-
"""Setup file for easy installation"""
import sys
import os
from os.path import join, dirname, split
from setuptools import setup
PY3 = sys.version_info[0] == 3
version = __import__('social').__version__
LONG_DESCRIPTION = """
Python Social Auth is an easy to setup social authentication/regi... |
import re
from util import *
from operation import Operation, OperationResult
class Replacement:
def __init__(self, regex, substitution):
self.regex = regex
self.substitution = substitution
class MinifyOperation(Operation):
def __init__(self):
self.inMultilineComment = False
pass
def apply(self, line, sta... |
import os, subprocess, shutil, hashlib, csv, pprint, sys, json
print "Overwatch wem extractor v0.2"
# get config
with open('config.json') as data_file:
config = json.load(data_file)
counter = 1
unknown = 0
# get hash storage
hashStorage = dict([])
with open(config["paths"]["important"], 'r') as csvfile:
hashreader =... |
#
# biofeedback.py
#
# Copyright (C)2011 Julian Ceipek and Patrick Varin
#
# Redistribution is permitted under the BSD license. See LICENSE for details.
#
try:
import multiprocessing
except:
raise Exception("Unable to load multiprocessing Python module.")
try:
import serial
except:
raise Exception(""... |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2016,2018 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... |
'''setup script for arsenal VMWare ESXi client.'''
# Copyright 2015 CityGrid Media, 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... |
#coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_A_SUBJECT_D002007').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
sc.... |
from PyQt5.QtCore import *
import time
import sys
import subprocess
import re
import shutil
import pathlib
VIDEO_EXTENSIONS = [".mp4",".avi",".mkv",".3gp", ".mov"] #most used video extensions
INFO = 0 #loglevel
ERROR = 1 #loglevel
#string format: Duration: 00:02:00.92, start: 0.000000, bitrate: 10156 kb/s
durationRe... |
# -*- coding: utf-8 -*-
from flask.ext.security import login_required, current_user, roles_accepted
from flask import request, Blueprint
from ..models import vehicle as vehicle_models, taxis as taxis_models
from ..extensions import db
from ..api import api
from . import ns_administrative
from flask.ext.restplus import ... |
from six.moves.urllib_parse import urlencode, unquote
import jwt
import json
from django.conf import settings
from student.models import Registration, UserProfile
from social_core.backends.oauth import BaseOAuth2
from django.contrib.auth.models import User
import uuid
import logging
import social_django
log... |
# 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/.
# Common codegen classes.
from collections import defaultdict
from itertools import groupby
import operator
import os
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Zomboided
#
# 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)... |
import sklearn
import sklearn.model_selection
import time
import itertools
import functools
import multiprocessing as mp
import os
import subprocess
import time
import copy
import json
import numpy as np
import pandas as pd
from numpy.linalg import norm
from scipy.optimize import minimize
import rmsd
import joblib
... |
import urllib2, urllib, sys, os, re, random, copy
from BeautifulSoup import BeautifulSoup, Tag, NavigableString
import xbmc,xbmcplugin,xbmcgui,xbmcaddon
from t0mm0.common.net import Net
from t0mm0.common.addon import Addon
from scrapers import CommonScraper
net = Net()
try:
import json
except:
# pre-frodo and python... |
'''
This function handles a Slack slash command named "/onnow" and echoes the details back to the Slack user.
Follow these steps to configure the slash command in Slack:
1. Navigate to https://<your-team-domain>.slack.com/services/new
2. Search for and select "Slash Commands".
3. Enter a name for your command... |
#!/usr/bin/env/python
"""
Abstract base class for a strong motion database reader
"""
import os
import abc
def get_float(xval):
"""
Returns a float value, or none
"""
if xval.strip():
return float(xval)
else:
return None
def get_int(xval):
"""
Returns an int value or none
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.