text stringlengths 12 6.59M |
|---|
from polished.backends import PelicanBackend
class EricPelicanBackend(PelicanBackend):
pass
|
# Copyright 2006-2007 The Trustees of Indiana University.
# This software is available for evaluation purposes only. It may not be
# redistirubted or used for any other purposes without express written
# permission from the authors.
# Authors:
# Christopher Mueller (chemuell@cs.indiana.edu)
# Andrew Lumsdaine ... |
import tkinter as tk
import ttkthemes as themed_tk
from tkinter import filedialog, ttk
import PIL.Image
import PIL.ImageTk
import os
import json
from collections import OrderedDict
import numpy as np
# weird import style to un-confuse PyCharm
try:
from cv2 import cv2
except ImportError:
import cv2
BACKGROUND_C... |
from discord import Client, Status
from utils.colourthief import get_embed_colour
from utils.messaging import notify_owner
class DiscordRelay:
def __init__(self, bot, config):
self.bot = bot
self.config = config
self.config["embed_colour"] = get_embed_colour(self.config["logo_url"])
... |
# -*- coding: utf-8 -*-
#
# Copyright (©) 2010-2013 Estêvão Samuel Procópio
# Copyright (©) 2010-2013 Gustavo Noronha Silva
#
# 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 ver... |
from mongoengine import fields, DynamicEmbeddedDocument
class Data(DynamicEmbeddedDocument):
__value_regex__ = '^(\d.\d{3,})\s+(eV)$'
C = fields.StringField(
min_length=8, max_length=10, required=True, regex = __value_regex__,
help_text="derivative discontinuity (valid format: `{}`)".format(
... |
from z3 import *
from mythril.analysis import solver
from mythril.analysis.ops import *
from mythril.analysis.report import Issue
from mythril.exceptions import UnsatError
import re
import logging
'''
MODULE DESCRIPTION:
Check for SUICIDE instructions that either can be reached by anyone, or where msg.sender is che... |
#
# Copyright 2014, NICTA
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_BSD2.txt" for details.
#
# @TAG(NICTA_BSD)
#
'''Entry point for the runner (template instantiator).'''
# Excuse this horrible prelude. Whe... |
# Copyright (c) 2015, Djaodjin Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
import typing
class Alt:
def __init__(self, expr, separator, allow_trailer=False, allow_empty=True):
self.expr = expr
self.separator = separator
self.allow_trailer = allow_trailer
self.allow_empty = allow_empty
def _compile(self, out):
staging = out.define('staging', '... |
# coding: utf-8
# This file is a part of VK4XMPP transport
# © simpleApps, 2013 — 2015.
import urllib
from printer import *
VK_AUDIO_SEARCH_LINK = "https://vk.com/search?c[q]=%s&c[section]=audio"
WALL_LINK = "https://vk.com/wall%(to_id)s_%(id)s"
GLOBAL_USER_SETTINGS["parse_wall"] = {"value": 0, "label": "Parse wall... |
VERSION = '1.3-RC5'
|
# -*- coding: utf-8 -*-
import logging
from collections import defaultdict
from datetime import datetime
from datetime import timedelta
from django.conf import settings
from django.http import JsonResponse
from elasticsearch_dsl import Search
from elasticsearch_dsl.query import Match, Q, Range
from elasticsearch_dsl.c... |
VERSION = '1.3-alpha-10'
|
# Copyright 2015 Cisco Systems, 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... |
"""
A file just to hold the version number, allows automated version increasing.
"""
SEMANTIC = '0.0.4-SNAPSHOT'
BUILD_TIME = 'UNKNOWN'
|
# Copyright 2018 The ops Developers
#
# 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 w... |
from __future__ import unicode_literals
import calendar
import iso639
import json
import phonenumbers
import pytz
import re
import unicodedata
from dateutil.relativedelta import relativedelta
from datetime import datetime, time, timedelta
from django.utils import timezone
from enum import Enum
from temba_client.utils... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import time, sys, commands, urllib2, logging, subprocess
from xml.dom.minidom import parse
FQN_XML_KEY = "stratus.glite.grid.ce.fqnkpi"
CLOTHO_URL="stratus.glite.grid.ce.ipmonitoring"
LOG_FILE = "/var/log/torqueProbe.log"
ROOT_MONITORING_TAG_NAME = "MonitoringInformation"
EVEN... |
import json
import copy
import rules
import threading
import inspect
import random
import time
import datetime
import os
import sys
import traceback
def _unix_now():
dt = datetime.datetime.now()
epoch = datetime.datetime.utcfromtimestamp(0)
delta = dt - epoch
return delta.total_seconds()
class Message... |
from civictechprojects.models import Project, ProjectPosition
from common.helpers.dictionaries import merge_dicts
from collections import Counter
def projects_tag_counts():
projects = Project.objects.filter(is_searchable=True)
issues, technologies, stage, organization, positions = [], [], [], [], []
if pro... |
from django.contrib.auth.models import User, AnonymousUser
from django.core.files.uploadedfile import SimpleUploadedFile
from django.http import HttpRequest
from django.test import Client
from django.test.client import RequestFactory
from unittest import TestCase
from ..models import DeviceToken
from ..views import dev... |
# Copyright 2015 IBM Corp.
#
# 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 a... |
# Copyright 2018 NOKIA
#
# 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... |
'''
Scan USB host for vendor specific device support
Usage:
umap2vsscan -P=PHY_INFO [-q] [-d=DB_FILE] [-s=VID:PID] [-t=TIMEOUT] [-z|-b=DELAY] [-r=RESUME_FILE] [-o=OS] [-e] [-v ...]
Options:
-P --phy PHY_INFO physical layer info, see list below
-v --verbose verbosity level
-q ... |
import numpy as np
from matplotlib import pyplot as plt
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
from sklearn.cross_validation import cross_val_score
def main():
np.random.seed(0)
n_samples = 30
true_f... |
# -*- coding: utf-8 -*-
"""Universal Language Codes
This library aims to provide an [en/de]coding utility for language codes.
To get a "universal" language code you create a LanguageCode object, giving it
the code and the standard it should use to look up that code.
>>> lc = LanguageCode('en', 'iso-639-1')
Inte... |
"""
Unit system class.
"""
# -----------------------------------------------------------------------------
# Copyright (c) 2018, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the LICENSE file, distributed with this software.
# ----------------------------... |
#coding: utf8
#
# urlfetch
# ~~~~~~~~
#
# An easy to use HTTP client based on httplib.
#
# :copyright: (c) 2011 Elyes Du.
# :license: BSD, see LICENSE for more details.
#
__version__ = '0.2'
__author__ = 'Elyes Du <lyxint@gmail.com>'
__url__ = 'https://github.com/lyxint/urlfetch'
import httplib
from... |
#!/usr/bin/python
#
# Urwid raw display module
# Copyright (C) 2004-2009 Ian Ward
#
# 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... |
import cvxpy.settings as s
from cvxpy.reductions.solvers import utilities
import cvxpy.interface as intf
from cvxpy.reductions import Solution
from cvxpy.reductions.solvers.qp_solvers.qp_solver import QpSolver
import numpy as np
import scipy.sparse as sp
class OSQP(QpSolver):
"""QP interface for the OSQP solver""... |
from .base import ( # noqa
AuthenticationError, SpaceTrackClient, UnknownPredicateTypeWarning)
from .operators import ( # noqa
greater_than, inclusive_range, less_than, like, not_equal, startswith)
__all__ = (
'AuthenticationError',
'greater_than',
'inclusive_range',
'less_than',
'like',
... |
# coding: utf-8
from __future__ import absolute_import, division, print_function
from .base import AuthenticationError, SpaceTrackClient # noqa
from .operators import ( # noqa
greater_than, inclusive_range, less_than, like, not_equal, startswith)
__all__ = (
'AuthenticationError',
'greater_than',
'i... |
# -*- coding: utf-8 -*-
'''
====================
SpamLists Library
====================
SpamLists provides common interfaces for querying whitelists and
blacklists containing web addresses: hostnames, IP addresses or urls.
It supports the following third party services:
* `Spamhaus ZEN https://www.spamhaus.org/z... |
from django import forms
from django.core.exceptions import NON_FIELD_ERRORS
from django.utils.translation import ugettext_lazy as _
from django.forms.util import ErrorList
from cla_provider.models import Provider
from cla_eventlog.forms import BaseCaseLogForm, EventSpecificLogForm
from knowledgebase.models import Art... |
#!/usr/bin/env python2
#import all the libraries and elements that we need
import time
import sys
import RPi.GPIO as GPIO
#import CloudFunctions
#turn off meaningless warnings
GPIO.setwarnings(False)
#define global variables defaults
LED_FREQ = 1000 #frequency of LED PWM switching
LOCATION = "CAXX0518" #location of t... |
import xml.etree.ElementTree as ET
from xml.sax.saxutils import escape
from constants import *
##########################################################################
# Various conversion helpers / base classes
class Output(object):
def __init__(self, output_dir, filename, module_name):
import os
s... |
"""
Defines common types and type related utilities: Singleton, etc.
These types can be shared by other utils modules and imported into util main namespace for use by other pymel modules
"""
import warnings, inspect
class Singleton(object) :
""" Singleton classes can be derived from this class,
you can d... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2021) Hewlett Packard Enterprise Development LP
#
# 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/licen... |
#!/usr/bin/env python
import copy, re, urllib2, json, ConfigParser
import oauth2 as oauth
from urllib import urlencode
from argparse import ArgumentParser
from pprint import pprint
from LRSignature.sign.Sign import Sign_0_21
_consumer = {
"key": "joe@navnorth.com",
"secret": "************************************"
}... |
from __future__ import print_function
# from cloudmesh_job.cm_jobdb import JobDB
from cmd3.console import Console
from cmd3.shell import command
import hostlist
from pprint import pprint
from cloudmesh_base.util import banner
from cloudmesh_job.cm_jobdb import JobDB
from cloudmesh_pbs.DbPBS import DbPBS'''please revie... |
import sys
import subprocess
import time
import re
class TrackValidation:
'''
Class for deciding whether a track summary from a run should be
considered valid based on the overheads and response times recorded
'''
def __init__(self, trackname):
self.track_name = trackname
self.pct_o... |
# Standard Libary
# Debug Toolbar
from .base import *
HOST_NAME = 'http://localhost:8000'
DEBUG = True
ALLOWED_HOSTS = [
'localhost',
]
INTERNAL_IPS = [
'127.0.0.1',
]
CLOUDINARY_URL = get_env_variable("CLOUDINARY_URL")
DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage'
EMAIL_PORT = 1... |
# Orca
#
# Copyright 2005-2009 Sun Microsystems Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This ... |
import libzilla.validator as validator
import getpass
import logging
import re
import sys
logging.basicConfig(
level=logging.INFO,
format='[%(asctime)s][%(name)s][%(levelname)s]: %(message)s')
logger = logging.getLogger(__name__)
"""This module helps create prompts for asking user for information."""
def pr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 29/03/17 at 11:40 AM
@author: neil
Program description here
Version 0.0.0
"""
import numpy as np
from astropy.io import fits
from astropy.table import Table
import matplotlib.pyplot as plt
import sys
import os
try:
import periodogram_functions2 as pf... |
from lims.shared.loggedintestcase import LoggedInTestCase
from lims.filetemplate.models import FileTemplate, FileTemplateField
from rest_framework import status
from .models import Location, ItemType, AmountMeasure, Set, Item, Tag
from django.contrib.auth.models import Permission, Group
from .views import ViewPermissio... |
import os
from django.contrib.gis.geos import Point, fromstr
from math import pi, sin, tan, sqrt, pow
from django.conf import settings
def KmlWrap( string ):
return '<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="ht... |
# -*- coding: utf-8 -*-
from django.db import models, IntegrityError
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from .. import settings
class TranslationManager(models.Manager):
def get_object_translations(self, obj, language=None):
... |
# -*- coding: UTF-8 -*-
# Copyright 2009-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
# python setup.py test -s tests.test_misc.PackagesTests
from __future__ import unicode_literals
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
install_requires = [
'Sphinx', ... |
# -*- coding: UTF-8 -*-
# Copyright 2017-2020 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
# $ python setup.py test -s tests.PackagesTests.test_packages
SETUP_INFO = dict(
name='lino-tera',
version='20.1',
install_requires=['lino-xl'],
# tests_require=['pytest', 'mock'],
test_suite... |
from __future__ import absolute_import
import json
import logging
from datetime import datetime
import pkg_resources
import requests
from linode.errors import ApiError, UnexpectedResponseError
from linode.objects import *
from linode.objects.filtering import Filter
from .common import load_and_validate_keys
from .pa... |
# Copyright 2015-2016 Capstone Team G
#
# 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 ... |
#ipc_lista1.10
#Faça um programa que peça a temperatura em graus Celsius, transforme e mostre em graus farenheit.
c = input("Entre com a temperatura em graus Celsius: ")
vt = c * 1.8
f = vt + 32
|
#ipc_lista1.13
#professor:
|
#ipc_lista1.15
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#
qHora = input("Quanto você ganha por hora: ")
hT = input("Quantas horas você trabalhou: ")
SalBruto = qHora
ir = (11/100.0 * salBruto)
inss = (8/100.0m* SalBruto)
sindicato = (5/100.0 * SalBruto)
vT = ir + sindicato
SalLiq = SalBru... |
#ipc_lista2.1
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que peça dois números e imprima o maior deles.
num1 = float(input("Informe um número: "))
|
#ipc_lista2.03
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que verifique se uma letra digitada é "F" ou "M"
sexo
sexo = raw_input("Informe seu sexo F para Feminino e M para Masculino: ")
if (sexo == "M"):
print
|
#ipc_lista2.06
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que leia três números e mostre o maior deles.
num1 = int(input("Insira um numero: ")
num2 = int(input("Insira outro numero: ")
num3 = int(input("Insira mais um numero: ")
if num1>num2
if num1>num3:
print ... |
from __future__ import absolute_import
# Implementation of RAKE - Rapid Automtic Keyword Exraction algorithm
# as described in:
# Rose, S., D. Engel, N. Cramer, and W. Cowley (2010).
# Automatic keyword extraction from indi-vidual documents.
# In M. W. Berry and J. Kogan (Eds.), Text Mining: Applications and Theory.unk... |
import ctypes
import os
import sys
import threading
import importlib.resources
from llvmlite.binding.common import _decode_string, _is_shutting_down
from llvmlite.utils import get_library_name
def _make_opaque_ref(name):
newcls = type(name, (ctypes.Structure,), {})
return ctypes.POINTER(newcls)
LLVMContext... |
# Copyright (c) 2008 Joost Cassee
# Licensed under the terms of the MIT License (see LICENSE.txt)
import re
from django import http
from django.conf import settings
import django.core.exceptions
from django.core import urlresolvers
from django.http import HttpResponseRedirect
from django.utils import translation
impor... |
__version__ = '1.0'
|
"""
pathtools.py provides functions handling IP hops, IXP detection and ASN information.
"""
import dbtools as db
import os
import copy
import logging
# load database from the local folder
cur_path = os.path.abspath(os.path.dirname(__file__))
as_rel = db.AsRelationDB(os.path.join(cur_path, "db/20161201.as-rel2.txt"))... |
import datetime
from django.db import models
from django.db.models.signals import post_save
from django.forms import Form, ModelForm, ValidationError, BooleanField, EmailField
from locksmith.common import (KEY_STATUSES,
PUB_STATUSES,
UNPUBLISHED,
... |
# -*- coding: utf-8 -*-
"""
Python Flight Mechanics Engine (PyFME).
Copyright (c) AeroPython Development Team.
Distributed under the terms of the MIT License.
Inputs Generator Tests
----------------------
Test functions for input generator module.
"""
import pytest
import numpy as np
from numpy.testing import assert_... |
# -*- coding: utf-8 -*-
"""
@file
@brief Helpers about versionning.
"""
def numeric_module_version(vers):
"""
Converts a string into a tuple with numbers wherever possible.
@param vers string
@return tuple
"""
if isinstance(vers, tuple):
return vers
spl = str(v... |
from flask.ext import restful
from . import database
from flask import abort, request
from werkzeug import secure_filename
import os
class DocumentInstance(restful.Resource):
def get(self, id):
document = database.get_document(id)
if document is None:
abort(404)
document = ... |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 Marcin Kuzminski,Lukasz Balcerzak. All rights reserved.
#
"""
Created on Apr 8, 2010
:author: marcink,lukaszb
"""
from itertools import chain
from vcs.utils.lazy import LazyProperty
from vcs.exceptions import EmptyRepositoryError
from vcs.exceptions impo... |
from django.core.paginator import Paginator
from lxml import etree, objectify
import mock
import pytest
from .. import factories
from .. import models
from .. import presentation
from .. import views
class TestBagFullTextSearch:
@pytest.mark.xfail(reason='FULLTEXT index is required.')
def test_returns_pagin... |
from core.models import Season, Quarter, Country, Matchday, League, Player, PlayerStatistics, Contract, Finance, Match, \
MatchStadiumStatistics, StadiumStandStatistics, StandLevel, StadiumLevel, MatchTeamStatistics, StadiumLevelItem
from django.contrib import admin
@admin.register(Season)
class SeasonAdmin(admin... |
# No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
#
# 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
#
# U... |
import logging, re, json, commands, os, copy
from datetime import datetime, timedelta
import time
import json
import copy
import itertools, random
import string as strm
from urllib import urlencode
from urlparse import urlparse, urlunparse, parse_qs
from django.http import HttpResponse
from django.http import HttpR... |
# coding=utf-8
import requests
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect, Http404, HttpResponseForbidden, HttpResponse
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from django.db import IntegrityError
... |
import logging, re, json, commands, os, copy
from datetime import datetime, timedelta
import time
import json
import copy
import itertools, random
import string as strm
from urllib import urlencode
from urlparse import urlparse, urlunparse, parse_qs
from django.http import HttpResponse
from django.http import HttpR... |
import logging, re, json, commands, os, copy
import sys, traceback
from datetime import datetime, timedelta
import time
import json
import copy
import itertools, random
import string as strm
import math
from urllib import urlencode, unquote
from urlparse import urlparse, urlunparse, parse_qs
from django.utils.decorator... |
import os
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import (CreateView, DetailView, ListView,
RedirectView... |
import logging, re, json, commands, os, copy
from datetime import datetime, timedelta
import time
import json
import copy
import itertools, random
import string as strm
import math
from urllib import urlencode
from urlparse import urlparse, urlunparse, parse_qs
from django.http import HttpResponse
from django.http im... |
# Copyright (c) 2008 Mikeal Rogers
#
# 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... |
from core.models import *
from core.forms import *
from django.shortcuts import render, redirect, get_object_or_404
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.mail import send_mail, send_mass_mail
from django.conf import settings
from django.contrib import messages
from d... |
#
# File: courseware/capa/responsetypes.py
#
'''
Problem response evaluation. Handles checking of student responses, of a variety of types.
Used by capa_problem.py
'''
# standard library imports
import inspect
import json
import logging
import numbers
import numpy
import random
import re
import requests
import tim... |
#!/usr/bin/env python3
# @file course-api.py
# @brief One script to rule them all.
#
# Downloads schedule data for a specific semester, including course
# meeting times, course descriptions, pre/corequisites, FCEs, and so on.
# Output is parsed into a single JSON output file.
#
# If you want... |
from bs4 import BeautifulSoup
from urllib2 import urlopen
from datetime import datetime
import csv
import sys
import os
import smtplib
import config
## ============================================================================
## Configurable Variables
## ====================================... |
"""General functions and classes to support PsychoPy experiments."""
from __future__ import division
import os
import sys
import time
import json
import argparse
import subprocess
from glob import glob
from string import letters
from math import floor
from subprocess import call
import numpy as np
import pandas as pd
... |
"""cs122 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... |
from django.db import models
class Users(models.Model):
username = models.CharField(max_length=32)
userType = models.CharField(max_length=16) # e.g. scheduler, faculty
email = models.CharField(max_length=32)
password = models.CharField(max_length=128)
salt = models.CharField(max_length=128)
firstNa... |
"""
This module contains the
:class:`StructureMapper<concept_formation.structure_mapper.StructureMapper>`
class which is used to perform flattening (i.e., compilation of component
attributes into relational attributes) and structure mapping (i.e., renaming
variable attributes it improve the category utility) on instanc... |
import os
import uuid
import django
from configurations import Configuration, pristinemethod
class Test(Configuration):
DEBUG = True
SITE_ID = 1
SECRET_KEY = str(uuid.uuid4())
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(os... |
#!/usr/bin/python
import confluent.exceptions as exc
import confluent.messages as msg
import eventlet
import eventlet.green.select as select
import eventlet.green.subprocess as subprocess
import glob
import logging
logging.getLogger('libarchive').addHandler(logging.NullHandler())
import libarchive
import hashlib
import... |
import json
import os
import os.path as path
from functools import partial
from subprocess import check_output
import petname
from conjureup import async, controllers, juju, utils
from conjureup.api.models import model_info
from conjureup.app_config import app
from conjureup.models.provider import Schema
from conjure... |
#!/usr/bin/env python3
#
# marathon_group.py: generate a Marathon Service Group out of a list of containers
#
# Author: Fernando Sanchez [ fernando at mesosphere.com ]
import json
import sys
import argparse
import subprocess
import os
import uuid
def create_group ( name, containers ):
"""
Creates a marathon group t... |
import sys, os, sublime, sublime_plugin
from modules import cssvariables, cssnesting
import tests
#
# Text Commands
#
class css_less_ish_compile_command(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
#reload_modules()
cssvariables.apply(view, edit)
cssnesting.apply(view, edit)
#print "C... |
# MIT License
#
# Copyright (c) 2017 Jonatan Almén, Alexander Håkansson, Jesper Jaxing, Gmal
# Tchaefa, Maxim Goretskyy, Axel Olivecrona
#
# 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 with... |
from django.db import models
from django.db.models.loading import get_model
from django.shortcuts import get_object_or_404
from django.views.generic.list import ListView
from django.utils.encoding import smart_str
from django.utils.text import capfirst
from cuff.models import Experiment
ALLOWED_LOOKUPS = ('iexact', '... |
from __future__ import unicode_literals, print_function
import sys
import click
import re
from datetime import datetime
from prompt_toolkit import Application, CommandLineInterface, AbortAction
from prompt_toolkit.history import History
from prompt_toolkit.shortcuts import create_default_layout, create_eventloop
fro... |
#!/usr/bin/env python
import Tkinter as tk
import requests
import json
def create_widgets(s):
quit_button = tk.Button(text='Quit', command=quit)
quit_button.grid(column=3,row=2)
username_input = tk.Entry();
username_input.insert(0, 'Username');
username_input.grid(column=1,row=1)
pas... |
"""
===============================================
Feature transformations with ensembles of trees
===============================================
Transform your features into a higher dimensional, sparse space. Then train a
linear model on these features.
First fit an ensemble of trees (totally random trees, a rand... |
from __future__ import division
from __future__ import print_function
import sys
sys.path.append('../myhdl')
import os
import argparse
from argparse import Namespace
from array import array
from myhdl import *
# resuse some of the interfaces
from vga_intf import Clock
from vga_intf import Reset
from vga_intf impor... |
# -*- coding: utf-8 -*-
from operator import lt
class LispSyntaxError(Exception):
pass
def lisp_if(predicate, consequent, alternative):
return predicate and consequent or alternative
def lisp_cond(*pred_cons_pairs, _else=None):
if not pred_cons_pairs[0]:
if _else is not None:
retur... |
# convertJsonLDToRDF.py
import sys, codecs
sys.path = sys.path + ['.']
# load the library
from elasticsearch import Elasticsearch
#using plugin rdflib-jsonld we easily can transform jsonld in N3
import json
from rdflib import Graph, plugin, ConjunctiveGraph, URIRef
from rdflib.serializer import Serializer
from rdfli... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.