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 |
|---|---|---|---|---|---|---|---|---|---|---|
src/joystick/sort_controllers.py | capehill/SDL | 2,967 | 3283973 | <gh_stars>1000+
#!/usr/bin/env python
#
# Script to sort the game controller database entries in SDL_gamecontroller.c
import re
filename = "SDL_gamecontrollerdb.h"
input = open(filename)
output = open(filename + ".new", "w")
parsing_controllers = False
controllers = []
controller_guids = {}
conditionals = []
split_p... | 0 | 0 | 0 | 0 | 0 | 0 |
poium/wda/__init__.py | yaoJeffer/poium | 174 | 3283999 | <gh_stars>100-1000
import time
from poium.common import logging
from poium.settings import Setting
from poium.processing import processing, screenshots_name
from poium.common.assert_des import insert_assert
LOCATOR_LIST = [
"id",
"name",
"text",
"nameContains",
"label",
"xpath",
"labelCont... | 0 | 0 | 0 | 0 | 0 | 0 |
source/NVDAObjects/IAccessible/sysTreeView32.py | oleguldberg/nvda | 1,592 | 3284011 | # A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2007-2020 NV Access Limited
from __future__ import annotations
import api
import controlTypes
import speech
import UIAHandler
from . import IAccessibl... | 1 | 28 | 0 | 0 | 29 | 0 |
lite/tests/unittest_py/op/test_collect_fpn_proposals_op.py | 714627034/Paddle-Lite | 808 | 3284023 | # Copyright (c) 2021 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 appli... | 0 | 0 | 0 | 0 | 0 | 0 |
2020/CVE-2020-9496/poc/pocsploit/CVE-2020-9496.py | hjyuan/reapoc | 421 | 3284036 | from __future__ import annotations
import requests
# Vuln Base Info
def info() -> dict[str,dict[str,str] | list[str] | str]:
return {
"author": "cckuailong",
"name": '''Apache OFBiz XML-RPC Java Deserialization''',
"description": '''XML-RPC request are vulnerable to unsafe deserialization ... | 0 | 5 | 0 | 0 | 5 | 0 |
tests/topologies_tests.py | pgaulon/minicps | 119 | 3284038 | <filename>tests/topologies_tests.py
"""
Topologies tests
"""
# TODO: move to swat example
from nose.plugins.skip import SkipTest
from minicps.sdns import OF_MISC
from minicps.utils import TEMP_DIR
from mininet.net import Mininet
from mininet.link import TCLink
from mininet.cli import CLI
from mininet.node import R... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/multi_process/zeromq_queue.py | jonathan-greig/plaso | 1,253 | 3284042 | <filename>tests/multi_process/zeromq_queue.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the the zeromq queue."""
import unittest
from plaso.lib import errors
from plaso.multi_process import zeromq_queue
from tests import test_lib as shared_test_lib
class ZeroMQPullBindQueue(zeromq_queue.ZeroMQPul... | 0 | 0 | 0 | 0 | 0 | 0 |
pybrain/structure/modules/sigmoidlayer.py | sveilleux1/pybrain | 2,208 | 3284091 | <filename>pybrain/structure/modules/sigmoidlayer.py
__author__ = '<NAME>, <EMAIL>'
from pybrain.structure.modules.neuronlayer import NeuronLayer
from pybrain.tools.functions import sigmoid
class SigmoidLayer(NeuronLayer):
"""Layer implementing the sigmoid squashing function."""
def _forwardImplementation(se... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/vfs/bde_file_system.py | dfjxs/dfvfs | 176 | 3284102 | <filename>tests/vfs/bde_file_system.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the file system implementation using pybde."""
import unittest
from dfvfs.lib import definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import context
from dfvfs.resolver import resolver
... | 0 | 0 | 0 | 0 | 0 | 0 |
manga_py/crypt/hentainexus_com.py | sonvt1710/manga-py | 337 | 3284119 | from .base_lib import BaseLib
class HentaiNexusComCrypt(BaseLib):
def __init__(self):
super().__init__()
self._this: list[object] = []
self._pads: dict[object,object] = {}
def decode(self, enc) -> object:
buff = self.base64decode(enc)
i = 0
file = 0
ke... | 1 | 4 | 0 | 2 | 7 | 0 |
tests/regression_tests/multipole/test.py | janmalec/openmc | 262 | 3284120 | import os
import openmc
import openmc.model
import pytest
from tests.testing_harness import TestHarness, PyAPITestHarness
def make_model() -> object:
model = openmc.model.Model()
# Materials
moderator = openmc.Material(material_id=1)
moderator.set_density('g/cc', 1.0)
moderator.add_nuclide('H1'... | 0 | 2 | 0 | 0 | 2 | 0 |
amazon_problems/problem_18.py | loftwah/Daily-Coding-Problem | 129 | 3284144 | <reponame>loftwah/Daily-Coding-Problem
"""This problem was asked by Amazon.
Given an array and a number k that's smaller than the length of the array,
rotate the array to the right k elements in-place.
""" | 0 | 0 | 0 | 0 | 0 | 0 |
graph_explorer/test/test_config.py | farheenkaifee/dashboard_3 | 284 | 3284161 | <gh_stars>100-1000
def test_config_valid():
# TODO update this for new text files
from graph_explorer import config
from graph_explorer.validation import ConfigValidator
c = ConfigValidator(obj=config)
valid = c.validate()
if not valid:
from pprint import pprint
pprint(c.errors)... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/perf/run_gtest_benchmark.py | zealoussnow/chromium | 14,668 | 3284179 | <reponame>zealoussnow/chromium<filename>tools/perf/run_gtest_benchmark.py
#!/usr/bin/env vpython
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs gtest perf tests and process results.
Runs gtest and... | 0 | 0 | 0 | 0 | 0 | 0 |
tbx/people/migrations/0013_culturepage_strapline_visible.py | elviva404/wagtail-torchbox | 103 | 3284204 | # Generated by Django 2.1.5 on 2019-03-20 15:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
("people", "0012_auto_20190316_1641"),
]
operations: list[object] = [
migrations.AddField(
model_name="cult... | 0 | 0 | 2 | 0 | 2 | 0 |
.modules/.metagoofil/hachoir_parser/file_system/mbr.py | termux-one/EasY_HaCk | 1,103 | 3284221 | <reponame>termux-one/EasY_HaCk<filename>.modules/.metagoofil/hachoir_parser/file_system/mbr.py<gh_stars>1000+
"""
Master Boot Record.
"""
# cfdisk uses the following algorithm to compute the geometry:
# 0. Use the values given by the user.
# 1. Try to guess the geometry from the partition table:
# if all the used... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unittests/test_batching.py | mj-kh/speechbrain | 3,913 | 3284227 | <filename>tests/unittests/test_batching.py
import pytest
import torch
import numpy as np
def test_batch_pad_right_to(device):
from speechbrain.utils.data_utils import batch_pad_right
import random
n_channels = 40
batch_lens = [1, 5]
for b in batch_lens:
rand_lens = [random.randint(10, 53... | 0 | 0 | 0 | 0 | 0 | 0 |
example/cifar10/label_smoothing.py | KuanKuanQAQ/ares | 206 | 3284256 | <filename>example/cifar10/label_smoothing.py
''' This file provides a wrapper class for TRADES (https://github.com/yaodongyu/TRADES) model for CIFAR-10 dataset. '''
import sys
import os
THIRD_PARTY_PATH = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../third_party'))
if THIRD_PARTY_PAT... | 0 | 0 | 0 | 0 | 0 | 0 |
vqa/function/test.py | xiling42/VL-BERT | 671 | 3284262 | from __future__ import annotations
import os
import pprint
import shutil
import json
from tqdm import tqdm, trange
import numpy as np
import torch
import torch.nn.functional as F
from common.utils.load import smart_load_model_state_dict
from common.trainer import to_cuda
from common.utils.create_logger import create_... | 3 | 1 | 0 | 0 | 4 | 0 |
simba/read_DLCmulti_h5_function.py | sgoldenlab/simba | 172 | 3284272 | import os, glob
import pandas as pd
import cv2
import numpy as np
from configparser import ConfigParser, MissingSectionHeaderError, NoSectionError, NoOptionError
from pylab import *
from simba.rw_dfs import *
from simba.drop_bp_cords import *
import pyarrow.parquet as pq
import pyarrow as pa
from simba.interp... | 0 | 0 | 0 | 0 | 0 | 0 |
cirq-core/cirq/protocols/equal_up_to_global_phase_protocol_test.py | LLcat1217/Cirq | 3,326 | 3284273 | # Copyright 2018 The Cirq Developers
#
# 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 0 | 2 | 0 | 2 | 4 | 0 |
tests/storage/psql_dos/migrations/django_branch/test_0041_seal_unsealed_processes.py | mkrack/aiida-core | 153 | 3284282 | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 1 | 0 | 0 | 0 | 1 | 0 |
samsungctl/remote_legacy.py | p3g4asus/samsungctl | 135 | 3284283 | <filename>samsungctl/remote_legacy.py
# -*- coding: utf-8 -*-
import base64
import logging
import socket
import time
import codecs
import threading
import sys
from . import exceptions
from .utils import LogIt, LogItWithReturn
logger = logging.getLogger('samsungctl')
class RemoteLegacy(object):
"""Object for rem... | 0 | 0 | 0 | 0 | 0 | 0 |
plaso/parsers/sqlite_plugins/twitter_android.py | jonathan-greig/plaso | 1,253 | 3284307 | <gh_stars>1000+
# -*- coding:utf-8 -*-
"""SQLite parser plugin for Twitter on Android database files."""
from dfdatetime import java_time as dfdatetime_java_time
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import definitions
from plaso.parsers import sqlite
from plaso.p... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/admin/test_csv.py | kleprevost/CTFd | 3,592 | 3284362 | import io
from CTFd.models import Challenges, Teams, Users
from CTFd.utils.crypto import verify_password
from tests.helpers import create_ctfd, destroy_ctfd, gen_challenge, login_as_user
def test_export_csv_works():
"""Test that CSV exports work properly"""
app = create_ctfd()
with app.app_context():
... | 0 | 0 | 0 | 0 | 0 | 0 |
dash_docs/chapters/dash_core_components/Store/examples/store_clicks.py | joelostblom/dash-docs | 379 | 3284373 | import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Output, Input, State
from dash.exceptions import PreventUpdate
# This stylesheet makes the buttons and table pretty.
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(_... | 0 | 2 | 0 | 0 | 2 | 0 |
coldtype/color/__init__.py | goodhertz/coldtype | 142 | 3284375 | from __future__ import annotations
from random import random
from coldtype.color.html import NAMED_COLORS
from coldtype.interpolation import norm
try:
import skia
except ImportError:
skia = None
try:
from fontTools.ttLib.tables.C_P_A_L_ import Color as FTCPALColor
except ImportError:
FTCPALColor = Non... | 20 | 39 | 0 | 2 | 61 | 0 |
listen_to_look_single_modality/models/models.py | facebookresearch/Listen-to-Look | 114 | 3284444 | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torchvision
from .networks import weights_init, ClassifierNet
from .audioPreview... | 5 | 3 | 0 | 0 | 8 | 0 |
tests/pico8/music/music_test.py | Syphonx/picotool | 310 | 3284504 | <filename>tests/pico8/music/music_test.py
#!/usr/bin/env python3
import unittest
from unittest.mock import Mock
from unittest.mock import patch
from pico8.music import music
VALID_MUSIC_LINES = [b'00 41424344\n'] * 64
class TestMusic(unittest.TestCase):
def testFromLines(self):
m = music.Music.from_li... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_font_size.py | josiahkhor/pdfminer.six | 3,538 | 3284510 | from helpers import absolute_sample_path
from pdfminer.high_level import extract_pages
from pdfminer.layout import LTChar, LTTextBox
def test_font_size():
path = absolute_sample_path('font-size-test.pdf')
for page in extract_pages(path):
for text_box in page:
if isinstance(text_box, LTText... | 0 | 0 | 0 | 0 | 0 | 0 |
lulu/extractors/kugou.py | fakegit/Lulu | 922 | 3284515 | #!/usr/bin/env python
import re
import json
from base64 import b64decode
from lulu.common import (
match1,
url_info,
print_info,
get_content,
download_urls,
)
__all__ = ['kugou_download']
site_info = '酷狗音乐 kugou.com'
def kugou_download_by_hash(hash_val, info_only: bool=False, **kwargs):
# ... | 3 | 0 | 0 | 0 | 3 | 0 |
mendeleev/cli.py | lmmentel/mendeleev | 105 | 3284526 | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import textwrap
import colorama
from pyfiglet import Figlet
from mendeleev import element
from mendeleev.fetch import fetch_table
def clielement():
"""
CLI for convenient printing of properties for a given element
"""
col... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/gamestonk_terminal/stocks/fundamental_analysis/financial_modeling_prep/test_fmp_model.py | Aerex/GamestonkTerminal | 1,835 | 3284533 | <reponame>Aerex/GamestonkTerminal
# IMPORTATION STANDARD
# IMPORTATION THIRDPARTY
import pytest
import numpy as np
import pandas as pd
# IMPORTATION INTERNAL
from gamestonk_terminal.stocks.fundamental_analysis.financial_modeling_prep import (
fmp_model,
)
@pytest.fixture(scope="module")
def vcr_config():
re... | 0 | 0 | 0 | 0 | 0 | 0 |
shap/benchmark/metrics.py | santanaangel/shap | 16,097 | 3284542 | from __future__ import annotations
from .. import LinearExplainer
from .. import KernelExplainer
from .. import SamplingExplainer
from ..explainers import other
from .. import __version__
from . import measures
from . import methods
import sklearn
import numpy as np
import copy
import functools
import time
import hashl... | 35 | 66 | 0 | 0 | 101 | 0 |
examples/multimedia/mmimdb_cca.py | kapikantzari/MultiBench | 148 | 3284567 | import torch
import sys
import os
sys.path.append(os.getcwd())
from unimodals.common_models import Linear, MaxOut_MLP
from datasets.imdb.get_data import get_dataloader
from fusions.common_fusions import Concat
from objective_functions.objectives_for_supervised_learning import CCA_objective
from training_structures.Su... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/distrib/add-iwyu.py | goodarzysepideh/grpc | 36,552 | 3284571 | #!/usr/bin/env python3
# Copyright 2021 gRPC 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... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/tests/utils.py | allcaps/django-pattern-library | 201 | 3284579 | from django import VERSION as DJANGO_VERSION
if DJANGO_VERSION < (2,):
from django.core.urlresolvers import reverse # noqa
else:
from django.urls import reverse # noqa
| 0 | 0 | 0 | 0 | 0 | 0 |
tools/crop_by_word_bb_syn90k.py | AK391/ABINet | 230 | 3284603 | <filename>tools/crop_by_word_bb_syn90k.py<gh_stars>100-1000
# Crop by word bounding box
# Locate script with gt.mat
# $ python crop_by_word_bb.py
import os
import re
import cv2
import scipy.io as sio
from itertools import chain
import numpy as np
import math
mat_contents = sio.loadmat('gt.mat')
image_names = mat_con... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/py/async-gather-concurrency.py | diwenshi61/ccxt | 24,910 | 3284612 | <reponame>diwenshi61/ccxt<gh_stars>1000+
# -*- coding: utf-8 -*-
import asyncio
import os
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt.async_support as ccxt # noqa: E402
async def work(exchange_id):
# create it on... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_packages/test_skills/test_generic_seller/test_models.py | bryanchriswhite/agents-aea | 126 | 3284616 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
ioflo/aid/test/test_eventing.py | BradyHammond/ioflo | 128 | 3284621 | <filename>ioflo/aid/test/test_eventing.py
# -*- coding: utf-8 -*-
"""
Unit Test Template
"""
from __future__ import absolute_import, division, print_function
import sys
import datetime
import unittest
import os
import time
from ioflo.aid.sixing import *
from ioflo.aid.odicting import odict
from ioflo.test import tes... | 0 | 0 | 0 | 0 | 0 | 0 |
docs_src/custom_response/tutorial008.py | jomue/fastapi | 53,007 | 3284633 | <filename>docs_src/custom_response/tutorial008.py
from fastapi import FastAPI
from fastapi.responses import StreamingResponse
some_file_path = "large-video-file.mp4"
app = FastAPI()
@app.get("/")
def main():
def iterfile(): # (1)
with open(some_file_path, mode="rb") as file_like: # (2)
yiel... | 0 | 0 | 0 | 0 | 0 | 0 |
ml3d/torch/models/pvcnn.py | krshrimali/Open3D-ML | 346 | 3284651 | from __future__ import annotations
import numpy as np
import torch
import torch.nn as nn
import functools
import open3d
from torch.autograd import Function
from .base_model import BaseModel
from ...utils import MODEL
from ..modules.losses import filter_valid_label
from ...datasets.augment import SemsegAugmentation
if... | 25 | 19 | 1 | 0 | 45 | 0 |
desktop/core/ext-py/docutils-0.14/test/test_transforms/test_writer_aux.py | kokosing/hue | 5,079 | 3284686 | #! /usr/bin/env python
# $Id: test_writer_aux.py 5174 2007-05-31 00:01:52Z wiemann $
# Author: <NAME> <<EMAIL>>
# Copyright: This module has been placed in the public domain.
"""
Test module for writer_aux transforms.
"""
from __init__ import DocutilsTestSupport # must be imported before docutils
from docutils.trans... | 0 | 1 | 0 | 0 | 1 | 0 |
examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur.py | felipeek/bullet3 | 9,136 | 3284704 | <reponame>felipeek/bullet3<filename>examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur.py
"""This file implements the functionalities of a minitaur using pybullet.
"""
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.... | 0 | 0 | 0 | 0 | 0 | 0 |
Glyph Names, Notes and Unicode/Add PUA Unicode Values to Selected Glyphs.py | justanotherfoundry/Glyphs-Scripts | 283 | 3284708 | #MenuTitle: Add PUA Unicode Values to Selected Glyphs
# -*- coding: utf-8 -*-
from __future__ import annotations
from __future__ import division, print_function, unicode_literals
__doc__="""
Adds custom Unicode values to selected glyphs.
"""
import vanilla
class CustomUnicode( object ):
def __init__( self ):
# Win... | 1 | 4 | 0 | 0 | 5 | 0 |
text/src/autogluon/text/text_prediction/__init__.py | zhiqiangdon/autogluon | 4,462 | 3284721 | <reponame>zhiqiangdon/autogluon
from . import constants
from . import infer_types
from . import metrics
from . import predictor
from . import presets
from .predictor.predictor import TextPredictor
__all__ = ['constants', 'infer_types', 'metrics', 'predictor', 'presets',
'TextPredictor']
| 0 | 0 | 0 | 0 | 0 | 0 |
lte/gateway/python/magma/pipelined/tests/app/table_isolation.py | nstng/magma | 539 | 3284740 | <reponame>nstng/magma
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS... | 0 | 0 | 0 | 0 | 0 | 0 |
python/gtsam/tests/test_Scenario.py | xxiao-1/gtsam | 1,402 | 3284742 | <filename>python/gtsam/tests/test_Scenario.py
"""
GTSAM Copyright 2010-2019, Georgia Tech Research Corporation,
Atlanta, Georgia 30332-0415
All Rights Reserved
See LICENSE for the license information
Scenario unit tests.
Author: <NAME> & <NAME> (Python)
"""
from __future__ import print_function
import math
import un... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/diag_scripts/mlr/test_helpers.py | cffbots/ESMValTool | 148 | 3284750 | <filename>tests/unit/diag_scripts/mlr/test_helpers.py
"""Unit tests for the module :mod:`esmvaltool.diag_scripts.mlr`."""
import os
from unittest import mock
import iris
import numpy as np
import pandas as pd
import pytest
from cf_units import Unit
from esmvaltool.diag_scripts import mlr
from esmvaltool.diag_scripts... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_substitute.py | gitmoneyyy123/VintageEx | 134 | 3284753 | import unittest
from vex.parsers.s_cmd import SubstituteLexer
from vex.parsers.parsing import RegexToken
from vex.parsers.parsing import Lexer
from vex.parsers.parsing import EOF
class TestRegexToken(unittest.TestCase):
def setUp(self):
self.token = RegexToken("f[o]+")
def testCanTestMem... | 0 | 0 | 0 | 0 | 0 | 0 |
kapture/algo/merge_remap.py | v-mehta/kapture | 264 | 3284760 | <reponame>v-mehta/kapture<filename>kapture/algo/merge_remap.py
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
"""
Merge kapture objects with remapping of identifiers.
"""
from kapture.io.tar import TarCollection
from typing import List, Optional, Type, Dict
import kapture
from kapture.io.records imp... | 0 | 0 | 0 | 0 | 0 | 0 |
edb/tools/wipe.py | sfermigier/edgedb | 7,302 | 3284764 | <reponame>sfermigier/edgedb
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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... | 0 | 0 | 0 | 0 | 0 | 0 |
google/appengine/_internal/graphy/pie_chart.py | MiCHiLU/google_appengine_sdk | 790 | 3284777 | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 14 | 5 | 0 | 2 | 21 | 0 |
depot/fields/filters/thumbnails.py | tcmike/depot | 128 | 3284785 | from depot.io import utils
from depot.manager import DepotManager
from ..interfaces import FileFilter
from PIL import Image
from io import BytesIO
class WithThumbnailFilter(FileFilter):
"""Uploads a thumbnail together with the file.
Takes for granted that the file is an image.
The resulting uploaded file... | 2 | 0 | 0 | 0 | 2 | 0 |
python/lib/ucscGb/encode/mkChangeNotes.py | andypohl/kent | 171 | 3284795 | #!/hive/groups/encode/dcc/bin/python
import sys, os, re, argparse, subprocess, math, datetime, time
from ucscGb.encode import track
from ucscGb.gbData import ra,ucscUtils
from ucscGb.gbData.ra.raFile import RaFile
from ucscGb.qa.encode import tableCheck as qa
class makeNotes(object):
def checkMetaDbForFiles(self, ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_parser.py | facebookincubator/StateService | 141 | 3284803 | <filename>tests/test_parser.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
from unittest import TestCase
from ..state_service.parser ... | 0 | 0 | 0 | 0 | 0 | 0 |
release/stubs.min/Autodesk/Revit/DB/Analysis_parts/AnalysisDisplayColoredSurfaceSettings.py | htlcnn/ironpython-stubs | 182 | 3284814 | <reponame>htlcnn/ironpython-stubs
class AnalysisDisplayColoredSurfaceSettings(object,IDisposable):
"""
Contains colored surface settings for analysis display style element.
AnalysisDisplayColoredSurfaceSettings()
AnalysisDisplayColoredSurfaceSettings(other: AnalysisDisplayColoredSurfaceSettings)
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
neural_compressor/ux/components/profiling/profile_model.py | intel/neural-compressor | 172 | 3284832 | # -*- coding: utf-8 -*-
# Copyright (c) 2021-2022 Intel 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 requir... | 1 | 2 | 1 | 0 | 4 | 0 |
tonic/agents/agent.py | Eyalcohenx/tonic | 350 | 3284866 | <reponame>Eyalcohenx/tonic
import abc
class Agent(abc.ABC):
'''Abstract class used to build agents.'''
def initialize(self, observation_space, action_space, seed=None):
pass
@abc.abstractmethod
def step(self, observations):
'''Returns actions during training.'''
pass
def... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/samples/issue-274-support-one-package-without-package-dir/hello_tests/__init__.py | mlasch/scikit-build | 299 | 3284868 | import unittest
import hello
from hello import cmake_generated_module
class HelloTest(unittest.TestCase):
def test_hello(self):
self.assertEqual(hello.who(), "world")
with open("test_hello.completed.txt", "w") as marker:
marker.write("")
def test_cmake_generated_module(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/fsspec/conftest.py | ZhangQingsen/CISC849Proj | 1,738 | 3284879 | import os
import shutil
import subprocess
import sys
import time
import pytest
import fsspec
from fsspec.implementations.cached import CachingFileSystem
@pytest.fixture()
def m():
"""
Fixture providing a memory filesystem.
"""
m = fsspec.filesystem("memory")
m.store.clear()
try:
yiel... | 0 | 0 | 0 | 0 | 0 | 0 |
BlogPosts/Prescription_based_prediction/prescription_based_prediction.py | markgraves/roamresearch | 190 | 3284880 | from __future__ import annotations
"""
The is the experimental framework associated with the Roam blog post
'Prescription-based prediction': URL
"""
from collections import Counter
from colour import Color
import json
import matplotlib.pyplot as plt
import numpy as np
from operator import itemgetter
import pandas as pd... | 39 | 20 | 0 | 1 | 60 | 0 |
accelerator/examples/build_tutorial01.py | eBay/accelerator | 143 | 3284888 | <filename>accelerator/examples/build_tutorial01.py
from os.path import dirname, join
from accelerator.colour import bold
from .printer import prt
description = "Tutorial: Import a file."
# The file is stored in the same directory as this python file.
# In a real project, set "input directory" in the config file inst... | 0 | 0 | 0 | 0 | 0 | 0 |
opacus/tests/grad_samples/layer_norm_test.py | anibadde/opacus | 958 | 3284892 | <reponame>anibadde/opacus
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import hypothesis.strategies as st
import torch
import torch.nn as nn
from hypothesis import given, settings
from .common import GradSampleHooks_test
class LayerNorm_test(GradSampleHooks_test):
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/tools/client/test_offsets.py | akashvacher/kafka-tools | 578 | 3284911 | <filename>tests/tools/client/test_offsets.py
import unittest
from mock import MagicMock
from tests.tools.client.fixtures import list_offset, list_offset_error, topic_metadata, offset_commit_response
from kafka.tools.client import Client
from kafka.tools.exceptions import ConnectionError, OffsetError
from kafka.tools.... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/dfmparse.py | yawor/pyparsing | 1,499 | 3284912 | from __future__ import annotations
"""
This module can parse a Delphi Form (dfm) file.
The main is used in experimenting (to find which files fail
to parse, and where), but isn't useful for anything else.
"""
__version__ = "1.0"
__author__ = "<NAME>' Griffith <pythondev - dang at lazytwinacres . net>"
fro... | 1 | 4 | 0 | 0 | 5 | 0 |
vespene/migrations/0002_auto_20181027_1530.py | webknjaz/vespene | 680 | 3284924 | # Generated by Django 2.1.2 on 2018-10-27 15:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('vespene', '0001_initial'),
]
operations: list[object] = [
migrations.AlterField(
model_name='build',
... | 0 | 0 | 2 | 0 | 2 | 0 |
2019/day_08_AOC19_candy.py | nyanthanya/Contoh-Program | 105 | 3284934 | <reponame>nyanthanya/Contoh-Program
from itertools import count
from random import shuffle
from stitch import stitch
import numpy as np
import cv2
l = np.array([[0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0],
[1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, ... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/statemachine.py | pombredanne/vulncode-db | 592 | 3284935 | # Copyright 2020 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, ... | 2 | 13 | 0 | 0 | 15 | 0 |
stratum/pipelines/loopback/ptf/loopback.py | cholve/stratum | 267 | 3284943 | <reponame>cholve/stratum
#!/usr/bin/env python2
# Copyright 2019 NoviFlow Inc.
# SPDX-License-Identifier: Apache-2.0
import ptf
import os
from ptf import config
import ptf.testutils as testutils
from base_test import P4RuntimeTest, autocleanup, stringify, ipv4_to_binary
class LoopbackTest(P4RuntimeTest):
pass
c... | 0 | 0 | 0 | 0 | 0 | 0 |
pyexcel/parser.py | craiga/pyexcel | 1,045 | 3284956 | """
pyexcel.parser
~~~~~~~~~~~~~~~~~~~
Extract tabular data from external file, stream or content
:copyright: (c) 2015-2020 by Onni Software Ltd.
:license: New BSD License
"""
from pyexcel.internal import garbagecollector as gc
class AbstractParser(object):
"""
Parsing data from tabular ... | 0 | 1 | 0 | 0 | 1 | 0 |
lib/hypervisor/hv_chroot.py | modulus-sa/ganeti | 396 | 3284963 | #
#
# Copyright (C) 2006, 2007, 2008, 2009, 2013 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this... | 11 | 11 | 1 | 0 | 23 | 0 |
tests/test_converters/test_sdist.py | OliverHofkens/dephell | 1,880 | 3284968 | # built-in
from pathlib import Path
# project
from dephell.converters import SDistConverter
def test_load_deps(requirements_path: Path):
path = requirements_path / 'sdist.tar.gz'
root = SDistConverter().load(path)
needed = {'attrs', 'cached-property', 'packaging', 'requests'}
assert {dep.name for de... | 2 | 0 | 0 | 0 | 2 | 0 |
app/sparsecoding/script/run_local.py | daiwei89/wdai_petuum_public | 370 | 3284994 | <gh_stars>100-1000
#!/usr/bin/env python
"""
This script starts a process locally, using <client-id> <hostfile> as inputs.
"""
import os
from os.path import dirname
from os.path import join
import time
import sys
if len(sys.argv) != 3:
print "usage: %s <client-id> <hostfile>" % sys.argv[0]
sys.exit(1)
# Please ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/push/github_pull_request_test.py | briandcho/all-repos | 350 | 3285000 | <gh_stars>100-1000
import json
import subprocess
import pytest
from all_repos.push import github_pull_request
from testing.auto_namedtuple import auto_namedtuple
from testing.git import init_repo
@pytest.fixture
def fake_github_repo(tmpdir):
# hax: make the repo end with :repo/slug so it "looks" like a github r... | 0 | 0 | 0 | 0 | 0 | 0 |
certificate_engine/tests/test_client_certificate.py | repleo/bounca | 142 | 3285034 | <reponame>repleo/bounca
import arrow
from cryptography.hazmat.primitives import serialization
from cryptography.x509 import ExtensionOID, RFC822Name
# noinspection PyUnresolvedReferences
from cryptography.x509.extensions import ExtensionNotFound
# noinspection PyUnresolvedReferences
from cryptography.x509.oid import ... | 0 | 0 | 0 | 0 | 0 | 0 |
AzureEnhancedMonitor/ext/aem.py | shridpant/azure-linux-extensions | 266 | 3285043 | #
# Copyright 2014 Microsoft 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 applicable law or agreed to ... | 5 | 199 | 5 | 10 | 219 | 0 |
SimTracker/TrackerMaterialAnalysis/python/randomNumberGeneratorService_cfi.py | ckamtsikis/cmssw | 852 | 3285047 | <reponame>ckamtsikis/cmssw
# The following comments couldn't be translated into the new config version:
# Random number generators for (optional) modules up to trackingMaterialProducer
import FWCore.ParameterSet.Config as cms
RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
... | 0 | 0 | 0 | 0 | 0 | 0 |
qa/L0_simple_ensemble/ensemble_test.py | jiweibo/triton_server | 2,159 | 3285052 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... | 0 | 1 | 0 | 0 | 1 | 0 |
utils/preprocessing.py | thatrobotdev/Image-Caption-Generator | 187 | 3285065 | import numpy as np
import os
from pickle import dump
import string
from tqdm import tqdm
from utils.model import CNNModel
from keras.preprocessing.image import load_img, img_to_array
from datetime import datetime as dt
# Utility function for pretty printing
def mytime(with_date: bool=False) -> object:
_str = ''
if w... | 1 | 3 | 0 | 0 | 4 | 0 |
tests/test_tools.py | baffolobill/django-split-settings | 826 | 3285070 | <reponame>baffolobill/django-split-settings<gh_stars>100-1000
import os
import pytest
import six
from split_settings.tools import include
_FIXTURE_VALUE = 'FIXTURE_VALUE'
def test_missing_file_error(scope):
"""This test covers the IOError, when file does not exist."""
with pytest.raises(IOError, match='doe... | 0 | 0 | 0 | 0 | 0 | 0 |
orochi/website/management/commands/symbols_sync.py | garanews/orochi | 121 | 3285083 | from __future__ import annotations
import os
import requests
import shutil
from zipfile import ZipFile
from volatility3 import framework
from pathlib import Path
from glob import glob
from django.core.management.base import BaseCommand
from django.conf import settings
import urllib3
urllib3.disable_warnings(urllib3.... | 1 | 3 | 1 | 2 | 7 | 0 |
guillotina/db/storages/utils.py | rboixaderg/guillotina | 173 | 3285089 | from __future__ import annotations
def clear_table_name(table_name) -> object:
if "." in table_name:
_, table_name = table_name.split(".", 1) # i.e.: 'public.objects' -> 'objects'
return table_name
def get_table_definition(name, schema, primary_keys: object | None=None) -> object:
primary_keys = ... | 1 | 3 | 0 | 1 | 5 | 0 |
payshare/purchases/admin.py | cb109/payshare | 184 | 3285108 | <reponame>cb109/payshare<filename>payshare/purchases/admin.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth.models import User
from django.utils.safestring import mark_safe
from payshare.purchases.models import Collective
from payshar... | 0 | 0 | 0 | 0 | 0 | 0 |
test/testLanguages.py | jackhj000/lizard | 1,255 | 3285112 | <gh_stars>1000+
import unittest
from lizard_languages import get_reader_for, CLikeReader, JavaReader, ObjCReader, JavaScriptReader, ScalaReader, GDScriptReader
class TestLanguageChooser(unittest.TestCase):
def test_not_case_sensitive(self):
self.assertEqual(CLikeReader, get_reader_for("a.Cpp"))
def ... | 0 | 0 | 0 | 0 | 0 | 0 |
stog/data/dataset_readers/abstract_meaning_representation.py | sfillwo/stog | 172 | 3285124 | <filename>stog/data/dataset_readers/abstract_meaning_representation.py
from typing import Dict, List, Tuple
import logging
import os
import json
from overrides import overrides
# NLTK is so performance orientated (ha ha) that they have lazy imports. Why? Who knows.
from stog.data.dataset_readers.amr_parsing.io import... | 0 | 0 | 0 | 0 | 0 | 0 |
thermo/activity.py | andr1976/thermo | 380 | 3285144 | # -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, 2017, 2018, 2019, 2020 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
... | 0 | 0 | 0 | 0 | 0 | 1 |
torch/distributed/elastic/timer/__init__.py | Hacky-DH/pytorch | 60,067 | 3285156 | <reponame>Hacky-DH/pytorch
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
"""
Expiration timers are set up on the same process as the agent and
used from your s... | 0 | 0 | 0 | 0 | 0 | 0 |
datasets/phrasecut_utils/iou.py | bonejay/mdetr | 601 | 3285177 | # Copyright (c) <NAME> & <NAME>. Licensed under the Apache License 2.0. All Rights Reserved
from __future__ import annotations
"""Direct import from https://github.com/ChenyunWu/PhraseCutDataset/blob/b15fb71a1ba692ea3186498f1390e8854b681a66/utils/iou.py
"""
from .data_transfer import *
# IoU function
def iou_box(box... | 20 | 7 | 0 | 0 | 27 | 0 |
stonesoup/reader/tests/test_image.py | io8ex/Stone-Soup | 157 | 3285178 | <gh_stars>100-1000
# -*- coding: utf-8 -*
import pytest
import numpy as np
from PIL import Image
from stonesoup.reader.image import SingleImageFileReader
@pytest.fixture()
def img_gt_filename(tmpdir):
img_filename = tmpdir.join("test.png")
imarray = np.random.rand(100, 100, 3) * 255
im = Image.fromarray(... | 0 | 0 | 0 | 0 | 0 | 0 |
bertkpe/dataloader/loader_utils.py | thunlp/BERT-KPE | 274 | 3285186 | <filename>bertkpe/dataloader/loader_utils.py
import os
import json
import codecs
import logging
import unicodedata
from tqdm import tqdm
from ..constant import UNK_WORD, BOS_WORD, EOS_WORD
from nltk.stem.porter import PorterStemmer
from torch.utils.data import Dataset
stemmer = PorterStemmer()
from .bert2span_dataload... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/granular/test_white_spaces.py | neomatrix369/nlp_profiler | 221 | 3285262 | import numpy as np
import pytest
from nlp_profiler.constants import NaN
from nlp_profiler.granular_features.chars_spaces_and_whitespaces \
import count_chars, count_whitespaces, count_characters_excluding_whitespaces, \
gather_repeated_whitespaces, count_repeated_whitespaces # noqa
text_with_a_number = '2833... | 7 | 0 | 0 | 0 | 7 | 0 |
symposion/wsgi.py | azkarmoulana/pycon | 154 | 3285279 | <gh_stars>100-1000
# This is used for staging & production
import os
import sys
settings = None
if 'IS_PRODUCTION' in os.environ:
# We're on a deployed server if the var "IS_PRODUCTION" exists, with any value.
# The value tells us if we're production or staging, so we
# can use the appropriate settings. Th... | 0 | 0 | 0 | 0 | 0 | 0 |
pincer/objects/message/embed.py | Arthurdw/Pincer | 118 | 3285283 | <reponame>Arthurdw/Pincer<gh_stars>100-1000
# Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from __future__ import annotations
from dataclasses import dataclass, field
from datetime import datetime
from re import match
from typing import TYPE_CHECKING
from ...excepti... | 0 | 0 | 0 | 0 | 0 | 0 |
concordia/migrations/0042_auto_20200316_1623.py | juliecentofanti172/juliecentofanti.github.io | 134 | 3285297 | <gh_stars>100-1000
# Generated by Django 2.2.10 on 2020-03-16 20:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("concordia", "0041_auto_20200203_1351"),
]
operations = [
migrations.AddField(
model_name="campaign",
... | 0 | 0 | 0 | 0 | 0 | 0 |
pyNastran/op2/tables/oes_stressStrain/random/oes_rods.py | luzpaz/pyNastran | 293 | 3285311 | <reponame>luzpaz/pyNastran
from typing import List
import numpy as np
from numpy import zeros, searchsorted, allclose
from pyNastran.op2.tables.oes_stressStrain.real.oes_objects import (
StressObject, StrainObject, OES_Object)
from pyNastran.op2.result_objects.op2_objects import get_times_dtype
from pyNastran.f06.... | 0 | 0 | 0 | 0 | 0 | 0 |
cpmpy/social_golfer1.py | hakank/hakank | 279 | 3285331 | <gh_stars>100-1000
"""
Social golfer problem in cpmpy.
CSPLib problem 10:
http://www.csplib.org/prob/prob010/index.html
'''
The coordinator of a local golf club has come to you with the following
problem. In her club, there are 32 social golfers, each of whom play golf
once a week, and always in groups of 4. She wou... | 0 | 0 | 0 | 0 | 0 | 0 |
cocotb_build_libs.py | lavanyajagan/cocotb | 350 | 3285360 | <reponame>lavanyajagan/cocotb
# Copyright cocotb contributors
# Licensed under the Revised BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-3-Clause
import distutils
import logging
import os
import subprocess
import sys
import sysconfig
import textwrap
from distutils.ccompiler import get_default_co... | 0 | 0 | 0 | 0 | 0 | 0 |
3.image_classification/cifar_tf/vgg_tf.py | zy199529/PaddlePaddle_code | 589 | 3285368 | # -*- coding: utf-8 -*-
"""
Created by huxiaoman 2017.12.12
vgg_tf.py:训练tensorflow版的vgg16网络,对cifar-10shuju进行分类
"""
from datetime import datetime
import math
import time
import tensorflow as tf
import cifar10
batch_size = 16
num_batches = 100
# 定义函数对卷积层进行初始化
# input_op : 输入数据
# name : 该卷积层的名字,用tf.name_scope()来命名
# kh... | 0 | 4 | 0 | 0 | 4 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.