text stringlengths 2 999k |
|---|
DEVICE_CUSTOMIZES = {
'bofu.curtain.bfmh': {
'select_properties': 'motor_control',
},
'careli.fryer.*': {
'button_actions': 'start_cook,pause,cancel_cooking',
'exclude_miot_services': 'custom',
},
'cgllc.airm.cgdn1': {
'exclude_miot_services': 'mac,settings',
},... |
# -*- 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):
# Adding model 'SalesTaxRate'
db.create_table(u'uppsell_salestaxrate', (
... |
# 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 ... |
from typing import Dict, List
import braintree as braintree_sdk
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import pgettext_lazy
from ... import TransactionKind
from ...interface import (
CreditCardInfo,
CustomerSource,
GatewayConfig,
GatewayResponse,
Paym... |
import unittest
import pandas as pd
import numpy as np
from pandas import Series
# Using parts of Python for Data Analysis - Wes McKinney
ser1 = Series([1, 4, 6, 8])
ser2 = Series([1, 6, -1, 2, None], index=['g', 'r', 'a', 'z', 'u'])
class SeriesTestCase(unittest.TestCase):
def using_series_test(self):
self.a... |
# -*- coding: utf-8 -*-
'''
Tests for salt.utils.jid
'''
# Import Python libs
from __future__ import absolute_import
import datetime
import os
# Import Salt libs
import salt.utils.jid
from tests.support.unit import TestCase, skipIf
from tests.support.mock import (
patch,
NO_MOCK,
NO_MOCK_REASON
)
class ... |
#!/usr/bin/env python3.8
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""The code is to provide a reference of how test_images.h is generated"""
import os
import tempfile
from typing import List
import ... |
from bin.Settings.SettingsEntity import SettingsEntity
from bin.Settings.SettingsSerialEntity import SettingsSerialEntity
from bin.Utility.SerialDiscoverer import get_port_name
class DeviceFactoryAbstract:
def __init__(self, settings_entity=SettingsEntity("")):
self.settings_entity = settings_entity
... |
from dados_map import produtos, pessoas, lista
from functools import reduce
# acumula = 0
# for item in lista:
# acumula += item
#
# print(acumula)
# soma_lista = reduce(lambda ac, item: item + ac, lista, 0)
soma_precos = reduce(lambda ac, p: p['preco'] + ac, produtos, 0)
print(soma_precos / len(produtos))
som... |
import pandas as pd
from .dataframe_bytes_storage import df_from_bytes, df_to_bytes
from .numpy_bytes_storage import np_from_bytes, np_to_bytes
try:
import rpy2.robjects as robjects
from rpy2.robjects import pandas2ri
from rpy2.robjects.conversion import localconverter
def r_to_py(object_):
i... |
import unittest
import io
class TestFileBasedBuffer(unittest.TestCase):
def _makeOne(self, file=None, from_buffer=None):
from waitress.buffers import FileBasedBuffer
return FileBasedBuffer(file, from_buffer=from_buffer)
def test_ctor_from_buffer_None(self):
inst = self._makeOne('file'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Warnings
--------
.. deprecated:: 3.3.0
Use :mod:`gensim.models.word2vec` instead.
Produce word vectors with deep learning via wo... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-27 08:33
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('web', '0004_user_chinese_name'),
]
... |
import os
############################################################################################################
# Enrich gcn_k
############################################################################################################
os.system('python STMeta_Obj.py -m STMeta_v1.model.yml -d bike_nyc.data.yml... |
##
## For help on setting up your machine and configuring this TestScript go to
## http://docs.testdroid.com/appium/
##
import os
import time
import unittest
import subprocess
from time import sleep
from appium import webdriver
from device_finder import DeviceFinder
from selenium.common.exceptions import WebDriverExce... |
x = int(input('digite um numero: '))
y = 0
for i in range(2, x):
if x % i == 0:
print('o numero não é primo pois é divisivel por {}'.format(i))
y = 1
if y != 1:
print('O numero é primo')
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... |
from __future__ import absolute_import, division, print_function
from .codiag import *
from . import givens
|
# Helper file to initialize Kafka producer
"""
Adapted from kafka_helpers.py https://github.com/gfrolov/aiven-kafka/blob/master/kafka_helpers.py
"""
from kafka import KafkaProducer
from json import dumps
from os import environ
def get_kafka_broker():
"""
Parses the KAFKA_URL and returns a hostname: port tha... |
# -*- coding: utf-8 -*-
import os.path
import sys
from pybtex.database.input import bibtex
from citation_vim.item import Item
class bibtexParser(object):
def load(self, source_field, file_path):
"""
Returns:
A bibtex file as an array of Items.
"""
items = []
try:
... |
import pymysql
class DBase:
def __init__(self, credentials):
self.info = (credentials["dbhost"], credentials["dbuser"],
credentials["dbpass"], credentials["dbname"])
def get_user(self, name):
connection = self.__make_connection()
try:
with connection.... |
from enum import Enum, unique
from pydoof.search_api.api_client import SearchAPIClient
from pydoof.helpers import parse_query_params
@unique
class QueryNames(Enum):
MATCH_AND = "match_and"
MATCH_OR = "match_or"
FUZZY = "fuzzy"
PHONETIC = "phonetic_text"
@unique
class Transformers(Enum):
BASIC =... |
from typing import Optional, Iterable
from json import loads
from io import StringIO
from copy import deepcopy
from os.path import getsize
import pandas as pd
import numpy as np
import torch as th
from torch import Tensor
from loguru import logger
from flask import current_app as app
from syft.core.common.uid import U... |
from __future__ import unicode_literals
import json
import time
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlencode
from ..utils import (
ExtractorError,
sanitized_Request,
)
class HypemIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hypem\.com/track/(?P<id>[^/]+)/'... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_0
from i... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "visdial.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... |
import Algorithmia
# API calls will begin at the apply() method, with the request body passed as 'input'
# For more details, see algorithmia.com/developers/algorithm-development/languages
def apply(input):
return "hello {}".format(str(input))
# Here is an example of an advanced form of an algorithm function,
# wh... |
# -*- coding: utf-8 -*-
from __future__ import print_function
# pylint: disable-msg=W0612,E1101
from copy import deepcopy
from datetime import datetime, timedelta, time
import sys
import operator
import re
import csv
import nose
import functools
import itertools
from itertools import product, permutations
from distuti... |
#importing the Kratos Library
from KratosMultiphysics import *
from KratosMultiphysics.MeshlessApplication import *
from KratosMultiphysics.SolidMechanicsApplication import *
class SolvingStrategyPython:
#######################################################################
def __init__(self,model_part,time_s... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v1/proto/resources/asset.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import messag... |
# DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#466. Count The Repetitions
#Define S = [s,n] as the string S which consists of n connected strings s. For example, ["abc", 3] ="abcabcabc".
#On the other... |
"""
Off Multipage Cheatsheet
https://github.com/daniellewisDL/streamlit-cheat-sheet
@daniellewisDL : https://github.com/daniellewisDL
"""
import streamlit as st
from pathlib import Path
import base64
from modules.toc import *
# Initial page config
st.set_page_config(
page_title='Code Compendium Intro Page',
... |
from functools import partial
import gym
import logging
import numpy as np
import tree
from typing import List
from ray.tune.registry import RLLIB_MODEL, RLLIB_PREPROCESSOR, \
RLLIB_ACTION_DIST, _global_registry
from ray.rllib.models.action_dist import ActionDistribution
from ray.rllib.models.modelv2 import ModelV... |
import bpy
from .base import AbstractHelper
#pylint: disable=W0223
class AbstractBoneEditHelper(AbstractHelper):
def _is_active_target(self, target, context):
if target is None:
return False
bone = context.active_bone
if bone is None:
return False
return (bo... |
# Natural Language Toolkit: Evaluation
#
# Copyright (C) 2001-2019 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from math import fabs
import operator
from random import shuffle
from functools i... |
import urllib
from datetime import date, time
from urllib.parse import parse_qsl
import pytest
import scrapy
from tests.utils import file_response
from city_scrapers.spiders.det_city_council import DetCityCouncilSpider
test_response = file_response('files/det_city_council.html')
spider = DetCityCouncilSpider()
def... |
import os, pytest, time, math
import openmmtools
from openmm import Vec3, unit, app
import numpy as np
import warnings
from UmbrellaPipeline import UmbrellaPipeline
from UmbrellaPipeline.analysis import PMFCalculator
from UmbrellaPipeline.path_finding import (
Tree,
Grid,
GridNode,
TreeNode,
GridEs... |
import unittest
import json
from mock import Mock, patch
import pyeapi.eapilib
class TestEapiConnection(unittest.TestCase):
def test_execute_valid_response(self):
response_dict = dict(jsonrpc='2.0', result=[], id=id(self))
mock_send = Mock(name='send')
mock_send.return_value = json.dump... |
# MIT License
#
# Copyright (c) 2021 Marcelo Jacinto
#
# 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, modif... |
"""
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:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# ... |
# coding=utf-8
# Copyright 2021 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... |
# Copyright 2018 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... |
import hashlib
import binascii
CONFIG_FILE = './config.cfg'
def redirect(data):
return None
def load_from_config(data):
return None
def process_request(request):
password = request.GET["password"]
# BAD: Inbound authentication made by comparison to string literal
if password == "myPa55word"... |
#!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the EarthCoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
i... |
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from libya_site.tests.factories import UserFactory
class StaffUserMixin(object):
model = None
username = "staff_user"
email = "staff@example.com"
password = "password"
permissions = []
... |
"""Autocomplete incomplete words based on generated dictionary tree."""
from .autocomplete import Autocomplete
from .dictionary_generator import DictionaryGenerator
|
#!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2022 Alex Petrov <sysman@sysman.net>
# SPDX-License-Identifier: BSD-2-Clause
from migen import *
from litex_boards.platforms import aliexpress_xc7k420t
from litex.soc.integration.soc_core import *
from litex.soc.integration.builder impo... |
import hashlib
import baseconv
import re
import sys
import uuid
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
INVALID_STREAM_SEARCH_PARAMS = ('deep_paging_id', 'rows', 'sort')
SEARCHABLE = ('alert', 'file', 'heuristic', 'result', 'safelist', 'signature', 'submission', 'wor... |
import re
import salt.modules.jboss7_cli as jboss7_cli
from salt.exceptions import CommandExecutionError
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import patch
from tests.support.unit import TestCase
class CmdMock:
commands = []
command_response_func = None # if you want... |
import numpy as np
from thundersvm import OneClassSVM
from tqdm import tqdm
class NoveltyDetectionClassifier(object):
def __init__(self, nu_high, nu_low, nu_resolution, gamma="scale"):
self.nu_high = nu_high
self.nu_low = nu_low
self.nu_resolution = nu_resolution
# -- Gamma of "au... |
import setuptools
from distutils.core import setup
setup(
name = 'kinetics',
packages = ['kinetics',
'kinetics.optimisation',
'kinetics.other_analysis',
'kinetics.reaction_classes',
'kinetics.ua_and_sa'],
setup_requires=['wheel'],
version = '1.4.3',
lic... |
"""Auto-generated file, do not edit by hand. HU metadata"""
from phonenumbers.phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_HU = PhoneMetadata(id='HU', country_code=36, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='30\\d{7}', possible_length=(9,... |
# -*- coding: utf-8 -*-
"""
BIT INDEX TREE
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.
The update(i, val) function modifies nums by updating the element at index i to val.
Example:
Given nums = [1, 3, 5]
sumRange(0, 2) -> 9
update(1, 2)
sumRange(0, 2) -> 8
N... |
"""Support for Netgear routers."""
import logging
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN as DEVICE_TRACKER_DOMAIN,
PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
SOURCE_TYPE_ROUTER,
)
from homeassistant.components.device_tracker.config_entry import ScannerEntity
... |
import requests
from requests.auth import HTTPBasicAuth
import json
from builtins import range
from pynxos.errors import NXOSError
# requests.packages.urllib3.disable_warnings()
class RPCClient(object):
def __init__(self, host, username, password, transport=u'http', port=None, verify=True):
if transport ... |
from functools import wraps
from starlette.requests import Request
from starlette.exceptions import HTTPException
import os
def guard(func):
@wraps(func)
async def check_permissions(*args, **kwargs):
request = args[1].context['request']
assert isinstance(request, Request)
... |
# -*- coding: utf-8 -*-
from django.forms.models import ModelForm
try:
from django.forms.utils import ErrorList
except ImportError:
# Django<1.7 (deprecated in Django 1.8, removed in 1.9)
from django.forms.util import ErrorList
from django.utils.translation import ugettext_lazy as _
from cms.models import... |
"""Module to convert from Ibis expression to SQL string."""
import base64
import datetime
from functools import partial
import ibis
from ibis.backends.base.sql import compiler
try:
import ibis.common.exceptions as com
except ImportError:
import ibis.common as com
import ibis.expr.datatypes as dt
import ibis... |
import math
import torch
import torch.nn as nn
from models.neural import MultiHeadedAttention, PositionwiseFeedForward
from models.rnn import LayerNormLSTM
class Classifier(nn.Module):
def __init__(self, hidden_size):
super(Classifier, self).__init__()
self.linear1 = nn.Linear(hidden_size, 1)
... |
"""
Copyright 2019 Goldman Sachs.
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 di... |
import torch
import numpy as np
from torch.autograd import Variable
import torch.nn as nn
import torch.optim
import json
import torch.utils.data.sampler
import os
import glob
import random
import time
import configs
import backbone
import data.feature_loader as feat_loader
from data.datamgr import SetDataManager
from ... |
import re
import os
import glob
data_dir = '/data2/archit/datum/'
#data_dir = '/data2/gmrtarch/cycle20/'
VALID_LIST = '../parser/filter_healthy/healthy2_file.txt'
valid_observations = open(VALID_LIST, 'r').read().split('\n')[0:-1]
all_observations = os.listdir(data_dir)
def INVALID_OBS():
invalid_obs = []
for ... |
# -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class CdbTdsqlAssignToProjectRequest(Request):
def __init__(self):
super(CdbTdsqlAssignToProjectRequest, self).__init__(
'tdsql', 'qcloudcliV1', 'CdbTdsqlAssignToProject', 'tdsql.api.qcloud.com')
def get_cdbInstanceIds(sel... |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class FC_RNN_ID(Base):
__slots__ = ()
_SDM_NAME = 'FCRNNID'
_SDM_ATT_MAP = {
'FC Header': 'fCRNNID.header.fcHeader',
'FC_CT': 'fCRNNID.header.fcCT',
'dNS': 'fCRNNID.header.dNS',
'FC CRC': 'fCRNN... |
'''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p
from OpenGL.GL import glget
EXTENSION_NAME = 'GL_HP_convolution_border_modes'
_p.unpack_constants( """GL_IGNORE_BORDER_HP 0x8150
GL_CONSTANT_BORDER_HP 0x8151
GL_REPLICATE_BORDER_HP 0x8153
GL_CONVOLUTION_BORDER_COLOR_HP 0x815... |
from .plugin.core.main import startup, shutdown
# TODO: narrow down imports
from .plugin.core.panels import *
from .plugin.core.registry import LspRestartClientCommand
from .plugin.core.documents import *
from .plugin.panels import *
from .plugin.edit import *
from .plugin.completion import *
from .plugin.diagnostics ... |
""" Methods for interacting with the SQL database """
import discord
import logging
import pymysql
from common import *
class SQL:
@staticmethod
def _get_db_connection(bot=None):
if bot and bot.connection:
bot.connection.ping(reconnect=True)
return bot.connection
loggi... |
# Hello World using 16x2 character lcd and an 74LS595 SPI LCD backpack.
import time
import board
import busio
import digitalio
import adafruit_character_lcd
# Character LCD Config:
# modify this if you have a different sized charlcd
lcd_columns = 16
lcd_rows = 2
# Backpack connection configuration:
clk = boa... |
#
# pyip is a Python package offering assembling/disassembling of raw ip packet
# including ip, udp, and icmp. Also it includes 2 utilities based on raw ip,
# traceroute and ping.
#
# pyip is released under PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2, and is
# a project inspired by 'ping' written by Jeremy Hylt... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-05-07 20:44
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('councilmatic_core', '0041_event_extras'),
('lametro', '0005_lametroorganization'),
]
... |
# Generated by Django 2.2.3 on 2019-07-02 05:52
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Movie',
fields=[
('id', models.AutoField(au... |
"""
See https://bittrex.com/Home/Api
"""
import time
import hmac
import hashlib
try:
from urllib import urlencode
from urlparse import urljoin
except ImportError:
from urllib.parse import urlencode
from urllib.parse import urljoin
import requests
try:
from Crypto.Cipher import AES
import ge... |
"""new_a_28530 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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-b... |
# Copyright The PyTorch Lightning 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 agreed to i... |
from bs4 import BeautifulSoup
from ..occurrences.occurrences import Occurrences
from ..occurrences.occurrence_interface import OccurrenceInterface
class Recommendation36:
"""
Recomendação 36: Nome da recomendação
- Fornecer controle para áudio
"""
def __init__(self, sourcecode):
self.rec... |
# Copyright 2019 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... |
import json
from datetime import timedelta
from django.test.utils import override_settings
from django.utils import timezone
from freezegun import freeze_time
from rest_framework import status
from posthog.constants import INSIGHT_STICKINESS
from posthog.ee import is_clickhouse_enabled
from posthog.models.dashboard_i... |
from django.contrib import admin
from .models import Sponsor, SponsorTier
@admin.register(Sponsor)
class SponsorAdmin(admin.ModelAdmin):
list_display = (
"name",
"tier",
"ticket_email",
"ticket_ready",
"tickets_sent",
"tickets_generated",
)
list_filter = ("... |
import math
import nltk
import pyphen
import regex
from collections import Counter
from nltk import SnowballStemmer
from zeeguu.model import Language
AVERAGE_SYLLABLE_LENGTH = 2.5
"""
Collection of simple text processing functions
"""
def split_words_from_text(text):
words = regex.findall(r'(\b\p{L}+\b)', ... |
import json
import uuid
import pytest
from flask import current_app
from freezegun import freeze_time
from notifications_utils.url_safe_token import generate_token
from app.models import EMAIL_AUTH_TYPE, SMS_AUTH_TYPE, Notification
from tests import create_authorization_header
from tests.app.db import create_invited_... |
#!/usr/bin/env python3
import socket
import binascii
from urllib.parse import urlparse
class MS17_010_BaseVerify:
def __init__(self, url):
self.info = {
'name': 'MS17-010漏洞',
'description': 'MS17-010SMB远程溢出漏洞,端口139,445,影响范围为: Windows NT,Windows 2000、Windows XP、Windows 2003、Windows ... |
from flask import Flask, jsonify
from db import db
from models import User, History
from flask_cors import CORS
from flask import request
from crawler import Crawler
from classifier import predict_class, get_three_docs
from poor_me import reference
from flask_jwt import JWT, jwt_required, current_identity
from datetime... |
# Copyright 2010 OpenStack LLC.
# 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 b... |
from flask import Flask, render_template, request, jsonify
from urlparse import urljoin
from werkzeug.contrib.atom import AtomFeed
import os
from bs4 import BeautifulSoup
import os
import datetime
import html2text
app = Flask(__name__)
app.debug=True
def make_external(url):
return urljoin(request.url_root, url)
... |
# !/usr/bin/env python3
# 2048
# Requires selenium and https://github.com/mozilla/geckodriver/.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
driver = webdriver.Firefox()
driver.get("https://play2048.co/")
while True:
... |
from collections import OrderedDict
from evaluation.core.labels.base import Label
from evaluation.core.opinions.collection import OpinionCollection
from evaluation.core.results.base import BaseEvalResult
from evaluation.core.results.utils import calc_f1_single_class, calc_f1_macro
from evaluation.results import metric... |
# model settings
model = dict(
type='Recognizer3D',
backbone=dict(
type='ResNet3d',
pretrained2d=True,
pretrained='torchvision://resnet50',
depth=50,
conv_cfg=dict(type='Conv3d'),
norm_eval=False,
inflate=((1, 1, 1), (1, 0, 1, 0), (1, 0, 1, 0, 1, 0), (0, 1... |
"""
This file defines the common pytest fixtures used in current directory.
"""
from contextlib import contextmanager
import json
import pytest
import subprocess
import ray
from ray.tests.cluster_utils import Cluster
from ray.tests.utils import run_and_get_output
@pytest.fixture
def shutdown_only():
yield None
... |
# -*- coding: utf-8 -*-
import os
import re
import shutil
import tempfile
from collections import defaultdict
from contextlib import contextmanager
from poetry.semver.constraints import Constraint
from poetry.semver.constraints import MultiConstraint
from poetry.semver.version_parser import VersionParser
from poetry.... |
# This file contains library manager director policies
policydict = {
'CD-10KCF1.library_manager': {
1: {'rule': {'storage_group': 'lqcd',
'file_family': 'hpqcd',
... |
#!/usr/bin/env python3
import os
import sys
from itertools import chain
from functools import reduce
from collections import namedtuple
from subprocess import Popen, PIPE, DEVNULL
from datetime import datetime, timedelta
# Character Sequences
SYM_TICK = '\033[32m✓\033[0m'
SYM_INFO = '\033[33m?\033[0m'
SYM_FAIL = '\03... |
# encoding: utf-8
from __future__ import unicode_literals
from .util import PY_3_OR_HIGHER
if PY_3_OR_HIGHER:
import urllib.request as urllib_request
import urllib.error as urllib_error
else:
import urllib2 as urllib_request
import urllib2 as urllib_error
import json
from ssl import SSLError
import so... |
class Coin:
def __init__(self, name, value):
# Reorganized the order of the attributes. self.name first, then self.value.
self.name = name
self.value = value
# Reorganized the order of each coin so it goes from least valuable to most.
class Penny(Coin):
def __init__(self):
su... |
from django.db import models
from image_cropping.fields import ImageRatioField, ImageCropField
from galleries.settings import IMAGE_CROPPING_RATIO
from orderable.models import OrderableModel
from django.utils.translation import ugettext as _
from utils import thumbnail, croppable
class Gallery(models.Model):
ti... |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2021, OMRON SINIC X
# 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... |
#!/usr/bin/env python
# encoding: utf-8
"""Packaging script."""
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
readme = open(os.path.join(here, 'README.rst')).read()
setup(
name="licenseheaders",
version="0.4",
author="Mayk Choji",
... |
# coding=utf-8
"""regexp_editor - give a user feedback on their regular expression
"""
import re
import wx
import wx.stc
STYLE_NO_MATCH = 0
STYLE_MATCH = 1
STYLE_FIRST_LABEL = 2
STYLE_ERROR = 31
UUID_REGEXP = (
"[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}"
)
RE_FILENAME_GUESSES =... |
# and.py
def main():
num = int(input("2의 배수이면서 3의 배수인 수 입력: "))
if num % 2 == 0 and num % 3 == 0:
print("OK!")
else:
print("NO!")
main()
|
# material definition table: tropical
#
tropical = [\
[ # 0
[[0.219385, 0.226102, 0.0, 1.0]], # ambient
[[0.877539, 0.904409, 0.0, 1.0]], # diffuse
[[0.0, 0.0, 0.0, 1.0]], # emission
[[0.0955906, 0.0955906, 0.0955906, 1.0]], # specular
[0.078125], # shininess
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
# Copyright (C) 2012-2018 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>
#
# Permission is he... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.