src stringlengths 721 1.04M |
|---|
import datetime
import json
import urllib.error
import urllib.parse
import urllib.request
import uuid
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import User
from django.core.mail import EmailMessage
from django.core.mail import send_mail
from django.shortcuts i... |
# pylint: skip-file
# This file is not maintained, but might be used in the future
#
import logging
import sys
from lbrynet.lbrylive.LiveStreamCreator import StdOutLiveStreamCreator
from lbrynet.core.BlobManager import TempBlobManager
from lbrynet.core.Session import Session
from lbrynet.core.server.BlobAvailabilityHan... |
#MenuTitle: Quote Manager
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Build double quotes from single quotes, and insert #exit and #entry anchors in the single quotes for auto-alignment.
"""
import vanilla
from Foundation import NSPoint
names = {
"quotesinglb... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This is a configuration file with no functioning code
# pylint: skip-file
#
# pyani documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 11 13:27:32 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
... |
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
###################################################... |
"""Default configuration values and documentation"""
from django.conf import settings
"""
.. data:: MIXPANEL_API_TOKEN
API token for your Mixpanel account. This configures the Mixpanel account
where all of the action will be.
You can find this on the ``API Information`` tab on your
`mixpanel account... |
from typing import List, Optional
import filters as f
from iota import Address, ProposedTransaction
from iota.commands import FilterCommand, RequestFilter
from iota.commands.core import GetBalancesCommand
from iota.exceptions import with_context
from iota.filters import Trytes
from iota.multisig.transaction import Pr... |
__author__ = 'IVMIT KFU: Gataullin Ravil & Veselovkiy Sergei'
from copy import copy
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from time import time
import warnings
warnings.filterwarnings("ignore")
from sklearn.cross_validation import train_test_split
from structure import Position
class... |
import django
import json
import logging
import re
import datetime
from itertools import chain, imap
from django.core.exceptions import FieldError
from django.db.models.fields import FieldDoesNotExist
from django.db.models.sql.datastructures import EmptyResultSet
from django.db.models.sql.where import EmptyWhere
from ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# drypy documentation build configuration file, created by
# sphinx-quickstart on Mon May 29 12:24:58 2017.
#
# 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
# auto... |
#!/usr/bin/env python
import logging
import yaml
import cgi
from xml.dom import minidom as md
from datetime import datetime, timedelta
from collections import defaultdict
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext import db
from django.utils import sim... |
# MIT License
#
# Copyright (c) 2017 David Sandberg
#
# 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... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 07 19:20:05 2016
@author: ryandrewjones
"""
import sys
import signal
import click
import os
import cPickle as pickle
import energyPATHWAYS.config as cfg
import energyPATHWAYS.util as util
from energyPATHWAYS.pathways_model import PathwaysModel
import energyPATHWAYS.shape... |
"""
Support for IP Cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.generic/
"""
import asyncio
import logging
import aiohttp
import async_timeout
import requests
from requests.auth import HTTPDigestAuth
import voluptuous as vol
from home... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os.path
import logging
from pelican import signals
logger = logging.getLogger(__name__)
class AliasGenerator(object):
TEMPLATE = """<!DOCTYPE html><html><head><meta charset="utf-8" />
<meta http-equiv="refresh" content="0;url=/{destination_... |
#! /usr/bin/env python
from gammalib import *
from math import *
import os
import sys
# ======================= #
# Test CTA response table #
# ======================= #
def cta_response_table(index=1):
"""
"""
# Import modules for plotting
import numpy as np
import matplotlib.pyplot as plt
i... |
import numpy as np
# functions and classes go here
def fb_alg(A_mat, O_mat, observ):
# set up
k = observ.size
(n,m) = O_mat.shape
prob_mat = np.zeros( (n,k) )
fw = np.zeros( (n,k+1) )
bw = np.zeros( (n,k+1) )
# forward part
fw[:, 0] = 1.0/n
for obs_ind in xrange(k):
f_row_vec... |
from .config import *
from ..utils import rebin, db
from .plot_utils import calc_extent
def plot_time_series(wf, f_start=None, f_stop=None, if_id=0, logged=True, orientation='h', MJD_time=False, **kwargs):
""" Plot the time series.
Args:
f_start (float): start frequency, in MHz
f_stop (float)... |
from collections import defaultdict
import csv
from django.core.management.base import BaseCommand
import elasticsearch
import elasticsearch_dsl
import json
import settings
from seqr.models import Individual
from seqr.views.utils.orm_to_json_utils import _get_json_for_individuals
from xbrowse_server.base.models import... |
#!/usr/bin/env python
# Copyright (C) 2005 Aaron Spike, aaron@ekips.org
#
# 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 versio... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2011 SYLEAM (<http://syleam.fr/>)
# Copyright (C) 2013 Julius Network Solutions SARL <co... |
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.contrib.auth.models import User
from django.db.models import Q
from django.urls import reverse
from django.utils.text import slugify, mark_safe
from django.db.models.signals import pre_save
from django.utils import timez... |
from copy import deepcopy
from django.core.cache import cache
from django.contrib.sites.models import Site
from django.db.models import signals
from django.http import Http404
from djpcms import sites
from djpcms.models import Page
from djpcms.views import appsite
from djpcms.views.baseview import pageview
class Pa... |
'''
Small RNA storage class
Stores unique sequence and read count in an internal dictionary.
Automatic normalisation to RPMR once loaded from file
'''
from scram_modules.dna import DNA
import time
class SRNASeq(object):
def __init__(self):
self._internal_dict = {} # internal dictionary for class
... |
import re
import argparse
import pandas as pd
# General expressions
re_error = re.compile(r'\[ERROR\]\[(\d+)\]\[(\w+)\](.+)')
re_warning = re.compile(r'\[WARN \]\[(\d+)\]\[(\w+)\](.+)')
re_info = re.compile(r'\[INFO \]\[(\d+)\]\[(\w+)\](.+)')
re_debug = re.compile(r'\[DEBUG\]\[(\d+)\]\[(\w+)\](.+)')
re_verbose = re.co... |
#!/usr/bin/env python
# coding: utf8
"""This example shows how to navigate the parse tree including subtrees
attached to a word.
Based on issue #252:
"In the documents and tutorials the main thing I haven't found is
examples on how to break sentences down into small sub thoughts/chunks. The
noun_chunks is handy, but h... |
import datetime
class TZOffset(datetime.tzinfo):
def __init__(self, offset_string):
# validity of offset_string is already taken care of by Setting.put() so we just trust it here.
self.offset_string = offset_string
self._h = int(self.offset_string[1:3])
self._m = int(self.offset_st... |
"""
Mark.
pymdownx.mark
Really simple plugin to add support for
<mark>test</mark> tags as ==test==
MIT license.
Copyright (c) 2014 - 2017 Isaac Muse <isaacmuse@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software")... |
# Copyright (C) 2011 Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not ... |
__author__ = 'Iurii Sergiichuk <iurii.sergiichuk@gmail.com>'
gal1 = tuple(range(256))
gal2 = (
0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e,
0x40, 0x42, 0x44, 0x... |
import json
from jsonobject.exceptions import BadValueError
from corehq.apps.reports_core.filters import DatespanFilter, ChoiceListFilter, Choice, DynamicChoiceListFilter, \
NumericFilter
from corehq.apps.userreports.exceptions import BadSpecError
from django.utils.translation import ugettext as _
from corehq.apps.... |
from flask import Flask, send_from_directory, jsonify, request
from flask_socketio import SocketIO
import settings
import os
app = Flask(__name__, static_url_path='')
socketio = SocketIO(app)
@app.route('/', methods=['GET'])
def home():
return send_from_directory('../front', 'index.html')
@app.route('/front/<pat... |
# -*- coding: UTF-8 -*-
## Copyright 2009-2013 Luc Saffre
## This file is part of the Lino project.
## Lino 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 y... |
""" openconfig_policy_types
This module contains general data definitions for use in routing
policy. It can be imported by modules that contain protocol\-
specific policy conditions and actions.
"""
import re
import collections
from enum import Enum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal... |
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import division, print_function, unicode_literals
import errno
import logging
import operator
import platform
import pwd
import random
import re
import signal
import socket
import stat
import sub... |
# Copyright 2021 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 agreed to in writing, ... |
"""
https://code.google.com/codejam/contest/32014/dashboard#s=p1
"""
def memo(f):
"""memoization decorator, taken from Peter Norvig's Design of Computer
Programs course on Udacity.com"""
cache = {}
def _f(*args):
try:
return cache[args]
except KeyError:
result =... |
# -*- coding: utf-8 -*-
from django.core.cache import caches
from django.utils import timezone
from oauth2_provider.models import get_access_token_model
from oauth2_provider.oauth2_validators import OAuth2Validator
from django_toolkit import toolkit_settings
cache = caches[toolkit_settings.ACCESS_TOKEN_CACHE_BACKEND]... |
"""
:module:
"""
import rtree
import numpy as np
from pyproj import Proj
from scipy.interpolate import griddata
from shapely.geometry import Point
from openquake.sub.misc.alpha_shape import alpha_shape
def generator_function(mesh):
"""
Generator function for quick loading of a 3D spatial index
:param ... |
# coding=UTF-8
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
import math
import random
import numpy as np
from mdkp import Colony
from machine import AllocationOfMachine
import heapq
from connection import *
import time
import _thread
import logging
import json
import jsonpickle
from log import slogger
#import log
mac... |
#!/usr/bin/env python3
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that... |
"""
======================
Tricontour Smooth User
======================
Demonstrates high-resolution tricontouring on user-defined triangular grids
with matplotlib.tri.UniformTriRefiner
"""
import matplotlib.tri as tri
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
# nodebox section
if... |
# -*- coding: utf-8 -*-
"""
apps.accounts.forms
~~~~~~~~~~~~~~
account forms
:copyright: (c) 2012 by arruda.
"""
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from accounts.models import UserProfile, Quota
class Re... |
# -*- coding: utf-8 -*-
from pushbullet import Pushbullet
from util import Mailer
from raspysystem.raspytask import RasPyTask
from twitter import TwitterTask
"""
send report end of day via email
send reports to pushbullet
"""
class NotifierTask(RasPyTask):
def __init__(self, parent):
RasPyTask.__... |
import sys
import numpy as np
import tensorflow as tf
import tensorflow.contrib.rnn as rnn
from act_wrapper import ACTWrapper
from act_model import ACTModel
from data import generate_sort_data
def echo(message, file):
print(message)
file.write(message + "\n")
SEED = 0
TRAIN_STEPS = 250000
BATCH_SIZE = 16... |
#!/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... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_20150830_2306'),
]
operations = [
migrations.AddField(
model_... |
# -*- coding: utf-8 -*-
# Copyright 2013 Fanficdownloader team, 2015 FanFicFare 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
#
# Un... |
#!/user/bin/env python
# coding:utf-8
import sys
import os
import codecs
import pandas as pd
reload(sys)
sys.setdefaultencoding('utf-8')
#删除的列 从0开始
DELCOL = 1
_DictFileCoding = dict()
def GetAllTxt(srcPath, dstPath):
#print path
srcfiles = []
dstfiles = []
for root, dirs, files in os.walk(srcPath):
for f in f... |
#!/usr/bin/python
import sys
import json
import serial
import fcntl
import serial.tools.list_ports
import time
from threading import Thread, Lock
import rospy
from atmega328p_service_discovery.srv import *
class SearchServices:
foundDevices = {}
def get_serial_port(self, service):
if not service in ... |
"""A simple trie, or prefix tree, data structure."""
import itertools
import collections.abc
class Trie(collections.abc.MutableSet):
"""A simple prefix tree data structure.
A Trie is data structure for storing sequences of "names," which can be
aribtrary hashable objects. In the prototypical trie, names ... |
# Copyright (C) 2015 JWCrypto Project Contributors - see LICENSE file
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives.asymmetric import ec
from jwcrypto.common import base64url_decode
import json
# draft-ietf-jose-... |
# -*- coding: utf-8 -*-
'''
pyca.db
~~~~¨~~
Database specification for pyCA
'''
import json
import os.path
import string
from pyca.config import config
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, Text, LargeBinary, DateTime, \
create_engine
from sqla... |
import os
import json
import logging
from urllib import quote
from xml.dom.minidom import parseString
from datetime import datetime
import webapp2, jinja2
from google.appengine.api.urlfetch import fetch
from google.appengine.api import memcache
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoad... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
("fixmystreet", "0059_fmsproxy"),
)
def forwards(self, orm):
# Adding mode... |
#
# Copyright (C) 2017 by YOUR NAME HERE
#
# This file is part of RoboComp
#
# RoboComp 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... |
import datetime
import hashlib
import json
from dateutil.parser import parse
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.template.loader import render_to_string
try:
from mon... |
"""Handle auth and authz activities in ~~~PROJNAME~~~"""
import logging
from decorator import decorator
from pyramid.decorator import reify
from pyramid.httpexceptions import HTTPForbidden
from pyramid.httpexceptions import HTTPFound
from pyramid.request import Request
from pyramid.security import unauthenticated_user... |
# -*- coding: utf-8 -*-
"""
Django settings for backend project.
Generated by 'django-admin startproject' using Django 1.8.2.
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/se... |
#####################################################################################
#
# Copyright (C) Tavendo GmbH
#
# Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you
# have purchased a commercial license), the license terms below apply.
#
# Should you enter into a separate licen... |
import os
from django.apps import AppConfig
from django.apps import apps
def samevalues(names):
records = []
for name in names:
if type(name) == str:
records.append({key: name for key in ['label', 'model', 'title']})
return records
pages = [
{'label': 'capacity', 'view': 'capacit... |
from typing import Any, List, Dict, Optional, Text, Union, Tuple, Iterable, TypeVar
import requests
from jsonschema import validate
from pykechain.defaults import API_EXTRA_PARAMS
from pykechain.enums import Category
from pykechain.exceptions import APIError, IllegalArgumentError
from pykechain.models import Base, Ba... |
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
from decimal import Decimal
from django.db import models
from django.core.validators import MinValueValidator
from ..notifications.models import NotificationMessage
from ..users.models import User
class Answer(models.Model):
question = models.ForeignKey('contests.contest', related_name='answer',
... |
"""Command-line interface for Yuno.
"""
import argparse
import sys
DESCRIPTION = 'Compiler! Y U NO compile???'
USAGE ="yuno.py [-h|--help] [--with key value [value ...]] command"
HELP_COMMANDS = ('help', '-h', '--help')
def build_arg_parser():
parser = argparse.ArgumentParser(
usage=USAGE, add_help=Fa... |
#!/usr/bin/env python
"""
A test of pymc for ITC.
"""
#=============================================================================================
# IMPORTS
#=============================================================================================
import numpy as np
import pymc
import pint
#=================... |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... |
#! /usr/bin/env python
#
# Author: Sergey Savchenko (savchenko.s.s@gmail.com)
#
from threading import Thread
import subprocess
from math import hypot, log10, sqrt
from time import time, sleep
import urllib.request
import urllib
import sys
import os
import glob
import shutil
import argparse
import bz2
import numpy a... |
__source__ = 'https://leetcode.com/problems/gray-code/description/'
# Time: O(2^n)
# Space: O(1)
#
# Description: Leetcode # 89. Gray Code
#
# The gray code is a binary numeral system where two successive values differ in only one bit.
#
# Given a non-negative integer n representing the total number of bits in the cod... |
# This example requires Z3
#
# This example shows how to parallelize solving using pySMT, by using
# the multiprocessing library.
#
# All shortcuts (is_sat, is_unsat, get_model, etc.) can be easily
# used. We sho two techniques: map and apply_async.
#
# Map applies a given function to a list of elements, and returns a
... |
"""
@package mi.dataset.driver.vel3d_l.wfp.test.test_driver
@file marine-integrations/mi/dataset/driver/vel3d_l/wfp/driver.py
@author Steve Myerson (Raytheon)
@brief Test cases for vel3d_l_wfp driver (for both telemetered and recovered data)
USAGE:
Make tests verbose and provide stdout
* From the IDK
... |
# -*- coding: utf-8 -*-
from flask.ext.script import Manager, Shell
from gastosabertos.extensions import db
from gastosabertos import create_app
manager = Manager(create_app)
manager.add_option('-i', '--inst', dest='instance_folder', required=False)
manager.add_command('shell', Shell(make_context=lambda: {
'app... |
from __future__ import unicode_literals
from prompt_toolkit.utils import is_windows
import os
__all__ = [
'ColorDepth',
]
class ColorDepth(object):
"""
Possible color depth values for the output.
"""
#: One color only.
DEPTH_1_BIT = 'DEPTH_1_BIT'
#: ANSI Colors.
DEPTH_4_BIT = 'DEPTH_... |
# -*- coding: utf-8 -*-
"""
(c) 2014 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
"""
from functools import wraps
import flask
import pagure.forms
from pagure import (APP, SESSION, LOG, cla_required, authenticated,
generate_gitolite_acls, generate_authorized_k... |
"""
Support for Nest thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.nest/
"""
import logging
import voluptuous as vol
import homeassistant.components.nest as nest
from homeassistant.components.climate import (
STATE_AUTO, STATE_C... |
# -*- coding: utf-8 -*-
"""
tests
-----
Ensures that certain actions in the togglwrapper library result in certain
behaviours.
Uses the responses library to mock out the requests library, and loads fixtures
from ``fixtures/`` for the mock JSON response output.
"""
import json
import os
import unittest
import respo... |
"""ACME AuthHandler."""
import itertools
import logging
import time
import zope.component
from acme import challenges
from acme import messages
from letsencrypt import achallenges
from letsencrypt import constants
from letsencrypt import errors
from letsencrypt import interfaces
logger = logging.getLogger(__name__... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Camera Surveillance tool for Raspberry Pi with Camera module Project in ICT M152.
Copyright (C) 2015 Kim D. Jeker
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published ... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import numpy as np
from keras.layers.core import Dense
from keras.models import Sequential
from keras.optimizers import RMSprop
from ..value_function import ValueFunction
from ...game.utils import normalize_board
class MLP(ValueFunction):
def __init__(self):
self.model = Sequential()
self.model.a... |
import sys
import os
import re
import urllib
from dudehere.routines import *
from dudehere.routines.scrapers import CommonScraper, ScraperResult
class alluc_apiScraper(CommonScraper):
def __init__(self):
self._settings = {}
self.service='alluc_api'
self.name = 'alluc.com'
self.referrer = 'https://www.alluc.com... |
# Copyright 2013 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 app... |
# -*- coding: utf-8 -*-
# (c) 2016 Marcos Dione <mdione@grulic.org.ar>
# This file is part of ayrton.
#
# ayrton 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... |
import re
import string
class ActiveBranchMixin():
def get_current_branch_name(self):
"""
Return the name of the last checkout-out branch.
"""
stdout = self.git("branch", "--no-color")
try:
correct_line = next(line for line in stdout.split("\n") if line.startsw... |
from django.db import migrations, models
import django.db.models.deletion
import extras.models
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('extras', '0021_add_color_comments_changelog_to_tag'),
]
operations = [
migra... |
###########################################################################
#
# Copyright 2015-2018 Robert B. Lowrie (http://github.com/lowrie)
#
# This file is part of pyRouterJig.
#
# pyRouterJig is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as publishe... |
import httplib
import os
import shutil
import time
import urllib2
from tempfile import NamedTemporaryFile
from django.conf import settings
import commonware.log
from pyquery import PyQuery as pq
import cronjobs
from .models import BlogCacheRyf
log = commonware.log.getLogger('z.cron')
RYF_IMAGE_PATH = os.path.join... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'uamodeler/uamodeler_ui.ui'
#
# Created by: PyQt5 UI code generator 5.11.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_UaModeler(object):
def setupUi(self, UaModeler):
... |
from test_all_fixers import lib3to2FixerTestCase
class Test_numliterals(lib3to2FixerTestCase):
fixer = u"numliterals"
def test_octal_1(self):
b = u"""0o755"""
a = u"""0755"""
self.check(b, a)
def test_octal_2(self):
b = u"""0o777"""
a = u"""0777"""
self.ch... |
from __future__ import absolute_import
__author__ = 'chris'
from django.forms.models import model_to_dict
import six
class UpdateScriptsMixin(object):
def save(self, **kwargs):
super(UpdateScriptsMixin, self).save(**kwargs)
from ..backend.utils import load_scripts
load_scripts()
class Dja... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'CustomRegistrationProfile.admin_activated'
db.delete_co... |
#!/usr/bin/env python
import json
import logging
import os
import signal
import time
from abc import ABCMeta, abstractmethod
from datetime import datetime
from math import ceil
from pathlib import Path
from pprint import pformat
import numpy as np
import pandas as pd
import yaml
from oandacli.util.logger import log_r... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
#!/usr/bin/python
#
# Copyright 2014 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 required b... |
# Copyright 2020 The dm_control Authors.
#
# 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 i... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.conf import settings
USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
USER_MODEL_NAME = USER_MODEL.split('.')[1]
class Migration(SchemaMigration):
def forwa... |
# Copyright (c) 2007-2012 by Enrique Pérez Arnaud <enriquepablo@gmail.com>
#
# This file is part of the terms project.
# https://github.com/enriquepablo/terms
#
# The terms project 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 Adrian Bürger
#
# This file is part of PECas.
#
# PECas 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 3 of the Lice... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.