text stringlengths 2 999k |
|---|
from __future__ import print_function
"""
Created on Wed Apr 22 16:02:53 2015
Basic integrate-and-fire neuron
R Rao 2007
translated to Python by rkp 2015
"""
import numpy as np
import matplotlib.pyplot as plt
import sys
# input current
I = 1 # nA
# capacitance and leak resistance
C = 1 # nF
R = 40 # M ohms
# I ... |
# -*- coding: utf-8-*-
import sys, os, time, random
import re
import json
import argparse
import logging
import psutil
from multiprocessing import Process, Queue, Pipe
from lib.graphic.baiduGraphic import BaiduGraphic
from lib.voice.baiduVoice import BaiduVoice
from lib.voice.baseVoice import AbstractVoiceEngine
from ... |
# coding: utf-8
"""
ELEMENTS API
The version of the OpenAPI document: 2
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from elements_sdk.configuration import Configuration
class TapeLibraryEndpointResponse(object):
"""NOTE: This class is auto ge... |
from splinter import Browser
from bs4 import BeautifulSoup
import pandas as pd
import datetime as dt
def init_browser():
executable_path = {"executable_path": "/usr/local/bin/chromedriver"}
# return Browser("chrome", executable_path, headless=False)
return Browser("chrome", **executable_path, headless=Tr... |
import random
from hashlib import md5
from faker import Faker
from six import with_metaclass
from pganonymizer.exceptions import InvalidProvider, InvalidProviderArgument
PROVIDERS = []
fake_data = Faker()
def get_provider(provider_config):
"""
Return a provider instance, according to the schema definition... |
from nothing.main import Nothing
Nothing = Nothing() |
import re
import itertools
from lxml import html
from scrapy.http.request.form import _get_inputs
class GenericForm:
def __init__(self, **kwargs):
self.kwargs = kwargs
def _pick_node(self, doc, selector):
nodes = doc.xpath(selector['xpath'])
if nodes:
return nodes[0]
... |
from unittest import mock
import pytest
from django import forms
from django.template import Context, Template, TemplateSyntaxError
from tapeforms.mixins import TapeformMixin
class DummyForm(TapeformMixin, forms.Form):
my_field1 = forms.CharField()
class TestFormTag:
@mock.patch('tapeforms.templatetags.ta... |
"""
Definition of ListNode
class ListNode(object):
def __init__(self, val, next=None):
self.val = val
self.next = next
"""
class Solution:
# @param node: the node in the list should be deleted
# @return: nothing
def deleteNode(self, node):
# write your code here
node.val... |
# Copyright 2016 F5 Networks Inc.
#
# 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 writi... |
from django.db import models
from utils.models import CampRelatedModel
from django.core.exceptions import ValidationError
import reversion
class InfoCategory(CampRelatedModel):
class Meta:
ordering = ["weight", "headline"]
verbose_name_plural = "Info Categories"
headline = models.CharField(
... |
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
gpus = '1'
import numpy
import tensorflow as tf
import logging
from tensorflow import logging as log
from collections import OrderedDict
from data_iterator import TextIterator
from tensorflow.contrib import rnn
import wa... |
try:
from . import generic as g
except BaseException:
import generic as g
class GraphTest(g.unittest.TestCase):
def setUp(self):
self.engines = ['scipy', 'networkx']
if g.trimesh.graph._has_gt:
self.engines.append('graphtool')
else:
g.log.warning('No graph-... |
import argparse
import logging
from aeromancer.db.models import Project
LOG = logging.getLogger(__name__)
class ProjectFilter(object):
"""Manage the arguments for filtering queries by project.
"""
@staticmethod
def add_arguments(parser):
"""Given an argparse.ArgumentParser add arguments.
... |
from django.core.management.base import BaseCommand
from django.db.models import Sum
from django.utils.translation import gettext as _
from mspray.apps.main.models.target_area import TargetArea
from mspray.apps.main.models.district import District
class Command(BaseCommand):
help = _('Load districts from TargetA... |
import pytube
url = 'https://www.youtube.com/watch?v=vxB0amY8BWs'
youtube = pytube.Youtube(url)
video = youtube.streams.first() # Establecer resolucion
video.donwload('../video') # Descargamos |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... |
from typing import List, Tuple, Any
from typed_ast import ast3 as ast
from ..utils.snippet import snippet, let
from .base import BaseNodeTransformer
@snippet
def return_from_generator(return_value):
let(exc)
exc = StopIteration()
exc.value = return_value
raise exc
class ReturnFromGeneratorTransforme... |
import tkinter as tk
infinity = 1000000000
class BinaryNode:
# Class-level drawing parameters.
node_radius = 10
x_spacing = 20
y_spacing = 20
def __init__(self, value):
self.value = value
self.left_child = None
self.right_child = None
# Drawing ... |
#!D:\Python Learning\DjangoCrudApplication\DjangoCrudApplication\env\Scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
|
from enum import Enum, unique
@unique
class ItemTag(Enum):
BLESS = "BLESS"
GLOW = "GLOW"
HUM = "HUM"
INVIS = "INVIS"
INSURED = "INSURED"
LIMITED = "LIMITED"
MAG = "MAG"
NO_DONATE = "!DONATE"
NO_DROP = "!DROP"
NO_LOCATE = "!LOCATE"
UNIQUE = "UNIQUE"
NO_JUNK = "!JUNK"
... |
# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** 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
from ... import me... |
# Generated by Django 3.1.5 on 2021-06-20 00:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('compras', '0006_auto_20210616_2025'),
]
operations = [
migrations.AddField(
model_name='facturadet',
name='detalle_c... |
# Copyright 2013-2022 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 RGridgraphics(RPackage):
"""Redraw Base Graphics Using 'grid' Graphics.
Functions to ... |
# -*- coding: utf-8 -*-
r"""
Families of graphs derived from classical geometries over finite fields
These include graphs of polar spaces, affine polar graphs, graphs
related to Hermitean unitals, graphs on nonisotropic points, etc
The methods defined here appear in :mod:`sage.graphs.graph_generators`.
"""
#########... |
'''
TACO: Multi-sample transcriptome assembly from RNA-Seq
'''
import os
import numpy as np
import h5py
import matplotlib.pyplot as plt
from taco.lib.base import Strand, Exon
from taco.lib.dtypes import FLOAT_DTYPE
from taco.lib.splice_graph import SpliceGraph
from taco.lib.path_graph import PathGraphFactory, reconstr... |
"""Assignment 01: Project box to xy-plane
"""
from compas.geometry import Box
from compas.geometry import Frame
from compas.geometry import Projection
from compas.artists import Artist
from compas.datastructures import Mesh
from compas.geometry import Plane
# Define a Frame, which is not in the origin and a bit tilted... |
from rest_framework import serializers
from .models import gemsMeta
class AttributeSerializer(serializers.ModelSerializer):
class Meta:
model = gemsMeta
fields = ['name', 'description', 'image'] |
# (c) Copyright [2017] Hewlett Packard Enterprise Development LP
#
# 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... |
#!/usr/bin/env python3
import tensorflow as tf
from flows.squeeze import Squeeze, Squeeze2DWithMask
class Squeeze2DTest(tf.test.TestCase):
def setUp(self):
super().setUp()
self.squeeze = Squeeze2DWithMask()
def testSqueezeWithOutAnythng(self):
x = tf.random.normal([32, 16, 8])
... |
# -*- coding: utf-8 -*-
'''
Control virtual machines via Salt
'''
# Import python libs
from __future__ import absolute_import, print_function
import os.path
import logging
# Import Salt libs
import salt.client
import salt.utils.virt
import salt.utils.cloud
import salt.key
from salt.exceptions import SaltClientError
... |
"""
WSGI config for fitlog_32927 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/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... |
# coding: utf-8
from youtube_video_url.youtube import get_youtube_urls
|
from typing import Any, Callable, Tuple
from dace.dtypes import paramdec
class Replacements(object):
""" A management singleton for functions that replace existing function calls with either an SDFG or a node.
Used in the Python frontend to replace functions such as `numpy.ndarray` and operators such
... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import confusion_matrix
from sklearn import metrics
... |
from .pyoptic import *
|
#header to convert outputs of model into boxes, scores, classes, valid
import tensorflow as tf
import numpy as np
def YoloV4Header(num_classes, anchorlist, mask, strides,
max_outputs, iou_threshold, score_threshold,inputs):
boxes, objects, classes = [], [], []
dtype = inputs[0].dtype
... |
# Copyright 2010-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... |
"""PyPi Version."""
__version__ = "0.3.2"
|
from django import forms
PROBLEM_REQ_FILENAME = 'filename'
PROBLEM_REQ_DATA = 'data'
class SaveProblemForm(forms.Form):
"""Test gRPC requests, as originating from the UI"""
filename = forms.CharField()
data = forms.CharField(widget=forms.Textarea,
initial='',
... |
#!/usr/bin/python
# Software License Agreement (BSD License)
#
# Copyright (c) 2013, Juergen Sturm, TUM
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must... |
# 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 ... |
# Copyright 2011 OpenStack Foundation
# 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 django.db import models
# Create your models here.
class Image(models.Model):
image_name = models.CharField(max_length=30)
image_description = models.CharField(max_length=255)
image_location = models.ForeignKey('Location',on_delete=models.CASCADE)
image_category = models.ForeignKey('Category',on_... |
from kf_d3m_primitives.interpretability.shap_explainers.shap_values_pipeline import ShapPipeline
def _test_fit_produce(dataset):
pipeline = ShapPipeline()
pipeline.write_pipeline()
pipeline.fit_produce(dataset)
pipeline.delete_pipeline()
def test_fit_produce_dataset_baseball():
_test_fit_prod... |
from typing import Optional, Tuple
from ..utils.events import EventedModel
from ._viewer_constants import CursorStyle
class Cursor(EventedModel):
"""Cursor object with position and properties of the cursor.
Attributes
----------
position : tuple or None
Position of the cursor in world coordi... |
from typing import Dict, List, Optional, Union
class Activities:
def __init__(self, swarm):
self.swarm = swarm
def get(self,
*,
change: Optional[int] = None,
stream: Optional[str] = None,
category: Optional[str] = None,
after: Optional[int]... |
"""
Application Errors
"""
class ApplicationError(Exception):
def __init__(self, message, code):
self.message = message
self.code = code
super(Exception, self).__init__(message)
class InvalidJSON(ApplicationError):
def __init__(self):
ApplicationError.__init__(self,
... |
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified).
__all__ = ['say_hello', 'HelloSayer']
# Cell
def say_hello(to):
"Say hello to somebody."
return f'Hello {to}!'
# Cell
class HelloSayer:
"Say hello to `to` using `say_hello`"
def __init__(self, to): self.to = to
... |
# nuScenes dev-kit.
# Code written by Holger Caesar, Varun Bankiti, and Alex Lang, 2019.
import json
import numpy as np
from matplotlib import pyplot as plt
from nuscenes import NuScenes
from nuscenes.eval.detection.constants import TP_METRICS, DETECTION_NAMES, DETECTION_COLORS, TP_METRICS_UNITS, \
PRETTY_DETECT... |
#!/bin/python
from functools import wraps
def trace(func):
@wraps(func)
def wrapper(*args, **kwargs):
result = func(*args, **kwargs)
print('%s(%r, %r) -> %r' %
(func.__name__, args, kwargs, result))
return result
return wrapper
|
import sys
import os
import struct
import datetime
from panda3d.core import PandaSystem
class SystemAnalyzer():
""" Small tool to analyze the system and also check if the users panda
build is out of date. """
@classmethod
def analyze(self):
""" Analyzes the user system. This should help deb... |
# coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. 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://ww... |
import configuration.configuration_time_line as timeline
default_Line = \
{
"TYPE":2,
"F_BUS":1,
"T_BUS":2,
"BR_R":0.3,
"BR_X":0.4,
"BR_B":0,
"RATE_A":5000,
"RATE_B":1000,
"RATE_C":10000,
"TAP":1,
"SHIFT":0,
"STATUS":1,... |
from datetime import datetime, timedelta, timezone
from unittest.mock import MagicMock
from airflow import DAG
from airflow.models.taskinstance import TaskInstance
import util.operator_util as op_util
class PickleMock(MagicMock):
def __reduce__(self):
return (MagicMock, ())
def test_get_runner_operato... |
from __future__ import print_function
import os
import sys
if __name__ == '__main__':
me = __file__
path = os.path.realpath(me)
sys.path.append(os.path.dirname(os.path.dirname(path)))
os.environ['DJANGO_SETTINGS_MODULE'] = 'astrometry.net.settings'
import settings
import django
django.setup()
from astrometr... |
import sounddevice as sd
from scipy.io.wavfile import write
from predictProcess import *
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D, LSTM
from keras.utils import to_categorical
import wandb
from wandb.keras import WandbCallback
from numpy impo... |
from .matric_util import fast_hist, per_class_iu, fast_hist_crop
|
from .base import Serializer, SqlReader, NameCompare
from .engine import Engine
from opendp.smartnoise_t._ast.tokens import Literal
from opendp.smartnoise_t._ast.expressions.numeric import BareFunction
class SparkReader(SqlReader):
ENGINE = Engine.SPARK
def __init__(self, conn, **kwargs):
super().__... |
import os
import pandas as pd
def get_index_queries():
r''' Run before everything to speed up things
'''
return ['CREATE INDEX patientId FOR (p:Patient) ON (p.patientId);',
'CREATE INDEX conceptId FOR (c:Concept) ON (c.conceptId);',
'CREATE INDEX documentId FOR (d:Document) ON (d.d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##Text Classification Model using TF-IDF.
#First, import the MultinomialNB module and create a Multinomial Naive Bayes classifier object using MultinomialNB() function.
from __future__ import print_function
import logging
import sys
from optparse import OptionParser
fro... |
import factory
from sqlalchemy import or_
from backend.extensions import db
from backend.models import Hacknight, Participant, Team, User
class BaseFactory(factory.alchemy.SQLAlchemyModelFactory):
class Meta:
abstract = True
sqlalchemy_session = db.session
class UserFactory(BaseFactory):
cl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" pytickersymbols
Copyright 2019 Slash Gordon
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file.
"""
from setuptools import setup, find_packages
EXCLUDE_FROM_PACKAGES = ['test', 'test.*', 'test*']
VERSION = '1.0.11'
... |
'''
This simulation executes a trained neural network that approximates the
closed form solution given by 2 axis inv kin
'''
from __future__ import division
import numpy as np
import contextlib
with contextlib.redirect_stdout(None):
import pygame
import pygame.locals
import sys
import os
import torch
import torch.... |
"""
SQLite backend for the sqlite3 module in the standard library.
"""
import datetime
import decimal
import functools
import hashlib
import math
import operator
import random
import re
import statistics
import warnings
from itertools import chain
from sqlite3 import dbapi2 as Database
from django.core.exceptions impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2021 by Murray Altheim. All rights reserved. This file is part
# of the Robot Operating System project, released under the MIT License. Please
# see the LICENSE file included as part of this package.
#
# author: altheim
# created: 2020-03-31
# modifie... |
"""
This Python file contains database objects
and schema for CFLTools.
"""
from sqlalchemy import Column, ForeignKey, Integer, \
String, DateTime, Boolean, \
create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, rel... |
#!/usr/bin/env python3
# Copyright (c) 2016-2019 The BitRub Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Encode and decode BASE58, P2PKH and P2SH addresses."""
import enum
from .script import hash256, hash16... |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... |
# Generated by Django 2.2.13 on 2022-01-21 06:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('story', '0008_auto_20220121_1051'),
]
operations = [
migrations.RemoveField(
model_name='stories',
name='duration_raw',
... |
# Generated by Django 3.1.2 on 2020-11-03 14:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('patients', '0007_auto_20201103_1421'),
]
operations = [
migrations.AlterField(
model_name='patient',
name='able_to_w... |
###
#
# Full history: see below
#
# Version: 1.0.0
# Date: 2020-04-15
# Author: Yves Vindevogel (vindevoy)
#
###
import cherrypy
import logging
import logging.config
import os
import yaml
from common.options import Options
# https://stackoverflow.com/questions/41879512/cherrypy-is-not-respecting-desired-logg... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='keras-trainer',
version='1.2.5',
description='A training abstraction for Keras models.',
author='Triage Technologies Inc.',
author_email='ai@triage.com',
url='https://www.triage.com/',
packages=find_packages(ex... |
import decimal
import sys
from eth_utils import (
big_endian_to_int,
decode_hex,
int_to_big_endian,
to_normalized_address,
)
from eth_utils.toolz import (
complement,
)
from hypothesis import (
example,
given,
settings,
strategies as st,
)
import pytest
from eth_abi.constants impor... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.optimize import curve_fit
def exp_func(x, a, b):
#e = 1.602176634e-19
#k = 8.617333262145e-5
#T = 3.00e2
return a * np.exp(b * np.double(x))
#return a * np.exp(- e * np.double(x) / b / k / T)
specimen_nam... |
from dataclasses import dataclass
from typing import List
import betterproto
@dataclass(eq=False, repr=False)
class UpdateRequest(betterproto.Message):
recommendationid: int = betterproto.uint64_field(1)
review_text: str = betterproto.string_field(2)
voted_up: bool = betterproto.bool_field(3)
is_publ... |
"""This module contains the general information for MgmtEntity ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class MgmtEntityConsts():
CHASSIS_DEVICE_IO_STATE1_OK = "ok"
CHASSIS_DEVICE_IO_STATE1_OPEN_E... |
"""Usage: planners_evaluation.py [options]
Compare performances of several planners
Options:
-h --help
--generate <true or false> Generate new data [default: True].
--show <true_or_false> Plot results [default: True].
--directory <path> Specify directory path [default: ./out/planners].
--data... |
import contextlib
import copy
import pathlib
import xml.etree.ElementTree
from unittest import mock
import pytest
np = pytest.importorskip("numpy")
import operator
import os
import time
import warnings
from functools import reduce
from io import StringIO
from operator import add, sub
from threading import Lock
from... |
"""
Support code for building Python extensions on Windows.
# NT stuff
# 1. Make sure libpython<version>.a exists for gcc. If not, build it.
# 2. Force windows to use gcc (we're struggling with MSVC and g77 support)
# 3. Force windows to use g77
"""
import os
import sys
import subprocess
import re
im... |
#!/usr/bin/env python
#
# Public Domain 2014-2015 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compil... |
import textwrap
from datetime import datetime, timedelta
import uuid
from elasticsearch import Elasticsearch
from airflow import DAG # noqa
from airflow import macros # noqa
from airflow.operators.python_operator import PythonOperator # noqa
from pyhocon import ConfigFactory
from databuilder.extractor.neo4j_search_... |
from moha.system.wavefunction.base import BaseWaveFunction
from moha.system.basis_set.ci_basis_set import CIBasisSet
import numpy as np
class CIWaveFunction(BaseWaveFunction):
"""Configuration interaction wavefunction class.
Attributes
----------
nelec : int
Number of electrons.
occ : di... |
#!/usr/bin/env python
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''
PROJECT_NAME:TradingBot
NAME:Huobi
AUTHOR:Tong
Create Date:2018/7/25
'''
import time
from Service.Market_API.Utils import *
class huobi_rest_client:
'''
Market data API
'''
# 获取KLine
def get_kline(symbol, period, size=150):
"""
:param... |
#!/usr/bin/env python3
# mypy: disallow_untyped_defs
# mypy: disallow_incomplete_defs
from __future__ import annotations
from processor.setting import Setting
from processor.display_settings import (
ResetSetting,
AdvancedSetting,
CurrentSetting,
CO2Setting,
)
from patient.rotary import Rotary, Dir
fro... |
#! python3
import zipfile
newZip = zipfile.ZipFile('new.zip', 'w')
newZip.write('spam.txt', compress_type=zipfile.ZIP_DEFLATED)
newZip.close()
|
"""
Scrapy Item
See documentation in docs/topics/item.rst
"""
from pprint import pformat
from collections import MutableMapping
from copy import deepcopy
from abc import ABCMeta
import six
from scrapy.utils.trackref import object_ref
class BaseItem(object_ref):
"""Base class for all scraped items."""
pass... |
__version__ = '0.2.7'
__author__ = 'chenjiandongx'
|
parallel = True
checkout_blocks_and_plots = False
|
import time
import json
import gzip
import boto3
import botocore.exceptions
import pandas as pd
import matplotlib.pyplot as plt
import util.notebook_utils
def wait_till_delete(callback, check_time = 5, timeout = None):
elapsed_time = 0
while timeout is None or elapsed_time < timeout:
try:
... |
# TODO: Temporarily disabled due to importing old code into openshift-ansible
# repo. We will work on these over time.
# pylint: disable=bad-continuation,missing-docstring,no-self-use,invalid-name,too-many-instance-attributes,too-few-public-methods
import os
import yaml
from pkg_resources import resource_filename
PER... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: spvault.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protob... |
from sklearn_explain.tests.skl_datasets_reg import skl_datasets_test as skltest
skltest.test_reg_dataset_and_model("freidman3" , "LGBMRegressor_15")
|
def LeftMax(array,i):
left=array[i]
for j in range(i):
# left=max(left,array[j])
if left < array[j]:
left = array[j]
else:
left=left
return left
def RightMax(array,i):
right=array[i]
for j in range(i+1,len(array)):
# right=max(right,array[j]... |
# #----------------------------------------------------------------------
# Cisco.SANOS.get_chassis_id
# ---------------------------------------------------------------------
# Copyright (C) 2007-2016 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Py... |
# Copyright 2015-2017 Capital One Services, 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 ... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : downloader.py
@Date : 2021/09/15
@Author : Yaronzz
@Version : 1.0
@Contact : yaronhuang@foxmail.com
@Desc :
"""
import time
from PyQt5.Qt import QThread
from tidal_gui.viewModel.taskModel import TaskModel
class DownloaderImp(QThread):
... |
import codecs
import game
from hacktools import common
def run():
infolder = "data/extract/DATA/files/movie/"
outfile = "data/movie_output.txt"
common.logMessage("Extracting MOVIE to", outfile, "...")
with codecs.open(outfile, "w", "utf-8") as out:
files = common.getFiles(infolder, ".bin")
... |
# Generated by Django 2.2.2 on 2019-06-05 19:51
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='SearchQuery',
fields=[
('id', models.AutoFi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.