code stringlengths 1 199k |
|---|
"""pytest_needle.driver
.. codeauthor:: John Lane <jlane@fanthreesixty.com>
"""
import base64
from errno import EEXIST
import math
import os
import re
import sys
import pytest
from needle.cases import import_from_string
from needle.engines.pil_engine import ImageDiff
from PIL import Image, ImageDraw, ImageColor
from se... |
"""Facebook OAuth interface."""
import json
import logging
try:
from urllib import quote_plus
except ImportError:
from urllib.parse import quote_plus
import oauth2 as oauth
from django.conf import settings
from .base_auth import Base3rdPartyAuth
logger = logging.getLogger(__name__)
FACEBOOK_REQUEST_TOKEN_URL = ... |
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class ShortCodeTestCase(IntegrationTestCase):
... |
class GeneticEngine:
genomLength = 10
generationCount = 10
individualCount = 10
selectionType = 10
crossingType = 10
useMutation = 1
mutationPercent = 50
"""constructor"""
def __init__(self, fitnessFunction):
return 0
"""main body"""
def run():
return 0
de... |
import argparse
import logging
from typing import List, Optional
from redis import StrictRedis
from minique.compat import sentry_sdk
from minique.work.worker import Worker
def get_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser()
parser.add_argument("-u", "--redis-url", required=True)
... |
"""
Contains basic interface (abstract base class) for word embeddings.
"""
import os
from abc import ABCMeta, abstractmethod
class IWordEmbedding(object):
"""
Abstract base class for word embeddings
"""
__metaclass__ = ABCMeta
def __init__(self, path, vector_length):
self.model = None
... |
"""
Views for PubSite app.
"""
from django.conf import settings
from django.contrib.auth.views import (
PasswordResetView,
PasswordResetDoneView,
PasswordResetConfirmView,
PasswordResetCompleteView,
)
from django.shortcuts import render
import requests
import logging
logger = logging.getLogger(__name__)... |
import os
import re
from amlib import conf, utils, log
'''
Functions for parsing AD automount maps into a common dict format.
Part of ampush. https://github.com/sfu-rcg/ampush
Copyright (C) 2016 Research Computing Group, Simon Fraser University.
'''
def get_names():
'''
Return a list of files in ${conf/flat_file_ma... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.forms.widgets
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),... |
from operator import mul
def multiply(n, l):
return map(lambda a: mul(a, n), l) |
import itertools
import logging
import pygame
width = 128
height = 32
log = logging.getLogger("pin.dmd")
class DMD(object):
def __init__(self):
self.renderer = None
self.previous_renderer = None
self.frame = pygame.Surface((width, height))
self.previous_frame = pygame.Surface((width,... |
f = open('data.txt', 'w')
size = f.write('Hello\n')
f.write('World\n')
f.close()
f = open('data.txt')
text = f.read()
print(text)
f.close() |
r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix', 'nt', 'os2' or 'ce'.
- os.curdir is a string representing the current directory ('.' or ... |
from mabozen.lib.url import parse_rfc1738_args
def parse_url(db_url):
"""parse url"""
components = parse_rfc1738_args(db_url)
return components |
"""Unit tests for PyGraphviz interface."""
import os
import tempfile
import pytest
import pytest
pygraphviz = pytest.importorskip('pygraphviz')
from networkx.testing import assert_edges_equal, assert_nodes_equal, \
assert_graphs_equal
import networkx as nx
class TestAGraph(object):
def build_graph(self, G):... |
print("hola me llamo juan")
a = 'ofi'
b = 'chilea'
c = 'Mmm'
d = 'me da igual'
bandera = True
carac = input()
if carac.endswith('?'):
print(a)
elif carac.isupper():
print (b)
elif carac.isalnum():
print(d)
else:
print(c) |
import pygame
import os
from buffalo import utils
from item import Item
class TradingUI:
BUTTON_SIZE = 32
PADDING = 6
def __init__(self, inventory, tradeSet):
self.tradeSet = tradeSet
self.inventory = inventory
self.surface = utils.empty_surface((228,500))
self.surface.fill((100,100,100,100))
self.pos = (u... |
"""Robobonobo setup script.
Usage:
./get_ready.py [options]
Options:
-h, --help Show this help screen
--version Show the version.
"""
from docopt import docopt
from glob import glob
import os
GPIOS = [30, 31, 112, 113, 65, 27]
GPIO_BASE = "/sys/class/gpio"
SLOTS_GLOB = "/sys/devices/bone_capemgr.?/... |
import PySeis as ps
import numpy as np
import pylab
input = ps.io.su.SU("./data/sample.su")
input.read("./data/raw.npy") |
"""Parse GCC-XML output files and produce a list of class names."""
import multiprocessing
import xml.dom.minidom
import sys
import os
import mpipe
import util
NAME = os.path.basename(sys.argv[0])
ARGS = [('out_file', 'output file'),
('xml_dir', 'directory with XML files'),]
ARGS = util.parse_cmd(NAME, ARGS)
fn... |
from __future__ import print_function, division
import numpy as np
import pytest
import sys
import chronostar.likelihood
sys.path.insert(0,'..')
from chronostar import expectmax as em
from chronostar.synthdata import SynthData
from chronostar.component import SphereComponent
from chronostar import tabletool
from chrono... |
def python_evaluate(text):
return eval(str(text))
def python_print(*values, sep=' '):
joined = sep.join((str(v) for v in values))
print(joined)
def python_list(*args):
return args
def error(text=''):
raise RuntimeError(text) |
'''
utils.py: part of som package
Copyright (c) 2017 Vanessa Sochat
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... |
import argparse
from board_manager import BoardManager
from constants import *
def main():
parser = argparse.ArgumentParser(description='Board client settings')
parser.add_argument('-sp', '--PORT', help='server port', type=int,
default=80, required=False)
parser.add_argument('-sip', ... |
"""
@brief test log(time=8s)
@author Xavier Dupre
"""
import sys
import os
import unittest
import shutil
from contextlib import redirect_stdout
from io import StringIO
from pyquickhelper.pycode import ExtTestCase
from pyquickhelper.pycode import process_standard_options_for_setup_help, get_temp_folder
from pyq... |
import datetime
from typing import Any, Dict, List, Optional, Union
from azure.core.exceptions import HttpResponseError
import msrest.serialization
from ._iot_hub_client_enums import *
class ArmIdentity(msrest.serialization.Model):
"""ArmIdentity.
Variables are only populated by the server, and will be ignored ... |
with open('textin.txt', 'r') as f1, open('textout.txt', 'w') as f2:
lines = f1.readlines()
# keep track of all binary tags (i.e. closeable tag)
closeables = set()
for line in lines:
if line.startswith('[/'): # closing tag
tag = line[2:].split(']')[0] #
closeables.add(tag) # add to set
# each l... |
from django.conf.urls import patterns
urlpatterns = patterns('staticblog.views',
(r'^$', 'archive'),
(r'^([\-\w]+)$', 'render_post'),
(r'^git/receive', 'handle_hook'),
) |
"""
Copyright (c) 2014 l8orre
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, merge, publish, distribute, sublice... |
"""tictactoe URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... |
from flask import request, abort, jsonify, render_template
from flask.ext.sqlalchemy import BaseQuery
import math
class PaginatedQuery(object):
def __init__(self, query_or_model, paginate_by, page_var='page',
check_bounds=False):
self.paginate_by = paginate_by
self.page_var = page_v... |
from __future__ import print_function
import logging
import os
import re
import socket
import sys
import time
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import ... |
import pygame, sys
from pygame.locals import *
import re
import json
import imp
import copy
chessboard1 = json.load(open("./common/initial_state.json"))
chessboard2 = json.load(open("./common/initial_state.json"))
chessboard3 = json.load(open("./common/initial_state.json"))
chessboards = [chessboard1, chessboard2, ch... |
import chess
chess.run() |
"""Auto-generated file, do not edit by hand. PG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_PG = PhoneMetadata(id='PG', country_code=675, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{6,7}', possible_length=(7, 8)),
... |
from ethereum.utils import sha3, encode_hex, denoms
from raiden.utils import privatekey_to_address
from raiden.tests.utils.blockchain import GENESIS_STUB
CLUSTER_NAME = 'raiden'
def generate_accounts(seeds):
"""Create private keys and addresses for all seeds.
"""
return {
seed: dict(
pri... |
import pyintersim.corelib as corelib
import ctypes
_core = corelib.LoadCoreLibrary()
class State:
"""Wrapper Class for the State"""
def __init__(self):
self.p_state = setup()
def __enter__(self):
return self.p_state
def __exit__(self, exc_type, exc_value, traceback):
delete(self.... |
import importlib
def import_string(import_name: str):
"""
Import an object based on the import string.
Separate module name from the object name with ":". For example,
"linuguee_api.downloaders:HTTPXDownloader"
"""
if ":" not in import_name:
raise RuntimeError(
f'{import_name... |
import numpy as np
import pandas as pd
import pickle
def lookupGenEd(cNum, college):
fileName = "data/Dietrich Gen Eds.csv"
picklepath = "data\\dietrich_gen_eds.p"
try:
with open(picklepath,'rb') as file:
gen_eds = pickle.load(file)
except:
df = pd.read_csv(fileName,names=['D... |
import numpy as np, time, itertools
from collections import OrderedDict
from .misc_utils import *
from . import distributions
concat = np.concatenate
import theano.tensor as T, theano
from importlib import import_module
import scipy.optimize
from .keras_theano_setup import floatX, FNOPTS
from keras.layers.core import L... |
import os, argparse
from Workspace import Workspace
class Pygling:
@staticmethod
def main():
name = os.path.basename( os.getcwd() )
# Parse arguments
parser = argparse.ArgumentParser( prog = 'Pygling', description = 'Pygling C++ workspace generator.', prefix_chars = '--', formatter_class = argparse.ArgumentDefa... |
from captcha.fields import CaptchaField
from django import forms
from django.contrib.auth.models import User
from django.http import HttpResponse
try:
from django.template import engines
__is_18 = True
except ImportError:
from django.template import loader
__is_18 = False
TEST_TEMPLATE = r"""
<!DOCTYPE ... |
from __future__ import unicode_literals
import os
from mopidy import ext, config
__version__ = '1.0.1'
__url__ = 'https://github.com/dz0ny/mopidy-api-explorer'
class APIExplorerExtension(ext.Extension):
dist_name = 'Mopidy-API-Explorer'
ext_name = 'api_explorer'
version = __version__
def get_default_con... |
import twe_lite
import json
import queue
import sys
import time
import traceback
import yaml
from threading import Thread
from datetime import datetime
from pytz import timezone
from iothub_client import IoTHubClient, IoTHubClientError, IoTHubTransportProvider, IoTHubClientResult, IoTHubClientStatus
from iothub_client ... |
import ctypes
import time
HELD = set()
SendInput = ctypes.windll.user32.SendInput
mouse_button_down_mapping = {
'left': 0x0002,
'middle': 0x0020,
'right': 0x0008
}
mouse_button_up_mapping = {
'left': 0x0004,
'middle': 0x0040,
'right': 0x0010
}
CODES = {
'esc': 0x01,
'escape': 0x01,
'... |
"""
Standard implementations of Twisted protocol-related interfaces.
Start here if you are looking to write a new protocol implementation for
Twisted. The Protocol class contains some introductory material.
"""
from zope.interface import implementer
from . import internet_interfaces as interfaces
@implementer(interfac... |
from __future__ import absolute_import, division, print_function, unicode_literals
import django
import patchy
from django.db.models.deletion import get_candidate_relations_to_delete
from django.db.models.query import QuerySet
from django.db.models.query_utils import Q
from django.db.models.sql.query import Query
def p... |
import time
from aquests.athreads import socket_map
from aquests.athreads import trigger
from rs4.cbutil import tuple_cb
from aquests.client.asynconnect import AsynSSLConnect, AsynConnect
from aquests.dbapi.dbconnect import DBConnect
import threading
from aquests.protocols.http import request as http_request
from aques... |
"""Alternate versions of the splitting functions for testing."""
from __future__ import unicode_literals
import unicodedata
from natsort.compat.py23 import PY_VERSION
if PY_VERSION >= 3.0:
long = int
def int_splitter(x, signed, safe, sep):
"""Alternate (slow) method to split a string into numbers."""
if not... |
import os
import sys
from .types import BackupCollection, Backup
def run(config):
backups = get_backup_collection(config.backup_dir)
days = backups.days()
if not days:
return 0
days_to_keep = get_days_to_keep(days, config)
if days_to_keep or config.force:
backups_to_remove = backups.... |
import sys
import multiprocessing
import os.path as osp
import gym
from collections import defaultdict
import tensorflow as tf
import numpy as np
from baselines.common.vec_env.vec_video_recorder import VecVideoRecorder
from baselines.common.vec_env.vec_frame_stack import VecFrameStack
from baselines.common.cmd_util imp... |
class amicable():
def d(self, n):
if n == 1:
return 0
else:
sum_of_factors = 0
for i in range(1, int(n**0.5)+1):
if n % i == 0:
sum_of_factors += i
if n/i != n:
sum_of_factors += int(n... |
"""
Django settings for ember_demo project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import os
from os.path import join
try:
from S3 import CallingFormat
... |
import sys, struct, array
import SocketServer
p = 0x08d682598db70a889ff1bc7e3e00d602e9fe9e812162d4e3d06954b2ff554a4a21d5f0aab3eae5c49ac1aec7117709cba1b88b79ae9805d28ddb99be07ba05ea219654afe0c8dddac7e73165f3dcd851a3c8a3b6515766321420aff177eaaa7b3da39682d7e773aa863a729706d52e83a1d0e34d69b461c837ed239745d6c50f124e34f4d1d0... |
"""
This module contains the :class:`.DataType` class and its subclasses. These
types define how data should be converted during the creation of a
:class:`.Table`.
A :class:`TypeTester` class is also included which be used to infer data
types from column data.
"""
from copy import copy
from agate.data_types.base import... |
from django.test import TestCase
from seedsdb.models import (
Plant, Tag, Harvest, Activity
)
class TestPlant(TestCase):
def tearDown(self):
Plant.objects.all().delete()
def make_test_plant(self, aliases=None):
if aliases:
aliases = "|".join(aliases)
else:
ali... |
KELVIN_OFFSET = 273.15
FAHRENHEIT_OFFSET = 32.0
FAHRENHEIT_DEGREE_SCALE = 1.8
MILES_PER_HOUR_FOR_ONE_METER_PER_SEC = 2.23694
KM_PER_HOUR_FOR_ONE_METER_PER_SEC = 3.6
KNOTS_FOR_ONE_METER_PER_SEC = 1.94384
HPA_FOR_ONE_INHG = 33.8639
MILE_FOR_ONE_METER = 0.000621371
KMS_FOR_ONE_METER = .001
ROUNDED_TO = 2
def kelvin_dict_t... |
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.contrib.taggit
import modelcluster.fields
import wagtail.contrib.routable_page.models
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.embeds.blocks
i... |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_PSD(object):
def setupUi(self, PSD):
PSD.setObjectName("PSD")
PSD.resize(1000, 561)
self.verticalLayout = QtWidgets.QVBoxLayout(PSD)
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
self.verticalLayout.setObjectName("verti... |
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
# TODO: put package requirements here
]
setup_requirements = [
# TODO(nbargnesi... |
from dataworkflow.data import get_data
import pandas as pd
def test_data():
data = get_data()
assert all(data.columns == ['Survived', 'Pclass', 'Sex', 'Age', 'SibSp', 'Parch', 'Fare',
'Embarked', 'FamilyTot', 'FamStatus', 'age_group'])
assert all([len(data[col]) == 891
for col in ['Su... |
import time
from random import choices
symbols = list('abcdefghijklmn')
print(symbols)
symbols_big = choices(symbols, k=2000000)
start = time.time()
ord_list1 = []
for sym in symbols_big:
ord_list1.append(ord(sym))
end = time.time()
print('for loop ran in %f s' % (end - start))
start = time.time()
ord_list2 = [ord(... |
// Copyright (c) 2015 Solarminx
from test_framework import SolariTestFramework
from solarirpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from binascii import a2b_hex, b2a_hex
from hashlib import sha256
from struct import pack
def check_array_result(object_array, to_match, expected):
"""
... |
cars = ["bmw", "rollsroyce", "audi", "ferrari"]
print(cars)
cars = ["bmw", "koenigsegg", "audi", "ferrari"]
print(cars) |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from flexget.utils import json
class TestUserAPI(object):
config = 'tasks: {}'
def test_change_password(self, execute_task, api_client):
weak_password = {'passwor... |
#-*- coding: UTF-8 -*-
from django.db.models import F
from celery.task import *
from datetime import timedelta, datetime
from app.models import CustomUser
from django.utils.translation import activate,deactivate
"""
Note: the api of twitter retards 1 minute (more or less) the update of the update_date
"""
@task
def fo... |
from flask_restful import Resource, Api
from flask_restful_swagger import swagger
from flauthority import app
from flauthority import api, app, celery, auth
from ModelClasses import AnsibleCommandModel, AnsiblePlaybookModel, AnsibleExtraArgsModel
import celery_runner
class TaskStatus(Resource):
@swagger.operation(
... |
"""
WSGI config for roastdog 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/dev/howto/deployment/wsgi/
"""
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
import os
os.environ.... |
from ._logs_query_client_async import LogsQueryClient
from ._metrics_query_client_async import MetricsQueryClient
__all__ = ["LogsQueryClient", "MetricsQueryClient"] |
import sublime, sublime_plugin, tempfile, os, re;
global g_current_file;
global g_last_view;
g_current_file = None;
g_last_view = None;
# get language name
# check if .sublime-build exists for language name
# if it doesn't, somehow get the file extension
# check for .sublime-build using file extension
# wouldn't ... |
"""
Demonstrate how to use major and minor tickers.
The two relevant userland classes are Locators and Formatters.
Locators determine where the ticks are and formatters control the
formatting of ticks.
Minor ticks are off by default (NullLocator and NullFormatter). You
can turn minor ticks on w/o labels by setting the... |
from unittest import TestCase
import trafaret as t
from trafaret_validator import TrafaretValidator
class ValidatorForTest(TrafaretValidator):
t_value = t.Int()
value = 5
class ValidatorForTest2(ValidatorForTest):
test = t.String()
class TestMetaclass(TestCase):
def test_metaclass(self):
self.as... |
try:
import collections.abc as collections
except ImportError:
import collections
import datetime
import logging
try:
import json
except ImportError:
import simplejson as json
import re
def get_log():
return logging.getLogger(__name__.split('.')[0])
class MarathonJsonEncoder(json.JSONEncoder):
"... |
from decimal import Decimal
from django.core.management.base import BaseCommand
from openpyxl import load_workbook
from contracts.models import PriceName, PriceCoast
from directory.models import Researches
class Command(BaseCommand):
def add_arguments(self, parser):
"""
:param path - файл с картами ... |
class O(object): pass
class A(O): pass
class B(O): pass
class C(O): pass
class D(O): pass
class E(O): pass
class K1(A,B,C): pass
class K2(D,B,E): pass
class K3(D,A): pass
class Z(K1,K2,K3): pass
print K1.__mro__
print K2.__mro__
print K3.__mro__
print Z.__mro__ |
class FakeFetcher(object):
"""
Used i.e. in Harvest tracker when we need credentials but don't fetcher
"""
def __init__(self, *args, **kwargs):
pass
def fetch_user_tickets(self, *args, **kwargs):
pass
def fetch_all_tickets(self, *args, **kwargs):
pass
def fetch_bugs_f... |
import os
import json
import pandas
import numpy
from IPython.display import HTML
from datetime import datetime
import pandas_highcharts.core
title_name = 'Tasks'
file_name = 'tasks.csv'
css_dt_name = '//cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css'
js_dt_name = '//cdn.datatables.net/1.10.12/js/jquery.dataT... |
class UnknownAccess(Exception):
"""
Access doesn't exist for this user.
"""
pass |
import os
import sys
dir = os.path.split(os.path.split(os.path.split(os.path.realpath(__file__))[0])[0])[0]
sys.path.append(os.path.join(dir, 'scripts'))
import mock
import unittest
from mock import patch
import setup.load as Config
import setup.database as DB
TEST_DATA = 'test_flood_portal_output.json'
class CheckConf... |
"""
This script uses py2exe to create inversion\dist\direfl.exe for Windows.
The resulting executable bundles the DiRefl application, the python runtime
environment, and other required python packages into a single file. Additional
resource files that are needed when DiRefl is run are placed in the dist
directory tree... |
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify, unhexlify
from decimal import Decimal, ROUND_DOWN
import hashlib
import json
import logging
import os
import random
import re
from subprocess import CalledProcessError
import time
from . import coverage
from .authp... |
import sys
from aimes.emgr.utils import *
__author__ = "Matteo Turilli"
__copyright__ = "Copyright 2015, The AIMES Project"
__license__ = "MIT"
def write_skeleton_conf(cfg, scale, cores, uniformity, fout):
'''Write a skeleton configuration file with the set number/type/duration of
tasks and stages.
'''
... |
from yos.rt import BaseTasklet
from yos.ipc import Catalog
class CatalogExample(BaseTasklet):
def on_startup(self):
Catalog.store('test1', 'test2', catname='test3')
Catalog.get('test1', self.on_read, catname='test3')
def on_read(self, val):
if val == 'test2':
print("Test pass... |
import numpy as np
class Stock:
"""
Class to represent the data and ratios of a stock.
"""
def __init__(self, eps, dps, roe=0):
'''
eps: earnings per share.
dps: dividends per share.
roe: fractional return on equity, default to 0.
'''
self.eps = np.array(e... |
import argparse
import numpy as np
parser = argparse.ArgumentParser(description='Configuration file')
arg_lists = []
def add_argument_group(name):
arg = parser.add_argument_group(name)
arg_lists.append(arg)
return arg
def str2bool(v):
return v.lower() in ('true', '1')
net_arg = add_argument_group('Network')
net... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
with open('README.rst') as file:
long_description = file.read()
except IOError:
long_description = 'Python lib for sniffets.com'
setup(
name='sniffets',
packages=['sniffets'],
version='0.1.8',... |
from distutils.core import setup
setup (
name = 'quaternion_class'
author = 'Matthew Nichols'
author_email = 'mattnichols@gmail.com'
packages = ['quaternion']
package_dir = {'quaternion':src}
) |
import os
import sys
from csvkit import sql
from csvkit import table
from csvkit import CSVKitWriter
from csvkit.cli import CSVKitUtility
class CSVSQL(CSVKitUtility):
description = 'Generate SQL statements for one or more CSV files, create execute those statements directly on a database, and execute one or more SQL... |
from django.db import models
from django.core.exceptions import ValidationError
from django.db.models.fields.related import ForeignObject
try:
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor
except ImportError:
from django.db.models.fields.related import ReverseSingleRelatedOb... |
import re
def objectid(value):
message = 'ciao'
if not value:
return None
pattern = re.compile('^[0-9a-z]{24}$')
if not pattern.match(value):
raise ValueError(message)
return value |
from .office365 import Office365 # noqa: F401
from .site import Site # noqa: F401
from .version import __version__ # noqa: F401
__all__ = ["site", "office365"]
__title__ = "SharePlum SharePoint Library"
__author__ = "Jason Rollins" |
import copy
import os
import re
import subprocess
from conans.client import tools
from conans.client.build.visual_environment import (VisualStudioBuildEnvironment,
vs_build_type_flags, vs_std_cpp)
from conans.client.tools.oss import cpu_count
from conans.client.tools.... |
"""core URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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 ... |
import logging
import numpy as np
import os
import subprocess
import tempfile
from . import scene
from . import rman
ZERO = scene.npvector((0, 0, 0))
_film = rman.Identifier(
'Film', positional=['string'],
named={
'xresolution': 'integer',
'yresolution': 'integer',
'cropwindow': 'float[4... |
"""
Generates an AXI Stream demux wrapper with the specified number of ports
"""
import argparse
from jinja2 import Template
def main():
parser = argparse.ArgumentParser(description=__doc__.strip())
parser.add_argument('-p', '--ports', type=int, default=4, help="number of ports")
parser.add_argument('-n', ... |
import os
import runpy
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.pngmath',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'pyHMSA'
copyright = u'2014, Philippe Pinard'
filepath = os.path.join(os.path.dirname(__file__),
... |
'''
///////////////////////////////////////////////////////////
// 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
// ... |
"""
Salt Edge Account Information API
API Reference for services # noqa: E501
OpenAPI spec version: 5.0.0
Contact: support@saltedge.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class CategoriesRequestBody(object):
"""N... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('company', '0003_auto_20170913_1007'),
]
operations = [
migrations.AlterField(
model_name='company',
name='basic_material',
... |
import os
import sys
if __name__ == "__main__":
settings_name = "settings.local" if os.name == 'nt' else "settings.remote"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_name)
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.