content
stringlengths
7
928k
avg_line_length
float64
3.5
33.8k
max_line_length
int64
6
139k
alphanum_fraction
float64
0.08
0.96
licenses
list
repository_name
stringlengths
7
104
path
stringlengths
4
230
size
int64
7
928k
lang
stringclasses
1 value
from eingabe import EinsatzstoffeEingabe from ausgabe import * from verarbeitung import * from plannung import * if __name__ == '__main__': eingabe1 = EinsatzstoffeEingabe(100000, "Erz", "Indien") eingabe2 = EinsatzstoffeEingabe(59000, "Kochen", "Rumänien") ausgabe1 = ProzessAusgabe(100, 200, "Sc...
35.083333
76
0.723278
[ "MIT" ]
caxenie/oom-oop-intro
main.py
843
Python
from chatterbot.trainers import ListTrainer from chatterbot import ChatBot bot = ChatBot('Test') conversa = ['oi', 'olá', 'Tudo bem?', 'Estou bem'] conversa2 = ['Gosta de futebol?','Eu adoro,sou tricolor Paulista e você','Qual seu filme favorito?' , 'O meu é Rocky 1'] bot.set_trainer(ListTrainer) bot.train(conversa)...
26.4
120
0.681818
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
Ageursilva/Bot
Bot.py
532
Python
from peewee import * import psycopg2 import datetime db = PostgresqlDatabase("prueba", host="localhost", port=5432, user="postgres", password="P@ssw0rd") class BaseModel(Model): class Meta: database = db class User(BaseModel): Username = CharField(unique = True) email = CharField(unique = True) ...
26.230769
100
0.670088
[ "MIT" ]
Raul-Flores/ORM-example
Postgress-example/peewee-orm-test.py
682
Python
# Copyright 2020 Efabless 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...
32.75
117
0.723584
[ "Apache-2.0" ]
Manarabdelaty/openlane
scripts/csv2html/csv2html.py
2,489
Python
""" Load volumes into vpv from a toml config file. Just load volumes and no overlays Examples -------- Example toml file orientation = 'sagittal' [top] specimens = [ 'path1.nrrd', 'path2.nrrd', 'path3.nrrd'] [bottom] specimens = [ 'path1.nrrd', 'path2.nrrd', 'path3.nrrd'] """ import sys from pathlib import Path ...
19.326087
80
0.615298
[ "Apache-2.0" ]
Dorky-Lever/vpv
utils/data_loader_2.py
1,778
Python
from Person_1.project.person import Person class Child(Person): pass
12.5
42
0.76
[ "MIT" ]
EmilianStoyanov/Projects-in-SoftUni
python__OOP/09.inheritance_exercise/01.person/child.py
75
Python
# author rovo98 import os import tensorflow as tf from tensorflow.keras.utils import plot_model from tensorflow.keras.callbacks import EarlyStopping from model_data_input import load_processed_dataset from models.fdconv1d_lstm.model import build_fdconv1d_lstm from models.utils.misc import running_timer from models.u...
43.697842
114
0.689167
[ "Apache-2.0" ]
rovo98/model-unkown-dfa-diagnosis-based-on-running-logs
models/fdconv1d_lstm/train.py
6,074
Python
from app.crud.crud_crosswalk import * from app.crud.crud_statistics import * from app.crud.crud_users import *
27.75
38
0.810811
[ "MIT" ]
Infam852/IoT-project
backend/app/crud/__init__.py
111
Python
"""babyshop URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-base...
37.259259
77
0.724652
[ "MIT" ]
MET-DEV/Django-E-Commerce
babyshop_app/babyshop/urls.py
1,006
Python
# __author__ = 'clarkmatthew' # import json class Namespace(object): """ Convert dict (if provided) into attributes and return a somewhat generic object """ def __init__(self, newdict=None): if newdict: for key in newdict: value = newdict[key] tr...
30.323529
78
0.402522
[ "Apache-2.0" ]
tbeckham/DeploymentManager
config_manager/namespace.py
1,031
Python
import datetime import json import os import sys import urllib import urlparse from collections import OrderedDict from time import mktime import dateutil.parser import feedparser import requests import xbmc import xbmcaddon import xbmcgui import xbmcplugin from bs4 import BeautifulSoup stations = { 'p00fzl68': ...
44.781145
144
0.656917
[ "MIT" ]
jonjomckay/kodi-addon-bbcsounds
addon.py
13,300
Python
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs.""" imp...
47.683544
117
0.623706
[ "MIT" ]
plc-ultima/plcu
test/functional/txn_clone.py
7,534
Python
import hydra import os import logging import json import numpy as np import torch import matplotlib.pyplot as plt from collections import defaultdict import json from IPython import embed # from AD_models import AD_Time_Series # from AD_utils import AD_report, AD_dataset, plot_AD_dataset, AD_preprocessing # import T...
48.892308
193
0.65922
[ "Apache-2.0" ]
LucaZancato/stric
main.py
6,356
Python
"""DATA STRUCTURES""" # Algorithms are set of rules used to solve a problem # Data structures are a way of organizing data in a computer # colors = ['red', 'yellow', [5, 6], 'blue'] friends = ['Josh', 'Renee', 'Agnes'] # print(colors) # print(colors[1]) # colors[2] = 'green' # mutability of lists # print(colors) # pri...
35.36
96
0.676471
[ "MIT" ]
Peabody29/Python_Projects-ST
Lists/lists-beg.py
884
Python
import numpy as np import random import os import json import math import cv2 def getPaddedROI(img, center_x, center_y, width, height): #print(str(int(center_x)) + "," + str(int(center_y))) paddingColor = [0,0,0] top_left_x = center_x - int(width/2)-1 #print("top_left_x:") #print(top_left_x) to...
35.311005
137
0.628862
[ "Apache-2.0" ]
gitpharm01/Parapose
imageLoader.py
7,380
Python
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
33.765784
93
0.701671
[ "Apache-2.0" ]
1110sillabo/models
official/nlp/transformer/utils/metrics.py
16,579
Python
# Copyright 2019-2020 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fil...
44.333333
92
0.724624
[ "Apache-2.0" ]
YYStreet/sagemaker-pytorch-serving-container
test-toolkit/integration/__init__.py
2,128
Python
from config_utils import read_main_config from deep_q_network import DeepQNetwork from gym_wrapper import GymWrapper from tensorflow.python.framework.ops import disable_eager_execution disable_eager_execution() config = read_main_config() gym_wrapper = GymWrapper(config['general']['scenario']) deep_q_network = DeepQ...
31
67
0.848635
[ "MIT" ]
tomjur/TF2.0DQN
main.py
403
Python
from spaceone.repository.model.plugin_model import * from spaceone.repository.model.schema_model import * from spaceone.repository.model.policy_model import * from spaceone.repository.model.repository_model import *
43.2
56
0.851852
[ "Apache-2.0" ]
gikang82/repository
src/spaceone/repository/model/__init__.py
216
Python
from setuptools import setup from Cython.Build import cythonize setup( name='Fibonacci', package_dir={'Fibonacci/functions_folder': ''}, ext_modules=cythonize("fib_module.pyx"), )
21.444444
51
0.735751
[ "MIT" ]
dalexa10/EngineeringDesignOptimization
Cython/Fibonacci/functions_folder/setup.py
193
Python
# -*- coding: utf-8 -*- # # This file is part of Flask-CLI # Copyright (C) 2015 CERN. # # Flask-AppFactory is free software; you can redistribute it and/or # modify it under the terms of the Revised BSD License; see LICENSE # file for more details. """Flask extension to enable CLI.""" import types from . import AppG...
28.133333
77
0.635664
[ "MIT" ]
muneneee/blog
virtual/lib/python3.6/site-packages/flask_cli/ext.py
1,688
Python
from django.http import HttpResponseRedirect from django.views.generic import ListView,CreateView,UpdateView,DetailView,View from django.shortcuts import render, redirect from ecom import forms, models from django.utils.decorators import method_decorator def admin_required(function): def wrap(request, *args, **k...
36.916667
128
0.715576
[ "MIT" ]
Gustolidel/Ikergust
ecom/paquetes/view_paquete.py
2,215
Python
# Copyright 2018-2021 Xanadu Quantum Technologies 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 applicabl...
33.985294
97
0.617337
[ "Apache-2.0" ]
PritishSehzpaul/pennylane
tests/tape/interfaces/test_qnode_jax.py
6,933
Python
"""Common DB report tests.""" import datetime from pycounter.constants import METRICS def test_version(db_report): assert db_report.report_version == 4 def test_year(db_report): assert db_report.year == 2012 def test_publisher(db_report): for publication in db_report: assert publication.publi...
22.65
86
0.737307
[ "MIT" ]
beda42/pycounter
pycounter/test/test_db_common.py
906
Python
from . import is_palindrome test_subjects = [ is_palindrome ] complex_pali = '''Anita. .laVa, :; la? TINa!''' def test_is_palindrome(): for subject in test_subjects: assert subject.algorithm('') assert subject.algorithm(' ') assert subject.algorithm(complex_pali) asse...
19.611111
46
0.648725
[ "MIT" ]
IngCarlosPedroza/algorithms-and-data-structures-py
algorithms_and_data_structures/algorithms/string_processing/is_palindrome/test_is_palindrome.py
353
Python
# coding: utf-8 """ convertapi Convert API lets you effortlessly convert file formats and types. # noqa: E501 OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import cloudmersive_convert_api_...
24.707317
117
0.741362
[ "Apache-2.0" ]
Cloudmersive/Cloudmersive.APIClient.Python.Convert
test/test_docx_set_header_request.py
1,013
Python
import abc import logging import Sea import numpy as np import itertools from ..base import Base class Connection(Base, Sea.model.connections.Connection): """ Abstract base class for all :mod:`Sea.adapter.connections` classes. """ __metaclass__ = abc.ABCMeta def __init__(self, obj, system, co...
42.848315
168
0.629343
[ "BSD-3-Clause" ]
FRidh/Sea
Sea/adapter/connections/Connection.py
7,627
Python
import warnings from contextlib import contextmanager from numba.tests.support import override_config, TestCase from numba.cuda.testing import skip_on_cudasim from numba import cuda from numba.core import types from numba.cuda.testing import SerialMixin import unittest @skip_on_cudasim("Skipped on simulator") class ...
30.181818
65
0.653614
[ "BSD-2-Clause" ]
aerusso/numba
numba/cuda/tests/cudapy/test_deprecation.py
1,328
Python
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
38.926327
94
0.676863
[ "Apache-2.0" ]
ArnovanHilten/tensorflow
tensorflow/python/kernel_tests/variables_test.py
35,929
Python
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/autolabor/catkin_ws/devel/include;/home/autolabor/catkin_ws/src/navigation/amcl/include".split(';') if "/home/autolabor/catkin_ws/devel/include;/home/autolabor/catkin_ws/src/navigation/amcl/inclu...
75.555556
253
0.777941
[ "BSD-2-Clause" ]
lty1994/ros_project
build/navigation/amcl/catkin_generated/pkg.develspace.context.pc.py
680
Python
import re from pygbif.gbifutils import gbif_baseurl, bool2str, requests_argset, gbif_GET def search( taxonKey=None, repatriated=None, kingdomKey=None, phylumKey=None, classKey=None, orderKey=None, familyKey=None, genusKey=None, subgenusKey=None, scientificName=None, countr...
50.844282
250
0.676748
[ "MIT" ]
livatras/pygbif
pygbif/occurrences/search.py
20,897
Python
# coding: utf-8 """ SCORM Cloud Rest API REST API used for SCORM Cloud integrations. OpenAPI spec version: 2.0 Contact: systems@rusticisoftware.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class Destina...
24.387324
77
0.524978
[ "Apache-2.0" ]
ryanhope2/scormcloud-api-v2-client-python
rustici_software_cloud_v2/models/destination_id_schema.py
3,463
Python
from __future__ import print_function import os import time import random import datetime import scipy.misc import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim from datetime import datetime from util.util import * from util.BasicConvLSTMCell import * class DEBLUR(object): def __init_...
46.30094
121
0.565471
[ "MIT" ]
DagothHertil/NNVEP-SRN-Deblur
models/model.py
14,770
Python
from __future__ import print_function, division import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler from torchvision import datasets, models, transforms import numpy as np import time import os import copy import argparse from azureml.core.run import Run from azureml.co...
34.215962
119
0.612514
[ "MIT" ]
hudua/azureml
azure-ml-pipelines/pytorch/training-folder/pytorch_train.py
7,288
Python
from mooquant import bar, strategy from mooquant.analyzer import drawdown, returns, sharpe, trades from mooquant.broker.backtesting import TradePercentage from mooquant.broker.fillstrategy import DefaultStrategy from mooquant.technical import cross, ma from mooquant.tools import tushare class thrSMA(strategy.Backtest...
29.075862
99
0.617173
[ "Apache-2.0" ]
bopo/MooQuant
stratlib/sample_SMA.py
4,244
Python
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
38.415094
95
0.63556
[ "BSD-3-Clause" ]
ctuning/ck-spack
package/spack-glew/package.py
2,036
Python
from django.db import models from django.utils.timezone import now # Create your models here. # <HINT> Create a Car Make model `class CarMake(models.Model)`: # - Name # - Description # - Any other fields you would like to include in car make model # - __str__ method to print a car make object class CarMake(models.Mo...
31.611765
105
0.639375
[ "Apache-2.0" ]
jahi-96/agfzb-CloudAppDevelopment_Capstone
server/djangoapp/models.py
2,687
Python
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module:...
37.987692
126
0.640936
[ "Apache-2.0" ]
aburan28/ansible-devops-pipeline
venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam_user.py
12,346
Python
# encoding: utf-8 import pytest from osf_tests.factories import ( RegistrationFactory, RegistrationProviderFactory ) from osf.models import ( RegistrationSchema, ) from osf.management.commands.move_egap_regs_to_provider import ( main as move_egap_regs ) from django.conf import settings @pytest.mar...
26.481481
94
0.718881
[ "Apache-2.0" ]
RCOSDP/RDM-osf.io
osf_tests/management_commands/test_move_egap_regs_to_provider.py
1,430
Python
import torch import torchvision from torchvision import transforms, utils, datasets from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler from sklearn.metrics import classification_report, confusion_matrix def makeDataSet(IMAGE_SHAPE = 300,DATA_PATH = './data_after_splitting/'): image_transforms = {...
37.166667
88
0.608371
[ "MIT" ]
manhph2211/Fp-Classification
dataloader.py
1,338
Python
# -*- coding: utf8 -*- from __future__ import unicode_literals import logging import netifaces def getIpWindows(adapteridx): try: import wmi except: logging.error("You must need Win32com (win32 extensions for python)") raise adapters = wmi.WMI().Win32_NetworkAdapt...
29.6625
78
0.552465
[ "MIT" ]
Hiestaa/miniboard-factorio-manager
conf.py
2,373
Python
""" @Author : liujianhan @Date : 2018/5/15 上午10:48 @Project : KGE @FileName : service.py @Description : 服务接口模块 """ import codecs import json import os import time from typing import Dict import torch from dotmap import DotMap from .core.predict import get_entity_relation_with_id from...
30.732558
114
0.678396
[ "MIT" ]
Jianhan-Liu/solid_ai_waddle
project/knowledge_graph_embedding/project_distmult_rotate_transe/service.py
2,917
Python
from keras.layers import Activation, Reshape, Lambda, dot, add from keras.layers import Conv1D, Conv2D, Conv3D from keras.layers import MaxPool1D,GlobalAveragePooling2D,Dense,multiply,Activation,concatenate from keras import backend as K def squeeze_excitation_layer(x, out_dim, ratio = 4, concate = True): squeez...
33.272727
95
0.73224
[ "MIT" ]
ailabnjtech/B-CNN
channel_attention.py
732
Python
# Copyright (c) Microsoft Corporation and contributors. # Licensed under the MIT License. import numpy as np import pandas as pd class LeastSquaresBinaryClassifierLearner: def __init__(self): self.weights = None def fit(self, X, Y, sample_weight): sqrtW = np.sqrt(sample_weight) matX ...
28.108108
64
0.623077
[ "MIT" ]
Acornagain/fair_regression_revised
test/unit/reductions/exponentiated_gradient/simple_learners.py
1,040
Python
""" An ASGI middleware. Based on Tom Christie's `sentry-asgi <https://github.com/encode/sentry-asgi>`_. """ import asyncio import inspect import urllib from sentry_sdk._functools import partial from sentry_sdk._types import MYPY from sentry_sdk.hub import Hub, _should_send_default_pii from sentry_sdk.integrations._w...
34.837607
161
0.59421
[ "BSD-2-Clause" ]
cuenca-mx/sentry-python
sentry_sdk/integrations/asgi.py
8,152
Python
# -*- coding: utf-8 -*- import re from packaging import version import phonemizer from phonemizer.phonemize import phonemize from TTS.utils.text import cleaners from TTS.utils.text.symbols import make_symbols, symbols, phonemes, _phoneme_punctuations, _bos, \ _eos # Mappings from symbol to numeric ID and vice ver...
35.042328
135
0.641401
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
DanBmh/TTS
utils/text/__init__.py
6,623
Python
# -*- coding: utf-8 -*- ''' loadFromExcel.py is an example of a plug-in that will load an extension taxonomy from Excel input and optionally save an (extension) DTS. (c) Copyright 2013 Mark V Systems Limited, All rights reserved. ''' import os, io, sys, time, re, traceback, json, posixpath from fnmatch import fnmatch...
61.984917
187
0.503301
[ "Apache-2.0" ]
CapoeiraShaolin1/Arelle
arelle/plugin/loadFromExcel.py
123,514
Python
import argparse import colorama import json import os import time from string import Template import modules from modules import site_config from modules import util # argument defaults and options for the CLI module_choices = ['clean', 'stix_data', 'groups', 'search', 'matrices', 'mitigations', 'software', 'tactics',...
43.319018
189
0.596233
[ "Apache-2.0" ]
Alexander-RB/attack-website
update-attack.py
7,061
Python
#!/usr/bin/env python3 # # main.py # # Specific command-line utility for Mellanox platform # try: import sys import subprocess import click import xml.etree.ElementTree as ET from sonic_py_common import device_info except ImportError as e: raise ImportError("%s - required module not found" % st...
29.643836
98
0.69085
[ "Apache-2.0" ]
AshokDaparthi/sonic-utilities
show/plugins/mlnx.py
4,328
Python
# 右侧加法和原处加法: __radd__和__iadd__ """ __add__并不支持+运算符右侧使用实例对象。要实现一并编写__radd__方法。 只有当+右侧的对象是实例,而左边对象不是类实例时,Python才会调用__radd++, 在其他情况下则是由左侧对象调用__add__方法。 """ class Commuter: def __init__(self, val): self.val = val def __add__(self, other): # 如果没有instance测试,当两个实例相加并且__add__触发 # __radd__的时候...
19.454545
57
0.653037
[ "Apache-2.0" ]
xuguoliang1995/leetCodePython
python_know/normal/demo9_7.py
1,142
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # ========================================================================= # Author Eduard Kabrinskyi <soulroot@gmail.com> Skype: soulroot@hotmail.com # ========================================================================= # ========================= # Main APP defin...
34.412162
122
0.531317
[ "Apache-2.0" ]
edroot/busgov_spider
spider.py
5,154
Python
from .base import * import os # how many data points are enough to calculate confidence? MINIMUM_SAMPLE_SIZE = 3 # original phrase is good enough for export TRANSCRIPT_PHRASE_POSITIVE_CONFIDENCE_LIMIT = .51 # original phrase needs correction TRANSCRIPT_PHRASE_NEGATIVE_CONFIDENCE_LIMIT = -.51 # correction is good eno...
23.190476
66
0.615332
[ "MIT" ]
amazingwebdev/django-FixIt
mla_game/settings/stage.py
1,461
Python
import time import threading import subprocess import helpers from settings import Settings def listener(): global data_source print("**** SIDE_THREAD ID == ", threading.get_ident()) while True: return_data = subprocess.run([data_source.settings.loaded['localization_bin']], stdout=subprocess.PIPE) ...
34.4
130
0.737209
[ "MIT" ]
joaovitor123jv/rontext
virtual_filesystem/localization.py
860
Python
import unittest from robot.parsing import TestCaseFile from robot.parsing.model import TestCaseTable from robot.utils import ET, ETSource, StringIO from robot.utils.asserts import assert_equal def create_test_case_file(): data = TestCaseFile(source='foo.txt') table = TestCaseTable(data) data.testcase_tab...
31.698795
90
0.659065
[ "ECL-2.0", "Apache-2.0" ]
nopparat-mkw/robotframework
utest/writer/test_filewriters.py
2,631
Python
import cv2.cv2 as cv2 import skimage.io as io from skimage.transform import downscale_local_mean import numpy as np from model import * from sklearn.naive_bayes import GaussianNB from sklearn.model_selection import train_test_split import numpy as np from sklearn.naive_bayes import GaussianNB from sklear...
40.098341
215
0.625476
[ "MIT" ]
MartimChaves/ret_detect
main.py
33,843
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import pickle import pandas as pd from cgp import * from cgp_config import * from cnn_train import CNN_train if __name__ == '__main__': parser = argparse.ArgumentParser(description='Evolving CAE structures') parser.add_argument('--gpu_num', '-g',...
49.078947
194
0.657105
[ "MIT" ]
dongzhiming/cgp-cnn-PyTorch
exp_main.py
3,730
Python
from sparknlp.annotator import * class BertSentence: @staticmethod def get_default_model(): return BertSentenceEmbeddings.pretrained() \ .setInputCols("sentence") \ .setOutputCol("sentence_embeddings") @staticmethod def get_pretrained_model(name, language, bucket=None): ...
25.210526
72
0.686848
[ "Apache-2.0" ]
JohnSnowLabs/nlu
nlu/components/embeddings/sentence_bert/BertSentenceEmbedding.py
479
Python
#!/usr/bin/env python3 import os import shutil import threading from selfdrive.swaglog import cloudlog from selfdrive.loggerd.config import ROOT, get_available_bytes, get_available_percent from selfdrive.loggerd.uploader import listdir_by_creation from selfdrive.dragonpilot.dashcam import DASHCAM_FREESPACE_LIMIT MIN_B...
28.555556
85
0.714397
[ "MIT" ]
Anthony919nc/Tessa
selfdrive/loggerd/deleter.py
1,285
Python
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from builtins import * from future.utils import iteritems from collections import defaultdict from copy import deepcopy from itertools import product import re from sqlal...
46.638889
155
0.602814
[ "Apache-2.0" ]
ailabx/snorkel
snorkel/candidates.py
13,432
Python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jan 15 10:38:14 2021 @author: kunal001 """ import logging logger = logging.getLogger(__name__) class CreateDatabase: def __init__(self,hier_graph,const_parse): self.hier_graph_dict = {} self.const_parse = const_parse self.G ...
38.906667
119
0.532557
[ "BSD-3-Clause" ]
mabrains/ALIGN-public
align/compiler/create_database.py
2,918
Python
def main(): # Open a file for writing and create it if it doesn't exist # myfile = open("textfile.txt", "w+") # # Open the file for appending text to the end # myfile = open("textfile.txt", "a+") # # write some lines of data to the file # for i in range(10): # myfile...
25.733333
64
0.537565
[ "MIT" ]
JeffreyAsuncion/LearningPython
Chapter03/file_start.py
772
Python
from robotMap import XboxMap from components.Actuators.LowLevel.shooterMotors import ShooterMotors from components.Actuators.LowLevel.intakeMotor import IntakeMotor from components.Actuators.HighLevel.hopperMotor import HopperMotor from utils.DirectionEnums import Direction from enum import Enum, auto from magicbot imp...
41.015873
100
0.689241
[ "MIT" ]
Raptacon/Robot-2022
components/Actuators/HighLevel/feederMap.py
2,584
Python
#!/usr/bin/python3 import pytest def test_weight(WBTC, WETH, accounts, SwapRouter, NonfungiblePositionManager, CellarPoolShareContract): ACCURACY = 10 ** 6 SwapRouter.exactOutputSingle([WETH, WBTC, 3000, accounts[0], 2 ** 256 - 1, 10 ** 7, 2 * 10 ** 18, 0], {"from": accounts[0], "value": 2 * 10 ** 18}) WB...
49.78125
151
0.700565
[ "Apache-2.0" ]
VolumeFi/somm-wbtc-eth-test-cellar
tests/test_05_weight.py
1,593
Python
# NOTICE # # This software was produced for the U.S. Government under # contract SB-1341-14-CQ-0010, and is subject to the Rights # in Data-General Clause 52.227-14, Alt. IV (DEC 2007) # # (c) 2018 The MITRE Corporation. All Rights Reserved. #==================================================== # CASE API #!/usr/bin...
33.657303
95
0.608746
[ "Apache-2.0" ]
casework/CASE-API-Python
example/case_example.py
11,982
Python
import sys import math import os sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../../") from sdc_etl_libs.sdc_dataframe.Dataframe import * import pandas as pd import numpy as np import json import pytest def test_generate_insert_query_ddl(mocker): test_schema = """ { "namespace": "Ti...
35.722973
275
0.538491
[ "Apache-2.0" ]
darknegma/docker-airflow
libs/sdc_etl_libs/test/dataframe_tests/sdc_dataframe_sql.py
5,296
Python
# # Copyright 2018 PyWren Team # (C) Copyright IBM Corp. 2020 # (C) Copyright Cloudlab URV 2020 # # 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-...
41.115894
108
0.67464
[ "Apache-2.0" ]
pablogs98/lithops
lithops/job/job.py
12,417
Python
import sys import time import os import os.path as osp import requests import shutil import tqdm import pickle import numpy as np import torch from cogdl.data import Data, Dataset, download_url from . import register_dataset def untar(path, fname, deleteTar=True): """ Unpacks the given archive file to the ...
36.100592
113
0.626946
[ "MIT" ]
AlvinWen428/cogdl
cogdl/datasets/gtn_data.py
6,101
Python
#!/usr/bin/env python3 # # Convert full firmware binary to rwd patch. # Supported models: # CR-V 5g (part num: 39990-TLA), tested # Civic 2016 sedan (part num: 39990-TBA), tested # Civic 2016 hatchback Australia (part num: 39990-TEA), tested # Civic 2016 hatchback (part num: 39990-TGG), tested # import os impor...
51.277457
2,371
0.631496
[ "MIT" ]
bccw-ai/rwd-xray
tools/bin_to_rwd.py
8,871
Python
from django.apps import AppConfig class AsciiArtConfig(AppConfig): name = 'ascii_art'
15.333333
33
0.76087
[ "MIT" ]
ChetanDehane/ascii-art
server/ascii_art_server/api/ascii_art/apps.py
92
Python
from django.contrib.staticfiles.storage import staticfiles_storage from django.urls import reverse from ManagementStudents.jinja2 import Environment # This enables us to use Django template tags like {% url ‘index’ %} or {% static ‘path/to/static/file.js’ %} in our Jinja2 templates. def environment(**options): en...
32.928571
134
0.718004
[ "MIT" ]
lpython2006e/exercies
14_Tran_An_Thien/ManagementStudents/ManagementStudents/customsettings.py
469
Python
""" This module used for serializing data CategorySchema - data from Category model VacancySchema - data from Vacancy model """ # pylint: disable=too-many-ancestors # pylint: disable=missing-class-docstring # pylint: disable=too-few-public-methods from app import ma from app.models.model import Category, Vacancy cl...
22.166667
55
0.692982
[ "Apache-2.0" ]
WishesFire/Epam-Python-Project
app/rest/serializers.py
798
Python
# 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 ...
43.434783
99
0.648649
[ "MIT" ]
AikoBB/azure-sdk-for-python
sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py
999
Python
# -*- coding: utf-8 -*- """Class that defines the abstract interface for an object repository. The scope of this class is intentionally very narrow. Any backend implementation should merely provide the methods to store binary blobs, or "objects", and return a string-based key that unique identifies the object that was...
44.497462
120
0.682523
[ "MIT", "BSD-3-Clause" ]
azadoks/aiida-core
aiida/repository/backend/abstract.py
8,766
Python
"""personal_gallery URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')...
35.608696
79
0.703297
[ "MIT" ]
mikengugy/The-Gallery
personal_gallery/urls.py
819
Python
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft and contributors. 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 ...
36.172414
76
0.656816
[ "Apache-2.0" ]
HydAu/AzureSDKForPython
azure-mgmt-resource/azure/mgmt/resource/features/__init__.py
1,049
Python
import sqlite3 import os MSG_HELP = """List of commands: !help List commands !listAll List all animals !show <animal> Give description !getFlag Give flag (Admin only) !serverInfo Give server info (Dragonite only) !addAdmin <id> Make user an admin (Dragonite only) !hint Give you a hint. Sou...
29.401361
86
0.621472
[ "Apache-2.0" ]
Bankde/Hack-me-bot
botCmd.py
4,322
Python
import unittest import xmlrunner # from selenium import webdriver import pagemodels.headerpage import tests.pickledlogin import browserconfig # VIDEO OF EXECUTION # https://gyazo.com/b20fd223076bf34c1f2c9b94a4f1fe0a # 2020-04-20 All tests passing, refactor complete # All tests passed 5 executions in a row. v1 ready...
41.504132
98
0.696734
[ "MIT" ]
BradleyPelton/NetflixSelenium
tests/test_headerpage.py
5,022
Python
class Sort_dic: def __init__(self): pass @staticmethod def sort_values(dic,rev=False,sort_by= 'values'): if sort_by == 'values': sv = sorted(dic.values(),reverse=rev) new_dic = {} for num in sv : for k,v in d...
26.321429
54
0.385346
[ "MIT" ]
jacktamin/king-tools
build/lib/king_libs/sort_val.py
737
Python
import os import sys import copy as copy from tensor_view_1d import TensorView1D from tensor_view_2d import TensorView2D from tensor_view_act import TensorViewAct from tensor_view_filter import TensorViewFilter from tensor_data import TensorData import inspect from PyQt4 import QtGui, QtCore from pyqt_env i...
40.035874
144
0.614658
[ "MIT" ]
octaviaguo/Tensorflow-Visualizing
TensorMonitor/control_panel.py
26,784
Python
"""TensorFlow ops for deep neural networks.""" # Copyright 2015-present The Scikit Flow 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.apac...
40.086957
75
0.748373
[ "Apache-2.0" ]
InfoPrice/tensorflow
tensorflow/contrib/learn/python/learn/ops/dnn_ops.py
1,844
Python
""" This code was created by Tyler Adam Martinez for the BMEN3310 Final #This are the varibles and what they stand for. Hemodynamic Parameter Analysis CS // Cross-Sectional Area of the heart valve vR // Radius of Valve DR // Disk Radius TiA // Area of the Titanium wire TiV // Volume of the Titanium wire...
32.614458
87
0.655707
[ "MIT" ]
TylerAdamMartinez/Minimally-Invasive-Monocusp-Valve
Hemodynamic_Parameter_Analysis.py
2,707
Python
# -*- coding: utf-8 -*- from ..Qt import QtGui, QtCore from .GraphicsView import GraphicsView from ..graphicsItems.GradientEditorItem import GradientEditorItem import weakref import numpy as np __all__ = ['GradientWidget'] class GradientWidget(GraphicsView): """ Widget displaying an editable colo...
39.666667
91
0.647059
[ "Apache-2.0" ]
kuldeepaman/tf-pose
scripts/pyqtgraph-develop/pyqtgraph/widgets/GradientWidget.py
2,975
Python
from typing_extensions import Final # noqa: F401 CONTAINER_CLIENT_PACKAGES = 'compressedpackages' # type: Final CONTAINER_EMAILS = 'emails' # type: Final CONTAINER_MAILBOX = 'mailbox' # type: Final CONTAINER_SENDGRID_MIME = 'sendgridinboundemails' # type: Final TABLE_DOMAIN_X_DELIVERED = 'emaildomainxdelivered' ...
46.166667
65
0.785199
[ "Apache-2.0" ]
tezzytezzy/opwen-cloudserver
opwen_email_server/constants/azure.py
554
Python
# # # Copyright 2020-21 British Broadcasting 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 l...
36.723077
108
0.713448
[ "ECL-2.0", "Apache-2.0" ]
bbc/rd-cloudfit-python-aiocypher
aiocypher/aioneo4j/graph.py
2,387
Python
# -*- coding: utf-8 -*- __version__ = "0.1.0"
9.6
23
0.5
[ "MIT" ]
ruzhnikov/exness-crowler
resources_crawler/__init__.py
48
Python
from typing import List import unittest from model import tasks class TestRepository(unittest.TestCase): def test_list(self): rep = tasks.Repository() l = rep.list() self.assertEqual(len(l), 2) self.assertEqual(l[0].id, 1) self.assertEqual(l[0].text, "task1") self....
24.311111
47
0.565814
[ "MIT" ]
74th/vscode-book-python
server/tests/test_repository.py
1,094
Python
from app import models from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField, SubmitField from wtforms.validators import ValidationError, DataRequired, Email, EqualTo class LoginForm(FlaskForm): username = StringField('Username', validators=[DataRequired()]) password = P...
37.454545
76
0.783981
[ "MIT" ]
justinvasel/justinvasel.com
app/forms.py
412
Python
""" Version information """ __version__ = "1.0.0"
8.5
21
0.627451
[ "MIT" ]
CiaranCurran/auto-sync-lingq
sync_lingq/_version.py
51
Python
# Copyright 2014 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
39.369957
80
0.637804
[ "Apache-2.0" ]
rodrigodias27/google-cloud-python
storage/tests/unit/test_blob.py
91,732
Python
class Hero: def __init__(self,name,health,attackPower): self.__name = name self.__health = health self.__attPower = attackPower # getter def getName(self): return self.__name def getHealth(self): return self.__health # setter def diserang(self,serangPower): self.__health -= serangPower def setA...
18.225806
44
0.748673
[ "MIT" ]
zharmedia386/Data-Science-Stuff
Python OOP/test.py
565
Python
import argparse import datasets import matplotlib.pyplot as plt import numpy as np def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('--input', type=str, required=True, help='Path to the directory with input dataset') return parser.parse_args() if __name__ == '__main__...
27.410256
109
0.529467
[ "MIT" ]
maximumSHOT-HSE/CurriculumLearning
src/cluster/sort_dataset_by_column/test.py
1,069
Python
# coding: utf-8 """ API's OpenData do Open Banking Brasil As API's descritas neste documento são referentes as API's da fase OpenData do Open Banking Brasil. # noqa: E501 OpenAPI spec version: 1.0.0-rc5.2 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.gi...
39.709821
117
0.636875
[ "MIT" ]
pitzer42/opbk-br-quickstart
products_and_services_client/api/invoice_financings_api.py
8,940
Python
# -*- coding: utf-8 -*- from __future__ import print_function from warnings import catch_warnings from datetime import datetime import itertools import pytest from numpy.random import randn from numpy import nan import numpy as np from pandas.compat import u from pandas import (DataFrame, Index, Series, MultiIndex...
40.52862
79
0.480131
[ "BSD-3-Clause" ]
wla80/pandas
pandas/tests/frame/test_reshape.py
36,111
Python
from os import path import autolens as al """ This script simulates `Imaging` of a strong lens where: - The lens `Galaxy`'s total mass distribution is a *SphericalIsothermal*. - The source `Galaxy`'s `LightProfile` is a *SphericalExponential*. This dataset is used in chapter 2, tutorials 1-3. """ ...
37.107438
120
0.73029
[ "MIT" ]
a-mere-peasant/PyAutoLens
howtolens/simulators/chapter_2/mass_sis__source_exp_x2.py
4,490
Python
#!/usr/bin/env python import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import sys all_raw = open(sys.argv[1], 'r') # init empty lists cell0v = [] cell1v = [] cell2v = [] cell3v = [] totalv = [] # Process data into lists for line in all_raw: if 'voltage cell 0: ' in line: try: ...
29.035714
75
0.587946
[ "Unlicense" ]
rjmendez/lifepo4_bms
plot_battery.py
1,626
Python
import time from messaging_pyx import Context, Poller, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error MSGS = 1e5 if __name__ == "__main__": c = Context() sub_sock = SubSocket() pub_sock = PubSocket() sub_sock.connect(c, "controlsState") pub_sock.connect(c, "controlsState") poll...
21.032258
113
0.642638
[ "MIT" ]
1Thamer/openpilot0.6.6
selfdrive/messaging/demo.py
652
Python
########################### # # #21 Amicable numbers - Project Euler # https://projecteuler.net/problem=21 # # Code by Kevin Marciniak # ########################### def sumproperdivisors(num): sum = 0 for x in range(1, int((num / 2)) + 1): if num % x == 0: sum += x return sum amicabl...
20.941176
83
0.573034
[ "BSD-3-Clause" ]
kmarcini/Project-Euler-Python
problem0021.py
712
Python
import threading from typing import Callable, List, MutableMapping, NamedTuple from dagster import check from dagster.core.events.log import EventLogEntry from .sql_event_log import SqlEventLogStorage POLLING_CADENCE = 0.1 # 100 ms class CallbackAfterCursor(NamedTuple): """Callback passed from Observer class ...
44.841463
104
0.68371
[ "Apache-2.0" ]
AndreaGiardini/dagster
python_modules/dagster/dagster/core/storage/event_log/polling_event_watcher.py
7,354
Python
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/stable/config # -- Path setup ------------------------------------------------------------...
29.146226
87
0.653666
[ "Apache-2.0" ]
agaszmurlo/bdg-sequila
docs/source/conf.py
6,179
Python
from typing import Optional, Type from pydantic import UUID4 from tortoise import fields, models from tortoise.exceptions import DoesNotExist from fastapi_users.db.base import BaseUserDatabase from fastapi_users.models import UD class TortoiseBaseUserModel(models.Model): id = fields.UUIDField(pk=True, generated...
33.917808
87
0.657108
[ "MIT" ]
JeffreyThijs/fastapi-users
fastapi_users/db/tortoise.py
4,952
Python