max_stars_repo_path string | max_stars_repo_name string | max_stars_count int64 | id string | content string | add_param_types int64 | add_return_types int64 | add_class_field_types int64 | add_instance_field_types int64 | add_total int64 | add_error int64 |
|---|---|---|---|---|---|---|---|---|---|---|
droidlet/interpreter/craftassist/spatial_reasoning.py | ali-senguel/fairo | 669 | 1680143 | from __future__ import annotations
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
import numpy as np
import droidlet.base_util
from droidlet.perception.craftassist import rotation, heuristic_perception
from droidlet.base_util import to_block_center, to_block_pos
from droidlet.shared_data_struct.craftassist_... | 6 | 4 | 0 | 0 | 10 | 0 |
scripts/deployment/distribution/create_vestings.py | jccf091/Sovryn-smart-contracts | 108 | 1680151 | from brownie import *
import time
import json
import csv
import math
def main():
thisNetwork = network.show_active()
# == Load config =======================================================================================================================
if thisNetwork == "development":
acct = acc... | 0 | 1 | 0 | 0 | 1 | 0 |
code/tests/test_utils.py | sigfaulterror/simcoin | 442 | 1680175 | from unittest import TestCase
import utils
from mock import patch
from mock import mock_open
from textwrap import dedent
from collections import namedtuple
from argparse import Namespace
class TestUtils(TestCase):
@patch('builtins.exit')
@patch('os.path.isfile')
def test_check_for_files_file_not_existing... | 0 | 0 | 0 | 0 | 0 | 0 |
mirdata/datasets/freesound_one_shot_percussive_sounds.py | lucaspbastos/mirdata | 224 | 1680193 | from __future__ import annotations
"""
Freesound One-Shot Percussive Sounds Dataset Loader
.. admonition:: Dataset Info
:class: dropdown
Introduction:
This dataset contains 10254 one-shot (single event) percussive sounds from freesound.org, a timbral
analysis computed by two different extractors (Fre... | 4 | 15 | 0 | 0 | 19 | 0 |
commands/dashboard/nextdns-status-check.py | daviddzhou/script-commands | 3,305 | 1680203 | #!/usr/bin/env python3
# Parameters
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title NextDNS Status
# @raycast.mode inline
# Conditional parameters:
# @raycast.refreshTime 1h
# Optional parameters:
# @raycast.packageName Dashboard
# @raycast.icon images/nextdns.png
# Documentation:
# @raycast.auth... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/flask-desktop/main.py | fergusch/flaskwebgui | 377 | 1680251 | <reponame>fergusch/flaskwebgui
from flask import Flask
from flask import render_template
from flaskwebgui import FlaskUI
app = Flask(__name__)
ui = FlaskUI(app, width=500, height=500)
@app.route("/")
def hello():
return render_template('index.html')
@app.route("/home", methods=['GET'])
def home():
ret... | 0 | 0 | 0 | 0 | 0 | 0 |
tonic/utils/trainer.py | Eyalcohenx/tonic | 350 | 1680275 | <gh_stars>100-1000
import os
import time
import numpy as np
from tonic import logger
class Trainer:
'''Trainer used to train and evaluate an agent on an environment.'''
def __init__(
self, steps=int(5e6), epoch_steps=10000, save_steps=500000,
test_episodes=5, show_progress=True
):
... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/pytorch/kg_completion/spodernet/hooks.py | stjordanis/graph4nlp | 121 | 1680283 | from __future__ import annotations
import numpy as np
import scipy.stats
import datetime
from spodernet.interfaces import IAtIterEndObservable, IAtEpochEndObservable, IAtEpochStartObservable
from spodernet.utils.util import Timer
from spodernet.utils.global_config import Config, Backends
from spodernet.utils.logger i... | 14 | 14 | 0 | 15 | 43 | 0 |
pyNastran/bdf/mesh_utils/make_half_model.py | ACea15/pyNastran | 293 | 1680295 | <filename>pyNastran/bdf/mesh_utils/make_half_model.py<gh_stars>100-1000
"""
This file defines:
- model = make_half_model(
bdf_filename, plane='xz', zero_tol=1e-12,
log=None, debug=True)
"""
from cpylog import get_logger2
from pyNastran.utils import deprecated
from pyNastran.bdf.mesh_utils.internal_ut... | 0 | 0 | 0 | 0 | 0 | 0 |
notebooks/Ch03_Processing_Wrangling_and_Visualizing_Data/read_json.py | baoqt2/practical-machine-learning-with-python | 1,989 | 1680321 | <reponame>baoqt2/practical-machine-learning-with-python<filename>notebooks/Ch03_Processing_Wrangling_and_Visualizing_Data/read_json.py<gh_stars>1000+
# -*- coding: utf-8 -*-
"""
Created on Wed May 10 19:51:47 2017
@author: <NAME>
"""
"""
This script showcases methods to read JSON type data:
+ using python's inbu... | 0 | 0 | 0 | 0 | 0 | 0 |
libs/pipelines/csv_column_ordering.py | covid-projections/covid-data-model | 155 | 1680323 | <reponame>covid-projections/covid-data-model<filename>libs/pipelines/csv_column_ordering.py<gh_stars>100-1000
"""
Module to specify columns in output csvs.
Changing the column ordering breaks many of our users who rely on column indices
to reference in excel and google sheets. The timeseries and summary csvs use thes... | 0 | 0 | 0 | 0 | 0 | 0 |
src/siphon/metadata.py | rpmanser/siphon | 164 | 1680340 | # Copyright (c) 2013-2015 Siphon Contributors.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
"""Helps support reading and parsing metadata elements from a TDS client catalog."""
import logging
logging.basicConfig(level=logging.ERR... | 1 | 27 | 0 | 2 | 30 | 0 |
salt/states/win_wusa.py | markgras/salt | 9,425 | 1680376 | <reponame>markgras/salt
"""
Microsoft Updates (KB) Management
This module provides the ability to enforce KB installations from files (.msu),
without WSUS or Windows Update
.. versionadded:: 2018.3.4
"""
import logging
import salt.utils.platform
import salt.utils.url
from salt.exceptions import CommandExecutionErr... | 0 | 0 | 0 | 0 | 0 | 0 |
preprocess/mimic.py | BruceWen120/medical-abbreviation-pretraining | 125 | 1680383 | import argparse
import os
import pandas as pd
import numpy as np
from tqdm import tqdm
from sklearn.model_selection import train_test_split
tqdm.pandas()
parser = argparse.ArgumentParser()
parse.add_argument("--mimic_dir", help="The directory contaning all the required MIMIC files (ADMISSIONS, PATIENTS, DIAGNOSES_I... | 1 | 3 | 0 | 0 | 4 | 0 |
jug/jug_version.py | szaydel/jug | 309 | 1680413 | <reponame>szaydel/jug
__version__ = '2.1.1-post'
CITATION = '''\
<NAME>., (2017). Jug: Software for Parallel Reproducible Computation in
Python. Journal of Open Research Software. 5(1), p.30.
http://doi.org/10.5334/jors.161'''
| 0 | 0 | 0 | 0 | 0 | 0 |
upliftml/models/pyspark.py | ilirmaci/upliftml | 154 | 1680428 | from typing import Any, Dict, List, Optional, Union
import pyspark
import pyspark.sql.functions as F
from pyspark.ml.linalg import Vectors, VectorUDT
from pyspark.sql.functions import udf
from pyspark.sql.types import FloatType
class SLearnerEstimator:
"""Estimates treatment effect by training a single model for... | 80 | 16 | 0 | 2 | 98 | 0 |
kili/queries/project_version/__init__.py | ASonay/kili-playground | 214 | 1680443 | """
Project version queries
"""
from typing import List, Optional
from typeguard import typechecked
from ...helpers import Compatible, format_result, fragment_builder
from .queries import gql_project_version, GQL_PROJECT_VERSION_COUNT
from ...types import ProjectVersion as ProjectVersionType
class QueriesProjectVer... | 5 | 2 | 0 | 0 | 7 | 0 |
homura/trainers.py | forkbabu/homura | 102 | 1680457 | from __future__ import annotations
import contextlib
import warnings
from abc import ABCMeta, abstractmethod
from functools import partial as Partial
from types import MethodType
from typing import Any, Callable, Iterable, TypeVar
import torch
from torch import Tensor, nn
from torch.optim import Optimizer
from torch.... | 52 | 26 | 0 | 4 | 82 | 0 |
mindspore/python/mindspore/mindrecord/common/exceptions.py | PowerOlive/mindspore | 3,200 | 1680475 | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | 0 | 4 | 0 | 2 | 6 | 0 |
scripts/test_twemoji_mapping.py | Victorsitou/hikari | 520 | 1680512 | <filename>scripts/test_twemoji_mapping.py
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021 davfsa
#
# 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 restricti... | 0 | 0 | 0 | 0 | 0 | 0 |
src/modules/agents/__init__.py | tarun018/pymarl | 1,098 | 1680536 | <gh_stars>1000+
REGISTRY = {}
from .rnn_agent import RNNAgent
REGISTRY["rnn"] = RNNAgent | 0 | 0 | 0 | 0 | 0 | 0 |
tests/testflows/rbac/tests/privileges/alter/alter_index.py | pdv-ru/ClickHouse | 15,577 | 1680570 | <reponame>pdv-ru/ClickHouse<gh_stars>1000+
import json
import random
from testflows._core.cli.arg.parser import parser
from testflows.core import *
from testflows.asserts import error
from rbac.requirements import *
from rbac.helper.common import *
import rbac.helper.errors as errors
from rbac.helper.tables import ta... | 0 | 0 | 0 | 0 | 0 | 0 |
napari/_qt/containers/qt_list_view.py | MaksHess/napari | 1,345 | 1680591 | from __future__ import annotations
from typing import TYPE_CHECKING, TypeVar
from qtpy.QtWidgets import QListView
from ._base_item_view import _BaseEventedItemView
from .qt_list_model import QtListModel
if TYPE_CHECKING:
from qtpy.QtWidgets import QWidget
from ...utils.events.containers import SelectableEv... | 2 | 1 | 1 | 0 | 4 | 0 |
mindspore_serving/server/__init__.py | mindspore-ai/serving | 157 | 1680594 | <reponame>mindspore-ai/serving
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
example/deployment/kubernetes/benchmark.py | m-novikov/websockets | 3,909 | 1680600 | <reponame>m-novikov/websockets
#!/usr/bin/env python
import asyncio
import sys
import websockets
URI = "ws://localhost:32080"
async def run(client_id, messages):
async with websockets.connect(URI) as websocket:
for message_id in range(messages):
await websocket.send("{client_id}:{message_id... | 0 | 0 | 0 | 0 | 0 | 0 |
yolov4-relu/yolo_v4_tiny.py | Clark1216/OpenVINO-YOLOV4 | 216 | 1680604 | # -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
from yolo_v4 import _conv2d_fixed_padding, _fixed_padding, _get_size, \
_detection_layer, _upsample
slim = tf.contrib.slim
_BATCH_NORM_DECAY = 0.9
_BATCH_NORM_EPSILON = 1e-05
_LEAKY_RELU = 0.1
_ANCHORS = [(10, 14), (23, 27), (37, 58),
... | 3 | 2 | 0 | 0 | 5 | 0 |
source/masif_ppi_search/second_stage_alignment_nn.py | NBDsoftware/masif | 309 | 1680613 | <filename>source/masif_ppi_search/second_stage_alignment_nn.py
#!/usr/bin/env python
# coding: utf-8
import sys
import time
import sklearn.metrics
from geometry.open3d_import import *
import numpy as np
import os
from alignment_utils_masif_search import compute_nn_score, rand_rotation_matrix, \
get_center_and_r... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/feedscraper-testclient.py | li-caspar/eventlet_0.30.2 | 1,044 | 1680620 | <gh_stars>1000+
from eventlet.green.urllib.request import urlopen
big_list_of_feeds = """
http://blog.eventlet.net/feed/
http://rss.slashdot.org/Slashdot/slashdot
http://feeds.boingboing.net/boingboing/iBag
http://feeds.feedburner.com/RockPaperShotgun
http://feeds.penny-arcade.com/pa-mainsite
http://achewood.com/rss.p... | 0 | 0 | 0 | 0 | 0 | 0 |
tastypie/utils/urls.py | pavanv/django-tastypie | 1,570 | 1680632 | <gh_stars>1000+
from __future__ import unicode_literals
from django.conf import settings
import six
_trailing_slash = '/?' if getattr(settings, 'TASTYPIE_ALLOW_MISSING_SLASH', False) else '/'
# for backwards compatibility where 3rd parties still call this like a function.
class CallableUnicode(six.text_type):
... | 0 | 0 | 0 | 0 | 0 | 0 |
tacker/tests/functional/common/fake_server.py | takahashi-tsc/tacker | 116 | 1680665 | <reponame>takahashi-tsc/tacker<gh_stars>100-1000
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/executable/swf.py | SabheeR/hobbits | 304 | 1680667 | <reponame>SabheeR/hobbits<gh_stars>100-1000
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
from enum import Enum
import collections
import zlib
... | 0 | 0 | 0 | 0 | 0 | 0 |
tencentcloud/common/sign.py | yangyimincn/tencentcloud-sdk-python | 285 | 1680676 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import binascii
import hashlib
import hmac
import sys
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
class Sign(object):
@staticmethod
def sign(secretKey, signStr, signMethod):
if sys.version_info[0] > 2:
... | 0 | 0 | 0 | 0 | 0 | 0 |
plugins/PassiveReconnaissance/wappalyzer.py | bingpo/Vxscan | 1,511 | 1680746 | <gh_stars>1000+
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import json
import logging
import re
from bs4 import BeautifulSoup
class WebPage(object):
"""
Simple representation of a web page, decoupled
from any particular HTTP library's API.
"""
def __init__(self, url, html, headers):
... | 0 | 0 | 0 | 0 | 0 | 0 |
nbdev/version.py | dleen/nbdev | 3,334 | 1680756 | from . import imports
__all__ = ['__version__']
__version__ = imports.get_config().version
| 0 | 0 | 0 | 0 | 0 | 0 |
src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_settrace.py | r3m0t/debugpy | 695 | 1680767 | def ask_for_stop(use_back):
import pydevd
if use_back:
pydevd.settrace(stop_at_frame=sys._getframe().f_back)
else:
pydevd.settrace()
print('Will stop here if use_back==False.')
def outer_method():
ask_for_stop(True)
print('will stop here.')
ask_for_stop(False)
if __name__... | 0 | 0 | 0 | 0 | 0 | 0 |
models/models.py | weiyx15/DHGNN | 124 | 1680771 | <reponame>weiyx15/DHGNN
import torch
from torch import nn
from torch.nn import Module
from models.layers import *
import pandas as pd
class DHGNN_v1(nn.Module):
"""
Dynamic Hypergraph Convolution Neural Network with a GCN-style input layer
"""
def __init__(self, **kwargs):
super().__init__()
... | 0 | 0 | 0 | 0 | 0 | 0 |
torchlambda/__init__.py | medric49/torchlambda | 104 | 1680783 | from . import arguments, implementation, subcommands
| 0 | 0 | 0 | 0 | 0 | 0 |
macropodus/summarize/topic_base/topic_nmf.py | leileixiao/Macropodus | 485 | 1680789 | # -*- coding: UTF-8 -*-
# !/usr/bin/python
# @time :2019/12/2 20:33
# @author :Mo
# @function :topic model of NMF
from macropodus.preprocess.tools_ml import extract_chinese, tfidf_fit
from macropodus.data.words_common.stop_words import stop_words
from macropodus.preprocess.tools_ml import macropodus_cut
from ma... | 3 | 1 | 0 | 1 | 5 | 0 |
pantalaimon/store.py | bradyt/pantalaimon | 216 | 1680791 | # Copyright 2019 The Matrix.org Foundation CIC
#
# 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 agre... | 7 | 18 | 7 | 0 | 32 | 0 |
test_data/files/tmp/file_with_secrets.py | gazali-alfatih/detect-secrets | 2,212 | 1680797 | <gh_stars>1000+
#!/usr/bin/python
# Will change this later.
SUPER_SECRET_VALUES = '<KEY>', '<KEY>'
def main():
print('Hello world!')
if __name__ == '__main__':
main()
| 0 | 0 | 0 | 0 | 0 | 0 |
chemml/datasets/base.py | iamchetry/DataChallenge-Fall2021 | 108 | 1680799 | <filename>chemml/datasets/base.py
from __future__ import print_function
import pkg_resources
import os
import pandas as pd
from chemml.chem import Molecule
def load_cep_homo():
"""Load and return a small sample of HOMO energies of organic photovoltaic candidates from CEP database (regression).
Clean Energy P... | 0 | 0 | 0 | 0 | 0 | 0 |
textract/async-form-table/lambda-process-response/helper/helper.py | srcecde/aws-tutorial-code | 105 | 1680801 | <reponame>srcecde/aws-tutorial-code
"""
-*- coding: utf-8 -*-
========================
AWS Lambda
========================
Contributor: <NAME> (<NAME>)
========================
"""
import boto3
import io
from .parser import Parse
import pandas as pd
def upload_to_s3(csv_buffer, BUCKET_NAME, key):
client = boto3... | 0 | 0 | 0 | 0 | 0 | 0 |
sgbackend/version.py | kevin-brown/sendgrid-django | 213 | 1680811 | version_info = (4, 2, 0) # pragma: no cover
__version__ = '.'.join(str(v) for v in version_info) # pragma: no cover
| 0 | 0 | 0 | 0 | 0 | 0 |
python-build/python-libs/py4a/__init__.py | visdom2000/python-for-android | 267 | 1680813 | <reponame>visdom2000/python-for-android<gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import print_function
import sysconfig
from distutils import sysconfig as dstconfig
import os
cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
if cross_compiling:
def _cross_cfg():
ret = os.path.join... | 0 | 0 | 0 | 0 | 0 | 0 |
table_recognition/lmdb_maker.py | cuongngm/TableMASTER-mmocr | 206 | 1680825 | <filename>table_recognition/lmdb_maker.py<gh_stars>100-1000
import os
import cv2
import glob
import lmdb
import time
import pickle
import random
import logging
import argparse
import numpy as np
def line_operation(line):
"""
Do something of line.
:param line:
:return:
"""
return line
def get_... | 0 | 0 | 0 | 0 | 0 | 0 |
zentral/contrib/okta/management/commands/setup_okta_event_hook.py | arubdesu/zentral | 634 | 1680826 | import getpass
import logging
import sys
from django.core.management.base import BaseCommand
from django.db import transaction, IntegrityError
from django.urls import reverse
from django.utils.crypto import get_random_string
import requests
from zentral.conf import settings
from zentral.contrib.okta.models import Event... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter11/convnet_undistributed.py | thatgeeman/Mastering-PyTorch | 132 | 1680831 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
import time
import argparse
class ConvNet(nn.Module):
def __init__(self):
super(ConvNet, self).__init__()
self.cn1 = ... | 0 | 1 | 0 | 0 | 1 | 0 |
code/optical_flow_net-PWC-Net/external_packages/correlation-pytorch-master/correlation-pytorch/test/test.py | MTonyM/PReMVOS | 140 | 1680838 | import torch
import torch.nn as nn
from torch.autograd import Variable
from correlation_package.modules.corr import Correlation, Correlation1d
from correlation_package.functions.corr import correlation, correlation1d
from torch.autograd import gradcheck
import numpy as np
def test_correlation():
# model = correla... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/unit/recommenders/datasets/test_wikidata.py | aeroabir/recommenders | 10,147 | 1680885 | <filename>tests/unit/recommenders/datasets/test_wikidata.py<gh_stars>1000+
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import pytest
from recommenders.datasets.wikidata import (
search_wikidata,
find_wikidata_id,
query_entity_links,
read_linked_entiti... | 0 | 0 | 0 | 0 | 0 | 0 |
custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS.py | UBS-P/hacs_waste_collection_schedule | 142 | 1680900 | from __future__ import annotations
import datetime
import logging
import re
import icalendar
import recurring_ical_events
_LOGGER = logging.getLogger(__name__)
class ICS:
def __init__(self, offset: object | None=None, regex: object | None=None, split_at: object | None=None):
self._offset = offset
... | 3 | 1 | 0 | 1 | 5 | 0 |
chrome/content/papermachines/processors/lib/geodict/jsqlite3.py | papermachines/papermachines | 134 | 1680915 | <filename>chrome/content/papermachines/processors/lib/geodict/jsqlite3.py
#!/usr/bin/env python2.7
import sys, os, logging
from java.lang import Class
from java.sql import Connection, DriverManager, ResultSet, ResultSetMetaData, SQLException, Statement, PreparedStatement
def connect(db_name):
return SqliteDB(db_n... | 0 | 0 | 0 | 0 | 0 | 0 |
var/spack/repos/builtin/packages/libxtst/package.py | LiamBindle/spack | 2,360 | 1680936 | <reponame>LiamBindle/spack
# 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 Libxtst(AutotoolsPackage, XorgPackage):
"""libXtst provides the... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/contrib/autoname/test_autoname.py | futurewarning/pyro | 4,959 | 1680955 | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import torch
import pyro
import pyro.distributions.torch as dist
import pyro.poutine as poutine
from pyro.contrib.autoname import autoname, sample
def test_basic_scope() -> object:
@autoname
... | 2 | 38 | 0 | 0 | 40 | 0 |
third_party/tlslite/tlslite/integration/POP3_TLS.py | nagineni/chromium-crosswalk | 231 | 1680959 | """TLS Lite + poplib."""
import socket
from poplib import POP3
from tlslite.TLSConnection import TLSConnection
from tlslite.integration.ClientHelper import ClientHelper
# POP TLS PORT
POP3_TLS_PORT = 995
class POP3_TLS(POP3, ClientHelper):
"""This class extends L{poplib.POP3} with TLS support."""
def __init... | 0 | 0 | 0 | 0 | 0 | 0 |
sumatra/versioncontrol/_mercurial.py | usnistgov/corr-sumatra | 143 | 1680965 | <reponame>usnistgov/corr-sumatra
"""
Defines the Sumatra version control interface for Mercurial.
Classes
-------
MercurialWorkingCopy
MercurialRepository
:copyright: Copyright 2006-2015 by the Sumatra team, see doc/authors.txt
:license: BSD 2-clause, see LICENSE for details.
"""
from __future__ import print_functi... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/tests/snapshots/snap_print_test.py | Duroktar/Wolf | 105 | 1680988 | <filename>scripts/tests/snapshots/snap_print_test.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['test_print 1'] = '[{"lineno": 10, "value": "[[6.4, 2.8, 5.6, 2.2], [5.... | 0 | 0 | 0 | 0 | 0 | 0 |
nets/cyclegan_dis.py | kiralpoon/TwinGAN | 736 | 1681026 | <filename>nets/cyclegan_dis.py
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 0 | 0 | 0 | 0 | 0 | 0 |
targets/l2_switch/openflow_mapping/l2.py | ghostli123/p4factory | 205 | 1681034 | from mapping_common import *
openflow_tables = {
"dmac": OFTable(
match_fields = {
"ethernet_dstAddr" : OFMatchField(field="OFPXMT_OFB_ETH_DST")
},
id = 0
)
}
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/aiplatform/test_explain_lit.py | slowy07/python-aiplatform | 180 | 1681036 | # -*- coding: utf-8 -*-
# Copyright 2021 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 o... | 0 | 0 | 0 | 0 | 0 | 0 |
Logistic Regression/LR_AnFany.py | Jojoxiao/Machine-Learning-for-Beginner-by-Python3 | 397 | 1681054 | # -*- coding:utf-8 -*-
# &Author AnFany
from Heart_Data import model_data as H_Data
import numpy as np
#计算混淆矩阵
from prettytable import PrettyTable
def confusion(realy, outy) -> object:
mix = PrettyTable()
type = sorted(list(set(realy.T[0])), reverse=True)
mix.field_names = [' '] + ['预测:%d类'... | 6 | 5 | 0 | 0 | 11 | 0 |
viscm/bezierbuilder.py | ZeekoZhu/viscm | 122 | 1681098 | # coding=utf8
# BézierBuilder
#
# Copyright (c) 2013, <NAME> <<EMAIL>>
# 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 retain the above copyright notic... | 11 | 17 | 0 | 4 | 32 | 0 |
MAML_CNN_classifier.py | markWJJ/FewShotNLP | 146 | 1681103 | import sys, os, glob, random
import time
import parser
import torch
import torch.nn as nn
# from AdaAdam import AdaAdam
import torch.optim as OPT
import numpy as np
from copy import deepcopy
from tqdm import tqdm, trange
import logging
from torchtext import data
import DataProcessing
from DataProcessing.MLTField impor... | 1 | 1 | 0 | 0 | 2 | 0 |
tvnamer/__init__.py | virusdave/tvnamer | 529 | 1681116 | #!/usr/bin/env python
"""tvnamer - Automagical TV episode renamer
Uses data from www.thetvdb.com (via tvdb_api) to rename TV episode files from
"some.show.name.s01e01.blah.avi" to "Some Show Name - [01x01] - The First.avi"
"""
__version__ = "4.0-dev"
__author__ = "dbr/Ben"
import os
if (
"TVNAMER_COVERAGE_SUBP... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/session/test_parallel.py | snsnlou/tox | 2,811 | 1681165 | <filename>tests/unit/session/test_parallel.py
from __future__ import absolute_import, unicode_literals
import json
import os
import subprocess
import sys
import threading
import pytest
from flaky import flaky
from tox._pytestplugin import RunResult
def test_parallel(cmd, initproj):
initproj(
"pkg123-0.... | 0 | 0 | 0 | 0 | 0 | 0 |
esphome/components/mcp4728/output.py | OttoWinter/esphomeyaml | 249 | 1681167 | <reponame>OttoWinter/esphomeyaml
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import output
from esphome.const import CONF_CHANNEL, CONF_ID, CONF_GAIN
from . import MCP4728Component, mcp4728_ns
DEPENDENCIES = ["mcp4728"]
MCP4728Channel = mcp4728_ns.class_("MCP4728Channel... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter12/12_fibonacci.py | surinkim/Python-Microservices-Development | 208 | 1681181 | <filename>Chapter12/12_fibonacci.py
class Fibo:
def __init__(self, max=10):
self.a, self.b = 0, 1
self.max = max
self.count = 0
def __iter__(self):
return self
def next(self):
try:
return self.a
finally:
if self.count == self.max:
raise StopIteration()
self.a, self.b = self.b, self.a + s... | 0 | 0 | 0 | 0 | 0 | 0 |
mapproxy/image/__init__.py | gravitystorm/mapproxy | 347 | 1681193 | # This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.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... | 22 | 23 | 0 | 9 | 54 | 0 |
baselines/cmaes/experiment.py | zuoxingdong/lagom | 383 | 1681196 | from multiprocessing import Pool
import time
import numpy as np
import torch
import gym
from lagom import Logger
from lagom import EpisodeRunner
from lagom.transform import describe
from lagom.utils import CloudpickleWrapper
from lagom.utils import pickle_dump
from lagom.utils import tensorify
from lagom.utils import ... | 0 | 3 | 0 | 0 | 3 | 0 |
build/scripts/gen_join_srcs.py | jochenater/catboost | 6,989 | 1681238 | <gh_stars>1000+
import sys
import process_command_files as pcf
with open(sys.argv[1], 'w') as f:
f.write('#if defined(__GNUC__)\n')
f.write('#pragma GCC diagnostic ignored "-Wunknown-pragmas"\n')
f.write('#if defined(__clang__)\n')
f.write('#pragma GCC diagnostic ignored "-Wunknown-warning-option"\n'... | 0 | 0 | 0 | 0 | 0 | 0 |
pony/orm/tests/test_decompiler.py | Camipique/pony | 2,628 | 1681245 | import unittest
from pony.thirdparty.compiler.transformer import parse
from pony.orm.decompiling import Decompiler
from pony.orm.asttranslation import ast2src
def generate_gens() -> object:
patterns = [
'(x * y) * [z * j)',
'([x * y) * z) * j',
'(x * [y * z)) * j',
'x * ([y * z) *... | 0 | 4 | 0 | 0 | 4 | 0 |
src/converters/modules/face_model.py | u0251077/InsightFace-REST | 236 | 1681249 | <reponame>u0251077/InsightFace-REST<gh_stars>100-1000
import collections
from typing import Dict, List, Optional
import numpy as np
from numpy.linalg import norm
import cv2
import logging
import time
from insightface.utils import face_align
from modules.model_zoo.getter import get_model
from modules.imagedata import ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/utils/test_misc.py | PyCN/pulsar | 1,410 | 1681264 | import sys
import unittest
from pulsar.utils.exceptions import reraise
class TestMiscellaneous(unittest.TestCase):
def test_reraise(self):
self.assertRaises(RuntimeError, reraise, RuntimeError, RuntimeError())
try:
raise RuntimeError('bla')
except Exception:
exc_i... | 0 | 0 | 0 | 0 | 0 | 0 |
tqsdk/multiaccount.py | shinny-mayanqiong/tqsdk-python | 3,208 | 1681293 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
__time__ = '2020/8/5 22:45'
__author__ = '<NAME>'
from typing import List, Union
from tqsdk.account import TqAccount, TqKq
from tqsdk.sim import TqSim
from tqsdk.channel import TqChan
from shinny_structlog import ShinnyLoggerAdapter, JSON... | 5 | 9 | 0 | 1 | 15 | 0 |
ivy_tests/test_ivy/test_pickling.py | RitujaPawas/ivy | 681 | 1681299 | <filename>ivy_tests/test_ivy/test_pickling.py<gh_stars>100-1000
import pickle
import numpy as np
import os
from hypothesis import given, strategies as st
# local
import ivy
import ivy_tests.test_ivy.helpers as helpers
import ivy.functional.backends.numpy as ivy_np
# Tests #
# ------#
# pickling array test to str
@... | 0 | 0 | 0 | 0 | 0 | 0 |
var/spack/repos/builtin/packages/py-aiohttp/package.py | kjrstory/spack | 2,360 | 1681313 | <reponame>kjrstory/spack
# 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)
class PyAiohttp(PythonPackage):
"""Supports both client and server side of HTTP protocol.
... | 0 | 0 | 0 | 0 | 0 | 0 |
sfepy/linalg/check_derivatives.py | clazaro/sfepy | 510 | 1681318 | <filename>sfepy/linalg/check_derivatives.py
"""
Utilities for checking derivatives of functions.
"""
from __future__ import print_function
from __future__ import absolute_import
import numpy as nm
from six.moves import range
def check_fx(x0, fx, fx_args, dfx, dfx_args=None, delta=1e-5):
"""
Check derivatives ... | 0 | 0 | 0 | 0 | 0 | 0 |
Tests/Marketplace/private_build_prepare_for_testing.py | diCagri/content | 799 | 1681332 | <reponame>diCagri/content
import argparse
import os
from Tests.Marketplace.marketplace_services import init_storage_client, Pack
from Tests.Marketplace.marketplace_constants import GCPConfig
from Tests.private_build.upload_packs_private import extract_packs_artifacts
from demisto_sdk.commands.common.tools import str2bo... | 0 | 0 | 0 | 0 | 0 | 0 |
security-admin/scripts/deleteUserGroupUtil.py | Eroschang/ranger | 555 | 1681339 | #
# 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
src/oci/cims/models/item.py | Manny27nyc/oci-python-sdk | 249 | 1681342 | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 0 | 10 | 0 | 8 | 18 | 0 |
oauthenticator/mediawiki.py | VaishnaviHire/oauthenticator | 311 | 1681346 | from __future__ import annotations
"""
Custom Authenticator to use MediaWiki OAuth with JupyterHub
Requires `mwoauth` package.
"""
import json
import os
from asyncio import wrap_future
from concurrent.futures import ThreadPoolExecutor
from jupyterhub.handlers import BaseHandler
from jupyterhub.utils import url_path_j... | 1 | 6 | 1 | 0 | 8 | 0 |
test/mac/xcode-gcc/test.gyp | chlorm-forks/gyp | 2,151 | 1681359 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'target_defaults': {
'xcode_settings': {
'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',
},
},
'variables': {
# Non-failing tests should check tha... | 0 | 0 | 0 | 0 | 0 | 0 |
mainapp/migrations/0047_auto_20180818_1723.py | sndp487/rescuekerala | 657 | 1681392 | <gh_stars>100-1000
# Generated by Django 2.1 on 2018-08-18 11:53
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("mainapp", "0046_auto_20180818_1609"),
]
operations = [
migrations.RemoveField(model_name="announcements", name="category",),
... | 0 | 0 | 0 | 0 | 0 | 0 |
build/python-env/lib/python2.7/site-packages/nose/plugins/allmodules.py | rfraposa/hadoopbeat | 5,079 | 1681400 | """Use the AllModules plugin by passing ``--all-modules`` or setting the
NOSE_ALL_MODULES environment variable to enable collection and execution of
tests in all python modules. Normal nose behavior is to look for tests only in
modules that match testMatch.
More information: :doc:`../doc_tests/test_allmodules/test_all... | 0 | 2 | 0 | 0 | 2 | 0 |
wagtail/tests/testapp/migrations/0031_customdocument_file_size.py | brownaa/wagtail | 8,851 | 1681411 | <filename>wagtail/tests/testapp/migrations/0031_customdocument_file_size.py
# Generated by Django 2.0.4 on 2018-05-04 17:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tests', '0030_formclassadditionalfieldpage'),
]
operations = [
m... | 0 | 0 | 0 | 0 | 0 | 0 |
models/commands/SirepCommand.py | pwnfoo/SirepRAT | 357 | 1681413 | <gh_stars>100-1000
#!/usr/bin/env python3
"""
BSD 3-Clause License
Copyright (c) 2017, SafeBreach Labs
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 retain the a... | 0 | 0 | 0 | 0 | 0 | 0 |
Security & Privacy/Proxy/proxy_request.py | Gregor-Davies/Awesome-Scripts-1 | 141 | 1681420 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
A quick, reliable and random Web Proxy request application using Python.
"""
import requests
from bs4 import BeautifulSoup
from random import choice
def get_proxy() -> dict[str,object]:
"""
Returns a dictionary
Args:
"""
url = "https://www.sslproxi... | 0 | 2 | 0 | 0 | 2 | 0 |
session-5/libs/batch_norm.py | itamaro/CADL | 1,628 | 1681434 | <filename>session-5/libs/batch_norm.py
"""Batch Normalization for TensorFlow.
<NAME>, Jan 2016.
"""
import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
def batch_norm(x, phase_train, name='bn', decay=0.9, reuse=None,
affine=True):
"""
Batch normalization on convolutional... | 0 | 0 | 0 | 0 | 0 | 0 |
ansys/mapdl/core/_commands/graphics_/style.py | RGPATCHI/pymapdl | 194 | 1681453 | import warnings
from typing import Optional, Union
from ansys.mapdl.core.mapdl_types import MapdlInt
class Style:
def cplane(self, key: str="", **kwargs) -> object:
"""Specifies the cutting plane for section and capped displays.
APDL Command: /CPLANE
Parameters
----------
... | 35 | 12 | 0 | 0 | 47 | 0 |
Hackerrank/Practice/Python/4.sets/39.Check Subset.py | kushagra1212/Competitive-Programming | 994 | 1681461 | # Enter your code here. Read input from STDIN. Print output to STDOUT
T=int(input())
for i in range(T):
element1=int(input())
A=set(map(int,input().split()))
element2=int(input())
B=set(map(int,input().split()))
if A.issubset(B):
print("True")
else:
print("False")
| 0 | 0 | 0 | 0 | 0 | 0 |
plugins/airtel_sni/client.py | tgragnato/geneva | 1,182 | 1681467 | <filename>plugins/airtel_sni/client.py
import argparse
import os
from plugins.plugin_client import ClientPlugin
from subprocess import Popen, PIPE, TimeoutExpired
class SNIIndiaClient(ClientPlugin):
"""
Defines the SNI client.
"""
name = "airtel_sni"
def __init__(self, args):
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
ppci/arch/xtensa/arch.py | kl4w3i/ppci | 161 | 1681477 | <filename>ppci/arch/xtensa/arch.py
""" Xtensa architecture """
from ... import ir
from ...binutils.assembler import BaseAssembler
from ..arch import Architecture
from ..arch_info import ArchInfo, TypeInfo
from ..generic_instructions import Label, Alignment, RegisterUseDef
from ..data_instructions import Db, Dd, Dcd2, ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/ut/python/profiler/parser/test_minddata_analyzer.py | mindspore-ai/mindspore | 3,200 | 1681516 | <gh_stars>1000+
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_merge.py | rasterio/rasterio | 117 | 1681527 | """Tests of rasterio.merge"""
import boto3
from hypothesis import given, settings
from hypothesis.strategies import floats
import numpy
import pytest
import affine
import rasterio
from rasterio.merge import merge
# Non-coincident datasets test fixture.
# Three overlapping GeoTIFFs, two to the NW and one to the SE.
@... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_tools/test_header.py | Alexmod/mdutils | 110 | 1681534 | # Python
#
# This module implements tests for Header class.
#
# This file is part of mdutils. https://github.com/didix21/mdutils
#
# MIT License: (C) 2018 <NAME>
from unittest import TestCase
from mdutils.tools.Header import Header
class TestHeader(TestCase):
def test_atx_level_1(self):
title = "Text Ti... | 0 | 0 | 0 | 0 | 0 | 0 |
spirit/comment/bookmark/apps.py | Ke-xueting/Spirit | 974 | 1681539 | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class SpiritCommentBookmarkConfig(AppConfig):
name: str = 'spirit.comment.bookmark'
verbose_name: str = "Spirit Comment Bookmark"
label: str = 'spirit_comment_bookmark'
| 0 | 0 | 3 | 0 | 3 | 0 |
virtual/lib/python3.6/site-packages/rest_framework/utils/json.py | Ruterana/clone_instagram | 17,395 | 1681577 | """
Wrapper for the builtin json module that ensures compliance with the JSON spec.
REST framework should always import this wrapper module in order to maintain
spec-compliant encoding/decoding. Support for non-standard features should be
handled by users at the renderer and parser layer.
"""
import functools
import j... | 0 | 4 | 0 | 0 | 4 | 0 |
src/0556.next-greater-element-iii/next-greater-element-iii.py | lyphui/Just-Code | 782 | 1681584 | class Solution:
def nextGreaterElement(self, n: int) -> int:
n = list(str(n))
i = j = len(n) - 1
while i and n[i-1] >= n[i]:
i -= 1
if not i:
return -1
while n[j] <= n[i-1]:
j -= 1
n[i-1], n[j] = n[j], n[i-1]
n = int(''.join... | 1 | 1 | 0 | 0 | 2 | 0 |
where-to-mock/b.py | AIRONAXSolutions/python-education | 408 | 1681585 | from a import burn
from a import Toaster
print 'In b.py, at import time:', burn
print 'In b.py, at import time, Toaster:', Toaster
def toast():
print 'In b.py, at runtime:', burn
print 'In b.py, at runtime, Toaster:', Toaster
print 'In b.py, at runtime, Toaster.burn:', Toaster.burn
burn()
Toaster.... | 0 | 0 | 0 | 0 | 0 | 0 |
python/encrypt.py | githork/PageCrypt | 228 | 1681588 | #!/usr/bin/python3
try:
from pbkdf2 import PBKDF2
except:
print("install pbkdf2: \"pip3 install pbkdf2\"")
exit(1)
try:
from Crypto import Random
from Crypto.Util.py3compat import bchr
from Crypto.Cipher import AES
except:
print("install pycrypto: \"pip3 install pycrypto\"")
exit(1)
import os, sys
from base64 ... | 1 | 1 | 0 | 0 | 2 | 0 |
pylearn2/scripts/datasets/make_mnistplus.py | ikervazquezlopez/Pylearn2 | 2,045 | 1681590 | from __future__ import annotations
"""
Script to generate the MNIST+ dataset. The purpose of this dataset is to make a
more challenging MNIST-like dataset, with multiple factors of variation. These
factors can serve to evaluate a model's performance at learning invariant
features, or its ability to disentangle factors ... | 6 | 4 | 0 | 0 | 10 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.