src stringlengths 721 1.04M |
|---|
# Copyright 2011 OpenStack Foundation
#
# 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 a... |
import httplib
from user_list import *
import re
from xml.dom.minidom import Document
for egroup in egroup_user_list:
users = egroup_user_list[egroup]
users = re.sub(' +',' ',users)
user_list = users.split(" ")
print user_list
for user in user_list:
doc = Document()
soap_envelope =... |
import webhose;
import time;
from datetime import datetime, timedelta
from lxml import html
import requests
import unirest
webhose.config(token='c6052904-f312-436b-a6d8-d915084ac866')
days_back = 30
date_days_ago = datetime.now() - timedelta(days=days_back)
organization = 'verizon'
lang = 'english'
country = 'US'
#... |
import os
import sys
from cadnano import app, setReopen, setBatch
from cadnano.fileio.nnodecode import decode, decodeFile
from cadnano.fileio.encoder import encode
from cadnano.gui.views.documentwindow import DocumentWindow
from cadnano.gui.ui.dialogs.ui_about import Ui_About
from cadnano.gui.views import styles
imp... |
"""
Module with family of classes for block structures.
BlockStructure - responsible for block existence and relations.
BlockStructureBlockData - responsible for block & transformer data.
BlockStructureModulestoreData - responsible for xBlock data.
The following internal data structures are implemented:
... |
# Copyright 2015 47Lining LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
#
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
import sys
import argparse
from vnc_api.vnc_api import *
from pysandesh.sandesh_base import Sandesh, SandeshSystem, SandeshConfig
from pysandesh.gen_py.sandesh.ttypes import SandeshLevel
from sandesh_common.vns.constants import (HttpPortKubeManager,... |
import logging
import sys
import os
import inspect
import pprint
import util
from resource_management import *
logger = logging.getLogger()
class Kafka(Script):
def install(self, env):
self.install_packages(env)
def configure(self, env):
import params
env.set_params(params)
def start(self, env):
... |
#!/usr/bin/env python
"""
Trying to return weird things from the constructor
Conclusions:
- you can only return None or nothing (which is None)
from a import constructor.
- this helps you to get out early if you don't want to
execute the rest of the constructor code.
- you cannot return 'self' since the __init__ meth... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.http import Http404
from ietf.doc.models import State, StateType, IESG_SUBSTATE_TAGS
from ietf.name.models import DocRelationshipName, DocTagName
from ietf.doc.utils import get_tags_for_stream_id
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
##############################################################################
# Copyright (c) 2016 The Linux Foundation and others.
#
# All rights reserved. This program and the accompanying materials
# are made available ... |
import numpy as np
import scipy.optimize
import scipy.stats
from artist import Plot
def main():
# Draw random numbers from the normal distribution
np.random.seed(1)
N = np.random.normal(size=2000)
# define bin edges
edge = 5
bin_width = .1
bins = np.arange(-edge, edge + .5 * bin_width, b... |
# -*- 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 http.server
import os
import os.path
PORT = 8080
class BlogRequestHandler(http.server.SimpleHTTPRequestHandler):
def __init__(self, *args, directory=None, **kwargs):
super().__init__(*args, **kwargs)
def translate_path(self, path):
path = http.server.SimpleHTTPRequestHandler.trans... |
# coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... |
import logging
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../../../../../../../'))
from clitellum.core import loadbalancers, queue
from clitellum.endpoints.channels.amqpchannels import OutBoundAmqpChannel
from clitellum.endpoints.gatewaysqueue import SenderGatewayQueue
__author__ = ... |
# -*- coding: utf-8 -*-
"""
flask.testing
~~~~~~~~~~~~~
Implements test support helpers. This module is lazily imported
and ususlly not used in production environments.
"""
from contextlib import contextmanager
from werkzeug.test import Client, EnvironBuilder
from .ctx import _request_ctx_stack
try... |
#!/usr/bin/python
# Copyright (c) 2015 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.
"""Certificate chain with 1 intermediate, where the target is expired (violates
validity.notAfter). Verification is expected to fail.""... |
""":mod:`autotweet.daemons` --- Learning, Answering your tweets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module learns your tweets and answering it automatically.
"""
from __future__ import unicode_literals
import re
import time
import tweepy
from .logger_factory import get_logger
from .learning impor... |
#@+leo-ver=5-thin
#@+node:2014fall.20141212095015.1775: * @file wsgi.py
# coding=utf-8
# 上面的程式內容編碼必須在程式的第一或者第二行才會有作用
################# (1) 模組導入區
# 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝
#@@language python
#@@tabwidth -4
#@+<<declarations>>
#@+node:2014fall.20141212095015.1776: ** <<declar... |
# Copyright 2009 - 2011 Machinalis: http://www.machinalis.com/
#
# This file is part of Eff.
#
# Eff 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 l... |
# ############################################################################
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core business i... |
"""Test revrand's bound and parameter types."""
from __future__ import division
import numpy as np
from scipy.stats import gamma
from revrand import Bound, Positive, Parameter
def test_bound():
b = Bound(1, 2)
assert b.lower == 1
assert b.upper == 2
assert b.check(1) is True
assert b.check(3)... |
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# Copyright 2015 Objectif Libre
#
# 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
... |
from activitystreams import parse as as_parser
from dino.db.manager.users import UserManager
from dino.hooks.create import OnCreateHooks
from test.db import BaseDatabaseTest
class CreateHookTest(BaseDatabaseTest):
_act = None
@staticmethod
def _publish(activity: dict, external=False) -> None:
Cr... |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
import copy
import bee
import dragonfly.pandahive
from dragonfly.grid import bgrid
from dragonfly.canvas import box2d
import dragonfly.std, dragonfly.gen, dragonfly.random, dragonfly.logic
blocks = (
bgrid(values=((0, 0), (1, 0), (2, 0), (3, 0))), # I
bgrid(values=((0, 1), (0, 0), (1, 0), (2, 0))), #J
b... |
import os
import tensorflow as tf
import numpy as np
from data import get_files
from data import FEATURES
from data import OUTPUTS
from data import RESULT_MAP
class DataPoint:
length = 0
filenames = []
xs = []
ys = []
# Our expected inputs for training, testing, etc.
class NNData:
training = DataP... |
import time
import random
from PIL import Image, ImageDraw
from skymap.labeling.common import Point, BoundingBox, evaluate, POSITION_WEIGHT
from skymap.labeling.greedy import GreedyLabeler, AdvancedGreedyLabeler
from skymap.labeling.grasp import GraspLabeler
from skymap.labeling.genetic import GeneticLabeler, CachedGe... |
# -*- coding: utf-8 -*-
# sintaxis for Python 2.7
from random import randint
import jugador
from jugador import Jugador
from criaturas import Enemigo
comand = jugador.Comandos
def main():
jug = Jugador()
jug.nombre = raw_input("¿Cual es tu nombre viager@? : ")
print "escribe: 'ayuda' para ver una list... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from . import steps
SPEC = {
'settings': {
'build_gs_bucket': 'chromium-chromiumos-archive',
# WARNING: src-side runtest.py is only tested with ch... |
#!/usr/bin/env python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
"""
Copyright (C) 2012 Caio Oliveira <caio.freitaso@gmail.com>
Copyright (C) 2012 Diego Toral <diegotoral@gmail.com>
Copyright (C) 2012 Thiago Abreu <thiagoa7@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 So... |
from __future__ import unicode_literals
from spacy.tokens import Doc
import pytest
@pytest.mark.models
def test_getitem(EN):
tokens = EN(u'Give it back! He pleaded.')
assert tokens[0].orth_ == 'Give'
assert tokens[-1].orth_ == '.'
with pytest.raises(IndexError):
tokens[len(tokens)]
def t... |
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from preprocess.preparedata import PrepareData
import numpy as np
from utility.runtype import RunType
from utility.datafilepath import g_singletonDataFilePath
from preprocess.splittrainvalidation import HoldoutSplitMethod
import xgboost as xgb
from evaluat... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2015 Baifendian Corporation
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 ... |
#
# @lc app=leetcode id=576 lang=python3
#
# [576] Out of Boundary Paths
#
# https://leetcode.com/problems/out-of-boundary-paths/description/
#
# algorithms
# Medium (36.32%)
# Total Accepted: 37.6K
# Total Submissions: 103.6K
# Testcase Example: '2\n2\n2\n0\n0'
#
# There is an m x n grid with a ball. The ball is i... |
#!/usr/bin/env python
""" dump 1 """
import sys, json
from struct import *
array=[]
def doit(f):
chunk = f.read(0x2)
l0 = unpack('>H', chunk)
assert l0[0] == 50
chunk = f.read(l0[0])
s = unpack('>%ds' % l0[0], chunk)
chunk = f.read(0x1)
l2 = unpack('>B', chunk)
#assert l2[0] == 0
... |
"""
Reader and writer of data file
"""
# Standard library modules.
import os
import io
import logging
logger = logging.getLogger(__name__)
import binascii
import xml.etree.ElementTree as etree
import xml.dom.minidom as minidom
# Third party modules.
from pkg_resources import iter_entry_points
# Local modules.
from p... |
# Yith Library Server is a password storage server.
# Copyright (C) 2012-2013 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# This file is part of Yith Library Server.
#
# Yith Library Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as... |
"""
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
from __future__ import unicode_literals
import functools
from importl... |
# PyUI
# Copyright (C) 2001-2002 Sean C. Riley
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful... |
# This file is part of Geeky Notes
#
# Geeky Notes is a CLI Simplenote client
# <https://github.com/dmych/gn>
#
# Copyright (c) Dmitri Brechalov, 2010-2011
#
# Geeky Notes 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... |
#!/usr/bin/env python2
# Copyright (c) 2014 The VeriCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
from test_framework.test_framework import VeriCoinTestFramework
from tes... |
# (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from datadog_checks.twistlock.utils import normalize_api_data_inplace
def test_normalize_api_data_inplace():
data = [
{
"scanTime": "2019-02-14T16:14:15.843Z",
'info'... |
# Copyright (c) 2014 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
# Copyright © 2014 Bart Massey
# [This work is licensed under the "MIT License"]
# Please see the file COPYING in the source
# distribution of this software for license terms.
# Given a mileage list, reduce it to a minimal set of edges
# that imply the same mileages.
# Strategy: Fill the whole list of edges into the
... |
### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
from .GXDB import GXDB
from .GXVA import GXVA
from .GXVV import GXVV
### endblock ClassImports
### block Header
# NOTIC... |
from i2c import I2C
from enum import IntEnum
class Command(IntEnum):
MeasureOne = 1
MeasureAll = 2
Count = 3
class RangeSensor(I2C):
"""
This class is an abstraction around the I2C communication with
the range-sensor module.
Details of the "protocol" used:
The Raspberry Pi sends a ... |
"""This module provides convenient access to the motionplanning module
functionality by defining the CSpace and MotionPlan classes."""
import motionplanning
import random
class CSpace:
"""Used alongside MotionPlan to define a configuration space for
motion planning.
Attributes:
- eps: the collisio... |
import modeldata
import molecules as mol
import translation
import replication as rep
import transcription
class Output:
"""
class for handling the simulation results of the different species types
"""
def __init__(self, model):
self.meta = {}
self.model = model
self.timecourse... |
# -*- coding: utf-8 -*-
'''Public section, including homepage and signup.'''
from flask import (Blueprint, request, render_template, flash, url_for,
redirect, session)
from flask_mail import Message
from flask.ext.login import login_user, login_required, logout_user
from farmsList.extensions import... |
"""
Stochastic solvers for regularized OT.
"""
# Author: Kilian Fatras <kilian.fatras@gmail.com>
#
# License: MIT License
import numpy as np
##############################################################################
# Optimization toolbox for SEMI - DUAL problems
##############################################... |
from crossfit_api import get_analysis_dataframe
import numpy as np
import pandas as pd
from memoize import persistent_memoize, memoize
from functools import partial
from sklearn.pipeline import Pipeline
from sklearn.feature_selection import SelectFromModel, RFECV
from sklearn.linear_model import Lasso, RANSACRegresso... |
from __future__ import absolute_import
import numpy as np
import re
from scipy import ndimage
from scipy import linalg
from os import listdir
from os.path import isfile, join
import random, math
from six.moves import range
'''
Fairly basic set of tools for realtime data augmentation on image data.
Can easily... |
# Copyright 2016 Internap.
#
# 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, so... |
import os
from qtpy import QtWidgets, QtGui
from qtpy.QtCore import Qt, QRect
__all__ = ['QtSplashScreen']
class QtSplashScreen(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):
super(QtSplashScreen, self).__init__(*args, **kwargs)
self.resize(627, 310)
self.setStyleSheet("back... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Year'
db.create_table('lizard_rijnmond_year', (
('id', self.gf('django.db.mode... |
#!/usr/bin/env python
# take a large CSV and filter out service attacks so the duration can be calculated
#
# Take protocol and array of ports as arguments
#
# Assuming 10 minute buckets for duration, if new traffic seen more than 10 mins
# after last consider it a new gnore all traffic sourced from the self IP, pass ... |
from panda3d.core import *
from panda3d.direct import *
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.DirectObject import DirectObject
from toontown.minigame import ToonBlitzGlobals
from toontown.minigame import TwoDStomper
class TwoDStomperMgr(DirectObject):
notify = DirectNotifyGlobal.d... |
import enum
from collections import namedtuple, OrderedDict
from itertools import zip_longest
__version__ = "1.5.0"
class EnumapMeta(enum.EnumMeta):
"""An EnumMeta for friendlier, more informative REPL behavior"""
def _iter_fmt_parts(cls):
names = cls.names()
types = cls.types()
fo... |
from __future__ import print_function
import logging
import os.path
import pandas as pd
import numpy as np
from collections import OrderedDict
from matplotlib.backends.backend_pdf import PdfPages
import sys
from .plots import counts_plot
from .storemanager import StoreManager, fix_filename, ELEMENT_LABELS
class SeqLi... |
#!/usr/bin/env python
'''
Fly Copter in SITL
AP_FLAKE8_CLEAN
'''
from __future__ import print_function
import copy
import math
import os
import shutil
import time
import numpy
from pymavlink import mavutil
from pymavlink import mavextra
from pymavlink import rotmat
from pysim import util
from pysim import vehiclei... |
from django.db import models
# import User model
from django.contrib.auth.models import User
# importing django-taggit
from taggit.managers import TaggableManager
# importing django image cropping
from image_cropping import ImageRatioField
#taggit autocomplete
from taggit_autocomplete.managers import TaggableManager
... |
import time
import re
from vsroom.common import timeconversion
from vsroom.common import sanitizer
# sanitizer.Sanitizer is the base class for a simple sanitizer bot.
class AbuseHelperSanitizer(sanitizer.Sanitizer):
# .sanitize(event) is the hook method for sanitizing events. This
# is the only method you ha... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
temporalprofileplugin.py
-------------------------------------
Copyright (C) 2014 TIGER-NET (www.tiger-net.org)
Based on Profile tool plugin:
Copyright (C) 2012 Patrice Verchere
*************... |
""" cparser.py
Purpose - break a sequence for given set of chars
Date Started - Nov 19th
Copyright (c) Madhukumar Seshadri
All rights reserved
Known Issues
Changes
A copy of this code is mparser which is marker parser which can use this instead
Trademark is Letustalkweb
Licensing yet to be decided
"""
import... |
"""
Replace corrupted data files with daily data re-downloaded with wget
"""
import sys
sys.path.append('/home/jwalker/dynamics/python/atmos-tools')
sys.path.append('/home/jwalker/dynamics/python/atmos-read')
import os
import shutil
import xarray as xray
import numpy as np
import collections
import time
import matplo... |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
# -*- coding: utf-8 -*
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
def plot_graphs(listX, listY, labelX, labelY, out, t='nada'):
fig, ax = plt.subplots()
plt.plot(listX, listY, linewidth=3.0)
ax.set_xlabel(labelX, fontsize='xx-large'... |
import sys
from abc import ABCMeta, abstractmethod
import requests
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
from .const import CLOUD_URLS
class Session(object):
"""
abstract class as base for sessions
"""
__metaclass__ = ABCMeta
def __init... |
#
# list.py : Interfaces to access list.
#
from db import user
from interfaces import app
import json
from flask import request
from flask import make_response
from flask import session
# /login : Login to user's account
@app.route("/login", methods=["POST"])
def login():
""" Login to user's account """
# Ge... |
#!/usr/bin/python
# *****************************************************************************
#
# Copyright (c) 2016, EPAM 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
#
#... |
import numpy as np
from collections import OrderedDict
__author__ = "Gokul Ramesh"
__copyright__ = "Copyright 2014, LatentView Analytics Pvt. Ltd."
__email__ = "gokul.ramesh@latentview.com"
__status__ = "Development"
__version__="0.0.1"
class SparseFeatureDistanceMatrix(np.ndarray):
def __new__(cls, records,... |
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... |
from git.config import SectionConstraint
from git.util import join_path
from git.exc import GitCommandError
from .symbolic import SymbolicReference
from .reference import Reference
__all__ = ["HEAD", "Head"]
class HEAD(SymbolicReference):
"""Special case of a Symbolic Reference as it represents the repository'... |
"""
GIS: GIS related utilities.
"""
###############################################################################
## Imports
###############################################################################
import math
###############################################################################
## GIS Format Con... |
"""
File: logging.py
Author: Ulf Krumnack
Email: krumnack@uni-osnabrueck.de
Github: https://github.com/krumnack
"""
# standard imports
import logging
# Qt imports
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget, QLabel, QPushButton
from PyQt5.QtWidgets import QCheckBox, QRadioButton, QButtonGroup
from... |
# 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 ... |
# coding:utf-8
import sys, os
import os.path
sys.path.append(os.path.dirname(sys.path[0]))
from settings.config import config
from peewee import Model, MySQLDatabase
mysqldb = MySQLDatabase('',
user=config.BACKEND_MYSQL['user'],
password=config.BACKEND_MYSQL['password']... |
#
#
# dns health check
#
#
import os
import subprocess
import simplejson as json
import re
from dns.config import config
class CheckHealthActions:
def __init__(self, check):
self.check = check
self.param_dict = json.loads(check['parameter'])
return
def run(self):
func_nam... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('categories', '0013_auto_20150130_1440'),
('projects', '0005_auto_20150202_1041'),
migrations... |
# 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 ... |
from django import forms
from django.utils.translation import ugettext_lazy as _
from schedule.models import Event, Occurrence
import datetime
import time
from zorna.calendars.models import ZornaCalendar, EventDetails, ZornaResourceCalendar
FREQUENCIES_CHOICES = (
("", _("-----")),
("WEEKLY", _("Weekly")),
... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
from __future__ import with_statement
from itertools import chain, starmap
import datetime
import sys
import warnings
import time as mod_time
from redis._compat import (b, izip, imap, iteritems, dictkeys, dictvalues,
basestring, long, nativestr, urlparse, bytes)
from redis.connection import C... |
import pandas as pd
import re
from nltk.corpus import stopwords
import os
import time
from nltk.stem.snowball import SnowballStemmer
import sys
sys.stdout = open('python_process.log', 'a')
start = time.time()
with open(os.path.join(os.path.dirname(__file__)) + '/data/tweets/train-tweets.txt', 'r') as f:
# Get ri... |
# -*- coding: utf-8 -*-
from flask import Flask, url_for, render_template, Response
import random
app = Flask(__name__)
@app.route('/')
def api_root():
mensaje = 'Welcome'
return Response(mensaje, status=200, mimetype='text/plain')
@app.route('/hola')
def api_home():
mensaje = 'Hola -cañón-'
return Response(mens... |
from __future__ import unicode_literals
import frappe, json, os
from frappe.utils import flt, cstr
from erpnext.controllers.taxes_and_totals import get_itemised_tax
from frappe import _
from frappe.utils.file_manager import save_file, remove_file
from frappe.desk.form.load import get_attachments
from erpnext.regional.... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 Daniel Kraft
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Test the merge-mining RPC interface:
# getauxblock, createauxblock, submitauxblock
from test_framework.test_framework... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
from __future__ import absolute_import
from iterstuff.lookahead import Lookahead
def repeatable_takewhile(predicate, iterable):
"""
Return successive entries from an iterable as long as the
predicate evaluates to true for each entry.
Like itertools.takewhile, but does not consume the first
elemen... |
# -*- coding: utf-8 -*-
#
# open_partecipate documentation build configuration file, created by
# sphinx-quickstart.
#
# 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 configuration valu... |
# we need this to scale actions and keyframing right
def get_relative_action_scale(obj_s, obj_e, note_s, note_e):
action_frames = obj_e - obj_s # 10 - 5 = 5
note_frames = note_e - note_s # 1050 - 1025 = 25
if action_frames <= 0:
action_frames = 1
relative_scale = note_frames / float(action_frames)... |
"""
Functions for creating UI elements, as well as their class counterparts.
"""
import re, sys, functools, traceback
import pymel.util as _util
import pymel.internal.pmcmds as cmds
import pymel.internal.factories as _factories
import pymel.internal as _internal
import pymel.versions as _versions
from language impor... |
import os
import os.path
import time
import heapq
from collections.abc import MutableMapping
from random import shuffle
from glob import glob
import feather
class AWJ(MutableMapping):
'''LRU cache for DataFrames backed by on-disk feather files
Parameters
----------
cache_path : str or Path
... |
#!/usr/bin/env python
import common
import glob
name = "Low"
binning = "60, 110, 140"
branch = "m4l_constrained, "+binning
###in workspace
obs_binning = binning
# key: category name
# value: TCut on mini-tree
categories = {
"ggF_4mu_13TeV" : "(event_type==0)",
"ggF_2mu2e_13TeV" : "(event_type==2)",
"ggF... |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright (c) 2011 Sergey Gulyaev <astraway@gmail.com>
#
# This file is part of Vertaler.
#
# Vertaler is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.