max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
tools/add_new_quantization_parameters.py
xiao1228/nncf
310
16000
""" Copyright (c) 2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
1.96875
2
src/backend/marsha/core/migrations/0019_auto_20200609_0820.py
marin-leonard/marsha
64
16001
<reponame>marin-leonard/marsha # Generated by Django 3.0.6 on 2020-05-19 14:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("core", "0018_auto_20200603_0620"), ] operations = [ migrations.AddField( model_name="video", ...
1.773438
2
models/video_base.py
vedaldi/dynamic-video-depth
1
16002
<filename>models/video_base.py<gh_stars>1-10 # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
1.890625
2
update-tuya-address.py
mwinters-stuff/octoprint-update-tuya-address
0
16003
#!/usr/bin/python3 import subprocess import yaml try: from yaml import CLoader as Loader, CDumper as Dumper except ImportError: from yaml import Loader, Dumper #MAC address of the smart plug MAC_ADDRESS = '84:f3:eb:32:e3:b4' # netmask of your network NET_MASK = '192.168.1.1/24' #octopi config OCTOPI_CONFIG = ...
2.265625
2
sarpy_gui_apps/apps/canvas_demo/panels/canvas_demo_button_panel.py
spowlas/sarpy
0
16004
from tkinter_gui_builder.panel_templates.widget_panel.widget_panel import AbstractWidgetPanel from tkinter_gui_builder.widgets import basic_widgets class CanvasDemoButtonPanel(AbstractWidgetPanel): fname_select = basic_widgets.Button zoom_in = basic_widgets.Button zoom_out = basic_widgets.Button rect_...
2.71875
3
GCN/test_until.py
Alienge/Graph-Network
3
16005
<gh_stars>1-10 import torch import numpy as np import scipy.sparse as sp def sparse_to_tuple(sparse_mx): """Convert sparse matrix to tuple representation.""" def to_tuple(mx): if not sp.isspmatrix_coo(mx): mx = mx.tocoo() coords = np.vstack((mx.row, mx.col)).transpose() value...
2.65625
3
mechmean/fabric_tensors.py
JulianKarlBauer/meanfieldmechanics
0
16006
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import mechkit import mechmean class KanataniFactory(object): def __init__(self, N): self.con = mechkit.notation.Converter() self._I2 = mechkit.tensors.Basic().I2 self.N = N = self.con.to_tensor(N) self.degree = le...
2.609375
3
setup.py
adamltyson/fancylog
3
16007
from setuptools import setup, find_packages setup( name="fancylog", version="0.2.6", description="Fancier logging in Python", install_requires=["packaging", "rich"], extras_require={ "dev": [ "black", "pytest-cov", "pytest", "coverage", ...
1.21875
1
tests/test_identity.py
multiscale/ymmsl-python
1
16008
from ymmsl import Identifier, Reference import pytest import yatiml def test_create_identifier() -> None: part = Identifier('testing') assert str(part) == 'testing' part = Identifier('CapiTaLs') assert str(part) == 'CapiTaLs' part = Identifier('under_score') assert str(part) == 'under_score...
2.390625
2
molecule/loadbalancer/tests/test_default.py
mvdheenux/OpenConext-deploy
11
16009
import os import pytest import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') @pytest.mark.parametrize("installed_packages", [ ("haproxy20"), ("socat"), ("keepalived"), ("bind"), ]) def test_p...
1.898438
2
tiledb/cloud/_results/results.py
TileDB-Inc/TileDB-Cloud-Py
4
16010
<filename>tiledb/cloud/_results/results.py<gh_stars>1-10 """Things that help you keep track of task results and how to decode them.""" import abc import dataclasses import threading import uuid from concurrent import futures from typing import Callable, Generic, Optional, TypeVar, Union import urllib3 from tiledb.cl...
2.40625
2
test2/mining/mining.py
gr0mph/OceanOfCode
0
16011
<gh_stars>0 import sys sys.path.append('../../') # Global variables from test2.test_main import TREASURE_MAP from test2.test_main import MINE_MAP # From OceanOfCode # Class from OceanOfCode import MineAndTrigger from OceanOfCode import Submarine from OceanOfCode import Board # Global from OceanOfCode import EMPTY_SY...
2.6875
3
dfdatetime/__init__.py
joachimmetz/dfdatetime
0
16012
# -*- coding: utf-8 -*- """Digital Forensics Date and Time (dfDateTime). dfDateTime, or Digital Forensics date and time, provides date and time objects to preserve accuracy and precision. """ # Imports for date time values factory. from dfdatetime import apfs_time from dfdatetime import cocoa_time from dfdatetime imp...
1.75
2
common/data/selectionhelper.py
alainjungo/reliability-challenges-uncertainty
56
16013
<filename>common/data/selectionhelper.py import logging import json import zlib import os import pymia.data.extraction as extr def save_indices(file_path: str, indices: list): config = {'indices': indices} with open(file_path, 'w') as f: json.dump(config, f) def load_indices(file_path: str): wi...
2.234375
2
src/main/TextLemmatizer.py
alschmut/code2semantics
2
16014
import sys from util.Timer import Timer from util.FileOpener import FileOpener from util.Logger import Logger from util.PathExtractor import PathExtractor from util.PathValidator import PathValidator from service import SpacyModel def lemmatize_text(file_path: str, timer: Timer): logger = Logger() output_file = File...
2.78125
3
mat2py/core/graph2d.py
mat2py/mat2py
0
16015
<reponame>mat2py/mat2py<filename>mat2py/core/graph2d.py # type: ignore __all__ = [ "plotyy", "figtoolset", "getscribecontextmenu", "getobj", "scribeeventhandler", "setscribecontextmenu", "putdowntext", "gtext", "scribetextdlg", "doresize", "prepdrag", "scriberestoresavef...
2.078125
2
run.py
Arthurdb1999/dash-plotly-example
0
16016
from app import app if __name__ == '__main__': app.run_server(port=5000, debug=True, host='localhost')
1.65625
2
rasa/train_init.py
BarnikRay/chatbot
1
16017
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import logging from rasa_core.agent import Agent from rasa_core.policies.keras_policy import KerasPolicy from rasa_core.policies.memoization import MemoizationPolicy def run_faq(domain_file="config/faq_dom...
2.125
2
examples/passage_ranking.py
skirdey/FARM
1,551
16018
# fmt: off import logging from pathlib import Path from farm.data_handler.data_silo import DataSilo from farm.data_handler.processor import RegressionProcessor, TextPairClassificationProcessor from farm.experiment import initialize_optimizer from farm.infer import Inferencer from farm.modeling.adaptive_model import Ad...
1.921875
2
extended_data_provider.py
NicolaOrritos/pricenet
0
16019
#!/usr/bin/env python import numpy as np import pandas as pd import json import pytz def _get_data(file): return pd.read_csv(file) def _get_prices(data): df = data rome_tz = pytz.timezone('Europe/Rome') df['time'] = pd.to_datetime(df['Timestamp'], unit='s') df['time'].dt.tz_localize(pytz.UTC...
2.703125
3
django_alive/tests/test_command.py
lincolnloop/django-alive
25
16020
import sys from django.core.management import CommandError, call_command from django.test import TestCase from .side_effects import bad_database_check try: from unittest.mock import patch except ImportError: from mock import patch # Python 2.7 support if sys.version_info > (3, 0): from io import StringI...
2.40625
2
main.py
fanicia/file-backup
0
16021
from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler # importing the modules import os.path import shutil import datetime import time import re # getting the current working directory src_dir = os.getcwd() # printing current directory print("########## File-backup started ######...
2.515625
3
tests/ignite/distributed/comp_models/test_native.py
Eunjnnn/ignite
4,119
16022
import os import pytest import torch import torch.distributed as dist from ignite.distributed.comp_models import has_native_dist_support if not has_native_dist_support: pytest.skip("Skip if no native dist support", allow_module_level=True) else: from ignite.distributed.comp_models.native import _expand_hostl...
2.015625
2
src/popular_consistent_items/popular_consistent_items.py
masinag/popular_twitter_topics_mining
0
16023
import pandas as pd from .apriori_opt import apriori as apriori_opt from .apriori_basic import apriori as apriori_basic # from memory_profiler import profile from .utils import log def get_frequent_items_in_time(tweets, s, r, a, start=None, end=None, basic=False): if tweets.empty: return [] if not st...
2.6875
3
txt/test/teste.py
juliano777/apostila_python
3
16024
<reponame>juliano777/apostila_python #_*_ encoding: utf-8 _*_ import time ''' Fibonacci function ''' def fibo(n): if (n < 2): return n else: return fibo(n - 1) + fibo(n - 2) ''' Memoize function ''' def memoize(f): # dictionary mem = {} ''' Helper function ''' def memoizer(*param): ...
3.640625
4
Tests/Methods/Mesh/test_get_field.py
IrakozeFD/pyleecan
0
16025
<reponame>IrakozeFD/pyleecan<gh_stars>0 # -*- coding: utf-8 -*- import pytest import numpy as np from unittest import TestCase from SciDataTool import DataTime, Data1D, DataLinspace, VectorField from pyleecan.Classes.SolutionData import SolutionData from pyleecan.Classes.SolutionMat import SolutionMat from pyleecan....
2.4375
2
python/services/compute/beta/reservation.py
trodge/declarative-resource-client-library
16
16026
<reponame>trodge/declarative-resource-client-library # Copyright 2021 Google LLC. 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...
1.898438
2
Examples/cimpleCraft/cimple4.py
shaesaert/TuLiPXML
1
16027
# Import modules from __future__ import print_function import sys import numpy as np from polytope import box2poly from tulip import hybrid from tulip.abstract import prop2part, discretize import Interface.DSL as DSL from Interface import Statechart as dumpsmach from Interface.Reduce import * from Interface.Transfor...
2.328125
2
CableClub/cable_club_colosseum.py
V-FEXrt/Pokemon-Spoof-Plus
2
16028
<gh_stars>1-10 from AI.team_manager import TeamManager from CableClub.cable_club_constants import Com out_byte = 0 last_recieved = 0 count = 0 def colosseum_process_byte(byte): global out_byte, last_recieved, count if byte >= Com.ATTACK_MOVE_1 and byte <= Com.SWITCH_POKEMON_6: if count == 12: ...
2.046875
2
workflow/wrappers/bio/popoolation2/indel_filtering_identify_indel_regions/wrapper.py
NBISweden/manticore-smk
0
16029
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "<NAME>" __copyright__ = "Copyright 2020, <NAME>" __email__ = "<EMAIL>" __license__ = "MIT" import os import re import tempfile from snakemake.shell import shell from snakemake.utils import logger log = snakemake.log_fmt_shell(stdout=True, stderr...
2.15625
2
open_publishing/provision/progression_rule.py
open-publishing/open-publishing-api
0
16030
from open_publishing.core import SequenceItem, SequenceField, SequenceItemProperty from open_publishing.core import FieldDescriptor, DatabaseObjectField, SimpleField from open_publishing.user import User from open_publishing.core.enums import ValueStatus from open_publishing.core.enums import ProvisionRuleRole, Provisi...
1.929688
2
forms/utils.py
braceio/forms
36
16031
<reponame>braceio/forms<gh_stars>10-100 from datetime import timedelta from functools import update_wrapper from flask import make_response, current_app, request, url_for, jsonify import uuid # decorators def crossdomain(origin=None, methods=None, headers=None, max_age=21600, attach_to_all=True, ...
2.34375
2
tests/ref_test.py
lykme516/pykka
1
16032
<filename>tests/ref_test.py import time import unittest from pykka import ActorDeadError, ThreadingActor, ThreadingFuture, Timeout class AnActor(object): def __init__(self, received_message): super(AnActor, self).__init__() self.received_message = received_message def on_receive(self, messa...
2.578125
3
tests/unit/test_baseObject.py
asaranprasad/nvda
1
16033
<reponame>asaranprasad/nvda #tests/unit/test_baseObject.py #A part of NonVisual Desktop Access (NVDA) #This file is covered by the GNU General Public License. #See the file COPYING for more details. #Copyright (C) 2018 NV Access Limited, Babbage B.V. """Unit tests for the baseObject module, its classes and their...
2.140625
2
querybook/server/lib/query_executor/connection_string/hive.py
shivammmmm/querybook
1,144
16034
import re from typing import Dict, Tuple, List, NamedTuple, Optional from lib.utils.decorators import with_exception_retry from .helpers.common import ( split_hostport, get_parsed_variables, merge_hostport, random_choice, ) from .helpers.zookeeper import get_hostname_and_port_from_zk # TODO: make thes...
2.265625
2
flopz/__init__.py
Flopz-Project/flopz
7
16035
<reponame>Flopz-Project/flopz<filename>flopz/__init__.py """ flopz. Low Level Assembler and Firmware Instrumentation Toolkit """ __version__ = "0.2.0" __author__ = "Noelsch<EMAIL>"
0.867188
1
OracleCASB_API_Client/occs.py
ftnt-cse/Oracle_CASB_API_Client
0
16036
<filename>OracleCASB_API_Client/occs.py #!/usr/bin/env python3 import sys, logging import requests, json, argparse, textwrap from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) from oracle_casb_api import * parser = argparse.Argum...
2.46875
2
src/classification_metrics.py
crmauceri/ReferringExpressions
6
16037
import argparse import json from data_management.DatasetFactory import datasetFactory from config import cfg import numpy as np if __name__ == "__main__": parser = argparse.ArgumentParser(description='Calculates metrics from output of a Classification network.' + ...
2.40625
2
base_model.py
Unmesh-Kumar/DMRM
23
16038
<reponame>Unmesh-Kumar/DMRM import torch import torch.nn as nn from attention import Attention, NewAttention from language_model import WordEmbedding, QuestionEmbedding, QuestionEmbedding2 from classifier import SimpleClassifier from fc import FCNet from Decoders.decoder1 import _netG as netG import torch.nn.functional...
2.03125
2
qymel/core/__init__.py
hal1932/QyMEL
6
16039
<reponame>hal1932/QyMEL # coding: utf-8 from .force_reload import * from .scopes import *
0.953125
1
lambda/nodemanager.py
twosdai/cloud-enablement-aws
11
16040
# Copyright 2002-2018 MarkLogic Corporation. All Rights Reserved. import boto3 import botocore import logging import hashlib import json import time from botocore.exceptions import ClientError log = logging.getLogger() log.setLevel(logging.INFO) # global variables ec2_client = boto3.client('ec2') asg_client = boto3...
1.96875
2
pyABC/0.10.14/petab/amici.py
ICB-DCM/lookahead-study
3
16041
<reponame>ICB-DCM/lookahead-study<gh_stars>1-10 import logging from collections.abc import Sequence, Mapping from typing import Callable, Union import copy import pyabc from .base import PetabImporter, rescale logger = logging.getLogger(__name__) try: import petab import petab.C as C except ImportError: ...
2.1875
2
ui_automation_core/helpers/browser/alert_action_type.py
Harshavardhanchowdary/python-ui-testing-automation
0
16042
<reponame>Harshavardhanchowdary/python-ui-testing-automation from enum import Enum, auto class AlertActionType(Enum): ACCEPT = auto() DISMISS = auto()
2.109375
2
xsertion/test_layers.py
karazijal/xsertion
0
16043
import unittest from xsertion.layers import * from keras.layers import Input, MaxPooling2D, Convolution2D, Activation, merge, Dense, Flatten from keras.models import Model import json def desc(model : Model): base_model_disc = json.loads(model.to_json()) return base_model_disc['config'] def topo_check(layer...
2.703125
3
language/python/modules/websocket/websocket_module.py
bigfoolliu/liu_aistuff
1
16044
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # author: bigfoolliu """ web socket可用于实时聊天 """ import websocket if __name__ == '__main__': pass
1.390625
1
engines/__init__.py
mukeran/simple_sandbox
0
16045
from .watcher import FileWatcher from .fpm_sniffer import FPMSniffer, FPMSnifferMode
1.15625
1
PyTrinamic/modules/TMC_EvalShield.py
trinamic-AA/PyTrinamic
37
16046
''' Created on 18.03.2020 @author: LK ''' class TMC_EvalShield(object): """ Arguments: connection: Type: connection interface The connection interface used for this module. shield: Type: class The EvalShield class used for every axis on this mod...
2.546875
3
kattis/rollcall.py
terror/Solutions
2
16047
import sys d, n = [], {} for i in sys.stdin: if i.rstrip() == "": break a, b = map(str, i.split()) d.append([a, b]) if a in n: n[a] += 1 else: n[a] = 1 d = sorted(d, key=lambda x: (x[1], x[0])) for k, v in d: if n[k] > 1: print(k, v) else: print(k)
2.875
3
test/vizier/test_nodes.py
robotarium/vizier
11
16048
<filename>test/vizier/test_nodes.py import json import vizier.node as node import unittest class TestVizierNodes(unittest.TestCase): def setUp(self): path_a = '../config/node_desc_a.json' path_b = '../config/node_desc_b.json' try: f = open(path_a, 'r') node_descri...
2.71875
3
tests/not_test_basics.py
kipfer/simple_modbus_server
1
16049
<gh_stars>1-10 import modbus_server s = modbus_server.Server( host="localhost", port=5020, daemon=True, loglevel="WARNING", autostart=False ) s.start() s.set_coil(1, True) s.set_coils(2, [True, False, True]) s.set_discrete_input(1, True) s.set_discrete_inputs(2, [True, False, True]) s.set_input_register(1, 123...
2.046875
2
cuda/rrnn_semiring.py
Noahs-ARK/rational-recurrences
27
16050
RRNN_SEMIRING = """ extern "C" { __global__ void rrnn_semiring_fwd( const float * __restrict__ u, const float * __restrict__ eps, const float * __restrict__ c1_init, const float * __restrict__ c2_init, const int len, ...
1.984375
2
tests.py
c-okelly/movie_script_analytics
1
16051
<reponame>c-okelly/movie_script_analytics import re import text_objects import numpy as np import pickle # f = open("Data/scripts_text/17-Again.txt", 'r') # text = f.read() # text = text[900:1500] # print(text) # count = len(re.findall("\W+",text)) # print(count) # # lines = text.split('\n') # lines_on_empty = re.sp...
2.921875
3
malcolm/modules/demo/parts/countermovepart.py
dinojugosloven/pymalcolm
0
16052
import time from annotypes import Anno, add_call_types from malcolm.core import PartRegistrar from malcolm.modules import builtin # Pull re-used annotypes into our namespace in case we are subclassed APartName = builtin.parts.APartName AMri = builtin.parts.AMri with Anno("The demand value to move our counter motor ...
2.609375
3
scripts/run_temporal_averaging.py
alexkaiser/heart_valves
0
16053
<filename>scripts/run_temporal_averaging.py import pyvista import os, sys, glob import subprocess import math from natsort import natsorted import multiprocessing def write_pvd(base_name, dt, nsteps, extension, nprocs_sim=1): prefix = '''<?xml version="1.0"?> <VTKFile type="Collection" version="0.1" ...
2.140625
2
server.py
MVHSiot/yelperhelper
0
16054
import sys try: sys.path.append('/opt/python3/lib/python3.4/site-packages') except: pass import yelp_api import pickle import calc pub_key = '<KEY>' sub_key = 'sub-c-0442432a-3312-11e7-bae3-02ee2ddab7fe' from pubnub.callbacks import SubscribeCallback from pubnub.enums import PNStatusCategory from pubnub.pnconf...
2.125
2
gmaploader/__init__.py
cormac-rynne/gmaploader
2
16055
<gh_stars>1-10 __version__ = '0.1.1' from .gmaploader import GMapLoader
1.179688
1
machina/templatetags/forum_tracking_tags.py
jujinesy/initdjango-machina
1
16056
<reponame>jujinesy/initdjango-machina<filename>machina/templatetags/forum_tracking_tags.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django import template from machina.core.loading import get_class TrackingHandler = get_class('forum_tracking.handler', 'TrackingHandler') register = temp...
2.15625
2
xmodaler/modeling/layers/attention_pooler.py
cclauss/xmodaler
830
16057
# Copyright 2021 JD.com, Inc., JD AI """ @author: <NAME> @contact: <EMAIL> """ import torch import torch.nn as nn __all__ = ["AttentionPooler"] class AttentionPooler(nn.Module): def __init__( self, *, hidden_size: int, output_size: int, dropout: float, use_bn: boo...
2.65625
3
aas_core_meta/__init__.py
aas-core-works/aas-core3-meta
0
16058
<reponame>aas-core-works/aas-core3-meta<gh_stars>0 """Provide meta-models for Asset Administration Shell information model.""" __version__ = "2021.11.20a2" __author__ = ( "<NAME>, <NAME>, <NAME>, <NAME>, <NAME>" ) __license__ = "License :: OSI Approved :: MIT License" __status__ = "Alpha"
0.734375
1
arxivmail/web.py
dfm/ArXivMailer
1
16059
<reponame>dfm/ArXivMailer # -*- coding: utf-8 -*- import flask from .mail import send_email from .models import db, Subscriber, Category __all__ = ["web"] web = flask.Blueprint("web", __name__) @web.route("/", methods=["GET", "POST"]) def index(): if flask.request.method == "POST": email = flask.reque...
2.375
2
qiskit/pulse/timeslots.py
lerongil/qiskit-terra
3
16060
<gh_stars>1-10 # -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICEN...
2.953125
3
core/assembler.py
iahuang/scratch-gcc
0
16061
<reponame>iahuang/scratch-gcc """ A basic two-pass MIPS assembler. Outputs a binary file in a custom format that can then be loaded into Scratch """ import struct import re import json import os """ Diagram of the Scratch MIPS VM memory space +--------------------- <- 0x0000000 | i/o space (see below) +-------------...
3.28125
3
qvdfile/tests/test_qvdfile.py
cosmocracy/qvdfile
17
16062
<reponame>cosmocracy/qvdfile import pytest import errno import os import glob import shutil import xml.etree.ElementTree as ET from qvdfile.qvdfile import QvdFile, BadFormat @pytest.fixture(scope="function") def qvd(): """ standard setup for most of the tests """ yield QvdFile("data/tab1.qvd") @pytest.fixt...
2.203125
2
app/__init__.py
i2nes/app-engine-blog
0
16063
<reponame>i2nes/app-engine-blog from flask import Flask from app.models import Article, Feature import logging def create_app(config, blog_config): """This initiates the Flask app and starts your app engine instance. Startup Steps: 1. Instantiate the Flask app with the config settings. 2. Register blu...
3.109375
3
libs/msfpayload.py
darkoperator/SideStep
3
16064
""" Generates the Meterpreter payload from msfvenom """ import subprocess def payloadGenerator(msfpath, msfvenom, msfpayload, ip, port): payload = subprocess.Popen('ruby ' + msfpath + msfvenom + ' -p ' + msfpayload + ' LHOST=' + ip + ' LPORT=' + str(port) + ' EXITFUNC=thread -e x86/alpha_mixed -f raw BufferRegister=...
2.59375
3
RevitPythonShell_Scripts/GoogleTools.extension/GoogleTools.tab/Ontologies.Panel/BOS_SetValues.pushbutton/script.py
arupiot/create_revit_families
1
16065
<gh_stars>1-10 # Select an element # Open yaml file with entity types # If parameters are already present, set values according to yaml input import sys import clr import System import rpw import yaml import pprint from System.Collections.Generic import * clr.AddReference("RevitAPI") from Autodesk.Revit.DB import * ...
2.390625
2
Code/src/models/optim/SimCLR_trainer.py
antoine-spahr/X-ray-Anomaly-Detection
2
16066
<gh_stars>1-10 import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np import time import logging from sklearn.manifold import TSNE from src.models.optim.CustomLosses import NT_Xent_loss, SupervisedContrastiveLoss from src.utils.utils import print_progessbar ...
2.28125
2
patients/migrations/0008_alter_patient_age.py
Curewell-Homeo-Clinic/admin-system
1
16067
<reponame>Curewell-Homeo-Clinic/admin-system # Generated by Django 3.2.9 on 2021-11-20 16:13 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('patients', '0007_alter_patient_age'), ] operations = [ migrations...
1.664063
2
kitsune/questions/tests/test_utils.py
AndrewDVXI/kitsune
1
16068
<gh_stars>1-10 from kitsune.questions.models import Answer, Question from kitsune.questions.tests import AnswerFactory, QuestionFactory from kitsune.questions.utils import ( get_mobile_product_from_ua, mark_content_as_spam, num_answers, num_questions, num_solutions, ) from kitsune.sumo.tests import ...
2.109375
2
scripts/create_fluseverity_figs_v2/export_zOR_classif_swap.py
eclee25/flu-SDI-exploratory-age
3
16069
<reponame>eclee25/flu-SDI-exploratory-age #!/usr/bin/python ############################################## ###Python template ###Author: <NAME> ###Date: 10/14/14 ###Function: Export zOR retrospective and early warning classifications into csv file format (SDI and ILINet, national and regional for SDI) ### Use nation-l...
2.078125
2
sonar/endpoints.py
sharm294/sonar
5
16070
""" Signal endpoints that can be used in testbenches """ import textwrap from typing import Dict import sonar.base_types as base class Endpoint(base.SonarObject): """ Endpoint class """ arguments: Dict[str, int] = {} @classmethod def instantiate(cls, _indent): """ Instantia...
2.53125
3
minemeld/ft/condition/BoolExprParser.py
zul126/minemeld-core
1
16071
<reponame>zul126/minemeld-core<gh_stars>1-10 # Generated from BoolExpr.g4 by ANTLR 4.5.1 # encoding: utf-8 from __future__ import print_function from antlr4 import * from io import StringIO # flake8: noqa def serializedATN(): with StringIO() as buf: buf.write(u"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d8...
1.429688
1
nodes/networkedSingleStepper/temporaryURLNode.py
imoyer/pygestalt
1
16072
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /vn/testNode.py was not found on this server.</p> <p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p> <hr>...
1.882813
2
cppwg/writers/header_collection_writer.py
josephsnyder/cppwg
21
16073
#!/usr/bin/env python """ Generate the file classes_to_be_wrapped.hpp, which contains includes, instantiation and naming typedefs for all classes that are to be automatically wrapped. """ import os import ntpath class CppHeaderCollectionWriter(): """ This class manages generation of the header collection f...
2.796875
3
22-crab-combat/solution22_2.py
johntelforduk/advent-of-code-2020
1
16074
<filename>22-crab-combat/solution22_2.py # Solution to part 2 of day 22 of AOC 2020, Crab Combat. # https://adventofcode.com/2020/day/22 import sys VERBOSE = ('-v' in sys.argv) class Deck: def __init__(self, player: int, cards: list): self.player = player self.cards = cards def take_top_ca...
3.890625
4
consts.py
mauroreisvieira/sublime-tailwindcss-intellisense
0
16075
<filename>consts.py import os # @see https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss EXTENSION_UID = "bradlc.vscode-tailwindcss" EXTENSION_VERSION = "0.5.2" SERVER_BINARY_PATH = os.path.join("extension", "dist", "server", "index.js")
1.242188
1
backend/app/alembic/versions/491383f70589_add_separate_reported_and_deleted_tables.py
Pinafore/Karl-flashcards-web-app
7
16076
"""add separate reported and deleted tables Revision ID: 491383f70589 Revises: <PASSWORD> Create Date: 2020-06-26 05:23:30.267933 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '491383f70589' down_revision = '<PASSWORD...
1.78125
2
test/test_viscous.py
nchristensen/mirgecom
0
16077
"""Test the viscous fluid helper functions.""" __copyright__ = """ Copyright (C) 2021 University of Illinois Board of Trustees """ __license__ = """ 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 Softwar...
1.828125
2
aiobotocore_refreshable_credentials/__init__.py
aweber/aiobotocore-refreshable-credentials
0
16078
<filename>aiobotocore_refreshable_credentials/__init__.py """ aiobotocore-refreshable-credentials =================================== """ from aiobotocore_refreshable_credentials.session import get_session version = '1.0.3' __all__ = [ 'get_session', 'version' ]
1.273438
1
g13gui/bitwidgets/label_tests.py
jtgans/g13gui
3
16079
<gh_stars>1-10 import unittest import time from g13gui.bitwidgets.display import Display from g13gui.bitwidgets.x11displaydevice import X11DisplayDevice from g13gui.bitwidgets.label import Label class LabelTests(unittest.TestCase): def setUp(self): self.dd = X11DisplayDevice(self.__class__.__name__) ...
2.453125
2
padre/git_utils.py
krislindgren/padre
0
16080
<filename>padre/git_utils.py #!/usr/bin/python # -*- coding: utf-8 -*- # MIT License # # Modified from https://github.com/wzpan/git-repo-sync/ import os import subprocess import sys def print_blocked(output): print("=" * len(output)) print(output) print("=" * len(output)) def check_output(cmd, **kwarg...
2.515625
3
domain_clf_analysis.py
xiaoleihuang/Domain_Adaptation_ACL2018
3
16081
<filename>domain_clf_analysis.py<gh_stars>1-10 """ Test on one domain, and train on the other domains, Output f1 scores and visualize them by heat map """ from utils import data_helper, model_helper from sklearn.metrics import f1_score from imblearn.over_sampling import RandomOverSampler from sklearn.preprocessing imp...
3.21875
3
01 - Expressions, variables and assignments/exercises/perimeter-of-rectangle.py
PableraShow/python-exercises
8
16082
""" Prints the length in inches of the perimeter of a rectangle with sides of length 4 and 7 inches. """ # Rectangle perimeter formula length = 4 inches = 7 perimeter = 2 * length + 2 * inches # Output print perimeter
3.515625
4
x_3_4.py
ofl/kuku2
0
16083
# x_3_4 # # mathモジュールからfloor関数だけインポートして切り捨て計算を行ってください from statistics import mean data = [7, 4, 3, 9] print(mean(data))
3.109375
3
2018/21/reverse_engineered.py
lvaughn/advent
0
16084
<reponame>lvaughn/advent #!/usr/bin/env python3 def simulate(reg_0, find_non_loop): seen = set() c = 0 last_unique_c = -1 while True: a = c | 65536 c = reg_0 while True: c = (((c + (a & 255)) & 16777215) * 65899) & 16777215 if a < 256: ...
3.109375
3
pybilt/lipid_grid/lipid_grid_curv.py
blakeaw/ORBILT
11
16085
<gh_stars>10-100 ''' Classes and functions to implement gridding and curvature correlation analysis for lipid bilayers. The gridding and anlaysis procedures are based on the decription given in section "Correlation between bilayer surface curvature and the clustering of lipid molecules" of <NAME>, <NAME>, <...
2.6875
3
security.py
Raghav714/intruder-alarm
4
16086
<gh_stars>1-10 import numpy as np import cv2 import pygame cap = cv2.VideoCapture(0) fgbg = cv2.createBackgroundSubtractorMOG2() pygame.mixer.init() pygame.mixer.music.load("1.mp3") while(1): ret, frame = cap.read() fgmask = fgbg.apply(frame) flag = np.std(fgmask) if flag>50: print("some one came") pygame.mixe...
2.78125
3
pygeos/measurements.py
jorisvandenbossche/pygeos
0
16087
<gh_stars>0 from . import ufuncs __all__ = ["area", "distance", "length", "hausdorff_distance"] def area(geometries): return ufuncs.area(geometries) def distance(a, b): return ufuncs.distance(a, b) def length(geometries): return ufuncs.length(geometries) def hausdorff_distance(a, b, densify=None): ...
2.671875
3
naff/models/naff/extension.py
Discord-Snake-Pit/dis_snek
64
16088
<filename>naff/models/naff/extension.py import asyncio import inspect import logging from typing import Awaitable, List, TYPE_CHECKING, Callable, Coroutine, Optional import naff.models.naff as naff from naff.client.const import logger_name, MISSING from naff.client.utils.misc_utils import wrap_partial from naff.models...
2.375
2
model/State.py
BrandonTheBuilder/thermawesome
0
16089
from CoolProp import CoolProp as CP class State(object): """ The state of a fluid is defined with two unique intensive properties this class keeps track of the state of the fluid and solves for all other intensive properties. """ def __init__(self, fluid, **kwargs): """ ...
3.359375
3
dashboard_api/widget_def/migrations/0059_auto_20160701_0929.py
data61/Openboard
2
16090
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-06-30 23:29 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('widget_def', '0058_auto_20160617_1124'), ] operations = [ migrations.AlterUn...
1.65625
2
ngraph/python/tests/test_ngraph/test_ops_reshape.py
mnosov/openvino
0
16091
# ****************************************************************************** # Copyright 2017-2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apa...
2.1875
2
malwarescan/wsclient.py
lbahtarliev/MalwareScan
3
16092
<reponame>lbahtarliev/MalwareScan #!/usr/bin/env python # -*- coding: utf-8 -*- import sys import json import ssl import click from json.decoder import JSONDecodeError from websocket import WebSocketException from websocket import WebSocketConnectionClosedException from websocket import create_connection from...
2.171875
2
CalibTracker/SiStripCommon/python/theBigNtuple_cfi.py
ckamtsikis/cmssw
852
16093
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms from CalibTracker.SiStripCommon.ShallowEventDataProducer_cfi import * from CalibTracker.SiStripCommon.ShallowDigisProducer_cfi import * from CalibTracker.SiStripCommon.ShallowClustersProducer_cfi import * from CalibTracker.SiStripCommon.ShallowTrackClustersPr...
1.21875
1
anti_freeze/__main__.py
Donluigimx/anti-freeze
0
16094
if __name__ == '__main__': from .system import MyApp MyApp().run()
1.34375
1
classic_NN/nn.py
disooqi/learning-machine-learning
1
16095
<filename>classic_NN/nn.py<gh_stars>1-10 import numpy as np from scipy.special import expit, logit import time import logging np.random.seed(4) # 4 logger = logging.getLogger(__name__) fr = logging.Formatter('%(asctime)s:%(levelname)s:%(message)s') sh = logging.StreamHandler() # sh.setFormatter(fr) logger.addHandler(...
2.796875
3
sensorAtlas/__init__.py
iosefa/pyMatau
2
16096
<reponame>iosefa/pyMatau<gh_stars>1-10 # app config default_app_config = 'sensorAtlas.apps.sensorAtlasConfig'
1.101563
1
api/urls.py
yasminfarza/country-state-address-api
4
16097
<filename>api/urls.py<gh_stars>1-10 from django.urls import path, include from rest_framework.routers import DefaultRouter from api import views router = DefaultRouter() router.register('countries', views.CountryViewSet) router.register('states/(?P<country>[^/.]+)', views.StateViewSet) router.register('addresses', vi...
2.140625
2
tests/test_protocol.py
gimbas/openinput
38
16098
# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>> def test_dispatch(basic_device): basic_device.protocol_dispatch([0x03, 0x02, 0x01]) # unrelated basic_device.protocol_dispatch([0x20]) # invalid length short basic_device.protocol_dispatch([0x21]) # invalid length long ...
2.03125
2
zaqar-8.0.0/zaqar/storage/sqlalchemy/driver.py
scottwedge/OpenStack-Stein
97
16099
# Copyright (c) 2013 Red Hat, Inc. # Copyright 2014 Catalyst IT 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 a...
1.90625
2