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 |
|---|---|---|---|---|---|---|---|---|---|---|
src/genie/libs/parser/ios/show_snmp.py | balmasea/genieparser | 204 | 3346270 | ''' show_snmp.py
IOSXE parsers for the following show commands:
* show snmp mib
'''
# Python
import re
# Metaparser
from genie.metaparser import MetaParser
# import iosxe parser
from genie.libs.parser.iosxe.show_snmp import ShowSnmpMib as ShowSnmpMib_iosxe
# ==========================
# Parser for 'show snmp m... | 0 | 0 | 0 | 0 | 0 | 0 |
data/utils.py | ishine/FastVocoder | 116 | 3346284 | <reponame>ishine/FastVocoder<filename>data/utils.py
import os
import torch
import numpy as np
import torch.nn.functional as F
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
def parse_path_file(path_file):
index = []
with open(path_file, "r", encoding="utf-8") as f:
for path in ... | 0 | 0 | 0 | 0 | 0 | 0 |
zipf/bin/script_template.py | mikerenfro/py-rse | 190 | 3346292 | """One-line description of what the script does."""
import argparse
def main(args):
"""Run the program."""
print('Input file:', args.infile)
print('Output file:', args.outfile)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('infile', type=st... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/contrib/sanic/test_sanic_server.py | melancholy/dd-trace-py | 308 | 3346304 | import asyncio
import random
import httpx
import pytest
from sanic import Sanic
from sanic.config import DEFAULT_CONFIG
from sanic.response import json
# Handle naming of asynchronous client in older httpx versions used in sanic 19.12
httpx_client = getattr(httpx, "AsyncClient", getattr(httpx, "Client"))
@pytest.f... | 0 | 2 | 0 | 0 | 2 | 0 |
IORawData/CaloPatterns/test/hand_patterns.py | ckamtsikis/cmssw | 852 | 3346305 | import FWCore.ParameterSet.Config as cms
process = cms.Process("Patterns")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)
process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff')
process.GlobalTag.globaltag = 'DESIGN_3X_V14::All'
process.source = cms.Source("Empt... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/altair/examples/cumulative_wiki_donations.py | ajayiagbebaku/NFL-Model | 6,831 | 3346347 | <reponame>ajayiagbebaku/NFL-Model<gh_stars>1000+
"""
Cumulative Wikipedia Donations
==============================
This chart shows cumulative donations to Wikipedia over the past 10 years. Inspired by this `Reddit post <https://www.reddit.com/r/dataisbeautiful/comments/7guwd0/cumulative_wikimedia_donations_over_the_p... | 0 | 0 | 0 | 0 | 0 | 0 |
test/functional/feature_bitcoin_htlc.py | fuxingloh/defichain | 313 | 3346350 | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Copyright (c) DeFi Blockchain Developers
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""Test Bitcoin SPV HTLC"""
from test_framework.test_framework... | 0 | 0 | 0 | 0 | 0 | 0 |
anima/ui/user_dialog.py | MehmetErer/anima | 101 | 3346365 | # -*- coding: utf-8 -*-
from anima.ui.lib import QtCore, QtWidgets
from anima.ui.base import AnimaDialogBase, ui_caller
def UI(app_in=None, executor=None, **kwargs):
"""
:param app_in: A Qt Application instance, which you can pass to let the UI
be attached to the given applications event process.
:... | 0 | 0 | 0 | 0 | 0 | 0 |
kitti/prepare_data.py | dkoguciuk/frustum-pointnets | 1,426 | 3346370 | <reponame>dkoguciuk/frustum-pointnets
''' Prepare KITTI data for 3D object detection.
Author: <NAME>
Date: September 2017
'''
from __future__ import print_function
import os
import sys
import numpy as np
import cv2
from PIL import Image
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow_data_validation/utils/example_weight_map.py | rtg0795/data-validation | 621 | 3346416 | <reponame>rtg0795/data-validation
# Copyright 2020 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 applic... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter 3/rel_post_01.py | tanS30/Building-Machine-Learning-Systems-With-Python-Second-Edition | 1,490 | 3346421 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by <NAME> and <NAME>
# published by PACKT Publishing
#
# It is made available under the MIT License
import os
import sys
import scipy as sp
from sklearn.feature_extraction.text import CountVectorizer
from utils import ... | 0 | 4 | 0 | 0 | 4 | 0 |
client/verta/verta/environment/_python.py | VertaAI/modeldb | 624 | 3346425 | # -*- coding: utf-8 -*-
from __future__ import annotations
import copy
import logging
import os
import sys
from ..external import six
from .._protos.public.modeldb.versioning import (
VersioningService_pb2 as _VersioningService,
)
from .._protos.public.modeldb.versioning import Environment_pb2 as _EnvironmentSer... | 6 | 11 | 0 | 0 | 17 | 0 |
scripts/external_libs/scapy-2.3.1/python2/scapy/layers/isakmp.py | klement/trex-core | 995 | 3346429 | <reponame>klement/trex-core
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) <NAME> <<EMAIL>>
## This program is published under a GPLv2 license
"""
ISAKMP (Internet Security Association and Key Management Protocol).
"""
import struct
from scapy.packet i... | 0 | 0 | 0 | 0 | 0 | 0 |
pytorch_image_classification/__init__.py | JokerYan/pytorch_image_classification | 1,114 | 3346439 | <reponame>JokerYan/pytorch_image_classification
from .config import get_default_config, update_config
from .collators import create_collator
from .transforms import create_transform
from .datasets import create_dataset, create_dataloader
from .models import apply_data_parallel_wrapper, create_model
from .losses import ... | 0 | 0 | 0 | 0 | 0 | 0 |
g-code-testing/g_code_parsing/g_code.py | mrod0101/opentrons | 235 | 3346443 | <filename>g-code-testing/g_code_parsing/g_code.py
from __future__ import annotations
import re
from typing import List
from g_code_parsing.errors import UnparsableGCodeError
from opentrons.drivers.smoothie_drivers.driver_3_0 import GCODE as SMOOTHIE_G_CODE
from opentrons.drivers.mag_deck.driver import GCODE as MAGDECK... | 0 | 0 | 0 | 0 | 0 | 0 |
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/g/generic_alias/generic_alias_mixed_py39.py | ciskoinch8/vimrc | 463 | 3346463 | """Test generic alias support with mix of typing.py and stdlib types (PY39+)."""
# flake8: noqa
# pylint: disable=missing-docstring,pointless-statement
# pylint: disable=too-few-public-methods,multiple-statements,line-too-long
import collections
import collections.abc
import contextlib
import re
import typing
# Type a... | 0 | 0 | 9 | 0 | 9 | 0 |
fairseq/models/fairseq_encoder.py | ypsoh/fairseq | 651 | 3346475 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import torch
import torch.nn as nn
from typing import Dict, List, NamedTuple, Optional
from torch import Te... | 3 | 4 | 0 | 0 | 7 | 0 |
tests/test_parse_mysql_cnf.py | KazakovDenis/django-extensions | 4,057 | 3346482 | # -*- coding: utf-8 -*-
import os
import shutil
from tempfile import mkdtemp
from django.test import TestCase
from django_extensions.management.mysql import parse_mysql_cnf
class ParseMysqlCnfTests(TestCase):
"""Tests for parse_mysql_cnf."""
@classmethod
def setUpClass(cls):
cls.tmpdir = mkdtem... | 0 | 0 | 0 | 0 | 0 | 0 |
runtests.py | timgates42/django-nap | 114 | 3346491 | <reponame>timgates42/django-nap
#!/usr/bin/env python
# Adapted from https://raw.githubusercontent.com/hzy/django-polarize/master/runtests.py
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
import django
if not settings.configured:
settings.configure(
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/ci/cherry_pick_utils/cherrypick.py | vvd170501/ClickHouse | 8,629 | 3346519 | <filename>tests/ci/cherry_pick_utils/cherrypick.py
# -*- coding: utf-8 -*-
"""
Backports changes from PR to release branch.
Requires multiple separate runs as part of the implementation.
First run should do the following:
1. Merge release branch with a first parent of merge-commit of PR (using 'ours' strategy). (bran... | 0 | 0 | 0 | 0 | 0 | 0 |
data/vqa_dataset.py | igor0/BLIP | 473 | 3346566 | <filename>data/vqa_dataset.py
import os
import json
import random
from PIL import Image
import torch
from torch.utils.data import Dataset
from data.utils import pre_question
from torchvision.datasets.utils import download_url
class vqa_dataset(Dataset):
def __init__(self, transform, ann_root, vqa_root, vg_root, ... | 0 | 0 | 0 | 0 | 0 | 0 |
openstackclient/tests/functional/common/test_extension.py | cloudification-io/python-openstackclient | 262 | 3346570 | <filename>openstackclient/tests/functional/common/test_extension.py
# Copyright (c) 2017, Intel Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
... | 0 | 0 | 0 | 0 | 0 | 0 |
lrs/admin.py | taotau/ADL_LRS | 197 | 3346603 | <filename>lrs/admin.py
from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.sites import AlreadyRegistered
# Registers all models for admin
for appname in settings.ADMIN_REGISTER_APPS:
myapp = apps.get_app_config(appname)
for model in myapp.ge... | 0 | 0 | 0 | 0 | 0 | 0 |
novaclient/tests/functional/v2/legacy/test_instances.py | klmitch/python-novaclient | 199 | 3346630 | # 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
# d... | 0 | 0 | 1 | 0 | 1 | 0 |
Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.py | BlackBoxAM/Lean | 6,580 | 3346658 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 | 1 | 0 | 0 | 1 | 0 |
allennlp_models/vision/predictors/vilbert_ir.py | zhiyangxu-umass/allennlp-models | 402 | 3346679 | from typing import List, Dict
from overrides import overrides
import numpy
from allennlp.common.file_utils import cached_path
from allennlp.common.util import JsonDict
from allennlp.data import Instance
from allennlp.data.fields import LabelField
from allennlp.predictors.predictor import Predictor
@Predictor.regist... | 5 | 3 | 0 | 0 | 8 | 0 |
lvl1/genPreds.py | maz2009/Grasp-and-lift-EEG-challenge | 223 | 3346680 | <reponame>maz2009/Grasp-and-lift-EEG-challenge
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 8 21:56:55 2015.
@author: alex, rc
This script contain code to generate lvl1 model prediction.
usage : python genPreds.py model_name mode
with mode = val for validation and val = test for test.
This script will read the mo... | 0 | 0 | 0 | 0 | 0 | 0 |
autotest/t073_test_cvfd.py | andrewcalderwood/flopy | 351 | 3346681 | import numpy as np
import flopy
from flopy.utils.cvfdutil import to_cvfd, gridlist_to_disv_gridprops
def test_tocvfd1():
vertdict = {}
vertdict[0] = [(0, 0), (100, 0), (100, 100), (0, 100), (0, 0)]
vertdict[1] = [(100, 0), (120, 0), (120, 20), (100, 20), (100, 0)]
verts, iverts = to_cvfd(vertdict)
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/__init__.py | skeledrew/birdseye | 1,507 | 3346684 | <reponame>skeledrew/birdseye
import os
from cheap_repr import repr_str, cheap_repr
from birdseye import eye
path = os.path.join(os.path.expanduser('~'), '.birdseye_test.db')
if not os.environ.get('BIRDSEYE_SERVER_RUNNING'):
# Remove the database to start from scratch
if os.path.exists(path):
os.remove... | 0 | 0 | 0 | 0 | 0 | 0 |
tfx/dsl/input_resolution/resolver_op_test.py | avelez93/tfx | 1,813 | 3346690 | <reponame>avelez93/tfx<filename>tfx/dsl/input_resolution/resolver_op_test.py
# Copyright 2021 Google 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://w... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/annotations_example.py | greyli/webargs | 601 | 3346701 | <filename>examples/annotations_example.py
"""Example of using Python 3 function annotations to define
request arguments and output schemas.
Run the app:
$ python examples/annotations_example.py
Try the following with httpie (a cURL-like utility, http://httpie.org):
$ pip install httpie
$ http GET :5001/... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/text_to_sql/IGSQL/model/token_predictor.py | JeremyZhao1998/PaddleNLP | 7,091 | 3346708 | <gh_stars>1000+
# Copyright (c) 2021 PaddlePaddle 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... | 0 | 0 | 0 | 0 | 0 | 0 |
example/reddit.py | PCMan/flask-oauthlib | 1,292 | 3346709 | <filename>example/reddit.py
from flask import Flask, redirect, url_for, session, request
from flask_oauthlib.client import OAuth, OAuthException, OAuthRemoteApp, parse_response
from flask_oauthlib.utils import to_bytes
import uuid
import base64
import time
REDDIT_APP_ID = '6WnQXb-elQ3DLw'
REDDIT_APP_SECRET = 'KzQickJE... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/__init__.py | joouha/euporie | 505 | 3346730 | # -*- coding: utf-8 -*-
"""Test suite for euporie."""
| 0 | 0 | 0 | 0 | 0 | 0 |
others/WorkHelper/Main_GUI.py | sesu089/stackoverflow | 302 | 3346746 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Main_GUI.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow... | 0 | 0 | 0 | 0 | 0 | 0 |
platforms/atlys.py | auscompgeek/litex-buildenv | 198 | 3346771 | # Support for the Digilent Atlys (http://digilentinc.com/atlys/) - The board used for HDMI2USB prototyping.
from litex.build.generic_platform import *
from litex.build.xilinx import XilinxPlatform, iMPACT
# There appear to be 4 x LTC2481C on the U1-SCL / U1-SDA lines connected to the Cypress
class DynamicLVCMOS(obje... | 2 | 4 | 9 | 1 | 16 | 0 |
src/sparsezoo/objects/recipe.py | neuralmagic/sparsezoo | 116 | 3346775 | # Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 82 | 20 | 4 | 2 | 108 | 0 |
single_shot_detection/outils.py | oumayb/ArtMiner | 107 | 3346781 | from tqdm import tqdm
import os
import PIL.Image as Image
import PIL.ImageDraw as ImageDraw
import numpy as np
import feature
import torch
import torch.nn.functional as F
from torch.autograd import Variable
## Initialize results of dictionary
def ResDictInit(query, searchDir) :
res = {}
for category in tqdm(quer... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/datachannel-vpn/vpn.py | thedilletante/aiortc | 1,992 | 3346784 | import argparse
import asyncio
import logging
import tuntap
from aiortc import RTCIceCandidate, RTCPeerConnection, RTCSessionDescription
from aiortc.contrib.signaling import BYE, add_signaling_arguments, create_signaling
logger = logging.Logger("vpn")
def channel_log(channel, t, message):
logger.info("channel(... | 0 | 0 | 0 | 0 | 0 | 0 |
src/ghhops-server-py/ghhops_server/component.py | talebia/compute.rhino3d | 182 | 3346799 | <gh_stars>100-1000
class HopsComponent:
"""Hops Component"""
def __init__(
self,
uri,
name,
nickname,
desc,
cat,
subcat,
icon,
inputs,
outputs,
handler,
):
self.uri = uri
# TODO: customize solve uri?
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/autoanchor.py | naokazuterada/MarkdownTOC | 299 | 3346801 | <reponame>naokazuterada/MarkdownTOC<filename>tests/autoanchor.py
# coding:utf-8
from base import TestBase
class TestAutoanchor(TestBase):
"""Test for attributes \'autoanchor\'"""
# for debug
# def tearDown(self):
# pass
text = """
<!-- MarkdownTOC {0} -->
<!-- /MarkdownTOC -->
# Changelog
... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter11/listing11_10.py | hohsieh/osgeopy-code | 160 | 3346820 | # Script to use proximity analysis and compute mean distance
# from roads.
import os
import sys
from osgeo import gdal, ogr
folder = r'D:\osgeopy-data\Idaho'
roads_ln = 'allroads'
wilderness_ln = 'wilderness'
road_raster_fn = 'church_roads.tif'
proximity_fn = 'proximity.tif'
# Set the cell size for the analysis.
cel... | 0 | 0 | 0 | 0 | 0 | 0 |
mmpdblib/command_support.py | trumanw/mmpdb | 102 | 3346840 | <reponame>trumanw/mmpdb
# mmpdb - matched molecular pair database generation and analysis
#
# Copyright (c) 2015-2017, <NAME> Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source cod... | 0 | 0 | 0 | 0 | 0 | 0 |
contrib/descriptions/__init__.py | berndonline/flan | 3,711 | 3346842 | <gh_stars>1000+
from .description_provider import VulnDescription, VulnDescriptionProvider
from .cveproject import CveProjectProvider
| 0 | 0 | 0 | 0 | 0 | 0 |
dash_docs/chapters/dash_slicer/examples/slicer_example4.py | joelostblom/dash-docs | 379 | 3346866 | import json
import dash
import dash_html_components as html
from dash.dependencies import Input, Output
import imageio
from dash_slicer import VolumeSlicer
app = dash.Dash(__name__, update_title=None)
vol = imageio.volread("imageio:stent.npz")
slicer = VolumeSlicer(app, vol)
slicer.graph.config["scrollZoom"] = False... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/nullable.py | s-knibbs/dataclasses-jsonschema | 143 | 3346874 | """
This script is used to test if mypy understands that the Nullable type is always False-y.
"""
from __future__ import annotations
from dataclasses import dataclass
from dataclasses_jsonschema.type_defs import Nullable
@dataclass
class Example:
name: Nullable[str | None] = None
example = Example("sienna")
... | 0 | 0 | 1 | 0 | 1 | 0 |
imagenet_pipeline/configs/resnet101_fixup.py | PavelOstyakov/pipeline | 214 | 3346875 | <reponame>PavelOstyakov/pipeline
from .base import ConfigImageNetBase
from torch.nn import DataParallel
from pipeline.models.image_models.resnet_fixup import resnet101
MODEL_SAVE_PATH = "models/imagenet_resnet_101_fixup"
class Config(ConfigImageNetBase):
def __init__(self, model_save_path=MODEL_SAVE_PATH):
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/data/expected/main/main_openapi_oas_response_reference/output.py | adaamz/datamodel-code-generator | 891 | 3346877 | <filename>tests/data/expected/main/main_openapi_oas_response_reference/output.py<gh_stars>100-1000
# generated by datamodel-codegen:
# filename: oas_response_reference.yaml
# timestamp: 2019-07-26T00:00:00+00:00
from __future__ import annotations
from typing import Optional
from pydantic import BaseModel
clas... | 0 | 0 | 0 | 0 | 0 | 0 |
url.py | xinghejd/opencanary_web | 633 | 3346923 | #!/usr/bin/env python
#coding:utf-8
"""
Author: pirogue --<<EMAIL>>
Purpose: URL路由配置文件
Created: 2017/4/8
Site: http://pirogue.org
"""
from handlers import login, hello
from handlers import logcollection, paginationlog, hello, email, index, chart, whiteiplist, whiteport, host
import unittest
u... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/utils.py | nats-io/nats.py | 335 | 3346932 | <filename>tests/utils.py
import os
import time
import signal
import ssl
import asyncio
import subprocess
import unittest
import http.client
from functools import wraps
try:
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
except:
pass
THIS_DIR = os.path.dirname(os.path.abspath(__file_... | 0 | 0 | 0 | 0 | 0 | 0 |
maintenance/db-init/db-init.py | xwu2git/Smart-City-Sample | 126 | 3346950 | <reponame>xwu2git/Smart-City-Sample
#!/usr/bin/python3
from signal import SIGTERM, signal
from db_ingest import DBIngest
from provision import Provision
from configuration import env
import traceback
import requests
import time
import json
import re
dbhost=env["DBHOST"]
dbchost=env.get("DBCHOST",None)
office=list(map... | 0 | 0 | 0 | 0 | 0 | 0 |
changes/models/jobstep.py | vault-the/changes | 443 | 3346959 | <filename>changes/models/jobstep.py
import uuid
from datetime import datetime
from sqlalchemy import Column, String, DateTime, ForeignKey
from sqlalchemy.orm import relationship, backref
from sqlalchemy.schema import Index
from changes.config import db
from changes.constants import Status, Result
from changes.db.util... | 0 | 0 | 0 | 0 | 0 | 0 |
petl/util/parsers.py | OptionMetrics/petl | 495 | 3346967 | <gh_stars>100-1000
from __future__ import absolute_import, print_function, division
import datetime
from petl.compat import long
def datetimeparser(fmt, strict=True):
"""Return a function to parse strings as :class:`datetime.datetime` objects
using a given format. E.g.::
>>> from petl import dateti... | 0 | 0 | 0 | 0 | 0 | 0 |
src/decoder-neural/src/main/python/mmt/__init__.py | Centaurioun/modernmt | 154 | 3346987 | import locale
import os
import fairseq
from fairseq.models import register_model_architecture
from fairseq.models.transformer import base_architecture
from fairseq.tasks import register_task
from fairseq.tasks.translation import TranslationTask
from mmt.textencoder import SubwordDictionary
if locale.getpreferredenco... | 2 | 2 | 0 | 0 | 4 | 0 |
BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py | CEOALT1/RefindPlusUDK | 151 | 3346993 | ## @file
# This is an XML API that uses a syntax similar to XPath, but it is written in
# standard python so that no extra python packages are required to use it.
#
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made availa... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/barcode/misc/python/test/test_barcode_detector.py | ptelang/opencv_contrib | 7,158 | 3346997 | #!/usr/bin/env python
'''
===============================================================================
Barcode detect and decode pipeline.
===============================================================================
'''
import os
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests
class ... | 0 | 0 | 0 | 0 | 0 | 0 |
maskrcnn_benchmark/modeling/detector/detectors.py | markson14/RRPN_pytorch | 294 | 3347025 | <gh_stars>100-1000
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from .generalized_rcnn import GeneralizedRCNN
from .generalized_rrpn_rcnn import GeneralizedRRPNRCNN
_DETECTION_META_ARCHITECTURES = {"GeneralizedRCNN": GeneralizedRCNN,
"RRPN":GeneralizedRRPNRCN... | 0 | 0 | 0 | 0 | 0 | 0 |
thefuck/rules/lein_not_task.py | HiteshMah-Jan/thefuck | 75,504 | 3347044 | import re
from thefuck.utils import replace_command, get_all_matched_commands, for_app
from thefuck.specific.sudo import sudo_support
@sudo_support
@for_app('lein')
def match(command) -> object:
return (command.script.startswith('lein')
and "is not a task. See 'lein help'" in command.output
... | 0 | 2 | 0 | 0 | 2 | 0 |
py2exe_setup.py | skyline75489/SimpleDNS | 204 | 3347048 | <reponame>skyline75489/SimpleDNS
from distutils.core import setup
import sys
import os
# require import
import py2exe
# require shadowsocks
twpath = os.path.abspath(os.path.join(sys.path[-1], "twisted"))
if not os.path.isdir(twpath):
raise IOError("require twisted")
with open('README.rst') as f:
long_description =... | 0 | 0 | 0 | 0 | 0 | 0 |
query_strategies/adversarial_bim.py | nannullna/deep-active-learning | 465 | 3347053 | import numpy as np
import torch
import torch.nn.functional as F
from .strategy import Strategy
from tqdm import tqdm
class AdversarialBIM(Strategy):
def __init__(self, dataset, net, eps: float=0.05):
super(AdversarialBIM, self).__init__(dataset, net)
self.eps = eps
def cal_dis(self, x) -> obje... | 1 | 2 | 0 | 0 | 3 | 0 |
tensorboard/plugins/mesh/metadata.py | qzchenwl/tensorboard | 353 | 3347067 | <filename>tensorboard/plugins/mesh/metadata.py
# 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/lice... | 0 | 0 | 0 | 0 | 0 | 0 |
wrappers/dlltrace.py | Gurten/apitrace | 1,723 | 3347070 | ##########################################################################
#
# Copyright 2008-2010 VMware, Inc.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software withou... | 0 | 1 | 0 | 0 | 1 | 0 |
ursina/scripts/terraincast.py | LyfeOnEdge/ursina | 1,431 | 3347089 | from ursina import *
from ursina import distance as ursina_distance
from math import inf
from ursina.hit_info import HitInfo
def prepare_terrain(terrain, debug: bool=False, calculate_normals: bool=True):
#does calculations that are needed for every terraincast check, and sets up the entities that manage transof... | 4 | 2 | 0 | 0 | 6 | 0 |
analytics/common/rec2db.py | xwu2git/Smart-City-Sample | 126 | 3347093 | <reponame>xwu2git/Smart-City-Sample
#!/usr/bin/python3
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from configuration import env
import requests
import os
office=list(map(float,env["OFFICE"].split(",")))
sthost=env["STHOST"]
class Handler(FileSystemEventHandler):
de... | 0 | 0 | 0 | 0 | 0 | 0 |
nbconvert/preprocessors/tests/test_latex.py | moskiGithub/nbconv | 728 | 3347145 | """Tests for the latex preprocessor"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from .base import PreprocessorTestsBase
from ..latex import LatexPreprocessor
class TestLatex(PreprocessorTestsBase):
"""Contains test functions for latex.py"""
def b... | 0 | 1 | 0 | 0 | 1 | 0 |
ztag/annotations/FtpLutron.py | justinbastress/ztag | 107 | 3347167 | import re
from ztag.annotation import Annotation
from ztag.annotation import OperatingSystem
from ztag.annotation import Type
from ztag.annotation import Manufacturer
from ztag import protocols
import ztag.test
class FtpLutron(Annotation):
protocol = protocols.FTP
subprotocol = protocols.FTP.BANNER
port: ... | 0 | 1 | 2 | 0 | 3 | 0 |
sahara/tests/unit/service/edp/storm/test_storm.py | openstack/sahara | 161 | 3347204 | <reponame>openstack/sahara<gh_stars>100-1000
# Copyright (c) 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | 0 | 0 | 0 | 0 | 0 | 0 |
detect_face.py | JeeveshN/Face-Detect | 109 | 3347242 | <reponame>JeeveshN/Face-Detect<filename>detect_face.py
from random import randint
import cv2
import sys
import os
import traceback
CASCADE="Face_cascade.xml"
FACE_CASCADE=cv2.CascadeClassifier(CASCADE)
def detect_faces(image_path,display=True):
image=cv2.imread(image_path)
image_grey=cv2.cvtColor(image,cv2.C... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_a_star_variants.py | duken72/PythonRobotics | 15,431 | 3347251 | <filename>tests/test_a_star_variants.py
import PathPlanning.AStar.a_star_variants as a_star
import conftest
def test_1():
# A* with beam search
a_star.show_animation = False
a_star.use_beam_search = True
a_star.main()
reset_all()
# A* with iterative deepening
a_star.use_iterative_deepeni... | 0 | 0 | 0 | 0 | 0 | 0 |
xbox/webapi/scripts/search.py | Landcross/xbox-webapi-python | 122 | 3347280 | """
Example script that utilizes EDSProvider to search XBL marketplace
"""
import argparse
import asyncio
from pprint import pprint
import sys
from aiohttp import ClientResponseError, ClientSession
from xbox.webapi.api.client import XboxLiveClient
from xbox.webapi.authentication.manager import AuthenticationManager
... | 0 | 0 | 0 | 0 | 0 | 0 |
analysis_engine/get_pricing.py | virdesai/stock-analysis-engine | 819 | 3347302 | from __future__ import annotations
"""
Utilities for getting pricing data from yahoo finance for:
- pricing
- news
- options
Internal version of:
https://github.com/neberej/pinance/master/pinance/engine/yfinance2.py
"""
import datetime
import json
import random
import urllib.request
import urllib.error
import urll... | 3 | 6 | 0 | 0 | 9 | 0 |
Tools/PostProcessing/plot_parallel.py | mrowan137/amrex | 131 | 3347307 | <filename>Tools/PostProcessing/plot_parallel.py
# Copyright 2019 <NAME>, <NAME>
#
# This file is part of WarpX.
#
# License: BSD-3-Clause-LBNL
import os
import glob
import matplotlib
import sys
import argparse
import yt
yt.funcs.mylog.setLevel(50)
import numpy as np
import matplotlib.pyplot as plt
'''
This script loo... | 0 | 0 | 0 | 0 | 0 | 0 |
youtube_dl/extractor/yandexvideo.py | jonyg80/youtube-dl | 66,635 | 3347310 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
try_get,
url_or_none,
)
class YandexVideoIE(InfoExtractor):
_VALID_URL: str = r'''(?x)
https?://
(?:
... | 0 | 1 | 2 | 0 | 3 | 0 |
posthog/migrations/0050_dashboards.py | avoajaugochukwu/posthog | 7,409 | 3347358 | <reponame>avoajaugochukwu/posthog<gh_stars>1000+
# Generated by Django 3.0.5 on 2020-05-07 09:12
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models, transaction
def forwards(apps, schema_editor):
Team = apps.get_model("posthog", "Team")
Dashboard = apps... | 0 | 0 | 0 | 0 | 0 | 0 |
mapchete/commands/__init__.py | Scartography/mapchete | 161 | 3347368 | <gh_stars>100-1000
"""
This package contains easy to access functions which otherwise would have to be called via the CLI.
This should make the use from within other scripts, notebooks, etc. easier.
"""
from mapchete.commands._convert import convert
from mapchete.commands._cp import cp
from mapchete.commands._execute i... | 0 | 0 | 0 | 0 | 0 | 0 |
amazon_kclpy/v2/__init__.py | rconroy293/amazon-kinesis-client-python | 338 | 3347379 | # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
This package provides an interface to the KCL MultiLangDaemon. This interface
manages the interaction with the MultiLangDaemon so that developers can focus
on implementing their record processor. A record... | 0 | 0 | 0 | 0 | 0 | 0 |
megaman/datasets/__init__.py | ffancheng/megaman | 303 | 3347394 | from .datasets import (get_megaman_image, generate_megaman_data,
generate_megaman_manifold, generate_noisefree_hourglass,
generate_noisy_hourglass)
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/layout_settings.py | pzahemszky/guizero | 320 | 3347432 | <reponame>pzahemszky/guizero
from guizero import App, Box, ListBox, CheckBox, Combo, PushButton
app = App()
list_boxes = Box(app, width="fill")
ListBox(list_boxes, items=["Times New Roman", "Courier", "Verdana"], align="left", width="fill")
ListBox(list_boxes, items=["Regular", "Italic", "Bold", "Bold Italic"], align... | 0 | 0 | 0 | 0 | 0 | 0 |
tests_obsolete/extension/pipeline_/single_passthrough/test_pipeline_single_passthrough.py | akmaru/veriloggen | 232 | 3347436 | <gh_stars>100-1000
from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import pipeline_single_passthrough
expected_verilog = """
module test;
reg CLK;
reg RST;
reg [32-1:0] x;
reg vx;
wire rx;
wire [32-1:0] y;
wire vy;
reg ry;
blinkled
uut
(
.CLK(CL... | 0 | 0 | 0 | 0 | 0 | 0 |
iepy/preprocess/ner/combiner.py | francolq/iepy | 813 | 3347497 | from iepy.preprocess.ner.base import BaseNERRunner
class CombinedNERRunner(BaseNERRunner):
"""A NER runner that is the combination of different NER runners
(therefore, different NERs).
The entities returned by each NER are combined by the method merge_entities
without any check, possibly leading to d... | 3 | 6 | 0 | 1 | 10 | 0 |
src/genie/libs/parser/ios/show_fdb.py | balmasea/genieparser | 204 | 3347499 | """show_fdb.py
supported commands:
* show mac address-table
* show mac address-table vlan {vlan}
* show mac address-table aging-time
* show mac address-table learning
"""
# Python
import re
# Metaparser
from genie.metaparser import MetaParser
# import parser utils
from genie.libs.parser.util... | 0 | 0 | 0 | 0 | 0 | 0 |
bgmi/front/resources.py | kaaass/BGmi | 483 | 3347538 | <reponame>kaaass/BGmi<gh_stars>100-1000
import datetime
import os
from collections import defaultdict
from icalendar import Calendar, Event
from bgmi.config import SAVE_PATH
from bgmi.front.base import BaseHandler
from bgmi.lib.constants import BANGUMI_UPDATE_TIME
from bgmi.lib.models import Download, Followed
clas... | 0 | 0 | 0 | 0 | 0 | 0 |
pupper/Config.py | 13221325403/StanfordQuadruped | 1,125 | 3347547 | import numpy as np
from pupper.ServoCalibration import MICROS_PER_RAD, NEUTRAL_ANGLE_DEGREES
from pupper.HardwareConfig import PS4_COLOR, PS4_DEACTIVATED_COLOR
from enum import Enum
# TODO: put these somewhere else
class PWMParams:
def __init__(self):
self.pins = np.array([[2, 14, 18, 23], [3, 15, 27, 24],... | 0 | 8 | 0 | 57 | 65 | 0 |
sympy/integrals/meijerint_doc.py | bigfooted/sympy | 8,323 | 3347553 | <filename>sympy/integrals/meijerint_doc.py
""" This module cooks up a docstring when imported. Its only purpose is to
be displayed in the sphinx documentation. """
from typing import Any, Dict, List, Tuple, Type
from sympy.integrals.meijerint import _create_lookup_table
from sympy import latex, Eq, Add, Symbol
... | 0 | 0 | 0 | 0 | 0 | 0 |
talkop/parse_vivire_card_catalog.py | KaihongGo/ONEPIECE-KG | 173 | 3347559 | '''
http://bbs.talkop.com/
抓取海贼王论坛
收获(都很牛逼)
1 发现用类写爬虫 比用函数写爬虫爽一些,有些参数不用一直传,都在__init__中,在这里就是self.data_list。
2 json 终于意识到json的价值了,把列表类型转换成json类型,保存在文件中,可以从文件中copy出来,有转化json类型的网站,直接转化下,就可以看到其中的数据了
3 etree的使用,参数是bytes类型
'''
import os
import json
import requests
from lxml import etree
class TalkopSpider(obj... | 0 | 1 | 0 | 4 | 5 | 0 |
freeline_core/task_engine.py | phitattoo/freeline | 6,094 | 3347565 | # -*- coding:utf8 -*-
import Queue
import threading
import time
import traceback
from logger import Logger
from task import ExecutableTask, Task
class ThreadPool(object):
def __init__(self):
self._init_core_worker()
def _init_core_worker(self):
self.core_worker = CoreWorker()
self.cor... | 1 | 3 | 0 | 6 | 10 | 0 |
util/install.py | samrushing/irken-compiler | 153 | 3347607 | # -*- Mode: Python -*-
# run this as $ python util/install.py
import os
import sys
PJ = os.path.join
# if you change this, you should consider changing the default
# value in self/context.scm to match it.
# N.B.: you will also need to change the definition of FFI-PATH
# in lib/ctype.scm.
PREFIX = "/usr/local/"
... | 0 | 1 | 0 | 0 | 1 | 0 |
src/build/android/incremental_install/generate_android_manifest.py | lazymartin/naiveproxy | 2,219 | 3347608 | #!/usr/bin/env python
#
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Creates an AndroidManifest.xml for an incremental APK.
Given the manifest file for the real APK, generates an AndroidManifest.xml ... | 0 | 3 | 0 | 0 | 3 | 0 |
salt/output/no_out_quiet.py | markgras/salt | 9,425 | 3347610 | <gh_stars>1000+
"""
Display no output
=================
No output is produced when this outputter is selected
CLI Example:
.. code-block:: bash
salt '*' foo.bar --out=quiet
"""
# Define the module's virtual name
__virtualname__ = "quiet"
def __virtual__():
return __virtualname__
def output(ret, **kwarg... | 0 | 0 | 0 | 0 | 0 | 0 |
var/spack/repos/builtin/packages/raxml-ng/package.py | LiamBindle/spack | 2,360 | 3347640 | <reponame>LiamBindle/spack<filename>var/spack/repos/builtin/packages/raxml-ng/package.py
# 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 Raxml... | 0 | 0 | 0 | 0 | 0 | 0 |
cme/protocols/smb/database.py | retr0-13/CrackMapExec | 6,044 | 3347645 | from __future__ import annotations
import logging
class database:
def __init__(self, conn):
self.conn = conn
@staticmethod
def db_schema(db_conn):
db_conn.execute('''CREATE TABLE "computers" (
"id" integer PRIMARY KEY,
"ip" text,
"hostname" text,
... | 24 | 22 | 0 | 0 | 46 | 0 |
src/s2v_encoder.py | aladjov/S2V | 214 | 3347657 | # Copyright 2017 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... | 4 | 10 | 0 | 0 | 14 | 0 |
grr/core/grr_response_core/lib/util/io_test.py | khanhgithead/grr | 4,238 | 3347682 | <filename>grr/core/grr_response_core/lib/util/io_test.py
#!/usr/bin/env python
import io
import itertools
from absl.testing import absltest
from grr_response_core.lib.util import io as ioutil
class ChunkTest(absltest.TestCase):
def testSizeZero(self):
with self.assertRaises(ValueError):
list(ioutil.Chun... | 0 | 0 | 0 | 0 | 0 | 0 |
integrations/pytorch/train.py | neuralmagic/sparseml | 922 | 3347686 | # Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 7 | 1 | 27 | 0 | 35 | 0 |
rl_algorithms/common/abstract/learner.py | medipixel/rl_algorithms | 466 | 3347687 | """Base Learner & LearnerWrapper class.
- Author: <NAME>
- Contact: <EMAIL>
"""
from abc import ABC, abstractmethod
from collections import OrderedDict
import os
import shutil
from typing import Tuple, Union
import torch
import torch.nn as nn
from rl_algorithms.utils.config import ConfigDict
TensorTuple = Tuple[to... | 21 | 10 | 0 | 1 | 32 | 0 |
tests/testapp/test_rewrite_query.py | gelo-zhukov/django-mysql | 502 | 3347698 | from django.db import connection
from django.test import TestCase
from django.test.utils import override_settings
from django_mysql.rewrite_query import rewrite_query
from tests.testapp.utils import CaptureLastQuery
class RewriteQueryTests(TestCase):
def test_it_doesnt_touch_normal_queries(self):
self.ch... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | mturch/spyder-notebook | 419 | 3347699 | # -*- coding: utf-8 -*-
#
# Copyright (c) Spyder Project Contributors
# Licensed under the terms of the MIT License
"""Setup script for spyder_notebook."""
# Standard library imports
import ast
import distutils
import os
import os.path as osp
import pipes
import subprocess
import sys
# Third party imports
from setup... | 1 | 3 | 0 | 0 | 4 | 0 |
demos/extract_motion_feats.py | Humoon/aistplusplus_api | 189 | 3347705 | # coding=utf-8
# Copyright 2020 The Google AI Perception Team 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 b... | 0 | 0 | 0 | 0 | 0 | 0 |
courses/machine_learning/deepdive2/structured/solutions/babyweight/trainer/task.py | laurenzberger/training-data-analyst | 6,140 | 3347720 | <reponame>laurenzberger/training-data-analyst
import argparse
import json
import os
from babyweight.trainer import model
import tensorflow as tf
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--job-dir",
help="this model ignores this field, but it is requi... | 0 | 0 | 0 | 0 | 0 | 0 |
neo/Network/core/tests/test_uint_base.py | volekerb/neo-python | 387 | 3347727 | <filename>neo/Network/core/tests/test_uint_base.py
from unittest import TestCase
from neo.Network.core.uintbase import UIntBase
class UIntBaseTest(TestCase):
def test_create_with_empty_data(self):
x = UIntBase(num_bytes=2)
self.assertEqual(len(x._data), 2)
self.assertEqual(x._data, b'\x00\... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.