code
stringlengths
1
199k
""" Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 The version of the OpenAPI document: 1.1.2-pre.0 Contact: blah@cliffano.com Generated by: https://openapi-generator.tech """ try: from inspect import getfullargspec except ImportError: from i...
from checks import AgentCheck import subprocess class openFileHandleCheck(AgentCheck): def check(self, instance): if not instance['process_name']: self.log.error('process_name is not defined') return process_name = instance['process_name'] stat_prefix = self.init_conf...
import rules is_faculty = rules.is_group_member('faculty') can_access_media_files = is_faculty | rules.is_superuser has_faculty_privilege = is_faculty | rules.is_superuser can_access_unreleased_problems = has_faculty_privilege @rules.predicate def can_access_problem(user, problem): return problem.released or can_ac...
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import io import os import json import unicodecsv as csv from copy import deepcopy from jsontableschema.model import SchemaModel from datapackage import DataPackage from ....
""" Package responsible for reading multiple files of the same type and obtaining true standard deviations """ from glob import glob from os.path import exists from serpentTools.settings import rc from serpentTools.messages import (warning, debug, MismatchedContainersError, error, Sam...
from __future__ import print_function, division from optparse import OptionParser import os import sys sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))[:-3] + 'python') from WikipediaScraper import * __author__ = "Louis Dijkstra" usage = """%prog <user> <output.csv> <user> username of a specific Wikiped...
""" Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 The version of the OpenAPI document: 1.1.2-pre.0 Contact: blah@cliffano.com Generated by: https://openapi-generator.tech """ import unittest import openapi_client from openapi_client.model.github_org...
from django.contrib import admin from .models import Address admin.site.register(Address)
import numpy as np import matplotlib.pyplot as plt from scipy.stats import geom from .distribution import Distribution __all__ = ['Geometric'] class Geometric(Distribution): """ The geometric distribution is the distribution of the number of trials needed to get the first sucess in repeated Bernoulli tr...
from setuptools import setup from setuptools import find_packages from huzzer import VERSION additional_args = { 'zip_safe': False, 'packages': find_packages(), 'entry_points': { 'console_scripts': [ 'huzz = huzzer.huzz:main' ], } } setup( name='huzzer', version=VERSI...
""" Unittests for nwid.terminal.codes module. """ from __future__ import absolute_import from mock import patch from nwid.terminal import codes as code from nwid.terminal.codes import TerminalCode def test_code_initialization(): """Escape codes should be initialized properly.""" assert str(code.BLACK) == '30' ...
""" Statistics module that is supposed to allow printing pre-defined or customized stats about the simulation in matplotlib graphs. TODO: Finish implementation. This is still old outdated code that should serve as inspiration only. """ import matplotlib.pyplot as plt plt.xkcd() __author__ = 'Michael Wagner' __version__...
""" Empty SDK file. """
from tests.test_helper import * from braintree import * class TestRiskData(unittest.TestCase): def test_initialization_of_attributes(self): risk_data = RiskData( { "id": "123", "decision": "Unknown", "device_data_captured": True, ...
from common.headers import * from django.contrib.auth.forms import PasswordChangeForm @require_POST def api(request, param): form = PasswordChangeForm(user=request.user, data=request.POST) if form.is_valid(): form.save() response = L('Password changed.') return HttpResponse(app_notify=re...
import unittest from ..fakes import FakeAction from contextshell.path import NodePath, NodePath as np # isort:skip def create_tree(*args, **kwargs): from contextshell.backends.node import NodeTreeRoot return NodeTreeRoot(*args) class ConstructionTests(unittest.TestCase): def test_root_have_no_value(self): ...
from powerline.theme import requires_segment_info @requires_segment_info def nix_shell_segment(pl, segment_info, create_watcher=None): if segment_info['environ'].get('IN_NIX_SHELL', '') != '': return "(nix)"
import voxie import dbus def registerNOCHandler(conn, uniqueConnectionName, client, context): if len(uniqueConnectionName) == 0 or uniqueConnectionName[0] != ':': raise Exception('Connection name %s is not a unique connection name' % ( repr(uniqueConnectionName),)) busName = "org.freedesktop...
def TOut_beh(mode, inc_in, LEDs, rdy_out): '''| | Specify the behavior, describe data processing; there is no notion | of clock. Access the in/out interfaces via get() and append() | methods. The "TOut_beh" function does not return values. |________''' print "Warning: Behavior model not implemen...
from django.conf.global_settings import LOGIN_URL from django.contrib import messages from django.contrib.auth import authenticate, login as auth_login from django.contrib.auth.models import User from django.core.context_processors import csrf from django.core.urlresolvers import reverse from django.http.response impor...
""" Copyright (c) 2015-2016 Roberto Christopher Salgado Bjerre. 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 rights to use, copy, modify, me...
X = 99 def func(Y): Z = X + Y return Z print(func(1)) import builtins print(dir(builtins)) print(zip) print(builtins.zip) print(zip is builtins.zip)
import numpy as np import matplotlib.pyplot as plt import os.path import json import scipy import argparse import math import pylab import sys import caffe from random import random from sklearn.preprocessing import normalize from libs.colorlist import colorlist from PIL import Image def segment(model,weights,iteration...
from pprint import pprint from django.contrib.auth.mixins import PermissionRequiredMixin from django.shortcuts import render from django.views import View import lotes.models from geral.functions import has_permission import cd.forms class TrocaLocal(PermissionRequiredMixin, View): def __init__(self): self....
import numpy as np from openpnm.utils import logging from openpnm.phase import Mercury from openpnm.physics import GenericPhysics from openpnm.metrics import Porosimetry from openpnm import models from openpnm import topotools logger = logging.getLogger(__name__) class MercuryIntrusion(Porosimetry): r""" A read...
class RowsDatabase(object): def __init__(self, num_columns): """ Constructor de la clase """ self.row_values = [] self.num_columns = int(num_columns) def insert_value(self, values): """ Método que almacena internamente los valores de la fila para l...
FLAG_IS_PHOTOS_BEING_ADDED = False FLAG_IS_AUTO_ALBUMS_BEING_PROCESSED = False NUM_PHOTOS_TO_ADD = 0 NUM_PHOTOS_ADDED = 0 def is_auto_albums_being_processed(): global FLAG_IS_AUTO_ALBUMS_BEING_PROCESSED return { "status":FLAG_IS_AUTO_ALBUMS_BEING_PROCESSED } def set_auto_album_processing_flag_on(): ...
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.mininode import sha256, ripemd160, CTransaction, CTxIn, COutPoint, CTxOut from test_framework.address import script_to_p2sh, key_to_p2pkh from test_framework.script import CScript, OP_HASH160, OP_CHECKSI...
from __future__ import unicode_literals, absolute_import import os import django PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(PROJECT_DIR) DEBUG = True USE_TZ = True SECRET_KEY = "33333333333333333333333333333333333333333333333333" DATABASES = {"default": {"ENGINE": "django.db.bac...
''' ONLY FOR INSIDE INNNOGAMES ''' ''' import json import os import subprocess import sys import psutil import time import logging import re import string, threading import kronos import math from subprocess import call from sys import platform as _platform from django.db.models.expressions import F, RawSQL import sele...
""" Mutalyzer config file Specify the location of this file in the `MUTALYZER_SETTINGS` environment variable. """ from __future__ import unicode_literals EMAIL = 'mutalyzer@humgen.nl' BATCH_NOTIFICATION_EMAIL = '{{ mutalyzer_batch_notification_email }}' CACHE_DIR = '/opt/mutalyzer/cache' LOG_FILE = '/opt/mutalyzer/log/...
from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import tensorflow as tf import math import time from datetime import timedelta from six.moves import cPickle as pickle import notMNIST_downloader notMNIST_downloader.download(); pickle_file = 'notMNIST.pickle' with open(pickle_file...
import _plotly_utils.basevalidators class TextValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="text", parent_name="funnelarea", **kwargs): super(TextValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edi...
import HTMLParser import re try: from html import escape except ImportError: # Python < 3.2 from cgi import escape from htmlentitydefs import name2codepoint def html_quote(v): if v is None: return '' if hasattr(v, '__html__'): return v.__html__() if isinstance(v, basestring): ...
def _(): return (foo,) = (_,)
from functools import partial import functools import time import weakref import asyncio from copy import deepcopy from numpy.lib.arraysetops import isin OBSERVE_GRAPH_DELAY = 0.23 # 23 is not a multiple of 50 OBSERVE_STATUS_DELAY = 0.5 OBSERVE_STATUS_DELAY2 = 0.2 status_observers = [] class StatusObserver: def __i...
a = 1 + 2 + 3 + 4 print(a)
from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui_SublayersDialog(object): def setupUi(self, SublayersDialog): SublayersDialog.setObjectName(_fromUtf8("SublayersDialog")) SublayersDialog.resize(400, 300) s...
def paths_with_sum(node, sum): return _paths_with_sum(node, 0, sum, {}) def _paths_with_sum(node, current_sum, target_sum, sum_table): if not node: return 0 current_sum += node.data sum = current_sum - target_sum paths = sum_table.get(sum, 0) if current_sum == target_sum: paths +...
import os import shutil import math import time import menpo.io as mio import menpo3d.io as m3io import numpy as np import h5py import pandas as pd import datetime from menpo.shape import ColouredTriMesh, PointCloud from menpo.image import Image from menpo.transform import Homogeneous from menpo3d.rasterize import rast...
import sys, os class VerificationError(Exception): """ An error raised when verification fails """ class VerificationMissing(Exception): """ An error raised when incomplete structures are passed into cdef, but no verification has been done """ LIST_OF_FILE_NAMES = ['sources', 'include_dirs', 'librar...
""" Basic chain parser tool for SmartChain functions. Author: Tim M. (TM2013) Co-Author: Bitkapp (aka alaniz) Organization: Project Radon Date: 2/17/2016 Requirements: BitcoinRPC An RPC-enabled client """ from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException import logging import time try: import cPickl...
from extra import auth from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): def handle(self, *args, **options): auth.create_perms_read(self) auth.create_perms_own(self) auth.create_group_default(self) auth.create_group_pi(self)
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="splom.selected.marker", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=pare...
import os import fix_path import urllib import webapp2 import jinja2 from authomatic import Authomatic from authomatic.adapters import Webapp2Adapter from config import CONFIG authomatic = Authomatic(config=CONFIG, secret='some random secret string') class Login(webapp2.RequestHandler): def any(self, provider_name)...
import sys class BinaryTreeNode: class BinarySearchTree: def __init__(self, data): self.left = None self.right = None self.data = data def insert(self, data): if self.data def find_ancestor(search_line): anc1, anc2 = search_line.split(' ') def main(): with open(sys.argv[1]) as input_file: for line in inpu...
from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.mininode import CTransaction, NetworkThread from test_framework.blocktools import create_coinbase, create_block from test_framework.comptool import TestInstance, TestManager from test_framework.script...
from pymeasure.thread import StoppableThread def test_thread_stopping(): t = StoppableThread() t.start() t.stop() assert t.should_stop() is True t.join() def test_thread_joining(): t = StoppableThread() t.start() t.join() assert t.should_stop() is True
from threading import Thread from random import randint import pymysql.cursors import configparser import time class DatabaseThread(Thread): def __init__(self, parent, cfg_file): Thread.__init__(self) self.cfg_file = cfg_file self.stop = True self.gpsTime = "" self.gpsDate = "" self.latDeg = "" self.lonD...
''' Created on May 19, 2016 @author: skarumbaiah '''
from django import template from django.contrib.humanize.templatetags.humanize import intcomma from django.template.defaultfilters import floatformat register = template.Library() @register.filter def humanize_price(price): return intcomma(floatformat(price, 0))
from PyQt5 import QtCore, QtGui, QtWidgets class Ui_ORStoolsDialogBase(object): def setupUi(self, ORStoolsDialogBase): ORStoolsDialogBase.setObjectName("ORStoolsDialogBase") ORStoolsDialogBase.resize(412, 868) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePol...
import re import string import markovify from unidecode import unidecode DEFAULT_MAX_OVERLAP_RATIO = 0.7 DEFAULT_MAX_OVERLAP_TOTAL = 15 DEFAULT_TRIES = 10 class Text(object): def __init__(self, input_text, state_size=2, chain=None): """ input_text: A string. state_size: An integer, indicatin...
from hazc import hazc_master master = hazc_master.hazc_master() master.setDebugCommandLine(True) master.detectDevices()
from django.conf.urls import patterns, url from simple import views urlpatterns = patterns('', #url(r'^$', views.index, name='index'), url(r'^login/', views.login, {'provider_name': 'fb'}, name='login') )
import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import Pipe...
import ConfigParser import socket from os.path import expanduser Config = ConfigParser.ConfigParser() Config.read(expanduser('~/.rbh-quota.ini')) try: db_host = Config.get('rbh-quota_api', 'db_host') except: db_host = '' try: db_user = Config.get('rbh-quota_api', 'db_user') except: db_user = '' try: ...
from toontown.estate import DistributedStatuary from toontown.estate import DistributedLawnDecor from direct.directnotify import DirectNotifyGlobal from direct.showbase.ShowBase import * from pandac.PandaModules import * from toontown.toon import Toon from toontown.toon import ToonDNA import GardenGlobals from toontown...
class Token(): """ID = (1, "id") STRING = (2, "token_string") INTEGER = (3, "token_integer") LONG = (4,"token_long") FLOAT = (5,"token_single") DOUBLE = (6, "token_double") RESERVED = (7, "") OPERATOR_OR_SYMBOLS = [ (8, "token_neg","-"), (9, "token...
from subprocess import Popen, PIPE from shlex import split def add_kube_segment(powerline): try: cmd = "kubectl config view -o=jsonpath={.current-context} | sed -e 's/gke_uc-prox-//g;s/_europe-west1-b_/-/g' | tr -d '\n' " output = Popen("%s " % cmd, stdout=PIPE, shell=True).communicate()[0] exce...
""" breeze.utils.settings ~~~~~~~~~~~~~~~~~~~~~ This module defines various utility functions for dealing with vim variables. """ import vim prefix = 'g:breeze_' def set(name, value): """To set a vim variable to a given value.""" if isinstance(value, basestring): val = "'{0}'".format(value) elif isi...
""" SQLpie License (MIT License) Copyright (c) 2011-2016 André Lessa, http://sqlpie.com See LICENSE file. """ import os, time import sys sys.path.append(os.getcwd()) from flask import Flask, current_app, g from flask import jsonify from flaskext.mysql import MySQL import sqlpie import application def handle_shell(app, ...
"""Hourly Temp Frequencies""" import calendar import pandas as pd from pyiem.util import get_autoplot_context, get_sqlalchemy_conn from pyiem.plot import figure_axes from pyiem.exceptions import NoDataFound PDICT = { "above": "At or Above Temperature", "below": "Below Temperature", } def get_description(): ...
from cosmos.lib.ezflow.tool import Tool import os class Bunzip2(Tool): name = "Bunzip" mem_req = 4*1024 cpu_req = 2 time_req = 100 inputs = ['bz2'] outputs = ['*'] def cmd(self,i,s,p): """ """ return 'bunzip2 -c {i[bz2]} > $OUT.*' class Gunzip(Tool): inputs = ['gz...
try: from setuptools import setup except ImportError: from distutils.core import setup version = '2.2.0' setup( name='proyectos_de_ley', version=version, author='Carlos Peña', author_email='mycalesis@gmail.com', packages=[ 'proyectos_de_ley', ], include_package_data=True, ...
from .block import * from .group import * from .single import *
""" An example of the basic mutaprops functions: * mutaproperties * mutasources * read-only parameter * UI manager initialization """ from mutaprops import * import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) logger = logging.getLogger(__name__) @mutaprop_class("Hoovercraft UI") class...
ACCESS_TOKEN = '<<ACCESS_TOKEN>>' VERIFY_TOKEN = '<<VERIFY_TOKEN>>' WIT_AI_ACCESS_TOKEN = 'IKJJJYYVR3X672DHFVS7U7C4L2MQSS2P' FACTS_SOURCE_FILE = 'data/facts.json' JOKES_SOURCE_FILE = 'data/jokes.json' QUOTES_SOURCE_FILE = 'data/quotes.json' SPOTIFY_TOKEN_FILE = 'tokens/spotify_token.json' GOODREADS_ACCESS_TOKEN = '<<GO...
""" Series of galactic operations (doesn't that sound cool?!). ...as in converting coordinates, calculating DM etc. """ from datetime import timedelta import ctypes as C import math import numpy as np import os import pandas as pd import random from frbpoppy.paths import paths uni_mods = os.path.join(paths.models(), 'u...
class Node(object): def __init__(self, x): self.value = x self.next = None class LinkedList(object): def __init__(self): self.head = None self.length = 0 def print_list(self): list_values = [] cur = self.head while cur is not None: list_val...
import sys import ipaddress as ip #built in lib for IP handling import json #built in lib for JSON file handling class word(): """Stores JSON words""" pref = 'prefixes' ipPref = 'ip_prefix' ipV6Pref = 'ipv6_prefix' #un-used in this version. Not handling IPv6 region = 'region' service = 'service' isOpen = False de...
from django.db import models from django.utils import timezone class BaseCoin(models.Model): date = models.DateField(default=timezone.now) exchange = models.CharField(max_length=100, blank=True, default='') price = models.DecimalField(max_digits=12, decimal_places=4, default=0) high = models.DecimalFiel...
import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG SECRET_KEY = "NOTASECRET" DATABASES = { "default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}, "replica": { "ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:", "T...
from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer from .. import models from ._configuration import ContainerRegistryManagementClie...
from basic import *
class BSTNode(object): def __init__(self, **kwargs): # < self.l = None # >= self.r = None self.data = None self.__dict__.update(kwargs) @staticmethod def to_bst(list=[]): if(len(list) == 0): return None root = BSTNode() v = len(list) / 2 while v > 0 and list[v] == list[v - 1]: v -= 1 root...
""" Similar to syntax_color.py but this is intended more for being able to copy+paste actual code into your Django templates without needing to escape or anything crazy. http://lobstertech.com/2008/aug/30/django_syntax_highlight_template_tag/ Example: {% load highlighting %} <style> @import url("http://lobstertech.c...
def setDefaults2Obj( pObj, defaults, exclude = []): """ Asignas las props q vienen en un dict a un objeto """ for key in defaults: if key in exclude: continue try: setattr(pObj, key, defaults[key]) except: #TODO: Log pass
''' Executes Main.java in the same directory and prints it out ''' import subprocess, re, sys, collections, os.path from subprocess import STDOUT,PIPE,Popen import pyparsing as pp from collections import defaultdict def structural_query_vector(query): result = -1 try: result = jena_graph('Main', query) result = a...
'''Various classifier implementations. Also includes basic feature extractor methods. Example Usage: :: >>> from textblob import TextBlob >>> from textblob.classifiers import NaiveBayesClassifier >>> train = [ ... ('I love this sandwich.', 'pos'), ... ('This is an amazing place!', 'pos'), ...
"""Alert statuses.""" from verta._internal_utils import documentation from ._status import ( _AlertStatus, Alerting, Ok, ) documentation.reassign_module( [ Alerting, Ok, ], module_name=__name__, )
from .default import Config class DevelopmentConfig(Config): pass
""" Module with various fits handling functions. """ __author__ = 'Carlos Alberto Gomez Gonzalez' __all__ = ['open_fits', 'info_fits', 'write_fits', 'verify_fits', 'byteswap_array'] import os import numpy as np from astropy.io import fits as ap_fits def open_fits(fitsfilename...
import os import struct from tempfile import TemporaryFile from extractor.entrytype import Map from extractor.utils import * def converttobin(f): uncompressed_size = read_ushort(f) data = [0 for _ in range(uncompressed_size)] tag = read_ubyte(f) match_bits = read_ubyte(f) assert match_bits == 4 ...
import numpy as np from .ortho_point import OrthoPoint from ..pytools import flag, flag_enum __all__ = ("OrthoMazeCellStatus", "OrthoMazeCell") class OrthoMazeCellState(flag_enum.FlagEnum): """Represent a single state of a cell.""" Visited = 0x01 NorthWall = 0x02 EastWall = 0x04 SouthWall = 0x08 ...
import requests import json import sys print ("Running Endpoint Tester....\n") address = input("Please enter the address of the server you want to access, \n If left blank the connection will be set to 'http://localhost:5000': ") if address == '': address = 'http://localhost:5000' print ("Making a GET Request for /p...
from math import sin, cos from openmdao.lib.components.api import MetaModel from openmdao.lib.doegenerators.api import FullFactorial, Uniform from openmdao.lib.drivers.api import DOEdriver from openmdao.lib.surrogatemodels.api import LogisticRegression, FloatKrigingSurrogate from openmdao.main.api import Assembly, Comp...
import omniORB omniORB.updateModule("CosTypedNotifyComm") import CosTypedNotifyComm_idl
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0031_sponsor_nightmode_image'), ] operations = [ migrations.AddField( model_name='sponsor', name='email_sponsor', ...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import math __all__ = ['tangent_points_to_circle_xy'] def tangent_points_to_circle_xy(circle, point): """Calculates the tangent points on a circle in the XY plane. Parameters ---------- circle : ...
''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the directory that is passed as an argument: nodes_main.txt nodes_test.txt These files must consist of lines in the format <ip> <ip>:<port> [<ipv6>] [<ipv6>]:<port> <onion>.onion 0xDDBBCC...
from login import db from werkzeug import generate_password_hash, check_password_hash from sqlalchemy import Table, Column, String, ForeignKey, BLOB from sqlalchemy.orm import relationship, backref import pyotp import time import qrcode from PIL import Image def hash_pass(password): return generate_password_hash(passw...
import RPi.GPIO as GPIO import time class DistanceSensor(object): CENTIMETER_COEFF = 17150 def __init__(self, trig_pin, echo_pin): self.trig_pin = trig_pin self.echo_pin = echo_pin GPIO.setmode(GPIO.BCM) GPIO.setup(self.trig_pin, GPIO.OUT) GPIO.setup(self.echo_pin, GPIO.I...
import urllib import os import re N_ARTICLES=5000 STEP_SIZE =50 URL_PATTERN="http://ec2-54-224-192-157.compute-1.amazonaws.com/annotate/index.php?expert_name=Master&status=pending_tagging&break=%d" dl_cache = os.path.join(os.environ["HOME"], "Cache", "get_pubmed_ids") if not os.path.exists(dl_cache): os.makedirs(dl...
from typing import Any, cast from amino import options from amino.util.mod import unsafe_import_name from amino.anon.prod.attr import AttrLambda from amino.anon.prod.method import MethodLambda from amino.anon.prod.complex import ComplexLambda _: AttrLambda = cast(AttrLambda, None) __: MethodLambda = cast(MethodLambda, ...
__author__ = 'Sandro Vega Pons : https://www.kaggle.com/svpons' import numpy as np import pandas as pd from sklearn.preprocessing import LabelEncoder from sklearn.linear_model import SGDClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn import ...
import codecs import glob import json import random import numpy as np class Vocabulary(object): def __init__(self): self._token_to_id = {} self._token_to_count = {} self._id_to_token = [] self._num_tokens = 0 self._s_id = None self._unk_id = None @property de...
from __future__ import unicode_literals import threading import time from multiple_database.routers import TestRouter import django from django.db import ( DatabaseError, connection, connections, router, transaction, ) from django.test import ( TransactionTestCase, mock, override_settings, skipIfDBFeature, ...
from django.core.urlresolvers import reverse_lazy from django.template import Context, Template, TemplateSyntaxError from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django.views.generic.base import View from braces.views import LoginRequiredMixin, AjaxResponseM...
class User: def __init__(self, data): self.data = data def validate(self): self.validate_email() self.validate_first_name() self.validate_last_name() def validate_email(self): if '@' not in self.data['email']: raise ValueError('Invalid email provided.') ...