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 |
|---|---|---|---|---|---|---|---|---|---|---|
tracking/migrations/0001_initial.py | TexasFile/django-tracking2 | 149 | 1688008 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies: list[object] = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
... | 0 | 0 | 2 | 0 | 2 | 0 |
api/tests/integration/tests/substructure/basic.py | tsingdao-Tp/Indigo | 204 | 1688016 | <filename>api/tests/integration/tests/substructure/basic.py
import sys
sys.path.append('../../common')
from env_indigo import *
def checkHasMatchMol (indigo, m, q):
q.aromatize()
m.checkBadValence()
m.checkBadValence()
matcher = indigo.substructureMatcher(m)
assert(matcher.match(q) != None)
m2... | 0 | 0 | 0 | 0 | 0 | 0 |
private/scripts/extras/fix_codechef_links.py | earora97/stopstalk-deployment | 342 | 1688025 | """
Copyright (c) 2015-2020 <NAME>(<EMAIL>), StopStalk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy... | 0 | 0 | 0 | 0 | 0 | 0 |
ufora/FORA/python/StatementTerm.py | ufora/ufora | 571 | 1688031 | <filename>ufora/FORA/python/StatementTerm.py<gh_stars>100-1000
# Copyright 2015 Ufora 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/LIC... | 0 | 0 | 0 | 0 | 0 | 0 |
pyramda/dictionary/map_dict_test.py | sergiors/pyramda | 124 | 1688032 | <reponame>sergiors/pyramda<gh_stars>100-1000
from .map_dict import map_dict
from .values import values
from pyramda.math import inc
from pyramda.private.asserts import assert_dicts_equal
test_dict = {
"a": 1,
"b": 2,
"c": 3
}
expected_dict = {
"a": 2,
"b": 3,
"c": 4
}
def map_dict_test():
... | 0 | 0 | 0 | 0 | 0 | 0 |
python_autocomplete/create_dataset.py | wwnew/python_autocomplete | 116 | 1688044 | <gh_stars>100-1000
#!/usr/bin/env python
"""
Parse all files and write to a single file
"""
import re
import string
import urllib.error
import urllib.request
import zipfile
from pathlib import Path
from pathlib import PurePath
from typing import List, NamedTuple, Set
from typing import Optional
import numpy as np
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
model.py | giuliolovisotto/YOLOv3_TensorFlow | 1,703 | 1688045 | <reponame>giuliolovisotto/YOLOv3_TensorFlow<filename>model.py<gh_stars>1000+
# coding=utf-8
# for better understanding about yolov3 architecture, refer to this website (in Chinese):
# https://blog.csdn.net/leviopku/article/details/82660381
from __future__ import division, print_function
import tensorflow as tf
slim =... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/perf/core/services/buildbucket_service.py | zealoussnow/chromium | 14,668 | 1688047 | # Copyright 2019 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.
"""Make requests to the Buildbucket RPC API.
For more details on the API see: go/buildbucket-rpc
"""
from core.services import request
SERVICE_URL = 'htt... | 1 | 3 | 0 | 0 | 4 | 0 |
examples/Testing/flopy3_loadSECP.py | ritchie46/flopy | 351 | 1688051 | import sys
import os
import platform
import numpy as np
import matplotlib.pyplot as plt
import flopy
#Set name of MODFLOW exe
# assumes executable is in users path statement
version = 'mf2005'
exe_name = 'mf2005'
if platform.system() == 'Windows':
exe_name = 'mf2005.exe'
mfexe = exe_name
#Set the paths
loadpth ... | 0 | 0 | 0 | 0 | 0 | 0 |
PythonAPI/carissma_project/lib/python3.5/site-packages/numpy/conftest.py | AbdulHoffmann/carla_carissma | 445 | 1688078 | <filename>PythonAPI/carissma_project/lib/python3.5/site-packages/numpy/conftest.py
"""
Pytest configuration and fixtures for the Numpy test suite.
"""
from __future__ import division, absolute_import, print_function
import pytest
import numpy
from numpy.core._multiarray_tests import get_fpu_mode
_old_fpu_mode = Non... | 0 | 0 | 0 | 0 | 0 | 0 |
note9/data/prepare_voc_data.py | fluffyrita/LearnPaddle | 367 | 1688082 | <filename>note9/data/prepare_voc_data.py
# coding=utf-8
import os
import re
import random
# 根据数据集的路径和年份和数据类型拼接路径
def get_dir(devkit_dir, year, type):
return os.path.join(devkit_dir, 'VOC' + year, type)
def walk_dir(devkit_dir, year):
# 获取所有类别的训练和测试的文件名的文件夹路径
filelist_dir = get_dir(devkit_dir, year, 'Imag... | 0 | 0 | 0 | 0 | 0 | 0 |
python/cudf/cudf/tests/test_udf_binops.py | gdaisukesuzuki/cudf | 4,012 | 1688098 | # Copyright (c) 2018, NVIDIA CORPORATION.
from __future__ import division
import numpy as np
import pytest
from numba.cuda import compile_ptx
from numba.np import numpy_support
import cudf
from cudf import Series, _lib as libcudf
from cudf.utils import dtypes as dtypeutils
@pytest.mark.parametrize(
"dtype", sor... | 0 | 2 | 0 | 0 | 2 | 0 |
drafts/rec/rec/test.py | kstepanmpmg/mldb | 665 | 1688109 | from pprint import pprint
from pymldb import Connection
import rec.settings as _
def run_test_pipeline(mldb):
mldb.datasets(_.TEST_DATASET).delete()
mldb.procedures(_.DATASET_MANAGER_TEST).runs.post_json({})
print('nb test examples', mldb.datasets(_.TEST_DATASET)
.get()['status']['rowCount'])
... | 0 | 0 | 0 | 0 | 0 | 0 |
feature_engine/outliers/winsorizer.py | kylegilde/feature_engine | 196 | 1688122 | <reponame>kylegilde/feature_engine<filename>feature_engine/outliers/winsorizer.py
# Authors: <NAME> <<EMAIL>>
# License: BSD 3 clause
from typing import List, Union
import numpy as np
import pandas as pd
from feature_engine.dataframe_checks import _is_dataframe
from feature_engine.outliers.base_outlier import Winsor... | 0 | 0 | 0 | 0 | 0 | 0 |
furnace/engine/lr_policy.py | fywalter/TorchSeg | 1,439 | 1688152 | #!/usr/bin/env python3
# encoding: utf-8
# @Time : 2018/8/1 上午1:50
# @Author : yuchangqian
# @Contact : <EMAIL>
# @File : lr_policy.py.py
from abc import ABCMeta, abstractmethod
class BaseLR():
__metaclass__ = ABCMeta
@abstractmethod
def get_lr(self, cur_iter): pass
class PolyLR(BaseLR):
de... | 0 | 3 | 0 | 0 | 3 | 0 |
skl2onnx/shape_calculators/grid_search_cv.py | snapADDY/sklearn-onnx | 323 | 1688218 | # SPDX-License-Identifier: Apache-2.0
import logging
from ..common._registration import (
register_shape_calculator,
get_shape_calculator)
from .._supported_operators import sklearn_operator_name_map
def convert_sklearn_grid_search_cv(operator) -> None:
grid_search_op = operator.raw_operator
best_est... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_models/test_dom.py | isarth/sumy | 2,880 | 1688219 | <gh_stars>1000+
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest
from sumy._compat import to_unicode
from sumy.models.dom import Paragraph, Sentence
from sumy.nlp.tokenizers import Tokenizer
from ..utils import build_document, build_document_fro... | 0 | 0 | 0 | 0 | 0 | 0 |
data/ner/streamlit_app.py | hatrungduc/spark-nlp-workshop | 687 | 1688227 | <filename>data/ner/streamlit_app.py
import streamlit as st
st.set_page_config(
layout="centered", # Can be "centered" or "wide". In the future also "dashboard", etc.
initial_sidebar_state="auto", # Can be "auto", "expanded", "collapsed"
page_title='Detect tumor characteristics', # String or None. Strings... | 0 | 0 | 0 | 0 | 0 | 0 |
pplp/core/trainer_utils.py | UoE-AIRS/PPLP | 883 | 1688257 | import os
import tensorflow as tf
slim = tf.contrib.slim
def load_checkpoints(checkpoint_dir, saver):
# Load latest checkpoint if available
all_checkpoint_states = tf.train.get_checkpoint_state(
checkpoint_dir)
if all_checkpoint_states is not None:
all_checkpoint_paths = \
al... | 0 | 1 | 0 | 0 | 1 | 0 |
collection/accounts_pre_2013.py | mihaivavram/twitterbots | 141 | 1688274 | import tweepy
import os
import sys
import random
import logging
from multiprocessing import Queue, Process
"""
Retrieves a sample dataset of pre-2013 Twitter users
"""
DEFAULT_PERCENTAGE = 100
DEFAULT_MIN_ID = 0
DEFAULT_MAX_ID = 5000000000
logger = logging.getLogger(__name__)
def fetch_accounts(api,
... | 0 | 0 | 0 | 0 | 0 | 0 |
forms-flow-api/migrations/versions/54dac710b166_tablecleanup.py | McCoySmith/forms-flow-ai | 132 | 1688278 | <gh_stars>100-1000
"""tablecleanup
Revision ID: <KEY>
Revises: <KEY>
Create Date: 2021-08-09 08:06:38.893697
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_o... | 0 | 0 | 0 | 0 | 0 | 0 |
python/ray/tests/test_get_locations.py | 77loopin/ray | 21,382 | 1688284 | <filename>python/ray/tests/test_get_locations.py
import numpy as np
import pytest
import platform
import time
import ray
def test_uninitialized():
with pytest.raises(RuntimeError):
ray.experimental.get_object_locations([])
def test_get_locations_empty_list(ray_start_regular):
locations = ray.experi... | 0 | 0 | 0 | 0 | 0 | 0 |
Code/Chenglong/gen_best_single_model.py | ChenglongChen/Kaggle_Homedepot | 465 | 1688295 | # -*- coding: utf-8 -*-
"""
@author: <NAME> <<EMAIL>>
@brief: script for generating the best single model from Chenglong's side
@note: 1. make sure you have run `python run_data.py` first
2. RMSE should be something around 0.438 ~ 0.439
"""
import os
suffix = '201604210409'
threshold = 0.05
cmd = "python featu... | 0 | 0 | 0 | 0 | 0 | 0 |
dedupe/variables/interaction.py | cilopez/dedupe | 2,190 | 1688314 | from .base import Variable
import itertools
class InteractionType(Variable):
type: str = "Interaction"
def __init__(self, definition):
self.interactions = definition["interaction variables"]
self.name = "(Interaction: %s)" % str(self.interactions)
self.interaction_fields = self.inte... | 0 | 1 | 1 | 0 | 2 | 0 |
ports/esp32/modules/upysh.py | sebi5361/micropython | 692 | 1688373 | ../../../../micropython-lib/upysh/upysh.py | 0 | 0 | 0 | 0 | 0 | 0 |
colabtools/interactive_util.py | KesterTong/colaboratory | 489 | 1688456 | from __future__ import annotations
"""Various utils for interactive widgets.
"""
import json
from IPython import display
BOOTSTRAP_JS = '/static/js/interactive_widgets.js'
# TODO(sandler): clean this code, Execute/Publish javascript should live
# in js module, and this should just contain higher level abstractions
... | 3 | 4 | 0 | 0 | 7 | 0 |
models/mobilenet.py | frankinwi/haq | 161 | 1688469 | <reponame>frankinwi/haq<filename>models/mobilenet.py
import os
import torch
import torch.nn as nn
os.sys.path.insert(0, os.path.abspath("../.."))
from lib.utils.quantize_utils import QConv2d, QLinear
import math
__all__ = ['MobileNet', 'mobilenet', 'qmobilenet']
def conv_bn(inp, oup, stride, conv_layer=nn.Conv2d, ha... | 0 | 0 | 0 | 0 | 0 | 0 |
snmp/datadog_checks/snmp/types.py | mchelen-gov/integrations-core | 663 | 1688486 | <reponame>mchelen-gov/integrations-core
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
"""
Type declarations, for type checking purposes only.
"""
from typing import Literal, NamedTuple, Tuple, TypedDict, TypeVar
T = TypeVar("T")
MetricDefinition = TypedDi... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/matrix_of_dots.py | SatoshiIwasada/BlueDot | 112 | 1688497 | from bluedot import BlueDot, COLORS
from signal import pause
from random import choice
bd = BlueDot()
bd.resize(1,2)
def pressed(pos):
print("Pressed : {}".format(pos))
def moved(pos):
print("Moved : {}".format(pos))
def released(pos):
print("Released : {}".format(pos))
... | 0 | 0 | 0 | 0 | 0 | 0 |
bark/runtime/viewer/buffered_mp_viewer.py | xmyqsh/bark | 174 | 1688512 | <reponame>xmyqsh/bark
# Copyright (c) 2021 fortiss GmbH
#
# Authors: <NAME>, <NAME>, <NAME> and
# <NAME>
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from bark.core.models.dynam... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/language/ast/test_location.py | matt-koevort/tartiflette | 530 | 1688543 | <reponame>matt-koevort/tartiflette
import pytest
from tartiflette.language.ast import Location
def test_location__init__():
location = Location(
line="locationLine",
column="locationColumn",
line_end="locationLineEnd",
column_end="locationColumnEnd",
)
assert location.line... | 0 | 0 | 0 | 0 | 0 | 0 |
Tests/interop/net/test_dynamicobjectmodel.py | aisk/ironpython3 | 1,872 | 1688592 | <filename>Tests/interop/net/test_dynamicobjectmodel.py<gh_stars>1000+
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import unittest
from iptest import IronPy... | 0 | 0 | 0 | 0 | 0 | 0 |
samples/list_datastore_cluster.py | ArpitSharma2800/pyvmomi-community-samples | 931 | 1688596 | #!/usr/bin/env python
# <NAME>
# www.virtuallyghetto.com
from __future__ import annotations
"""
vSphere Python SDK program for listing Datastores in Datastore Cluster
"""
from pyVmomi import vim, vmodl
from tools import cli, service_instance
def main() -> int | object:
"""
Simple command-line program for lis... | 0 | 1 | 0 | 0 | 1 | 0 |
src/ros/rosunit/src/rosunit/pyunit.py | jungleni/ros_code_reading | 742 | 1688598 | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, <NAME>, Inc.
# 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 copyri... | 3 | 1 | 0 | 0 | 4 | 0 |
infoxlm/src-infoxlm/infoxlm/data/dict_dataset.py | Maria-philna/unilm | 5,129 | 1688606 | <reponame>Maria-philna/unilm<filename>infoxlm/src-infoxlm/infoxlm/data/dict_dataset.py
import numpy as np
import os
import torch
from threading import Thread
from fairseq.data import data_utils, FairseqDataset, FairseqIterableDataset
class DictIterDataset(FairseqIterableDataset):
def __init__(self, defn, sizes=Non... | 0 | 0 | 0 | 0 | 0 | 0 |
vedaseg/utils/checkpoint.py | YuxinZou/vedaseg | 438 | 1688611 | # adapted from https://github.com/open-mmlab/mmcv
from __future__ import annotations
import os
import time
import torch
from collections import OrderedDict
def weights_to_cpu(state_dict) -> object:
"""Copy a model state_dict to cpu.
Args:
state_dict (OrderedDict): Model weights on GPU.
Returns:
... | 5 | 2 | 0 | 0 | 7 | 0 |
mmtbx/command_line/rotalyze.py | dperl-sol/cctbx_project | 155 | 1688632 | from __future__ import absolute_import, division, print_function
# LIBTBX_SET_DISPATCHER_NAME phenix.rotalyze
# LIBTBX_SET_DISPATCHER_NAME molprobity.rotalyze
# LIBTBX_PRE_DISPATCHER_INCLUDE_SH export PHENIX_GUI_ENVIRONMENT=1
import sys
from iotbx.cli_parser import CCTBXParser
from libtbx.utils import multi_out, show... | 0 | 0 | 0 | 0 | 0 | 0 |
SoftLayer/CLI/vlan/cancel.py | dvzrv/softlayer-python | 126 | 1688667 | """Cancel Network Vlan."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import formatting
@click.command()
@click.argument('identifier')
@environment.pass_env
def cli(env, identifier):
"... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test/strategies/test_integers.py | ActorForth/brownie | 122 | 1688675 | #!/usr/bin/python3
import pytest
from hypothesis import given
from hypothesis.strategies import SearchStrategy
from brownie.test import strategy
@pytest.mark.parametrize("bits", range(8, 257, 8))
def test_strategy(bits):
type_str = f"uint{bits}"
assert isinstance(strategy(type_str), SearchStrategy)
typ... | 0 | 0 | 0 | 0 | 0 | 0 |
rllab/envs/mujoco/swimmer3d_env.py | RussellM2020/maml_gps | 1,838 | 1688691 | from .swimmer_env import SwimmerEnv
class Swimmer3DEnv(SwimmerEnv):
FILE: str = 'swimmer3d.xml' | 0 | 0 | 1 | 0 | 1 | 0 |
allennlp/common/task_card.py | MSLars/allennlp | 11,433 | 1688692 | """
A specification for defining task cards (derived from model cards).
Motivation: A model's capabilities and limitations are dependent on
the task definition. Thus, it is helpful to separate the information
in the model card that comes from specifically the task itself.
"""
from typing import Dict, List, Optional, U... | 0 | 0 | 9 | 0 | 9 | 0 |
pysmt/cmd/check_version.py | Ying1123/pysmt | 435 | 1688708 | # Copyright 2014 <NAME> and <NAME>
#
# 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 wri... | 0 | 1 | 0 | 0 | 1 | 0 |
Self-Consistent-Field/RHF_libJK.py | andyj10224/psi4numpy | 214 | 1688711 | <filename>Self-Consistent-Field/RHF_libJK.py
"""
A restricted Hartree-Fock code using the Psi4 JK class for the
4-index electron repulsion integrals.
References:
- Algorithms from [Szabo:1996], [Sherrill:1998], and [Pulay:1980:393]
"""
__authors__ = "<NAME>"
__credits__ = ["<NAME>"]
__copyright__ = "(c) 2014-2018, ... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter 11/ch11_r01.py | PacktPublishing/Modern-Python-Cookbook | 107 | 1688717 | <gh_stars>100-1000
"""Python Cookbook
Chapter 11, recipe 1 and 2.
"""
from math import factorial
def binom(n: int, k: int) -> int:
'''Computes the binomial coefficient.
This shows how many combinations of
*n* things taken in groups of size *k*.
:param n: size of the universe
:param k: size of eac... | 0 | 0 | 0 | 0 | 0 | 0 |
colmap-helpers/create_cmu_query_db.py | maxtomCMU/hfnet | 555 | 1688719 | import argparse
import numpy as np
from os import path
import struct
from internal import db_handling
def parse_args() -> object:
parser = argparse.ArgumentParser()
parser.add_argument('--sift_feature_dir', required=True)
parser.add_argument('--query_txt_file', required=True)
parser.add_argument('--... | 0 | 1 | 0 | 0 | 1 | 0 |
test/new_tests/test_exists.py | indigo-tribe/aerospike-client-python | 105 | 1688739 | <reponame>indigo-tribe/aerospike-client-python<filename>test/new_tests/test_exists.py
# -*- coding: utf-8 -*-
import pytest
import sys
from .test_base_class import TestBaseClass
import time
from . import test_data
aerospike = pytest.importorskip("aerospike")
try:
import aerospike
from aerospike import exceptio... | 0 | 0 | 0 | 0 | 0 | 0 |
spirit/core/utils/paginator/__init__.py | Ke-xueting/Spirit | 974 | 1688745 | # -*- coding: utf-8 -*-
from __future__ import annotations
from django.core.paginator import InvalidPage, Paginator
from django.http import Http404
from django.utils.http import urlencode
from .yt_paginator import YTPaginator, YTPage
def get_page_number(obj_number, per_page) -> int | object:
if obj_number < per... | 2 | 5 | 0 | 0 | 7 | 0 |
textattack/constraints/grammaticality/__init__.py | bouhoula/TextAttack | 1,980 | 1688757 | <filename>textattack/constraints/grammaticality/__init__.py
""".. _grammaticality:
Grammaticality:
--------------------------
Grammaticality constraints determine if a transformation is valid based on
syntactic properties of the perturbation.
"""
from . import language_models
from .language_tool import LanguageTool... | 0 | 0 | 0 | 0 | 0 | 0 |
consolemenu/validators/url.py | Tyler887/console-menu | 230 | 1688764 | try:
# python2
from urlparse import urlparse
except Exception:
# python3
from urllib.parse import urlparse
from consolemenu.validators.base import BaseValidator
class UrlValidator(BaseValidator):
def __init__(self):
"""
URL Validator class
"""
super(UrlValidator, ... | 0 | 1 | 0 | 0 | 1 | 0 |
SoftLayer/CLI/order/quote_list.py | dvzrv/softlayer-python | 126 | 1688767 | """List active quotes on an account."""
# :license: MIT, see LICENSE for more details.
import click
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.managers import ordering
from SoftLayer.utils import clean_time
@click.command()
@environment.pass_env
def cli(env):
"""Lis... | 0 | 0 | 0 | 0 | 0 | 0 |
anaconda_project/internal/test/test_windows_cmdline.py | kathatherine/anaconda-project | 188 | 1688782 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2016, Anaconda, Inc. All rights reserved.
#
# Licensed under the terms of the BSD 3-Clause License.
# The full license is in the file LICENSE.txt, distributed with this software.
# -------------------... | 0 | 1 | 0 | 0 | 1 | 0 |
imagepy/menus/Process/Segment/graph_plgs.py | dada1437903138/imagepy | 1,178 | 1688789 | <reponame>dada1437903138/imagepy
from sciapp.action import Simple
from skimage import data, io, segmentation, color
from skimage.future import graph
import numpy as np
class RagThreshold(Simple):
title = 'RAG Threshold'
note = ['all', 'preview']
para = {'lab':None, 'thresh':10, 'connect':'8-connected'... | 0 | 0 | 0 | 0 | 0 | 0 |
cpp/dyncg/data/sentclf/clean_subj.py | mikejqzhang/sparsemap | 101 | 1688796 | # encoding: utf8
bad = "
"
lines = []
with open("subj.txt") as f:
for line in f:
line = (line
.strip()
.replace(bad, "")
.replace("[", "")
.replace("]", "")
)
lines.append(line)
with open("subj.txt", "w") as f:
for line in lines:
... | 0 | 0 | 0 | 0 | 0 | 0 |
vumi/tests/test_log.py | seidu626/vumi | 199 | 1688797 | <reponame>seidu626/vumi
import logging
from vumi.tests.utils import LogCatcher
from vumi import log
from vumi.log import WrappingLogger
from vumi.tests.helpers import VumiTestCase
class TracerException(Exception):
pass
class TestVumiLog(VumiTestCase):
def test_normal_log_levels(self):
levels = [
... | 0 | 0 | 0 | 0 | 0 | 0 |
chainercv/datasets/coco/coco_bbox_dataset.py | souravsingh/chainercv | 1,600 | 1688798 | from chainercv.datasets.coco.coco_instances_base_dataset import \
COCOInstancesBaseDataset
class COCOBboxDataset(COCOInstancesBaseDataset):
"""Bounding box dataset for `MS COCO`_.
.. _`MS COCO`: http://cocodataset.org/#home
Args:
data_dir (string): Path to the root of the training data. If ... | 6 | 0 | 0 | 0 | 6 | 0 |
security/etpro-telemetry/src/opnsense/scripts/etpro_telemetry/send_heartbeat.py | marcquark/plugins | 616 | 1688836 | <gh_stars>100-1000
#!/usr/local/bin/python3
"""
Copyright (c) 2018-2019 <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:
1. Redistributions of source code must retai... | 0 | 0 | 0 | 0 | 0 | 0 |
transformer_courses/object_detection_DETR/test_model.py | wwhio/awesome-DeepLearning | 1,150 | 1688838 | from __future__ import annotations
import os
import numpy as np
import copy
from PIL import Image, ImageDraw
from collections.abc import Sequence
from paddle.io import Dataset
from data.operators import *
from eval_model import get_categories, get_infer_results
class ImageFolder(Dataset):
def __init__(self,
... | 12 | 12 | 0 | 4 | 28 | 0 |
src/connection-monitor-preview/azext_connection_monitor_preview/profiles.py | Mannan2812/azure-cli-extensions | 207 | 1688846 | <reponame>Mannan2812/azure-cli-extensions
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/flow/test_multi_pattern.py | vishalbelsare/RedisGraph | 988 | 1688847 | <filename>tests/flow/test_multi_pattern.py
import os
import sys
import unittest
from RLTest import Env
from redisgraph import Graph, Node, Edge
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from base import FlowTestsBase
redis_graph = None
people = ["Roi", "Alon", "Ailon", "Boaz", "Tal", "Omri", "Or... | 0 | 0 | 0 | 0 | 0 | 0 |
devtools/yaml2json.py | Schweinepriester/oil | 2,209 | 1688907 | #!/usr/bin/env python2
"""
yaml2json.py
"""
from __future__ import print_function
import json
import sys
import yaml
def main(argv):
with open(argv[1]) as f:
obj = yaml.safe_load(f)
json.dump(obj, sys.stdout, indent=2)
if __name__ == '__main__':
try:
main(sys.argv)
except RuntimeError as e:
p... | 0 | 0 | 0 | 0 | 0 | 0 |
vendor/oauth2client/anyjson.py | louis-pre/NewsBlur | 3,073 | 1688911 | # Copyright (C) 2010 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 writ... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/nucleus/io/sharded_file_utils.py | Leorock123/deepvariant | 2,553 | 1688916 | # Copyright 2018 Google LLC.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#... | 1 | 11 | 0 | 0 | 12 | 0 |
back-end/core/process.py | aifact/Yolov5-Flask-VUE | 266 | 1688920 | import os
def pre_process(data_path) -> tuple[object, object]:
file_name = os.path.split(data_path)[1].split('.')[0]
return data_path, file_name
| 0 | 1 | 0 | 0 | 1 | 0 |
tests/utils/test_register.py | abersheeran/index.py | 242 | 1688935 | from typing import Callable
from indexpy.utils.register import RegisterDict
def test_register_dict():
d: RegisterDict[str, Callable] = RegisterDict()
@d.register("foo")
def foo():
pass
assert d["foo"] is foo
| 0 | 0 | 1 | 0 | 1 | 0 |
nbgrader/tests/apps/test_nbgrader_db.py | omelnikov/nbgrader | 1,116 | 1688973 | import pytest
import datetime
import shutil
import os
from textwrap import dedent
from os.path import join
from ...api import Gradebook, MissingEntry
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderDb(BaseTestApp):
def test_help(self):
"""Does the help display without error?... | 0 | 0 | 0 | 0 | 0 | 0 |
videos/management/commands/video_encoding_tasks.py | annevandalfsen/screenbird | 121 | 1689005 | """
A management command which checks videos
ready for encoding(VideoStatus--> is_encoding=True)
which could be found on /tmp folder.
After video is encoded it would be placed on
/videos folder and the original
video on /tmp folder would then be deleted.
"""
import os
import datetime
from django.conf import settings
... | 0 | 0 | 1 | 0 | 1 | 0 |
incubator/cdatabase/tests/test02.py | krai/ck | 480 | 1689006 | <filename>incubator/cdatabase/tests/test02.py
import os
import json
# Get path to some CK entry
import ck.kernel as ck
r=ck.access({'action':'load',
'module_uoa':'kernel',
'data_uoa':'default'})
if r['return']>0: ck.err(r)
path=r['path']
path_obj=os.path.dirname(path)
from cdat... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/nas_infer_model/DXYs/__init__.py | shashank3959/NAS-Projects | 923 | 1689023 | # Performance-Aware Template Network for One-Shot Neural Architecture Search
from .CifarNet import NetworkCIFAR as CifarNet
from .ImageNet import NetworkImageNet as ImageNet
from .genotypes import Networks
| 0 | 0 | 0 | 0 | 0 | 0 |
terrascript/docker/__init__.py | hugovk/python-terrascript | 507 | 1689050 | # terrascript/docker/__init__.py
import terrascript
class docker(terrascript.Provider):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
backend/src/models/wrapped/pie.py | rutvikpadhiyar000/github-trends | 157 | 1689092 | <filename>backend/src/models/wrapped/pie.py
from typing import List, Optional
from pydantic import BaseModel
class PieDatum(BaseModel):
id: str
label: str
value: int
formatted_value: str
color: Optional[str]
class PieData(BaseModel):
repos_changed: List[PieDatum]
repos_added: List[PieDa... | 0 | 0 | 0 | 0 | 0 | 0 |
src/ralph/networks/models/choices.py | DoNnMyTh/ralph | 1,668 | 1689111 | <filename>src/ralph/networks/models/choices.py<gh_stars>1000+
from dj.choices import Choices
class IPAddressStatus(Choices):
_ = Choices.Choice
used = _('used (fixed address in DHCP)')
reserved = _('reserved').extra(help_text=_('Exclude from DHCP'))
| 0 | 0 | 0 | 0 | 0 | 0 |
plex_scrobble/plex_monitor.py | jesseward/plex-lastfm-scrobbler | 105 | 1689141 | <filename>plex_scrobble/plex_monitor.py
# -*- coding: utf-8 -*-
import io
import logging
import os
import re
import time
import xml.etree.ElementTree as ET
import requests
import pylast
from .scrobble_cache import ScrobbleCache
def parse_line(log_line):
"""
Matches known audio metadata log entries entries a... | 0 | 0 | 0 | 0 | 0 | 0 |
17_retinaface/lib/train_engine.py | rohit0906/Monk_Object_Detection | 549 | 1689148 | <reponame>rohit0906/Monk_Object_Detection
from __future__ import print_function
import os
import torch
import torch.optim as optim
import torch.backends.cudnn as cudnn
import argparse
import torch.utils.data as data
from data.wider_face import WiderFaceDetection, DataLoaderWithoutLandmarks, detection_collate
from data.... | 0 | 0 | 0 | 0 | 0 | 0 |
vimfiles/bundle/vim-fsharp/ftplugin/fsharpvim.py | ciskoinch8/vimrc | 463 | 1689161 | <gh_stars>100-1000
from subprocess import Popen, PIPE
from os import path
import sys
import string
import tempfile
import unittest
import json
import threading
import hidewin
import vim
class G:
fsac = None
fsi = None
paths = {}
locations = []
projects = {}
class Interaction:
def __init__(se... | 0 | 0 | 0 | 0 | 0 | 0 |
viscm/__main__.py | ZeekoZhu/viscm | 122 | 1689171 | # This file is part of viscm
# Copyright (C) 2015 <NAME> <<EMAIL>>
# Copyright (C) 2015 <NAME> <<EMAIL>>
# See file LICENSE.txt for license information.
import sys
from .gui import main
main(sys.argv[1:])
| 0 | 0 | 0 | 0 | 0 | 0 |
monk/tf_keras_1/models/common.py | take2rohit/monk_v1 | 542 | 1689204 | <filename>monk/tf_keras_1/models/common.py
from monk.tf_keras_1.models.imports import *
from monk.system.imports import *
from monk.tf_keras_1.models.layers import get_layer
@accepts("self", bool, post_trace=False)
#@TraceFunction(trace_args=False, trace_rv=False)
def set_parameter_requires_grad(finetune_net, freeze... | 0 | 0 | 0 | 0 | 0 | 0 |
napalm_logs/auth.py | emfusion/napalm-logs | 133 | 1689210 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
'''
Authenticator worker process
'''
from __future__ import absolute_import
from __future__ import unicode_literals
# Import pythond stdlib
import os
import ssl
import signal
import socket
import logging
import threading
# Import napalm-logs pkgs
from napalm_logs.config impo... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/take-picture.py | damiafuentes/TelloSDKPy | 679 | 1689213 | <filename>examples/take-picture.py
import cv2
from djitellopy import Tello
tello = Tello()
tello.connect()
tello.streamon()
frame_read = tello.get_frame_read()
tello.takeoff()
cv2.imwrite("picture.png", frame_read.frame)
tello.land()
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/tilechain_invaders.py | cannero/lifxlan | 464 | 1689217 | <filename>examples/tilechain_invaders.py
from lifxlan import *
from random import randint
from time import sleep
def main():
lan = LifxLAN()
tilechain_lights = lan.get_tilechain_lights()
if len(tilechain_lights) != 0:
t = lan.get_tilechain_lights()[0] # grab the first tilechain
print("Sel... | 0 | 0 | 0 | 0 | 0 | 0 |
adb/systrace/catapult/devil/devil/utils/zip_utils.py | mohanedmoh/TBS | 2,151 | 1689255 | <filename>adb/systrace/catapult/devil/devil/utils/zip_utils.py
# 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.
import argparse
import json
import logging
import os
import sys
import zipfile
if __name__ ==... | 0 | 0 | 0 | 0 | 0 | 0 |
050 N-Queens.py | ChiFire/legend_LeetCode | 872 | 1689258 | <filename>050 N-Queens.py<gh_stars>100-1000
"""
The n-queens puzzle is the problem of placing n queens on an n*n chessboard such that no two queens attack each other.
Given an integer n, return all distinct solutions to the n-queens puzzle.
Each solution contains a distinct board configuration of the n-queens' p... | 0 | 0 | 0 | 0 | 0 | 0 |
chrome/android/java/src/PRESUBMIT.py | zipated/src | 2,151 | 1689278 | # Copyright (c) 2017 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.
"""Presubmit script for Android Java code.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presub... | 0 | 4 | 0 | 0 | 4 | 0 |
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/lang/swift/expression/protocol_extension/TestExprInProtocolExtension.py | Polidea/SiriusObfuscator | 427 | 1689289 | <gh_stars>100-1000
# TestExprInProtocolExtension.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
#... | 0 | 0 | 0 | 0 | 0 | 0 |
insights/combiners/tests/test_package_provides_httpd.py | lhuett/insights-core | 121 | 1689294 | import doctest
from insights.combiners import package_provides_httpd
from insights.parsers.package_provides_httpd import PackageProvidesHttpd
from insights.combiners.package_provides_httpd import PackageProvidesHttpdAll
from insights.tests import context_wrap
PACKAGE_COMMAND_MATCH_1 = """
/opt/rh/httpd24/root/usr/sb... | 0 | 0 | 0 | 0 | 0 | 0 |
pyhindsight/browsers/chrome.py | hyuunnn/hindsight | 730 | 1689343 | # -*- coding: utf-8 -*-
import hashlib
import math
import os
import sys
import errno
import datetime
import re
import struct
import json
import logging
import shutil
import puremagic
import urllib
import base64
import pyhindsight.lib.ccl_chrome_indexeddb.ccl_blink_value_deserializer
from pyhindsight.browsers.webbrowse... | 0 | 0 | 0 | 0 | 0 | 0 |
RecoBTag/SecondaryVertex/python/pfSimpleInclusiveSecondaryVertexHighEffBJetTags_cfi.py | ckamtsikis/cmssw | 852 | 1689353 | <reponame>ckamtsikis/cmssw<filename>RecoBTag/SecondaryVertex/python/pfSimpleInclusiveSecondaryVertexHighEffBJetTags_cfi.py<gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
pfSimpleInclusiveSecondaryVertexHighEffBJetTags = cms.EDProducer("JetTagProducer",
jetTagComputer = cms.string('candidateSimpleSecondary... | 0 | 0 | 0 | 0 | 0 | 0 |
doc/source/plots/gi_c.py | dimpase/mpmath | 625 | 1689378 | <gh_stars>100-1000
# Scorer function Gi(z) in the complex plane
cplot(scorergi, [-8,8], [-8,8], points=50000)
| 0 | 0 | 0 | 0 | 0 | 0 |
fhirclient/models/encounter_tests.py | carolinarsm/client-py | 418 | 1689380 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import encounter
from .fhirdate import FHIRDate
class EncounterTests(unittest.TestCase):
def instantiate_from(self, filename) ->... | 0 | 1 | 0 | 0 | 1 | 0 |
halo/halo.py | Flame442/Trusty-cogs | 148 | 1689388 | from __future__ import annotations
import asyncio
from random import choice as randchoice
import aiohttp
import discord
from redbot.core import Config, checks, commands
numbs = {"next": "➡", "back": "⬅", "exit": "❌"}
class Halo(commands.Cog):
"""
Display Halo 5 and Halo Wars 2 stats and information
"""
... | 12 | 6 | 0 | 0 | 18 | 0 |
stheno/model/measure.py | wesselb/stheno | 168 | 1689407 | from __future__ import annotations
from types import FunctionType
from lab import B
from matrix import Constant
from mlkernels import (
num_elements,
ZeroKernel,
TensorProductKernel,
)
from plum import Union
from .fdd import FDD
from .gp import GP, assert_same_measure
from .observations import (
Abstr... | 46 | 35 | 1 | 5 | 87 | 0 |
manager.py | aviaryan/VSCodeNotebook | 668 | 1689413 | <gh_stars>100-1000
#!/Users/aviaryan/miniconda3/bin/python
from vscode_notebook import vscode_notebook
if __name__ == '__main__':
vscode_notebook.main()
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/benchmark/milvus_benchmark/env/base.py | CyberFlameGO/milvus | 10,504 | 1689424 | <reponame>CyberFlameGO/milvus
import logging
from milvus_benchmark import utils
from milvus_benchmark import config
logger = logging.getLogger("milvus_benchmark.env.env")
class BaseEnv(object):
"""docstring for Env"""
def __init__(self, deploy_mode="single"):
self.deploy_mode = deploy_mode
se... | 0 | 0 | 0 | 0 | 0 | 0 |
pyscreenshot/__init__.py | ponty/pyscreenshot | 416 | 1689440 | from __future__ import annotations
import logging
from pyscreenshot.about import __version__
from pyscreenshot.childproc import childprocess_backend_version
from pyscreenshot.loader import FailedBackendError, backend_dict, backend_grab
ADDITIONAL_IMPORTS = [FailedBackendError]
log = logging.getLogger(__name__)
log.d... | 3 | 3 | 0 | 0 | 6 | 0 |
misc/synchronous_mode.py | zwc662/SequentialAttack | 116 | 1689446 | #!/usr/bin/env python
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
import glob
import os
import sys
try:
sys.path.append(glob.glob('**/*%d.... | 0 | 2 | 0 | 0 | 2 | 0 |
all/memory/advantage_test.py | drozzy/autonomous-learning-library | 584 | 1689463 | import unittest
import torch
import torch_testing as tt
from all import nn
from all.core import StateArray
from all.approximation import VNetwork, FeatureNetwork
from all.memory import NStepAdvantageBuffer
class NStepAdvantageBufferTest(unittest.TestCase):
def setUp(self):
torch.manual_seed(1)
sel... | 0 | 1 | 0 | 0 | 1 | 0 |
eval_utils_test.py | jdagdelen/natural-questions | 720 | 1689485 | # coding=utf-8
# Copyright 2018 The Google AI Language 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 by ... | 0 | 0 | 0 | 0 | 0 | 0 |
pyzoo/zoo/examples/tensorflow/tfpark/keras/keras_ndarray.py | limn2o4/analytics-zoo | 2,970 | 1689494 | <reponame>limn2o4/analytics-zoo<filename>pyzoo/zoo/examples/tensorflow/tfpark/keras/keras_ndarray.py
#
# Copyright 2018 Analytics Zoo 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
... | 0 | 0 | 0 | 0 | 0 | 0 |
contrib/ldnsx/examples/ldnsx-axfr.py | elindsey/ldns | 178 | 1689512 | #!/usr/bin/python
# vim:fileencoding=utf-8
#
# AXFR client with IDN (Internationalized Domain Names) support
#
import ldns
import encodings.idna
def utf2name(name):
return '.'.join([encodings.idna.ToASCII(a) for a in name.split('.')])
def name2utf(name):
return '.'.join([encodings.idna.ToUnicode(a) for a in n... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/from-wiki/matrixmul_tiled.py | hesom/pycuda | 1,264 | 1689516 | #!python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Multiples two square matrices together using multiple blocks and shared memory.
Each thread block is assigned a "tile" of the resulting matrix and is responsible
for generating the elements in that tile. Each thread in a block computes one element
of the... | 0 | 0 | 0 | 0 | 0 | 0 |
st2actions/st2actions/policies/retry.py | momokuri-3/st2 | 4,920 | 1689524 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 2 | 4 | 2 | 0 | 8 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.