text stringlengths 2 999k |
|---|
# Copyright 2015 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/python3
import sys
import argparse
import xml_utils as u
import datetime
import pdb
from collections import defaultdict
##------------------------------------------------------------
## can be called with:
## xml_diff file1 file2
##------------------------------------------------------------
def main ... |
"submod"
|
# Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
# Python
import json
# Django
from django.db import models
# AWX
from awx.main.fields import JSONBlob
from awx.main.models.base import CreatedModifiedModel, prevent_search
from awx.main.utils import encrypt_field
from awx.conf import settings_registry
__all_... |
"""add label to role
Revision ID: b0e2b55721bd
Revises: 9429d9e2ef7f
Create Date: 2020-05-28 16:10:09.454301
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
from thorn.migration_utils import is_sqlite
# revision identifiers, used by Alembic.
revision = 'b0e2b55721bd'
down_rev... |
# coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.... |
from invoke import task, Context
from fabric import Connection
@task
def build(c):
pass
@task
def deploy(c):
pass
@task
def basic_run(c):
c.run("nope")
@task
def expect_vanilla_Context(c):
assert isinstance(c, Context)
assert not isinstance(c, Connection)
@task
def expect_from_env(c):
... |
# Compute CORAL loss using pytorch
# Reference: DCORAL: Correlation Alignment for Deep Domain Adaptation, ECCV-16.
import torch
def CORAL_loss(source, target):
d = source.data.shape[1]
ns, nt = source.data.shape[0], target.data.shape[0]
# source covariance
xm = torch.mean(source, 0, keepdim=True) - so... |
from NIWENV import *
# from PySide2.QtWidgets import ...
from PySide2.QtCore import Qt
from PySide2.QtGui import QPixmap, QPainter, QPen, QColor, QBrush
from PySide2.QtWidgets import QWidget, QVBoxLayout, QLabel
from PySide2.QtWidgets import QWidget
class ShowPoints_NodeInstance_MainWidget(QWidget, MWB):
def ... |
import os
import fnmatch as fn
from sparksession import *
import database as db
def get_path_from_id(student_id, location=None):
"""
Get the relative path for a specific student's csv.
:param student_id: ID number of the csv file.
:param location: Directory to search for file in, data_raw/ by default.... |
import json
import os
import time
import requests
from .fcm_errors import *
class BaseAPI(object):
CONTENT_TYPE = "application/json"
FCM_END_POINT = "https://fcm.googleapis.com/fcm/send"
FCM_MAX_RECIPIENTS = 1000
FCM_LOW_PRIORITY = 'normal'
FCM_HIGH_PRIORITY = 'high'
def __init__(self, api... |
# -*- 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):
# Removing unique constraint on 'SimpelProduct', fields ['naam']
db.delet... |
from bs4 import BeautifulSoup
from ..config import dp, _
from ..lib import handlers
from ..lib.aioget import aioget
@dp.message_handler(commands=["bashorg", "bashim", "b"])
@handlers.parse_arguments(2, without_params=True)
async def bashorg(message, params):
if len(params) == 1:
page = await aioget("http... |
# -*- coding: utf8 -*-
from .base import *
|
# -*- coding: utf-8 -*-
import inspect
class ErrorsModel(Exception):
def __init__(self):
super().__init__(self.message, self.code)
class ServiceModel:
@property
def short_name(self):
return self.__service_short_name
@property
def count(self):
return self.__count_slot
@count.setter
def count(self, val... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# 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
#
# ... |
#
# 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, software
# distributed under ... |
import sys
from setuptools import setup
PY3 = sys.version_info[0] == 3
dependencies = [
'cassandra-driver ~= 3.24',
'click ~= 7.1',
'PyGithub ~= 1.45',
'PyYAML ~= 5.4'
]
if not PY3:
dependencies.append('backports.tempfile ~= 1.0')
long_description = ""
with open("README.md") as f:
long_... |
from .determine_winner import determine_winner
def equality(cards_player_one, cards_player_two, card_player_one, card_player_two, cards_to_win, battle_player_one, battle_player_two):
cards_player_one.remove(card_player_one)
cards_player_two.remove(card_player_two)
hide_card_player_one = cards_player_one[0]
hide_c... |
import setuptools
#import speak
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='speakme',
version='0.1.1',
scripts=['speakme'] ,
author="Tejas Bhor",
author_email="tejasjbhor@gmail.com",
description="Personal voice assistant - Markos",
... |
"""CLI subcommands."""
import platform
import sys
import click
from greynoise.__version__ import __version__
from greynoise.cli.decorator import (
echo_result,
gnql_command,
handle_exceptions,
ip_lookup_command,
not_implemented_command,
pass_api_client,
)
from greynoise.cli.formatter import A... |
"""Packaging settings."""
from codecs import open as codecs_open
from os.path import abspath, dirname, join
from sys import version_info
from setuptools import find_packages, setup
from runway import __version__
THIS_DIR = abspath(dirname(__file__))
with codecs_open(join(THIS_DIR, 'README.rst'), encoding='utf-8') ... |
# -*- coding: utf-8 -*-
"""
@date: 2021/9/28 上午10:56
@file: __init__.py.py
@author: zj
@description:
"""
|
# -*- coding: utf-8 -*-
"""Export components of the bioregistry to YAML."""
import os
import click
import yaml
from ..constants import DOCS_DATA
from ..schema import sanitize_mapping
from ..utils import read_collections, read_metaregistry, read_registry
@click.command()
def export_yaml():
"""Export the regist... |
from pandas_profiling.report.presentation.core import Overview, Table, Sequence, HTML
from pandas_profiling.report.structure.variables import render_common
def render_generic(summary):
template_variables = {} # render_common(summary)
info = Overview(
anchor_id=summary["varid"],
warnings=summ... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... |
# -*- coding: utf-8 -*-
'''
Support for Zabbix
:optdepends: - zabbix server
:configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar
or in the minion's config file. Zabbix url should be also specified.
.. code-block:: yaml
zabbix.user: A... |
from datetime import datetime, timedelta, timezone
import requests_cache
import yfinance as yf
from pandas import DataFrame
from src.logger import WithLogger
from src.utils.asyncio_utils import asyncize, run_async_main
from src.utils.date_utiles import TOMORROW
'''
def auto_adjust(data):
df = data.copy()
rati... |
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... |
from __future__ import division, absolute_import, print_function
from .info import __doc__
from numpy.version import version as __version__
from . import multiarray
from . import umath
from . import _internal # for freeze programs
from . import numerictypes as nt
multiarray.set_typeDict(nt.sctypeDict)
from . import n... |
# Generated by Django 2.2.19 on 2021-05-02 15:56
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.CreateModel(
... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... |
from flask import render_template, redirect, request, url_for, flash
from flask_login import login_user, login_required, logout_user
from ..models import User
from .forms import LoginForm
from . import auth
@auth.route('/login', methods=['GET', 'POST'])
def login():
form = LoginForm()
if form.validate_on_su... |
# SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import onnx
from ..base import Base
from . import expect
class ReduceSum(Base):
@staticmethod
def ex... |
import re
from contextlib import contextmanager
from copy import deepcopy
from datetime import timedelta
from unittest import SkipTest
import parler
from cms.api import add_plugin
from cms.utils.copy_plugins import copy_plugins_to
from cms.utils.plugins import downcast_plugins
from django.contrib import admin
from dja... |
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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 require... |
import socket
from time import sleep
import paho.mqtt.client as mqtt
hostname = socket.gethostname()
broker = 'broker.hivemq.com'
port = 1883
default_user = hostname
default_pw = None
default_topic = '/ping-mqtt/' + hostname
default_msg = 'ping'
default_qos = 0
ping_interval = 1
running ... |
#!/usr/bin/env 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 require... |
import pymssql
import boto3
from sqlalchemy.orm import declarative_base
from sqlalchemy.schema import Sequence
from sqlalchemy import Column, String, DateTime, Integer, Float, Date, MetaData
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from sqlalchemy.sql import select
from sqlalchemy import... |
"""
Tests app.internals.user_feed package
:author: Angelo Cutaia
:copyright: Copyright 2021, LINKS Foundation
:version: 1.0.0
..
Copyright 2021 LINKS Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may ob... |
from tests.unit.mock.fake_cli import fake_cli |
from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='{{ cookiecutter.project_version }}',
description='{{ cookiecutter.project_description }}',
author='{{ cookiecutter.project_author }}',
license='{{ cookiecutter.project_license }}'
)
|
import os
import regex
from pathlib import Path
class MultiDataset:
mapping = {}
#The tokenizer is only used during training for checking if some tokens will be considered as UNK by BERT
def __init__(self, dataset, predifined_mapping=None, tokenizer=None):
self.__mappings = MultiDataset.mapping
... |
from metric.recall_at_k import RecallAtK
from loss.vae_loss import VAELoss
from dataloader.mamo_dataset import MamoDataset
from validator import Validator
from torch.utils.data import DataLoader
from models.multi_VAE import MultiVAE
import os
import numpy as np
import pytest
import yaml
# Packages needed to run test:
... |
from setuptools import setup, find_packages
import toml
config = toml.load('./plugin_info.toml')
SHORT_PLUGIN_NAME = config['plugin-info']['SHORT_PLUGIN_NAME']
PLUGIN_NAME = f"pymodaq_plugins_{SHORT_PLUGIN_NAME}"
from pathlib import Path
if not SHORT_PLUGIN_NAME.isidentifier():
raise ValueError("'SHORT_PLUGIN_N... |
from .utils import *
from .hard_coded_partitioning import *
from .leader_election import *
from .networkx_partitioning import *
from .spectral_clustering import *
from .fm_partitioning import *
|
# -*- coding: utf-8 -*-
import struct
from cStringIO import StringIO
# Object headers
_NIL = 0xc0
_TRUE = 0xc3
_FALSE = 0xc2
_UINT8 = 0xcc
_UINT16 = 0xcd
_UINT32 = 0xce
_UINT64 = 0xcf
_INT8 = 0xd0
_INT16 = 0xd1
_INT32 = 0xd2
_INT64 = 0xd3
_FLOAT = 0xca
_DOUBLE = 0xcb
_FIX_RAW = 0xa0
_RAW16 = 0xda
_RAW32 ... |
from ursina import *
app = Ursina()
title = Text('''position, rotation, scale and parenting demo''', position=(-.85, .475), scale=1.5)
entity = Entity(model='cube', texture='white_cube')
child = Entity(parent=entity, x=1, model='cube', scale=.5, texture='white_cube', color=color.azure)
spacing = .04
ui_parent = Enti... |
# Copyright 2018 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, ... |
__all__ = ['alert', 'api', 'npo'] |
import click
from click_aliases import ClickAliasedGroup
from workspacesio.common import schemas
from . import config
from .util import exit_with, handle_request_error
def make(cli: click.Group):
@cli.group(name="user", cls=ClickAliasedGroup, aliases=["u"])
def user():
pass
@user.command(name="... |
import numpy
i = 122
|
import cv2
import numpy as np
from ..modules.one_euro_filter import OneEuroFilter
class Pose:
num_kpts = 18
kpt_names = ['neck', 'nose',
'l_sho', 'l_elb', 'l_wri', 'l_hip', 'l_knee', 'l_ank',
'r_sho', 'r_elb', 'r_wri', 'r_hip', 'r_knee', 'r_ank',
'r_eye', 'l... |
######################################
## 数据文件夹下LRW文件夹的名字. ##
######################################
LRW1000_DATA_PATH_NAME = '/data/zhangyk/data/CAS-VSR-W1k/audio/LRW1000_Public/audio'
LRW1000_AUDIO_DATA_PATH_NAME = '/data/zhangyk/data/lrw1000_audio_pkl'
######################################
import torch
from torch.... |
from django.db import models
class Movie(models.Model):
title = models.CharField(max_length=256)
length = models.PositiveIntegerField()
release_year = models.PositiveIntegerField()
font_size = models.IntegerField()
def __str__(self):
return self.title
class Customer(models.Model):
fir... |
import numpy as np
from pyearth import Earth
import pandas as pd
def find_nearest(array, value):
"""
find the index of an item in an array that is closest to a given value
Args:
array: numpy array
value: int or float
Returns:
int
"""
idx = (np.abs(array - value)).ar... |
#!/usr/bin/env python
import random
import warnings
import time
import numpy as np
from compressors import (
sparse_ratio_metric,
TopKCompressor,
RandKCompressor
)
class Client:
def __init__(self, client_id, group=None, train_data={'x' : [],'y' : []}, eval_data={'x' : [],'y' : []}, model=None):
... |
from django import forms
from .models import News
class NewsForm(forms.ModelForm):
class Meta:
model = News
# fields = '__all__'
fields = ['title', 'content', 'is_published', 'category']
widgets = {
'title': forms.TextInput(attrs={'class': 'form-control'}),
... |
# -*- coding: utf-8 -*-
# cython: language_level=3
# Copyright (c) 2020 Nekokatt
#
# 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... |
import json
import mock
from django.core.urlresolvers import reverse
from ide.utils.cloudpebble_test import CloudpebbleTestCase
from utils.fakes import FakeS3
__author__ = 'joe'
fake_s3 = FakeS3()
@mock.patch('ide.models.s3file.s3', fake_s3)
class TestSource(CloudpebbleTestCase):
"""Tests for the Tests models"... |
unica = [[], []]
for i in range(0, 7):
n1 = int(input(f"Digite o {i+1}º numero"))
if n1 % 2 == 0:
unica[0].append(n1)
else:
unica[1].append(n1)
unica[0].sort()
unica[1].sort()
print(f"Numeros pares digitados: {unica[0]}")
print(f"Numeros impares digitados: {unica[1]}")
|
# -*- coding: utf-8 -*-
"""
"""
import os, io, sys
import re
import json
import time
# import pprint
from copy import deepcopy
from datetime import datetime
from typing import Union, Optional, Any, List, Dict, Tuple, Set, Sequence, NoReturn
from numbers import Real, Number
import numpy as np
np.set_printoptions(precis... |
#!/usr/bin/env python2
# Copyright (c) 2017 The Zcash developers
# Copyright (c) 2017-2018 The SnowGem developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from ... |
# coding=utf-8
from unittest import TestCase
from similarityPy.measure.string_data.edit_distance import SimilarityMeasure
from tests import test_logger
__author__ = 'cenk'
class SimilarityMeasureTest(TestCase):
def test_algorithm(self):
test_logger.debug("SimilarityMeasureTest - test_algorithm Starts"... |
"""
==========================================================
Sample pipeline for text feature extraction and evaluation
==========================================================
The dataset used in this example is the 20 newsgroups dataset which will be
automatically downloaded and then cached and reused for the d... |
from django.apps import AppConfig
class BookConfig(AppConfig):
name = 'book'
verbose_name = '图书管理' |
from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class BoolTests(TranspileTestCase):
def test_bool_omitted(self):
self.assertCodeExecution("""
print(bool())
""")
def test_bool_like(self):
self.assertCodeExecution("""
class BoolLike:
... |
import FWCore.ParameterSet.Config as cms
SinglePhotonJetPlusHOFilterSkim = cms.EDFilter("SinglePhotonJetPlusHOFilter",
Photons = cms.InputTag("photons"),
PFJets = cms.InputTag("ak4PFJets"),
particleFlowClusterHO = cms.InputTag("particleFlowClusterHO"),
Ptcut = cms.untracked.double(90.0),
Etacut =... |
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... |
import tweepy
from tweepy import OAuthHandler
import os
import json
from timeit import default_timer as timer
class Twitter:
def __init__(self, cfg):
"""
:param cfg: Hydra config for Twitter API
"""
auth = OAuthHandler((cfg.get('consumer_key', os.environ.get('CONSUMER_KEY'))),
... |
"""final_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/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')
Cla... |
import unittest
import os
import shutil
import pandas as pd
from pprint import pprint
from ds_discovery import SyntheticBuilder, Transition
from ds_discovery.components.commons import Commons
from ds_discovery.intent.synthetic_intent import SyntheticIntentModel
from aistac.properties.property_manager import PropertyMa... |
#!/usr/bin/python3
from datetime import datetime
import sys
import numpy as np
import matplotlib.pyplot as plt
try:
if sys.argv[1]:
fileName = sys.argv[1]
except IndexError:
print("Using default file name.")
fileName = 'loglistener.txt'
f = open(fileName,"r")
f2 = open(fileName,"r")
#f.close()
def get_ip(id):
... |
# --------------------------------------------------------
# Subcategory CNN
# Copyright (c) 2015 CVGL Stanford
# Licensed under The MIT License [see LICENSE for details]
# Written by Yu Xiang
# --------------------------------------------------------
from __future__ import absolute_import
import numpy as np
import ma... |
# Generated by Django 1.9 on 2016-02-21 15:43
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('evaluation', '0042_populate_single_result_participant_count'),
]
operations = [
migrations.AlterField(
... |
# flake8: noqa: F401, F403
from .base import *
DEBUG = True
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}
|
from gym_fearbun.envs.raceboard import RaceboardEnv |
#!/usr/bin/env python
#
# This is a module that gathers a list of serial ports on POSIXy systems.
# For some specific implementations, see also list_ports_linux, list_ports_osx
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C) 2011-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Ident... |
# Copyright (c) 2016-2017, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
from asyncio import Event
from aiorpcx import _version as aiorpcx_version, TaskGroup
import electrumx
from electrumx.lib.server_base import ServerBase
... |
import json
import socket
import argparse
import random
from properties import BUFFER_SIZE, PUT, GET, QUERY, DELETE, ERROR, BAD_SYNTAX, NOT_FOUND, REPLICA_IS_DOWN, \
CANNOT_EXECUTE, CANNOT_GUARANTEE_CORRECT_OUTPUT, OK, WARNING
from utils import print_response
def check_method(method: str) -> bool:
if method ... |
import os
import pytest
from flaky.flaky_decorator import flaky
from funcy import first, get_in
from dvc import api
from dvc.exceptions import FileMissingError, OutputNotFoundError
from dvc.path_info import URLInfo
from dvc.utils.fs import remove
from tests.unit.fs.test_repo import make_subrepo
cloud_names = [
"... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRviennacl(RPackage):
"""RViennaCL: 'ViennaCL' C++ Header Files"""
homepage = "https:... |
#!/usr/bin/env python3
# Copyright (c) 2020 The PIVX developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Tests importprivkey and importaddress with staking keys/addresses.
Node0 generates staking addresses and sends del... |
"""Module for checking Litecoin addresses"""
from address_checkers.abs_address_checker import AbsAddressChecker
class XmrAddressChecker(AbsAddressChecker):
"""Monero address checker"""
def address_check(self, address: str) -> bool:
"""This function simply returns False because
we have no way ... |
# coding: utf-8
# 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, software
# dist... |
import os
import subprocess
import sys
if sys.version_info.major == 3 and sys.version_info.minor > 5:
# good
print(sys.version)
else:
print("Error: stix-shifter requires python version at least or greater than 3.6")
exit(1)
from generate_requirements import generate_requirements
generate_requirements... |
from collections import defaultdict, Counter
from itertools import starmap
from operator import sub
from adventofcode.inputs import get_input
from adventofcode.utils import aoc_timer
def parse_input(input_str):
jolts = list(map(int, input_str.splitlines()))
jolts.extend([0, max(jolts) + 3])
return sorted... |
"""
Hello world!
3D rotating planet - with text
Ursina Lesson 1.1
"""
from ursina import *
app = Ursina()
planet = Entity(model='sphere', texture='earth')
planet.scale = 4
message = Text('<bold>hello world!',background=True)
message.scale=2
message.background.color=color.lime
message.appear(speed=0.1)
def update()... |
import torch
import numpy as np
import os
from PIL import Image
from models.dynamic_channel import set_uniform_channel_ratio, reset_generator
import models
import time
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
# settings
# for attributes to use, modify the load_asse... |
import re
from typing import Any, Dict, List, Optional, Set, Tuple, cast
from django.utils import timezone
from rest_framework import exceptions
from ee.clickhouse.client import sync_execute
from ee.clickhouse.materialized_columns.columns import TableWithProperties, get_materialized_columns
from ee.clickhouse.models.... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
from __future__ import abso... |
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.http import HttpResponse
from django.views import defaults as default_views
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
schema_... |
import genomicsqlite
def test_bundled_extensions():
con = genomicsqlite.connect(":memory:")
con.executescript(
"""
CREATE TABLE test(json TEXT);
INSERT INTO test(json) VALUES('{"chrom":"chr10"}');
INSERT INTO test(json) VALUES('{"chrom":"chr2"}');
INSERT INTO test(json... |
import datetime
import json
from django.db import models
from django.db.models.fields import BooleanField, related
from django.db.models.query_utils import select_related_descend
from database.utils.constants import *
from .utils.common import json_loader, get_json_if_not_none, get_summary_info
from django.forms.models... |
# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... |
#!/usr/bin/env python3
import re
import sys
from typing import Dict, List, Optional
class Callgraph:
def __init__(self):
self.nodes = {} # type: Dict[str, List[str]]
def add_edge(self, node_from: str, node_to: str):
if node_from not in self.nodes:
self.nodes[node_from] = []
... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Created by eeliu at 12/29/20
# ******************************************************************************
# Copyright 2020. NAVER Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with t... |
class FasterContent:
def __init__(self, path):
self.path = path
self.alpha = 1.0
self.content_conv1_1_check = False
self.content_conv1_1_weight = 1.0
self.content_conv1_2_check = False
self.content_conv1_2_weight = 1.0
self.content_pool1_check = False
self.content_pool1_weight = 1.0
self.content_conv... |
from typing import List, Optional
from app.data_models.answer_store import AnswerStore
from app.data_models.relationship_store import RelationshipStore
from app.questionnaire.relationship_location import RelationshipLocation
class RelationshipRouter:
UNRELATED_RELATIONSHIP_VALUE = "Unrelated"
def __init__(
... |
# -*- coding: utf-8 -*-
# Scrapy settings for unicode_icon project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://doc.scrapy.org/en/latest/topics/settings.html
# https://doc.scrapy.org/en/latest/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.