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
server/auvsi_suas/views/telemetry_test.py
RMMichael/interop
175
1675400
<reponame>RMMichael/interop<filename>server/auvsi_suas/views/telemetry_test.py """Tests for the telemetry module.""" import time from auvsi_suas.models.uas_telemetry import UasTelemetry from auvsi_suas.proto.interop_api_pb2 import Telemetry from django.contrib.auth.models import User from django.test import TestCase f...
0
0
0
0
0
0
third_party/pyjson5/src/json5/host.py
Meysamsarabadani/devtools-frontend
2,389
1675401
# Copyright 2014 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 applicable law or ag...
4
5
0
0
9
0
ecosystem_tools/mindconverter/mindconverter/graph_based_converter/mapper/onnx/ops/cumsum_mapper.py
mindspore-ai/mindinsight
216
1675413
<gh_stars>100-1000 # Copyright 2021 Huawei Technologies Co., Ltd.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 # # Un...
0
0
0
0
0
0
electrumsv/gui/qt/import_export.py
electrumsv/electrumsv
136
1675415
# Open BSV License version 3 # Copyright (c) 2021 Bitcoin Association # # 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, ...
8
6
6
6
26
0
index.py
Chris3691/Dash-Flask-Users
105
1675427
<gh_stars>100-1000 # index page import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import dash_bootstrap_components as dbc from app import app, server from flask_login import logout_user, current_user from views import login, error, page1, page2, profile,...
0
0
0
0
0
0
homeassistant/components/yale_smart_alarm/entity.py
MrDelik/core
30,023
1675434
<filename>homeassistant/components/yale_smart_alarm/entity.py """Base class for yale_smart_alarm entity.""" from homeassistant.const import CONF_NAME, CONF_USERNAME from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC from homeassistant.helpers.entity import DeviceInfo, Entity from homeassistant.he...
0
0
0
0
0
0
projects/samples/robotbenchmark/highway_driving/controllers/highway_driving_benchmark/highway_driving_benchmark.py
HarpieRapace45/webots
1,561
1675441
"""Controller program to manage the benchmark.""" import os import random import socket import sys from controller import Supervisor try: from shapely.geometry import Point from shapely.geometry import LineString except ImportError: sys.stderr.write("Error: 'shapely' module not found.\n") sys.exit(0) ...
0
1
0
0
1
0
pastepwn/analyzers/tests/bcrypthashanalyzer_test.py
robotboyfriend/pastepwn
113
1675511
<gh_stars>100-1000 # -*- coding: utf-8 -*- import unittest from unittest import mock from pastepwn.actions.basicaction import BasicAction from pastepwn.analyzers.bcrypthashanalyzer import BcryptHashAnalyzer class TestBcryptHashAnalyzer(unittest.TestCase): def setUp(self): self.analyzer = BcryptHashAnalyz...
0
0
0
0
0
0
gluoncv/model_zoo/action_recognition/c3d.py
Kh4L/gluon-cv
5,447
1675540
<reponame>Kh4L/gluon-cv<filename>gluoncv/model_zoo/action_recognition/c3d.py """C3D, implemented in Gluon. https://arxiv.org/abs/1412.0767""" # pylint: disable=arguments-differ,unused-argument __all__ = ['C3D', 'c3d_kinetics400'] from mxnet import init from mxnet.context import cpu from mxnet.gluon.block import Hybri...
0
0
0
0
0
0
pixiedust/display/chart/__init__.py
elgalu/pixiedust
598
1675542
<gh_stars>100-1000 # ------------------------------------------------------------------------------- # Copyright IBM Corp. 2017 # # 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://ww...
0
0
0
0
0
0
examples/python/ducctest.py
mjc87/SHTOOLS
251
1675610
<gh_stars>100-1000 import numpy as np import pyshtools as pysh from time import time nthreads = 1 def _l2error(a, b): return np.sqrt(np.sum(np.abs(a - b) ** 2) / np.sum(np.abs(a) ** 2)) # force SHTOOLS to deallocate temporary buffers def flush_buffers(grd): degrees = np.arange(1, dtype=float) degrees[...
0
0
0
0
0
0
src/ralph/assets/__init__.py
DoNnMyTh/ralph
1,668
1675620
<gh_stars>1000+ default_app_config = 'ralph.assets.apps.AssetsConfig'
0
0
0
0
0
0
h/migrations/versions/2d0ad2b1bf07_add_enforce_scope_column_to_group_table.py
pombredanne/h
2,103
1675629
<reponame>pombredanne/h """Add enforce_scope column to group table.""" import sqlalchemy as sa from alembic import op revision = "<KEY>" down_revision = "<KEY>" def upgrade(): op.add_column( "group", sa.Column( "enforce_scope", sa.Boolean(), server_default=sa.s...
0
0
0
0
0
0
stacking_val_predict.py
wubinbai/argus-freesound
314
1675636
<reponame>wubinbai/argus-freesound import json import numpy as np import pandas as pd from src.stacking.datasets import load_fname_probs from src.stacking.predictor import StackPredictor from src.metrics import LwlrapBase from src.utils import get_best_model_path from src import config STACKING_EXPERIMENT = "stackin...
0
0
0
0
0
0
rpython/jit/backend/llsupport/asmmemmgr.py
m4sterchain/mesapy
381
1675643
from __future__ import annotations import sys from rpython.rlib.rarithmetic import intmask, r_uint, LONG_BIT from rpython.rlib.objectmodel import we_are_translated from rpython.rlib import rmmap from rpython.rlib.debug import debug_start, debug_print, debug_stop from rpython.rlib.debug import have_debug_prints from rpy...
6
15
6
6
33
0
nemo/collections/nlp/data/text_normalization/constants.py
hamjam/NeMo
4,145
1675662
<filename>nemo/collections/nlp/data/text_normalization/constants.py # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # htt...
0
0
0
0
0
0
tests/col_generation/test_mapcolvals.py
rohankumardubey/pdpipe
438
1675670
<reponame>rohankumardubey/pdpipe """Testing MapColVals pipeline stages.""" import pickle import datetime import pandas as pd import pytest from pdpipe.col_generation import MapColVals from pdptestutil import random_pickle_path def _test_df(): return pd.DataFrame([[1], [3], [2]], ['UK', 'USSR', 'US'], ['Medal'...
0
0
0
0
0
0
test/crud_v2_format.py
naomielst/mongo-python-driver
2,593
1675675
# Copyright 2020-present MongoDB, 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 wri...
0
5
2
0
7
0
ckan/cli/generate.py
irev/ckan
2,805
1675697
# encoding: utf-8 import contextlib import os import shutil import alembic.command import click from alembic.config import Config as AlembicConfig import ckan from ckan.cli.db import _resolve_alembic_config import ckan.plugins.toolkit as tk import uuid import string import secrets from ckan.cli import error_shout ...
1
1
0
0
2
0
mmcv/visualization/color.py
BIGWangYuDong/mmcv
3,748
1675716
# Copyright (c) OpenMMLab. All rights reserved. from __future__ import annotations from enum import Enum import numpy as np from mmcv.utils import is_str class Color(Enum): """An enum that defines common colors. Contains red, green, blue, cyan, yellow, magenta, white and black. """ red: tuple[int, ...
0
1
8
0
9
0
ontobio/lexmap.py
alliance-genome/ontobio
101
1675719
from __future__ import annotations """Lexical mapping of ontology classes The core data structure used here is a Mapping Graph. This is a networkx Graph object (i.e. singly labeled, non-directional) that connects lexically mapped nodes between two ontologies. Edge Properties --------------- idpair: (string,string) ...
4
31
4
5
44
0
tests/tasks/test_dbus.py
facebook/sparts
220
1675724
<filename>tests/tasks/test_dbus.py<gh_stars>100-1000 # Copyright (c) 2015, Facebook, Inc. 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. An additional grant # of patent rights can be found in the PATENTS file in t...
0
0
0
0
0
0
tests/test020.py
takipsizad/pyjs
739
1675737
import ui class DayCheckBox(ui.CheckBox): def __init__(self, caption, day): ui.CheckBox.__init__(self, caption) self.day = day
0
0
0
0
0
0
xt/model/ppo/ppo_mlp_zeus.py
TianQi-777/xingtian
240
1675838
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to us...
0
9
0
0
9
0
concepts/relationship_forwarding/python/source_forwarding.py
jingtaoh/USD-Cookbook
332
1675852
<filename>concepts/relationship_forwarding/python/source_forwarding.py #!/usr/bin/env python # -*- coding: utf-8 -*- """A demonstration of how to get the leaf-target values of a USD relationship.""" # IMPORT THIRD-PARTY LIBRARIES from pxr import Usd def main(): """Run the main execution of the current script.""...
0
0
0
0
0
0
neuralhydrology/training/train.py
DavidChoi76/neuralhydrology
144
1675900
<filename>neuralhydrology/training/train.py from neuralhydrology.training.basetrainer import BaseTrainer from neuralhydrology.training.umaltrainer import UMALTrainer from neuralhydrology.utils.config import Config def start_training(cfg: Config): """Start model training. Parameters ---------- cfg...
0
0
0
0
0
0
src/programy/services/rest/microsoft/search/service.py
RonKhondji/program-y
345
1675911
""" Copyright (c) 2016-2020 <NAME> http://www.keithsterling.com 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
10
2
2
14
0
tests/__init__.py
sagorbrur/bengali_pyspellchecker
475
1675925
''' Testing Module '''
0
0
0
0
0
0
test/package/setup.py
e3krisztian/shiv
1,395
1675926
<reponame>e3krisztian/shiv<filename>test/package/setup.py import setuptools from setuptools import setup setup( name="hello", packages=["hello"], package_data={"": ["script.sh"]}, entry_points={"console_scripts": ["hello = hello:main"]}, )
0
0
0
0
0
0
rpcore/gui/render_mode_selector.py
bluekyu/RenderPipeline
1,031
1675954
<reponame>bluekyu/RenderPipeline """ RenderPipeline Copyright (c) 2014-2016 tobspr <<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 in the Software without restriction, including without limitation the...
0
0
0
0
0
0
tools/style_variable_generator/base_generator.py
chromium/chromium
14,668
1675967
<reponame>chromium/chromium # 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. import os import sys import collections import re import textwrap from style_variable_generator import path_overrides from style_...
0
0
0
0
0
0
file/read-lines-between-two-values/main-find.py
whitmans-max/python-examples
140
1676000
<filename>file/read-lines-between-two-values/main-find.py #!/usr/bin/env python3 text = '''DATA_out file values DATA_LINE 1 DATA_LINE 2 DATA_LINE 3 DATA_LINE 4 total ''' start = text.find('values') end = text.find('total', start) if start > -1 and end > -1: start += len("values") prin...
0
0
0
0
0
0
pylayers/measures/test/test_exploith5.py
usmanwardag/pylayers
143
1676002
import numpy as np from pylayers.measures.vna.E5072A import * from pylayers.measures.parker.smparker import * from pylayers.antprop.channel import * from pylayers.measures.exploith5 import * M = Mesh5('mimocal8_4_V1') #M.plot(cmd='mes',mes='mes1',lg=[2,0,1,0]) #M.plot(cmd='cal',mes='mes1',lg=[2,0,1,0]) #M.plot(cmd='r...
0
0
0
0
0
0
src/genie/libs/parser/ios/tests/ShowLogging/cli/equal/golden_output_3_expected.py
balmasea/genieparser
204
1676014
<reponame>balmasea/genieparser expected_output = { "syslog_logging":{ "enabled":{ "counters":{ "messages_dropped": 0, "messages_rate_limited": 0, "flushes": 0, "overruns": 0, "xml": "disabled", "filtering": "disabled" ...
0
0
0
0
0
0
DQM/SiPixelPhase1Common/python/SiPixelPhase1GeometryDebug_cfi.py
ckamtsikis/cmssw
852
1676072
import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDHarvester import DQMEDHarvester from DQM.SiPixelPhase1Common.HistogramManager_cfi import * DefaultHistoDebug = DefaultHisto.clone( topFolderName = "PixelPhase1/Debug" ) SiPixelPhase1GeometryDebugDetId = DefaultHistoDebug.clone( name = "debug_deti...
0
0
0
0
0
0
image_classification/DeiT/tests/test_auto_augment.py
no-name-xiaosheng/PaddleViT
993
1676083
# Copyright (c) 2021 PPViT 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 applicable...
0
0
0
0
0
0
utils/test/MilitaryFeaturesTestRunner.py
Pandinosaurus/solutions-geoprocessing-toolbox
113
1676092
<reponame>Pandinosaurus/solutions-geoprocessing-toolbox # coding: utf-8 ''' ------------------------------------------------------------------------------ Copyright 2015 - 2017 Esri Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You m...
0
0
0
0
0
0
locations/spiders/gianteagle.py
davidchiles/alltheplaces
297
1676097
# -*- coding: utf-8 -*- import json import re import scrapy from locations.items import GeojsonPointItem from locations.hours import OpeningHours DAY_MAPPING = { 1: "Su", 2: "Mo", 3: "Tu", 4: "We", 5: "Th", 6: "Fr", 7: "Sa" } class GiantEagleSpider(scrapy.Spider): name: str = "giant...
0
2
6
0
8
0
PhysicsTools/PatAlgos/test/patTuple_addTracks_cfg.py
ckamtsikis/cmssw
852
1676129
<reponame>ckamtsikis/cmssw ## import skeleton process from PhysicsTools.PatAlgos.patTemplate_cfg import * #process.Tracer = cms.Service("Tracer") process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff") patAlgosToolsTask.add(process.patCandidatesTask) #Temporary customize to the unit tests that fail du...
0
0
0
0
0
0
tools/perf/benchmarks/loading.py
google-ar/chromium
777
1676132
<gh_stars>100-1000 # Copyright 2016 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. from core import perf_benchmark import page_sets import ct_benchmarks_util from benchmarks import page_cycler_v2 from telemetry import be...
0
0
0
0
0
0
Language Skills/Python/Unit 11 Introduction to Classes/01 Introduction to classes/Inheritance/13-Override.py
WarHatch/Codecademy-Exercise-Answers
346
1676137
<gh_stars>100-1000 class Employee(object): """Models real-life employees!""" def __init__(self, employee_name): self.employee_name = employee_name def calculate_wage(self, hours): self.hours = hours return hours * 20.00 # Add your code below! class PartTimeEmployee(Employee): ...
0
0
0
0
0
0
asq/test/test_element_at.py
sixty-north/asq
175
1676154
<reponame>sixty-north/asq<gh_stars>100-1000 import unittest from asq.queryables import Queryable from asq.test.test_queryable import infinite __author__ = "<NAME>" class TestElementAt(unittest.TestCase): def test_element_at(self): a = [1, 2, 4, 8, 16, 32, 64, 128] b = Queryable(a).element_at(3) ...
0
0
0
0
0
0
src/research/_compile_usa_model.py
mzy2240/GridCal
284
1676160
import os import pandas as pd from GridCal.Engine import * folder = '/home/santi/Descargas/USATestSystem/SyntheticUSA_IV' branch_df = pd.read_csv(os.path.join(folder, 'branch.csv')) bus_df = pd.read_csv(os.path.join(folder, 'bus.csv')) bus2sub_df = pd.read_csv(os.path.join(folder, 'bus2sub.csv')) dcline_df = pd.read...
0
0
0
0
0
0
publisher/options.py
mwidjaja1/scipy_proceedings
116
1676185
from __future__ import annotations """ Configuration utilities. """ from __future__ import print_function, unicode_literals __all__ = ['options'] import os.path import json import io import codecs from contextlib import contextmanager import conf toc_conf = conf.toc_conf proc_conf = conf.proc_conf other_conf = c...
0
3
0
0
3
0
jiant/jiant/utils/zlog.py
wh629/CNLI-generalization
1,108
1676196
<reponame>wh629/CNLI-generalization import os import time import torch import traceback from contextlib import contextmanager import jiant.utils.python.io as py_io import jiant.utils.python.filesystem as filesystem class BaseZLogger: def log_context(self): raise NotImplementedError() def write_entr...
0
0
0
0
0
0
test/test_indent.py
nschneid/acl-anthology
221
1676217
#!/usr/bin/env python3 import sys import lxml.etree as etree from anthology.utils import indent filename = "data/test.xml" tree = etree.parse(filename) root = tree.getroot() indent(root) print(etree.tostring(root).decode("utf-8"))
0
0
0
0
0
0
setup.py
smalldragonvt/curlify
225
1676246
<reponame>smalldragonvt/curlify # coding: utf-8 import os from setuptools import setup, Command class CleanCommand(Command): """Custom clean command to tidy up the project root.""" user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(sel...
0
0
0
0
0
0
numba/core/optional.py
auderson/numba
6,620
1676249
<filename>numba/core/optional.py<gh_stars>1000+ import operator from numba.core import types, typing, cgutils from numba.core.imputils import (lower_cast, lower_builtin, lower_getattr_generic, impl_ret_untracked, lower_setattr_generic) def always_ret...
0
0
0
0
0
0
src/tools/package.py
loongson-zn/build
215
1676265
# Status: ported # Base revision: 64488 # # Copyright (c) 2005, 2010 <NAME>. # Copyright 2006 <NAME>. # # Use, modification and distribution is subject to the Boost Software # License Version 1.0. (See accompanying file LICENSE.txt or # https://www.bfgroup.xyz/b2/LICENSE.txt) # Provides mechanism for installing whole ...
5
1
0
0
6
0
examples/text_matching/simnet/model.py
JeremyZhao1998/PaddleNLP
7,091
1676270
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
32
5
0
0
37
0
examples/ppo/train.py
cg31/cule
208
1676281
import math import time import torch import torch.cuda.nvtx as nvtx import numpy as np import torch.nn.functional as F import torch.optim as optim import torch.utils.data from tqdm import tqdm from utils.initializers import args_initialize, env_initialize, log_initialize, model_initialize from a2c.helper import call...
0
2
0
0
2
0
blackmamba/lib/rope/base/simplify.py
oz90210/blackmamba
463
1676303
"""A module to ease code analysis This module is here to help source code analysis. """ import re from rope.base import codeanalyze, utils @utils.cached(7) def real_code(source) -> object: """Simplify `source` for analysis It replaces: * comments with spaces * strs with a new str filled with space...
0
2
0
0
2
0
tests/core/array/test_basic_ops.py
gohar94/nums
111
1676318
# coding=utf-8 # Copyright (C) 2020 NumS Development Team. # # 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...
7
0
0
0
7
0
users/migrations/0019_auto_20200809_1616.py
ujlbu4/vas3k.club
496
1676321
<reponame>ujlbu4/vas3k.club # Generated by Django 3.1 on 2020-08-09 16:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0018_user_stripe_id'), ] operations = [ migrations.AlterField( model_name='user', ...
0
0
0
0
0
0
athena/data/datasets/speaker_recognition.py
wgfi110/athena
791
1676326
<reponame>wgfi110/athena<filename>athena/data/datasets/speaker_recognition.py # coding=utf-8 # Copyright (C) 2020 ATHENA AUTHORS; <NAME> # # 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 # # ...
0
0
0
0
0
0
riko/bado/microdom.py
nerevu/riko
1,716
1676336
<gh_stars>1000+ # -*- test-case-name: twisted.web.test.test_xml -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Micro Document Object Model: a partial DOM implementation with SUX. This is an implementation of what we consider to be the useful subset of the DOM. The chief advantage of ...
0
0
0
0
0
0
Single_State_Contracts/Single_State.py
Oribaba1/Smart_Contacts
343
1676361
# This is a stateless smart contract that enables participants to send Choice Coin to others. def choice_flip(receiver,sender_mnemonic,sender_address,amount,comment): parameters = algod_client.suggested_params() error = '' amount = int(amount) if encoding.is_valid_address(receiver) and encoding.is_valid...
0
0
0
0
0
0
dirigible/fts/tests/test_2595_Spinner.py
EnoX1/dirigible-spreadsheet
168
1676381
# Copyright (c) 2010 Resolver Systems Ltd. # All Rights Reserved # from functionaltest import FunctionalTest class Test_2595_Throbber(FunctionalTest): def test_spinner_appears_during_recalcs(self): # * Harold likes to know when dirigible is working hard on his calculations # * He ...
0
0
0
0
0
0
flash/core/serve/dag/visualize.py
Actis92/lightning-flash
1,457
1676385
from __future__ import annotations from contextlib import suppress from io import BytesIO from flash.core.serve.dag.task import get_deps from flash.core.serve.execution import TaskComposition with suppress(ImportError): import graphviz def _dag_to_graphviz(dag, dependencies, request_data, response_data, *, no_o...
5
2
0
0
7
0
pyGPs/Demo/Regression/demo_GPR.py
Corentin-LF/pyGPs
196
1676393
<reponame>Corentin-LF/pyGPs<filename>pyGPs/Demo/Regression/demo_GPR.py from __future__ import print_function #================================================================================ # <NAME> [marion dot neumann at uni-bonn dot de] # <NAME> [dan dot marthaler at gmail dot com] # <NAME> [shan dot huang ...
0
0
0
0
0
0
code/run_finetune.py
seanliu96/OptiPrompt
131
1676394
<filename>code/run_finetune.py<gh_stars>100-1000 import json import argparse import os import random import sys import logging from tqdm import tqdm import torch from models import Prober from utils import load_vocab, load_data, batchify, save_model, evaluate, get_relation_meta from transformers import AdamW, get_lin...
0
0
0
0
0
0
src/modules/multihead_attention.py
awesome-archive/inversecooking
591
1676413
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # https://github.com/pytorch/fairseq. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from __future__ import annotations im...
9
9
0
1
19
0
setup.py
adamzhang1987/py-etherscan-api
458
1676414
import setuptools setuptools.setup( name='py_etherscan_api', version='0.9.0', packages=['examples', 'examples.stats', 'examples.tokens', 'examples.accounts', 'examples.blocks', 'examples.transactions', 'etherscan'], url='https://github.com/corpetty/py-etherscan-api', license='MIT', ...
0
0
0
0
0
0
Chapter07/fcn.py
dcastf01/Hands-On-Computer-Vision-with-TensorFlow-2
336
1676428
""" File name: fcn Author: <NAME> Date created: 17.02.2019 Date last modified: 16:59 17.02.2019 Python Version: "3.6" Copyright = "Copyright (C) 2018-2019 of Packt" Credits = ["<NAME>, <NAME>"] License = "MIT" Version = "1.0.0" Maintainer = "non" Status = "Prototype" # "Prototype", "Development", or "Production" """ ...
2
1
0
0
3
0
robot-server/tests/errors/test_error_responses.py
knownmed/opentrons
235
1676442
"""Tests for API error exceptions and response model serialization.""" from robot_server.errors.error_responses import ( ApiError, ErrorSource, ErrorDetails, ErrorResponse, LegacyErrorResponse, MultiErrorResponse, ) def test_error_details() -> None: """It should serialize an error response...
0
5
0
0
5
0
pyscf/fci/direct_spin0_symm.py
QuESt-Calculator/pyscf
501
1676463
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
43
13
0
1
57
0
tests/test_specials_sierra_10_12.py
scanner/osxphotos
656
1676484
<reponame>scanner/osxphotos # Test cloud photos import pytest PHOTOS_DB = "./tests/Test-10.12.6.photoslibrary/database/photos.db" UUID_DICT = {"no_specials": "Pj99JmYjQkeezdY2OFuSaw"} def test_portrait(): import osxphotos photosdb = osxphotos.PhotosDB(PHOTOS_DB) # photos = photosdb.photos(uuid=[UUID_D...
0
0
0
0
0
0
test/backend/test_views/test_main.py
bnbwebexpertise/linkr
124
1676501
<reponame>bnbwebexpertise/linkr<filename>test/backend/test_views/test_main.py import linkr # flake8: noqa: F401 import views.main from test.backend.factory import LinkFactory from test.backend.test_case import LinkrTestCase class TestMain(LinkrTestCase): _multiprocess_can_split_ = True def test_alias_route...
0
0
0
0
0
0
crank/feature/__init__.py
abeersaqib/crank
162
1676510
from .feature import Feature # noqa
0
0
0
0
0
0
examples/git/git_remote.py
eaaltonen/docopt
5,125
1676514
""" usage: git remote [-v | --verbose] git remote add [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url> git remote rename <old> <new> git remote rm <name> git remote set-head <name> (-a | -d | <branch>) git remote [-v | --verbose] show [-n] <name> git remote prune [-n | ...
0
0
0
0
0
0
tsp_solvers/tsp_solver_ropt.py
juicetinliu/VeRyPy
156
1676527
<filename>tsp_solvers/tsp_solver_ropt.py # -*- coding: utf-8 -*- # Written in Python 2.7, but try to maintain Python 3+ compatibility from __future__ import print_function from __future__ import division from util import objf from local_search.intra_route_operators import do_2opt_move, do_3opt_move from random impor...
0
0
0
0
0
0
Alfred/Alfred.alfredpreferences/workflows/user.workflow.CCED065A-2EF4-454A-9E4B-CC363272CC2C/workflow/background.py
LumpyChen/mac-conf
442
1676543
#!/usr/bin/env python # encoding: utf-8 # # Copyright © 2014 <EMAIL> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2014-04-06 # from __future__ import annotations """ Run background tasks """ from __future__ import print_function, unicode_literals import sys import os import subprocess impor...
3
7
0
0
10
0
datasets/build_cub_bird200_zeroshot.py
Mithilesh1609/assembled-cnn
363
1676544
#!/usr/bin/env python # coding=utf8 from __future__ import annotations from __future__ import absolute_import from __future__ import division from __future__ import print_function """BFE 논문의 성능 비교를 위해 CUB BIRD200-2011 를 생성한다.""" import os import random import argparse import sys sys.path.append('./') sys.path.append...
2
4
0
0
6
0
SimTracker/TrackerMaterialAnalysis/python/trackingMaterialAnalyser_ForPhaseII_cff.py
ckamtsikis/cmssw
852
1676557
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms # Analyze and plot the tracking material from SimTracker.TrackerMaterialAnalysis.trackingMaterialAnalyser_ForPhaseII_cfi import *
0
0
0
0
0
0
gitpandas/utilities/check_api.py
Liambeguin/git-pandas
202
1676558
<filename>gitpandas/utilities/check_api.py """ A little utility to figure out all of the parameter names in git-pandas, and make sure we aren't mixing up language in different functions. """ import gitpandas as module import inspect import json __author__ = 'willmcginnis' def extract_objects(m, classes=True, funct...
0
0
0
0
0
0
tests/integration/cartography/intel/aws/test_route53.py
sckevmit/cartography
2,322
1676559
<gh_stars>1000+ import cartography.intel.aws.route53 import cartography.util import tests.data.aws.route53 TEST_UPDATE_TAG = 123456789 TEST_ZONE_ID = "TESTZONEID" TEST_ZONE_NAME = "TESTZONENAME" TEST_AWS_ACCOUNTID = "AWSID" TEST_AWS_REGION = "us-east-1" def _ensure_local_neo4j_has_test_route53_records(neo4j_session)...
0
0
0
0
0
0
Lib/codeop.py
shawwn/cpython
6,989
1676574
r"""Utilities to compile possibly incomplete Python source code. This module provides two interfaces, broadly similar to the builtin function compile(), which take program text, a filename and a 'mode' and: - Return code object if the command is complete and valid - Return None if the command is incomplete - Raise Sy...
4
5
0
0
9
0
src/python/ipc-example.py
laurelkeys/tev
601
1676575
<filename>src/python/ipc-example.py<gh_stars>100-1000 #!/usr/bin/env python3 # This file was developed by <NAME> & <NAME> <<EMAIL>>. # It is published under the BSD 3-Clause License within the LICENSE file. """ Example usage of tev's Python IPC implementation. """ from ipc import TevIpc import numpy as np if __name...
0
0
0
0
0
0
eth2deposit/cli/generate_keys.py
mxmar/network-deposit-cli
302
1676577
<gh_stars>100-1000 import os import click from typing import ( Any, Callable, ) from eth_typing import HexAddress from eth_utils import is_hex_address, to_normalized_address from eth2deposit.credentials import ( CredentialList, ) from eth2deposit.exceptions import ValidationError from eth2deposit.utils.va...
0
0
0
0
0
0
wrappers/python/tests/ledger/test_submit_request.py
sklump/indy-sdk
636
1676582
<gh_stars>100-1000 import datetime import json import logging import time import pytest from indy import ledger, anoncreds, blob_storage, error @pytest.mark.asyncio async def test_submit_request_works(pool_handle): request = { "reqId": 1491566332010860, "identifier": "Th7MpTaRZVRYnPiabds81Y", ...
0
0
0
0
0
0
pyth-pard68/pyth-src/server.py
cco3/challenge-2019-06
254
1676585
<reponame>cco3/challenge-2019-06 #!venv/bin/python from flask import Flask, render_template, request, Response import os import time import subprocess app = Flask(__name__, template_folder='.', static_folder='.') @app.route('/') def root(): time_in_secs = os.path.getmtime('pyth.py') time_in_python = time.gmt...
0
0
0
0
0
0
utils/random_code.py
amiltonwong/mil-segment-pytorch
630
1676592
<reponame>amiltonwong/mil-segment-pytorch # camera-ready # this file contains code snippets which I have found (more or less) useful at # some point during the project. Probably nothing interesting to see here. import pickle import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import numpy as np ...
0
0
0
0
0
0
tools/esp_prov/proto/__init__.py
lovyan03/esp-idf
8,747
1676595
<gh_stars>1000+ # Copyright 2018 Espressif Systems (Shanghai) PTE LTD # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
0
0
0
0
0
0
tests/core/filter-utils/test_filter_helpers.py
kclowes/eth-tester
234
1676650
<reponame>kclowes/eth-tester<gh_stars>100-1000 from __future__ import unicode_literals import pytest from eth_utils import ( big_endian_to_int, is_list_like, ) from eth_tester.utils.filters import ( check_single_topic_match, check_if_from_block_match, check_if_to_block_match, check_if_topics_m...
0
0
0
0
0
0
Fast-PTransE/PCRA.py
xw-666/Fast-TransX
380
1676679
<gh_stars>100-1000 import os,sys import math import random import time def map_add(mp, key1,key2, value): if (key1 not in mp): mp[key1] = {} if (key2 not in mp[key1]): mp[key1][key2] = 0.0 mp[key1][key2] += value def map_add1(mp,key): if (key not in mp): mp[key] = 0 mp[key]...
0
0
0
0
0
0
scripts/swapTest/swap_test.py
jccf091/Sovryn-smart-contracts
108
1676681
<reponame>jccf091/Sovryn-smart-contracts #!/usr/bin/python3 from brownie import * from brownie.network.contract import InterfaceContainer from brownie.network.state import _add_contract import shared import json with open('./scripts/swapTest/swap_test.json') as config_file: data = json.load(config_file) def main(...
0
0
0
0
0
0
core/migrations/0001_initial.py
loic5/babybuddy
480
1676689
<reponame>loic5/babybuddy # -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-08-19 20:13 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_de...
0
0
0
0
0
0
syzygy/trace/service/service.gyp
nzeh/syzygy
343
1676707
<reponame>nzeh/syzygy # Copyright 2012 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...
0
0
0
0
0
0
docs/examples/fig6p1.py
uluturki/Mathematics-of-Epidemics-on-Networks
136
1676715
import networkx as nx import EoN from collections import defaultdict import matplotlib.pyplot as plt import scipy colors = ['#5AB3E6','#FF2000','#009A80','#E69A00', '#CD9AB3', '#0073B3','#F0E442'] def getMs(counts) -> tuple[object, object, object]: r'''used for figure 6.3 to get the values of M1, Mstar, and M2...
0
1
0
0
1
0
drl_grasping/algorithms/common/features_extractor/modules.py
Tiamat-Tech/drl_grasping
126
1676728
import ocnn import torch class OctreeConvRelu(torch.nn.Module): def __init__(self, depth, channel_in, channel_out, kernel_size: list[int]=[3], stride: int=1): super(OctreeConvRelu, self).__init__() self.conv = ocnn.OctreeConv(depth, channel_in, ...
20
8
0
0
28
0
flexxamples/howtos/send_data.py
tbnorth/flexx
1,662
1676737
# doc-export: SendData """ Example that demonstrates sending (binary) array data from Python to JS. The ``SendDataView`` widget (a ``JsComponent``) has an action to display the data. This action is invoked from Python, with an array as input. The action invokation is serialized with BSDF (http://bsdf.io), which native...
0
1
2
0
3
0
blocks/initialization.py
KIKOcaoyue/blocks
1,067
1676760
<filename>blocks/initialization.py<gh_stars>1000+ """Objects for encapsulating parameter initialization strategies.""" from abc import ABCMeta, abstractmethod import numbers import numpy import theano from six import add_metaclass from blocks.utils import repr_attrs, pack @add_metaclass(ABCMeta) class NdarrayInitia...
0
0
0
0
0
0
tests/parsers/sqlite_plugins/chrome_history.py
roshanmaskey/plaso
1,253
1676780
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the Google Chrome History database plugin.""" import unittest from plaso.lib import definitions from plaso.parsers.sqlite_plugins import chrome_history from tests.parsers.sqlite_plugins import test_lib class GoogleChrome8HistoryPluginTest(test_lib.SQLiteP...
0
0
0
0
0
0
sdk/agrifood/azure-agrifood-farming/azure/agrifood/farming/operations/_weather_operations.py
rsdoherty/azure-sdk-for-python
2,728
1676786
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
10
12
0
0
22
0
Incident-Response/Tools/dfirtrack/dfirtrack_config/migrations/0007_artifactpriority.py
sn0b4ll/Incident-Playbook
273
1676794
<filename>Incident-Response/Tools/dfirtrack/dfirtrack_config/migrations/0007_artifactpriority.py from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dfirtrack_config', '0006_mainconfigmodel_artifactstatus_open'), ] operations = [ migrations....
0
0
0
0
0
0
h/migrations/versions/5ed9c8c105f6_add_authority_provided_id_field_to_group.py
pombredanne/h
2,103
1676807
""" Add authority_provided_id field, index to group. This will allow clients of the API, in certain circumstances, to set a unique-to-authority identifier on a group, versus having to use the service-generated ``pubid``. This ``authority_provided_id`` can be used to perform certain actions on the group without having ...
0
0
0
0
0
0
unfurl/init.py
john-gaughan/unfurl
109
1676813
# Copyright (c) 2020 <NAME> # SPDX-License-Identifier: MIT from __future__ import annotations """ This module implements creating and cloning project and ensembles as well Unfurl runtimes. """ import datetime import os import os.path import random import shutil import string import sys import uuid import logging from j...
28
33
0
8
69
0
autoload/SimplenoteNew.py
Andrea-Augello/simplenote.vim
208
1676823
<filename>autoload/SimplenoteNew.py<gh_stars>100-1000 def SimplenoteNew(): interface.create_new_note_from_current_buffer() try: set_cred() SimplenoteNew() except simplenote.SimplenoteLoginFailed: # Note: error has to be caught here and not in __init__ reset_user_pass('Login Failed. Check token?') ...
0
0
0
0
0
0
src/obfuscapk/obfuscators/new_alignment/new_alignment.py
Elyorbe/Obfuscapk
688
1676829
<reponame>Elyorbe/Obfuscapk #!/usr/bin/env python3 import logging from obfuscapk import obfuscator_category from obfuscapk.obfuscation import Obfuscation class NewAlignment(obfuscator_category.ITrivialObfuscator): def __init__(self): self.logger = logging.getLogger( "{0}.{1}".format(__name__...
0
0
0
0
0
0
DataUtils/__init__.py
bamtercelboo/pytorch_NER_PosTag_BiLSTM_CRF
313
1676870
<reponame>bamtercelboo/pytorch_NER_PosTag_BiLSTM_CRF # @Author : bamtercelboo # @Datetime : 2018/8/23 17:39 # @File : __init__.py # @Last Modify Time : 2018/8/23 17:39 # @Contact : <EMAIL>, <EMAIL>} """ FILE : __init__.py FUNCTION : None """
0
0
0
0
0
0