text stringlengths 1 927k |
|---|
from .container_manager import ContainerManager
from .docker_swarm import DockerSwarmContainerManager |
# -*- coding: utf-8 -*-
"""module for Chromium Web Browser."""
import os
import shutil
from json import decoder
from modules import manager
from modules import interface
from modules.app_chromium.chrome import chrome
from modules.app_chromium.whale import whale
from modules.app_chromium.chromium_edge import chromium_e... |
# coding: utf-8
"""
PocketSmith
The public PocketSmith API # noqa: E501
The version of the OpenAPI document: 2.0
Contact: api@pocketsmith.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from pocketsmith.configuration import Configuration
... |
"""
ApiWatchTower 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')
Cla... |
# Generated by Django 3.2.7 on 2021-09-21 18:01
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_depen... |
import requests
import jmespath
class Client:
opts = {
'data_url': 'https://data.opencrypto.io/data.json'
}
def __init__(self, options={}):
for key in options:
print(key)
self.opts[key] = options[key]
self.data = None
self.load()
def load(self):
if self.data is None:
pri... |
import os
class Config:
"""
General configuration parent class
"""
NEWS_API_BASE_URL = 'https://newsapi.org/v2/sources?language=en&apiKey=fb94d5e25c0c4415b3e09b25c25b3d62'
ARTICLES_API_BASE_URL = 'https://newsapi.org/v2/everything?sources={}&apiKey=fb94d5e25c0c4415b3e09b25c25b3d62'
NEWS_API_KE... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import json
import os
import numpy as np
import torch
import time
from copy import deepcopy
import random
import psutil
import ... |
# (C) Datadog, Inc. 2019
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from copy import deepcopy
from six import iteritems
from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck
from datadog_checks.errors import CheckException
class KubeAPIServerMetricsCheck(OpenMetri... |
# Copyright 2014-2020 The PySCF Developers. 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 appl... |
# 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... |
import torch
import torch.nn as nn
from torch.utils.data import Dataset
from torch.nn.functional import normalize
from random import shuffle
from utils import MLP, read_input_file, _compute_connectivity, rmsd, save_structure
import matplotlib.pyplot as plt
import os
from pykeops.torch import LazyTensor
from tqdm impo... |
# Copyright (c) 2017 SquirrelInHell
#
# 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, dist... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
import tqdm
from sty import fg, bg, ef, rs
foo = fg.red + 'This is red text!' + fg.rs
bar = bg.blue + 'This has a blue background!' + bg.rs
baz = ef.italic + 'This is italic text' + rs.italic
qux = fg(201) + 'This is pink text using 8bit colors' + fg.rs
qui = bg(255, 10, 10) + 'This is red text using 24bit colors.' + ... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
genesis = {
'kb': '''
Father(Abraham, Isaac)
Father(Isaac, Esau)
Father(Esau, Eliphaz)
Father(Esau, Jeush)
Father(Isaac, Jacob)
Father(Jacob, Reuben)
Father(Jacob, Simeon)
Father(Jacob, Levi)
Father(Abraham, Ishmael)
Father(Ishmael, Nebaioth)
Father(Ishmael, Kedar)
Father(Kedar)
IsMortal
Father(w, x... |
import re
import datetime
from book_manager.ser import Ser
class borrow:
def borrowing(self, book, borrow_person):
book_num = self.book_list_oprate(-1, book=book)
self.borrow_list_oprate(-1, person=borrow_person, book=book, book_num=book_num)
def backing(self, book, borrow_person):
se... |
# coding: utf-8
# pylint: disable=too-many-locals, too-many-arguments, invalid-name
# pylint: disable=too-many-branches, too-many-statements
"""Training Library containing training routines."""
from __future__ import absolute_import
import warnings
import numpy as np
from .core import Booster, STRING_TYPES, XGBoostErr... |
import collections
import os
from textwrap import dedent
import pytest
import yaml
from jinja2 import Environment, FileSystemLoader
from conda_build.utils import copy_into
from conda_smithy.configure_feedstock import (
conda_forge_content,
_load_forge_config,
)
RecipeConfigPair = collections.namedtuple(
... |
#
# @lc app=leetcode id=516 lang=python3
#
# [516] Longest Palindromic Subsequence
#
# https://leetcode.com/problems/longest-palindromic-subsequence/description/
#
# algorithms
# Medium (56.28%)
# Total Accepted: 173.4K
# Total Submissions: 308.1K
# Testcase Example: '"bbbab"'
#
# Given a string s, find the longest... |
#
# Module providing various facilities to other parts of the package
#
# billiard/util.py
#
# Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
#
from __future__ import absolute_import
import errno
import functools
import itertools
import weakref
import atexit
import shutil
import tempfile
import threading ... |
# -*- coding: utf-8 -*-
import requests
import hashlib
import json
import os
def saveNewData():
with open(fn, 'w') as f:
json.dump(TargetData.json(), f,ensure_ascii=False)
def saveHashvalue():
with open(fnHash, 'w') as hashread:
hashread.write(NewHash)
def CalHashvalue():
data = hashl... |
from typing import Pattern, Dict
from recognizers_text.utilities import RegExpUtility
from recognizers_number.number.extractors import BaseNumberExtractor
from recognizers_number.number.parsers import BaseNumberParser
from ...resources.english_date_time import EnglishDateTime
from ..extractors import DateTimeExtractor... |
# Generated by Django 2.2.27 on 2022-02-18 08:17
import api.utils
import django.core.validators
from django.db import migrations, models
import re
class Migration(migrations.Migration):
dependencies = [
('api', '0142_auto_20220202_0551'),
]
operations = [
migrations.AlterField(
... |
import numpy as np
import pandas as pd
import plotly.graph_objs as go
from typing import List
from flask import jsonify
from plotly.offline import plot
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from lilypadz.model.data_processor import get_toad_processed_hop
def get_all_clustering_resul... |
import datetime
import pandas as pd
import pytz
from pandas_market_calendars.exchange_calendar_hkex import HKEXExchangeCalendar
def test_time_zone():
assert HKEXExchangeCalendar().tz == pytz.timezone('Asia/Shanghai')
assert HKEXExchangeCalendar().name == 'HKEX'
def test_2018_holidays():
hkex = HKEXExc... |
age=int(input("Enter your age?"))
if age < 30:
print("age is less than 30, may be you are minor let me find out")
if age > 18:
print("you are telling truth you are not minor")
else:
print("you are in legal age and between 18 and 30")
elif age >= 30:
print("let me check if you are a senio... |
# Tests that require installed backends go into
# sympy/test_external/test_autowrap
import os
import tempfile
import shutil
from io import StringIO
from sympy.utilities.autowrap import autowrap, binary_function, CythonCodeWrapper,\
ufuncify
from sympy.utilities.codegen import Routine, CCodeGen, CodeGenArgumen... |
from __future__ import print_function
import inspect
import types
import sys
import operator as op
from collections import namedtuple
import warnings
import re
from jedi._compatibility import unicode, is_py3, builtins, \
py_version, force_unicode
from jedi.inference.compiled.getattr_static import getattr_static
A... |
import pytest
import json
import jsonpickle
import os.path
import importlib
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... |
# -*- 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... |
"""
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... |
""" a clumsy attempt at a macro language to let the programmer execute code on the server (ex: determine 64bit)"""
import is64bit as is64bit
def macro_call(macro_name, args, kwargs):
""" allow the programmer to perform limited processing on the server by passing macro names and args
:new_key - the key name th... |
import psycopg2
## connect to the db
host = "localhost"
db = "stock_selector_db"
user = "postgres"
pw = "123"
conn = psycopg2.connect(
host = host,
database = db,
user = user,
password = pw)
cur = conn.cursor()
## insert data
while True:
index = input("what index do you want to register?\n")
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("deepdanbooru/__main__.py", encoding="utf-8") as f:
version = re.search('__version__ = "([^"]+)"', f.read()).group(1) # type: ignore
instal... |
from __future__ import absolute_import, print_function, division
import sys
from collections import defaultdict, deque
import tensorflow as tf
from tensorflow.python.training import slot_creator
from tensorflow.contrib.opt import ScipyOptimizerInterface
from far_ho import utils
from far_ho.optimizer import Optimizer... |
#
# PySNMP MIB module RUCKUS-SYSTEM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RUCKUS-SYSTEM-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:58:59 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Logging of database connection activity. Activate this with ZCML::
<include package="nti.zodb" file="configure_activitylog.zcml" />
Originally based on code from the unreleased zc.zodbactivitylog.
"""
from __future__ import print_function, absolute_import, divis... |
import argparse, os, sys, math
import numpy as np
from gensim.models import Word2Vec
from sklearn.decomposition import TruncatedSVD
from soynlp.word import pmi
from soynlp.vectorizer import sent_to_word_contexts_matrix
from collections import defaultdict
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(... |
import pytest
from django.contrib import admin
# from sme_material_apps.proponentes.admin import TipoDocumentoAdmin
from sme_material_apps.proponentes.models import TipoDocumento
pytestmark = pytest.mark.django_db
def test_instancia(tipo_documento):
assert isinstance(tipo_documento, TipoDocumento)
assert ti... |
#!/usr/bin/env python3
# Fetching a JSON Document from the Google Geocoding API
import requests
def geocode(address):
parameters = {'address': address, 'sensor': 'false'}
base = 'http://maps.googleapis.com/maps/api/geocode/json'
response = requests.get(base, params=parameters)
answer = response.json... |
#!/usr/bin/env python3
"""
Implementation of ZeroSeg library methods with corresponding
behaviour but displayed on emulator display.
"""
from Emulator.characters import CHARS, UNDEFINED
import time
METHOD = []
class Screen:
"""
Representation of `screen` object from ZeroSeg library.
"""
def __init_... |
import os
import shutil
from pathlib import Path
import requests_mock
from validators.utils import ValidationFailure
from eu_state_aids import __version__
from eu_state_aids.utils import validate_year, validate_year_month
from typer.testing import CliRunner
from eu_state_aids.main import app
runner = CliRunner()
... |
#
# List of forecast evaluation test names
#
test_names = "N,T" |
import collections
import argparse
from datetime import datetime
import os
import numpy as np
import tqdm
from vgn import io#, vis
from vgn.grasp import *
from vgn.simulation import ClutterRemovalSim
from vgn.utils.transform import Rotation, Transform
from vgn.utils.implicit import get_mesh_pose_list_from_world, get... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... |
"""
modbus honeypot topology
"""
from mininet import net
from mininet.link import Intf
from mininet.topo import Topo as TopoBase
from srvm import Srvm
from clim import Clim
from clim2 import Clim2
# Defines network topology for this simulation. All nodes
# (Srvm, Clim, Clim2) are connected to a single switch 's1'.
c... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'batch.ui'
#
# Created by: PyQt5 UI code generator 5.14.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import QThread, pyqtSignal
from PyQt5.QtWidgets import QFileDialog
from... |
# encoding: UTF-8
from __future__ import absolute_import
from .vnshzd import ShzdApi |
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from sauce_searcher_server.api import (
get_anime,
get_doujin,
get_light_novel,
get_manga,
get_visual_novel,
)
from sauce_searcher_server.models import Anime, Doujin, LightNovel, Manga, VisualNovel
app = FastAPI()
app.a... |
prev = 0
balance = 0
day = 0
longest_dep1 = 0
longest_dep2 = 0
longest_day = 0
wins = 0
def start_game(deposit_1, deposit_2):
global day, balance, prev
day = 2
prev = deposit_1
balance = deposit_1 + deposit_2
day_loop()
def day_loop():
global day, balance, prev
day += 1
prev_tmp = pr... |
from ..fragments import FRAGMENT_PRODUCT_RELATION_TYPE
MUTATION_CREATE_PRODUCT_RELATION_TYPES = '''
mutation CreateProductRelationTypes(
$type: CreateProductRelationTypeInput!
$reverse: CreateProductRelationTypeInput
$selfReverse: Boolean
) {
createProductRelationTypes(
type: $type
reverse: $reverse
... |
import os
from urlparse import urlparse
import datetime
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.db.models import Max, Min
from django.shortcuts import get_object_or_404, render, redirect
from django.template import TemplateDoesNotExist
fr... |
# -*- coding: utf-8 -*-
"""
functions.py - Miscellaneous functions with no other home
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
"""
from __future__ import division
from .python2_3 import asUnicode
from .Qt import QtGui, QtCore, USE_PYSIDE
Colors = {
'b... |
import random
import py_trees
import carla
from haco.DIDrive_core.simulators.carla_data_provider import CarlaDataProvider
from haco.DIDrive_core.simulators.srunner.scenariomanager.scenarioatomics.atomic_behaviors import ChangeNoiseParameters, \
ActorTransformSetter
from haco.DIDrive_core.simulators.srunner.scenari... |
from tkinter import *
Label(None, {'text': 'Hello GUI world!', Pack: {'side': 'top'}}).mainloop()
"""
from tkinter import *
options = {'text': 'Hello GUI world!'}
layout = {'side': 'top'}
Label(None, **options).pack(**layout) # keyword must be strings
mainloop()
""" |
import os
import subprocess
import django_heroku
from pathlib import Path
from django.utils import timezone
import dj_database_url
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See h... |
import cv2
import numpy as np
import caffe
def get_landmark_net():
net_file = './landmark.prototxt'
caffe_model = './landmark.caffemodel'
caffe.set_mode_gpu()
net = caffe.Net(net_file, caffe_model, caffe.TEST)
return net
def get_pose_landmarks(net , img):
halfheight = img.shape[0] * 0.5
... |
import math
import cmath
import numpy
#import fluo # used in Layer.get_index, change to readf1f2, stop using fluo
import readf1f2a
# 9/20/2010: Y.Choi.
# Reflectivity calculation using Parratt's recursive formula
# Calculate reflected intensity as a function of angle or energy
# Needs accesss to index of refraction d... |
# Copyright (c) 2019-2020, RTE (https://www.rte-france.com)
# See AUTHORS.txt
# This Source Code Form is subject to the terms of the Apache License, version 2.0.
# If a copy of the Apache License, version 2.0 was not distributed with this file, you can obtain one at http://www.apache.org/licenses/LICENSE-2.0.
# SP... |
# Simple Pong game in Python 3 using Turtle
import turtle
import os
# game window setup
window = turtle.Screen()
window.title("Pong")
window.bgcolor("black")
window.setup(width=800, height=600)
window.tracer(0)
# paddle A
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("white")
p... |
#!/usr/bin/env python3
"""
--- Day 17: No Such Thing as Too Much ---
The elves bought too much eggnog again - 150 liters this time. To fit it all into your refrigerator, you'll need to move it into smaller containers. You take an inventory of the capacities of the available containers.
For example, suppose you have c... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\baby\baby_tuning.py
# Compiled at: 2020-06-18 05:20:39
# Size of source mod 2**32: 8564 bytes
i... |
"""
PriorityField custom field.
This custom field exists to manage the priority value of individual
`Coordinates` objects. It exhibits the following behaviour:
* based on `models.PositiveSmallIntegerField` (values <= 32767 are safe on all
db platforms)
* accepts null (`None`/`NULL`) values
* values are unique for ... |
#!/usr/bin/python
# Add security groups to CloudFormation template files.
# This will modify the CloudFormation template files,
import sys, json, glob
from ansible.module_utils.basic import *
from cfyaml import yaml
def read_template(file_name):
with open(file_name, 'r') as f:
template = yaml.load(f)
... |
from collections import OrderedDict
opts = OrderedDict()
opts['use_gpu'] = True
opts['model_path'] = '../models/critic.pth'
opts['actor_path'] = '../models/Actor250000.npy'
opts['img_size'] = 107
opts['padding'] = 16
opts['batch_pos'] = 32
opts['batch_neg'] = 96
opts['batch_neg_cand'] = 1024
opts['batch_test'] = 2... |
# coding: utf-8
from lxml import html
from django.test import TestCase
from django.test.client import Client
from quotes.tests.utils import create_test_tag
class TagPageTestCase(TestCase):
def setUp(self):
self.client = Client()
self.dom = ''
self.tag = create_test_tag()
def tearDo... |
"""
Author: Sam Armstrong
Date: Autumn 2021
Description: The code for generating a single sample using the model (saves the image to the local folder)
"""
import torch
import numpy as np
from Generator import Generator
from PIL import Image
from matplotlib import cm
from torch.autograd import Variable
from torch impo... |
from __future__ import print_function, division, absolute_import
__author__ = 'Alex Rogozhnikov'
__version__ = '0.6.0' |
# -*- coding: utf-8 -*-
# Copyright 2017 ProjectV Authors. 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 requi... |
import os,sys
import os.path
import numpy as np
import torch
import torch.utils.data
from torchvision import datasets,transforms
from sklearn.utils import shuffle
import urllib.request
from PIL import Image
import pickle
import utils
#####################################################################################... |
import json, socket
class Provider:
def __init__(self, name: str):
self.name = name
self._is_connected = False
self._initializing = False
def connect(self):
pass
def client_connect(
self, remote_address: str, remote_port: int, client_socket: socket.socket
) ->... |
import pytest
from inan.wallet.chialisp import (
apply,
args,
cons,
eval,
fail,
first,
is_zero,
make_if,
make_list,
nth,
quote,
rest,
sexp,
)
class Testchialisp:
def test_sexp(self):
assert sexp() == "()"
assert sexp(1) == "(1)"
assert s... |
import numpy as np
from shapely.geometry import Polygon
import numpy as np
import cv2
from PIL import Image
import math
import os
import torch
def get_MSER(image_path,):
image = cv2.imread(image_path)
rgb_img = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
negtive_map = np.zeros(image.shape[:2])
mser = cv2.... |
from __future__ import division
import numpy as np, pandas as pd, time
from utils import BHfilter
def interval_statistic(method,
instance,
X,
Y,
beta,
l_theory,
l_min,
... |
"""
With classes, we have a problem with heritage. Note that for standard functions
(like sum_arrays), we actually also have the problem with monkey patching.
We can just say that monkey patching of `sum_arrays` is not supported (so that
`sum_arrays` can be treated as a Pythran function, and potentially inlined) but
f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = []
import re
import shlex
import calendar
from datetime import datetime
from operator import itemgetter
from collections import namedtuple
import ads
import flask
from werkzeug.contrib.cache import SimpleCache
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps.registry import Apps
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class UnicodeModel(models.Model):
title = models.CharField('รรรยขรรร', max_length=20, defaul... |
from typing import Text
import numpy as np
from rasa.shared.core.constants import ENTITY_LABEL_SEPARATOR
import scipy.sparse
import pytest
from rasa.core.featurizers.single_state_featurizer import SingleStateFeaturizer
from rasa.shared.core.domain import Domain
from rasa.shared.nlu.constants import (
ACTION_TEXT,... |
# flake8: noqa (because we import * for a decent reason)
'''
The django test runner looks for unittest.TestCase subclasses
defined in this file, so import any testcases here.
'''
from .test_metadata import *
from .test_bills import *
from .test_legislators import *
from .test_committees import *
from .test_events impo... |
import math
from kraken.core.maths import Vec3
from kraken.core.maths.xfo import Xfo
from kraken.core.maths.xfo import xfoFromDirAndUpV
from kraken.core.objects.components.base_example_component import BaseExampleComponent
from kraken.core.objects.attributes.attribute_group import AttributeGroup
from kraken.core.obj... |
from .base import *
import environ
ENV_FILE = os.path.join(BASE_DIR, '.env')
env = environ.Env()
env.read_env(ENV_FILE)
SECRET_KEY = '@8*#m4e^8ec-1rnzu*sit&c$9io-uo$mb#d9+k9x*j)-^4ozql'
DEBUG = False
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS')
STATIC_ROOT = os.path.join(BASE_DIR, 'www/{}/static'.format(PROJECT_NAM... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Script to determine the Pywikibot version (tag, revision and date)."""
#
# (C) Merlijn 'valhallasw' van Deen, 2007-2008
# (C) xqt, 2010-2020
# (C) Pywikibot team, 2007-2020
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division... |
# Copyright 2017 The TensorFlow Authors. 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 applica... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import six
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.conf import settings
from google.protobuf.descriptor import FieldDescriptor
from google.protobuf.message import Message
from . import fields
LOGGER... |
from utils import CSVScraper
class GrimsbyPersonScraper(CSVScraper):
csv_url = 'https://www.niagaraopendata.ca//dataset/fe096749-6ca8-4ae7-b80e-dc682a698759/resource/892a4873-cbe7-4c32-9b70-9f364467955e/download/grimsbycouncil20160210.csv'
many_posts_per_area = True |
from pathlib import Path
import random
import numpy
from pyrr import matrix44
import moderngl
import moderngl_window
from moderngl_window.opengl.vao import VAO
class Boids(moderngl_window.WindowConfig):
"""
An attempt to make something boid-list with GL3.3.
Not currently working as intended, but still cr... |
from django.shortcuts import render
from rest_framework import generics, permissions, viewsets, renderers
from rest_framework.views import APIView
from rest_framework.response import Response
from collections import Counter
from django.db.models import Count, Avg
from datetime import timedelta
from .models import Book,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019, Linear Labs Technologies
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
Unles... |
# -----------------------------------------
# python modules
# -----------------------------------------
from importlib import import_module
from easydict import EasyDict as edict
import torch.backends.cudnn as cudnn
import sys
import numpy as np
import os
# stop python from writing so much bytecode
sys.dont_write_byt... |
'''
Problem Statement
Write a function that takes in a non-empty array of distinct integers and an integer representing a target sum. If any two numbers in the input array sum up to the target sum, the function should return them in an array, in sorted order. If no two numbers sum up to the target sum, the function sho... |
import collections
import math
import operator
from eth_utils import (
to_tuple,
)
from eth_utils.toolz import (
curry,
groupby,
sliding_window,
)
from web3._utils.math import (
percentile,
)
from web3.exceptions import (
InsufficientData,
ValidationError,
)
MinerData = collections.namedt... |
from organizations.models import Content
from django.http import HttpResponse
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import TemplateView
from projects.models import Project
class ContentDashboard(LoginRequiredMixin, TemplateView):
template_name = "content/manage_co... |
"""OpenPype Settings
Settings define how openpype and it's modules behave. They became main
component of dynamism.
OpenPype settings (ATM) have 3 layers:
1.) Defaults - defined in code
2.) Studio overrides - values that are applied on default that may modify only
some values or None, result can be called "studio ... |
"""Crux_pivo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/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-bas... |
'''
Reads chromoplexy breaks, generates a graph using a sliding window of fixed size, and stores all the resulting connected subraphs in a file compatible with an implementation of gSpan [1].
Discards all subgraphs with less than 3 vertices or 3 edges.
[1] https://github.com/betterenvi/gSpan
'''
import os
import sys
... |
# __all__ = [ "operations", "input", "output" ]
from os.path import dirname, basename, isfile, join
import glob
modules = glob.glob(join(dirname(__file__), "*.py"))
__all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] |
import os
import time
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
import torchvision
from torchvision.datasets import CIFAR10 #MNIST
from torch.utils.data import DataLoader, random_split
from torchvision import transforms
import pytorch_lightning as pl
import matplotlib.pyplot... |
# coding: utf-8
from enum import Enum
from six import string_types, iteritems
from bitmovin_api_sdk.common.poscheck import poscheck_model
from bitmovin_api_sdk.models.imsc_styling_mode import ImscStylingMode
import pprint
import six
class ImscStyling(object):
@poscheck_model
def __init__(self,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.