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
library/oci_fast_connect_provider_service_facts.py
slmjy/oci-ansible-modules
106
141655
<filename>library/oci_fast_connect_provider_service_facts.py #!/usr/bin/python # Copyright (c) 2019, Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gp...
0
0
0
0
0
0
Python/owo.py
PushpneetSingh/Hello-world
1,428
141657
import time print("OwO What's This!!!") print("Here's my favorite activity in Japoneeese: プログラミング (yes google translate is good)") furry = "Rawr x3 nuzzles how are you pounces on you you're so warm o3o notices you have a bulge o: someone's happy ;) nuzzles your necky wecky~ murr~ hehehe rubbies your bulgy wolgy you're...
0
0
0
0
0
0
plugins/vsphere/resoto_plugin_vsphere/config.py
someengineering/resoto
126
141665
<filename>plugins/vsphere/resoto_plugin_vsphere/config.py<gh_stars>100-1000 from dataclasses import dataclass, field from typing import ClassVar, Optional @dataclass class VSphereConfig: kind: ClassVar[str] = "vsphere" user: Optional[str] = field(default=None, metadata={"description": "User name"}) passwo...
0
0
0
0
0
0
dataset/doc_text.py
jamaalhay/Final_Proj
104
141683
# -*- coding: utf-8 -*- import re import logging import torch import numpy as np logger = logging.getLogger(__name__) class DocText: """ define one sample text, like one context or one question """ def __init__(self, nlp, text, config): doc = nlp(text) self.config = config ...
0
4
0
7
11
0
CTFd/api/v1/submissions.py
omertuc/CTFd
3,592
141686
<gh_stars>1000+ from typing import List from flask_restx import Namespace, Resource from CTFd.api.v1.helpers.request import validate_args from CTFd.api.v1.helpers.schemas import sqlalchemy_to_pydantic from CTFd.api.v1.schemas import ( APIDetailedSuccessResponse, PaginatedAPIListSuccessResponse, ) from CTFd.ca...
0
0
0
0
0
0
lldb/test/API/tools/lldb-server/TestGdbRemoteAttachWait.py
Machiry/checkedc-clang
250
141688
import os from time import sleep import gdbremote_testcase import lldbgdbserverutils from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestGdbRemoteAttachWait(gdbremote_testcase.GdbRemoteTestCaseBase): mydir = TestBase.compute_mydir(__file__...
0
2
0
0
2
0
python/pycylon/test/test_frame.py
deHasara/cylon
229
141695
<reponame>deHasara/cylon<filename>python/pycylon/test/test_frame.py ## # 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 appl...
0
0
0
0
0
0
ParlAI/projects/convai2/interactive.py
UmaTaru/run
163
141696
<filename>ParlAI/projects/convai2/interactive.py<gh_stars>100-1000 #!/usr/bin/env python3 # 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. """Basic script which allows local human keyboard inpu...
0
0
0
0
0
0
modules/dbnd/test_dbnd/scenarios/pipelines/pipelines_with_errors.py
ipattarapong/dbnd
224
141699
<reponame>ipattarapong/dbnd import logging from time import sleep from dbnd import PipelineTask, band, output, parameter, pipeline, task from dbnd.tasks.basics import SimplestTask from dbnd.tasks.basics.simplest import SimpleTask from dbnd_test_scenarios.test_common.task.factories import TTask from targets import tar...
0
0
0
0
0
0
orchestra/tests/test_dashboard.py
code-review-doctor/orchestra
444
141705
<filename>orchestra/tests/test_dashboard.py<gh_stars>100-1000 import json from django.test import override_settings from orchestra.models import Step from orchestra.models import Task from orchestra.models import Project from orchestra.models import TaskAssignment from orchestra.tests.helpers import OrchestraTransact...
0
0
0
0
0
0
dataset/coco_karpathy_dataset.py
zengyan-97/X-VLM
107
141710
<gh_stars>100-1000 import os import json import random from collections import Counter import torch from torch.utils.data import Dataset from torchvision.datasets.utils import download_url from PIL import Image from dataset.utils import pre_caption class coco_karpathy_train(Dataset): def __init__(self, transfo...
0
0
0
0
0
0
tests/api/test_text_impl.py
JosephWardDotTech/helium
1,656
141723
from helium._impl import TextImpl from helium._impl.selenium_wrappers import WebDriverWrapper from tests.api import BrowserAT class TextImplTest(BrowserAT): def get_page(self) -> str: return 'test_text_impl.html' def test_empty_search_text_xpath(self): xpath = TextImpl(WebDriverWrapper(self.driver))._get_search_...
0
1
0
0
1
0
benchmarks/sanic/micro.py
kzh3ka/japronto
9,472
141730
<gh_stars>1000+ from sanic import Sanic from sanic.response import text app = Sanic(__name__) @app.route("/") async def hello(request): return text("Hello world!") app.run(host="0.0.0.0", port=8080)
0
0
0
0
0
0
sensor.py
cynicer/hass-smartthinq
252
141746
<gh_stars>100-1000 import datetime import logging import time import voluptuous as vol from custom_components.smartthinq import ( CONF_LANGUAGE, KEY_SMARTTHINQ_DEVICES, LGDevice) import homeassistant.helpers.config_validation as cv from homeassistant.const import CONF_REGION, CONF_TOKEN, TIME_HOURS, PERCENTAGE fro...
0
0
0
0
0
0
leetcode.com/python/841_Keys_and_Rooms.py
vansh-tiwari/coding-interview-gym
713
141762
class Solution(object): def canVisitAllRooms(self, rooms) -> object: """ :type rooms: List[List[int]] :rtype: bool """ seen = [False] * len(rooms) seen[0] = True stack = [0, ] while stack: roomIdx = stack.pop() for key in rooms[...
0
1
0
0
1
0
movie_recommender/src/als_recommender.py
KevinLiao159/ApiForDataScience
320
141773
import os import argparse import time import gc # spark imports from pyspark.sql import SparkSession, Row from pyspark.sql.functions import col, lower from pyspark.ml.evaluation import RegressionEvaluator from pyspark.ml.recommendation import ALS class AlsRecommender: """ This a collaborative filtering recom...
1
8
0
0
9
0
impala/compat.py
wzhou-code/impyla
661
141776
# Copyright 2015 Cloudera 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
1
0
0
1
0
Validation/EcalHits/python/ecalBarrelSimHitsValidation_cfi.py
ckamtsikis/cmssw
852
141777
import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer ecalBarrelSimHitsValidation = DQMEDAnalyzer("EcalBarrelSimHitsValidation", moduleLabelG4 = cms.string('g4SimHits'), verbose = cms.untracked.bool(False), ValidationCollection = cms.string('EcalValidInfo'), ...
0
0
0
0
0
0
examples/training/nli/training_nli.py
ccolas/sentence-transformers
7,566
141799
""" The system trains BERT (or any other transformer model like RoBERTa, DistilBERT etc.) on the SNLI + MultiNLI (AllNLI) dataset with softmax loss function. At every 1000 training steps, the model is evaluated on the STS benchmark dataset Usage: python training_nli.py OR python training_nli.py pretrained_transformer...
0
0
0
0
0
0
Tools/sqfvalidator/sqf/database.py
Rowantrek/A3-Antistasi
161
141804
<gh_stars>100-1000 # This file is generated automatically by `build_database.py`. Change it there. from sqf.expressions import BinaryExpression, UnaryExpression, NullExpression from sqf.types import Keyword, Type, Nothing, Anything, String, Code, Array, Number, Boolean, Namespace, \ Object, Config, Script, Control,...
0
0
0
0
0
0
blog/tests.py
regulusweb/wagtail_blog
274
141810
import doctest import json from django.core.management import call_command from django.contrib.auth.models import User from django.test import TestCase from django_comments_xtd.models import XtdComment from wagtail.core.models import Page import responses from .models import ( BlogPage, BlogTag, BlogPageT...
0
0
0
0
0
0
tests/test_model_to_dict.py
boba-and-beer/vectorhub
385
141811
<filename>tests/test_model_to_dict.py<gh_stars>100-1000 from vectorhub.auto_encoder import * def test_get_model_definitions(): assert isinstance(get_model_definitions(json_fn=None), list) assert isinstance(get_model_definitions(json_fn=None)[0], dict) assert len(get_model_definitions(json_fn=None)) > 0
0
0
0
0
0
0
tests/ut/python/dataset/test_exceptions.py
PowerOlive/mindspore
3,200
141814
<reponame>PowerOlive/mindspore<gh_stars>1000+ # Copyright 2019 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 # # ...
0
0
0
0
0
0
comtypes/test/find_memleak.py
vasily-v-ryabov/comtypes
212
141830
<reponame>vasily-v-ryabov/comtypes import unittest, gc from ctypes import * from ctypes.wintypes import * ################################################################ class PROCESS_MEMORY_COUNTERS(Structure): _fields_ = [("cb", DWORD), ("PageFaultCount", DWORD), ("Peak...
0
0
0
0
0
0
mayan/apps/checkouts/tests/test_links.py
bonitobonita24/Mayan-EDMS
343
141845
<filename>mayan/apps/checkouts/tests/test_links.py from mayan.apps.documents.permissions import permission_document_file_new from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from mayan.apps.sources.links import link_document_file_upload from mayan.apps.sources.tests.mixins.base_mixins import Sour...
0
0
0
0
0
0
lib/PyAMF-0.7.2/pyamf/tests/remoting/__init__.py
MiCHiLU/google_appengine_sdk
790
141857
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ Remoting tests. @since: 0.1.0 """
0
0
0
0
0
0
imperative/python/megengine/optimizer/optimizer.py
Olalaye/MegEngine
5,168
141869
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
6
4
0
3
13
0
getpaid/post_forms.py
prog32/django-getpaid
220
141913
from django import forms class PaymentHiddenInputsPostForm(forms.Form): def __init__(self, fields, *args, **kwargs): super().__init__(*args, **kwargs) for key in fields: self.fields[key] = forms.CharField( initial=fields[key], widget=forms.HiddenInput )
0
0
0
0
0
0
code/custom_dataloaders.py
aosokin/biogans
105
141919
<reponame>aosokin/biogans import os from torchvision.datasets.folder import default_loader, find_classes, make_dataset, IMG_EXTENSIONS import torchvision.transforms as transforms import torch.utils.data as data import numpy as np import torch import random from tqdm import tqdm from utils import parallel_process def...
0
0
0
0
0
0
HLTriggerOffline/Higgs/python/HiggsValidation_cff.py
ckamtsikis/cmssw
852
141935
import FWCore.ParameterSet.Config as cms from HLTriggerOffline.Higgs.hltHiggsValidator_cfi import * HiggsValidationSequence = cms.Sequence( hltHiggsValidator ) #HLTHiggsVal_FastSim = cms.Sequence( # recoHiggsValidationHLTFastSim_seq + # hltHiggsValidator # )
0
0
0
0
0
0
research/syntaxnet/examples/dragnn/tutorial_2.py
zcdzcdzcd/models
3,326
141939
<reponame>zcdzcdzcd/models """Second example: separate tagger and parser.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path import tensorflow as tf from google.protobuf import text_format from dragnn.protos import spec_pb2 from dragnn.python...
0
0
0
0
0
0
model/tensor_pool.py
Shimingyi/MotioNet
368
141947
import random import torch from torch.autograd import Variable class TensorPool(): def __init__(self, pool_size): self.pool_size = pool_size if self.pool_size > 0: self.num_imgs: int = 0 self.images: list[object] = [] def query(self, tensors) -> object: if self.p...
0
1
0
2
3
0
tests/library/python/for.py
chrisseaton/katahdin
115
141962
x = 0 for n in range(10): x = x + 1 assert x == 10
0
0
0
0
0
0
sdks/python/apache_beam/dataframe/frame_base_test.py
hengfengli/beam
5,279
141973
# # 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 us...
7
6
0
0
13
0
Models/Layers.py
GingerNg/SDNet
112
141997
<gh_stars>100-1000 # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os import random import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torch.nn.init as init from torch.nn.parameter import Parameter from torch.nn.utils.rnn import...
0
0
0
0
0
0
botorch/models/approximate_gp.py
saitcakmak/botorch
2,344
141998
#!/usr/bin/env python3 # 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. r""" References .. [burt2020svgp] <NAME> and <NAME> and <NAME>, Convergence of Sparse Variational Inference in...
36
10
0
2
48
0
django_quill/quill.py
LeeHanYeong/django-quill-editor
125
142013
import json __all__ = ( "QuillParseError", "Quill", ) class QuillParseError(Exception): def __init__(self, value): self.value = value def __str__(self) -> object: return "Failed to parse value(%s)" % self.value class Quill: def __init__(self, json_string): try: ...
0
1
0
0
1
0
midi_ddsp/modules/interpretable_conditioning.py
magenta/midi-ddsp
169
142018
<reponame>magenta/midi-ddsp # Copyright 2022 The MIDI-DDSP 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 # # # Unles...
0
0
0
0
0
0
plan2explore/tools/count_dataset.py
sarthak268/plan2explore
189
142056
# Copyright 2019 The Dreamer Authors. Copyright 2020 Plan2Explore 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...
0
2
0
0
2
0
django/contrib/gis/db/backends/mysql/base.py
webjunkie/django
790
142074
from django.db.backends.mysql.base import * from django.db.backends.mysql.base import DatabaseWrapper as MySQLDatabaseWrapper from django.contrib.gis.db.backends.mysql.creation import MySQLCreation from django.contrib.gis.db.backends.mysql.introspection import MySQLIntrospection from django.contrib.gis.db.backends.mysq...
0
0
0
0
0
0
action_cls/msr_dataset.py
HarmoniaLeo/meteornet
127
142111
''' Provider for duck dataset from <NAME> ''' import os import os.path import json import numpy as np import sys import pickle import glob class Dataset(): def __init__(self, \ root: str='/scr1/mengyuan/ICCV-data/MSR_processed', \ num_points: int = 8192, \ num_frames: int=2...
5
2
0
3
10
0
examples/gzipfilter.py
Datatope/mod_python
183
142117
# # Usage: # <Directory /where/ever> # PythonOutputFilter gzipfilter # SetOutputFilter gzipfilter # </Directory> from __future__ import annotations from mod_python import apache import os import sys import gzip import cStringIO from mod_python import apache def compress(s) -> object: sio = cStringI...
0
2
0
0
2
0
t5_closed_book_qa/t5_cbqa/postprocessors.py
deepneuralmachine/google-research
23,901
142127
# 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...
3
1
0
0
4
0
Beginner/Chef and Interactive Contests (CHFINTRO)/interactive.py
anishsingh42/CodeChef
127
142139
<gh_stars>100-1000 N, r = map(int, input().split()) for i in range(N): R = int(input()) if R>=r: print('Good boi') else: print('Bad boi')
0
0
0
0
0
0
cupcake2/io/SeqSplitter.py
ArthurDondi/cDNA_Cupcake
205
142143
#!/usr/bin/env python from __future__ import annotations """Define Class `FastaSplitter` which splits a fasta file into smaller files each containing `reads_per_split` reads.""" import os import os.path as op import sys from Bio import SeqIO from pbtranscript.Utils import mkdir class FaFqSplitter(object): """...
2
5
0
1
8
0
models/dnn/dnn.py
Zhenyu-Lii/2021-Audio-Recognition
359
142168
<reponame>Zhenyu-Lii/2021-Audio-Recognition import os from typing import Optional from abc import ABC, abstractmethod import numpy as np from keras.models import Sequential, model_from_json from ..base import BaseModel from utils import curve class DNN(BaseModel, ABC): """ 所有基于 Keras 的深度学习模型的基类 Args: ...
0
0
0
0
0
0
flask_rest_jsonapi/data_layers/filtering/alchemy.py
fossasia/flask-rest-jsonapi
1,757
142208
<gh_stars>1000+ # -*- coding: utf-8 -*- from sqlalchemy import and_, or_, not_ from flask import current_app from flask_rest_jsonapi.exceptions import InvalidFilters from flask_rest_jsonapi.schema import get_relationships, get_model_field def create_filters(model, filter_info, resource): """Apply filters from f...
0
0
0
0
0
0
code/sql/network.py
Dookas/Robust-Multitask-RL
106
142210
import math import random import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable from memory_replay import Transition use_cuda = torch.cuda.is_available() FloatTensor = torch.cuda.FloatTensor if use_cuda else torch.FloatTensor LongTensor = to...
0
3
0
0
3
0
observations/r/voteincome.py
hajime9652/observations
199
142218
<reponame>hajime9652/observations # -*- 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 voteincome(path): """Sample Turnout...
0
0
0
0
0
0
setup_mcedit2.py
elcarrion06/mcedit2
673
142228
<gh_stars>100-1000 """ setup-mcedit2 """ from os import path import sys from setuptools import setup, find_packages from Cython.Build import cythonize import numpy # Output annotated .html import Cython.Compiler.Options Cython.Compiler.Options.annotate = True with file("version.txt") as f: version = f.read(...
0
0
0
0
0
0
examples/widgets/line/lv_example_line_1.py
nickzhuang0613/lvgl
5,238
142229
<gh_stars>1000+ # Create an array for the points of the line line_points = [ {"x":5, "y":5}, {"x":70, "y":70}, {"x":120, "y":10}, {"x":180, "y":60}, {"x":240, "y":10}] # Create style style_line = lv.style_t() style_line.init() style_line.set_line_widt...
0
0
0
0
0
0
homeassistant/components/numato/sensor.py
MrDelik/core
30,023
142259
<reponame>MrDelik/core """Sensor platform integration for ADC ports of Numato USB GPIO expanders.""" from __future__ import annotations import logging from numato_gpio import NumatoGpioError from homeassistant.components.sensor import SensorEntity from homeassistant.const import CONF_ID, CONF_NAME, CONF_SENSORS from...
0
0
0
0
0
0
nnutils/chamfer_python.py
NVlabs/UMR
184
142269
# ----------------------------------------------------------------------------- # Code adapted from: # https://github.com/ThibaultGROUEIX/ChamferDistancePytorch/blob/719b0f1ca5ba370616cb837c03ab88d9a88173ff/chamfer_python.py # # MIT License # # Copyright (c) 2019 ThibaultGROUEIX # # Permission is hereby granted, fr...
1
3
0
0
4
0
tests/python/compiler/test_top_level4.py
ThomsonTan/nnvm
1,872
142287
from __future__ import annotations import numpy as np import tvm from tvm.contrib import graph_runtime import topi import nnvm.symbol as sym import nnvm.compiler from nnvm.testing.config import ctx_list def helper(symbol, inputs, dtype, np_forward, np_backward: object | None=None, need_input: bool=True, ne...
3
21
0
0
24
0
swagger_tester/swagger_tester.py
pwnieexpress/swagger-tester
109
142288
<reponame>pwnieexpress/swagger-tester # -*- coding: utf-8 -*- import json import logging import os import requests import six import time try: from urllib import urlencode except ImportError: # Python 3 from urllib.parse import urlencode import connexion from swagger_parser import SwaggerParser logging.ba...
0
0
0
0
0
0
test/jpypetest/test_module.py
pitmanst/jpype
531
142292
# ***************************************************************************** # # 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
dedupe/predicates.py
fritshermans/dedupe
2,190
142293
<reponame>fritshermans/dedupe #!/usr/bin/python # -*- coding: utf-8 -*- import re import math import itertools import string import abc from doublemetaphone import doublemetaphone from dedupe.cpredicates import ngrams, initials import dedupe.tfidf as tfidf import dedupe.levenshtein as levenshtein from typing import ...
0
0
0
0
0
0
src/thug/cli.py
rmoutie/thug-memes
234
142309
from enum import Enum from os import (getcwd, path as osp) import sys import click import cv2 from .conf import (get_config, print_config) from .detect.opencv import HaarCascadeDetector from .meme.basic import Meme from .meme.thug import ThugMeme MEME_RESULT_DIR = getcwd() CONTEXT = dict(help_option_names=['-h', '-...
1
4
2
0
7
0
judge/detection_perf.py
sunset768541/ctw-baseline
333
142311
<filename>judge/detection_perf.py # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import codecs import json import matplotlib.pyplot as plt import numpy as np import os import plot_tools import...
0
0
0
0
0
0
src/tools/grap_disassembler/disassembler.py
AirbusCyber/grap
171
142312
# !/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations import re import sys import os import multiprocessing import multiprocessing.dummy import signal import io try: from capstone import Cs from capstone import CS_ARCH_X86 from capstone import CS_MODE_32 from capstone impor...
56
33
0
16
105
0
.jenkins/pytorch/print_sccache_log.py
Stonepia/pytorch
206
142335
import sys log_file_path = sys.argv[1] with open(log_file_path) as f: lines = f.readlines() for line in lines: # Ignore errors from CPU instruction set or symbol existing testing keywords = ['src.c', 'CheckSymbolExists.c'] if all([keyword not in line for keyword in keywords]): print(line)
0
0
0
0
0
0
applications/ParticleMechanicsApplication/python_scripts/particle_json_output_process.py
lkusch/Kratos
778
142342
from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7 # Importing the Kratos Library import KratosMultiphysics from KratosMultiphysics.json_utilities import read_external_json, write_external_json # Importing the base class from KratosMul...
0
3
0
0
3
0
tests/nnapi/specs/V1_2/reduce_min_float_nnfw.mod.py
periannath/ONE
255
142354
<reponame>periannath/ONE model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{1, 2, 2, 1}") axis = Parameter("axis", "TENSOR_INT32", "{1}", [2]) keepDims = False output = Output("output", "TENSOR_FLOAT32", "{1, 2, 1}") model = model.Operation("REDUCE_MIN", i1, axis, keepDims).To(output) # Example 1. Input in opera...
0
0
0
0
0
0
coding_interviews/leetcode/medium/subrectangle_queries/subrectangle_queries.py
LeandroTk/Algorithms
205
142395
<filename>coding_interviews/leetcode/medium/subrectangle_queries/subrectangle_queries.py # https://leetcode.com/problems/subrectangle-queries class SubrectangleQueries: def __init__(self, rectangle): self.rectangle = rectangle def updateSubrectangle(self, row1, col1, row2, col2, newValue): fo...
0
0
0
0
0
0
examples/show_font_table.py
aathi2002/open-tamil
218
142415
# This code is released to public domain. # It is part of open-tamil project examples. # # Code to show fontbased encoding tables in Open-TAMIL # Ref: https://github.com/Ezhil-Language-Foundation/open-tamil/issues/216 import sys import unicodedata # requires installing fontTools # Ref: https://fonttools.readthedocs.io...
0
0
0
0
0
0
tests/constants.py
fraudnet/kibana-docker
256
142416
import os from subprocess import run, PIPE try: version = os.environ['ELASTIC_VERSION'] except KeyError: version = run('./bin/elastic-version', stdout=PIPE).stdout.decode().strip()
0
0
0
0
0
0
Chapter07/transfer_learning_imdb.py
arifmudi/Hands-On-Transfer-Learning-with-Python
756
142445
# -*- coding: utf-8 -*- """ Created on Thu Apr 12 13:33:45 2018 @author: tghosh """ import config from dataloader.loader import Loader from preprocessing.utils import Preprocess, remove_empty_docs from dataloader.embeddings import GloVe from model.cnn_document_model import DocumentModel, TrainingParameters from keras...
0
0
0
0
0
0
aldjemy/wrapper.py
Piero-Palevsky-OH/aldjemy
255
142456
<reponame>Piero-Palevsky-OH/aldjemy class Wrapper: "Wrapper to disable commit in sqla" def __init__(self, obj): self.obj = obj def __getattr__(self, attr): if attr in ["commit", "rollback"]: return lambda *args, **kwargs: None obj = getattr(self.obj, attr) if at...
0
0
0
0
0
0
env/Lib/site-packages/plotly/validators/scatter3d/_surfaceaxis.py
andresgreen-byte/Laboratorio-1--Inversion-de-Capital
11,750
142466
import _plotly_utils.basevalidators class SurfaceaxisValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name: str="surfaceaxis", parent_name: str="scatter3d", **kwargs): super(SurfaceaxisValidator, self).__init__( plotly_name=plotly_name, parent_...
2
0
0
0
2
0
scripts/visualize_model.py
jonahwu/cner
823
142490
import spacy_streamlit import typer def main(models: str, default_text: str): models = [name.strip() for name in models.split(",")] spacy_streamlit.visualize(models, default_text, visualizers=["ner"]) if __name__ == "__main__": try: typer.run(main) except SystemExit: pass
2
0
0
0
2
0
libs/sqlobject/tests/test_expire.py
scambra/HTPC-Manager
422
142492
from sqlobject import * from sqlobject.tests.dbtest import * ######################################## ## Expiring, syncing ######################################## class SyncTest(SQLObject): name = StringCol(length=50, alternateID=True, dbName='name_col') def test_expire(): setupClass(SyncTest) SyncTest(...
0
0
0
0
0
0
jactorch/transforms/bbox/transforms.py
dapatil211/Jacinle
114
142501
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # File : transforms.py # Author : <NAME> # Email : <EMAIL> # Date : 03/03/2018 # # This file is part of Jacinle. # Distributed under terms of the MIT license. from __future__ import annotations import random import torch import torchvision.transforms as transforms ...
0
19
0
0
19
0
src/layers.py
AlexHeffner/DropEdge
380
142510
<filename>src/layers.py import math import torch from torch.nn.parameter import Parameter from torch.nn.modules.module import Module from torch import nn import torch.nn.functional as F class GraphConvolutionBS(Module): """ GCN Layer with BN, Self-loop and Res connection. """ def _...
0
0
0
0
0
0
cookbook/mesher_prismmesh_vardens.py
XuesongDing/fatiando
179
142526
<reponame>XuesongDing/fatiando """ Meshing: Make a 3D prism mesh with depth-varying density """ from fatiando import gridder, mesher from fatiando.vis import myv shape = (10, 20, 10) nz, ny, nx = shape mesh = mesher.PrismMesh((0, 100, 0, 200, 0, 50), shape) def fill(i): k = i / (nx * ny) return k mesh.addpro...
0
0
0
0
0
0
koalixcrm/crm/documents/pdf_export.py
Cataldir/koalixcrm
290
142529
<gh_stars>100-1000 # -*- coding: utf-8 -*- import os from subprocess import check_output from subprocess import STDOUT from django.conf import settings from django.core import serializers from lxml import etree import koalixcrm.crm.documents.sales_document import koalixcrm.djangoUserExtension.models class PDFExport:...
0
0
0
0
0
0
u2flib_server/model.py
xnguyena2/python-u2flib-server
306
142586
# Copyright (c) 2013 Yubico AB # 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 list of conditi...
4
33
15
0
52
0
test/bibliopixel/util/offset_range_test.py
rec/leds
253
142598
import unittest from bibliopixel.util import offset_range class OffsetRangeTest(unittest.TestCase): def test_empty(self): dmx = offset_range.DMXChannel.make() self.assertEqual(dmx.index(0), None) self.assertEqual(dmx.index(1), 0) self.assertEqual(dmx.index(2), 1) self.asse...
0
0
0
0
0
0
build/CI/kylin-system-testing/kylin_utils/kylin.py
ApacheSourceCode/kylin
3,402
142614
#!/usr/bin/python # # 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
freight/notifiers/base.py
armandomeeuwenoord/freight
562
142619
<reponame>armandomeeuwenoord/freight<filename>freight/notifiers/base.py<gh_stars>100-1000 from freight.models import Deploy, TaskStatus from freight import http __all__ = ["Notifier", "NotifierEvent"] class NotifierEvent(object): TASK_STARTED = 0 TASK_FINISHED = 1 TASK_QUEUED = 2 class Notifier(object)...
0
0
0
0
0
0
wagtail_localize/test/migrations/0015_testsnippet_small_charfield.py
hpoul/wagtail-localize
123
142631
# Generated by Django 3.2.4 on 2021-06-29 15:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('wagtail_localize_test', '0014_auto_20210217_0924'), ] operations: list[object] = [ migrations.AddField( m...
0
0
2
0
2
0
src/compas_rhino/artists/pointartist.py
funkchaser/compas
235
142632
<gh_stars>100-1000 from __future__ import print_function from __future__ import absolute_import from __future__ import division import compas_rhino from compas.artists import PrimitiveArtist from .artist import RhinoArtist class PointArtist(RhinoArtist, PrimitiveArtist): """Artist for drawing points. Parame...
0
0
0
0
0
0
leetcode.com/python/1358_Number_of_Substrings_Containing_All_Three_Characters.py
vansh-tiwari/coding-interview-gym
713
142643
<gh_stars>100-1000 from collections import defaultdict class Solution(object): def numberOfSubstrings(self, s): """ :type s: str :rtype: int """ left, right = 0, 0 subStringCount = 0 couter = {c: 0 for c in 'abc'} while right < len(s): cout...
0
0
0
0
0
0
bcs-ui/backend/uniapps/network/views/charts/versions.py
laodiu/bk-bcs
599
142656
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
0
2
2
0
4
0
gen_version.py
virtualmix/noto-emoji
1,225
142669
<filename>gen_version.py #!/usr/bin/env python3 # # Copyright 2015 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/LICE...
0
0
0
0
0
0
scrapers/scrape_nw_common.py
brunis83/covid_19
485
142672
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re from bs4 import BeautifulSoup import scrape_common as sc def get_nw_page() -> tuple[object, object]: url = 'https://www.nw.ch/gesundheitsamtdienste/6044' content = sc.download(url, silent=True) content = content.replace("&nbsp;", " ") content =...
0
1
0
0
1
0
nipyapi/registry/models/bundle_version_metadata.py
Jimvin/nipyapi
199
142680
# coding: utf-8 from __future__ import annotations """ Apache NiFi Registry REST API The REST API provides an interface to a registry with operations for saving, versioning, reading NiFi flows and components. OpenAPI spec version: 1.15.0 Contact: <EMAIL> Generated by: https://github.com/swagger-a...
15
20
2
15
52
0
tests/changes/backends/jenkins/test_builder.py
vault-the/changes
443
142686
from __future__ import absolute_import import mock import os.path import responses import pytest import re import time from flask import current_app from uuid import UUID from changes.config import db, redis from changes.constants import Status, Result from changes.lib.artifact_store_lib import ArtifactState from c...
0
6
1
0
7
0
opticspy/ray_tracing/glass_function/transferMatrix.py
Graylien/opticspy
306
142687
# This file is part of PyTMM. # # PyTMM 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. # # PyTMM is distributed in t...
4
8
2
0
14
0
src/api_generator.py
stevenlovegrove/sony_camera_api
191
142690
<filename>src/api_generator.py from __future__ import print_function from api_list import exist_param, no_param def gen(): result = '' exist_def = """def %s(self, param=None): return self._cmd(method="%s", param=param)""" no_def = """def %s(self): return self._cmd(method="%s")""" for x in ex...
0
0
0
0
0
0
Harvard-CS50x/pset6/sentiments/analyzer.py
Sam-Gao-Xin/Courses-
622
142695
import nltk class Analyzer(): """Implements sentiment analysis.""" def __init__(self, positives, negatives): """Initialize Analyzer.""" self.negatives: list[object] = [] self.positives: list[object] = [] with open ("negative-words.txt") as negative: ...
0
1
0
2
3
0
examples/data_pipeline/dataset.py
parmeet/text
3,172
142711
import torch from torchtext.datasets import DATASETS class BatchTextClassificationData(torch.utils.data.IterableDataset): def __init__(self, dataset_name, batch_size: int=16): super(BatchTextClassificationData, self).__init__() self._iterator = DATASETS[dataset_name](split='train') self.b...
1
0
0
0
1
0
tests/issues/test_issue.py
mubashshirjamal/code
1,582
142768
<reponame>mubashshirjamal/code # encoding: UTF-8 from tests.base import TestCase from vilya.models.issue import Issue from vilya.models.issue_comment import IssueComment class TestIssue(TestCase): def test_add_issue(self): i = Issue.add('test', 'test description', 'test', 'assignee') assert isi...
0
0
0
0
0
0
ps4000aExamples/ps4824BlockExample.py
shikajiro/picosdk-python-wrappers
114
142787
<reponame>shikajiro/picosdk-python-wrappers # # Copyright (C) 2018 Pico Technology Ltd. See LICENSE file for terms. # # PS4824 BLOCK MODE EXAMPLE # This example opens a 4000a driver device, sets up two channels and a trigger then collects a block of data. # This data is then plotted as mV against time in ns. import ct...
0
0
0
0
0
0
src/intensio_obfuscator/core/obfuscation/intensio_replace.py
bbhunter/Intensio-Obfuscator
553
142827
<reponame>bbhunter/Intensio-Obfuscator # -*- coding: utf-8 -*- # https://github.com/Hnfull/Intensio-Obfuscator #---------------------------------------------------------- [Lib] -----------------------------------------------------------# import re import fileinput import os import sys from progress.bar import Bar t...
0
0
0
0
0
0
paddleseg/models/portraitnet.py
JamesLim-sy/PaddleSeg
4,708
142830
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # # 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...
8
5
0
1
14
0
tests/test_discovery.py
tipofthesowrd/SoCo
1,149
142832
import socket import select import ipaddress import ifaddr from collections import OrderedDict from unittest.mock import patch, MagicMock as Mock, PropertyMock, call from soco import discover from soco import config from soco.discovery import ( any_soco, by_name, _find_ipv4_addresses, _find_ipv4_netw...
0
3
0
0
3
0
compressor/parser/lxml.py
cron-ooo/django-compressor
1,480
142833
<reponame>cron-ooo/django-compressor from django.core.exceptions import ImproperlyConfigured from django.utils.encoding import smart_str from django.utils.functional import cached_property from compressor.exceptions import ParserError from compressor.parser import ParserBase class LxmlParser(ParserBase): """ ...
0
0
0
0
0
0
test cases/common/71 ctarget dependency/gen2.py
iinuwa/meson
4,047
142836
#!/usr/bin/env python3 import sys, os from glob import glob files = glob(os.path.join(sys.argv[1], '*.tmp')) assert len(files) == 1 with open(files[0]) as ifile, open(sys.argv[2], 'w') as ofile: ofile.write(ifile.read())
0
0
0
0
0
0
hatch/files/setup.py
williamirick/hatch
2,549
142870
<filename>hatch/files/setup.py from hatch.structures import File from hatch.utils import normalize_package_name TEMPLATE = """\ #################### Maintained by Hatch #################### # This file is auto-generated by hatch. If you'd like to customize this file # please add your changes near the bottom marked for...
0
0
0
0
0
0
imapfw/toolkit.py
paralax/imapfw
492
142874
<gh_stars>100-1000 # The MIT License (MIT). # Copyright (c) 2015, <NAME> & contributors. import os from threading import Thread def runHook(hookFunc, *args): class Hook(object): def __init__(self): self._stop = True def ended(self): self._stop = False def stop(se...
0
0
0
0
0
0