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 |
|---|---|---|---|---|---|---|---|---|---|---|
source/appModules/code - insiders.py | marlon-sousa/nvda | 1,592 | 1689591 | # A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2020 NV Access Limited, <NAME>
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
""" App module for Visual Studio Code Insiders.
This app module simply inherrits from the app module for the stable version of Co... | 0 | 0 | 0 | 0 | 0 | 0 |
peeringdb/migrations/0013_auto_20201207_2233.py | ggidofalvy-tc/peering-manager | 173 | 1689605 | # Generated by Django 3.1.3 on 2020-12-07 21:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
("peeringdb", "0012_peerrecord_visible"),
]
def flush_peeringdb_tables(apps, schema_editor):
apps.get_model("peeringdb", "Conta... | 0 | 0 | 2 | 0 | 2 | 0 |
core/apps/capture_node_api/lib/disk_management.py | near-feign/pcapdb | 244 | 1689623 | from __future__ import annotations
from collections import defaultdict
import fcntl
import io
import os
import re
import subprocess
import sys
import tempfile
from django.conf import settings
#from celery.utils import log as logging
import logging
log = logging.getLogger(__name__)
#log = logging.task_logger
__auth... | 10 | 33 | 14 | 3 | 60 | 0 |
examples/database/task_script.py | Howdy-Personally/tensorlayer-master | 4,484 | 1689667 | """Sample task script."""
import tensorflow as tf
import tensorlayer as tl
# tf.logging.set_verbosity(tf.logging.DEBUG)
tl.logging.set_verbosity(tl.logging.DEBUG)
# connect to database
db = tl.db.TensorHub(ip='localhost', port=27017, dbname='temp', project_name='tutorial')
# load dataset from database
X_train, y_t... | 0 | 2 | 0 | 0 | 2 | 0 |
analysis/classification.py | maxwellyin/arxiv-public-datasets | 217 | 1689681 | """
Classification.py
"""
import os
import json
import gzip
import json
import numpy as np
from datetime import datetime
from sklearn.linear_model import LogisticRegression, SGDClassifier
from arxiv_public_data.embeddings.util import load_embeddings, fill_zeros
import arxiv_public_data.tests.cocitation_category_feat... | 4 | 5 | 0 | 0 | 9 | 0 |
crowd_anki/utils/filesystem/name_sanitizer.py | katrinleinweber/CrowdAnki | 391 | 1689689 | <filename>crowd_anki/utils/filesystem/name_sanitizer.py<gh_stars>100-1000
from functional import seq
ascii_control_chars = ''.join([chr(x) for x in range(0,32)])
invalid_filename_chars = set(":*?\"<>|/\\ \n" + ascii_control_chars)
def sanitize_anki_deck_name(name: str, replace_char='_'):
"""
Get name that co... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/run-natmodtests.py | memiks/micropython | 181 | 1689698 | #!/usr/bin/env python3
# This file is part of the MicroPython project, http://micropython.org/
# The MIT License (MIT)
# Copyright (c) 2019 <NAME>
from __future__ import annotations
import os
import subprocess
import sys
import argparse
sys.path.append('../tools')
import pyboard
# Paths for host executables
CPYTHON... | 0 | 2 | 0 | 0 | 2 | 0 |
source/python-vsmclient/vsmclient/v1/monitors.py | ramkrsna/virtual-storage-manager | 172 | 1689752 | <filename>source/python-vsmclient/vsmclient/v1/monitors.py
# Copyright 2014 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
#
# http:... | 0 | 0 | 0 | 0 | 0 | 0 |
src/config_params/configs.py | Sarajvega/kaggle-birdsong-recognition | 137 | 1689807 | import string
from pathlib import Path
class AUDIO_CONFIG:
sampling_rate: int = 32000
duration: int = 1
hop_length: int = 251 # making it 128 in size
fmin: int = 500
fmax: int = 15000
n_mels: int = 128
n_fft = n_mels * 20
samples = sampling_rate * duration
padmode: str = 'reflect'
... | 1 | 2 | 7 | 0 | 10 | 0 |
test-framework/test-suites/unit/tests/command/stack/commands/remove/host/firmware/mapping/test_command_stack_commands_remove_host_firmware_mapping_plugin_basic.py | kmcm0/stacki | 123 | 1689820 | from unittest.mock import create_autospec, ANY, patch, call
import pytest
from stack.commands import DatabaseConnection
from stack.commands.remove.host.firmware.mapping import Command
from stack.exception import CommandError
from stack.commands.remove.host.firmware.mapping.plugin_basic import Plugin
class TestRemoveHo... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_messenger.py | Stanwarr/fbmessenger | 120 | 1689826 | <reponame>Stanwarr/fbmessenger
import copy
import pytest
from mock import Mock
from fbmessenger import BaseMessenger, thread_settings
@pytest.fixture
def messenger():
class Messenger(BaseMessenger):
def message(self, payload):
pass
def delivery(self, payload):
pass
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/layoutparser/ocr/base.py | frankiert/layout-parser | 2,931 | 1689869 | <gh_stars>1000+
# Copyright 2021 The Layout Parser team. 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 req... | 0 | 0 | 0 | 0 | 0 | 0 |
projects/Password_generator/password_generator.py | rossi2018/python-mini-projects | 9,957 | 1689873 | <filename>projects/Password_generator/password_generator.py<gh_stars>1000+
from tkinter import*
from random import choice
import string
class App:
def __init__(self):
self.window = Tk()
self.window.title('password_generator')
self.window.iconbitmap('logo.ico')
self.window.i... | 0 | 0 | 0 | 0 | 0 | 0 |
datadog_checks_dev/tests/tooling/manifest_validator/test_v2_validator.py | abraham-leal/integrations-core | 663 | 1689876 | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import json
import os
from copy import deepcopy
from pathlib import Path
import mock
import pytest
import tests.tooling.manifest_validator.input_constants as input_constants
import datadog_checks.dev.too... | 0 | 2 | 0 | 0 | 2 | 0 |
examples/mnist/mnist_data_setup.py | tornado12345/TensorFlowOnSpark | 4,363 | 1689888 | <reponame>tornado12345/TensorFlowOnSpark
# Copyright 2017 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
if __name__ == "__main__":
... | 0 | 0 | 0 | 0 | 0 | 0 |
Lib/fontTools/ttLib/tables/G__l_o_c.py | twardoch/fonttools-py27 | 240 | 1689901 | from __future__ import annotations
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc import sstruct
from fontTools.misc.textTools import safeEval
from . import DefaultTable
import array
import sys
Gloc_header = '''
> # big endian
vers... | 1 | 4 | 1 | 2 | 8 | 0 |
virtual/lib/python3.8/site-packages/charset_normalizer/cli/normalizer.py | Carolwanzuu/The_Awwward | 18,636 | 1689921 | from __future__ import annotations
import argparse
import sys
from os.path import abspath
from json import dumps
from charset_normalizer import from_fp
from charset_normalizer.models import CliDetectionResult
from charset_normalizer.version import __version__
from platform import python_version
def query_yes_no(que... | 2 | 2 | 0 | 0 | 4 | 0 |
IntelligentUAVPathPlanningSimulationSystem/core/appUI/AppSettingDialogDesigner.py | wangwei39120157028/IntelligentUAVPathPlanningSimulationSystem-Drone | 208 | 1689931 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\AppSettingDialogDesigner.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_AppSettingDialog(object):
def setupUi(self, Ap... | 0 | 0 | 0 | 0 | 0 | 0 |
hand/a_handMpiiToCoco.py | Pandinosaurus/openpose_train | 496 | 1689933 | <filename>hand/a_handMpiiToCoco.py<gh_stars>100-1000
sGenerateLightVersionForDebugging = False
# sGenerateLightVersionForDebugging = True
sDatasetFolder = "../dataset/hand/"
sDisplayDebugging = sGenerateLightVersionForDebugging
import cv2
import glob
import natsort
import json
from coco_util import *
def split_file(n... | 0 | 0 | 0 | 0 | 0 | 0 |
python/app/thirdparty/oneforall/modules/datasets/chinaz_api.py | taomujian/linbing | 351 | 1689942 | from app.thirdparty.oneforall.config import settings
from app.thirdparty.oneforall.common.query import Query
class ChinazAPI(Query):
def __init__(self, domain):
Query.__init__(self)
self.domain = domain
self.module: str = 'Dataset'
self.source: str = 'ChinazAPIQuery'
self.a... | 0 | 1 | 0 | 3 | 4 | 0 |
bonobo/execution/contexts/__init__.py | Playfloor/bonobo | 1,573 | 1690015 | """
Execution Contexts are objects that wraps the stateless data-structures (graphs and nodes) during a job execution to
keep an eye on their context/state (from the simplest things like i/o statistics to lifecycle and custom userland
state).
"""
from bonobo.execution.contexts.graph import GraphExecutionContext
from ... | 0 | 0 | 0 | 0 | 0 | 0 |
cirq-core/cirq/ops/mixed_unitary_channel.py | peterse/Cirq | 3,326 | 1690017 | from typing import Any, Dict, Iterable, Tuple, Union
import numpy as np
from cirq import linalg, protocols, value
from cirq._compat import proper_repr
from cirq.ops import raw_types
class MixedUnitaryChannel(raw_types.Gate):
"""A generic mixture that can record the index of its selected operator.
This type ... | 7 | 12 | 0 | 0 | 19 | 0 |
tests/test_log_prob.py | ahartikainen/pystan | 1,030 | 1690040 | <gh_stars>1000+
"""Test model with array parameter."""
import numpy as np
import pytest
import stan
unrestricted_program = """
parameters {
real y;
}
model {
y ~ normal(0, 1);
}
"""
restricted_program = """
parameters {
real<lower=0> y;
}
model {
y ~ normal... | 0 | 0 | 0 | 0 | 0 | 0 |
util/dynamic.py | giuseppe/quay | 2,027 | 1690056 | def import_class(module_name, class_name) -> object:
"""
Import a class given the specified module name and class name.
"""
klass = __import__(module_name)
class_segments = class_name.split(".")
for segment in class_segments:
klass = getattr(klass, segment)
return klass
| 0 | 1 | 0 | 0 | 1 | 0 |
problems/equality_in_a_array.py | vinta/fuck-coding-interviews | 590 | 1690076 | #!/bin/python3
"""
https://www.hackerrank.com/challenges/equality-in-a-array/problem
"""
from collections import Counter
import math
import os
import random
import re
import sys
def equalizeArray(arr) -> object:
counter = Counter(arr)
delete_count = 0
for i, data in enumerate(counter.most_common(len(arr))... | 0 | 1 | 0 | 0 | 1 | 0 |
programs/pyeos/tests/python/call/t.py | learnforpractice/pyeos | 144 | 1690078 | <gh_stars>100-1000
import os
import time
import struct
import wallet
import eosapi
import initeos
from eosapi import N
from tools import cpp2wast
from common import prepare, producer
import debug as _debug
print('please make sure you are running the following command before testing')
print('./pyeos/pyeos --manual-g... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/vision/mnist/interpret.py | Locust2520/path_explain | 145 | 1690081 | <reponame>Locust2520/path_explain
import tensorflow as tf
import numpy as np
from joblib import dump, load
from sklearn.decomposition import PCA
from train import load_mnist, build_model
from path_explain.path_explainer_tf import PathExplainerTF
from path_explain.utils import set_up_environment
from absl import app
f... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/syslog_spec.py | msabramo/chaperone | 186 | 1690095 | from prefix import *
from chaperone.cutil.syslog import _syslog_spec_matcher
SPECS = (
('*.*', '(True)'),
('[crond].*', '((g and "crond" == g.lower()))'),
('.*', 'Invalid log spec syntax: .*'),
('kern.*... | 0 | 0 | 0 | 0 | 0 | 0 |
image-generation/slegan/generate.py | AaratiAkkapeddi/nnabla-examples | 228 | 1690104 | # Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/gsutil/gslib/tests/test_kms.py | tingshao/catapult | 2,151 | 1690106 | # -*- coding: utf-8 -*-
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 2 | 0 | 1 | 0 | 3 | 0 |
alipay/aop/api/domain/MenuAnalysisData.py | snowxmas/alipay-sdk-python-all | 213 | 1690108 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
from alipay.aop.api.constant.ParamConstants import *
class MenuAnalysisData(object):
def __init__(self):
self._avg_click_user_cnt: None = None
self._click_cnt: None = None
self._click_user_cnt: N... | 0 | 9 | 0 | 7 | 16 | 0 |
third_party/angle/src/libANGLE/gen_format_map.py | zipated/src | 2,151 | 1690122 | <reponame>zipated/src
#!/usr/bin/python
# Copyright 2016 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# gen_format_map.py:
# Code generation for GL format map. The format map matches between
# {format,type} and ... | 0 | 0 | 0 | 0 | 0 | 0 |
infra/scripts/release/bump_file_versions.py | kevjumba/feast | 810 | 1690156 | # This script will bump the versions found in files (charts, pom.xml) during the Feast release process.
import pathlib
import sys
USAGE = f"Usage: python {sys.argv[0]} [--help] | current_semver_version new_semver_version]"
VERSIONS_TO_BUMP = 27
def main() -> None:
args = sys.argv[1:]
if not args or len(args... | 1 | 2 | 0 | 0 | 3 | 0 |
caches.py | FelixBoers/sublime-gulp | 138 | 1690175 | import sublime
import json
import codecs
import os
is_sublime_text_3 = int(sublime.version()) >= 3000
if is_sublime_text_3:
from .settings import Settings
else:
from settings import Settings
class ProcessCache():
_procs: list[object] = []
last_task_name: None = None
@classmethod
def get_fro... | 2 | 8 | 2 | 0 | 12 | 0 |
src/python/test/test_dtm_rips_complex.py | m0baxter/gudhi-devel | 146 | 1690254 | """ This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
Author(s): <NAME>
Copyright (C) 2020 Inria, Copyright (C) 2020 FUjitsu Laboratories Ltd.
Modification(s):
... | 0 | 0 | 0 | 0 | 0 | 0 |
pycozmo/expressions/__init__.py | nalbion/pycozmo | 123 | 1690292 |
from .expressions import * # noqa
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/example_sim_rigid_chain.py | NVIDIA/warp | 306 | 1690298 | <filename>examples/example_sim_rigid_chain.py
# Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved.
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure... | 0 | 0 | 0 | 0 | 0 | 0 |
mlcomp/utils/logging.py | lightforever/kaggler | 166 | 1690316 | import os
import logging
import sys
from logging.handlers import RotatingFileHandler
from mlcomp import LOG_FOLDER, LOG_NAME, FILE_LOG_LEVEL, DB_LOG_LEVEL, \
CONSOLE_LOG_LEVEL
from mlcomp.db.core import Session
from mlcomp.db.providers import LogProvider
from mlcomp.db.models import Log
from mlcomp.utils.misc impo... | 6 | 4 | 0 | 0 | 10 | 0 |
scripts/artifacts/smanagerLow.py | deagler4n6/ALEAPP | 187 | 1690337 | import sqlite3
import textwrap
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly
def get_smanagerLow(files_found, report_folder, seeker, wrap_text) -> None:
file_found = str(files_found[0])
db = open_s... | 0 | 1 | 0 | 0 | 1 | 0 |
dadmatools/flair/utils/params.py | njzr/DadmaTools | 161 | 1690344 | from __future__ import annotations
import json
import argparse
import yaml
import copy
from flair.utils import logging
from flair.algorithms import dict_merge
logger = logging.init_logger()
class Params(object):
"""
Parameters
"""
def __init__(self, params):
self.params = params
def __... | 1 | 10 | 0 | 0 | 11 | 0 |
features/src/autogluon/features/generators/pipeline.py | zhiqiangdon/autogluon | 4,462 | 1690370 | <filename>features/src/autogluon/features/generators/pipeline.py
import copy
import logging
import psutil
from pandas import DataFrame
from autogluon.core.features.feature_metadata import FeatureMetadata
from autogluon.core.features.infer_types import get_type_map_real
from autogluon.core.utils import get_approximate... | 0 | 0 | 0 | 0 | 0 | 0 |
models/camera_server.py | HoangTienDuc/tf-insightface | 212 | 1690374 | <filename>models/camera_server.py
import cv2
'''
This server:
Input: Camera address
Process: Start a camera thread
Output: Run an overridden process function for each frame
'''
class CameraServer(object):
camera_address = None
cam = None
in_progress = False
def __init__(self, camera_add... | 0 | 0 | 0 | 0 | 0 | 0 |
Company-Project/src/main/tests/test_page_not_found.py | joshuadavidthomas/Wagtail-Pipit | 124 | 1690384 | <filename>Company-Project/src/main/tests/test_page_not_found.py
from django.test import TestCase
class PageNotFoundTest(TestCase):
def test_that_404_contains_no_errors(self):
response = self.client.get("/a-404-url/")
self.assertEqual(response.status_code, 404)
def test_that_404_view_uses_pro... | 0 | 0 | 0 | 0 | 0 | 0 |
bfxapi/models/subscription.py | uggel/bitfinex-api-py | 162 | 1690459 | from __future__ import annotations
"""
Module used to describe all of the different data types
"""
import time
import json
from random import randint
def generate_sub_id() -> object:
"""
Generates a unique id in the form of 12345566-12334556
"""
prefix = str(int(round(time.time() * 1000)))
suffix ... | 2 | 5 | 0 | 2 | 9 | 0 |
testing/MLDB-1753_useragent_function.py | kstepanmpmg/mldb | 665 | 1690465 | #
# MLDB-1753_useragent_function.py
# <NAME>, 2016-06-27
# This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved.
#
from mldb import mldb, MldbUnitTest, ResponseException
class MLDB1753UseragentFunction(MldbUnitTest): # noqa
@classmethod
def setUpClass(cls):
mldb.put("/v1/functio... | 0 | 0 | 0 | 0 | 0 | 0 |
test/exploits/hashes/collisions/test_python2_32.py | drjerry/acsploit | 107 | 1690484 | <gh_stars>100-1000
from exploits.hashes.collisions import python2_32
from test.exploits.dummy_output import DummyOutput
from input.chars import CharGenerator
import pytest
def test_run_small_collision_output():
output = DummyOutput()
n_collisions = 2
length = 7
substring_length = 3
target = '42'
... | 0 | 0 | 0 | 0 | 0 | 0 |
jni-build/jni/include/tensorflow/python/ops/image_grad.py | rcelebi/android-elfali | 680 | 1690501 | <reponame>rcelebi/android-elfali
# Copyright 2015 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 | 0 | 0 | 0 | 0 | 0 |
rpython/translator/c/gcc/test/test_asmgcroot.py | m4sterchain/mesapy | 381 | 1690505 | import py
import sys, os, gc
from rpython.translator.c.test import test_newgc
from rpython.translator.translator import TranslationContext
from rpython.translator.c.genc import CStandaloneBuilder
from rpython.annotator.listdef import s_list_of_strings
from rpython.conftest import option
from rpython.translator.tool.cbu... | 0 | 0 | 0 | 0 | 0 | 0 |
binding.gyp | ajsb85/brig | 175 | 1690518 | <reponame>ajsb85/brig
{
'targets': [
{
'target_name': '<!(node -e \"require(\'./package.json\').binary.module_name\")',
'module_name': '<!(node -e \"require(\'./package.json\').binary.module_name\")',
'module_path': '<!(node -e \"require(\'./package.json\').binary.module_path\")',
'sources': [
'<!@(tools/g... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/guinea-pigs/pytest/pep8_test.py | Tirzono/teamcity-messages | 105 | 1690535 | import sys
def test_ok():
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
netdissect/tool/makesample.py | priyaravichander/ganspace | 1,711 | 1690543 | '''
A simple tool to generate sample of output of a GAN,
subject to filtering, sorting, or intervention.
'''
import torch, numpy, os, argparse, numbers, sys, shutil
from PIL import Image
from torch.utils.data import TensorDataset
from netdissect.zdataset import standard_z_sample
from netdissect.progress import default... | 0 | 0 | 0 | 0 | 0 | 1 |
src/python/tests/unittests/test_common/test_persist.py | annihilatethee/seedsync | 255 | 1690544 | # Copyright 2017, <NAME>, All rights reserved.
import unittest
import tempfile
import shutil
import os
from common import overrides, Persist, AppError, Localization
class DummyPersist(Persist):
def __init__(self):
self.my_content: None = None
@classmethod
@overrides(Persist)
def from_str(cl... | 2 | 2 | 0 | 1 | 5 | 0 |
alipay/aop/api/response/AlipayMerchantPayforprivilegeUserrelationCreateResponse.py | antopen/alipay-sdk-python-all | 213 | 1690553 | <filename>alipay/aop/api/response/AlipayMerchantPayforprivilegeUserrelationCreateResponse.py<gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.PayForPrivilegeUserRelation import PayForPrivilegeUserRel... | 0 | 0 | 0 | 0 | 0 | 0 |
files_and_folders.py | yun-ji-cho/Ten-lines-or-less | 526 | 1690556 | <reponame>yun-ji-cho/Ten-lines-or-less
import os
# improvement liberally borrowed from:
# https://forum.omz-software.com/topic/2784/feature-request-pythonista-built-in-file-picker
def files_and_folders(dir_path="."):
"""Return a dict containing a sorted tuple of files and a sorted
tuple of folders"""
f_a... | 0 | 0 | 0 | 0 | 0 | 0 |
testsuite/mix-reg/run.py | luyatshimbalanga/OpenShadingLanguage | 1,105 | 1690584 | <reponame>luyatshimbalanga/OpenShadingLanguage
#!/usr/bin/env python
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# mix float, float, float includes masking
command += testshade("-t 1 -g 32 32... | 0 | 0 | 0 | 0 | 0 | 0 |
section6/sample_code_c6_1.py | nha6ki/python_source_separation | 135 | 1690598 | <reponame>nha6ki/python_source_separation
import numpy as np
#ステアリングベクトルを算出
#mic_position: 3 x M dimensional ndarray [[x,y,z],[x,y,z]]
#source_position: 3x Ns dimensional ndarray [[x,y,z],[x,y,z] ]
#freqs: Nk dimensional array [f1,f2,f3...]
#sound_speed: 音速 [m/s]
#is_use_far: Farを使う場合はTrue, Nearの場合はFalse,
... | 0 | 0 | 0 | 0 | 0 | 0 |
pinboard/__init__.py | nickwynja/pinboard.py | 290 | 1690615 | <filename>pinboard/__init__.py
# Copyright 2014-2017 Lionheart Software 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 requi... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_install_all_packages.py | KenMacD/pipx | 3,573 | 1690620 | """
This module uses the pytest infrastructure to produce reports on a large list
of packages. It verifies installation with and without an intact system PATH.
It also generates report summaries and error reports files.
Test pytest outcomes:
PASS - if no pip errors, and no pipx issues, and package apps verified
... | 35 | 18 | 3 | 11 | 67 | 0 |
wagtail/contrib/simple_translation/views.py | brownaa/wagtail | 8,851 | 1690628 | <filename>wagtail/contrib/simple_translation/views.py
from django.contrib import messages
from django.contrib.admin.utils import unquote
from django.core.exceptions import PermissionDenied
from django.db import transaction
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect
from dja... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_distribution.py | CompGeoInc/traces | 502 | 1690668 | import datetime
import nose
from traces import TimeSeries, Histogram
def test_distribution():
start = datetime.datetime(2015, 3, 1)
# v. simple
a = TimeSeries()
a.set(start, 1)
a.set(datetime.datetime(2015, 3, 2), 0)
a.set(datetime.datetime(2015, 3, 3), 1)
a.set(datetime.datetime(2015, 3... | 0 | 0 | 0 | 0 | 0 | 0 |
Configuration/Eras/python/Modifier_phase1Pixel_cff.py | ckamtsikis/cmssw | 852 | 1690673 | import FWCore.ParameterSet.Config as cms
phase1Pixel = cms.Modifier()
| 0 | 0 | 0 | 0 | 0 | 0 |
src/pytorch_retinanet/model_incresv2.py | dendisuhubdy/kaggle-rsna | 120 | 1690693 | <reponame>dendisuhubdy/kaggle-rsna<gh_stars>100-1000
import torch
import torch.utils.model_zoo as model_zoo
from . import model_inc_resnet_v2_aligned
from .model import RetinaNet, RetinaNetEncoder
class InceptionResnetV2Encoder(RetinaNetEncoder):
def __init__(self, **kwargs):
super().__init__()
s... | 0 | 0 | 0 | 0 | 0 | 0 |
homework_solutions/HW05/hw05_solution_py2.py | mateusza/Introduction-to-Python-Numerical-Analysis-for-Engineers-and-Scientist | 101 | 1690708 | import numpy as np
import matplotlib.pyplot as plt
# ========== HW04 SOLUTION [Python2] ========== #
# ========== 1 ========== #
five_dim_array = np.load('five_dim_array.npy')
array_flat = five_dim_array.flatten()
print array_flat.argmin()
# ========== 2 ========== #
x = np.linspace(-10, 10)
plt.figure()
plt.plo... | 0 | 0 | 0 | 0 | 0 | 0 |
rpython/jit/backend/ppc/test/test_del.py | nanjekyejoannah/pypy | 381 | 1690741 |
from rpython.jit.backend.ppc.test.support import JitPPCMixin
from rpython.jit.metainterp.test.test_del import DelTests
class TestDel(JitPPCMixin, DelTests):
# for the individual tests see
# ====> ../../../metainterp/test/test_del.py
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/response/AlipayMobilePublicMessageMatcherSendResponse.py | snowxmas/alipay-sdk-python-all | 213 | 1690746 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMobilePublicMessageMatcherSendResponse(AlipayResponse):
def __init__(self):
super(AlipayMobilePublicMessageMatcherSendResponse, self).__init__()
self._code: Non... | 0 | 4 | 0 | 4 | 8 | 0 |
flow/visualize/plot_ray_results.py | SHITIANYU-hue/flow | 805 | 1690749 | """Plot results from ray-based simulations.
This method accepts as input the progress file generated by ray
(usually stored at ~/ray_results/.../progress.csv)
as well as the column(s) to be plotted.
If no column is specified, all existing columns will be printed.
Example usage
-----
::
python plot_ray_results.py... | 0 | 2 | 0 | 0 | 2 | 0 |
src/dev/arm/Display.py | charitha22/gem5 | 135 | 1690752 | # Copyright (c) 2019 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | 0 | 3 | 12 | 0 | 15 | 0 |
ssg/environment.py | justchris1/scap-security-guide | 1,138 | 1690754 | from __future__ import absolute_import
from __future__ import print_function
from .products import load_product_yaml
from .yaml import open_raw
def open_environment(build_config_yaml_path, product_yaml_path) -> object:
contents = open_raw(build_config_yaml_path)
contents.update(load_product_yaml(product_yam... | 0 | 1 | 0 | 0 | 1 | 0 |
bsp/air640w/air640w.py | openLuat/LuatOS | 217 | 1690767 | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
from __future__ import annotations
import os.path
import shutil
import zipfile
import time
import subprocess
import sys
import json
import io
#------------------------------------------------------------------
# 读取配置信息
import configparser
config = configparser.ConfigParser()... | 3 | 5 | 0 | 0 | 8 | 0 |
lib_pypy/_ssl/__init__.py | ctrl-shift-make/pypy | 333 | 1690772 | <gh_stars>100-1000
from _cffi_ssl._stdssl import (_PROTOCOL_NAMES, _OPENSSL_API_VERSION,
_test_decode_cert, _SSLContext)
from _cffi_ssl import _stdssl
from _cffi_ssl._stdssl import *
OP_SINGLE_DH_USE = lib.SSL_OP_SINGLE_DH_USE
OP_SINGLE_ECDH_USE = lib.SSL_OP_SINGLE_ECDH_USE
try: from __pypy__ import builtinif... | 0 | 0 | 0 | 0 | 0 | 0 |
src/c3nav/site/migrations/0005_siteupdate_default_related_name.py | johnjohndoe/c3nav | 132 | 1690780 | # Generated by Django 2.1.4 on 2018-12-10 22:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('site', '0004_siteupdate_tweaks'),
]
operations: list[object] = [
migrations.AlterModelOptions(
name='siteupdate',... | 0 | 0 | 2 | 0 | 2 | 0 |
intro/matplotlib/examples/options/plot_ms.py | zmoon/scipy-lecture-notes | 2,538 | 1690784 | """
Marker size
===========
Demo the marker size control in matplotlib.
"""
import matplotlib.pyplot as plt
size = 256, 16
dpi = 72.0
figsize = size[0] / float(dpi), size[1] / float(dpi)
fig = plt.figure(figsize=figsize, dpi=dpi)
fig.patch.set_alpha(0)
plt.axes([0, 0, 1, 1], frameon=False)
for i in range(1, 11):
... | 0 | 0 | 0 | 0 | 0 | 0 |
Demo/classes/Rev.py | arvindm95/unladen-swallow | 2,293 | 1690809 | <filename>Demo/classes/Rev.py
'''
A class which presents the reverse of a sequence without duplicating it.
From: "<NAME>" <<EMAIL>>
It works on mutable or inmutable sequences.
>>> chars = list(Rev('Hello World!'))
>>> print ''.join(chars)
!dlroW olleH
The .forw is so you can use anonymous sequences in __init__, and ... | 0 | 0 | 0 | 0 | 0 | 0 |
hubspot/crm/extensions/accounting/models/accounting_extension_invoice.py | Ronfer/hubspot-api-python | 117 | 1690817 | <filename>hubspot/crm/extensions/accounting/models/accounting_extension_invoice.py
# coding: utf-8
"""
Accounting Extension
These APIs allow you to interact with HubSpot's Accounting Extension. It allows you to: * Specify the URLs that HubSpot will use when making webhook requests to your external accounting ... | 0 | 0 | 0 | 0 | 0 | 0 |
Joy_QA_Platform/ApiManager/models.py | bzc128/Joy_QA_Platform | 123 | 1690822 | # api模块 model
from django.db import models
from django.utils import timezone
from ApiManager.managers import ProjectInfoManager, ModuleInfoManager, TestCaseInfoManager, ConfigInfoManager, \
TaskInfoManager, EnvInfoManager, DebugTalkManager
from Joy_QA_Platform.configs import AUTH_DELETE, AUTH_UPDATE, AUTH_VIEW
#... | 0 | 7 | 22 | 0 | 29 | 0 |
src/pymor/__init__.py | meretp/pymor | 182 | 1690825 | # This file is part of the pyMOR project (https://www.pymor.org).
# Copyright 2013-2021 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
import os
import platform
import sys
if sys.version_info.major < 3:
raise RuntimeError('py... | 0 | 1 | 0 | 0 | 1 | 0 |
torchpq/legacy/IVFPQ.py | mhamilton723/TorchPQ | 103 | 1690834 | <reponame>mhamilton723/TorchPQ<gh_stars>100-1000
import torch
import numpy as np
from .IVFPQBase import IVFPQBase
from .IVFPQTopk import IVFPQTopk
from .PQ import PQ
from ..clustering import KMeans
class IVFPQ(IVFPQBase):
def __init__(
self,
d_vector,
n_subvectors=8,
n_cq_clusters=128,
n_pq_clus... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/text_generation/unimo-text/run_gen.py | JeremyZhao1998/PaddleNLP | 7,091 | 1690854 | <gh_stars>1000+
import os
import time
import math
import argparse
import json
import paddle
import paddle.distributed as dist
import paddle.nn as nn
import paddle.nn.functional as F
from paddlenlp.transformers import LinearDecayWithWarmup
from paddle.optimizer import AdamW
from paddlenlp.datasets import load_dataset
... | 0 | 0 | 0 | 0 | 0 | 0 |
freenom_dns_updater/test/test_record_parser.py | anhdhbn/Freenom-dns-updater | 160 | 1690855 | import datetime
import pathlib
import unittest
from freenom_dns_updater import Record, RecordType
from freenom_dns_updater.record_parser import RecordParser
class DomainParserTest(unittest.TestCase):
def test_parse_records(self):
path = pathlib.Path(__file__).parent / "resources" / "record_page.html"
... | 0 | 0 | 0 | 0 | 0 | 0 |
custom_components/doomsday_clock/sensor.py | renemarc/home-assistant-conf | 297 | 1690861 | <gh_stars>100-1000
"""Sensor platform for Doomsday Clock."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_SECONDS,
ATTR_TIME,
CONF_ICON,
CONF_NAME,
CON... | 0 | 0 | 0 | 0 | 0 | 0 |
nncf/tensorflow/graph/transformations/layout.py | evgeniya-egupova/nncf | 310 | 1690876 | """
Copyright (c) 2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | 10 | 6 | 0 | 0 | 16 | 0 |
multi_script_editor/managers/houdini/soptoolutils.py | paulwinex/pw_multiScriptEditor | 142 | 1690890 | <filename>multi_script_editor/managers/houdini/soptoolutils.py<gh_stars>100-1000
import hou
def scriptSopFilterTool(scriptargs,
nodetypename,
nodename=None,
center_on_selection=False,
translate_parm_name=None,
... | 0 | 0 | 0 | 0 | 0 | 0 |
bin/docutils/parsers/__init__.py | iilness2/bash-lambda-layer-custom | 5,079 | 1690904 | # $Id: __init__.py 7646 2013-04-17 14:17:37Z milde $
# Author: <NAME> <<EMAIL>>
# Copyright: This module has been placed in the public domain.
"""
This package contains Docutils parser modules.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import Component
if sys.version_info < (2,5):
from docu... | 0 | 1 | 2 | 0 | 3 | 0 |
cupy_alias/linalg/__init__.py | fixstars/clpy | 142 | 1690918 | <gh_stars>100-1000
from clpy.linalg import * # NOQA
| 0 | 0 | 0 | 0 | 0 | 0 |
sagemaker_batch_transform/tensorflow_cifar-10_with_inference_script/code/model_def.py | jpmarques19/tensorflwo-test | 144 | 1690933 | <gh_stars>100-1000
import tensorflow as tf
from tensorflow.keras.layers import Activation, Conv2D, Dense, Dropout, Flatten, MaxPooling2D, BatchNormalization
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import Adam, SGD, RMSprop
HEIGHT = 32
WIDTH = 32
DEPTH = 3
NUM_CLASSES = 10
def g... | 0 | 0 | 0 | 0 | 0 | 0 |
test.py | BotanAtomic/anomaly-detection | 179 | 1690940 | import argparse
from argparse import Namespace
from datasets import CIFAR10
from datasets import MNIST
from datasets import SHANGHAITECH
from datasets import UCSDPed2
from models import LSACIFAR10
from models import LSAMNIST
from models import LSAShanghaiTech
from models import LSAUCSD
from result_helpers import OneCl... | 0 | 1 | 0 | 0 | 1 | 0 |
spacy/tests/enable_gpu.py | snosrap/spaCy | 22,040 | 1690942 | <reponame>snosrap/spaCy
from spacy import require_gpu
require_gpu()
| 0 | 0 | 0 | 0 | 0 | 0 |
py/testdir_ec2/test_rf_airlines.py | gigliovale/h2o | 882 | 1690947 | <reponame>gigliovale/h2o
import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_rf
# RF train parameters
paramsTrainRF = {
'ntree' : 50,
'depth' : 30,
'bin_limit' : 10000,
'ignore' : 'AirTime,ArrDelay,DepDelay,Carrie... | 0 | 0 | 0 | 0 | 0 | 0 |
src/richie/apps/core/templatetags/full_static_tags.py | regisb/richie | 174 | 1690967 | <filename>src/richie/apps/core/templatetags/full_static_tags.py<gh_stars>100-1000
"""
Add full URL to a static Django file.
https://stackoverflow.com/a/47336360
"""
from django import template
from django.templatetags import static
# pylint: disable=invalid-name
register = template.Library()
class FullStaticNode(st... | 0 | 0 | 0 | 0 | 0 | 0 |
yolact_edge/data/flying_chairs.py | akaneko1019/yolact_edge | 1,036 | 1690979 | import os
import os.path as osp
import sys
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
import cv2
import numpy as np
from .config import cfg, MEANS, STD
from pycocotools import mask as maskUtils
import contextlib
import io
import logging
import time
def collate_fn_flying_c... | 1 | 5 | 0 | 1 | 7 | 0 |
desktop/libs/metadata/src/metadata/metadata_sites_tests.py | yetsun/hue | 5,079 | 1690990 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 0 | 0 | 0 | 0 | 0 | 0 |
app/program_window.py | nthparameter/ci_edit | 229 | 1691023 | # Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 3 | 8 | 0 | 6 | 17 | 0 |
composer/workflows/taskgroup.py | glasnt/python-docs-samples | 5,938 | 1691024 | <reponame>glasnt/python-docs-samples<filename>composer/workflows/taskgroup.py<gh_stars>1000+
# 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
#
# https://www.ap... | 0 | 0 | 0 | 0 | 0 | 0 |
model/map_cnn.py | kikacaty/AgentFormer | 105 | 1691041 | <filename>model/map_cnn.py<gh_stars>100-1000
import torch
import torch.nn as nn
import torch.nn.functional as F
class MapCNN(nn.Module):
def __init__(self, cfg):
super().__init__()
self.convs = nn.ModuleList()
map_channels = cfg.get('map_channels', 3)
patch_size = cfg.get('patch_si... | 0 | 0 | 0 | 0 | 0 | 0 |
weather_cli/weather_cli.py | jae-yong-2/awesomeScripts | 245 | 1691049 | <reponame>jae-yong-2/awesomeScripts
"""
This is a command line tool for using the openweathermap.org API.
- Retrieving current weather of a specified city or cities,
- Easy way and no complicated libraries.
- Arguments for specifying the output.
"""
from os import environ
import requests
import argpars... | 0 | 0 | 0 | 0 | 0 | 0 |
mmcv/mmcv/visualization/__init__.py | mengmengliu1998/qd-3dt | 384 | 1691066 | <reponame>mengmengliu1998/qd-3dt
from .color import Color, color_val
from .image import (imshow, imshow_bboxes, imshow_det_bboxes,
imshow_bboxes_w_ids, imshow_tracklets, random_color)
# from .optflow import flowshow, flow2rgb, make_color_wheel
__all__ = [
'Color', 'color_val', 'imshow', 'imshow... | 0 | 0 | 0 | 0 | 0 | 0 |
test/util/display_sysinfo_settings.py | arunrordell/RackHD | 451 | 1691073 | <gh_stars>100-1000
'''
Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
Purpose:
This script will generate a list of discovered nodes and display the system information for the nodes
'''
import fit_path # NOQA: unused import
import fit_common
fit_common.VERBOSIY = 1 # this is needed for suppres... | 0 | 0 | 0 | 0 | 0 | 0 |
nn_dataflow/core/pipeline_segment_timing.py | Pingziwalk/nn_dataflow | 170 | 1691075 | <filename>nn_dataflow/core/pipeline_segment_timing.py
""" $lic$
Copyright (C) 2016-2020 by Tsinghua University and The Board of Trustees of
Stanford University
This program is free software: you can redistribute it and/or modify it under
the terms of the Modified BSD-3 License as published by the Open Source
Initiativ... | 0 | 0 | 0 | 0 | 0 | 0 |
Data Structures/Trees/normal_tree.py | harshita9621/CompetitiveProgrammingQuestionBank | 931 | 1691092 | <gh_stars>100-1000
# Class to build a tree node
class TreeNode:
# Constructor to create tree node
def __init__(self, data):
self.data = data
self.children = []
self.parent = None
# Function to add a add in individual node
def add_child(self, child):
child.parent ... | 0 | 0 | 0 | 0 | 0 | 0 |
migrations/versions/36d7c98ddfee_drop_projectplan_table.py | vault-the/changes | 443 | 1691107 | """Drop ProjectPlan table
Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2014-10-14 11:25:48.151275
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
from alembic import op
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_ta... | 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.