max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 7 115 | max_stars_count int64 101 368k | id stringlengths 2 8 | content stringlengths 6 1.03M |
|---|---|---|---|---|
tests/h/search/index_test.py | BearerPipelineTest/h | 2,103 | 11136914 | import logging
from unittest import mock
from unittest.mock import sentinel
import elasticsearch
import pytest
from h.search.index import BatchIndexer
@pytest.mark.usefixtures("nipsa_service")
class TestBatchIndexer:
def test_it_indexes_all_annotations(
self, batch_indexer, factories, get_indexed_ann
... |
wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/unique_fragment_names.py | borisgrafx/client | 3,968 | 11136920 | from ...error import GraphQLError
from .base import ValidationRule
class UniqueFragmentNames(ValidationRule):
__slots__ = 'known_fragment_names',
def __init__(self, context):
super(UniqueFragmentNames, self).__init__(context)
self.known_fragment_names = {}
def enter_OperationDefinition(s... |
atomate/vasp/fireworks/tests/test_lobster.py | rkingsbury/atomate | 167 | 11136932 | <filename>atomate/vasp/fireworks/tests/test_lobster.py
import os
import unittest
from atomate.vasp.fireworks.core import StaticFW
from atomate.vasp.fireworks.lobster import LobsterFW
from pymatgen.core.lattice import Lattice
from pymatgen.core.structure import Structure
__author__ = "<NAME>, <NAME>"
__email_... |
SegNet_Conv/test.py | xwshi/Semantic-Segmentation | 380 | 11136934 | <gh_stars>100-1000
#---------------------------------------------#
# 该部分用于查看网络结构
#---------------------------------------------#
from nets.segnet import convnet_segnet
if __name__ == "__main__":
model = convnet_segnet(2, input_height=416, input_width=416)
model.summary()
|
sympy/ntheory/bbp_pi.py | iamabhishek0/sympy | 445 | 11136961 | <reponame>iamabhishek0/sympy
'''
This implementation is a heavily modified fixed point implementation of
BBP_formula for calculating the nth position of pi. The original hosted
at: http://en.literateprograms.org/Pi_with_the_BBP_formula_(Python)
# Permission is hereby granted, free of charge, to any person obtaining
# ... |
Python/hello_hack_2018.py | PushpneetSingh/Hello-world | 1,428 | 11136963 | print ("Hello Hacktoberfest 2018 World")
|
octavia/statistics/drivers/logger.py | zhangi/octavia | 129 | 11136965 | <reponame>zhangi/octavia
# Copyright 2018 GoDaddy
#
# 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 agree... |
onnxruntime/test/testdata/coreml_argmax_cast_test.py | mszhanyi/onnxruntime | 669 | 11136975 | import onnx
from onnx import TensorProto, helper
# CoreML EP currently handles a special case for supporting ArgMax op
# Please see in <repo_root>/onnxruntime/core/providers/coreml/builders/impl/argmax_op_builder.cc and
# <repo_root>/onnxruntime/core/providers/coreml/builders/impl/cast_op_builder.cc
# We have this sep... |
tests/someapp/models.py | oss-transfer/django-neomodel | 166 | 11136981 | <filename>tests/someapp/models.py
from datetime import datetime
from django.db import models
from django_neomodel import DjangoNode
from neomodel import StringProperty, DateTimeProperty, UniqueIdProperty
class Library(models.Model):
name = models.CharField(max_length=10)
class Meta:
app_label = 'som... |
src/ui/uivar.py | JayHeng/-NXP-MCUBootUtility | 174 | 11136987 | <filename>src/ui/uivar.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import json
import uidef
import RTyyyy_uidef
import RTxxx_uidef
g_exeTopRoot = None
g_soundEffectType = None
g_languageIndex = None
g_hasSubWinBeenOpened = False
g_efuseDict = {'0x400_lock':0x00000000,
'0x450_b... |
textattack/models/tokenizers/glove_tokenizer.py | xinzhel/TextAttack | 1,980 | 11136993 | <reponame>xinzhel/TextAttack
"""
Glove Tokenizer
^^^^^^^^^^^^^^^^^
"""
import json
import tempfile
import tokenizers as hf_tokenizers
class WordLevelTokenizer(hf_tokenizers.implementations.BaseTokenizer):
"""WordLevelTokenizer.
Represents a simple word level tokenization using the internals of BERT's
... |
backend/server/server/urls.py | Bonifase/django-react | 508 | 11136997 | from django.contrib import admin
from django.urls import path
from apps.accounts.urls import accounts_urlpatterns
from apps.notes.urls import notes_urlpatterns
urlpatterns = [
path('admin/', admin.site.urls),
]
urlpatterns += accounts_urlpatterns # add URLs for authentication
urlpatterns += notes_urlpatterns # n... |
test/com/facebook/buck/skylark/parser/testdata/attr/int_list/defs.bzl | Unknoob/buck | 8,027 | 11137003 | <reponame>Unknoob/buck
""" Module docstring """
def well_formed():
""" Function docstring """
a = attr.int_list()
if repr(a) != "<attr.int_list>":
fail("Expected attr.int_list instance")
a = attr.int_list(mandatory = True, doc = "Some int_list", default = [1])
if repr(a) != "<attr.int_list>... |
test/regression/features/lambda/lambda_arity2.py | ppelleti/berp | 137 | 11137012 | l = lambda x,y: x + y
print(l(3,9))
|
vumi/components/tests/test_window_manager.py | seidu626/vumi | 199 | 11137015 | <reponame>seidu626/vumi<filename>vumi/components/tests/test_window_manager.py<gh_stars>100-1000
from twisted.internet.defer import inlineCallbacks
from twisted.internet.task import Clock
from vumi.components.window_manager import WindowManager, WindowException
from vumi.tests.helpers import VumiTestCase, PersistenceHe... |
inclearn/models/zil.py | Zotkin/incremental_learning.pytorch | 277 | 11137033 | import collections
import copy
import functools
import logging
import math
import os
import pickle
import numpy as np
import torch
from sklearn import preprocessing as skpreprocessing
from sklearn.svm import SVC
from sklearn.utils.class_weight import compute_class_weight
from torch import nn
from torch.nn import funct... |
koku/api/report/test/azure/test_views.py | rubik-ai/koku | 157 | 11137034 | <filename>koku/api/report/test/azure/test_views.py
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Test the Azure Report views."""
from unittest.mock import patch
from django.http import HttpRequest
from django.http import QueryDict
from django.urls import reverse
from faker import Faker
fro... |
corehq/apps/app_manager/__init__.py | dimagilg/commcare-hq | 471 | 11137041 | <gh_stars>100-1000
from django.apps import AppConfig
from django.conf import settings
from corehq.preindex import ExtraPreindexPlugin
class AppManagerAppConfig(AppConfig):
name = 'corehq.apps.app_manager'
def ready(self):
# Also sync this app's design docs to APPS_DB
ExtraPreindexPlugin.regi... |
elkserver/docker/redelk-base/redelkinstalldata/scripts/modules/helpers.py | gitradar/RedELK | 1,863 | 11137046 | <reponame>gitradar/RedELK<filename>elkserver/docker/redelk-base/redelkinstalldata/scripts/modules/helpers.py
#!/usr/bin/python3
"""
Part of RedELK
Authors:
- <NAME>. / <NAME> (@xychix)
- <NAME> (@fastlorenzo)
"""
import copy
import datetime
import json
import logging
import os
from elasticsearch import Elasticsearch
... |
devtools/scripts/conda_env.py | jhrmnn/QCEngine | 105 | 11137055 | <reponame>jhrmnn/QCEngine
import argparse
import os
import shutil
import subprocess as sp
# Args
parser = argparse.ArgumentParser(description='Creates a conda environment from file for a given Python version.')
parser.add_argument('-n', '--name', type=str, nargs=1, help='The name of the created Python environment')
pa... |
scripts/speech/head.py | Steven1791/seq2seq | 383 | 11137065 | #!/usr/bin/env python3
import argparse
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('input')
parser.add_argument('output')
parser.add_argument('-n', type=int, default=10)
args = parser.parse_args()
with open(args.input, 'rb') as input_file, open(args.output, 'wb') as output_file:
n, ... |
mmdet/utils/__init__.py | cameronchoi/r3det-docker | 176 | 11137090 | <filename>mmdet/utils/__init__.py<gh_stars>100-1000
from .collect_env import collect_env
from .flops_counter import get_model_complexity_info
from .logger import get_root_logger
from .rbbox_visualization import imshow_det_rbboxes
__all__ = ['get_model_complexity_info', 'get_root_logger', 'collect_env',
'ims... |
track2/test-densemapnet.py | omshinde/dfc2019 | 123 | 11137098 | <reponame>omshinde/dfc2019
import numpy as np
import os
from keras.models import load_model
from keras.applications import imagenet_utils
from tqdm import tqdm
import tifffile
import cv2
import glob
from densemapnet import densemapnet
import argparse
NO_DATA = -999.0
COMPLETENESS_THRESHOLD_PIXELS = 3.0
#GPU="0" # def... |
tf_agents/networks/nest_map_test.py | anair13/agents | 3,175 | 11137113 | <filename>tf_agents/networks/nest_map_test.py<gh_stars>1000+
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.... |
tests/test_encoding/test_woe_encoder.py | janrito/feature_engine | 650 | 11137115 | <gh_stars>100-1000
import pandas as pd
import pytest
from sklearn.exceptions import NotFittedError
from feature_engine.encoding import WoEEncoder
def test_automatically_select_variables(df_enc):
# test case 1: automatically select variables, woe
encoder = WoEEncoder(variables=None)
encoder.fit(df_enc[["... |
aws-blog-campanile/bin/multipartlist.py | securityscorecard/aws-big-data-blog | 305 | 11137117 | #!/usr/bin/python2.7
import sys
import os
import fileinput
import argparse
import math
import uuid
# -----------------------------------------------------------------------------
# Support for Hadoop Streaming Sandbox Env
# -----------------------------------------------------------------------------
sys.path.append... |
REST/python/Targets/add-role-to-target.py | gdesai1234/OctopusDeploy-Api | 199 | 11137132 | <filename>REST/python/Targets/add-role-to-target.py<gh_stars>100-1000
import json
import requests
octopus_server_uri = 'https://your.octopus.app/api'
octopus_api_key = 'API-YOURAPIKEY'
headers = {'X-Octopus-ApiKey': octopus_api_key}
def get_octopus_resource(uri):
response = requests.get(uri, headers=headers)
... |
src/visitpy/visit_flow/flow/src/core/__init__.py | visit-dav/vis | 226 | 11137144 | <filename>src/visitpy/visit_flow/flow/src/core/__init__.py<gh_stars>100-1000
# Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: __init__.py... |
modules/tools/record_parse_save/parse_radar.py | jzjonah/apollo | 22,688 | 11137151 | <filename>modules/tools/record_parse_save/parse_radar.py
#!/usr/bin/env python3
###############################################################################
# Copyright 2018 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file excep... |
qiskit/circuit/library/generalized_gates/pauli.py | Roshan-Thomas/qiskit-terra | 1,456 | 11137204 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wor... |
test/sample.py | vlcinsky/nameko | 3,425 | 11137209 | <filename>test/sample.py<gh_stars>1000+
import logging
from nameko.rpc import rpc
log = logging.getLogger('test.sample')
class Service(object):
name = "service"
@rpc
def ping(self):
log.info('ping!')
|
venv/Lib/site-packages/scipy/linalg/tests/test_solvers.py | unbun/snake.ai | 6,989 | 11137220 | from __future__ import division, print_function, absolute_import
import os
import numpy as np
from numpy.testing import assert_array_almost_equal
import pytest
from pytest import raises as assert_raises
from scipy.linalg import solve_sylvester
from scipy.linalg import solve_continuous_lyapunov, solve_discrete_lyapun... |
ote_sdk/ote_sdk/tests/entities/test_id.py | ntyukaev/training_extensions | 775 | 11137263 | <reponame>ntyukaev/training_extensions<gh_stars>100-1000
# Copyright (C) 2021-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import pytest
from bson import ObjectId
from ote_sdk.entities.id import ID
from ote_sdk.tests.constants.ote_sdk_components import OteSdkComponent
from ote_sdk.tests.constants.req... |
library/src/greppo/layers/tile_layer.py | greppo-io/greppo | 221 | 11137291 | <gh_stars>100-1000
from dataclasses import dataclass
import uuid
@dataclass
class TileLayerComponent:
def __init__(
self,
url: str,
name: str,
description: str = '',
visible: bool = True,
opacity: float = 1.0,
):
self.url = url
self.name = name
... |
study/vowel_spectrum.py | Kshitiz-Bansal/wavetorch | 470 | 11137302 | """Generate plot of the mean vowel sample spectra
"""
import torch
import wavetorch
from torch.utils.data import TensorDataset, DataLoader
import argparse
import yaml
import time
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.gridspec import GridSpec
import pan... |
example/timestamp-as-a-service/services/web/app.py | fatash89/sanic | 251 | 11137335 | from datetime import datetime
from flask import Flask, render_template
from redis import Redis
app = Flask(__name__)
redis = Redis(host='redis', retry_on_timeout=True)
@app.route('/')
def index():
timestamp_id = redis.get('TIMESTAMP_ID') or 0
return render_template('index.html', timestamps=timestamp_id)
i... |
jni-build/jni/include/tensorflow/contrib/learn/python/learn/tests/coordinated_session_test.py | rcelebi/android-elfali | 680 | 11137353 | # pylint: disable=g-bad-file-header
# Copyright 2016 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/LICENS... |
pundle.py | ksimmi/pundler | 209 | 11137362 | # encoding: utf-8
"""
Data Model, start here to not get mad
=====================================
Main entity will be distribution, like Flask. Per key
Pundle tracks three state parts:
1. requirement, like Flask>0.12.2.
2. frozen version, like ==0.12.2
3. installed distributions, like [flask==0.12.2, flask... |
kolla_ansible/kolla_address.py | okleinschmidt/kolla-ansible | 531 | 11137370 | <reponame>okleinschmidt/kolla-ansible
# -*- coding: utf-8 -*-
#
# Copyright 2019 <NAME> (yoctozepto)
#
# 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... |
tools/app_reg/build.py | kokosing/hue | 5,079 | 11137382 | #!/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... |
src/beanmachine/ppl/compiler/fix_problems.py | facebookresearch/beanmachine | 177 | 11137389 | <gh_stars>100-1000
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Callable, List, Set
import beanmachine.ppl.compiler.profiler as prof
from beanmachine.ppl.compiler.bm... |
Trakttv.bundle/Contents/Libraries/Shared/trakt/interfaces/users/__init__.py | disrupted/Trakttv.bundle | 1,346 | 11137433 | from trakt.core.helpers import popitems
from trakt.interfaces.base import Interface, authenticated
from trakt.mapper import CommentMapper, ListMapper
# Import child interfaces
from trakt.interfaces.users.lists import UsersListInterface, UsersListsInterface
from trakt.interfaces.users.settings import UsersSettingsInter... |
aminator/plugins/manager.py | vijay-khanna/Netflix-aminator | 721 | 11137434 | <reponame>vijay-khanna/Netflix-aminator<gh_stars>100-1000
# -*- coding: utf-8 -*-
#
#
# Copyright 2013 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
#
# ... |
examples/optimistic_lock.py | rspadim/aiocache | 459 | 11137438 | <filename>examples/optimistic_lock.py
import asyncio
import logging
import random
from aiocache import Cache
from aiocache.lock import OptimisticLock, OptimisticLockError
logger = logging.getLogger(__name__)
cache = Cache(Cache.REDIS, endpoint='127.0.0.1', port=6379, namespace='main')
async def expensive_function(... |
development_playgrounds/TSexperiments/Oscillatory/result_loader.py | ai-di/Brancher | 208 | 11137474 | import pickle
import numpy as np
filename = 'Full_os_results.pickle'
with open(filename, 'rb') as f:
x = pickle.load(f)
MSE = {"ASVI": (np.mean([np.sqrt(error) for error in x["PE"]["MSE"]]), np.std([np.sqrt(error) for error in x["PE"]["MSE"]])/np.sqrt(len(x["PE"]["MSE"]))),
"ADVI (MF)": (np.mean([np.sqrt(error) ... |
maskrcnn_benchmark/modeling/backbone/mixer.py | microsoft/GLIP | 295 | 11137501 | import torch
from torch import nn
class MixedOperationRandom(nn.Module):
def __init__(self, search_ops):
super(MixedOperationRandom, self).__init__()
self.ops = nn.ModuleList(search_ops)
self.num_ops = len(search_ops)
def forward(self, x, x_path=None):
if x_path is No... |
atest/testdata/running/binary_list.py | rdagum/robotframework | 7,073 | 11137508 | <filename>atest/testdata/running/binary_list.py
LIST__illegal_values = ('illegal:\x00\x08\x0B\x0C\x0E\x1F',
'more:\uFFFE\uFFFF')
|
oncogemini/mendelianerror.py | fakedrtom/cancer_gemini | 221 | 11137520 | <filename>oncogemini/mendelianerror.py
"""
Calculate the probability of a mendelian error given the genotype likelihoods
from a trio."""
from __future__ import print_function
import sys
from math import log10
import gzip
nan = float('nan')
class LowGenotypeException(Exception):
pass
def rescale(li):
s = flo... |
python/jupyter_flex/tests/test_pkg.py | ocefpaf/jupyter-flex | 245 | 11137534 | <reponame>ocefpaf/jupyter-flex
import os
import pytest
import jupyter_flex
from jupyter_flex.config import settings
pytestmark = [pytest.mark.nondestructive, pytest.mark.pkg]
def test_import():
assert jupyter_flex.__version__ is not None
assert jupyter_flex.__version__ != "0.0.0"
assert len(jupyter_fl... |
scripts/test/test_import_point_cloud.py | sparsebase/facebook360_dep | 221 | 11137538 | #!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""Unit test class for ImportPointCloud.
This class subclasses the DepTest class, which provides some utilit... |
tools/codegen-diff-revisions.py | 82marbag/smithy-rs | 125 | 11137566 | <reponame>82marbag/smithy-rs
#!/usr/bin/env python3
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
#
# This script can be run and tested locally. To do so, you should check out
# a second smithy-rs repository so that you can work on the script and still
# ... |
test_integration/test_skill_tellina.py | cohmoti/clai | 391 | 11137577 | <reponame>cohmoti/clai
#
# Copyright (C) 2020 IBM. All Rights Reserved.
#
# See LICENSE.txt file in the root directory
# of this source tree for licensing information.
#
from test_integration.contract_skills import ContractSkills
class TestSkillTellina(ContractSkills):
def get_skill_name(self):
return '... |
sagemaker-python-sdk/tensorflow_serving_container/sample_utils.py | pollyrolly/amazon-sagemaker-examples | 2,610 | 11137581 | <reponame>pollyrolly/amazon-sagemaker-examples
import cv2
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
def tfhub_to_savedmodel(
model_name, export_path, uri_pattern="https://tfhub.dev/google/imagenet/{}/classification/2"
):
"""Download a model from TensorFlow Hub, add inputs and out... |
Tools/heatcalculator.py | zhyinty/HeliumRain | 646 | 11137607 | <reponame>zhyinty/HeliumRain<gh_stars>100-1000
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import configparser
import math
import sys
OVERHEAT_TEMPERATURE = 1200
BURN_TEMPERATURE = 1500
SOLAR_POWER = 3.094
def print_u(str):
bytes_str = (str + "\n").encode('utf8')
sys.stdout.buffer.write(bytes_str)
class Ship:
n... |
uberduck_ml_dev/_nbdev.py | Cris140/uberduck-ml-dev | 167 | 11137618 | <filename>uberduck_ml_dev/_nbdev.py
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"ensure_speaker_table": "data.cache.ipynb",
"STANDARD_MULTISPEAKER": "data.parse.ipynb",
"STANDARD_SINGLESPEAKER": "data.parse.ipynb",
"VCTK": "d... |
rl_agents/agents/tree_search/mdp_gape.py | RockWenJJ/rl-agents | 342 | 11137619 | import logging
import numpy as np
from rl_agents.agents.common.factory import safe_deepcopy_env
from rl_agents.agents.tree_search.olop import OLOP, OLOPAgent, OLOPNode
from rl_agents.utils import max_expectation_under_constraint, kl_upper_bound
logger = logging.getLogger(__name__)
class MDPGapE(OLOP):
"""
... |
BitsParser.py | fireeye/BitsParser | 104 | 11137624 | # Copyright 2021 FireEye, 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, s... |
office365/sharepoint/folders/folder.py | vgrem/Office365-REST-Python-Client | 544 | 11137653 | from office365.runtime.client_result import ClientResult
from office365.runtime.queries.create_entity_query import CreateEntityQuery
from office365.runtime.queries.service_operation_query import ServiceOperationQuery
from office365.runtime.queries.update_entity_query import UpdateEntityQuery
from office365.runtime.path... |
panel/models/layout.py | sthagen/holoviz-panel | 601 | 11137679 | <reponame>sthagen/holoviz-panel
from bokeh.core.properties import (
Bool, List, Nullable, String,
)
from bokeh.models import Column
class Card(Column):
active_header_background = Nullable(String, help="Background color of active Card header.")
button_css_classes = List(String, help="CSS classes to add t... |
greykite/sklearn/transform/build_timeseries_features_transformer.py | CaduceusInc/greykite | 1,503 | 11137684 | <filename>greykite/sklearn/transform/build_timeseries_features_transformer.py
# BSD 2-CLAUSE LICENSE
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# Redistributions of source code must retain the above copyright notic... |
diffusion/models/models.py | DazhiZhong/v-diffusion-pytorch | 393 | 11137693 | <filename>diffusion/models/models.py
from . import cc12m_1, danbooru_128, imagenet_128, wikiart_128, wikiart_256, yfcc_1, yfcc_2
models = {
'cc12m_1': cc12m_1.CC12M1Model,
'cc12m_1_cfg': cc12m_1.CC12M1Model,
'danbooru_128': danbooru_128.Danbooru128Model,
'imagenet_128': imagenet_128.ImageNet128Model,
... |
utils.py | tolleybot/fast-depth | 759 | 11137714 | import os
import torch
import shutil
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import math
cmap = plt.cm.viridis
def parse_command():
data_names = ['nyudepthv2']
from dataloaders.dataloader import MyDataloader
modality_names = MyDataloader.modality_names
import argpar... |
pythonz/installer/versions.py | saghul/pythonz | 358 | 11137740 | versions = {
'cpython': {
'2.4': 'ff746de0fae8691c082414b42a2bb172da8797e6e8ff66c9a39d2e452f7034e9',
'2.4.1': 'f449c3b167389324c525ad99d02376c518ac11e163dbbbc13bc88a5c7101fd00',
'2.4.2': '2653e1846e87fd9b3ee287fefc965c80c54646548b4913a22265b0dd54493adf',
'2.4.3': '985a413932f5e31e628... |
test.py | ATrain951/01.python_function-milaan9 | 167 | 11137761 | <filename>test.py
# Python Module example
def fun():
print("something here inside fun()")
|
vis/python/plot_mesh.py | dfielding14/athena-public-version | 174 | 11137768 | #! /usr/bin/env python
"""
Script for plotting mesh structure in mesh_structure.dat (default) file produced
by running Athena++ with "-m <np>" argument.
Can optionally specify "-i <input_file>" and/or "-o <output_file>". Output
defaults to using "show()" command rather than saving to file.
"""
# Python modules
impor... |
modules/roamresearch.py | hwiorn/orger | 241 | 11137815 | #!/usr/bin/env python3
from itertools import chain
from typing import Iterable
from orger import Mirror
from orger.inorganic import node, link, OrgNode
from orger.common import dt_heading
from orger import pandoc
import my.roamresearch as roamresearch
# todo ^^ ^^ things are highlight?
def roam_text_to_org(text: st... |
app.py | kougou/DialogStateTracking | 246 | 11137834 | from flask import Flask, render_template, request
from flask import jsonify
import main as botmodule
# global
bot = None
app = Flask(__name__,static_url_path="/static")
'''
Routing
'''
# @GET
# PATH : /query
@app.route('/query', methods=['GET'])
def reply():
return bot.reply(request.args['msg'])
'''
... |
it/structures/python3/default_naming-default/test.py | reproto/reproto | 108 | 11137849 | import lower_camel as lower_camel
import lower_snake as lower_snake
import upper_camel as upper_camel
import upper_snake as upper_snake
class Entry:
def __init__(self, _lower_camel, _lower_snake, _upper_camel, _upper_snake):
self._lower_camel = _lower_camel
self._lower_snake = _lower_snake
self._upper_ca... |
Diagnostic/watcherutil.py | shridpant/azure-linux-extensions | 266 | 11137860 | <reponame>shridpant/azure-linux-extensions
#!/usr/bin/env python
#
# Azure Linux extension
#
# Linux Azure Diagnostic Extension (Current version is specified in manifest.xml)
# Copyright (c) Microsoft Corporation
# All rights reserved.
# MIT License
# Permission is hereby granted, free of charge, to any person obtainin... |
python/test/utils/test_graph_converters/test_identity.py | daniel-falk/nnabla | 2,792 | 11137892 | <reponame>daniel-falk/nnabla
# Copyright 2020,2021 Sony 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 ... |
jcvi/assembly/kmer.py | inspirewind/jcvi | 517 | 11137905 | <reponame>inspirewind/jcvi
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Deals with K-mers and K-mer distribution from reads or genome
"""
import os.path as op
import sys
import logging
import math
import numpy as np
from collections import defaultdict
from jcvi.graphics.base import (
plt,
adjust_spines,... |
scripts/external_libs/ansi2html/ansi2html/style.py | timgates42/trex-core | 956 | 11137920 | # This file is part of ansi2html.
# Copyright (C) 2012 <NAME> <<EMAIL>>
# Copyright (C) 2013 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version... |
universe/remotes/docker_remote.py | BitJetKit/universe | 8,120 | 11137926 | <reponame>BitJetKit/universe
from __future__ import absolute_import
import base64
import logging
import os
import pipes
import sys
import threading
import uuid
import time, random
import docker
import six.moves.urllib.parse as urlparse
from gym.utils import closer
from universe import error
from universe.remotes impo... |
pymoo/vendor/go_benchmark_functions/go_funcs_F.py | gabicavalcante/pymoo | 762 | 11137944 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from .go_benchmark import Benchmark
class FreudensteinRoth(Benchmark):
r"""
FreudensteinRoth objective function.
This class defines the Freudenstein & Roth [1]_ global optimization problem.
T... |
tests/test_guid_type.py | nyejon/fastapi-utils | 994 | 11137964 | import uuid
from fastapi import FastAPI
from starlette.testclient import TestClient
from fastapi_utils.session import context_session
from tests.conftest import User, session_maker
def test_guid(test_app: FastAPI) -> None:
name1 = "test_name_1"
name2 = "test_name_2"
user_id_1 = str(uuid.uuid4())
wi... |
data_capture/decorators.py | mepsd/CLAC | 126 | 11137990 | <filename>data_capture/decorators.py
from functools import wraps
from django.shortcuts import redirect
from frontend import ajaxform
def handle_cancel(*args, redirect_name='index', key_prefix='data_capture:'):
'''
Decorator to handle cancel behavior in Data Capture flows.
The associated request's POST d... |
piGAN_lib/eval_metrics.py | zihangJiang/CIPS-3D | 308 | 11137993 | import os
import shutil
import torch
import math
from torch_fidelity import calculate_metrics
from torchvision.utils import save_image
from tqdm import tqdm
import copy
import argparse
import shutil
import curriculums
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('generat... |
lib/jnpr/junos/command/__init__.py | kimcharli/py-junos-eznc | 576 | 11137999 | import sys
import os
import yaml
import types
from jnpr.junos.factory.factory_loader import FactoryLoader
import yamlordereddictloader
__all__ = []
class MetaPathFinder(object):
def find_module(self, fullname, path=None):
mod = fullname.split(".")[-1]
if mod in [
os.path.splitext(i)... |
test/test_utils/io/test_traj_logging.py | TheVinhLuong102/AutoML-SMAC3 | 711 | 11138005 | import tempfile
import logging
import json
import os
import unittest.mock
from unittest.mock import patch
from smac.utils.io.traj_logging import TrajLogger
from smac.utils.io.traj_logging import TrajEntry
from smac.configspace import ConfigurationSpace,\
Configuration, CategoricalHyperparameter, Constant, Unifor... |
tests/filters/filters.py | pyllyukko/plaso | 1,253 | 11138023 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the event filter expression parser filter classes."""
import unittest
from plaso.containers import events
from plaso.filters import filters
from plaso.lib import definitions
from tests import test_lib as shared_test_lib
from tests.containers import test_lib... |
examples/testapp/testapp/views.py | benthomasson/gevent-socketio | 625 | 11138027 | <gh_stars>100-1000
from pyramid.view import view_config
import gevent
from socketio import socketio_manage
from socketio.namespace import BaseNamespace
from socketio.mixins import RoomsMixin, BroadcastMixin
from gevent import socket
def index(request):
""" Base view to load our template """
return {}
"""
AC... |
tests/io/test_everest.py | jorgemarpa/lightkurve | 235 | 11138048 | import pytest
from lightkurve import search_lightcurve
@pytest.mark.remote_data
def test_search_everest():
"""Can we search and download an EVEREST light curve?"""
search = search_lightcurve("GJ 9827", author="EVEREST", campaign=12)
assert len(search) == 1
assert search.table["author"][0] == "EVEREST... |
Chapter02/calendar_form.py | trappn/Mastering-GUI-Programming-with-Python | 138 | 11138050 | <reponame>trappn/Mastering-GUI-Programming-with-Python<gh_stars>100-1000
import sys
from PyQt5 import QtWidgets as qtw
from PyQt5 import QtCore as qtc
class MainWindow(qtw.QWidget):
def __init__(self):
"""MainWindow constructor."""
super().__init__()
# Configure the window
self.se... |
tests/www/views/test_views_pool.py | ChaseKnowlden/airflow | 15,947 | 11138124 | #
# 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, Version 2.0 (the
# "License"); you may not... |
tests/test_metrics.py | vpeopleonatank/segmentation | 122 | 11138157 | import numpy as np
import pytest
import torch
from sklearn.metrics import f1_score
from src.metrics.f1_score import F1Score
from src.utils.utils import set_seed
@torch.no_grad()
@pytest.mark.parametrize('average', ['micro', 'macro', 'weighted'])
def test_f1score_metric(average: str) -> None:
set_seed(42)
lab... |
frontend/src/indexesfrontend.py | grofers/PGObserver | 274 | 11138162 | import flotgraph
import time
import indexdata
import hosts
import datetime
import tplE
class IndexesFrontend(object):
def default(self, *p, **params):
if len(p) < 2:
return ""
hostId = int(p[0]) if p[0].isdigit() else hosts.uiShortnameToHostId(p[0])
hostUiName = p[0] if not ... |
openpoiservice/server/db_import/models.py | larsrinn/openpoiservice | 131 | 11138178 | <reponame>larsrinn/openpoiservice<filename>openpoiservice/server/db_import/models.py
# openpoiservice/server/models.py
from openpoiservice.server import db, ops_settings
from geoalchemy2 import Geography
import logging
logger = logging.getLogger(__name__)
class POIs(db.Model):
__tablename__ = ops_settings['provi... |
play-1.2.4/python/Lib/site-packages/win32/lib/sspicon.py | AppSecAI-TEST/restcommander | 550 | 11138201 | # Generated by h2py from c:\microsoft sdk\include\sspi.h
ISSP_LEVEL = 32
ISSP_MODE = 1
ISSP_LEVEL = 32
ISSP_MODE = 0
ISSP_LEVEL = 32
ISSP_MODE = 1
def SEC_SUCCESS(Status): return ((Status) >= 0)
SECPKG_FLAG_INTEGRITY = 1
SECPKG_FLAG_PRIVACY = 2
SECPKG_FLAG_TOKEN_ONLY = 4
SECPKG_FLAG_DATAGRAM = 8
SECPKG_FLAG_CONNECTION... |
terrascript/testing/d.py | mjuenema/python-terrascript | 507 | 11138229 | # terrascript/testing/d.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class testing_assertions(terrascript.Data):
pass
class testing_tap(terrascript.Data):
pass
|
octoprint/tests/test_octoprint.py | divyamamgai/integrations-extras | 158 | 11138262 | import mock
import pytest
from datadog_checks.octoprint import OctoPrintCheck
@pytest.mark.skip
@pytest.mark.integration
@pytest.mark.usefixtures('dd_environment')
@mock.patch('datadog_checks.octoprint.OctoPrintCheck.get_rpi_core_temp')
def test_check(mock_rpi_temp, aggregator, mock_api_request, instance):
mock_... |
examples/kddcup2021/MAG240M/r_unimp/dataset/sage_all_data.py | zbmain/PGL | 1,389 | 11138264 | <filename>examples/kddcup2021/MAG240M/r_unimp/dataset/sage_all_data.py
import os
import yaml
import pgl
import time
import copy
import numpy as np
import os.path as osp
from pgl.utils.logger import log
from pgl.graph import Graph
from pgl import graph_kernel
from pgl.sampling.custom import subgraph
from ogb.lsc import ... |
v7.0/mania_analyze.py | jsstwright/osumapper | 296 | 11138267 | # -*- coding: utf-8 -*-
#
# JSON osu! map analysis (for osu!mania)
#
import numpy as np;
def get_map_timing_array(map_json, length=-1, divisor=4):
if length == -1:
length = map_json["obj"][-1]["time"] + 1000; # it has an extra time interval after the last note
if map_json["obj"][-1]["type"] & 8: ... |
tests_tensorflow/test_sphere.py | aferrall/redner | 1,146 | 11138272 | <gh_stars>1000+
# Tensorflow by default allocates all GPU memory, leaving very little for rendering.
# We set the environment variable TF_FORCE_GPU_ALLOW_GROWTH to true to enforce on demand
# memory allocation to reduce page faults.
import os
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'
import tensorflow as tf
tf.c... |
lib/cli_output.py | bingpo/Vxscan | 1,511 | 11138329 | import sys
import time
import pyfiglet
from lib.bcolors import Bcolors
from lib.settings import POC, THREADS, SCANDIR, PING, SOCKS5, CHECK_DB
def banner():
ascii_banner = pyfiglet.figlet_format("Vxscan")
print(Bcolors.RED + ascii_banner + Bcolors.ENDC)
def start_out(hosts):
sys.stdout.write(Bcolors.OK... |
examples/contrib/magic_square_and_cards.py | klorel/or-tools | 279 | 11138346 | # Copyright 2010 <NAME> <EMAIL>
#
# 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... |
recipes/Python/347810_Load_datweb_browser_without_using_temp/recipe-347810.py | tdiprima/code | 2,023 | 11138351 | import BaseHTTPServer
import webbrowser
def LoadInDefaultBrowser(html):
"""Display html in the default web browser without creating a temp file.
Instantiates a trivial http server and calls webbrowser.open with a URL
to retrieve html from that server.
"""
class RequestHandler(BaseHTTPServer.BaseH... |
runtests.py | efeslab/llvmlite | 1,384 | 11138372 | <gh_stars>1000+
#!/usr/bin/env python
import sys
from llvmlite.tests import main
if __name__ == "__main__":
main()
|
mpcomp/client.py | sanjay051099/try2- | 199 | 11138389 | <reponame>sanjay051099/try2-<filename>mpcomp/client.py
#!/usr/bin/env python
#
# Copyright (C) 2008, 2009 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.apach... |
geoq/core/admin.py | kaydoh/geoq | 471 | 11138393 | <reponame>kaydoh/geoq
# -*- coding: utf-8 -*-
# This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012)
from reversion.admin import VersionAdmin
from django.contrib.gis im... |
tools/build/test/chain.py | Manu343726/boost-cmake | 2,831 | 11138395 | <reponame>Manu343726/boost-cmake
#!/usr/bin/python
# Copyright 2003 <NAME>
# Copyright 2002, 2003 <NAME>
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# This tests that :
# 1) the 'make' correctly assigns types to produc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.