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 |
|---|---|---|---|---|
acp/__main__.py | 6sibilings/daniel-Allen | 133 | 11194748 | <gh_stars>100-1000
import cli
cli.main()
|
Recoveries/chrome.py | Harot5001/Radium-Keylogger | 498 | 11194752 | <reponame>Harot5001/Radium-Keylogger
import sqlite3
import shutil
import win32crypt
import sys, os, platform
class Chrome():
def __init__(self):
pass
def run(self):
database_path = ''
if 'HOMEDRIVE' in os.environ and 'HOMEPATH' in os.environ:
# For Win7
path_W... |
h2o-py/h2o/model/extensions/varimp.py | MikolajBak/h2o-3 | 6,098 | 11194756 | from h2o.utils.ext_dependencies import get_matplotlib_pyplot
from h2o.utils.typechecks import assert_is_type
class VariableImportance:
def _varimp_plot(self, num_of_features=None, server=False):
"""
Plot the variable importance for a trained model.
:param num_of_features: the number of f... |
main.py | eyotang/atxserver2-ios-provider | 103 | 11194757 | from __future__ import print_function
import argparse
import os
import shutil
import subprocess
import tempfile
import time
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from functools import partial
import requests
import tornado.web
from logzero import logger
from tornado imp... |
pip_audit/_fix.py | pombredanne/pip-audit | 447 | 11194763 | <reponame>pombredanne/pip-audit<filename>pip_audit/_fix.py
"""
Functionality for resolving fixed versions of dependencies.
"""
import logging
from dataclasses import dataclass
from typing import Dict, Iterator, List, cast
from packaging.version import Version
from pip_audit._service import (
Dependency,
Reso... |
common/__init__.py | apple/ml-cvnets | 209 | 11194764 | <reponame>apple/ml-cvnets<filename>common/__init__.py<gh_stars>100-1000
#
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
SUPPORTED_IMAGE_EXTNS = [".png", ".jpg", ".jpeg"] # Add image formats here
SUPPORTED_MODALITIES = ["image", "video"]
SUPPORTED_VIDEO_CLIP_VOTI... |
varnish/tests/common.py | mchelen-gov/integrations-core | 663 | 11194771 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
# This is a small extract of metrics from varnish. This is meant to test that
# the check gather metrics. This the check return everything from varnish
# without any selection/rename, their is ... |
exercises/en/solution_02_06.py | Jette16/spacy-course | 2,085 | 11194785 | <filename>exercises/en/solution_02_06.py
from spacy.lang.en import English
nlp = English()
# Import the Doc and Span classes
from spacy.tokens import Doc, Span
words = ["I", "like", "David", "Bowie"]
spaces = [True, True, True, False]
# Create a doc from the words and spaces
doc = Doc(nlp.vocab, words=words, spaces... |
samsungctl/__main__.py | p3g4asus/samsungctl | 135 | 11194793 | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import collections
import json
import logging
import os
import socket
import sys
try:
from . import __doc__ as doc
from . import __title__ as title
from . import __version__ as version
from . import exceptions
from . imp... |
pypy/interpreter/test/test_pycode.py | nanjekyejoannah/pypy | 333 | 11194796 | <reponame>nanjekyejoannah/pypy
from pypy.interpreter.pycode import _code_const_eq
def test_strong_const_equal(space):
# test that the stronger equal that code objects are supposed to use for
# consts works
s = 'Python'
values = [
space.newint(1),
space.newfloat(0.0),
space.newfl... |
hubconf.py | ijonglin/IBN-Net | 744 | 11194797 | dependencies = ['torch']
from ibnnet import resnet18_ibn_a, resnet34_ibn_a, resnet50_ibn_a, resnet101_ibn_a, \
resnet18_ibn_b, resnet34_ibn_b, resnet50_ibn_b, resnet101_ibn_b, \
resnext101_ibn_a, se_resnet101_ibn_a
|
modules/dnn/feathernet/data/fileList.py | zongwave/libxcam | 400 | 11194800 |
# coding: utf-8
# # Use CASIA-SURF training dataset and our private dataset for training
# In[1]:
from pathlib import Path #从pathlib中导入Path
import os
# data_dir = os.getcwd() + '/our_filelist'
# txt_dir=[i for i in list(Path(data_dir).glob("**/2*.txt")) ]#
# Use CASIA-SURF traing data and our private data
# str... |
ufora/core/math/Color.py | ufora/ufora | 571 | 11194851 | <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/LICENSE-2.0
#
# Unless required by applicable... |
sdk/python/lib/pulumi/automation/_server.py | pcen/pulumi | 12,004 | 11194858 | <reponame>pcen/pulumi<filename>sdk/python/lib/pulumi/automation/_server.py<gh_stars>1000+
# Copyright 2016-2021, Pulumi 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
#
# ht... |
project/tests/test_view_sql_detail.py | eduzen/django-silk | 2,027 | 11194878 | <gh_stars>1000+
import random
from django.conf import settings
from django.test import TestCase
from silk.config import SilkyConfig
from silk.middleware import silky_reverse
from silk.views.sql_detail import SQLDetailView
from .test_lib.mock_suite import MockSuite
class TestViewSQLDetail(TestCase):
@classmetho... |
common/src/stack/command/stack/commands/add/host/storage/partition/__init__.py | anooprajendra/stacki | 123 | 11194887 | <gh_stars>100-1000
# @copyright@
# Copyright (c) 2006 - 2019 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
import stack.commands
from stack.exception import ArgRequired
class Command(stack.commands.add.host.command):
"""
Add a s... |
Server/models/live.py | qinXpeng/weapp-zhihulive | 381 | 11194907 | # coding=utf-8
from datetime import date, timedelta
from elasticsearch_dsl import (
DocType, Date, Integer, Text, Float, Boolean, Keyword, SF, Q, A,
Completion, Long)
from elasticsearch_dsl.connections import connections
from elasticsearch_dsl.analysis import CustomAnalyzer
from config import SEARCH_FIELDS, L... |
samples/wmi/create_process.py | IMULMUL/PythonForWindows | 479 | 11194920 | import time
import windows
wmispace = windows.system.wmi["root\\cimv2"]
print("WMI namespace is <{0}>".format(wmispace))
proc_class = wmispace.get_object("Win32_process")
print("Process class is {0}".format(proc_class))
inparam_cls = proc_class.get_method("Create").inparam
print("Method Create InParams is <{0}>".for... |
rastervision_pytorch_backend/rastervision/pytorch_backend/examples/utils.py | theoway/raster-vision | 1,577 | 11194945 | from typing import List, Optional
import csv
from io import StringIO
import os
from pathlib import Path
from tempfile import TemporaryDirectory
import rasterio
from shapely.strtree import STRtree
from shapely.geometry import shape, mapping
from shapely.ops import transform
from rastervision.core import Box
from raste... |
numba/roc/tests/hsapy/test_reduction.py | mawanda-jun/numba | 1,738 | 11194954 | from __future__ import print_function, absolute_import, division
import numpy as np
from numba import unittest_support as unittest
from numba import roc, intp
WAVESIZE = 64
@roc.jit(device=True)
def wave_reduce(val):
tid = roc.get_local_id(0)
laneid = tid % WAVESIZE
width = WAVESIZE // 2
while widt... |
caffe2/python/operator_test/normalize_op_test.py | KevinKecc/caffe2 | 585 | 11194965 | # Copyright (c) 2016-present, Facebook, 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... |
django/utils/http.py | KaushikSathvara/django | 61,676 | 11194969 | <filename>django/utils/http.py
import base64
import datetime
import re
import unicodedata
from binascii import Error as BinasciiError
from email.utils import formatdate
from urllib.parse import (
ParseResult, SplitResult, _coerce_args, _splitnetloc, _splitparams,
scheme_chars, urlencode as original_urlencode, u... |
Filters/Programmable/Testing/Python/MultidimensionalSolution.py | forestGzh/VTK | 1,755 | 11194986 | <filename>Filters/Programmable/Testing/Python/MultidimensionalSolution.py
#!/usr/bin/env python
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
#
# The dataset read by this exercise ("combVectors.vtk") has field data
# associated with the pointdata, namely two vector fields. In thi... |
mindsdb/integrations/mariadb_handler/mariadb_handler.py | mindsdb/main | 261 | 11194991 | from mindsdb.integrations.mysql_handler.mysql_handler import MySQLHandler
class MariaDBHandler(MySQLHandler):
"""
This handler handles connection and execution of the MariaDB statements.
"""
def __init__(self, name, **kwargs):
super().__init__(name, **kwargs) |
testFetch.py | icarito/guy | 194 | 11195005 | #!/usr/bin/env python3
# # -*- coding: utf-8 -*-
import guy
# call a http service during an async rpc method call
class Fetch(guy.Guy): # name the class as the web/<class_name>.html
size=guy.FULLSCREEN
__doc__="""
<style>
body,html,center {width:100%;height:100%;margin:0px;padding:0px;cursor:pointer;backgr... |
RecoBTag/SecondaryVertex/python/negativeCombinedSecondaryVertexV2Computer_cfi.py | ckamtsikis/cmssw | 852 | 11195009 | <filename>RecoBTag/SecondaryVertex/python/negativeCombinedSecondaryVertexV2Computer_cfi.py<gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
from RecoBTag.SecondaryVertex.combinedSecondaryVertexV2Computer_cfi import *
negativeCombinedSecondaryVertexV2Computer = combinedSecondaryVertexV2Computer.clone(
ve... |
upload.py | swils/verifast | 272 | 11195049 | <gh_stars>100-1000
import sys
import os
import json
from google.oauth2 import service_account
from google.cloud import storage
credentials = service_account.Credentials.from_service_account_info(json.loads(os.environ['GOOGLE_CLOUD_PLATFORM_CREDENTIALS']))
storageClient = storage.Client(credentials.project_id, credent... |
great_expectations/core/usage_statistics/anonymizers/data_docs_site_anonymizer.py | vanderGoes/great_expectations | 6,451 | 11195053 | from great_expectations.core.usage_statistics.anonymizers.anonymizer import Anonymizer
from great_expectations.core.usage_statistics.anonymizers.site_builder_anonymizer import (
SiteBuilderAnonymizer,
)
from great_expectations.core.usage_statistics.anonymizers.store_backend_anonymizer import (
StoreBackendAnony... |
Lib/test/test_multiprocessing_forkserver.py | shawwn/cpython | 52,316 | 11195061 | import unittest
import test._test_multiprocessing
import sys
from test import support
if support.PGO:
raise unittest.SkipTest("test is not helpful for PGO")
if sys.platform == "win32":
raise unittest.SkipTest("forkserver is not available on Windows")
test._test_multiprocessing.install_tests_in_module_dict(g... |
Geometry/HGCalGeometry/test/python/testHGCalWaferInFileTestV15_cfg.py | Purva-Chaudhari/cmssw | 852 | 11195063 | import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
process = cms.Process("PROD",Phase2C11)
process.load("SimGeneral.HepPDTESSource.pdt_cfi")
process.load("Geometry.HGCalCommonData.testHGCalV15XML_cfi")
process.load("Geometry.HGCalCommonData.hgcalV15ParametersInitializat... |
sfepy/discrete/variables.py | BubuLK/sfepy | 510 | 11195067 | """
Classes of variables for equations/terms.
"""
from __future__ import print_function
from __future__ import absolute_import
from collections import deque
import numpy as nm
from sfepy.base.base import (real_types, complex_types, assert_, get_default,
output, OneTypeList, Container, Str... |
hypernets/conf/_configuration.py | Enpen/Hypernets | 1,080 | 11195071 | <reponame>Enpen/Hypernets
import glob
import os
import sys
from traitlets import Unicode
from traitlets.config import Application, Configurable
class Configuration(Application):
config_dir = Unicode('./conf',
help='The file system directory which contains all configuration files'
... |
fewshots/data/utils.py | bertinetto/r2d2 | 111 | 11195075 | <gh_stars>100-1000
from PIL import Image
import torch
import numpy as np
from torchvision import transforms
normalize_mini_t = transforms.Normalize(mean=[x / 255.0 for x in [120.39586422, 115.59361427, 104.54012653]],
std=[x / 255.0 for x in [70.68188272, 68.27635443, 72.5450552... |
venv/Lib/site-packages/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/module.py | ajayiagbebaku/NFL-Model | 695 | 11195083 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, <NAME>
# 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 retai... |
src/zvt/factors/ma/domain/__init__.py | vishalbelsare/zvt | 2,032 | 11195093 | <reponame>vishalbelsare/zvt
# -*- coding: utf-8 -*-
# the __all__ is generated
__all__ = []
# __init__.py structure:
# common code of the package
# export interface in __all__ which contains __all__ of its sub modules
# import all from submodule stock_1d_ma_stats_factor
from .stock_1d_ma_stats_factor import *
from .s... |
LeetCode/0072_Edit_Distance.py | Achyut-sudo/PythonAlgorithms | 144 | 11195109 | <reponame>Achyut-sudo/PythonAlgorithms
class Solution:
# @return an integer
def minDistance(self, word1, word2):
m=len(word1)
n=len(word2)
dp=[[0 for i in range(n+1)] for j in range(m+1)]
for i in range(m+1):
dp[i][0]=i
for j in range(n+1):
dp[0][j... |
tests/test_word_vector.py | Gorlph/pythainlp | 569 | 11195124 | # -*- coding: utf-8 -*-
import unittest
from pythainlp import word_vector
from pythainlp.word_vector import WordVector
class TestWordVectorPackage(unittest.TestCase):
def test_thai2vec(self):
self.assertGreaterEqual(word_vector.similarity("แบคทีเรีย", "คน"), 0)
self.assertIsNotNone(word_vector.s... |
linmdtw/_version.py | lvlanson/linmdtw | 180 | 11195140 | __version__ = "0.1.6"
|
Methodology/C_CreateDatabase/moneymarkets_creator.py | MobileAir/FinanceDatabase | 1,014 | 11195151 | import json
import os
from tqdm import tqdm
def fill_data_points_moneymarkets(data_symbol, options=None):
if options is None:
options = {}
try:
options['short_name'] = data_symbol['quoteType']['shortName']
except (TypeError, KeyError):
options['short_name'] = None
t... |
common/vision/datasets/keypoint_detection/freihand.py | billzhonggz/Transfer-Learning-Library | 1,474 | 11195175 | """
@author: <NAME>
@contact: <EMAIL>
"""
import json
import time
import torch
import os
import os.path as osp
from torchvision.datasets.utils import download_and_extract_archive
from ...transforms.keypoint_detection import *
from .keypoint_dataset import Hand21KeypointDataset
from .util import *
""" General util fu... |
var/spack/repos/builtin/packages/r-nada/package.py | LiamBindle/spack | 2,360 | 11195178 | # 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 RNada(RPackage):
"""Nondetects and Data Analysis for Environmental Data
Contains meth... |
torchnet/logger/visdomlogger.py | HarshTrivedi/tnt | 1,463 | 11195179 | """ Logging to Visdom server """
import numpy as np
import visdom
from .logger import Logger
class BaseVisdomLogger(Logger):
'''
The base class for logging output to Visdom.
***THIS CLASS IS ABSTRACT AND MUST BE SUBCLASSED***
Note that the Visdom server is designed to also handle a serv... |
mmf/trainers/mmf_trainer.py | sisilmehta2000/mmf | 3,252 | 11195200 | <filename>mmf/trainers/mmf_trainer.py
# Copyright (c) Facebook, Inc. and its affiliates.
import logging
import warnings
import omegaconf
import torch
from mmf.common.registry import registry
from mmf.datasets.multi_datamodule import MultiDataModule
from mmf.modules.metrics import Metrics
from mmf.trainers.base_trainer... |
homeassistant/components/steamist/coordinator.py | MrDelik/core | 30,023 | 11195207 | """DataUpdateCoordinator for steamist."""
from __future__ import annotations
from datetime import timedelta
import logging
from aiosteamist import Steamist, SteamistStatus
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
_LOGGER = logging.getLog... |
src/out/ICFP18evaluation/evaluationCNN/TensorFlow/TensorFlow.py | faradaym/Lantern | 158 | 11195218 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
jni-build/jni/include/tensorflow/python/kernel_tests/random_gamma_test.py | rcelebi/android-elfali | 680 | 11195234 | <filename>jni-build/jni/include/tensorflow/python/kernel_tests/random_gamma_test.py
# 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 ... |
ipypublish/frontend/shared.py | parmentelat/ipypublish | 220 | 11195235 | <filename>ipypublish/frontend/shared.py
import sys
import os
import argparse
import fnmatch
from ipypublish import __version__
from ipypublish.convert.config_manager import iter_all_export_infos
class CustomFormatter(
argparse.ArgumentDefaultsHelpFormatter, argparse.RawDescriptionHelpFormatter
):
pass
clas... |
doc/TRexDataAnalysis.py | timgates42/trex-core | 956 | 11195241 | #!/scratch/Anaconda2.4.0/bin/python
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
from matplotlib import dates as matdates
from matplotlib import lines as matlines
import os
import time
from datetime import datetime
"""
This Module is structured to... |
nuplan/planning/training/callbacks/utils/test/test_scenario_scoring_callback.py | motional/nuplan-devkit | 128 | 11195257 | <gh_stars>100-1000
import json
import pathlib
import tempfile
import unittest
from typing import Tuple
from unittest.mock import Mock
import torch
from nuplan.common.actor_state.state_representation import StateSE2
from nuplan.planning.scenario_builder.abstract_scenario import AbstractScenario
from nuplan.planning.sc... |
ffsubsync/__init__.py | Lucas-C/ffsubsync | 4,533 | 11195267 | # -*- coding: utf-8 -*-
import logging
import sys
try:
from rich.console import Console
from rich.logging import RichHandler
# configure logging here because some other later imported library does it first otherwise
# TODO: use a fileconfig
logging.basicConfig(
level=logging.INFO,
... |
tests/base/test_tensor_omf.py | ckohnke/discretize | 123 | 11195284 | <gh_stars>100-1000
import numpy as np
import unittest
import discretize
try:
import omf
except ImportError:
has_omf = False
else:
has_omf = True
if has_omf:
from discretize.mixins.omf_mod import unravel_data_array, ravel_data_array
class TestTensorMeshOMF(unittest.TestCase):
def setUp(se... |
tests/test_page.py | cobolbaby/python-seo-analyzer | 743 | 11195293 | <gh_stars>100-1000
from seoanalyzer import page
def test_page_init():
p = page.Page(url='https://www.sethserver.com/sitemap.xml', base_domain='https://www.sethserver.com/')
assert p.base_domain.scheme == 'https'
assert p.base_domain.netloc == 'www.sethserver.com'
assert p.base_domain.path == '/'
... |
mlcomp/db/models/computer.py | megachester/mlcomp | 166 | 11195316 | <filename>mlcomp/db/models/computer.py
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from mlcomp.db.models.base import Base
from mlcomp.utils.misc import now
class Computer(Base):
__tablename__ = 'computer'
name = sa.Column(sa.String, primary_key=True)
gpu = sa.Column(sa.Integer, default=0)
... |
plasmapy/utils/exceptions.py | seanjunheng2/PlasmaPy | 429 | 11195334 | """Exceptions and warnings specific to PlasmaPy."""
__all__ = [
"PlasmaPyError",
"PhysicsError",
"InvalidRomanNumeralError",
"OutOfRangeError",
"RelativityError",
"RomanError",
"PlasmaPyWarning",
"CouplingWarning",
"PhysicsWarning",
"PlasmaPyDeprecationWarning",
"PlasmaPyFut... |
process_latex.py | PhysicsTeacher13/latex-to-sym-py | 339 | 11195358 | <reponame>PhysicsTeacher13/latex-to-sym-py<gh_stars>100-1000
import sympy
import antlr4
from antlr4.error.ErrorListener import ErrorListener
from gen.PSParser import PSParser
from gen.PSLexer import PSLexer
from gen.PSListener import PSListener
from sympy.printing.str import StrPrinter
def process_sympy(sympy):
... |
program_synthesis/karel/arguments.py | kavigupta/program_synthesis | 123 | 11195388 | <filename>program_synthesis/karel/arguments.py
import torch
import argparse
import time
def get_arg_parser(title, mode):
parser = argparse.ArgumentParser(description=title)
parser.add_argument('--no-cuda', action='store_true', default=False)
parser.add_argument('--verbose', action='store_true', default=F... |
conan/tools/cmake/cmakedeps/templates/target_data.py | fanStefan/conan | 6,205 | 11195389 | <reponame>fanStefan/conan<filename>conan/tools/cmake/cmakedeps/templates/target_data.py
import os
import textwrap
from conan.tools.cmake.cmakedeps.templates import CMakeDepsFileTemplate
from conan.tools.cmake.utils import get_file_name
"""
foo-release-x86_64-data.cmake
"""
class ConfigDataTemplate(CMakeDepsFileTe... |
py2.5/examples/ex_synchronize.py | geofft/multiprocess | 356 | 11195401 | #
# A test file for the `processing` package
#
import time, sys, random
from Queue import Empty
import processing # may get overwritten
#### TEST_VALUE
def value_func(running, mutex):
random.seed()
time.sleep(random.random()*4)
mutex.acquire()
print '\n\t\t\t' + ... |
maigret/submit.py | noi4eg/maigret | 1,156 | 11195415 | import asyncio
import json
import re
from typing import List
import xml.etree.ElementTree as ET
import requests
from .activation import import_aiohttp_cookies
from .checking import maigret
from .result import QueryStatus
from .settings import Settings
from .sites import MaigretDatabase, MaigretSite, MaigretEngine
from... |
example_backend.py | scottmberry/mule-uploader | 131 | 11195424 | from flask import Flask, request, render_template
from sqlalchemy import create_engine, Column, Integer
from sqlalchemy import String, DateTime, Text, MetaData
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from werkzeug import SharedDataMiddleware
from h... |
tools/mo/unit_tests/mo/front/HSwish_fusing_test.py | ryanloney/openvino-1 | 1,127 | 11195431 | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
from openvino.tools.mo.front.HSwish_fusion import HSwishWithClamp, HSwishWithMinMax
from openvino.tools.mo.front.common.partial_infer.utils import float_array
from openvino.tools.mo.utils.ir_engine.compare_graphs import ... |
tslearn/tests/test_svm.py | andriyor/tslearn | 1,151 | 11195436 | import numpy as np
from tslearn.metrics import cdist_gak
from tslearn.svm import TimeSeriesSVC, TimeSeriesSVR
__author__ = '<NAME> <EMAIL>[<EMAIL>'
def test_gamma_value_svm():
n, sz, d = 5, 10, 3
rng = np.random.RandomState(0)
time_series = rng.randn(n, sz, d)
labels = rng.randint(low=0, high=2, siz... |
cms/test_utils/project/pluginapp/plugins/multicolumn/models.py | Mario-Kart-Felix/django-cms | 5,659 | 11195455 | <filename>cms/test_utils/project/pluginapp/plugins/multicolumn/models.py
from cms.models import CMSPlugin
class MultiColumns(CMSPlugin):
"""
A plugin that has sub Column classes
"""
def __str__(self):
plugins = self.child_plugin_instances or []
return "{} columns".format(len(plugins))... |
code/model_part_pc.py | jeonghyunkeem/structurenet | 212 | 11195466 | <filename>code/model_part_pc.py
"""
This file defines part point cloud VAE/AE model.
"""
import torch
import torch.nn as nn
from chamfer_distance import ChamferDistance
from collections import namedtuple
class PartFeatSampler(nn.Module):
def __init__(self, feature_size, probabilistic=True):
super(Pa... |
networks/SPyNet/PYTHON_Flow2Color/computeColor.py | donegaci/memc-net | 145 | 11195475 | <reponame>donegaci/memc-net
import sys
import os
import time
import random
import subprocess as sp
# import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy.misc import imread, imsave, imshow, imresize, imsave
from skimage import color
def makeColorwheel():
RY = 15
YG = 6
GC = 4
CB ... |
venv/Lib/site-packages/jedi/inference/references.py | ajayiagbebaku/NFL-Model | 1,318 | 11195486 | <filename>venv/Lib/site-packages/jedi/inference/references.py
import os
import re
from parso import python_bytes_to_unicode
from jedi.debug import dbg
from jedi.file_io import KnownContentFileIO
from jedi.inference.names import SubModuleName
from jedi.inference.imports import load_module_from_path
from jedi.inference... |
env/lib/python3.8/site-packages/faker/providers/ssn/en_CA/__init__.py | avdhari/enigma | 258 | 11195496 | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as SsnProvider
def checksum(sin):
"""
Determine validity of a Canadian Social Insurance Number.
Validation is performed using a modified Luhn Algorithm. To check
the Every second digit of the SIN is doubled and the result ... |
academicstoday_project/registration/tests.py | LeeDoona/EasyGrading | 146 | 11195550 | <filename>academicstoday_project/registration/tests.py<gh_stars>100-1000
from django.core.urlresolvers import resolve
from django.http import HttpRequest
from django.http import QueryDict
from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
from django.contrib.auth... |
i3pystatus/core/io.py | fkusei/i3pystatus | 413 | 11195554 | import json
import signal
import sys
from contextlib import contextmanager
from threading import Condition
from threading import Thread
from i3pystatus.core.modules import IntervalModule
class IOHandler:
def __init__(self, inp=sys.stdin, out=sys.stdout):
self.inp = inp
self.out = out
def wri... |
auto_derby/single_mode/race/__init__.py | DoctrineAlanK/auto-derby | 235 | 11195555 | import logging
from .game_data import (
find,
find_by_date,
find_by_race_detail_image,
find_by_race_menu_image,
reload,
reload_on_demand,
)
from .globals import g
from .race import Race
from .race_result import RaceResult
# Deprecated: remove at next major version
LOGGER = logging.getLogger(__... |
uC/AVR/stuff/FreeRTOSv202107.00/FreeRTOS/Test/litani/lib/litani.py | 4lc0n/PinToWin | 369 | 11195564 | <gh_stars>100-1000
# Copyright Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or i... |
utils/build_swift/tests/build_swift/test_migration.py | gandhi56/swift | 72,551 | 11195573 | <filename>utils/build_swift/tests/build_swift/test_migration.py
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 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 inf... |
docs/autodoc/type_comment.py | ishine/cotk | 117 | 11195611 | <filename>docs/autodoc/type_comment.py
"""
autodoc.type_comment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update annotations info of living objects using type_comments.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import ast
from inspect impor... |
pyprob/nn/inference_network.py | probprog/pyprob | 268 | 11195630 | import torch
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import torch.distributed as dist
from torch.utils.data import DataLoader
import sys
import time
import os
import shutil
import uuid
import tempfile
import tarfile
import copy
import math
from threading import ... |
tests/single_file_test.py | tailhook/swindon | 104 | 11195641 | import os.path
def data_check(data, method, expected):
if method == "HEAD":
assert data == b''
else:
assert data == expected
async def test_ok(swindon, get_request, static_request_method,
debug_routing, TESTS_DIR):
resp, data = await get_request(swindon.url / 'static-file')
a... |
examples/shap/binary_classification.py | PeterSulcs/mlflow | 10,351 | 11195659 | <gh_stars>1000+
import os
import numpy as np
from sklearn.datasets import load_breast_cancer
from sklearn.ensemble import RandomForestClassifier
import shap
import mlflow
from utils import to_pandas_Xy
# prepare training data
X, y = to_pandas_Xy(load_breast_cancer())
X = X.iloc[:50, :8]
y = y.iloc[:50]
# train a m... |
01_basics/01_building_expressions/03_tensor.py | johny-c/theano_exercises | 711 | 11195686 | # Fill in the TODOs in this exercise, then run
# python 03_tensor.py to see if your solution works!
import numpy as np
from theano import function
raise NotImplementedError("TODO: add any other imports you need")
def make_tensor(dim):
"""
Returns a new Theano tensor with no broadcastable dimensions.
dim: t... |
test_scripts/dependency-test/t1.py | clayne/ida-qscripts | 131 | 11195693 | <reponame>clayne/ida-qscripts
import sys
subdir = os.path.join(os.path.dirname(__file__), 'subdir')
if subdir not in sys.path:
print("-->adding to path: %s" % subdir)
sys.path.append(subdir)
import datetime
import t2, t3, t4, t5
print("--- %s; this is %s.." % (datetime.datetime.now(), __file__))
... |
python/ql/test/library-tests/frameworks/sqlalchemy/new_tests.py | angie1148/codeql | 643 | 11195695 | import sqlalchemy
import sqlalchemy.orm
# SQLAlchemy is slowly migrating to a 2.0 version, and as part of 1.4 release have a 2.0
# style (forwards compatible) API that _can_ be adopted. So these tests are marked with
# either v1.4 or v2.0, such that we cover both.
raw_sql = "select 'FOO'"
text_sql = sqlalchemy.text(r... |
tempest/api/object_storage/test_container_sync.py | cityofships/tempest | 254 | 11195708 | <reponame>cityofships/tempest
# Copyright 2012 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/... |
posthog/tasks/email.py | csmatar/posthog | 7,409 | 11195724 | import datetime
import logging
from typing import Optional
from posthog.celery import app
from posthog.email import EmailMessage, is_email_available
from posthog.models import Event, Organization, OrganizationInvite, PersonDistinctId, Team, User, organization
from posthog.templatetags.posthog_filters import compact_nu... |
client/conversation.py | kelvinhammond/jasper-client | 3,771 | 11195735 | <reponame>kelvinhammond/jasper-client<filename>client/conversation.py<gh_stars>1000+
# -*- coding: utf-8-*-
import logging
from notifier import Notifier
from brain import Brain
class Conversation(object):
def __init__(self, persona, mic, profile):
self._logger = logging.getLogger(__name__)
self.p... |
runtests.py | stefanor/pystemmer | 192 | 11195746 | #!/usr/bin/env python
import doctest
import sys
py3k = sys.version_info >= (3, 0)
if py3k:
num_failures, num_tests = doctest.testfile('docs/quickstart_python3.txt')
else:
num_failures, num_tests = doctest.testfile('docs/quickstart.txt')
if num_failures > 0:
print("%d failures out of %d tests" % (num_fai... |
code/extras/graph_representations.py | vamships/RelationPrediction | 376 | 11195748 | import numpy as np
from scipy.sparse import coo_matrix
import math
import tensorflow as tf
from model import Model
class MessageGraph():
sender_indices = None
receiver_indices = None
message_types = None
def __init__(self, edges, vertex_count, label_count):
self.vertex_count = vertex_count
... |
sentry_sdk/integrations/logging.py | olasd/sentry-python | 553 | 11195749 | from __future__ import absolute_import
import logging
import datetime
from sentry_sdk.hub import Hub
from sentry_sdk.utils import (
to_string,
event_from_exception,
current_stacktrace,
capture_internal_exceptions,
)
from sentry_sdk.integrations import Integration
from sentry_sdk._compat import iterite... |
Src/StdLib/Lib/test/test_sha.py | cwensley/ironpython2 | 2,209 | 11195751 | # Testing sha module (NIST's Secure Hash Algorithm)
# use the three examples from Federal Information Processing Standards
# Publication 180-1, Secure Hash Standard, 1995 April 17
# http://www.itl.nist.gov/div897/pubs/fip180-1.htm
import warnings
warnings.filterwarnings("ignore", "the sha module is deprecated.*",
... |
migrations/versions/166d65e5a7e3_add_aggregatetest_gr.py | vault-the/changes | 443 | 11195760 | """Add AggregateTest{Group,Suite}
Revision ID: 166d65e5a7e3
Revises: 2<PASSWORD>c3b2<PASSWORD>
Create Date: 2013-12-04 13:19:26.702555
"""
# revision identifiers, used by Alembic.
revision = '166d65e5<PASSWORD>'
down_revision = '21b7c3b2ce88'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.cr... |
tests/test_require_user.py | borisgrafx/client | 3,968 | 11195782 | """
require user tests.
"""
import pytest
import wandb
@pytest.fixture
def require_mock(mocker):
cleanup = []
def fn(require, func):
cleanup.append(require)
mocker.patch.object(
wandb.wandb_sdk.wandb_require._Requires,
"require_" + require,
func,
... |
src/express-route-cross-connection/azext_expressroutecrossconnection/vendored_sdks/v2018_04_01/models/verification_ip_flow_parameters_py3.py | Mannan2812/azure-cli-extensions | 207 | 11195789 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
tests/API0/testdateparam.py | mcepl/param | 123 | 11195791 | <reponame>mcepl/param<filename>tests/API0/testdateparam.py
"""
Unit test for Date parameters.
"""
import unittest
import datetime as dt
import param
class TestDateParameters(unittest.TestCase):
def test_initialization_out_of_bounds(self):
try:
class Q(param.Parameterized):
q ... |
tests/integration/test_cmorize_obs.py | ESMValGroup/ESMValTool | 148 | 11195796 | <gh_stars>100-1000
"""Tests for the module :mod:`esmvaltool.cmorizers.obs.cmorize_obs`."""
import contextlib
import os
import sys
import iris
import numpy as np
import yaml
from cf_units import Unit
from esmvaltool.cmorizers.obs.cmorize_obs import main as run
@contextlib.contextmanager
def keep_cwd():
"""
... |
tools/Polygraphy/polygraphy/tools/args/util/util.py | KaliberAI/TensorRT | 5,249 | 11195810 | <filename>tools/Polygraphy/polygraphy/tools/args/util/util.py
#
# Copyright (c) 2021, NVIDIA 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://w... |
plugins/modules/panos_log_forwarding_profile.py | EverOps/pan-os-ansible | 130 | 11195822 | <gh_stars>100-1000
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Palo Alto 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/licen... |
setup.py | melonwater211/snorkel | 2,323 | 11195847 | <filename>setup.py
from typing import Dict
from setuptools import find_packages, setup
# version.py defines the VERSION and VERSION_SHORT variables.
# We use exec here so we don't import snorkel.
VERSION: Dict[str, str] = {}
with open("snorkel/version.py", "r") as version_file:
exec(version_file.read(), VERSION)
... |
lib_pypy/_cffi_ssl/_cffi_src/openssl/nid.py | nanjekyejoannah/pypy | 333 | 11195857 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/obj_mac.h>
"""
TYPES = """
static const... |
dags/utils.py | Akash-Dutta/DataEngineering | 190 | 11195858 | <filename>dags/utils.py
import os
from airflow.hooks.S3_hook import S3Hook
from airflow.hooks.postgres_hook import PostgresHook
import psycopg2
def _local_to_s3(
bucket_name: str, key: str, file_name: str, remove_local: bool = False
) -> None:
s3 = S3Hook()
s3.load_file(filename=file_name, bucket_name=bu... |
tests/foundations/environments/test_plan.py | IuryAlves/cloud-foundation-fabric | 203 | 11195876 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
tkinter/__frame__/replace-frame-with-content/main-v2-lambda.py | whitmans-max/python-examples | 140 | 11195884 | <gh_stars>100-1000
# date: 2019.05.04
# author: Bartłomiej 'furas' Burek
import tkinter as tk
# --- functions ---
def change_frame(new_frame):
global current
# hide current tk.Frame
current.pack_forget()
# show new tk.Frame
current = new_frame
current.pack()
# --- main ---
root = tk.Tk()... |
release/stubs.min/Autodesk/Revit/DB/__init___parts/SpatialElementGeometryResults.py | htlcnn/ironpython-stubs | 182 | 11195887 | class SpatialElementGeometryResults(object,IDisposable):
""" The results of spatial element geometry calculation. """
def Dispose(self):
""" Dispose(self: SpatialElementGeometryResults) """
pass
def GetBoundaryFaceInfo(self,face):
"""
GetBoundaryFaceInfo(self: SpatialElementGeometryResults,face: Face)... |
anuga/caching/caching.py | samcom12/anuga_core | 136 | 11195892 | # =============================================================================
# caching.py - Supervised caching of function results.
# Copyright (C) 1999, 2000, 2001, 2002 <NAME>
# Australian National University (1999-2003)
# Geoscience Australia (2003-present)
#
# This program is free software; you can redistribu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.