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 |
|---|---|---|---|---|---|---|---|---|---|---|
Face Reconstruction/Self-Supervised Monocular 3D Face Reconstruction by Occlusion-Aware Multi-view Geometry Consistency/src_common/geometry/gpmm/HDF5IO.py | swapnilgarg7/Face-X | 302 | 162313 | #!/usr/bin/env python
from __future__ import annotations
import h5py
import numpy as np
class HDF5IO:
def __init__(self, path_file, handler_file: object | None = None, mode: str='a'):
if(handler_file == None):
self.handler_file = h5py.File(path_file, mode=mode)
else:
self.h... | 2 | 2 | 0 | 0 | 4 | 0 |
HLTriggerOffline/SUSYBSM/python/SUSYBSM_DiJet_MET_cff.py | ckamtsikis/cmssw | 852 | 162346 | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
SUSY_HLT_DiJet_MET = DQMEDAnalyzer('SUSY_HLT_DiJet_MET',
trigSummary = cms.InputTag("hltTriggerSummaryAOD",'', 'HLT'),
pfMETCollection = cms.InputTag("pfMet"... | 0 | 0 | 0 | 0 | 0 | 0 |
libweasyl/libweasyl/alembic/versions/8c2635571571_allow_index_to_be_used_for_comment_.py | akash143143/weasyl | 111 | 162363 | <filename>libweasyl/libweasyl/alembic/versions/8c2635571571_allow_index_to_be_used_for_comment_.py<gh_stars>100-1000
"""Allow index to be used for comment sorting
Revision ID: 8c2635571571
Revises: <KEY>
Create Date: 2018-10-21 17:47:05.349531
"""
# revision identifiers, used by Alembic.
revision = '8c2635571571'
do... | 0 | 0 | 0 | 0 | 0 | 0 |
covidprognosis/data/__init__.py | olopade-lab/CovidPrognosis | 151 | 162366 | <reponame>olopade-lab/CovidPrognosis
from .base_dataset import BaseDataset
from .chexpert import CheXpertDataset
from .combined_datasets import CombinedXrayDataset
from .mimic_cxr import MimicCxrJpgDataset
from .nih_chest_xrays import NIHChestDataset
| 0 | 0 | 0 | 0 | 0 | 0 |
bsuite/bsuite/tests/sweep_test.py | hbutsuak95/iv_rl | 1,337 | 162370 | # python3
# pylint: disable=g-bad-file-header
# Copyright 2019 DeepMind Technologies Limited. 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... | 0 | 0 | 0 | 0 | 0 | 0 |
example/svrg_module/api_usage_example/example_api_train.py | Vikas-kum/incubator-mxnet | 228 | 162380 | # 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 u... | 0 | 1 | 0 | 0 | 1 | 0 |
history/views.py | ccf/pytrader | 2,110 | 162386 | <filename>history/views.py
from django.contrib.admin.views.decorators import staff_member_required
from history.models import (
PredictionTest, Price, Trade, Balance, TradeRecommendation, get_time, PerformanceComp,
ClassifierTest)
from django.shortcuts import render_to_response
from django.utils import timezone... | 0 | 0 | 0 | 0 | 0 | 0 |
nodes/1.x/python/Family.HasRoomCalculationPoint.py | jdehotin/Clockworkfordynamo | 147 | 162411 | <reponame>jdehotin/Clockworkfordynamo
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
fams = UnwrapElement(IN[0])
booleans = list()
for fam in fams:
if fam.GetType().ToString() == "Autodesk.Revit.DB.Family":
booleans.append(fam.get_Parameter(BuiltInParameter.ROOM_CALCULATION_POINT).AsInteger... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_query_tables.py | admariner/wikipedia_ql | 334 | 162419 | <gh_stars>100-1000
import re
import pytest
from wikipedia_ql.fragment import Fragment
from wikipedia_ql.selectors import text, section, css, alt, page, attr, table_data
def make_fragment(html, **kwargs):
# Because fragment is Wikipedia-oriented and always looks for this div :shrug:
return Fragment.parse(f'<d... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | techthiyanes/clip-retrieval | 201 | 162434 | from setuptools import setup, find_packages
from pathlib import Path
import os
if __name__ == "__main__":
with Path(Path(__file__).parent, "README.md").open(encoding="utf-8") as file:
long_description = file.read()
import os
def package_files(directory) -> object:
paths = []
for (... | 0 | 1 | 0 | 0 | 1 | 0 |
promgen/tests/test_host_add.py | kackey0-1/promgen | 913 | 162442 | <gh_stars>100-1000
# Copyright (c) 2017 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
from promgen import models
from promgen.tests import PromgenTest
from django.urls import reverse
class RouteTests(PromgenTest):
longMessage = True
def setUp(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
extra_tests/cffi_tests/conftest.py | ctrl-shift-make/pypy | 381 | 162519 | <reponame>ctrl-shift-make/pypy
import sys
def pytest_ignore_collect(path):
if '__pypy__' not in sys.builtin_module_names:
return True
| 0 | 0 | 0 | 0 | 0 | 0 |
src/api/python/pxapi/errors.py | hangqiu/pixie | 1,821 | 162530 | # Copyright 2018- The Pixie 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 w... | 10 | 3 | 0 | 0 | 13 | 0 |
opps/contrib/multisite/models.py | jeanmask/opps | 159 | 162537 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from opps.core.permissions.models import Permission
class SitePermission(Permission):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
torcms/script/script_sitemap.py | bukun/TorCMS | 243 | 162578 | # -*- coding: utf-8 -*-
'''
Generating sitemap.
'''
import os
from config import SITE_CFG, router_post
from torcms.model.post_model import MPost
from torcms.model.wiki_model import MWiki
def gen_post_map(file_name, ext_url: str=''):
'''
Generate the urls for posts.
:return: None
'''
with open(fil... | 2 | 0 | 0 | 0 | 2 | 0 |
qiskit/opflow/evolutions/trotterizations/qdrift.py | Roshan-Thomas/qiskit-terra | 1,456 | 162595 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# 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 derivat... | 2 | 2 | 1 | 0 | 5 | 0 |
scipy/stats/kde.py | lorentzenchr/scipy | 9,095 | 162598 | # This file is not meant for public use and will be removed in SciPy v2.0.0.
# Use the `scipy.stats` namespace for importing the functions
# included below.
import warnings
from . import _kde
__all__ = [ # noqa: F822
'gaussian_kde', 'linalg', 'logsumexp', 'check_random_state',
'atleast_2d', 'reshape', 'newa... | 0 | 2 | 0 | 0 | 2 | 0 |
osp/test/citations/jobs/test_text_to_docs.py | davidmcclure/open-syllabus-project | 220 | 162612 |
import pytest
from osp.corpus.models import Document_Index
from osp.citations.jobs import text_to_docs
from osp.citations.models import Citation
from osp.citations.utils import tokenize_field
from peewee import fn
pytestmark = pytest.mark.usefixtures('db', 'es')
def test_matches(add_doc, add_text):
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
testData/mock/pydanticv18/types.py | alek-sun/pydantic-pycharm-plugin | 238 | 162621 |
def conlist(item_type, *, min_items = None, max_items = None) Type[List[T]]:
pass
def constr(
*,
strip_whitespace: bool = False,
to_lower: bool = False,
strict: bool = False,
min_length: int = None,
max_length: int = None,
curtail_length: int = None,
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_api_properties.py | YuanyuanNi/azure-cli | 3,287 | 162635 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/components/fjaraskupan/conftest.py | MrDelik/core | 30,023 | 162652 | <gh_stars>1000+
"""Standard fixtures for the Fjäråskupan integration."""
from __future__ import annotations
from unittest.mock import patch
from bleak.backends.device import BLEDevice
from bleak.backends.scanner import AdvertisementData, BaseBleakScanner
from pytest import fixture
@fixture(name="scanner", autouse=T... | 0 | 0 | 0 | 0 | 0 | 0 |
testcases/elichika_tests/node/Convolution2D.py | vermashresth/chainer-compiler | 116 | 162655 | # coding: utf-8
import chainer
import chainer.links as L
from chainer import serializers
class A(chainer.Chain):
def __init__(self):
super(A, self).__init__()
with self.init_scope():
# TODO Add more tests
self.l1 = L.Convolution2D(None, 6, (5, 7), stride=(2, 3))
def f... | 0 | 2 | 0 | 0 | 2 | 0 |
golem/execution.py | Sunil-Rathore/golem | 171 | 162660 | <filename>golem/execution.py
""" Stored values specific to a single test execution. """
test_file = None
browser = None
browser_definition = None
browsers = {}
data = None
secrets = None
description = None
settings = None
test_dirname = None
test_path = None
project_name = None
project_path = None
testdir = None
execu... | 0 | 0 | 0 | 0 | 0 | 0 |
100-200q/162.py | rampup01/Leetcode | 990 | 162708 | '''
A peak element is an element that is greater than its neighbors.
Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element and return its index.
The array may contain multiple peaks, in that case return the index to any one of the peaks is fine.
You may imagine that nums[-1] = nums[n] = -∞.
... | 0 | 2 | 0 | 0 | 2 | 0 |
py/moma/base_task_test.py | wx-b/dm_robotics | 128 | 162717 | # Copyright 2020 DeepMind Technologies Limited.
#
# 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 ag... | 1 | 4 | 0 | 2 | 7 | 0 |
tests/test_hopfield_net.py | lantunes/cellpylib | 124 | 162762 | import unittest
import cellpylib as cpl
import numpy as np
import os
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
class TestHopfieldNet(unittest.TestCase):
def test_hopfield_net(self):
np.random.seed(0)
# patterns for training
zero = [
0, 1, 1, 1, 0,
1, ... | 0 | 1 | 0 | 0 | 1 | 0 |
pymagnitude/third_party/allennlp/tests/models/sniff_test.py | tpeng/magnitude | 1,520 | 162795 | # pylint: disable=no-self-use,line-too-long
from __future__ import absolute_import
from __future__ import print_function
from allennlp.common.testing import AllenNlpTestCase
from allennlp.models.archival import load_archive
from allennlp.predictors import Predictor
def demo_model(archive_file , predictor_name ... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/e2e/test_ocr_e2e.py | jingjie181/genalog | 185 | 162845 | <reponame>jingjie181/genalog
import json
import pytest
from genalog.ocr.blob_client import GrokBlobClient
from genalog.ocr.grok import Grok
@pytest.fixture(scope="module", autouse=True)
def load_azure_config(load_azure_resources):
# Loading the non-secrets
# Assume the secrets are set in the environment var... | 0 | 0 | 0 | 0 | 0 | 0 |
generate_config_docs.py | hixio-mh/taskcat | 920 | 162846 | <reponame>hixio-mh/taskcat
# flake8: noqa
import json
if __name__ == "__main__":
schema = json.load(open("./taskcat/cfg/config_schema.json", "r"))
def resolve_ref(props):
if "$ref" in props:
ref = props["$ref"].split("/")[-1]
del props["$ref"]
props.update(schema["... | 0 | 0 | 0 | 0 | 0 | 0 |
observations/r/davis_thin.py | hajime9652/observations | 199 | 162857 | <reponame>hajime9652/observations<filename>observations/r/davis_thin.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/pyb/timer.py | learnforpractice/micropython-cpp | 692 | 162890 | # check basic functionality of the timer class
import pyb
from pyb import Timer
tim = Timer(4)
tim = Timer(4, prescaler=100, period=200)
print(tim.prescaler())
print(tim.period())
tim.prescaler(300)
print(tim.prescaler())
tim.period(400)
print(tim.period())
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/pybaseball/cache/test_cache.py | reddigari/pybaseball | 650 | 162902 | from datetime import datetime, timedelta
from typing import Callable
from unittest.mock import MagicMock, patch
import pandas as pd
import pytest
from _pytest.monkeypatch import MonkeyPatch
from pybaseball import cache
@pytest.fixture(name="mock_data_1")
def _mock_data_1() -> pd.DataFrame:
return pd.DataFrame([1... | 35 | 16 | 0 | 0 | 51 | 0 |
mindspore/ops/_op_impl/_custom_op/dsd_impl.py | Vincent34/mindspore | 3,200 | 162916 | # Copyright 2020 Huawei Technologies Co., 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 applicable law or a... | 2 | 1 | 0 | 0 | 3 | 0 |
deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/MESA/window_pos.py | ShujaKhalid/deep-rl | 210 | 162928 | <gh_stars>100-1000
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as ... | 0 | 0 | 0 | 0 | 0 | 0 |
office365/directory/applications/app_identity.py | rikeshtailor/Office365-REST-Python-Client | 544 | 162940 | from office365.runtime.client_value import ClientValue
class AppIdentity(ClientValue):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | oraluben/pyperformance | 255 | 162942 | <filename>setup.py
#!/usr/bin/env python3
# FIXME:
#
# - REENABLE HG_STARTUP BENCHMARK.
#
# Update dependencies:
#
# - python3 -m pip install --user --upgrade pip-tools
# - git clean -fdx # remove all untracked files!
# - (pip-compile --upgrade -o requirements.txt requirements.in)
#
# Prepare a release:
#
# - git... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/core/minos-microservice-common/minos/common/protocol/avro/base.py | minos-framework/minos-python | 247 | 162959 | <gh_stars>100-1000
import io
from typing import (
Any,
Union,
)
from fastavro import (
parse_schema,
reader,
writer,
)
from ...exceptions import (
MinosProtocolException,
)
from ..abc import (
MinosBinaryProtocol,
)
class MinosAvroProtocol(MinosBinaryProtocol):
"""Minos Avro Protocol... | 0 | 0 | 0 | 0 | 0 | 0 |
Beginers/stdlib/datetime/solution/weekdays.py | arunkgupta/PythonTrainingExercises | 150 | 162971 | <filename>Beginers/stdlib/datetime/solution/weekdays.py
"""Create a function that returns a list of a given size of date objects
that correspond to week days starting at a given date.
Created on 17 Feb 2016
@author: paulross
"""
import datetime
import pytest
def business_days(start_date, num):
result = []
w... | 0 | 0 | 0 | 0 | 0 | 0 |
ST_DM/KDD2021-HGAMN/src/dataset/pointwise_dataset.py | zhangyimi/Research | 1,319 | 162987 | <reponame>zhangyimi/Research<gh_stars>1000+
# Copyright (c) 2020 PaddlePaddle 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 |
Packs/CommonScripts/Scripts/IsListExist/IsListExist.py | diCagri/content | 799 | 163001 | <filename>Packs/CommonScripts/Scripts/IsListExist/IsListExist.py
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def main():
list_name = demisto.args()['listName']
res = demisto.executeCommand("getList", {"listName": list_name})
res = res[0]
if res['Type'] ==... | 0 | 0 | 0 | 0 | 0 | 0 |
extra/logreader.py | iKsSs/sslsplit | 1,242 | 163026 | <reponame>iKsSs/sslsplit<filename>extra/logreader.py
#!/usr/bin/env python
# vim: set ft=python list et ts=8 sts=4 sw=4:
# SSLsplit contributed code: Log parser for sslsplit -L
# This script reads the log from standard input and parses it.
# Standard input can point to a file or a named pipe.
# Copyright (C) 2015, <... | 0 | 0 | 0 | 0 | 0 | 0 |
exercises/strain/strain.py | kishankj/python | 1,177 | 163038 | <gh_stars>1000+
def keep(sequence, predicate):
pass
def discard(sequence, predicate):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/ac-dc-meshed/ac-dc-lopf.py | AlOussama/PyPSA | 594 | 163061 | import pypsa, os
import numpy as np
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
network = pypsa.Network()
folder_name = "ac-dc-data"
network.import_from_csv_folder(folder_name)
network.lopf(network.snapshots)
fig, ax = plt.subplots(subplot_kw={'projection': ccrs.EqualEarth()},
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_verilog/test_inline_2d_array_interface.py | leonardt/magma | 167 | 163066 | import magma as m
from magma.testing import check_files_equal
import os
def test_inline_2d_array_interface() -> object:
class Main(m.Generator):
@staticmethod
def generate(width, depth) -> object:
class MonitorWrapper(m.Circuit):
io = m.IO(arr=m.In(m.Array[depth, m.Bits... | 0 | 2 | 0 | 0 | 2 | 0 |
web/tests/test_categorization.py | zeyuyun1/word-embeddings-benchmarks | 416 | 163075 | import numpy as np
from web.evaluate import calculate_purity, evaluate_categorization
from web.embedding import Embedding
from web.datasets.utils import _fetch_file
from web.datasets.categorization import fetch_ESSLI_2c
def test_purity():
y_true = np.array([1,1,2,2,3])
y_pred = np.array([2,2,2,2,1])
assert... | 0 | 0 | 0 | 0 | 0 | 0 |
datashader/glyphs/glyph.py | goncaloperes/datashader | 706 | 163080 | <reponame>goncaloperes/datashader<filename>datashader/glyphs/glyph.py
from __future__ import absolute_import, division
import inspect
import warnings
import os
from math import isnan
import numpy as np
import pandas as pd
from datashader.utils import Expr, ngjit
from datashader.macros import expand_varargs
try:
... | 0 | 0 | 0 | 0 | 0 | 0 |
spacy/lang/tn/stop_words.py | snosrap/spaCy | 22,040 | 163086 | <filename>spacy/lang/tn/stop_words.py
# Stop words
STOP_WORDS = set(
"""
ke gareng ga selekanyo tlhwatlhwa yo mongwe se
sengwe fa go le jalo gongwe ba na mo tikologong
jaaka kwa morago nna gonne ka sa pele nako teng
tlase fela ntle magareng tsona feta bobedi kgabaganya
moo gape kgatlhanong botlhe tsotlhe bok... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/checksnippets.py | mgoelz/quickstart-android | 9,079 | 163087 | """Script for checking that Java and Kotlin snippets are in line.
Example:
$ python scripts/checksnippets.py
Checking snippets in folder: storage/app/src/
ERROR: Missing kotlin file for java file FirebaseUIActivity.java
ERROR: The following snippets are missing from StorageActivity.kt: set(['storage_custom_app'])
ERRO... | 0 | 6 | 0 | 0 | 6 | 0 |
python/app/plugins/http/Tongda/Tongda_Oa_Rce.py | taomujian/linbing | 351 | 163090 | #!/usr/bin/env python3
from __future__ import annotations
import re
import urllib3
from app.lib.utils.request import request
from app.lib.utils.common import get_capta, get_useragent
class Tongda_Oa_Rce_BaseVerify:
def __init__(self, url):
self.info: dict[str,str] = {
'name': '通达OA远程命令执行漏洞',
... | 0 | 1 | 0 | 3 | 4 | 0 |
pclib/cl/pipelines.py | belang/pymtl | 206 | 163098 | #=======================================================================
# pipelines.py
#=======================================================================
# Collection of pipelines for cycle-level modeling.
from pymtl import *
from collections import deque
#------------------------------------------------... | 1 | 2 | 0 | 0 | 3 | 0 |
tests/tests_tuner/test_tuner.py | stjordanis/mljar-supervised | 1,882 | 163104 | <filename>tests/tests_tuner/test_tuner.py
import os
import unittest
from supervised.tuner.mljar_tuner import MljarTuner
class TunerTest(unittest.TestCase):
def test_key_params(self):
params1 = {
"preprocessing": {"p1": 1, "p2": 2},
"learner": {"p1": 1, "p2": 2},
"valida... | 0 | 0 | 0 | 0 | 0 | 0 |
drake/src/drake/ocaml/menhir.py | infinit/elle | 521 | 163116 | <gh_stars>100-1000
# Copyright (C) 2019, Quentin "mefyl" Hocquet
#
# This software is provided "as is" without warranty of any kind,
# either expressed or implied, including but not limited to the
# implied warranties of fitness for a particular purpose.
#
# See the LICENSE file for more information.
'''OCaml menhir p... | 0 | 0 | 0 | 0 | 0 | 0 |
training/data.py | catalina17/EmbodiedQA | 289 | 163154 | <reponame>catalina17/EmbodiedQA<gh_stars>100-1000
import math
import time
import h5py
import logging
import argparse
import numpy as np
import os, sys, json
from tqdm import tqdm
from scipy.misc import imread, imresize
import torch
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.dataloader impo... | 0 | 0 | 0 | 0 | 0 | 0 |
src/tools/obtain_word_embedding.py | the-gates-of-Zion/zero-shot-gcn | 945 | 163164 | import argparse
import re
import os
import json
import numpy as np
import pickle as pkl
"""
for extracting word embedding yourself, please download pretrained model from one of the following links.
"""
url = {'glove': 'http://nlp.stanford.edu/data/glove.6B.zip',
'google': 'https://drive.google.com/file/d/0B7Xk... | 0 | 5 | 0 | 0 | 5 | 0 |
Packs/Campaign/Scripts/SetPhishingCampaignDetails/test_data/campaign_data.py | diCagri/content | 799 | 163187 | CAMPAIGN_INCIDENT_CONTEXT = {
"EmailCampaign": {
"firstIncidentDate": "2021-11-21T14:00:07.425185+00:00",
"incidents": [
{
"emailfrom": "<EMAIL>",
"emailfromdomain": "example.com",
"id": "1",
"name": "Verify your example acc... | 0 | 0 | 0 | 0 | 0 | 0 |
pytchat/processors/jsonfile_archiver.py | wakamezake/pytchat | 246 | 163218 | <reponame>wakamezake/pytchat<filename>pytchat/processors/jsonfile_archiver.py
import json
import os
import re
from .chat_processor import ChatProcessor
PATTERN = re.compile(r"(.*)\(([0-9]+)\)$")
class JsonfileArchiver(ChatProcessor):
"""
JsonfileArchiver saves chat data as text of JSON lines.
Parameter:... | 0 | 0 | 0 | 0 | 0 | 0 |
REDSI_1160929_1161573/boost_1_67_0/tools/build/src/tools/notfile.py | Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo | 198 | 163244 | # Status: ported.
# Base revision: 64429.
#
# Copyright (c) 2005-2010 <NAME>.
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
import b2.build.type as type
import b2.build.gen... | 0 | 2 | 0 | 0 | 2 | 0 |
python-cim/samples/ui/tree.py | pombredanne/flare-wmi | 390 | 163282 | <reponame>pombredanne/flare-wmi
from collections import namedtuple
from PyQt5.QtCore import Qt
from PyQt5.QtCore import QModelIndex
from PyQt5.QtCore import QAbstractItemModel
class Item(object):
""" interface """
def __init__(self):
pass
def __repr__(self):
raise NotImplementedError()
... | 0 | 0 | 0 | 0 | 0 | 0 |
extra/servers/memory_server.py | heinsm/qira | 2,056 | 163313 | <reponame>heinsm/qira
from qira_log import *
from flask import Flask
from flask.ext.socketio import SocketIO, emit
import base64
class Address:
def __init__(this):
this.backing = {}
def fetch(this, clnum):
# use binary search lol
while clnum >= 0:
if clnum in this.backing:
return this.ba... | 0 | 0 | 0 | 0 | 0 | 0 |
demo_scripts/charts/concatenation_and_line_chart.py | webclinic017/qf-lib | 198 | 163325 | # Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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 |
esphome/components/midea_ir/climate.py | OttoWinter/esphomeyaml | 249 | 163328 | <filename>esphome/components/midea_ir/climate.py
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import climate_ir
from esphome.const import CONF_ID
AUTO_LOAD = ["climate_ir", "coolix"]
CODEOWNERS = ["@dudanov"]
midea_ir_ns = cg.esphome_ns.namespace("midea_ir")
MideaIR = mi... | 0 | 0 | 0 | 0 | 0 | 0 |
src/modules/alignment.py | lzy1732008/simple-effective-text-matching | 281 | 163338 | # coding=utf-8
# Copyright (C) 2019 Alibaba Group Holding Limited
#
# 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 app... | 1 | 3 | 0 | 0 | 4 | 0 |
pyNastran/converters/dev/vrml/parsing_help.py | luzpaz/pyNastran | 293 | 163349 | <filename>pyNastran/converters/dev/vrml/parsing_help.py
import pyparsing as pp
#from pyparsing import (
#Suppress, Group, Optional, Word, ZeroOrMore, White, Combine,
#Dict, Literal, OneOrMore, Regex,
#alphas, alphanums, nums, oneOf, delimitedList, quotedString
#)
pword = pp.Word(pp.alphas).setName('word')
... | 0 | 0 | 0 | 0 | 0 | 0 |
stix_shifter_modules/trendmicro_vision_one/stix_translation/transformers.py | pyromaneact/stix-shifter | 129 | 163354 | <reponame>pyromaneact/stix-shifter<filename>stix_shifter_modules/trendmicro_vision_one/stix_translation/transformers.py
# -*- coding: utf-8 -*-
from stix_shifter_utils.stix_translation.src.utils.transformers import ValueTransformer
from stix_shifter_utils.utils import logger
LOGGER = logger.set_logger(__name__)
WINDO... | 0 | 0 | 0 | 0 | 0 | 0 |
caffe2/python/operator_test/group_norm_op_test.py | Hacky-DH/pytorch | 60,067 | 163359 |
from caffe2.python import core
import caffe2.python.hypothesis_test_util as hu
import caffe2.python.serialized_test.serialized_test_util as serial
from hypothesis import given, settings
import hypothesis.strategies as st
import numpy as np
import unittest
class TestGroupNormOp(serial.SerializedTestCase):
de... | 0 | 6 | 0 | 0 | 6 | 0 |
darkarmour.py | incredibleindishell/darkarmour | 482 | 163383 | <filename>darkarmour.py
#!/usr/bin/env python3
import os
import sys
import random
import string
import argparse
from lib import banner
from lib import compile
from lib import auxiliary
from lib import encryption
class DarkArmour(object):
def __init__(self):
super(DarkArmour, self).__init__()
self... | 0 | 0 | 0 | 0 | 0 | 0 |
scale/data/test/test_views.py | kaydoh/scale | 121 | 163390 | """ Tests dataset views methods """
from __future__ import unicode_literals
from __future__ import absolute_import
import copy
import datetime
import json
import django
from django.utils.timezone import now
from rest_framework import status
from rest_framework.test import APITestCase
from data.data.json.data_v6 impo... | 0 | 0 | 6 | 0 | 6 | 0 |
alibi_detect/od/prophet.py | Clusks/alibi-detect | 1,227 | 163395 | <reponame>Clusks/alibi-detect
try:
from fbprophet import Prophet
PROPHET_INSTALLED = True
except ImportError:
PROPHET_INSTALLED = False
import logging
import pandas as pd
from typing import Dict, List, Union
from alibi_detect.base import BaseDetector, FitMixin, outlier_prediction_dict
logger = logging.ge... | 0 | 0 | 0 | 0 | 0 | 0 |
back/config.py | aninstein/sex_code_blog | 116 | 163414 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
http://www.pythondoc.com/flask/config.html#id6
"""
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.getenv('SECRET_KEY') or 'MPk2WlUArcLeeU_iohzT'
'''
# 旧版本
import random
import string
''.join(rando... | 0 | 0 | 12 | 0 | 12 | 0 |
deprecated/benchmark/ps/semantic_matching/nets.py | hutuxian/FleetX | 170 | 163417 | # Copyright (c) 2019 PaddlePaddle 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 app... | 0 | 3 | 0 | 0 | 3 | 0 |
mayo/log.py | deep-fry/mayo | 110 | 163427 | <gh_stars>100-1000
import os
import sys
import time
import atexit
import shutil
import inspect
import itertools
from contextlib import contextmanager
from termcolor import colored
if os.name == "nt":
import colorama
colorama.init()
class Logger(object):
_levels = {
'debug': 0,
'info': 1,... | 0 | 0 | 0 | 0 | 0 | 0 |
panzer/meta.py | mhminai/panzer | 185 | 163459 | <gh_stars>100-1000
""" Functions for manipulating metadata """
import pandocfilters
import shlex
from . import const
from . import info
from . import util
from . import error
def update_metadata(old, new):
""" return `old` updated with `new` metadata """
# 1. Update with values in 'metadata' field
try:
... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/test/topos/regionabc.py | meodaiduoi/onos | 1,091 | 163463 | #!/usr/bin/env python
"""
[1] ----- [3] ----- [5]
| ____/ | \ |
| / | \____ |
| / | \ |
[2] ----- [4] ----- [6]
"""
from mininet.topo import Topo
class RegionABC( Topo ):
"""Simple 6 switch example"""
def __init__( self ):
"""Create a topol... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/utils/test_utils.py | run-x/opta | 595 | 163466 | import click
import pytest
from pytest_mock import MockFixture
from opta.exceptions import UserErrors
from opta.utils import alternate_yaml_extension, check_opta_file_exists, exp_backoff
def test_exp_backoff(mocker: MockFixture) -> None:
# Sleep should be exponential for each iteration
mocked_sleep = mocker.... | 5 | 6 | 0 | 0 | 11 | 0 |
setup.py | Jsn2win/pycoinnet | 114 | 163484 | <filename>setup.py
#!/usr/bin/env python
from setuptools import setup
version = "0.19"
REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()]
setup(
name="pycoinnet",
version=version,
packages=[
"pycoinnet",
"pycoinnet.examples",
"pycoinnet.helpers",
"py... | 0 | 0 | 0 | 0 | 0 | 0 |
pytablewriter/sanitizer/_python.py | jvdvegt/pytablewriter | 510 | 163491 | """
.. codeauthor:: <NAME> <<EMAIL>>
"""
import re
from typing import List, Pattern
from ._base import VarNameSanitizer
class PythonVarNameSanitizer(VarNameSanitizer):
__PYTHON_RESERVED_KEYWORDS: list[str] = [
"and",
"del",
"from",
"not",
"while",
"as",
"e... | 3 | 5 | 2 | 0 | 10 | 0 |
src/py/autowig/default_controller.py | StatisKit/AutoWIG | 102 | 163517 | ## Copyright [2017-2018] UMR MISTEA INRA, UMR LEPSE INRA, ##
## UMR <NAME>, EPI Virtual Plants Inria ##
## Copyright [2015-2016] UMR <NAME>, EPI Virtual Plants Inria ##
## ##
## This file is part of ... | 0 | 1 | 0 | 0 | 1 | 0 |
dash_docs/chapters/dash_slicer/index.py | joelostblom/dash-docs | 379 | 163533 | <reponame>joelostblom/dash-docs<gh_stars>100-1000
import inspect
import dash_html_components as html
import dash_core_components as dcc
from dash_docs import styles
from dash_docs import tools
from dash_docs import reusable_components as rc
import dash_slicer
try:
from dash_slicer.docs import get_reference_docs
e... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/interactive/interactive_1d/1d_interactive.py | genematx/nmrglue | 150 | 163538 | <reponame>genematx/nmrglue<filename>examples/interactive/interactive_1d/1d_interactive.py<gh_stars>100-1000
#! /usr/bin/env python
# Create a 1D interactive plot from NMRPipe data
import nmrglue as ng
import matplotlib.pyplot as plt
# read in the data from a NMRPipe file
dic, data = ng.pipe.read("nmrpipe_1d/test.ft")... | 0 | 0 | 0 | 0 | 0 | 0 |
greykite/algo/common/col_name_utils.py | CaduceusInc/greykite | 1,503 | 163554 | <gh_stars>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 Apache License, Version 2.0
# (the "License");... | 0 | 0 | 0 | 0 | 0 | 0 |
beartype/_util/py/utilpyinterpreter.py | vcokltfre/beartype | 1,056 | 163585 | #!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
Project-wide **Python interpreter** utilities.
This private submodule is *not* intended for importation by downstream callers.
'''... | 0 | 1 | 0 | 0 | 1 | 0 |
testData/typeinspection/fieldField.py | alek-sun/pydantic-pycharm-plugin | 238 | 163594 |
from pydantic import BaseModel, Field
NUMBER = 123
class A(BaseModel):
a: int = Field(int(123))
b = Field(123)
c = Field(default=int(123))
d: int = Field(...)
e: int = Field(NUMBER)
f: int = Field(default=NUMBER)
g = Field(NUMBER)
h: int = Field(NUMBER)
i: int = Field(default=NUM... | 0 | 0 | 6 | 0 | 6 | 0 |
tests/test_attr.py | takehirokj/picamera | 1,311 | 163596 | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2017 <NAME> <<EMAIL>>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributio... | 0 | 0 | 0 | 0 | 0 | 1 |
redbeat/__init__.py | nigel-gott/redbeat | 746 | 163603 | from .schedulers import RedBeatScheduler, RedBeatSchedulerEntry # noqa
| 0 | 0 | 0 | 0 | 0 | 0 |
wip/deptree.py | vzkqwvku/kglab | 388 | 163619 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
See <https://stackoverflow.com/a/55007852/1698443>
"""
import pipdeptree # type: ignore # pylint: disable=E0401
import json
#import sys
pkgs = pipdeptree.get_installed_distributions()
tree = pipdeptree.PackageDAG.from_pkgs(pkgs)
print(pipdeptree.render_json_tree(tr... | 0 | 0 | 0 | 0 | 0 | 0 |
txdav/xml/parser_etree.py | backwardn/ccs-calendarserver | 462 | 163621 | <gh_stars>100-1000
##
# Copyright (c) 2012-2017 Apple Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | 0 | 0 | 0 | 0 | 0 | 0 |
bindings/python/cntk/tests/tensor_test.py | burhandodhy/CNTK | 17,702 | 163623 | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import numpy as np
import cntk as C
import pytest
def test_slice_stride():
c... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/release18/GeGetMoDataWeights.py | tdapper/cinema4d_py_sdk | 113 | 163631 | <gh_stars>100-1000
# This example shows how to call GeGetMoDataWeights()
import c4d
from c4d.modules import mograph
def main():
# Checks if there is an active object
if op is None:
print "Please select a MoGraph Cloner Object"
return
# Checks if the active object is a MoGraph Cloner Obje... | 0 | 0 | 0 | 0 | 0 | 0 |
malware_specific/TinyPOS/TinyPOS_exfil_decoder.py | knightsc/tau-tools | 202 | 163655 | <reponame>knightsc/tau-tools<gh_stars>100-1000
import re
import sys
import os
'''
Python3
Date: 4 May 2020
Author: <NAME> TAU - <NAME>
Exemplar Hashes:
Description: Decodes PCI encoded data dumps from TinyPOS/PinkKite ShellCode Variants
'''
__VERSION__ = '1.0'
def decode(string):
key = [<KEY>
out = ''
count... | 0 | 0 | 0 | 0 | 0 | 0 |
adb_shell/__init__.py | maybe-sybr/adb_shell | 268 | 163665 | <reponame>maybe-sybr/adb_shell
# Copyright (c) 2021 <NAME> and contributors
#
# This file is part of the adb-shell package.
"""ADB shell functionality.
"""
__version__ = '0.4.1'
| 0 | 0 | 0 | 0 | 0 | 0 |
async/netdev-async.py | caputomarcos/network-programmability-stream | 120 | 163691 | <reponame>caputomarcos/network-programmability-stream
import asyncio
from datetime import datetime
from typing import List, Dict, Any, Iterable, Tuple
import netdev
import colorama
HOSTS = {
"R1": "198.18.1.101",
"R2": "198.18.1.102",
"R3": "198.18.1.103",
"R4": "198.18.1.104",
"R5": "198.18.1.105... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/model_repository.py | ParikhKadam/HybridPose | 369 | 163704 | <reponame>ParikhKadam/HybridPose
from torch import nn
import torch
from torch.nn import functional as F
from lib.resnet import resnet18, resnet50, resnet34
import pdb
class Resnet18_8s(nn.Module):
def __init__(self, num_keypoints=8, fcdim=256, s8dim=128, s4dim=64, s2dim=32, raw_dim=32):
super(Resnet18_8s, ... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/backtracking/Maze-Generation-Visualiser.py | Khushboo85277/NeoAlgo | 897 | 163770 | '''
Maze Generation Visualizer using Backtracking Algorithm
Python scripts for generating random solvable mazes using the depth-first search and recursive backtracking algorithms.
The code also implements a recursive backtracking pathfinding algorithm for solving the generated mazes.
'''
import pygame
import random... | 11 | 1 | 0 | 2 | 14 | 0 |
reliability-v2/tasks/ScheduledTasks.py | afcollins/svt | 115 | 163784 | <gh_stars>100-1000
import logging
from apscheduler.schedulers.background import BackgroundScheduler
class ScheduledTasks:
def __init__(self):
self.logger = logging.getLogger('reliability')
# config scheduler
executors = {
'default': {'type': 'threadpool', 'max_workers': 60},
... | 0 | 0 | 0 | 0 | 0 | 0 |
lightbus/transports/registry.py | gcollard/lightbus | 178 | 163788 | from itertools import chain
from typing import NamedTuple, Dict, Sequence, List, Set, Type, Union, TYPE_CHECKING, Tuple
from lightbus.exceptions import TransportNotFound, TransportsNotInstalled
from lightbus.transports.pool import TransportPool
from lightbus.utilities.importing import load_entrypoint_classes
empty = ... | 39 | 23 | 5 | 1 | 68 | 0 |
tests/events/test_utils.py | janheise/zentral | 634 | 163815 | from django.test import TestCase
from zentral.core.events.utils import decode_args, encode_args
class EventUtilsTestCase(TestCase):
def test_decode_args(self):
for encoded, decoded in (("", [""]),
(r"\\a", [r"\a"]),
(r"|1|2|3||", ["", "1", ... | 0 | 0 | 0 | 0 | 0 | 0 |
odo/backends/ssh.py | farukht/odo | 844 | 163835 | <reponame>farukht/odo
from __future__ import absolute_import, division, print_function
import paramiko
from contextlib import contextmanager
from toolz import keyfilter, memoize, take, curry
from datashape import discover
import re
import uuid
from ..directory import Directory
from ..utils import keywords, tmpfile, s... | 0 | 0 | 0 | 0 | 0 | 0 |
opsdroid/testing/fixtures.py | JiahnChoi/opsdroid.kr | 712 | 163851 | <reponame>JiahnChoi/opsdroid.kr
"""Core fixtures for testing opsdroid and skills.
These are not in conftest.py so that they can be imported in sub-projects.
"""
import contextlib
import socket
from typing import Tuple
import pytest
from opsdroid.core import OpsDroid
from opsdroid.connector import Connector
from .ex... | 0 | 0 | 0 | 0 | 0 | 0 |
fixtures/python_output/post_with_data_raw.py | martinsirbe/curlconverter | 4,955 | 163861 | <filename>fixtures/python_output/post_with_data_raw.py
import requests
data = {
'msg1': 'wow',
'msg2': 'such',
'msg3': '@rawmsg'
}
response = requests.post('http://example.com/post', data=data)
| 0 | 0 | 0 | 0 | 0 | 0 |
barbican/tests/plugin/util/test_mime_types.py | mail2nsrajesh/barbican | 177 | 163868 | <reponame>mail2nsrajesh/barbican
# Copyright (c) 2013-2014 Rackspace, 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 require... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.