code stringlengths 1 199k |
|---|
from catcher import models as m
import falcon
import logging
from catcher.models.queries import Queries
from playhouse.shortcuts import model_to_dict
from catcher.api.privileges import Privilege
class Sotg(object):
@staticmethod
def checkValue(value):
if value is None or 0 <= value <= 4:
ret... |
import botocore
from unittest import TestCase
from nose.tools import ok_, eq_
from mock import Mock
from lamvery.clients.events import EventsClient
class EventsClientTestCase(TestCase):
def setUp(self):
self.client = EventsClient(region='us-east-1')
self.client._events = Mock()
def test_get_rule... |
from __future__ import absolute_import, division, print_function, unicode_literals
from nose.tools import eq_
from smarkets.functools import always_return, memoized
def test_memoized():
@memoized
def my_sum(x, y):
counter[0] += 1
return x + y
counter = [0]
eq_(my_sum(1, 2), 3)
eq_(co... |
import _plotly_utils.basevalidators
class ValuessrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="valuessrc", parent_name="sunburst", **kwargs):
super(ValuessrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
"""Manage.py, MC server assistant
Usage:
manage.py sort [--folder=<DIR>]
manage.py report (nms|permissions)
manage.py (-h | --help)
manage.py --version
Options:
--folder=<DIR> Specify an input folder relative to this file
-h --help Show this screen.
--version Show version.
"""
from docopt imp... |
default_app_config = 'spirit.comment.like.apps.SpiritCommentLikeConfig' |
import OpenGL.GL as gl
from numpy import degrees, identity, array
from primitives import Primitives
class Frame(object):
def __init__(self, index=0, T=identity(4), show_frame=True):
self.children = []
self.T = T
self.show_frame = show_frame
self.index = index
def __str__(self):
... |
"""Package for handling OVF and OVA virtual machine description files.
The :class:`OVF` class provides an implementation of the
:class:`COT.vm_description.VMDescription` interface. In general, COT
submodules should be agnostic of the internals of this package and should
only use the ``VMDescription`` interface.
API
---... |
from gevent import monkey; monkey.patch_all()
import os
import sys
import time
import shlex
import shutil
import subprocess
import signal
import socket
import threading
import copy
import psutil
import tornado
import websocket
from decorator import decorator
from funcserver import RPCServer, RPCClient
VWWRAPPER = os.pa... |
import logging
import sys
import threading
from django.core.management.base import BaseCommand
from fastapp.executors.heartbeat import HeartbeatThread, inactivate, update_status, HEARTBEAT_QUEUE
from fastapp.executors.async import AsyncResponseThread
from fastapp.log import LogReceiverThread
from django.conf import set... |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scatter3d.marker.line", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... |
"""
Python library to communicate with an obs-websocket server.
"""
from .core import obsws # noqa: F401 |
"""
This module contains patches for the 'os'-module to make StaSh's thread-system like a process-system (from the view of the script)"""
import os
import threading
from mlpatches import base, os_popen
_stash = base._stash
def getpid(patch):
"""Return the current process id."""
ct = threading.current_thread()
... |
"""
负责指挥调度,流程:
1.Commander开启战役,调用侦查兵侦查网站,判断帖子是否需要发表评论
2.侦察兵若发现目标,则取回目标参数,存入queue
3.参谋从queue中取出目标,分析并给出计划,将作战计划交给commander
4.commander收到计划后,交给soldier执行(进行评论)
"""
from collections import deque
from Scout import Scout
from StaffOfficer import StaffOfficer
from Soilder import Soilder
from HeadQuarters import *
from baidu i... |
'''
Created by auto_sdk on 2014-12-17 17:22:51
'''
from top.api.base import RestApi
class FuwuScoresGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.current_page = None
self.date = None
self.page_size = None
def getapiname(self):
return 'ta... |
for i in range (1,101):
if ((i % 3 == 0) & (i % 5 == 0)):
print ("fizzbuzz")
elif i % 3 == 0 :
print ("fizz")
elif i % 5 == 0:
print ("buzz")
else:
print(i) |
from django.conf.urls import include, url
from django.contrib import admin
import feedback.urls
import kompassi_oauth2.urls
from .views import (
shoottikala_frontpage_view,
shoottikala_event_view,
shoottikala_cosplayer_view,
shoottikala_photographer_view,
shoottikala_send_message_view,
)
admin.autod... |
import time
class Cache(object):
"""docstring for Cache
"""
def __init__(self, cache,
load = None,
allow_stale = True):
self.cache = cache;
self.load = load;
self.allow_stale = allow_stale;
def get(self, key):
value =
def ... |
import tensorflow as tf
import numpy as np
from sklearn.cross_validation import train_test_split
import random
import os.path
def one_hot(y):
retVal = np.zeros((len(y), 10))
retVal[np.arange(len(y)), y.astype(int)] = 1
return retVal
input = np.load('X_train_zca.npy')
input = input.transpose(0,2,3,1)
labels ... |
from datetime import date, datetime, timedelta
from django.utils import timezone
from django.db import models
from django.db.models import Count, Avg, Min, Max
from tracking.settings import TRACK_PAGEVIEWS, TRACK_ANONYMOUS_USERS
from tracking.cache import CacheManager
from .compat import User
def adjusted_date_range(st... |
import urllib.request, urllib.parse, urllib.error
import xml.etree.ElementTree as ET
serviceurl = 'http://maps.googleapis.com/maps/api/geocode/xml?'
while True:
address = input('Enter location: ')
if len(address) < 1 : break
url = serviceurl + urllib.parse.urlencode({'sensor':'false', 'address': address})
... |
from django import forms
from questions.models import Question, Answer
class QuestionForm(forms.ModelForm):
title = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}),
max_length=255)
description = forms.CharField(widget=forms.Textarea(attrs={'class':'form-control'}),
max_len... |
"""
WSGI config for myproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
from django.core.w... |
class USPSXMLError(Exception):
def __init__(self, element):
self.info = {}
for item in element.getchildren():
self.info[item.tag] = item.text
super(USPSXMLError, self).__init__(self.info['Description'])
class XMLTagNameError(Exception):
def __init__(self, tag_name):
e... |
class P(object):
def __init__(self, pkg, requires):
self.requires = requires
self.pkg = pkg
self.Required = 0
def __str__(self):
return self.pkg
def __repr__(self):
return self.__str__()
def Require(self, pkg):
if str(pkg) in self.requires:
... |
def parse_html_color(color):
str=color[1:]
if color[0]=='#':
if len(color[1:])==3:
str= color[1]+color[1]+color[2]+color[2]+color[3]+color[3]
else: str=PRESET_COLORS[color.lower()][1:]
return {'r':int(str[0:2],16),'g':int(str[2:4],16),'b':int(str[4:6],16)} |
import _plotly_utils.basevalidators
class R0Validator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="r0", parent_name="scatterpolar", **kwargs):
super(R0Validator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwa... |
import os
from asset import Asset
class StaticAsset(Asset):
@property
def source(self):
return open(self.pathname,'r+').read()
def to_path(self):
return self.pathname
def write_to(self,filename,**options):
try:
import shutil
if not options.has_key('compress'):
name,ext = os.path.splitext(filename)
... |
import os
import requests
from requests.auth import HTTPBasicAuth
import simplejson
from flask import Flask, render_template
app = Flask(__name__)
app.config.from_object('config')
def get_repos(username):
"""
Given a username, this function returns
all repos associated with that username.
"""
repos ... |
import pytest
from flasgger.base import Swagger
def test_init_config(monkeypatch):
def __init__(self, config=None, merge=False):
self._init_config(config, merge)
monkeypatch.setattr(Swagger, "__init__", __init__)
# # Unspecified config will be initialized to dict()
t = Swagger(config=None, merge... |
from __future__ import print_function, division
import bayesloop as bl
import numpy as np
class TestParameterParsing:
def test_inequality(self):
S = bl.Study()
S.loadData(np.array([1, 2, 3, 4, 5]))
S.setOM(bl.om.Poisson('rate', bl.oint(0, 6, 50)))
S.setTM(bl.tm.Static())
S.fi... |
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils.datetime_safe import datetime
from learn.models import Dictionary, Translation, RythmNotation
from learn.tests.tests_views.tests_int.utilities import create_and_login_a_user
def fake_next_repetition(successes):
return da... |
import logging
from django.http import HttpResponseRedirect, HttpResponseForbidden
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.contrib.auth import login as auth_login, logout as auth_logout
from django.utils.translat... |
from heinzel.tests.utils import Fixture, runtests
from heinzel.core.exceptions import DoesNotExist, SQLSyntaxError
from heinzel.core.sql.dml import Q
from heinzel.core.connection import db
from heinzel.core import utils
from heinzel.tests.model_examples import Car, Brand, Manufacturer, Driver, Key
from heinzel.core imp... |
import numpy as np
import matplotlib.pyplot as plt
import glob
import re
import sqlite3
import helper
import addline
def plotStrongScaling(allsize=1000000,allgraphtype='SOFTWARE',alladditionalwhere=' AND total_time>0 ',suffix='',title=''):
fig = plt.figure()
ax = fig.add_subplot(111)
addline.addStrongScaling(axis=ax... |
class Consts:
"""a plain object to store some stuff"""
pass
time_format = "%Y-%m-%d %H:%M:%S"
api_root = "https://api.scryfall.com"
search_endpoint = "/cards/search"
sets_endpoint = "/sets"
cards_fname = "cards.json"
sets_fname = "sets.json"
used_sets_fname = "used_sets.json"
new_sets_fname = "new_sets.txt"
ima... |
__author__ = 'Debanjan Mahata'
import time
from twython import Twython, TwythonError
from pymongo import MongoClient
import TwitterAuthentication as t_auth
def collect_tweets(path_name):
try:
#connecting to MongoDB database
mongoObj = MongoClient()
#setting the MongoDB database
db = ... |
import torch
import torch.nn as nn
import torch.nn.functional as func
from utils import preprocess # ../utils/preprocess.py
class FullyConnected(nn.Module):
def __init__(self, num_features, hidden_size, dropout):
super(FullyConnected, self).__init__()
self.flatten = preprocess.Flatten()
sel... |
"""
It is possible to communicate with devices via I2C.
.. code:: python
#create i2c device on i2c address 0x77
i2c = I2C(0x77)
i2c.write_raw8(123)
"""
class II2CDeviceDriver(object):
"""
"""
@property
def value_type(self):
return "number"
def reverse_byte_order(self, data):
... |
import operator
import math
"""
numpy and pandas inspired array object with python native numeric types
"""
def is_array(x):
return hasattr(x,'__getitem__')
def fun1(f,x):
return array([f(xi) for xi in x]) if is_array(x) else f(x)
class pipe1:
def __init__(self,f):
self.f=f
def __call__(self,x):
f=self.f
retu... |
import hashlib
import os
from django.contrib import admin, messages
from app.models import ConsultationPlatform, Initiative, Campaign, SocialNetworkApp, Idea, Comment, Vote, \
SocialNetworkAppCommunity, SocialNetworkAppUser, ParticipaUser
from app.tasks import test_function
from app.error import ... |
import smtplib
from email.mime.text import MIMEText
from email.header import Header
sender = 'thydeyx@163.com'
receivers = '553865290@qq.com' # 接收邮件,可设置为你的QQ邮箱或者其他邮箱
mail_host="smtp.163.com"
message = MIMEText('Python 邮件发送测试...', 'plain', 'utf-8')
message['From'] = Header("菜鸟教程", 'utf-8')
message['To'] = Header("测试",... |
from pyvisdk.base.managed_object_types import ManagedObjectTypes
from pyvisdk.base.base_entity import BaseEntity
import logging
log = logging.getLogger(__name__)
class HostDatastoreBrowser(BaseEntity):
'''The DatastoreBrowser managed object type provides access to the contents of one
or more datastores. The ite... |
import sys, os, logging, types, random, string
ANDROGUARD_VERSION = "1.7"
def get_ascii_string(s) :
try :
return s.decode("ascii")
except UnicodeDecodeError :
d = ""
for i in s :
if ord(i) < 128 :
d += i
else :
d += "%x" % ord(i)
... |
import sys, os, cmd
from collections import namedtuple
PowerballTicket = namedtuple("PowerballTicket",
["ticket_number", "white_balls", "powerball"])
class PowerballChecker(cmd.Cmd):
intro_lines = []
intro_lines.append("💸💸💸 Welcome to the Powerball Checker! 💸💸💸")
intro_lines.append("⚪ ️⚪ ️⚪ ️⚪ ️⚪ ... |
import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="namelengthsrc", parent_name="box.hoverlabel", **kwargs
):
super(NamelengthsrcValidator, self).__init__(
plotly_name=plotly_name,
p... |
import collections
import threading
import socket
import json
from helpers.logger import log_debug, log_exception
"""
a simple client to talk to ovsdb over json rpc
"""
class OVSDBConnection(threading.Thread):
"""Connects to an ovsdb server that has manager set using
ovs-vsctl set-manager ptcp:6632
... |
from numpy import *
from string import *
def smooth(x,window_len=5111,window='hanning'):
"""smooth the data using a window with requested size.
This method is based on the convolution of a scaled window with the signal.
The signal is prepared by introducing reflected copies of the signal
(with the windo... |
from typing import Pattern, Match, Union, List
import regex
class RegExpUtility:
@staticmethod
def get_safe_reg_exp(source: str, flags: int = regex.I | regex.S) -> Pattern:
return regex.compile(source, flags=flags)
@staticmethod
def get_group(match: Match, group: str, default_val: str = '') -> s... |
from __future__ import absolute_import
from theano import dot
import theano.tensor as T
class Regularizer(object):
def set_param(self, p):
self.p = p
def set_layer(self, layer):
self.layer = layer
def __call__(self, loss):
return loss
def get_config(self):
return {"name":... |
from fastapi import FastAPI, Security
from fastapi.security.http import HTTPAuthorizationCredentials, HTTPBase
from fastapi.testclient import TestClient
app = FastAPI()
security = HTTPBase(scheme="Other")
@app.get("/users/me")
def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)):
re... |
"""The Logistic distribution."""
from equadratures.distributions.template import Distribution
from equadratures.distributions.recurrence_utils import jacobi_recurrence_coefficients
import numpy as np
from scipy.stats import logistic
RECURRENCE_PDF_SAMPLES = 50000
class Logistic(Distribution):
"""
The class defi... |
from __future__ import unicode_literals, print_function
import redis
from rq import Connection, Queue, Worker
from rq.logutils import setup_loghandlers
from frappe.utils import cstr
from collections import defaultdict
import frappe
import os, socket, time
from frappe import _
from six import string_types
import pymysql... |
class Application(object):
def __init__(self, window, scroll):
self.window = window
self.scroll = scroll
class AbstractFactory(object):
"""
Should be one instance
"""
instance = None
def __new__(cls, *args, **kwargs):
if not isinstance(cls.instance, cls):
cls.... |
from collections import OrderedDict
def meminfo():
''' Return the information in /proc/meminfo
as a dictionary '''
meminfo = OrderedDict()
with open('/proc/meminfo') as f:
for line in f:
meminfo[line.split(':')[0]] = line.split(':')[1].strip()
return meminfo
if __name__ == '__mai... |
from scrapy_fieldstats.fieldstats import FieldStatsExtension
def extract_fake_items_and_compute_stats(fake_items, show_counts=False, skip_none=True):
ext = FieldStatsExtension(skip_none=skip_none)
for item in fake_items:
ext.compute_item(item)
if show_counts:
return ext.field_counts
retu... |
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ContributorEmailV3... |
import CommandParser
import unittest
class TestCommandParser(unittest.TestCase):
def setUp(self):
self.parser = CommandParser.CommandParser()
# test default values
def test_defaults(self):
args = self.parser.get_arguments(
'aws-sudo test-profile test-command'.split()[1:]
... |
import platform
import re
import sys
from distutils.version import LooseVersion
from nose.tools import eq_
from flake8_strict import _process_code
def _test_processing(test_data_path):
with open(test_data_path, 'rt') as f:
code = f.read()
code = code.strip()
expected_errors = set()
for lineno, l... |
import dataclasses
from indico.core import signals
from indico.util.decorators import classproperty
from indico.util.enum import IndicoEnum
from indico.util.signals import values_from_signal
def get_search_provider(only_active=True):
"""Get the search provider to use for a search.
:param only_active: Whether to... |
import sys
import string
import math
def normalize(matrix):
nrow = len(matrix)
ncol = len(matrix[0])
pssm = [[0.0 for col in xrange(ncol)] for row in xrange(nrow)]
for c in xrange(ncol):
colsum = 0.0
for r in xrange(nrow):
colsum += float(matrix[r][c])
for r in xrange... |
from __future__ import with_statement
import os.path, sys
sys.path += [
os.path.dirname(__file__),
os.path.join(os.path.dirname(__file__), 'third_party.zip'),
]
import re
import inspect
import wingapi
import shared
pattern = re.compile(
r'''.*?(?P<square_brackets>\[(?P<key>.*?)\])$'''
)
def dict_direct_to_g... |
"""
==============================
Test for qplotutils.chart.view
==============================
Autogenerated package stub.
"""
import unittest
import logging
import sys
import os
import numpy as np
from qtpy.QtCore import *
from qtpy.QtGui import *
from qtpy.QtOpenGL import *
from qtpy.QtWidgets import *
from qplotut... |
def compute_vp(Vout):
Vcc = 5
Rvcc = 150
Rgnd = 180
Rf = 750
Rf_par_Rgnd = 1/((1/float(Rf))+(1/float(Rgnd)))
Rvcc_par_Rgnd = 1/((1/float(Rvcc))+(1/float(Rgnd)))
vp_vcc = (Rf_par_Rgnd / (Rf_par_Rgnd + Rvcc)) * Vcc
vp_vout = (Rvcc_par_Rgnd / (Rvcc_par_Rgnd + Rf)) * Vout
#comparator vp superposition from... |
from . import class_
class Mage(class_.Class):
def __init__(self, mage_type):
class_.Class.__init__(self)
self.defs['will'] = 2
self.spec = 'mage_%s' % mage_type |
print("Hello World :)") |
"""Contains the Light class."""
import asyncio
from functools import partial
from typing import Set, Dict, List, Tuple, Any
from mpf.core.delays import DelayManager
from mpf.core.platform import LightsPlatform, LightConfig, LightConfigColors
from mpf.core.device_monitor import DeviceMonitor
from mpf.core.machine import... |
from tests import settings
from .resources import (Transfer, TransferRefund,
PayInRefund, DirectPayIn, Refund,
Wallet)
from .test_base import BaseTest
from mangopay.utils import Money
from datetime import date
import responses
import time
class RefundsTest(BaseTest):
... |
"""Trains, evaluates and saves the KittiSeg model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import sys
import collections
import numpy as np
import tensorflow as tf
flags = tf.app.flags
FLAGS = flags.FLAGS
sys.pa... |
import _plotly_utils.basevalidators
class TickcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="tickcolor", parent_name="layout.slider", **kwargs):
super(TickcolorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
import tempfile
db_file = tempfile.NamedTemporaryFile()
class Config(object):
SECRET_KEY = 'REPLACE ME'
class ProdConfig(Config):
ENV = 'prod'
SQLALCHEMY_DATABASE_URI = 'sqlite:///../database.db'
CACHE_TYPE = 'simple'
MAIL_SERVER = "email-smtp.us-east-1.amazonaws.com"
MAIL_PORT = 587
MAIL_US... |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['testserver', 'localhost', '127.0.0.1', '::1']
SECRET_KEY = 'fake_secret'
ROOT_URLCONF = 'tests.test_urls'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
MIDDLEWARE_CLASSES = []
INSTALLED_APPS = (
... |
DOCUMENTATION = '''
---
module: azure_deploy
short_description: Create or destroy Azure deployments via Azure Resource Manager API
version_added: "2.0"
description:
- Create or destroy Azure deployments via Azure Resource Manager API using requests and Python SDK for Azure
options:
subscription_id:
descripti... |
from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.core.validators import validate_email
from django.utils.translation import ugett... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^chant/', include('chant.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('common.urls')),
url(r'social/', include('social.apps.django_app.urls'... |
"""Subclrschm.""" |
""" This is the controller of the /rewards endpoint
The following functions are called from here: GET, POST.
"""
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy import exists
from databasesetup import create_session, Employee
from models.employee_reward_api_model import EmployeeRewardApiModel
from models.emp... |
import Tkinter as Tk
import ttk
import os
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import GUI.NPS_root as rt
class NPS_Plotter(object):
'''
Creates stand-alone graph widget with numerous controls
'''
def __init__(self, ... |
wolfram_templates = {
"fail": [u"Sorry, I don't know the answer to that one.",
u"Tricky question. I'm not sure.",
u"I don't know. You can try rephrasing your question?",
u"I don't know that one, but feel free to try and rephrase.",
u"Your questions are too hard.",... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('movies', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='rating',
name='raw_time',
field=models.... |
"""
Base of the configuration parsing plugins. Each of these will need to provide a method that will be executed with a
copy of the configuration global object from core.json.
"""
_plugins = []
def register_configuration_plugin(_callable):
"""
Register a callable that will be used to configure a sub component ... |
from abc import ABCMeta
__author__ = 'Luqman'
"""
Author: Luqman A. M.
PixelCleaningAbstract.py
Abstract class for pixel cleaning algorithms
"""
class PixelCleaningAbstract(object):
__metaclass__ = ABCMeta
algorithm_name = ""
def __init__(self, name):
self.algorithm_name = name
pass |
from msrest.serialization import Model
class EffectiveNetworkSecurityGroupListResult(Model):
"""Response for list effective network security groups API service call.
Variables are only populated by the server, and will be ignored when
sending a request.
:param value: A list of effective network security... |
'''
Test script for security-check.py
'''
import os
import subprocess
import unittest
from utils import determine_wellknown_cmd
def write_testcode(filename):
with open(filename, 'w', encoding="utf8") as f:
f.write('''
#include <stdio.h>
int main()
{
printf("the quick brown fox jumps over... |
'''
This module provides a newsuper() function in Python 2 that mimics the
behaviour of super() in Python 3. It is designed to be used as follows:
from __future__ import division, absolute_import, print_function
from future.builtins import super
And then, for example:
class VerboseList(list):
def ap... |
import os
import string
from django.conf import settings
from django.template.loader import render_to_string
from file_system import File
from datetime import datetime
from hydeengine.templatetags.hydetags import xmldatetime
import commands
class FolderFlattener:
@staticmethod
def process(folder, params):
... |
import os
import logging
import urllib.request
import concurrent.futures
import hashlib
import io
from urllib.error import HTTPError
from PIL import Image
from slackclient import SlackClient
ICON_SIZE = 192
def get_image_urls(token):
client = SlackClient(token)
users = client.api_call("users.list")
urls = [... |
import bb.data_smart
import oe.types
class Data(bb.data_smart.DataSmart):
def __init__(self, parent):
if parent:
super(Data, self).__init__(seen=parent._seen_overrides.copy(),
special=parent._special_values.copy())
self.dict["_data"] = parent.di... |
try:
from setuptools import setup, find_packages
from setuptools.command.test import test
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.command.test import test
import os
here = os.path.dirname(os.path.abspath... |
from setuptools import setup
from corrida import __version__ as version
source = 'http://pypi.python.org/packages/source'
install_requires = ['numpy', 'pandas']
classifiers = """\
Development Status :: 5 - Production/Stable
Environment :: Console
Intended Audience :: Science/Research
Intended Audience :: Developers
Int... |
from distutils.core import setup
from setuptools import find_packages
DESCRIPTION = "A Django application to send email using django's templating system"
LONG_DESCRIPTION = None
try:
LONG_DESCRIPTION = open('README.rst').read()
except:
pass
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Aud... |
"""
Django settings for jass project.
Generated by 'django-admin startproject' using Django 1.8.4.
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/
"""
import os
PROJECT_P... |
import datetime
from django import template
from apps.reader.models import UserSubscription
from utils.user_functions import get_user
from apps.rss_feeds.models import MFeedIcon
register = template.Library()
@register.inclusion_tag('recommendations/render_recommended_feed.xhtml', takes_context=True)
def render_recommen... |
from django.contrib.auth.models import User
from django.forms import ModelForm, forms
from twitter_app.models import Profile
class UserDetailsForm(ModelForm):
class Meta:
model = User
fields = ['username', 'first_name', 'last_name', 'email']
class ProfileForm(ModelForm):
class Meta:
mode... |
import unittest
import datetime
from cwr.parser.decoder.dictionary import RecordingDetailDictionaryDecoder
"""
Dictionary to Message decoding tests.
The following cases are tested:
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
class TestRecordingDetailDictionaryDecoder(unit... |
from django.shortcuts import render, HttpResponseRedirect, reverse, HttpResponse
from django.contrib.auth import authenticate, login, logout
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.hashers import make_password
from django.contrib.auth.backends import ModelBackend
from users.models... |
from typing import Optional, IO, Any
import os
import sys
RED = 31
GREEN = 32
BOLD = 1
RESET_ALL = 0
def style(
text: str, fg: Optional[int] = None, *, bold: bool = False, file: IO = sys.stdout
) -> str:
use_color = not os.environ.get("NO_COLOR") and file.isatty()
if use_color:
parts = [
... |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pip... |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline i... |
"""List current environment variables and values.
"""
from __future__ import division, print_function, unicode_literals
import argparse
import os
import sys
def main(args):
p = argparse.ArgumentParser(description=__doc__)
p.add_argument("variables", action="store", nargs="*", help="variables to be printed")
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.