text stringlengths 2 999k |
|---|
from dagster import check
from dagster.core.definitions import ExpectationResult, Materialization, Output, Solid, SolidHandle
from dagster.core.errors import DagsterInvariantViolationError
from dagster.core.execution.context.compute import SolidExecutionContext
from dagster.core.execution.context.system import SystemCo... |
# --------------
# import libraries
import numpy as np
import pandas as pd
import re
# Load data
data = pd.read_csv(path, parse_dates=[0], infer_datetime_format=True)
# Sort headlines by date of publish
data.sort_values('publish_date', inplace=True)
# Retain only alphabets
data['headline_text'].apply(lambda x:re.sub... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
from abc import (
ABCMeta,
abstractmethod
)
import six
from .util import _parse_name
NOT_IMPLEMENTED_MESSAGE = "Galaxy tool format does not yet support this tool feature."
@six.python_2_unicode_compatible
@six.add_metaclass(ABCMeta)
class ToolSource(object):
""" This interface represents an abstract so... |
import unittest
from rdbtools3.intset import unpack_intset
from rdbtools3.exceptions import RDBValueError
class TestIntset(unittest.TestCase):
def test_3x2bytes(self):
val = (b'\x02\x00\x00\x00' # int size
b'\x03\x00\x00\x00' # set length
b'\x01\x00' # item 1
... |
#!/bin/python
class ActionRecord(object):
def __init__(self, playerid, action):
self.__playerid__ = playerid
self.__action__ = action
def __get_playerid__(self):
return self.__playerid__
playerid = property(__get_playerid__)
def __get_action__(self):
return self.__ac... |
# -*- coding: utf-8 -*- #
# Copyright 2013 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 requir... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2021 Red Hat
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: validate_argument_spec
short_descript... |
import time
import pickle
from sklearn.svm import LinearSVC
from sklearn.metrics import f1_score
from sklearn.metrics import accuracy_score
from sklearn.metrics import classification_report
from sklearn.feature_extraction.text import TfidfVectorizer
from toiro import tokenizers
from toiro import classifiers
class ... |
# Generated by Django 2.0.4 on 2018-04-09 15:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('user_profile', '0003_merge_20180110_1837'),
]
operations = [
migrations.AlterField(
model_name=... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# copyright 2014 Hamilton Kibbe <ham@hamiltonkib.be>
# Modified from code by Paulo Henrique Silva <ph.silva@gmail.com>
# 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 ... |
import math
from abc import ABC, abstractmethod
from dataclasses import dataclass
import numpy as np
from camera import CameraConfig
@dataclass
class TriangulationConfig(object):
"""
Class designed to produce config triangulation object.
Arguments:
down_cam_config config obje... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, bitcoind will dump mempool on shutdown and
then reload it on sta... |
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
"DJANGO_SECRET_KEY... |
"""
Validate and coerce event resource parameters
"""
from . import AuthnValidator, to_bool
auth0 = {
'tenant': {'type': 'string', 'readonly': True, 'empty': False},
'service_token': {'type': 'string', 'readonly': True},
'name': {'type': 'string'},
'audience': {'type': 'string', 'rename': 'identifier',... |
"""
Copyright (c) 2016-2020 Keith Sterling http://www.keithsterling.com
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, m... |
# -*- coding: utf-8 -*-
# Copyright 2017 IBM RESEARCH. 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 requ... |
from .settings import *
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'gs',
'USER': 'root',
'PASSWORD': 'mysqldb',
'HOST': '127.0.0.1',
'PORT': '3306',
}
}
|
# The MIT License
#
# Copyright 2020 UB Dortmund <daten.ub@tu-dortmund.de>.
#
# 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
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2020 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://trac.edgewall.org/wiki/TracLicense.
#
# This soft... |
import loopy as lp
import numloopy as nplp
np = nplp.begin_computation_stack()
A = np.arange(9).reshape((3, 3))
x = np.arange(3)
y = np.sum(A * x, axis=1)
knl = np.end_computation_stack([A, x, y])
print(lp.generate_code_v2(knl).device_code())
|
"""
Base class for equipment that use the SDK provided by the manufacturer for the connection.
"""
from msl.loadlib import LoadLibrary
from .connection import Connection
class ConnectionSDK(Connection):
def __init__(self, record, libtype, path=None):
"""Base class for equipment that use the SDK provided... |
from ..player import Player
from ...utils import check_random_state
class RandPlayer(Player):
name = 'RandPlayer'
def __init__(self, random_state=None):
self.random_state = check_random_state(random_state)
def __str__(self):
return 'RandPlayer'
def __repr__(self):
return 'R... |
#! python3
# Scrapes the websites of Berkeley establishments known to occasionally offer pesto,
# searching for the presence of aforementioned pesto (the holiest of all sauces).
# Currently-searched businesses include the UCB dining commons, Cheese Board,
# and Sliver Pizzeria.
import re, sys
from selenium import web... |
# Pillow para manipulação de imagem
from PIL import Image
## import Matplotlib
import matplotlib.pyplot as pp
class Extract:
def __init__(self):
pass
@staticmethod
def extract_feature(img, show):
# características de extração
character_one_feature_one = 0 # Abu - Cor da Pele
... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/deed/pet_deed/shared_gurreck_deed.iff"
result.attribute_template_id... |
from umap import UMAP
from sklearn.datasets import make_blobs
from nose.tools import assert_greater_equal
from nose import SkipTest
import pytest
import numpy as np
try:
# works for sklearn>=0.22
from sklearn.manifold import trustworthiness
except ImportError:
# this is to comply with requirements (scikit-... |
import inspect
import io
import re
from pathlib import Path
from pdb import Pdb, getsourcelines
import sqlparse
from rich import box, markup
from rich._inspect import Inspect
from rich.console import Console
from rich.panel import Panel
from rich.pretty import pprint
from rich.syntax import DEFAULT_THEME, Syntax
from ... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# 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... |
# Copyright (c) 2018 - 2020 Advanced Micro Devices, Inc. All rights reserved.
#
# 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
# ... |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin test... |
"""Helper to test significant Light state changes."""
from __future__ import annotations
from typing import Any
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.significant_change import check_absolute_change
from . import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_EFFECT,
... |
#!/usr/bin/env python
#
# This script will migrate a single user from the old system to the new one. This will
# reset the users password in the process - there is no way around that.
#
# This process is automatically done when the user logs in to the new website, but it
# is useful to do this if the user has lost his ... |
import pygame
my_cursors = {}
def record_cursor(name, center, strings):
data, mask = pygame.cursors.compile(strings)
my_cursors[name] = ((len(strings),) * 2, center, data, mask)
record_cursor(
"square",
(4, 4),
(
"XXXXXXXX",
"X X",
"X X",
"X X",
... |
from rlgym.utils.reward_functions import RewardFunction
from rlgym.utils import math
from rlgym.utils.gamestates import GameState, PlayerData
import numpy as np
# THIS REWARD IS FOR DEMONSTRATION PURPOSES ONLY
class DefaultReward(RewardFunction):
def __init__(self):
super().__init__()
se... |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 26 14:29:11 2018
@author: Christian Bender
@license: MIT-license
This module contains some useful classes and functions for dealing
with linear algebra in python.
Overview:
- class Vector
- function zeroVector(dimension)
- function unitBasisVector(dimension,pos)
- func... |
import requests
import pandas as pd
import re
class FeatureServerOverview:
"""
Class used to find all the available featureservers in mapservices.
This can be used to navigate the API through python, allowing some more efficient searching.
"""
def __init__(self):
self.prefix = 'https://map... |
"""
Django settings for portfolio project.
Generated by 'django-admin startproject' using Django 3.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... |
# Copyright (c) 2007-2009 Thomas Herve <therve@free.fr>.
# See LICENSE for details.
"""
Tests for erlang protocol and parsing.
"""
|
from .._abstract import AbstractScraper
from ..utils import scrape_page, Crawler, get_int_from_string
import re
class UniversityOfSydney(AbstractScraper):
def __init__(self):
self.name = "University of Sydney"
super().__init__()
@staticmethod
def abbreviation():
return "USYD"
... |
from __future__ import print_function
import argparse
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torchvision.util... |
"""Utility tools"""
from .util import columns, data, units
|
# uncompyle6 version 3.2.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: lib.coginvasion.minigame.UnoGameHeadPanel
from panda3d.core import *
from direct.gui.DirectGui import *
from lib.coginvasion.toon.ToonHe... |
from __future__ import division
from numpy import zeros, float64, diff, sum, array
from numpy.linalg import norm
from pynurbs.geometry.point import Point
def uniform(pnts, a=0., b=1.):
"""
Generate a uniform parameters.
:param pnts: 1D set of ordered points.
:etype pnts: Points or array_like
:p... |
from typing import Union, List, Tuple, Callable
import torch
import torch.nn as nn
from torch import Tensor
import numpy as np
def get_gaussian_kernel(k=3, mu=0, sigma=3, normalize=True):
# compute 1 dimension gaussian
gaussian_1D = np.linspace(-1, 1, k)
# compute a grid distance from center
x, y = n... |
import dataclasses
import logging
import time
from collections import Counter
from typing import Optional
from aloe.protocols.protocol_message_types import ProtocolMessageTypes
from aloe.server.outbound_message import Message
log = logging.getLogger(__name__)
@dataclasses.dataclass(frozen=True)
class RLSettings:
... |
# -*- coding: utf-8 -*-
from threading import Thread
from logging import getLogger
import queue
from threading import Lock
logger = getLogger(__name__)
class WorkerThread(Thread):
def __init__(self, task_queue, *args, **kwargs):
super(WorkerThread, self).__init__(*args, **kwargs)
self._task_que... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-18 02:48
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0009_user_dummy_user'),
]
operations = [
migrations.AddField(
... |
import unittest
import os
from cate.core.wsmanag import FSWorkspaceManager
from cate.util.monitor import Monitor
from cate.webapi.websocket import WebSocketService
class WebSocketServiceTest(unittest.TestCase):
def setUp(self):
self.service = WebSocketService(FSWorkspaceManager())
@unittest.skipIf(o... |
#!/usr/bin/env python
import os, sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wtfhack.settings")
# Add the lib/ directory to the system path
sys.path.append("lib")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
from __future__ import absolute_import
from django import forms
from django.utils.translation import ugettext_lazy as _
from sentry.models import AuditLogEntry, AuditLogEntryEvent, Project
from sentry.utils.samples import create_sample_event
BLANK_CHOICE = [("", "")]
class AddProjectForm(forms.ModelForm):
nam... |
from hyp.schematics import Responder as SchematicsResponder
from hyp.collector import Collector
from fixtures import PostResponder, PostSerializer, CommentResponder
from hyp.constants import JSONAPI_VERSION_DICT
class TestCollectorInternal(object):
def test_collect_gather_links_unique(self):
c = Collecto... |
"""
Question:
Given a root of a tree, and an integer k. Get all the nodes which are at k distance from root.
For example:
__1__
/ \
2 3
/ \ / \
4 5 1 2
/
9
Distance: 2
Output: [4, 5, 1, 2].
"""
from binarytree import Node
from unittest import TestCase
def find_notes_at_di... |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
from __future__ import print_function
import sys
from Game import Game
from .GobangLogic import Board
import numpy as np
class GobangGame(Game):
def __init__(self, n=15, nir=5):
self.n = n
self.n_in_row = nir
def getInitBoard(self):
# return initial board (numpy board)
b = Bo... |
from ._fastfood import Fastfood
__all__ = ["Fastfood"]
|
import json
import os
from hipjoiner.jcl.config import config
from hipjoiner.jcl.posts import posts
class Job:
home = '/'.join([config.home, 'jobs'])
def __init__(self, name, create=False):
self.name = name
if create:
if os.path.exists(self.fpath):
raise ValueErro... |
"""
===============
The Solar Cycle
===============
This example shows the current and possible next solar cycle.
"""
import datetime
import matplotlib.pyplot as plt
import sunpy.lightcurve as lc
from sunpy.data.sample import NOAAINDICES_LIGHTCURVE, NOAAPREDICT_LIGHTCURVE
############################################... |
import shade
shade.simple_logging(debug=True)
cloud = shade.openstack_cloud(cloud='my-citycloud', region_name='Buf1')
try:
server = cloud.create_server(
'my-server', image='Ubuntu 16.04 Xenial Xerus',
flavor=dict(id='0dab10b5-42a2-438e-be7b-505741a7ffcc'),
wait=True, auto_ip=True)
prin... |
# Generated by Django 3.0.6 on 2020-05-31 17:36
from django.db import migrations, models
import gdstorage.storage
class Migration(migrations.Migration):
dependencies = [
('InjectionLog', '0026_auto_20200531_1730'),
]
operations = [
migrations.AlterField(
model_name='bloodwor... |
import _plotly_utils.basevalidators
class RadiusValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="radius", parent_name="densitymapbox", **kwargs):
super(RadiusValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
#!/usr/bin/env python3
#
# Copyright (c) 2021, NVIDIA CORPORATION. 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
#
# ... |
"""Irrigation Unlimited Coordinator and sub classes"""
from datetime import datetime, time, timedelta
from types import MappingProxyType
from typing import OrderedDict
import homeassistant
from homeassistant.core import HomeAssistant, CALLBACK_TYPE
from homeassistant.helpers.entity import Entity
from homeassistant.help... |
''' unit test for Ansible module: na_elementsw_cluster_config.py '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import pytest
from ansible_collections.netapp.elementsw.tests.unit.compat import unittest
from ansible_collections.netapp.elementsw.tests.unit.compat... |
# Copyright 2014-2017 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... |
def vanakkam():
print '''
##################################################
# Tool : pscan #
# Version : 1.6 #
# Coded with Python 2.7 #
# Profile : https://github.com/pr2h/ #
############################... |
#!/usr/bin/env python
#
# VMEncryption extension
#
# Copyright 2015 Microsoft Corporation
#
# 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
#
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2020, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
#"""
#ADF NMR Output Editor
##############################
#Editor class for parsing the NMR data from an ADF calculation
#"""
#from __future__ import absolute_import
#from __future_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2020 all rights reserved
#
"""
Verify that compatibility among protocols is detected correctly
"""
def test():
import pyre
# declare a couple of protocols
class base(pyre.protocol):
"""the base proto... |
import os
import numpy as np
from src.learn.bots.PolicyBot import PolicyBot
import src.learn.bots.utils as utils
from src.play.model.Game import WHITE, BLACK
class Bot_32(PolicyBot):
def get_path_to_self(self):
return os.path.abspath(__file__)
@staticmethod
def generate_nn_input(flat_board, color... |
#
# Copyright (c) 2012 Patrice Munger
# This file is part of pynetdicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pynetdicom.googlecode.com
#
import dsutils
from DIMSEparameters import *
import DIMSEprovider
import ACSEprovider
i... |
# 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) AutoRest Code Generator.
# Changes ... |
"""
Django settings for btre project.
Generated by 'django-admin startproject' using Django 2.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... |
# Fazer um programa que leia 3 numeros, e mostrar qual o maior e qual o menor
n1 = int(input('Numero 1: '))
n2 = int(input('Numero 2: '))
n3 = int(input('Numero 3: '))
maior = n1
if (n2 > maior):
maior = n2
if (n3 > maior):
maior = n3
print('Maior: ', maior)
menor = n1
if (n2 < menor):
menor = n2
if (n3... |
from django.db import models
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser
from jsonfield import JSONField
class UserManager(BaseUserManager):
def create_user(self, email, full_name, password=None):
if not email:
raise ValueError('Users must have an email address')
... |
from django.urls import path, include
from katalog import views
urlpatterns = [
# path('addstreetroad/', views.AddstreetroadList.as_view()),
path('', views.index, name='index'),
path('books/', views.BookListView.as_view(), name='books'),
path('book/<int:pk>', views.BookDetailView.as_view(), name='bo... |
import sys
import os
PACKAGE_PARENT = '..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(
os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT)))
def test_sample_graph():
from helpers.samples import SampleGraph
sample_graph = S... |
"""Tests for the SIPAuthServe component.
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same dire... |
#!/home/smoucha/Desktop/projects/pawards/venv/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
|
# -*- coding: utf-8 -*-
# Copyright (C) 2010-2013 Tobias Weber <tobi-weber@gmx.de>
#
# 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 ... |
from __future__ import annotations
from typing import Dict
from typing import Iterable
from typing import List
from typing import NewType
from typing import Tuple
from typing import TypeVar
from typing import Union
AllowedContainers = Union[Dict, List]
Name = NewType('Name', str)
UserId_NT = NewType('UserId_NT', st... |
import requests
from bs4 import BeautifulSoup
news_data_total = list()
def soupMake(url):
res = requests.get(url)
html_text = res.text
return BeautifulSoup(html_text, 'html.parser')
def newsScraping(soup):
news_lis = soup.select('#main_pack > section > div > div.group_news > ul > li')
count = 1
... |
import requests as http
from lib.connect import SpotifyConnect
from lib.network import get_next_song
from multiprocessing import Process, Queue
from subprocess import Popen
from lib.play import play_loop
import time
import os
import sys
os.environ['TOKEN'] = ''
Popen(['python', 'server.py'])
url = 'http://127.0.0.1:50... |
from http.server import ThreadingHTTPServer, HTTPServer, BaseHTTPRequestHandler
from http import cookies
import ssl
from io import BytesIO
import json
import secrets
import datetime as dt
import jwt
import copy
from jwt import encode, decode
from datetime import datetime, timedelta
from eth_account import Account
from... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals
from collections import OrderedDict
from brainstorm.layers.base_layer import Layer
from brainstorm.structure.buffer_structure import (BufferStructure,
StructureTemp... |
__version__ = "1.0.0-wip"
|
import json
import os
import argparse
import scipy.stats as stats
import numpy as np
import pandas as pd
import torch
import random
import sys
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import time
import torch.utils.data as data
from sklearn.model_selection import StratifiedKFold
from collect... |
# -*- coding: utf-8 -*-
from django.shortcuts import render
from resume import settings
from .models import Persona, Curriculum, Project
def index(request):
personas = Persona.objects.all()
curriculum = Curriculum.objects.all()
if curriculum:
curriculum = curriculum[0]
projects = Project.obje... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import csv
import argparse
import sys
import os
import logzero
from logzero import logger as log
from locale import strxfrm
#### Config ####
# CLI Params
parser = argparse.ArgumentParser("generic_csv_exporter.py")
parser.add_argument("--loglevel", help="DEBUG, INFO, ERRO... |
import _plotly_utils.basevalidators
class UpValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='up', parent_name='layout.scene.camera', **kwargs
):
super(UpValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... |
from .base_collection import BaseCollection
from .settings import Settings
from .exceptions import PocketMongoConfigError, PocketMongoCollectionNotDefined
__all__ = [
'BaseCollection',
'PocketMongoConfigError',
'PocketMongoCollectionNotDefined',
'Settings',
]
|
n = int(input())
s = set(map(int, input().split()))
lines = int(input())
for i in range(lines):
query = input()
if query == 'pop': s.pop()
elif 'remove' in query:
q = query.split()
s.remove(int(q[1]))
elif 'discard' in query:
q = query.split()
s.discard(int(q[1]))
... |
"""
Django settings for tutorial_python project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
i... |
import pytest
from danger_python.exceptions import DangerfileException, SystemConfigurationException
from danger_python.shell import (
build_danger_command,
execute_dangerfile,
resolve_danger_path,
)
@pytest.mark.parametrize("danger_js_path", ["/usr/bin/fake-danger-js \n \r"])
@pytest.mark.usefixtures("r... |
"""
Util functions for manipulating images in artifice.
"""
import numpy as np
from PIL import Image
from skimage import draw
from artifice.log import logger # noqa: F401
"""
Basic image utilities.
"""
def grayscale(image):
"""Convert an n-channel, 3D image to grayscale.
Use the[luminosity weighted average]... |
# 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... |
"""
This is a manual implementation of (Point-to-point) ICP, it is not as optimized
as Open3D's nor does as fully-featured.
It's also quite slow.
"""
import numpy as np
from scipy.spatial.distance import cdist
from scanner3d.exceptions import PointCloudSizeMismatch
def find_transform(pcd1, pcd2):
center_pcd1 =... |
#!/usr/bin/env python
import optparse
import os
import sys
chplenv_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.abspath(chplenv_dir))
import chpl_platform
from utils import memoize
@memoize
def get(flag='host'):
if flag == 'host':
mem_val = 'cstdlib'
elif flag == 'target':
mem_... |
"""
Just run optimal pricing in simple situations
"""
# import packages
from tqdm import tqdm
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import json
from importlib import reload
import os
import sys
from other_functions import get_social_welfare
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.