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 |
|---|---|---|---|---|---|---|---|---|---|---|
moto/swf/models/activity_type.py | jonnangle/moto-1 | 5,460 | 3204295 | from .generic_type import GenericType
class ActivityType(GenericType):
@property
def _configuration_keys(self) -> list[str]:
return [
"defaultTaskHeartbeatTimeout",
"defaultTaskScheduleToCloseTimeout",
"defaultTaskScheduleToStartTimeout",
"defaultTaskSta... | 0 | 2 | 0 | 0 | 2 | 0 |
timeboard/tests/test_timeboard.py | mmamaev/timeboard | 120 | 3204331 | import timeboard as tb
import datetime
import pytest
import pandas as pd
class TestVersion(object):
def test_version(self):
version = tb.read_from('VERSION.txt')
assert version == tb.__version__
class TestTBConstructor(object):
def test_tb_constructor_trivial(self):
clnd = tb.Timeboa... | 0 | 2 | 0 | 0 | 2 | 0 |
tricks/fast_export/python/fast_export.py | jingtaoh/USD-Cookbook | 332 | 3204365 | <reponame>jingtaoh/USD-Cookbook<gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# IMPORT STANDARD LIBRARIES
import collections
import time
# IMPORT THIRD-PARTY LIBRARIES
from pxr import Sdf, Usd
ITERATIONS = 1000
PATHS = frozenset((
"/BasePrim",
"/BasePrim/InnerPrim",
"/BasePrim/InnerPrim... | 0 | 0 | 0 | 0 | 0 | 0 |
yolk/parser.py | KerasKorea/YOLK_ObjectDetector | 124 | 3204382 | import argparse
def parse_args(args) -> object:
""" Parse the arguments.
"""
parser = argparse.ArgumentParser(description='Simple training script for training a RetinaNet network.')
subparsers = parser.add_subparsers(help='Arguments for specific dataset types.', dest='dataset_type')
subparsers.... | 0 | 2 | 0 | 0 | 2 | 0 |
recipes/Python/577662_ASIO/recipe-577662.py | tdiprima/code | 2,023 | 3204403 | from __future__ import annotations
import collections
import errno
import functools
import select
import socket
'''Asynchronous socket service inspired by the basic design of Boost ASIO.
This service currently supports TCP sockets only, and supports asynchronous
versions of common client operations (connect, read, wr... | 4 | 17 | 0 | 10 | 31 | 0 |
tests/unit/compiler/port_spec/init_test.py | gamechanger/dusty | 421 | 3204426 | from mock import patch
from ....testcases import DustyTestCase
from dusty.compiler.port_spec import (_docker_compose_port_spec, _nginx_port_spec,
_hosts_file_port_spec, get_port_spec_document,
ReusedHostFullAddress, ReusedStreamHostPort)
clas... | 0 | 0 | 0 | 0 | 0 | 0 |
data_collection/gazette/spiders/rn_sao_goncalo_do_amarante.py | kaiocp/querido-diario | 454 | 3204450 | <gh_stars>100-1000
import datetime
import re
import dateparser
import scrapy
from gazette.items import Gazette
from gazette.spiders.base import BaseGazetteSpider
class SpSaoGoncaloDoAmarante(BaseGazetteSpider):
"""
<NAME> has a primary url with
recent gazettes (https://saogoncalo.rn.gov.br/diario-oficia... | 0 | 0 | 0 | 0 | 0 | 0 |
stepik_lesson/course_512/24470_step_16/main.py | DazEB2/SimplePyScripts | 117 | 3204459 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
"""
Примечание:
Эта задача является дополнительной, то есть ее решение не принесет вам баллы.
Задача сложнее остальных задач из этого раздела, и идея ее решения выходит за рамки простого понимания регулярных
выражений как средства задания шаблона... | 0 | 0 | 0 | 0 | 0 | 0 |
tracardi/service/wf/domain/__init__.py | bytepl/tracardi | 153 | 3204460 | __all__ = [
'flow',
'entity',
'named_entity',
'flow_history',
'flow_graph_data'
]
| 0 | 0 | 0 | 0 | 0 | 0 |
wrappers/python/tests/cache/test_purge_cred_def_cache.py | absltkaos/indy-sdk | 636 | 3204482 | <gh_stars>100-1000
import json
import pytest
from indy import cache
@pytest.mark.asyncio
async def test_purge_schema_cache_works(wallet_handle):
options_json = {
"maxAge": -1,
}
await cache.purge_cred_def_cache(wallet_handle, json.dumps(options_json))
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_min_size.py | martinlombana/pywebview | 3,093 | 3204521 | <reponame>martinlombana/pywebview
import webview
from .util import run_test
def test_min_size():
window = webview.create_window('Min size test', 'https://www.example.org', min_size=(400, 200))
run_test(webview, window)
| 0 | 0 | 0 | 0 | 0 | 0 |
Day_1_Scientific_Python/snippets/02-pandas_introduction47.py | Morisset/python-workshop | 183 | 3204554 | df['Age'].hist() | 0 | 0 | 0 | 0 | 0 | 0 |
firmware/coreboot/3rdparty/chromeec/extra/tigertool/ecusb/__init__.py | fabiojna02/OpenCellular | 627 | 3204565 | # Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__all__ = ['tiny_servo_common', 'stm32usb', 'stm32uart', 'pty_driver']
| 0 | 0 | 0 | 0 | 0 | 0 |
docsource/source/auto_benchmark/localization.py | CAOR-MINES-ParisTech/ukfm | 128 | 3204581 | """
********************************************************************************
2D Robot Localization - Benchmark
********************************************************************************
Goals of this script:
- implement different UKFs on the 2D robot localization example.
- design the Extended K... | 0 | 0 | 0 | 0 | 0 | 0 |
alibi_detect/cd/pytorch/utils.py | sugatoray/alibi-detect | 1,227 | 3204597 | from torch import nn
from typing import Callable
def activate_train_mode_for_dropout_layers(model: Callable) -> Callable:
model.eval() # type: ignore
n_dropout_layers = 0
for module in model.modules(): # type: ignore
if isinstance(module, nn.Dropout):
module.train()
n_dr... | 1 | 1 | 0 | 0 | 2 | 0 |
data/synth_dataset.py | Arka161/cnngeometric_pytorch | 262 | 3204600 | from __future__ import annotations
from __future__ import print_function, division
import torch
import os
from os.path import exists, join, basename
from skimage import io
import pandas as pd
import numpy as np
from torch.utils.data import Dataset
from geotnf.transformation import GeometricTnf
from torch.autograd impor... | 9 | 2 | 0 | 0 | 11 | 0 |
examples/use_before_parse_variable_fixed.py | KloseLC/python-gflags | 218 | 3204602 | #!/usr/bin/env python
"""Proposed fix."""
import os
import unittest
import gflags
FLAGS = gflags.FLAGS
def _get_output_dir() -> object:
return os.path.join(FLAGS.my_dir, 'my_subdir')
class MyTest(googletest.TestCase):
def setUp(self):
self.filename = os.path.join(_get_output_dir(), 'filename')
| 0 | 1 | 0 | 0 | 1 | 0 |
fabtools/require/docker.py | timgates42/fabtools | 308 | 3204632 | """
Docker
====
This module provides a docker tools.
"""
from fabric.api import env
from fabtools.system import UnsupportedFamily, distrib_family
from fabtools.utils import run_as_root
from fabtools import files
def core():
"""
Require the docker core installation.
Example::
from fabtools im... | 0 | 0 | 0 | 0 | 0 | 0 |
libreasr/lib/models.py | johnpaulbin/LibreASR | 680 | 3204705 | <filename>libreasr/lib/models.py
"""
Common models including RNN-Transducer implementation.
"""
import operator
import time
import random
from queue import PriorityQueue
import torch
from torch import nn
import torch.nn.functional as F
import numpy as np
from fastai2.vision.models.xresnet import xresnet18
from fast... | 0 | 0 | 0 | 0 | 0 | 0 |
tods/sk_interface/detection_algorithm/CBLOF_skinterface.py | ZhuangweiKang/tods | 544 | 3204724 | import numpy as np
from ..base import BaseSKI
from tods.detection_algorithm.PyodCBLOF import CBLOFPrimitive
class CBLOFSKI(BaseSKI):
def __init__(self, **hyperparams):
super().__init__(primitive=CBLOFPrimitive, **hyperparams)
self.fit_available: bool = True
self.predict_available: bool = True
self.produce_av... | 0 | 0 | 0 | 3 | 3 | 0 |
egs/librispeech/ASR/conformer_ctc/test_transformer.py | TIFOSI528/icefall | 173 | 3204775 | #!/usr/bin/env python3
# Copyright 2021 Xiaomi Corp. (authors: <NAME>)
#
# See ../../../../LICENSE for clarification regarding multiple 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... | 0 | 0 | 0 | 0 | 0 | 0 |
old/main/kpp/ae_conv_mnist_mc.py | soyoung9306/-3-keras | 200 | 3204779 | #########################################################
# Convolutional layer based AE with MNIST, Models/Class
#########################################################
###########################
# AE 모델링
###########################
from keras import layers, models
def Conv2D(filters, kernel_size, padding: str='... | 3 | 1 | 0 | 0 | 4 | 0 |
weld-python/weld/grizzly/core/indexes/column.py | tustvold/weld | 2,912 | 3204788 | from __future__ import annotations
"""
Index used for access columns in Grizzly.
"""
from weld.grizzly.core.indexes.base import Index
class ColumnIndex(Index):
"""
An index used for columns in a Grizzly DataFrame.
Each index value is a Python object. For operations between two DataFrames
with the sa... | 1 | 4 | 0 | 1 | 6 | 0 |
kloppy/infra/serializers/event/sportec/__init__.py | cedrickrause/kloppy | 176 | 3204815 | <filename>kloppy/infra/serializers/event/sportec/__init__.py
from .serializer import SportecEventSerializer
| 0 | 0 | 0 | 0 | 0 | 0 |
netdev/vendors/ubiquiti/__init__.py | maliciousgroup/netdev | 199 | 3204828 | from .ubiquity_edge import UbiquityEdgeSwitch
__all__ = ["UbiquityEdgeSwitch"]
| 0 | 0 | 0 | 0 | 0 | 0 |
Lesson06/number_of_disc_intersections.py | nawang87/codility_lessons | 114 | 3204872 | """
Task:NumberOfDiscIntersections
Compute the number of intersections in a sequence of discs.
We draw N discs on a plane. The discs are numbered from 0 to N − 1. An array A of N non-negative integers, specifying the radiuses of the discs, is given. The J-th disc is drawn with its center at (J, 0) and radius A[J].
We... | 0 | 1 | 0 | 0 | 1 | 0 |
final/jddc/interface.py | caoxu915683474/jddc_solution_4th | 256 | 3204910 | <gh_stars>100-1000
# coding: utf-8
"""
接口模块
====================================================================
"""
class BaseIR(object):
"""IR基类"""
def __init__(self, name=None):
self.name = name
def get_candidates(self, q_tokens, top=10):
"""获取候选答案
:param q_tokens: list of st... | 0 | 0 | 0 | 0 | 0 | 0 |
tiktokpy/client/trending.py | sourcery-ai-bot/tiktokpy | 324 | 3204911 | <filename>tiktokpy/client/trending.py
import asyncio
from typing import List
import pyppeteer
from tqdm import tqdm
from tiktokpy.client import Client
from tiktokpy.utils.client import catch_response_and_store
from tiktokpy.utils.logger import logger
class Trending:
def __init__(self, client: Client):
s... | 0 | 0 | 0 | 0 | 0 | 0 |
caltrain/get_ece_bias.py | DionysisChristopoulos/google-research | 23,901 | 3204946 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 2 | 1 | 0 | 0 | 3 | 0 |
src/python/pants/option/option_value_container_test.py | yoav-orca/pants | 1,806 | 3204963 | <filename>src/python/pants/option/option_value_container_test.py
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import unittest
import pytest
from pants.option.option_value_container import OptionValueContainerBuilder
from pants.opti... | 0 | 0 | 0 | 0 | 0 | 0 |
build_files/cmake/project_info.py | noorbeast/blender | 365 | 3204989 | #!/usr/bin/env python3
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This... | 1 | 14 | 0 | 0 | 15 | 0 |
scale/data/test/dataset/test_dataset.py | kaydoh/scale | 121 | 3204990 | <reponame>kaydoh/scale<filename>scale/data/test/dataset/test_dataset.py
from __future__ import unicode_literals
import django
from django.test.testcases import TestCase
from data.data.data import Data
from data.data.exceptions import InvalidData
from data.data.value import FileValue, JsonValue
from data.interface.pa... | 0 | 0 | 0 | 0 | 0 | 0 |
analysis_tools/definitions.py | GoSecure/php7-opcache-override | 279 | 3204998 | <filename>analysis_tools/definitions.py
#!/usr/bin/env python
# Copyright (c) 2016 GoSecure Inc.
OPCODES = {
0 : "NOP",
1 : "ADD",
2 : "SUB",
3 : "MUL",
4 : "DIV",
5 : "MOD",
6 : "SL",
7 : "SR",
8 : "CONCAT",
9 : "BW_OR",
10 : "BW_AND",
11 : "BW_XOR",
12 : "BW_NOT",... | 0 | 0 | 0 | 0 | 0 | 0 |
deprecated/demo/tutorial_6/6_object_tracking/config.py | mfkiwl/GAAS | 2,111 | 3205018 | K = [
[376., 0., 376.],
[0., 376., 240.],
[0., 0., 1.]
]
resolution = (752, 480)
left_topic='/gi/simulation/left/image_raw'
right_topic='/gi/simulation/right/image_raw'
object_position_topic='/track_rect_pub'
init_rect_img_topic = '/gi/simulation/left/image_raw' | 0 | 0 | 0 | 0 | 0 | 0 |
geofree/models/transformers/warpgpt.py | phygitalism/geometry-free-view-synthesis | 241 | 3205040 | from __future__ import annotations
import torch
import time
import torch.nn.functional as F
import pytorch_lightning as pl
from torch.optim.lr_scheduler import LambdaLR
from geofree.main import instantiate_from_config
class WarpTransformer(pl.LightningModule):
"""This one relies on WarpGPT, where the warper hand... | 27 | 15 | 0 | 1 | 43 | 0 |
observations/r/epilepsy.py | hajime9652/observations | 199 | 3205061 | <gh_stars>100-1000
# -*- 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 epilepsy(path):
"""Epilepsy Attacks Data Set
Da... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/simple_rpc_client.py | ZygusPatryk/amqpstorm | 140 | 3205084 | """
A simple RPC Client.
"""
import amqpstorm
from amqpstorm import Message
class FibonacciRpcClient(object):
def __init__(self, host, username, password):
"""
:param host: RabbitMQ Server e.g. localhost
:param username: RabbitMQ Username e.g. guest
:param password: <PASSWORD>MQ P... | 0 | 2 | 0 | 5 | 7 | 0 |
etl/parsers/etw/Microsoft_AppV_Client_StreamingUX.py | IMULMUL/etl-parser | 104 | 3205105 | <reponame>IMULMUL/etl-parser
# -*- coding: utf-8 -*-
"""
Microsoft-AppV-Client-StreamingUX
GUID : 28cb46c7-4003-4e50-8bd9-442086762d12
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/adapters/__init__.py | timfjord/sublime_debugger | 225 | 3205118 | from .mock import Mock
from .lldb import LLDB
from .gdb import GDB
from .go import Go
from .php import PHP
from .python import Python
from .ruby import Ruby
from .node import Node
from .chrome import Chrome
from .firefox import Firefox
| 0 | 0 | 0 | 0 | 0 | 0 |
django_th/my_services.py | Leopere/django-th | 1,069 | 3205147 | <filename>django_th/my_services.py
# coding: utf-8
from django.conf import settings
class MyService(object):
"""
build the name of the package, module, class
on that model:
th_<service>.my_<service>.Service<Service>
"""
@staticmethod
def full_name(package):
service_nam... | 0 | 0 | 0 | 0 | 0 | 0 |
lite/tests/unittest_py/pass/test_squeeze2_matmul_fuse_pass.py | 714627034/Paddle-Lite | 808 | 3205170 | # 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... | 2 | 3 | 0 | 0 | 5 | 0 |
frameworks/Python/quart/hypercorn_conf.py | xsoheilalizadeh/FrameworkBenchmarks | 5,300 | 3205197 | <reponame>xsoheilalizadeh/FrameworkBenchmarks<filename>frameworks/Python/quart/hypercorn_conf.py
import multiprocessing
import os
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count()
if _is_travis:
workers = 2
bind = ["0.0.0.0:8080"]
keep_alive_timeout = 120
worker_class = "uvloo... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/drawBotScripts/oval.py | andyclymer/drawbot | 302 | 3205198 | import drawBot
drawBot.size(200, 200)
for i in range(14):
f = i / 14.0
drawBot.fill(1-f, 1 - f, 0)
drawBot.oval(10, 10, 50, 50)
drawBot.translate(10, 10) | 0 | 0 | 0 | 0 | 0 | 0 |
marbles/core/marbles/__main__.py | JonathanGrant/marbles | 109 | 3205209 | #
# Copyright (c) 2018 Two Sigma Open Source, LLC
#
# 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 to use, copy, modify, m... | 0 | 0 | 0 | 0 | 0 | 0 |
internal/common/test/expand_into_runfiles_test.bzl | Aghassi/rules_nodejs | 645 | 3205234 | <filename>internal/common/test/expand_into_runfiles_test.bzl
"Unit tests for //internal/common:expand_into_runfiles.bzl"
load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest")
load("//internal/common:expand_into_runfiles.bzl", "expand_location_into_runfiles")
def _impl(ctx):
env = unittest.begin(ctx)
... | 0 | 0 | 0 | 0 | 0 | 0 |
39/demo4.py | dunjin/DataAnalysisInAction | 656 | 3205260 | # -*- coding: utf-8 -*-
# 信用卡违约率分析
import matplotlib
import pandas as pd
from sklearn.model_selection import learning_curve, train_test_split, GridSearchCV
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import Pipeline
from sklearn.metrics import accuracy_score
from sklearn.svm import SVC
from s... | 1 | 1 | 0 | 0 | 2 | 0 |
python/233 Number of Digit One.py | allandproust/leetcode-share | 156 | 3205261 | '''
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.
For example:
Given n = 13,
Return 6, because digit 1 occurred in the following numbers: 1, 10, 11, 12, 13.
'''
class Solution(object):
def countDigitOne(self, n) -> object:
"""
... | 0 | 1 | 0 | 0 | 1 | 0 |
anuga/parallel/tests/test_parallel_riverwall.py | GeoscienceAustralia/anuga_core | 136 | 3205264 | <reponame>GeoscienceAustralia/anuga_core<gh_stars>100-1000
"""
Test parallel and sequential results of riverwall procedure
"""
from __future__ import print_function
#------------------------------------------------------------------------------
# Import necessary modules
#---------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/domain/AlipayCommerceAbntaskModifyModel.py | antopen/alipay-sdk-python-all | 213 | 3205343 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.OperateTask import OperateTask
class AlipayCommerceAbntaskModifyModel(object):
def __init__(self):
self._operate_task_list: None = ... | 0 | 6 | 0 | 4 | 10 | 0 |
esphome/components/nextion/sensor/__init__.py | OttoWinter/esphomeyaml | 249 | 3205353 | <reponame>OttoWinter/esphomeyaml
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor
from esphome.const import (
CONF_ID,
CONF_COMPONENT_ID,
)
from .. import nextion_ns, CONF_NEXTION_ID
from ..base_component import (
setup_component_core_,
CONFIG_S... | 0 | 0 | 0 | 0 | 0 | 0 |
config.py | yacy/yacybot | 961 | 3205363 | # --- Configuration for YaCyBot ---
# vim: ts=2 sw=2 expandtab
# ----------------------------------------------------------------------------
# "THE PIZZA-WARE LICENSE" (derived from "THE BEER-WARE LICENCE"):
# <<EMAIL>> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff.... | 0 | 0 | 0 | 0 | 0 | 0 |
src/adafruit_blinka/board/hardkernel/odroidxu4.py | Jcc99/Adafruit_Blinka | 294 | 3205394 | """Pin definitions for the Odroid XU4."""
from adafruit_blinka.microcontroller.samsung.exynos5422 import pin
SDA = SDA1 = pin.I2C1_SDA
SCL = SCL1 = pin.I2C1_SCL
SDA5 = pin.I2C5_SDA
SCL5 = pin.I2C5_SCL
SCLK = pin.SPI1_SCLK
MOSI = pin.SPI1_MOSI
MISO = pin.SPI1_MISO
SPI_CS0 = pin.SPI1_CS0
"""physical pin number(XU4 Sh... | 0 | 0 | 0 | 0 | 0 | 0 |
menpo/transform/tcoords.py | apapaion/menpo | 311 | 3205397 | <gh_stars>100-1000
import numpy as np
from menpo.transform import Homogeneous, Scale
def tcoords_to_image_coords(image_shape):
r"""
Returns a :map:`Homogeneous` transform that converts [0,1]
texture coordinates (tcoords) used on :map:`TexturedTriMesh`
instances to image coordinates, which behave just ... | 0 | 0 | 0 | 0 | 0 | 0 |
env/Lib/site-packages/OpenGL/GLES2/KHR/blend_equation_advanced.py | 5gconnectedbike/Navio2 | 210 | 3205419 | '''OpenGL extension KHR.blend_equation_advanced
This module customises the behaviour of the
OpenGL.raw.GLES2.KHR.blend_equation_advanced to provide a more
Python-friendly API
Overview (from the spec)
This extension adds a number of "advanced" blending equations that can be
used to perform new color blending ope... | 0 | 1 | 0 | 0 | 1 | 0 |
dataset/dist_dataset.py | zengyan-97/X-VLM | 107 | 3205431 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Multi-Grained Vision Language Pre-Training: Aligning Texts with Visual Concepts (https://arxiv.org/abs/2111.08276)
# Github: https://github.com/zengyan-97/X-VLM
# Copyright (c) 2022, ByteDance Inc.
# All rights reserved.
import sys
from typing import List, Any
import war... | 8 | 2 | 0 | 0 | 10 | 0 |
koku/masu/exceptions.py | rubik-ai/koku | 157 | 3205434 | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Masu Processor Exceptions."""
class MasuProcessingError(Exception):
"""Masu Processing Error."""
class MasuProviderError(Exception):
"""Masu Provider Error."""
class MasuConfigurationError(Exception):
"""Masu Configuration Erro... | 0 | 0 | 0 | 0 | 0 | 0 |
pysph/examples/rigid_body/dam_break3D_sph.py | nauaneed/pysph | 293 | 3205438 | """3D Dam Break Over a block of text spelling "SPH". (8 hours)
This example demonstrates how to setup a rigid body motion and couple it to the
fluid motion.
"""
from os.path import dirname, join
import numpy as np
from pysph.examples._db_geometry import DamBreak3DGeometry
from pysph.base.kernels import WendlandQuint... | 0 | 3 | 0 | 0 | 3 | 0 |
chrome/content/papermachines/processors/lib/geodict/geodict_lib.py | papermachines/papermachines | 134 | 3205477 | # Geodict
# Copyright (C) 2010 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Thi... | 1 | 6 | 2 | 2 | 11 | 0 |
tensorflow_examples/lite/model_maker/core/api/deprecated_api.py | duy-maimanh/examples | 6,484 | 3205492 | # Copyright 2021 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... | 0 | 0 | 0 | 0 | 0 | 0 |
Trakttv.bundle/Contents/Libraries/Shared/plugin/core/backup/sources/__init__.py | disrupted/Trakttv.bundle | 1,346 | 3205496 | from plugin.core.backup.sources.database import DatabaseBackupSource
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_normalise_availability.py | ecmwf/climetlab | 182 | 3205501 | <gh_stars>100-1000
#!/usr/bin/env python3
# (C) Copyright 2020 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by ... | 0 | 0 | 0 | 0 | 0 | 0 |
test/unittests/test_core.py | usnistgov/corr-sumatra | 143 | 3205512 | """
Unit tests for the sumatra.core module
"""
import unittest
from sumatra.core import _Registry as Registry
class TestRegistry(unittest.TestCase):
def setUp(self):
self.registry = Registry.__new__(Registry) # hack to create new instance for each test
self.registry.__init__()
class Compo... | 0 | 0 | 3 | 0 | 3 | 0 |
octavia/tests/unit/cmd/test_health_checker.py | zhangi/octavia | 129 | 3205522 | # Copyright 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 0 | 0 | 0 | 0 | 0 | 0 |
questions/57185927/57185927-1/wizardUI/wizard.py | LoicGRENON/stackoverflow | 302 | 3205530 | <filename>questions/57185927/57185927-1/wizardUI/wizard.py
import os
import sys
from PySide2 import QtCore, QtWidgets, QtUiTools
# https://stackoverflow.com/a/42615559/6622587
if getattr(sys, 'frozen', False):
# If the application is run as a bundle, the pyInstaller bootloader
# extends the sys module by a fl... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/Olympics/olympics_tea.py | rrrrrrockpang/tea-lang | 218 | 3205540 | import tea
'''
Want to see if Wrestling is correlated with greater athlete Weight
than Swimming, and if Female athletes have a lower Weight than
Male athletes.
'''
data_path = "./athlete_events_cleaned_weight.csv"
variables = [
{
'name': 'ID',
'data type': 'ratio'
},
{
'name': '... | 0 | 0 | 0 | 0 | 0 | 0 |
ogb_lsc/mag/config.py | feifzhou/deepmind-research | 10,110 | 3205549 | # Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 1 | 1 | 0 | 0 | 2 | 0 |
Portfolio_Strategies/main_indicators_one_graph.py | vhn0912/Finance | 441 | 3205593 | <reponame>vhn0912/Finance
#import relevant libraries
import yfinance as yf
import datetime as dt
import pandas as pd
from pandas_datareader import data as pdr
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import matplotlib.ticker as mticker
import datetime as datetime
import numpy as np
from mplfina... | 0 | 0 | 0 | 0 | 0 | 0 |
roboticstoolbox/mobile/DubinsPlanner.py | tassos/robotics-toolbox-python | 749 | 3205647 | from __future__ import annotations
"""
Dubins path planner sample code
author <NAME>(@Atsushi_twi)
The MIT License (MIT)
Copyright (c) 2016 - 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the... | 3 | 11 | 0 | 0 | 14 | 0 |
WebMirror/OutputFilters/Booksie/BooksieSeriesPageFilter.py | awesome-archive/ReadableWebProxy | 193 | 3205656 | <filename>WebMirror/OutputFilters/Booksie/BooksieSeriesPageFilter.py
import WebMirror.OutputFilters.FilterBase
import WebMirror.OutputFilters.util.MessageConstructors as msgpackers
from WebMirror.OutputFilters.util.TitleParsers import extractTitle
import bs4
import re
import time
from settings import BOOKSIE_REQ... | 0 | 0 | 0 | 0 | 0 | 0 |
.deprecated/mod_hangar_extended/mod_hangar_extended121.py | angelsoft1/spoter-mods | 150 | 3205666 | # -*- coding: utf-8 -*-
# Embedded file name: hangar_extended.py
#scripts/client/gui/ClientHangarSpace.py
#_VehicleAppearance
"""Hangar spawn mod by spoter"""
import BigWorld
import ResMgr
import Math
import game
from gui import ClientHangarSpace
from CurrentVehicle import _CurrentVehicle
from gui.shared import g_ite... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | SilverQ/naive-bayes-applicant-classifier | 170 | 3205669 | <filename>setup.py<gh_stars>100-1000
#!/usr/bin/env python
try:
from setuptools.core import setup
except ImportError:
from distutils.core import setup
setup(name='naiveBayesClassifier',
version='0.1.3.1',
license='MIT',
description='yet another general purpose naive bayesian classifier',
... | 0 | 0 | 0 | 0 | 0 | 0 |
nbtutor/ipython/models/heap_object.py | vincentxavier/nbtutor | 423 | 3205670 | <reponame>vincentxavier/nbtutor
from typing import Dict, List, Optional, Union, Literal
from ..models.serializable import Serializable
from .unique_identifier import UniqueIdentifier
RenderType = Literal['basic', 'sequence', 'kvp']
class RenderOptions(Serializable):
def __init__(self, concat: Optional[bool] = F... | 0 | 0 | 0 | 0 | 0 | 0 |
parsel/__init__.py | Nirzak/parsel | 787 | 3205712 | """
Parsel lets you extract text from XML/HTML documents using XPath
or CSS selectors
"""
__author__ = "Scrapy project"
__email__ = "<EMAIL>"
__version__ = "1.6.0"
__all__ = [
"Selector",
"SelectorList",
"css2xpath",
"xpathfuncs",
]
from parsel.selector import Selector, SelectorList # NOQA
from parse... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/helpers/constants.py | psibean/django-rest-registration | 329 | 3205768 | REGISTER_VERIFICATION_URL = '/verify-account/'
REGISTER_EMAIL_VERIFICATION_URL = '/verify-email/'
RESET_PASSWORD_VERIFICATION_URL = '/reset-password/'
VERIFICATION_FROM_EMAIL = '<EMAIL>'
USERNAME = 'testusername'
USERNAME2 = 'testusername2'
USER_PASSWORD = '<PASSWORD>'
| 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/572207_Using_Pexpect_netrc_automate_commands_which/recipe-572207.py | tdiprima/code | 2,023 | 3205804 | <reponame>tdiprima/code<gh_stars>1000+
# ewp.py - <NAME> <<EMAIL>> [16 May 2008]
import sys, re, os, optparse, pexpect, netrc
def password_from_netrc(machine, user):
'''Given a machine name and user name, return the associated password in
~/.netrc. Returns None if not found or if .netrc does not exist.'''
... | 0 | 0 | 0 | 0 | 0 | 0 |
avionics/firmware/monitors/cs_analog.py | leozz37/makani | 1,178 | 3205821 | <filename>avionics/firmware/monitors/cs_analog.py
# Copyright 2020 Makani Technologies 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
... | 0 | 0 | 0 | 0 | 0 | 0 |
neuralmonkey/vocabulary.py | ufal/neuralmonkey | 446 | 3205852 | <gh_stars>100-1000
"""Vocabulary class module.
This module implements the Vocabulary class and the helper functions that
can be used to obtain a Vocabulary instance.
"""
import collections
import json
import os
from typing import List, Set, Union
import numpy as np
import tensorflow as tf
from typeguard import chec... | 0 | 0 | 0 | 0 | 0 | 0 |
src/RelaxedIK/Utils/ik_task.py | ajay5447/relaxed_ik | 133 | 3205904 | from __future__ import annotations
import numpy as np
from abc import ABCMeta, abstractmethod
import math
from ..Utils import transformations as T
import tf.broadcaster
import rospy
from visualization_msgs.msg import Marker
from geometry_msgs.msg import PoseStamped
keyboard_pos_goal = [0,0,0]
keyboard_quat_goal = [1,... | 33 | 19 | 0 | 4 | 56 | 0 |
Lyndon1994/0011.py | saurabh896/python-1 | 3,976 | 3205919 | # -*- coding: utf-8 -*-
"""
第 0011 题:
敏感词文本文件 filtered_words.txt,里面的内容为以下内容,
当用户输入敏感词语时,则打印出 Freedom,否则打印出 Human Rights。
北京
程序员
公务员
领导
牛比
牛逼
你娘
你妈
love
sex
jiangge
"""
word_filter=set()
with open('source/0011/filtered_words.txt') as f:
for w in f.readlines():
word_filter.add(w.strip())
while True:
s=i... | 0 | 0 | 0 | 0 | 0 | 0 |
glazier/lib/identifier_test.py | TsekNet/glazier | 1,233 | 3205945 | # Lint as: python3
# Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 0 | 0 | 0 | 0 | 0 | 0 |
app/util/counter.py | rsennewald/ClusterRunner | 164 | 3205950 | <gh_stars>100-1000
from queue import Queue
class Counter(object):
"""
A thread-safe counter.
"""
def __init__(self, start=0, step=1):
self._step = step
self._counter = Queue(maxsize=1)
self._counter.put(start)
def increment(self):
return self._change_current_value(... | 0 | 0 | 0 | 0 | 0 | 0 |
mmrazor/models/mutators/darts_mutator.py | hunto/mmrazor | 553 | 3205986 | <gh_stars>100-1000
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from torch.nn import functional as F
from mmrazor.models.builder import MUTATORS
from .differentiable_mutator import DifferentiableMutator
@MUTATORS.register_module()
class DartsMutator(DifferentiableMutator):
def __init__(self, ig... | 0 | 0 | 0 | 0 | 0 | 0 |
example_native_deps/handler.py | AusBOM/serverless-python-requirements | 919 | 3205994 | <filename>example_native_deps/handler.py
# must be called as we're using zipped requirements
try:
import unzip_requirements
except ImportError:
pass
import numpy
import scipy
import sklearn
def hello(event, context):
return {mod.__name__: mod.__version__ for mod in (numpy, scipy, sklearn)}
| 0 | 0 | 0 | 0 | 0 | 0 |
challenges/2.5.Sets/lesson_tests.py | pradeepsaiu/python-coding-challenges | 141 | 3206035 | import unittest
from main import *
class StringsTests(unittest.TestCase):
def test_main(self):
self.assertIsInstance(fccSet, set)
self.assertEqual(len(fccSet), 14)
| 0 | 0 | 0 | 0 | 0 | 0 |
rkqc/tools/gui/core/PathSelector.py | clairechingching/ScaffCC | 158 | 3206076 | <filename>rkqc/tools/gui/core/PathSelector.py
# RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org)
# Copyright (C) 2009-2011 The RevKit Developers <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/nltk_contrib/hadoop/hadooplib/outputcollector.py | h4ck3rm1k3/NLP-project | 123 | 3206104 | class LineOutput:
"""
default output class, output key and value
as (key, value) pair separated by separator
"""
@staticmethod
def collect(key, value, separator = '\t'):
"""
collect the key and value, output them to
a line separated by a separator character
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_steady_db.py | Cito/DBUtils | 178 | 3206108 | <filename>tests/test_steady_db.py<gh_stars>100-1000
"""Test the SteadyDB module.
Note:
We do not test any real DB-API 2 module, but we just
mock the basic DB-API 2 connection functionality.
Copyright and credit info:
* This test was contributed by <NAME>
"""
import unittest
from . import mock_db as dbapi
from dbu... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/numpy/max_min.py | Fryguy/py2rb | 124 | 3206143 | # coding: utf-8
import numpy as np
def print_matrix(data):
data_i = []
for i in list(data):
data_j = []
for j in i:
data_j.append(j)
data_i.append(data_j)
print(data_i)
def print_array(data):
datas = []
for i in data:
datas.append(i)
print(datas)
x... | 0 | 0 | 0 | 0 | 0 | 0 |
pytext/data/featurizer/__init__.py | Titousensei/pytext-1 | 6,199 | 3206150 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from .featurizer import Featurizer, InputRecord, OutputRecord
from .simple_featurizer import SimpleFeaturizer
__all__ = ["Featurizer", "InputRecord", "OutputRecord", "SimpleFeaturizer"]
| 0 | 0 | 0 | 0 | 0 | 0 |
3]. Competitive Programming/09]. HackerRank/2]. Tutorials/1]. 30 Days of Code/Python/Day_06.py | MLinesCode/The-Complete-FAANG-Preparation | 6,969 | 3206166 | ##### 7th solution
#---------------------------------------------------------
for i in range(int(input())):
s = input()
print(*[''.join(s[::2]), ''.join(s[1::2])]) | 0 | 0 | 0 | 0 | 0 | 0 |
arkane/data/methoxy.py | tza0035/RMG-Py | 250 | 3206192 | title = 'methoxy decomposition to H + CH2O'
description = ''
frequencyScaleFactor = 1.0
"""
This example illustrates how to manually set up an Arkane input file for a small P-dep reaction system [using only the
RRHO assumption, and without tunneling, although this can be easily implemented]. Such a calculation is desi... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/No of file Dulicates with path(dev).py | thefool76/hacktoberfest2021 | 448 | 3206225 | import os, pdb
d={'m' : ['.mp3','.m4a','.wav','.flac'],
'v' : ['.mp4','.flv','.mkv','.3gp','.mpeg'],
'p' : ['.jpg','.png','.jpeg']
}
p=input('\tPath : \n\t')
print("\n\n\t For Music : Enter 'm' \n\t For Videos : Enter 'v' \n\t For Pictures : Enter 'p' \n\t Or give the file extention with '.' like : '.py','.pdf','.xl... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/domain/AlipayOpenAgentCreateModel.py | snowxmas/alipay-sdk-python-all | 213 | 3206297 | <reponame>snowxmas/alipay-sdk-python-all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ContactModel import ContactModel
class AlipayOpenAgentCreateModel(object):
def __init__(self):
self._account = None
s... | 0 | 0 | 0 | 0 | 0 | 0 |
main.py | nohharri/chator | 1,636 | 3206316 | from application.app import app
app = app
| 0 | 0 | 0 | 0 | 0 | 0 |
models/vgg19_tf.py | oostudys/hualin95a | 238 | 3206326 | <reponame>oostudys/hualin95a
# -*- coding: utf-8 -*-
# @Time : 2018/2/3 22:50
# @Author : HLin
# @Email : <EMAIL>
# @File : vgg19_tf.py
# @Software: PyCharm
'''
This is a implemention of VGG19 with weights initialized.
'''
import tensorflow as tf
import numpy as np
class VGG19:
def __init__(self,VGG19_M... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/containers/test_traversal_py3.py | whysage/python-dependency-injector | 1,997 | 3206338 | <filename>tests/unit/containers/test_traversal_py3.py<gh_stars>1000+
import unittest
from dependency_injector import containers, providers
class TraverseProviderTests(unittest.TestCase):
def test_nested_providers(self):
class Container(containers.DeclarativeContainer):
obj_factory = provider... | 0 | 0 | 0 | 0 | 0 | 0 |
extensions/RichardHe.you-complete-me-1.0.36/ycmd/ycmd/tests/rust/subcommands_test.py | Sunshengjin/RoboWare-Studio | 239 | 3206340 | <reponame>Sunshengjin/RoboWare-Studio<filename>extensions/RichardHe.you-complete-me-1.0.36/ycmd/ycmd/tests/rust/subcommands_test.py
#!/usr/bin/env python
#
# Copyright (C) 2015 ycmd contributors.
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the ... | 0 | 0 | 0 | 0 | 0 | 0 |
openl3/openl3_warnings.py | lclichen/openl3 | 279 | 3206356 | class OpenL3Warning(Warning):
"""The root OpenL3 warning class"""
pass | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter10/10_7_sdn_miniedit.py | shamir456/Python-Network-Programming-Cookbook-Second-Edition | 125 | 3206364 | <gh_stars>100-1000
#!/usr/bin/env python
# Python Network Programming Cookbook, Second Edition -- Chapter - 10
# This program is optimized for Python 2.7.12.
# It may run on any other version with/without modifications.
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSControlle... | 0 | 0 | 0 | 0 | 0 | 0 |
Trakttv.bundle/Contents/Code/fs_migrator.py | disrupted/Trakttv.bundle | 1,346 | 3206382 | <reponame>disrupted/Trakttv.bundle
from plugin.core.constants import PLUGIN_VERSION_BASE
from plugin.core.helpers.variable import all
from lxml import etree
import shutil
import os
class FSMigrator(object):
migrations = []
@classmethod
def register(cls, migration):
cls.migrations.append(migratio... | 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.