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 |
|---|---|---|---|---|---|---|---|---|---|---|
python/src/mapreduce/property_range.py | dhcabinian/Song-Map-Reduce | 228 | 1608744 | #!/usr/bin/env python
# Copyright 2015 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 required ... | 0 | 16 | 0 | 0 | 16 | 0 |
deadshot/worker/celery_initialization.py | shreyanshp/deadshot | 172 | 1608748 | from celery import Celery
from celery.signals import after_setup_task_logger
from datetime import datetime
from deadshot import celery
from deadshot.api_server import create_app
from deadshot.configurations.api_server_config_data import Config
from pythonjsonlogger import jsonlogger
import sys
import logging
'''
This f... | 0 | 1 | 1 | 0 | 2 | 0 |
src/base/base.gyp | KawaneRio/mozc | 1,144 | 1608753 | <reponame>KawaneRio/mozc
# Copyright 2010-2021, Google 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 copyright
# notice, thi... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | destroyer92/pyogame | 115 | 1608754 | from distutils.core import setup
setup(
name='ogame',
packages=['ogame'],
version='8.1.0.21',
license='MIT',
description='lib for the popular browsergame ogame',
author='PapeprPieceCode',
author_email='<EMAIL>',
url='https://github.com/alaingilbert/pyogame',
download_url='https://gi... | 0 | 0 | 0 | 0 | 0 | 0 |
library/tests/conftest.py | rickyphewitt/st7789-python | 118 | 1608759 | <gh_stars>100-1000
import sys
import mock
import pytest
@pytest.fixture(scope='function', autouse=False)
def GPIO():
"""Mock RPi.GPIO module."""
GPIO = mock.MagicMock()
# Fudge for Python < 37 (possibly earlier)
sys.modules['RPi'] = mock.Mock()
sys.modules['RPi'].GPIO = GPIO
sys.modules['RPi.G... | 0 | 0 | 0 | 0 | 0 | 0 |
env/lib/python3.8/site-packages/plotly/validators/cone/colorbar/_tickformatstopdefaults.py | acrucetta/Chicago_COVI_WebApp | 11,750 | 1608765 | <reponame>acrucetta/Chicago_COVI_WebApp<gh_stars>1000+
import _plotly_utils.basevalidators
class TickformatstopdefaultsValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self,
plotly_name="tickformatstopdefaults",
parent_name="cone.colorbar",
**kwargs
):
... | 0 | 0 | 0 | 0 | 0 | 0 |
benchmark/mini_bench.py | narupo/janome | 748 | 1608770 | # Copyright 2015 moco_beta
#
# 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, softwa... | 0 | 0 | 0 | 0 | 0 | 0 |
var/spack/repos/builtin/packages/r-oligoclasses/package.py | LiamBindle/spack | 2,360 | 1608772 | <reponame>LiamBindle/spack<gh_stars>1000+
# 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 ROligoclasses(RPackage):
"""Classes for high-thr... | 0 | 0 | 0 | 0 | 0 | 0 |
robustness_metrics/reports/imagenet_variants_test.py | goncaloperes/robustness_metrics | 383 | 1608806 | <reponame>goncaloperes/robustness_metrics
# coding=utf-8
# Copyright 2021 The Robustness Metrics 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/license... | 0 | 0 | 0 | 0 | 0 | 0 |
hover/utils/misc.py | phurwicz/hover | 251 | 1608812 | <gh_stars>100-1000
"""Mini-functions that do not belong elsewhere."""
from datetime import datetime
from abc import ABC, abstractmethod
def current_time(template="%Y%m%d %H:%M:%S"):
return datetime.now().strftime(template)
class BaseUnionFind(ABC):
"""
???+ note "Data attached to union-find."
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
representjs/pretrain_horovod.py | parasj/contracode | 115 | 1608819 | <reponame>parasj/contracode<filename>representjs/pretrain_horovod.py
import os
import random
import time
import fire
import numpy as np
import sentencepiece as spm
import torch
import torch.nn.functional as F
import tqdm
import wandb
from loguru import logger
import torch.distributed as dist
import torch.multiprocessi... | 0 | 0 | 0 | 0 | 0 | 0 |
mmtbx/regression/tst_model_vs_map.py | dperl-sol/cctbx_project | 155 | 1608827 | from __future__ import absolute_import, division, print_function
import time
from libtbx import easy_run
#import libtbx.load_env
import time
from iotbx import pdb
cryst_str = """\n
CRYST1 34.917 22.246 44.017 90.00 90.00 90.00 P 1
SCALE1 0.028639 0.000000 0.000000 0.00000
SCALE2 0.000000 ... | 1 | 0 | 0 | 0 | 1 | 0 |
jenkinsapi_tests/systests/test_authentication.py | ChandlerSwift/jenkinsapi | 556 | 1608854 | '''
System tests for authentication functionality
'''
import pytest
from jenkinsapi.utils.requester import Requester
from six.moves.urllib.error import HTTPError
from requests import HTTPError as REQHTTPError
from jenkinsapi.jenkins import Jenkins
def test_normal_uthentication(jenkins_admin_admin):
# No problem ... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/examples/datadog_exporter/client.py | oxeye-nikolay/opentelemetry-python | 868 | 1608865 | # Copyright The OpenTelemetry 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 applicable law or agreed to in ... | 0 | 0 | 0 | 0 | 0 | 0 |
chempy/tests/test__equilibrium.py | bertiewooster/chempy | 340 | 1608892 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from ..util.testing import requires
try:
import numpy as np
except ImportError:
np, NumSysLin, NumSysLog = [None] * 3
else:
from scipy.optimize import fsolve
from .._equilibrium import equilibrium_residual, solve_equilibrium, _get_rc_interval
from .._util import... | 0 | 0 | 0 | 0 | 0 | 0 |
rdkit/ML/Cluster/Clusters.py | kazuyaujihara/rdkit | 1,609 | 1608901 | <gh_stars>1000+
# $Id$
#
# Copyright (C) 2001-2008 <NAME>
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" contains the Cluster class for repr... | 0 | 0 | 0 | 0 | 0 | 0 |
deepxde/utils/pytorch.py | matth86/deepxde | 955 | 1608952 | <filename>deepxde/utils/pytorch.py
"""Utilities of pytorch."""
| 0 | 0 | 0 | 0 | 0 | 0 |
nova/conf/conductor.py | zjzh/nova | 1,874 | 1608964 | # Copyright (c) 2010 OpenStack Foundation
# 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 | 1 | 0 | 0 | 1 | 0 |
pkg/releasing/release_tools_test.py | konste/rules_pkg | 123 | 1608972 | # Copyright 2019 The Bazel 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 applicable la... | 0 | 0 | 0 | 0 | 0 | 0 |
var/spack/repos/builtin/packages/perl-timedate/package.py | kkauder/spack | 2,360 | 1608994 | <reponame>kkauder/spack<filename>var/spack/repos/builtin/packages/perl-timedate/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 Per... | 0 | 0 | 0 | 0 | 0 | 0 |
dojo/components/views.py | mtcolman/django-DefectDojo | 1,772 | 1609016 | <filename>dojo/components/views.py
from django.shortcuts import render
from django.db.models import Count, Q
from dojo.utils import add_breadcrumb, get_page_items
from dojo.filters import ComponentFilter
from dojo.components.sql_group_concat import Sql_GroupConcat
from django.db import connection
from django.contrib.po... | 0 | 0 | 0 | 0 | 0 | 0 |
py2app_tests/test_app_with_sharedlib.py | sorphin/py2app | 193 | 1609020 | <reponame>sorphin/py2app
import sys
if (sys.version_info[0] == 2 and sys.version_info[:2] >= (2,7)) or \
(sys.version_info[0] == 3 and sys.version_info[:2] >= (3,2)):
import unittest
else:
import unittest2 as unittest
import subprocess
import shutil
import time
import os
import signal
import py2app
imp... | 0 | 0 | 0 | 0 | 0 | 0 |
asterioids-pygame-project/source_code_step_6/space_rocks/game.py | syberflea/materials | 3,682 | 1609022 | import pygame
from models import Asteroid, Spaceship
from utils import get_random_position, load_sprite
class SpaceRocks:
MIN_ASTEROID_DISTANCE: int = 250
def __init__(self):
self._init_pygame()
self.screen = pygame.display.set_mode((800, 600))
self.background = load_sprite("space", ... | 0 | 1 | 1 | 1 | 3 | 0 |
claf/model/token_classification/__init__.py | GMDennis/claf | 225 | 1609057 |
from claf.model.token_classification.bert import BertForTokCls
# fmt: off
__all__ = [
"BertForTokCls",
]
# fmt: on
| 0 | 0 | 0 | 0 | 0 | 0 |
src/api/impl/branch_unittest.py | piwaniuk/critic | 216 | 1609077 | <filename>src/api/impl/branch_unittest.py
def basic(arguments):
import api
assert arguments.sha1 is not None, "missing argument: --sha1"
assert arguments.name is not None, "missing argument: --name"
critic = api.critic.startSession(for_testing=True)
repository = api.repository.fetch(critic, reposi... | 0 | 0 | 0 | 0 | 0 | 0 |
main_train_dncnn.py | WestCityInstitute/KAIR | 1,521 | 1609078 | <gh_stars>1000+
import os.path
import math
import argparse
import time
import random
import numpy as np
from collections import OrderedDict
import logging
import torch
from torch.utils.data import DataLoader
from utils import utils_logger
from utils import utils_image as util
from utils import utils_option as option
... | 0 | 0 | 0 | 0 | 0 | 0 |
piccolo/apps/shell/piccolo_app.py | 0scarB/piccolo | 750 | 1609095 | from piccolo.conf.apps import AppConfig, Command
from .commands.run import run
APP_CONFIG = AppConfig(
app_name="shell",
migrations_folder_path="",
commands=[Command(callable=run, aliases=["start"])],
)
| 0 | 0 | 0 | 0 | 0 | 0 |
3d_segmentation/torch/unet_training_dict.py | tommydino93/tutorials | 535 | 1609117 | # Copyright 2020 MONAI Consortium
# 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, s... | 0 | 0 | 0 | 0 | 0 | 0 |
denet/layer/split.py | lachlants/denet | 121 | 1609124 | <gh_stars>100-1000
#dummy layer for splitting the model into multiple evaluations
import numpy
import theano
import denet.common.logging as logging
from denet.layer import AbstractLayer
class SplitLayer(AbstractLayer):
type_name = "split"
def __init__(self, layers, json_param={}):
super(... | 0 | 0 | 0 | 0 | 0 | 0 |
autoprompt/utils.py | theashworld/autoprompt | 221 | 1609148 | from __future__ import annotations
import csv
import copy
import json
import logging
import random
from collections import defaultdict
import torch
from torch.nn.utils.rnn import pad_sequence
MAX_CONTEXT_LEN = 50
logger = logging.getLogger(__name__)
def pad_squeeze_sequence(sequence, *args, **kwargs) -> object:
... | 14 | 10 | 0 | 1 | 25 | 0 |
request/middleware.py | Django-AI/django-request | 373 | 1609160 | <gh_stars>100-1000
from django.core.exceptions import ValidationError
from django.utils.deprecation import MiddlewareMixin
from . import settings
from .models import Request
from .router import Patterns
from .utils import request_is_ajax
class RequestMiddleware(MiddlewareMixin):
def process_response(self, reques... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/pythonpkg/tests/fast/test_map.py | AldoMyrtaj/duckdb | 2,816 | 1609178 | <reponame>AldoMyrtaj/duckdb<gh_stars>1000+
import duckdb
import pandas as pd
import numpy
import pytest
class TestMap(object):
def test_map(self, duckdb_cursor):
testrel = duckdb.values([1, 2])
conn = duckdb.connect()
conn.execute('CREATE TABLE t (a integer)')
empty_rel = conn.table... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/experimental_tests/links_tests/model_tests/fcis_tests/utils_tests/test_proposal_target_creator.py | souravsingh/chainercv | 1,600 | 1609181 | import unittest
import numpy as np
from chainer.backends import cuda
from chainer import testing
from chainer.testing import attr
from chainercv.experimental.links.model.fcis import ProposalTargetCreator
from chainercv.utils import generate_random_bbox
from chainercv.utils import mask_to_bbox
class TestProposalTa... | 0 | 0 | 4 | 0 | 4 | 0 |
tests/test_3d.py | eodcgmbh/datacube-core | 363 | 1609183 | # This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2020 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
from collections import OrderedDict
from pathlib import Path
import pytest
from datacube.model import DatasetType
from datacube.utils.document... | 0 | 0 | 0 | 0 | 0 | 0 |
reviewboard/hostingsvcs/utils/paginator.py | b1pb1p/reviewboard | 921 | 1609212 | from __future__ import annotations
"""Paginators for iterating over API results."""
from __future__ import unicode_literals
from django.utils import six
from django.utils.six.moves import range
from django.utils.six.moves.urllib.parse import (parse_qs, urlencode,
urlsp... | 7 | 13 | 2 | 5 | 27 | 0 |
docs/conf.py | clabom/pypcap | 281 | 1609221 | # encoding: utf-8
from __future__ import annotations
"""pypcap documentation build configuration file"""
from __future__ import unicode_literals
import os
import re
import sys
import types
import mock
def get_version(filename) -> object | str:
# Hack this for right now since pypcap doesn't have standard module... | 0 | 2 | 0 | 0 | 2 | 0 |
imaging/ml/toolkit/hcls_imaging_ml_toolkit/dicom_json_test.py | umair-akb/healthcare | 310 | 1609226 | <reponame>umair-akb/healthcare<filename>imaging/ml/toolkit/hcls_imaging_ml_toolkit/dicom_json_test.py
# Copyright 2019 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... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/577989_Yahoo_Stock_Information/recipe-577989.py | tdiprima/code | 2,023 | 1609227 | #!/usr/bin/env python
#
# Copyright (c) 2007-2008, <NAME> (<EMAIL>)
#
# license: GNU LGPL
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/extra_lib/test.py | burner/pyd | 168 | 1609267 | import os.path, sys
import distutils.util
# Append the directory in which the binaries were placed to Python's sys.path,
# then import the D DLL.
libDir = os.path.join('build', 'lib.%s-%s' % (
distutils.util.get_platform(),
'.'.join(str(v) for v in sys.version_info[:2])
))
sys.path.append(os.path.abspath(libDi... | 0 | 0 | 0 | 0 | 0 | 0 |
petl/transform/basics.py | alimanfoo/petl | 435 | 1609281 | from __future__ import annotations
from __future__ import absolute_import, print_function, division
# standard library dependencies
from itertools import islice, chain
from collections import deque
from itertools import count
from petl.compat import izip, izip_longest, next, string_types, text_type
# internal depen... | 31 | 30 | 0 | 1 | 62 | 0 |
configs/benchmark/hv_second_secfpn_4x8_80e_pcdet_kitti-3d-3class.py | phamhe/mmdetection3d | 109 | 1609295 | # model settings
voxel_size = [0.05, 0.05, 0.1]
point_cloud_range = [0, -40, -3, 70.4, 40, 1]
model = dict(
type='VoxelNet',
voxel_layer=dict(
max_num_points=5,
point_cloud_range=point_cloud_range,
voxel_size=voxel_size,
max_voxels=(16000, 40000)),
voxel_encoder=dict(type='H... | 0 | 0 | 0 | 0 | 0 | 0 |
code/2-enrollment/DataProviderEnrollment.py | wmh02240/3D-convolutional-speaker-recognition-pytorch | 123 | 1609296 | <gh_stars>100-1000
import torch
import torchvision
import torchvision.transforms as transforms
import os
from scipy.io.wavfile import read
import scipy.io.wavfile as wav
import subprocess as sp
import numpy as np
import argparse
import random
import os
import sys
from random import shuffle
import speechpy
import dateti... | 0 | 0 | 0 | 0 | 0 | 0 |
pymongo/collection.py | hipacloud/mongo-python-driver | 2,593 | 1609299 | # Copyright 2009-present MongoDB, 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 wri... | 131 | 58 | 2 | 0 | 191 | 0 |
tests/runners/airflow/build/spark/test_spark_image_builder.py | ZionCervello/incubator-liminal | 107 | 1609307 | <reponame>ZionCervello/incubator-liminal
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, V... | 0 | 0 | 0 | 0 | 0 | 0 |
src/data_utils.py | lyakaap/pytorch-template | 140 | 1609328 | import cv2
import numpy as np
from torch.utils.data import Dataset
from torch.utils.data import sampler
class CSVDataset(Dataset):
def __init__(self, df, transform):
self.df = df
self.transform = transform
def __getitem__(self, index) -> tuple[object, object]:
row = self.df.iloc[inde... | 0 | 5 | 0 | 0 | 5 | 0 |
cas/tests/factories.py | byuhbll/django-cas | 113 | 1609369 | <filename>cas/tests/factories.py
from django.contrib.auth.models import User
import factory
class UserFactory(factory.DjangoModelFactory):
class Meta:
model = User
username = "derekst"
first_name = "new"
last_name = "user"
is_staff = True
password = factory.PostGenerationMethodCall(... | 0 | 0 | 0 | 0 | 0 | 0 |
python-lambda-simple/app.py | hemanthkolla/cdk-templates | 117 | 1609370 | <gh_stars>100-1000
#!/usr/bin/env python3
import os
from aws_cdk import core
from python_lambda_simple.python_lambda_simple_stack import PythonLambdaSimpleStack
app = core.App()
# for production set your Environment to specify the target region and account
# Prod_Env__Ire = env=core.Environment(region="eu-west-1",ac... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow/python/distribute/ctl_correctness_test.py | BenjaminWegener/tensorflow-directml | 351 | 1609374 | <reponame>BenjaminWegener/tensorflow-directml
# 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/licen... | 0 | 0 | 0 | 0 | 0 | 0 |
lambda/lambda_read_pdf_s3_trigger.py | srcecde/aws-tutorial-code | 105 | 1609386 | <filename>lambda/lambda_read_pdf_s3_trigger.py
# -*- coding: utf-8 -*-
__author__ = "<NAME> (Srce Cde)"
__license__ = "MIT"
__email__ = "<EMAIL>"
__maintainer__ = "<NAME> (Srce Cde)"
import json
import boto3
import fitz
def lambda_handler(event, context):
"""Read file from s3 on trigger."""
# boto3 client
... | 0 | 0 | 0 | 0 | 0 | 0 |
testing/example_scripts/tmpdir/tmp_path_fixture.py | markshao/pytest | 9,225 | 1609408 | import pytest
@pytest.mark.parametrize("a", [r"qwe/\abc"])
def test_fixture(tmp_path, a):
assert tmp_path.is_dir()
assert list(tmp_path.iterdir()) == []
| 0 | 0 | 0 | 0 | 0 | 0 |
aetros/client.py | aetros/aetros-cli | 120 | 1609416 | from __future__ import annotations
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import collections
import signal
import socket
import time
import msgpack
import requests
import simplejson
import sys
import six
from paramiko.ssh_exception import NoValidC... | 9 | 21 | 0 | 32 | 62 | 0 |
grad-norm/train.py | take-cheeze/models | 112 | 1609418 | <filename>grad-norm/train.py
import argparse
import matplotlib.pyplot as plt
import numpy as np
import chainer
import chainer.functions as F
from dataset import RegressionDataset
from model import RegressionChain
from model import RegressionTrainChain
def main():
parser = argparse.ArgumentParser(description='G... | 0 | 0 | 0 | 0 | 0 | 0 |
policyuniverse/tests/test_policy.py | georgepsarakis/policyuniverse | 321 | 1609426 | <reponame>georgepsarakis/policyuniverse
# Copyright 2014 Netflix, 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
#... | 0 | 0 | 0 | 0 | 0 | 0 |
crafter/constants.py | kachayev/crafter | 161 | 1609430 | import pathlib
import ruamel.yaml as yaml
root = pathlib.Path(__file__).parent
for key, value in yaml.safe_load((root / 'data.yaml').read_text()).items():
globals()[key] = value
| 0 | 0 | 0 | 0 | 0 | 0 |
NI_DAQ/PyDAQmx/DAQmxTypes.py | roniwinik/Drivers | 103 | 1609462 | import sys
from ctypes import *
import ctypes
from .DAQmxConstants import DAQmx_copyright_year
# New types definitions
# Correspondance between the name used in the NiDAQmx.h file and ctypes
int8 = c_byte
uInt8 = c_ubyte
int16 = c_short
uInt16 = c_ushort
int32 = c_int
uInt32 = c_uint
float32 = c_float
float64 = c... | 0 | 1 | 0 | 0 | 1 | 0 |
tempest/tests/lib/common/test_jsonschema_validator.py | mail2nsrajesh/tempest | 254 | 1609465 | # Copyright 2016 NEC 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 0 | 0 | 1 | 0 | 1 | 0 |
thop/count_hooks.py | AdityaNG/LEAStereo | 186 | 1609468 | import argparse
import torch
import torch.nn as nn
multiply_adds = 1
def count_convNd(m, x, y):
x = x[0]
kernel_ops = m.weight.size()[2:].numel()
bias_ops = 1 if m.bias is not None else 0
# cout x oW x oH
total_ops = y.nelement() * (m.in_channels//m.groups * kernel_ops + bias_ops)
m.total_... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/maskRCNN_distributed/run.py | lostmygithubaccount/MLOps | 1,068 | 1609481 | <gh_stars>1000+
import os
import shutil,glob
import argparse
from git.repo.base import Repo
SRC_DIR = '/maskrcnn'
SAMPLES_DIR = os.path.join(SRC_DIR,'samples')
LOGS_DIR = os.path.join(os.getcwd(),'logs')
os.makedirs(LOGS_DIR, exist_ok = True)
parser = argparse.ArgumentParser()
parser.add_argument('--is_distributed'... | 0 | 0 | 0 | 0 | 0 | 0 |
openstackclient/tests/functional/network/v2/test_ip_availability.py | cloudification-io/python-openstackclient | 262 | 1609484 | <reponame>cloudification-io/python-openstackclient<filename>openstackclient/tests/functional/network/v2/test_ip_availability.py<gh_stars>100-1000
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the L... | 0 | 0 | 0 | 0 | 0 | 0 |
finalists/yc14600/PyTorch-Encoding/encoding/nn/__init__.py | lrzpellegrini/cvpr_clvision_challenge | 1,993 | 1609546 | <filename>finalists/yc14600/PyTorch-Encoding/encoding/nn/__init__.py
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: <NAME>
## ECE Department, Rutgers University
## Email: <EMAIL>
## Copyright (c) 2017
##
## This source code is licensed under the MIT-style license found in the... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/galaxy/model/orm/scripts.py | rhpvorderman/galaxy | 1,085 | 1609550 | from __future__ import annotations
"""
Code to support database helper scripts (create_db.py, manage_db.py, etc...).
"""
import argparse
import logging
import os
import sys
from migrate.versioning.shell import main as migrate_main
from galaxy.util.path import get_ext
from galaxy.util.properties import find_config_fil... | 3 | 2 | 0 | 0 | 5 | 0 |
examples/django_simple.py | eddiechapman/XlsxWriter | 2,766 | 1609552 | <reponame>eddiechapman/XlsxWriter
##############################################################################
#
# A simple Django view class to write an Excel file using the XlsxWriter
# module.
#
# Copyright 2013-2021, <NAME>, <EMAIL>
#
import io
from django.http import HttpResponse
from django.views.generic import... | 0 | 0 | 0 | 0 | 0 | 0 |
redash/__init__.py | DaPulse/redash | 20,680 | 1609556 | <reponame>DaPulse/redash
from __future__ import absolute_import
import logging
import os
import sys
import redis
from flask_mail import Mail
from flask_limiter import Limiter
from flask_limiter.util import get_ipaddr
from flask_migrate import Migrate
from statsd import StatsClient
from . import settings
from .app imp... | 0 | 0 | 0 | 0 | 0 | 0 |
gcloud/apigw/apps.py | wkma/bk-sops | 881 | 1609559 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 0 | 0 | 2 | 0 | 2 | 0 |
bpython/curtsies.py | dtrodrigues/bpython | 2,168 | 1609561 | # To gradually migrate to mypy we aren't setting these globally yet
# mypy: disallow_untyped_defs=True
# mypy: disallow_untyped_calls=True
import argparse
import code
import collections
import logging
import sys
import curtsies
import curtsies.events
import curtsies.input
import curtsies.window
from . import args as... | 20 | 20 | 2 | 2 | 44 | 0 |
docs/conf.py | jviide/htm.py | 112 | 1609575 | <filename>docs/conf.py<gh_stars>100-1000
project = 'htm.py'
master_doc = 'index'
html_title = 'html.py'
exclude_patterns = ['_build']
extensions = [
'sphinx_rtd_theme',
]
html_theme = 'sphinx_rtd_theme'
| 0 | 0 | 0 | 0 | 0 | 0 |
test/completion/descriptors.py | asmeurer/jedi | 239 | 1609582 | class RevealAccess(object):
"""
A data descriptor that sets and returns values
normally and prints a message logging their access.
"""
def __init__(self, initval=None, name='var'):
self.val = initval
self.name = name
def __get__(self, obj, objtype):
print('Retrieving', s... | 0 | 0 | 0 | 0 | 0 | 0 |
mode/examples/Topics/Create Shapes/WigglePShape/wiggler.py | timgates42/processing.py | 1,224 | 1609591 | # An object that wraps the PShape.
class Wiggler(object):
def __init__(self):
# For 2D Perlin noise
self.yoff: int = 0
# Its location
self.x = width / 2
self.y = height / 2
# The "original" locations of the vertices make up a circle.
# We are using a list to ... | 0 | 0 | 0 | 2 | 2 | 0 |
tiny_video_nets/batch_norm.py | deepneuralmachine/google-research | 23,901 | 1609609 | <filename>tiny_video_nets/batch_norm.py
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | 0 | 0 | 0 | 0 | 0 | 0 |
dojo/unittests/tools/test_yarn_audit_parser.py | axelpavageau/django-DefectDojo | 1,772 | 1609635 | <filename>dojo/unittests/tools/test_yarn_audit_parser.py
from django.test import TestCase
from dojo.tools.yarn_audit.parser import YarnAuditParser
from dojo.models import Engagement, Product, Test
class TestYarnAuditParser(TestCase):
def get_test(self):
test = Test()
test.engagement = Engagement()... | 0 | 0 | 0 | 0 | 0 | 0 |
test_files/uctable_Zl.py | garrettluu/js-adler32 | 224 | 1609649 | uctable = [ [ 226, 128, 168 ] ]
| 0 | 0 | 0 | 0 | 0 | 0 |
python/pyspark/mllib/recommendation.py | leen0304/Spark2.2.0-source-code | 675 | 1609659 | <reponame>leen0304/Spark2.2.0-source-code<gh_stars>100-1000
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the A... | 0 | 0 | 0 | 0 | 0 | 0 |
Algo and DSA/LeetCode-Solutions-master/Python/minimum-deletions-to-make-character-frequencies-unique.py | Sourav692/FAANG-Interview-Preparation | 3,269 | 1609662 | <gh_stars>1000+
# Time: O(n)
# Space: O(1)
import collections
import string
class Solution(object):
def minDeletions(self, s):
"""
:type s: str
:rtype: int
"""
count = collections.Counter(s)
result = 0
lookup = set()
for c in string.ascii_lowercase:... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/pxScene2d/external/libnode-v10.15.3/deps/v8/tools/bigint-tester.py | madanagopaltcomcast/pxCore | 2,151 | 1609724 | #!/usr/bin/python
# Copyright 2017 the V8 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.
from __future__ import annotations
import argparse
import math
import multiprocessing
import os
import random
import subprocess
import sy... | 0 | 50 | 0 | 0 | 50 | 0 |
Lib/xml/dom/minicompat.py | leepro/unladen-swallow | 2,293 | 1609730 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest possible NodeList implementation
#
# EmptyNodeList -- lightest possible NodeList that is guarateed to
# remain empty ... | 0 | 0 | 0 | 0 | 0 | 1 |
gfi/tweet.py | khush31/good-first-issue | 966 | 1609736 | <reponame>khush31/good-first-issue<gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Starting from the most recent addition in `data/repositories.toml`, if
the repo has not been tweeted about in the past `GoodFirstTwitter.TWEET_AGAIN`
(90) days, tweet it. In a single session, only `GoodFirstTwitter.T... | 0 | 0 | 0 | 0 | 0 | 0 |
objectModel/Python/tests/adls_test_helper.py | jocubeit/CDM | 265 | 1609769 | <filename>objectModel/Python/tests/adls_test_helper.py
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
import os
from cdm.storage import ADLSAdapter
from cdm.enums import AzureCloudEndpoint
class AdlsTestHelp... | 0 | 0 | 0 | 0 | 0 | 0 |
functions/source/registerType/lambda_function.py | autodidacticon/quickstart-amazon-eks | 372 | 1609809 | <reponame>autodidacticon/quickstart-amazon-eks
import logging
from crhelper import CfnResource
from time import sleep
import json
import boto3
from semantic_version import Version
from random import choice
execution_trust_policy = {
'Version': '2012-10-17',
'Statement': [
{
'Effect': 'Allow... | 0 | 0 | 0 | 0 | 0 | 0 |
src/operation/news.py | fekblom/critic | 216 | 1609810 | <filename>src/operation/news.py
# -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2012 <NAME>, Opera Software ASA
#
# 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.... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/apps/callcenter/tests/test_use_fixtures_configuration.py | dimagilg/commcare-hq | 471 | 1609825 | import os
from django.test import SimpleTestCase
from corehq.apps.app_manager.models import ReportAppConfig, ReportModule
from corehq.apps.callcenter import const
from corehq.apps.callcenter.app_parser import (
ParsedIndicator,
_get_indicators_used_in_forms,
_get_indicators_used_in_modules,
get_call_c... | 1 | 5 | 1 | 0 | 7 | 0 |
scripts/check_libyaml.py | jankytara2/dbt | 3,156 | 1609847 | <gh_stars>1000+
#!/usr/bin/env python
try:
from yaml import (
CLoader as Loader,
CSafeLoader as SafeLoader,
CDumper as Dumper
)
except ImportError:
from yaml import (
Loader, SafeLoader, Dumper
)
if Loader.__name__ == 'CLoader':
print("libyaml is working")
elif Loade... | 0 | 0 | 0 | 0 | 0 | 0 |
contrib/python/prompt-toolkit/py2/prompt_toolkit/terminal/win32_output.py | jochenater/catboost | 6,989 | 1609848 | <reponame>jochenater/catboost
from __future__ import unicode_literals
from ctypes import windll, byref, ArgumentError, c_char, c_long, c_ulong, c_uint, pointer
from ctypes.wintypes import DWORD, HANDLE
from prompt_toolkit.renderer import Output
from prompt_toolkit.styles import ANSI_COLOR_NAMES
from prompt_toolkit.wi... | 0 | 0 | 0 | 0 | 0 | 0 |
models/mtcnn/mtcnn_pytorch/src/matlab_cp2tform.py | nonoesp/pixel2style2pixel | 2,450 | 1609856 | <filename>models/mtcnn/mtcnn_pytorch/src/matlab_cp2tform.py
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 11 06:54:28 2017
@author: zhaoyafei
"""
import numpy as np
from numpy.linalg import inv, norm, lstsq
from numpy.linalg import matrix_rank as rank
class MatlabCp2tormException(Exception):
def _... | 0 | 0 | 0 | 0 | 0 | 0 |
libreasr/lib/decoders.py | johnpaulbin/LibreASR | 680 | 1609860 | <gh_stars>100-1000
"""
[Unused] incomplete implementation of a CTC Decoder.
"""
from itertools import groupby
from operator import itemgetter
import torch
import torch.nn as nn
import torch.nn.functional as F
def remove_duplicates(l):
return list(map(itemgetter(0), groupby(l)))
def remove_blanks(l, blank=0):
... | 0 | 0 | 0 | 0 | 0 | 0 |
pytorch_warmup/untuned.py | shuoyangd/pytorch_warmup | 170 | 1609882 | <gh_stars>100-1000
from .base import LinearWarmup, ExponentialWarmup
class UntunedLinearWarmup(LinearWarmup):
"""Untuned linear warmup schedule for Adam.
This warmup scheme is described in
`On the adequacy of untuned warmup for adaptive optimization
<https://arxiv.org/abs/1910.04209>`_.
Argument... | 0 | 0 | 0 | 0 | 0 | 0 |
tnp/__init__.py | hydiant/tnp | 295 | 1609886 | version = '0.1.1'
| 0 | 0 | 0 | 0 | 0 | 0 |
odps/ml/text/tests/test_text_algo.py | wjsi/aliyun-odps-python-sdk | 412 | 1609894 | # encoding: utf-8
# Copyright 1999-2017 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 0 | 0 | 0 | 0 | 0 | 0 |
filer/server/backends/xsendfile.py | PeterW-LWL/django-filer | 134 | 1609923 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.http import HttpResponse
from .base import ServerBase
class ApacheXSendfileServer(ServerBase):
def serve(self, request, file_obj, **kwargs) -> object:
response = HttpResponse()
response['X-Sendfile'] = file_obj.path
... | 0 | 1 | 0 | 0 | 1 | 0 |
tools/tftp_tester.py | cbowesntu/fbtftp | 389 | 1609931 | <reponame>cbowesntu/fbtftp<filename>tools/tftp_tester.py
#!/usr/bin/env python3
# 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.
import sys
import socket
import time
import hashlib
import stru... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/doc_classification.py | skirdey/FARM | 1,551 | 1609948 | <reponame>skirdey/FARM
# fmt: off
import logging
from pathlib import Path
from farm.data_handler.data_silo import DataSilo
from farm.data_handler.processor import TextClassificationProcessor
from farm.modeling.optimization import initialize_optimizer
from farm.infer import Inferencer
from farm.modeling.adaptive_model ... | 0 | 0 | 0 | 0 | 0 | 0 |
network.py | dwhite54/Probabilistic-Face-Embeddings | 312 | 1609963 | from __future__ import annotations
"""Main implementation class of PFE
"""
# MIT License
#
# Copyright (c) 2019 <NAME>
#
# 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,... | 5 | 4 | 0 | 0 | 9 | 0 |
testing/op_test.py | wangwansan/grumpy | 11,252 | 1609966 | # Copyright 2016 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 required by applicable law or a... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/test_async.py | Chia-Network/dnspython | 1,666 | 1609975 | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2017 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permis... | 0 | 47 | 8 | 0 | 55 | 0 |
PokerRL/eval/rl_br/workers/la/Dist_RLBR_LearnerActor.py | MAWUT0R/PokerRL | 247 | 1610026 | # Copyright (c) 2019 <NAME>
import ray
from PokerRL.eval.rl_br.workers.la.Local_RLBR_LearnerActor import Local_RLBR_LearnerActor as _LocalLA
@ray.remote(num_cpus=1)
class Dist_RLBR_LearnerActor(_LocalLA):
def __init__(self, t_prof, chief_handle, eval_agent_cls):
super().__init__(t_prof=t_prof, chief_h... | 0 | 0 | 0 | 0 | 0 | 0 |
phuzzer/minimizer.py | robwaz/phuzzer | 133 | 1610044 | <filename>phuzzer/minimizer.py<gh_stars>100-1000
import os
import shutil
import tempfile
import subprocess
from .phuzzers import Phuzzer
from .phuzzers.afl import AFL
import logging
l = logging.getLogger("phuzzer.Minimizer")
class Minimizer:
"""Testcase minimizer"""
def __init__(self, binary_path, testcase):... | 0 | 0 | 0 | 0 | 0 | 0 |
kloppy/infra/datasets/core/loading.py | cedrickrause/kloppy | 176 | 1610046 | <filename>kloppy/infra/datasets/core/loading.py
import os, logging
import requests
from typing import Dict, Union
from kloppy.domain import TrackingDataset, EventDataset
from .registered import _DATASET_REGISTRY
logger = logging.getLogger(__name__)
def download_file(url, local_filename):
with requests.get(u... | 0 | 0 | 0 | 0 | 0 | 0 |
mbrl/third_party/dmc2gym/__init__.py | pecey/mbrl-lib | 592 | 1610048 | <gh_stars>100-1000
import gym
from gym.envs.registration import register
def make(
domain_name,
task_name,
seed=1,
visualize_reward=True,
from_pixels=False,
height=84,
width=84,
camera_id=0,
frame_skip=1,
episode_length=1000,
environment_kwargs=None,
time_limit=None,
... | 0 | 0 | 0 | 0 | 0 | 0 |
migrations/versions/1caf0d25843b_set_on_delete_cascad.py | vault-the/changes | 443 | 1610064 | """Set ON DELETE CASCADE on AggregateTestSuite.*
Revision ID: 1caf0d25843b
Revises: <PASSWORD>
Create Date: 2013-12-23 16:15:27.526777
"""
# revision identifiers, used by Alembic.
revision = '1caf0d25843b'
down_revision = '<PASSWORD>'
from alembic import op
def upgrade():
op.drop_constraint('aggtestsuite_proj... | 0 | 0 | 0 | 0 | 0 | 0 |
tantum/libs/fmix/implementations/torchbearer_implementation.py | dmitryshendryk/tantum | 320 | 1610072 | import torch.nn.functional as F
import torchbearer
from torchbearer.callbacks import Callback
from fmix import sample_mask, FMixBase
import torch
def fmix_loss(input, y, index, lam, train: bool=True, reformulate: bool=False, bce_loss: bool=False) -> object:
r"""Criterion for fmix
Args:
input: If trai... | 13 | 5 | 0 | 0 | 18 | 0 |
examples/color_patches/color_patches/model.py | DoofCoder/mesa | 1,704 | 1610079 | """
The model - a 2D lattice where agents live and have an opinion
"""
from collections import Counter
from mesa import Model, Agent
from mesa.time import SimultaneousActivation
from mesa.space import Grid
class ColorCell(Agent):
"""
Represents a cell's opinion (visualized by a color)
"""
OPINIONS:... | 2 | 5 | 1 | 2 | 10 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.