src stringlengths 721 1.04M |
|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
import telebot # https://github.com/eternnoir/pyTelegramBotAPI
import random
from token_file import token_var
from DTCScrapper import DTCScrapper
TOKEN = token_var
bot = telebot.TeleBot(TOKEN)
about_text_bot = "Hey !\nI am a telegram bot built by @n07070. I'm open source on... |
# Orca
#
# Copyright 2015 Igalia, S.L.
#
# Author: Joanmarie Diggs <jdiggs@igalia.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your o... |
# -*- 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 'GDPRProfile'
db.create_table('gdpr_gdprprofile', (
('id', self.gf('django.db.mod... |
import os
from queuelib.rrqueue import RoundRobinQueue
from queuelib.queue import (
FifoMemoryQueue, LifoMemoryQueue, FifoDiskQueue, LifoDiskQueue,
FifoSQLiteQueue, LifoSQLiteQueue,
)
from queuelib.tests import (QueuelibTestCase, track_closed)
# hack to prevent py.test from discovering base test class
class b... |
#!/usr/bin/env python
# Read LICENSE for licensing details.
import sys
import textwrap
import glob
import shutil
import os
app_name = 'rconsoft'
#-----------------------------
# Do some checks
if sys.version_info < (2, 4, 0):
sys.stderr.write(app_name+' requires Python 2.4 or newer.\n')
sys.exit(-1)
try:
f... |
# Copyright 2012 OpenStack LLC.
# 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... |
from django.core.cache import cache
from django.db.transaction import non_atomic_requests
from django.utils.translation import ugettext
from rest_framework.exceptions import ParseError
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.status import HTTP_201_CREAT... |
#!/usr/bin/env python-i
# SUMMON examples
# 10_text.py - example of text
#
# Try zoomin in and out so see affects on text. Use CTRL-right drag and
# SHIFT-right drag to zoom and x and y axis separately.
#
# make summon commands available
from summon.core import *
from summon import shapes
import summon
win = summ... |
"""Creates a load balancer rule"""
from baseCmd import *
from baseResponse import *
class createLoadBalancerRuleCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""load balancer algorithm (source, roundrobin, leastconn)"""
"""Required"""
self.algorithm = ... |
# create a mapping of state to abbreviation
states = {
'Oregon': 'OR',
'Florida': 'FL',
'California': 'CA',
'New York': 'NY',
'Michigan': 'MI'
}
# create a basic set of states and some cities in them
cities = {
'CA': 'San Francisco',
'MI': 'Detroit',
'FL': 'Jacksonville'
}
# add some more cities
cities['NY'] ... |
# Django settings for dayspring project.
import os
PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https:/... |
class UndirectedGraphNode():
def __init__(self, x):
self.label = x
self.neighbors = []
class SolutionDFS():
def cloneGraph(node):
dictmap = {}
def dfs(input, map):
if input in map:
return map[input]
output = UndirectedGraphNode(input.labe... |
from mock import patch
from mock import call
import mock
from .test_helper import raises
from kiwi.package_manager.apt import PackageManagerApt
from kiwi.exceptions import (
KiwiDebootstrapError,
KiwiRequestError
)
class TestPackageManagerApt(object):
def setup(self):
repository = mock.Mock()
... |
'''
Created on March 27, 2017
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
# Device Model
# https://presence.atlassian.net/wiki/display/devices/Thermostat
from devices.thermostat.thermostat import ThermostatDev... |
import uuid
from django.db import connection, models
from busshaming.enums import RouteMetric, MetricTimespan
UPSERT_ENTRY = '''
INSERT INTO busshaming_routeranking (id, route_id, date, timespan, metric, rank, display_rank, value)
VALUES (uuid_generate_v4(), %s, %s, %s, %s, %s, %s, %s)
ON CONFLICT (date, timespan, ... |
#
# Copyright 2011 Thomas Bollmeier
#
# This file is part of GObjectCreator2.
#
# GObjectCreator2 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 late... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Configuration
# Templates
basepolname = 'template/module'
base_transpol_name = 'template/temp_transition'
makefile_path = 'template/Makefile'
# Default value for the template variables
user_u_default = 'user_u'
user_r_default = 'user_r'
user_t_default = 'user_t'
module_d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... |
import json
import os
from cStringIO import StringIO
from xml.parsers.expat import ExpatError
from django import http
from django.shortcuts import render, get_object_or_404, redirect
from django.db import transaction
from django.conf import settings
from django.utils import timezone
from django.db.models import Count
... |
#! /usr/bin/env python
# encoding: utf-8
"""
log模块,这里利用了一些sys.modules和python系统库查找的一些trick。
log模块第一次导入的时候,是作为一个文件被查找到的。
查找成功后,文件会跑一个生成log实例的逻辑,然后把它加入到全局sys.modules字典里面。
以后所有模块的`import log`动作都会绕开文件查找的过程,直接在sys.modules里面找这个模块。
"""
import sys
import logging.handlers
from settings import (
LOG_NAME
)
class Log(objec... |
#!/bin/env python
# usage: depth , inDictionary [, outJSON]
def generateChain(depth, inFile):
import collections, re
numChar, endChar = '#', '.'
regexWord = re.compile('^[a-z]+$')
depthRange = range(depth - 1)
padStr = ' ' * (depth - 1)
chars = collections.deque(maxlen = depth) # limit to depth chars
de... |
# -*- encoding: utf-8 -*-
import pytest
from decimal import Decimal
from finance.tests.factories import VatSettingsFactory
from invoice.models import Invoice, InvoiceLine
from invoice.service import InvoicePrint
from invoice.tests.factories import (
InvoiceFactory,
InvoiceLineFactory,
InvoiceSettingsFacto... |
# -*- coding: utf8 -*-
#
# Copyright (C) 2017 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Licen... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is distrib... |
"""EasyEngine MySQL core classes."""
import pymysql
import configparser
from os.path import expanduser
import sys
import os
from ee.core.logging import Log
from ee.core.variables import EEVariables
class EEMysql():
"""Method for MySQL connection"""
def execute(self, statement, errormsg='', log=True):
... |
from typing import Any, Dict, Optional, Union
from django.core.exceptions import ValidationError
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render
from django.utils.translation import gettext as _
from django.views.decorators.http import require_safe
from confirmation.models import... |
import discord
from discord.ext import commands
import asyncio
import os
from .utils import checks
from .utils.dataIO import fileIO
class Persistentname:
"""When a user changes their account name, and no nickname is set, this will set their nickname to their old account name."""
def __init__(sel... |
import ftp_utils
def get_timescale(s):
aa = s.split()
word = aa[aa.index('`timescale') + 1]
return word.split('(')[0]
def get_module_name(s):
aa = s.split()
word = aa[aa.index('module') + 1]
return word.split('(')[0]
def get_regs(s):
regs = []
aa = s.split()
while 'input' in aa:
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import stdout
from codecs import open
from json import loads
from numpy import zeros, dot, sqrt
from argparse import ArgumentParser
from heapq import nlargest
import cudamat as cm
def debug(debug_str):
stdout.write(debug_str)
stdout.flush()
def load_vec... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 19 11:29:40 2017
@author: daniel
"""
import Tomography as tom
import quPy as qp
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
import json
import io
import scipy.constants as co
#import rydpy
c = 299792458 # m/s, speed of light CODATA 2... |
# coding: utf-8
# In[1]:
from __future__ import division,unicode_literals
# get_ipython().magic('matplotlib inline')
import numpy as np
import pandas as pd
import json
import runProcs
from urllib.request import urlopen
import matplotlib.pyplot as plt
# In[2]:
# 0. State abbreviations
# 0.1 dictionary:
stateAbbr... |
from setuptools import setup, find_packages
install_requires=['django>=1.5', 'django-easysettings', 'pytz']
try:
import importlib
except ImportError:
install_requires.append('importlib')
setup(
name='django-password-policies',
version=__import__('password_policies').__version__,
description='A D... |
"""
devices.py
~~~~~~~~~~~~
This module supports accessing and updating devices and device properties.
:copyright: (c) 2012 by Albert Boehmler
:license: GNU Affero General Public License, see LICENSE for more details.
"""
from flask import Blueprint, render_template, abort, request, url_for
from jinja2 import Templ... |
#!/usr/bin/env python3
def which_sue(part=1):
sues = []
for line in open("day_16.txt").read().strip().split("\n"):
parts = line.split(" ")
sues.append({parts[2][:-1]: int(parts[3][:-1]),
parts[4][:-1]: int(parts[5][:-1]),
parts[6][:-1]: int(parts[7])})... |
# Copyright 2012 Edgeware AB.
#
# 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,... |
from __future__ import unicode_literals
import datetime
import os
import subprocess
from django.utils.lru_cache import lru_cache
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
version = get_complete_version(version)
# Now build the two parts of th... |
from __future__ import print_function
from __future__ import division
import oss2
import sys
import datetime
import math
access_key_id = '<access_key_id>'
access_key_secret = '<access_key_secret>'
bucket_name = '<bucket_name>'
bucket_endpoint = 'http://oss-cn-shanghai.aliyuncs.com' # endpoint name
genesis =... |
"""CartoCSS properties."""
# extracted from https://raw.githubusercontent.com/mapbox/carto/master/docs/latest.md
Properties = {
"background-color": {
"default": None,
"description": "Map Background color.",
"type": "color"
},
"background-image": {
"default": "",
"de... |
# coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud... |
# Licensed GNU Affero GPL v3 or later: http://www.gnu.org/licenses/agpl.html
import sys, calendar, re, heapq, tempfile
_month_dict = { 'Jan' : 1, 'Feb' : 2, 'Mar' : 3, 'Apr' : 4, 'May' : 5, 'Jun' : 6,
'Jul' : 7, 'Aug' : 8, 'Sep' : 9, 'Oct' : 10, 'Nov' : 11, 'Dec' : 12 }
def _parse_logtime (string):
... |
# -*- coding: utf-8 -*-
from openerp import models, fields, api, exceptions
class Project(models.Model):
_inherit = 'bestja.project'
estimation_reports = fields.One2many('bestja.estimation_report', inverse_name='project')
enable_estimation_reports = fields.Boolean(string=u"Raporty szacunkowe do zbiórki ... |
"""
This module contains a CAB io implementation in PyGame.
"""
import pygame
import pygame.gfxdraw
import pygame.locals
import math
import cab.abm.agent as cab_agent
import cab.ca.cell as cab_cell
import cab.util.io_pygame_input as cab_pygame_io
import cab.util.io_interface as cab_io
import cab.global_constants as c... |
#!/usr/bin/env python
# vim: ts=4 sw=4 et
from itertools import combinations
import os
import numpy as np
import km3pipe as kp
from km3modules.plot import plot_dom_parameters
from km3modules.fit import fit_delta_ts
import km3pipe.style
km3pipe.style.use('km3pipe')
PLOTS_PATH = 'www/plots'
cal = kp.calib.Calibratio... |
import django.core.files.storage
from django.db import migrations, models
import comics.core.models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
name="Comic",
fields=[
(
"id",
... |
""" Defines a training options class as a holder for options that can be passed
for training a neural network.
"""
__author__ = "Mihaela Rosca"
__contact__ = "mihaela.c.rosca@gmail.com"
import numpy as np
# TODO: move from common here
import common
class TrainingOptions(object):
def __init__(self, miniBatchSize,
... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: reflector.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _ref... |
import turtle
OFFSET=200
MULTIPLE=10
def draw(n,paths):
cords=[(0,0),(n,0),(n,n),(0,n),(0,0)]
turtle.penup()
for c in cords:
turtle.setpos(getCoord(c[0]),getCoord(c[1]))
turtle.pendown()
## turtle.left(90)
## turtle.penup()
## turtle.goto(-OFFSET,-OFFSET)
## turtle.pen... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import pytest
from six.moves.urllib.error import URLError
import spack.ci as ci
import spack.main as spack_main... |
# Compensa el tamanio de imagen al modificar el lente de la camara.
bl_info = {
"name": "Resize Render Resolution",
"author": "Oscurart",
"version": (1, 0),
"blender": (2, 66, 0),
"location": "Search > Resize Resolution by Camera Angle",
"description": "Resize render dimension by camera angle.... |
# -*- coding: utf-8 -*-
from openprocurement.api.models import get_now
from openprocurement.api.utils import (
get_file,
save_tender,
upload_file,
apply_patch,
update_file_content_type,
opresource,
json_view,
context_unpack,
)
from openprocurement.api.validation import (
validate_fil... |
from django.db import models
class Price(models.Model):
cost = models.FloatField(blank=False)
promotion = models.CharField(max_length=100, blank=False)
def __unicode__(self):
return '${0}'.format(self.cost)
class Color(models.Model):
WHITE = 1
BLACK = 2
name = models.CharField(max_l... |
#!/usr/bin/env python
"""
withsqlite - uses an sqlite db as a back end for a dict-like object,
kind of like shelve but with json and sqlite3.
Copyright 2011-2013 James Vasile
Released under the GNU General Public License, version 3 or later.
See https://www.gnu.org/licenses/gpl-3.0.html for terms.
Repo is at <http:/... |
# Thanks to Andrew Christophersen
# Maya Wheel Rig with World Vectors video tutorial
# https://youtu.be/QpDc93br3dM
# importing libraries:
import maya.cmds as cmds
from Library import dpUtils as utils
import dpBaseClass as Base
import dpLayoutClass as Layout
# global variables to this module:
CLASS_NAME = "Whe... |
from keras.models import Sequential
from keras.layers import Bidirectional, BatchNormalization
from keras.layers.embeddings import Embedding
from keras.layers.core import Dense, Activation, Merge, Dropout, Flatten, Reshape
from keras.layers.convolutional import MaxPooling2D
from keras.layers.recurrent import LSTM, GRU
... |
import numpy as np
from scipy.interpolate import interp1d
import tomviz.operators
import time
class ReconWBPOperator(tomviz.operators.CancelableOperator):
def transform_scalars(self, dataset, Nrecon=None, filter=None, interp=None):
"""
3D Reconstruct from a tilt series using Weighted Back-project... |
# !/usr/bin/python
# -*- coding: utf-8 -*-
#
# Created on April 12, 2016
# @author: Bo Zhao
# @email: bo_zhao@hks.harvard.edu
# @website: http://yenching.org
# @organization: Harvard Kennedy School
import time
import platform
from pymongo import MongoClient, errors
from selenium import webdriver
from... |
# coding: utf-8
from __future__ import unicode_literals
import pytest
from mock import Mock
from boxsdk.config import API
from boxsdk.object.device_pinner import DevicePinner
from boxsdk.network.default_network import DefaultNetworkResponse
@pytest.fixture(scope='module')
def delete_device_pin_response():
# py... |
# -*- coding: utf-8 -*-
import functools
import html
import io
from urllib.parse import quote
from django.conf import settings
from django.http import HttpResponse, StreamingHttpResponse
def strip_generator(fn):
@functools.wraps(fn)
def inner(output, event, generator=False):
if generator:
... |
#!/usr/bin/env python
from __future__ import print_function
_print = print
del print_function
from inspect import getsource
from strict_functions import strict_globals, noglobals
__all__ = 'asserts', 'print', 'attempt'
@strict_globals(getsource=getsource)
def asserts(input_value, rule, message=''):
""" this fu... |
#!/usr/bin/env python
# Drive APMrover2 in SITL
from __future__ import print_function
import os
import pexpect
import time
from common import AutoTest
from common import AutoTestTimeoutException
from common import MsgRcvTimeoutException
from common import NotAchievedException
from common import PreconditionFailedEx... |
# Memory Overcommitment Manager
# Copyright (C) 2010 Adam Litke, IBM Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it ... |
# -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp
from openerp import tools, api
import datetime
import logging
_logger = logging.getLogger(__name__)
class vnsoft_sale_order(osv.osv):
_in... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015, 2016 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... |
import asyncio
import struct
import dictionary
import datetime
import tests
from collections import *
from os import listdir
from os.path import isfile, join
from enum import Enum
from dicotomix import Dicotomix, Direction, NotFoundException, OrderException
import unidecode
import sys
import numpy as np
ENABLE_TESTS =... |
#
# Python Imaging Library
# $Id$
#
# stuff to read (and render) GIMP gradient files
#
# History:
# 97-08-23 fl Created
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1997.
#
# See the README file for information on usage and redistribution.
#
from math import pi, log, si... |
#!/usr/bin/env python
# The MIT License (MIT)
#
# Copyright (c) 2015 Corrado Ubezio
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the ri... |
# -*- coding: utf-8 -*-
class AbstractAccessor(object):
def __init__(self, driver, structure):
self.driver = driver
self.structure = structure
self.is_valid()
self.initialize()
def is_valid(self):
pass
def initialize(self):
pass
def reload(self, drive... |
"""
Support for playing AudioSegments. Pyaudio will be used if it's installed,
otherwise will fallback to ffplay. Pyaudio is a *much* nicer solution, but
is tricky to install. See my notes on installing pyaudio in a virtualenv (on
OSX 10.10): https://gist.github.com/jiaaro/9767512210a1d80a8a0d
"""
import subprocess
fr... |
# Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... |
#!/usr/bin/env python
from optparse import OptionParser
from rpy import r
import bx.align.maf
import bx.bitset
from bx.bitset_builders import binned_bitsets_from_file
def main():
parser = OptionParser(usage="usage: %prog [options] maf_file snp_file neutral_file window_size step_size")
parser.add_option("-o... |
from tests.testcase import TestCase
from tests.foundation.syslogserver import SysLogServer
class TestSysLog(TestCase):
"""
Test the SysLog
"""
def set_up(self):
"""
Set up the test case
"""
super(TestSysLog, self).set_up()
self._server = SysLogServer()
... |
import numpy as np
import pylab
import mahotas as mh
import types
# constants
upper_distance = 100 #the start searching
approxWidth = 40
threshold = 300
border = 1
def pre_process(image):
"""
pre_process will return black_white image, given a colorful image as input.
"""
T = mh.threshol... |
from django.core.urlresolvers import get_callable
from request.models import Request
from request import settings
from request.router import patterns
class RequestMiddleware(object):
def process_response(self, request, response):
if request.method.lower() not in settings.REQUEST_VALID_METHOD_NAMES:
... |
import sys, getopt
import create_fit_plots as cfp
def main(argv):
inargs1 = 'ht:c:o:f:l:'
snargs1 = inargs1[1:].split(':')
inargs2 = ['time','cmsdir','outdir','fitfile','loopfile']
helpinfo = "create_model_files_wrapper.py is a command line utility which calls the class create_model_files\n"
he... |
#!/usr/bin/env python2
from gi.repository import Gtk, Gdk, GLib
from SettingsWidgets import *
class Module:
comment = _("Control mouse and touchpad settings")
name = "mouse"
category = "hardware"
def __init__(self, content_box):
keywords = _("mouse, touchpad, synaptic, double-click")
... |
import rethinkdb as r
from future.moves.queue import Empty
from nose.tools import assert_raises
from rethinkpool import RethinkPool
def test_pool_create():
max_conns = 50
initial_conns = 10
rp = RethinkPool(max_conns=max_conns, initial_conns=initial_conns)
assert rp.current_conns == initial_conns
de... |
from __future__ import division
import numpy as np
import math as m
from easygui import multenterbox
import pandas as pd
import matplotlib.pyplot as plt
import math as m
def import_xl(file_path):
df = pd.read_excel(file_path,header = None)
df = df.values
return df
def export_xl(file_path,sheets):
writ... |
# Copyright (c) 2011 OpenStack, LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
import os
import networkx
from netdiff import BatmanParser, diff
from netdiff.exceptions import ParserError
from netdiff.tests import TestCase
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
iulinet = open('{0}/static/batman.json'.format(CURRENT_DIR)).read()
iulinet2 = open('{0}/static/batman-1+1.json'.for... |
#
# account.py
# mailVirtual
#
# Created by Andrea Mistrali on 25/09/09.
# Copyright akelge@gmail.com 2009. All rights reserved.
#
# $Id$
from Foundation import *
class Accounts(object):
pl=None
binary=False
modified=False
filename=''
def __new__(cls, filename):
try:
cls.p... |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import contextlib
import os.path
import StringIO
import sys
import traceback
import warnings
import weakref
from behave import matchers
from behave.step_registry import setup_step_decorators
from behave.formatter import formatters
from behave.configuration... |
import pickle
import math
import sys
PATH="diccionarios/"
soporte=int(sys.argv[1])
codigos_ISO=sys.argv[2:]
for codigo_ISO in codigos_ISO:
archivo=open(PATH+codigo_ISO+"wiki_frecuencias.pickle","r")
metadatos_palabras,dic_palabras=pickle.load(archivo)
print
print "Metadatos archivo de frecuencias de p... |
# Copyright (c) 2015-2016 Tigera, 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 by applicabl... |
#!/usr/bin/python
# ADAGIO Android Application Graph-based Classification
# featureAnalysis.py >> Analysis of features from SVM linear model
# Copyright (c) 2013 Hugo Gascon <hgascon@uni-goettingen.de>
import os
import sys
import os
import ml
import eval
import FCGextractor
import instructionSet
import random
import... |
"""The :mod:`evaluation` module defines classes to evaluate program CodeBlocks."""
from abc import ABC, abstractmethod
from typing import Sequence, Union, Callable
from collections import defaultdict
import numpy as np
import pandas as pd
from pyshgp.push.interpreter import PushInterpreter, Program
from pyshgp.tap imp... |
"""
Provides Logging facilities.
Grid for Digital Security (G4DS)
Currently, simple logging into files.
@author: Michael Pilgermann
@contact: mailto:mpilgerm@glam.ac.uk
@license: GPL (General Public License)
"""
from time import strftime
import string
import syslog
# "singleton"
_defaultLogger = None
def getDefaul... |
# This file is part of Bika LIMS
#
# Copyright 2011-2016 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.
from AccessControl import getSecurityManager
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.permissions import *
from bika.lims.browser.analysisreq... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... |
'''
Copyright (c) 2010, Universidad Industrial de Santander, Colombia
University of Delaware
All rights reserved.
@author: Sergio Pino
@author: Henry Arguello
Website: http://www.eecis.udel.edu/
emails : sergiop@udel.edu - henarfu@udel.edu
Date : Nov, 2010
'''
from gnuradio.wxgui import fftsink2, scopesink2
from g... |
"""
Django settings for gphoto project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
im... |
from django.contrib import admin
from .models import *
# Register your models here.
#organizacion
class InlineEscuelaCampo(admin.TabularInline):
model = EscuelaCampo
extra = 1
class OrganizacionAdmin(admin.ModelAdmin):
inlines = [InlineEscuelaCampo]
list_display = ('id','nombre','siglas')
list_dis... |
"""
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.8.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build path... |
# coding=utf-8
"""Provider code for Zooqle."""
from __future__ import unicode_literals
import logging
from medusa import tv
from medusa.bs4_parser import BS4Parser
from medusa.helper.common import (
convert_size,
try_int,
)
from medusa.logger.adapters.style import BraceAdapter
from medusa.providers.torrent.... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2020 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... |
# -*- coding: utf-8 -*-
########################################################################
# #
# python-OBD: A python OBD-II serial module derived from pyobd #
# #
# C... |
## begin license ##
#
# "Meresco Lucene" is a set of components and tools to integrate Lucene (based on PyLucene) into Meresco
#
# Copyright (C) 2013-2015 Seecr (Seek You Too B.V.) https://seecr.nl
# Copyright (C) 2013-2014 Stichting Bibliotheek.nl (BNL) http://www.bibliotheek.nl
# Copyright (C) 2015 Koninklijke Biblio... |
###############################################################################
# This file is part of openWNS (open Wireless Network Simulator)
# _____________________________________________________________________________
#
# Copyright (C) 2004-2007
# Chair of Communication Networks (ComNets)
# Kopernikusstr. 16, D-... |
# -*- coding:utf-8 -*-
"""
Verion: 1.0
Author: zhangjian
Site: https://iliangqunru.bitcron.com/
File: pyeverything.py
Time: 2018/3/9
Add New Functional pyeverything.py
"""
import logging
import sys
from ctypes import windll, create_unicode_buffer, byref, WinDLL
level = logging.DEBUG
format = '%(asctime)s - %(... |
# 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, software
# distributed under t... |
# coding=utf-8
# Copyright 2018 The HuggingFace Inc. 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.