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
#!/usr/bin/env python3 # Copyright 2021 Xiaomi Corporation (Author: Liyong Guo, Fangjun Kuang) # # See ../../../../LICENSE for clarification regarding multiple authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain ...
33.02446
91
0.605132
[ "Apache-2.0" ]
aarora8/icefall
egs/librispeech/ASR/conformer_mmi/decode.py
22,952
Python
#!/usr/bin/env python # -*- Mode: Python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- # vi: set ts=4 sw=4 expandtab: # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (the "License"); you may not us...
42.8
239
0.697263
[ "Apache-2.0" ]
Acidburn0zzz/shumway
src/avm2/generated/generate.py
2,996
Python
#!/usr/bin/env python class FilterModule(object): def filters(self): return {'json_env_map': self.json_env_map} def json_env_map(self, env): return [{'name': k, 'value': str(v)} for k,v in env.items()]
24.444444
66
0.65
[ "MIT" ]
antoine-fl/ansible-clever
filter_plugins/env_json_map.py
220
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- class TrafficWeight: def __init__(self): self.request = 0 self.response = 0 class PacketInterval: def __init__(self): self.firstPacket = 0 self.lastPacket = 0
17.461538
24
0.651982
[ "MIT" ]
AntoineRondelet/SideChannelLeaksOverHTTPS
src/utils.py
227
Python
# Dana jest posortowana tablica A[1, ..., n] oraz liczba x. Proszę napisać program, który stwierdza # czy istnieją indeksy i oraz j takie, że A[i] + A[j] = x. def sum_search(T, x): l = 0 r = len(T) - 1 while l <= r: if T[l] + T[r] == x: return True elif T[l] + T[r] > x: ...
21.952381
99
0.488069
[ "MIT" ]
Szymon-Budziak/ASD_exercises_solutions
Exercises/Exercises_01/07_exercise.py
466
Python
# Generated by Django 2.2.12 on 2020-07-05 18:03 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('vote', '0002_request_track'), ] operations = [ migrations.AddField( model_name='track', name='metadata_locked', ...
20.421053
53
0.600515
[ "BSD-3-Clause" ]
colons/nkd.su
nkdsu/apps/vote/migrations/0003_track_metadata_locked.py
388
Python
# IMPORTATION STANDARD # IMPORTATION THIRDPARTY import pytest # IMPORTATION INTERNAL from openbb_terminal.cryptocurrency.defi import terraengineer_model @pytest.mark.vcr @pytest.mark.parametrize( "asset,address", [("ust", "terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8")], ) def test_get_history_asset_from_te...
23.952381
72
0.771372
[ "MIT" ]
23errg/GamestonkTerminal
tests/openbb_terminal/cryptocurrency/defi/test_terraengineer_model.py
503
Python
from __future__ import print_function # Part of the JBEI Quantitative Metabolic Modeling Library (JQMM) # Copyright (c) 2016, The Regents of the University of California. # For licensing details see "license.txt" and "legal.txt". from builtins import str import re import core import NamedRangedNumber class Gene(Name...
45.327586
128
0.651198
[ "Unlicense" ]
somtirtharoy/jqmm
code/core/Genes.py
7,887
Python
# Copyright 2019, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
40.007117
103
0.718244
[ "Apache-2.0" ]
ddayzzz/federated
tensorflow_federated/python/core/impl/executors/eager_tf_executor.py
22,484
Python
import torch import argparse from bindsnet.network import Network from bindsnet.learning import Hebbian from bindsnet.pipeline import EnvironmentPipeline from bindsnet.encoding import bernoulli from bindsnet.network.monitors import Monitor from bindsnet.environment import GymEnvironment from bindsnet.network.topology ...
27.791045
72
0.713212
[ "MIT" ]
Singular-Brain/ProjectBrain
bindsnet_master/examples/breakout/random_network_baseline.py
3,724
Python
""" Ensemble the predictions from different model outputs. """ import argparse import json import pickle import numpy as np from collections import Counter from data.loader import DataLoader from utils import scorer, constant def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('pred_files...
31.533333
103
0.652854
[ "Apache-2.0" ]
gstoica27/tacred-exploration
ensemble.py
2,365
Python
import os import sys import shutil import subprocess from config import rfam_local as conf from config import gen_config as gc from utils import genome_search_utils as gsu # ------------------------------------------------------------------------ def split_genome_to_chunks(updir, upid): """ updir: upid...
31.259259
82
0.557267
[ "Apache-2.0" ]
Rfam/rfam-production
scripts/support/split_genomes.py
2,532
Python
#!/usr/bin/env python """Pathspecs are methods of specifying the path on the client. The GRR client has a number of drivers to virtualize access to different objects to create a Virtual File System (VFS) abstraction. These are called 'VFS Handlers' and they provide typical file-like operations (e.g. read, seek, tell a...
30.449704
80
0.667314
[ "Apache-2.0" ]
mrhania/grr
grr/lib/rdfvalues/paths.py
10,292
Python
#!/usr/bin/env python3 # Copyright (c) 2020 The Garliccoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. '''Test generateblock rpc. ''' from test_framework.test_framework import GarliccoinTestFramework from test_...
51.598131
155
0.694983
[ "MIT" ]
Garlic-HM/garliccoin
test/functional/rpc_generateblock.py
5,521
Python
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from d...
72.424051
725
0.718081
[ "Apache-2.0" ]
extremenetworks/pybind
pybind/slxos/v17r_1_01a/routing_system/router/router_bgp/router_bgp_attributes/cluster_id/__init__.py
11,443
Python
from django.contrib import messages, auth from django.contrib.auth.decorators import login_required from payments.forms import MakePaymentForm from django.shortcuts import render, get_object_or_404, redirect from django.core.urlresolvers import reverse from django.template.context_processors import csrf from django.con...
34.510204
91
0.645772
[ "MIT" ]
lilschmitz/Lifestyle_Fitness_Site
payments/views.py
1,691
Python
#!/usr/bin/env python2.7 # William Lam # wwww.virtuallyghetto.com # # 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 app...
32.977528
74
0.656899
[ "Apache-2.0" ]
whchoi98/whchoi_pyvmomi-community-samples
samples/set_vcenter_motd.py
2,935
Python
# -------------- #Importing header files import pandas as pd import numpy as np import matplotlib.pyplot as plt #Path of the file is stored in the variable path data=pd.read_csv(path) #Code starts here data.rename(columns={'Total':'Total_Medals'},inplace=True) # Data Loading data['Better_Event'] = np.where(data['Tota...
31.388235
103
0.775487
[ "MIT" ]
Monika199211/olympics-data-analysis
code.py
2,668
Python
from functools import partial as curry from django import forms from django.utils import timezone from django.utils.text import slugify from django.utils.translation import ugettext_lazy as _ from pinax.images.models import ImageSet from mdeditor.fields import MDTextFormField from .conf import settings from .models...
26.558442
86
0.593643
[ "MIT" ]
Zorking/pinax-blog
pinax/blog/forms.py
4,090
Python
from mininet.topo import Topo class Project1_Topo_0866007(Topo): def __init__(self): Topo.__init__(self) # Add hosts h1 = self.addHost('h1', ip='192.168.0.1/24') h2 = self.addHost('h2', ip='192.168.0.2/24') h3 = self.addHost('h3', ip='192.168.0.3/24') h4 = self.add...
25.46875
52
0.548466
[ "MIT" ]
shoulderhu/0866007-sdn-lab
project1_0866007/bonus_0866007.py
815
Python
# Copyright 2011 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,...
29.061947
92
0.704324
[ "Apache-2.0" ]
natduca/osx-trace
src/osx_trace_test.py
3,284
Python
import datetime from django.contrib.syndication import feeds, views from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.utils import tzinfo from django.utils.feedgenerator import rfc2822_date, rfc3339_date from models import Entry from xml.dom import minidom try: se...
39.631737
151
0.607993
[ "BSD-3-Clause" ]
Smarsh/django
tests/regressiontests/syndication/tests.py
13,237
Python
import requests from logging import getLogger from bs4 import BeautifulSoup from requests import Session from typing import List from urllib.parse import quote_plus from .book import Book from ..base import HEADERS class BahanAjar: def __init__(self, email: str, password: str, login: bool = True): self.se...
35.212121
98
0.609725
[ "MIT" ]
UnivTerbuka/ut-telegram-bot
libs/bahan_ajar/bahan_ajar.py
2,324
Python
""" Provides linkedin api-related code """ import random import logging from time import sleep import json from linkedin_api.utils.helpers import get_id_from_urn from linkedin_api.client import Client logger = logging.getLogger(__name__) class Linkedin(object): """ Class for accessing Linkedin API. """...
34.379679
258
0.575932
[ "MIT" ]
Alexander-Bakogeorge/linkedin-api
linkedin_api/linkedin.py
19,287
Python
import os import sys sys.path.append( os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) ) from src.DbHelper import DbHelper persons = [ 'Lucy', 'Franz', 'Susanne', 'Jonathan', 'Max', 'Stephan', 'Julian', 'Frederike', 'Amy', 'Miriam...
28.118644
139
0.614225
[ "MIT" ]
LFeret/masterseminar
src/Simple_Fraud_Detection/solution/01_fill_fraud_db_with_nodes.py
1,660
Python
# Keypirinha launcher (keypirinha.com) import keypirinha as kp import keypirinha_util as kpu import keypirinha_net as kpnet import json import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), "lib")) from faker import Faker class FakerData(kp.Plugin): ITEMCAT = kp.ItemCategory.USER_BASE + 1 ITEMRE...
27.919355
117
0.691797
[ "MIT" ]
Fuhrmann/keypirinha-faker-data
src/fakerdata.py
3,462
Python
from queue import Queue, Empty, Full from ..core import DriverBase, format_msg import pika class Driver(DriverBase): def __init__(self, exchange, queue, routing_key=None, buffer_maxsize=None, *args, **kwargs): super().__init__() self._args = args self._kwargs = kwargs ...
33.65625
78
0.539926
[ "Apache-2.0" ]
frantp/iot-sensor-reader
piot/outputs/amqp.py
2,154
Python
# -*- coding: utf-8 -*- import subprocess def test_too_many_arguments_in_fixture(absolute_path): """ End-to-End test to check arguments count. It is required due to how 'function_type' parameter works inside 'flake8'. Otherwise it is not set, unit tests can not cover `is_method` correctly. ...
25.958333
76
0.654896
[ "MIT" ]
AlwxSin/wemake-python-styleguide
tests/test_checkers/test_high_complexity.py
623
Python
import itertools try: import theano import theano.tensor as T from theano.gradient import disconnected_grad except ImportError: theano = None T = None from ._backend import Backend from .. import make_graph_backend_decorator class _TheanoBackend(Backend): def __init__(self): super()....
39.211009
79
0.649509
[ "BSD-3-Clause" ]
Andrew-Wyn/pymanopt
pymanopt/autodiff/backends/_theano.py
4,274
Python
#!-*-coding:utf-8-*- import sys # import PyQt4 QtCore and QtGui modules from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5 import QtCore from pylinac import VMAT from dmlc import Ui_MainWindow class DirectoryPath(object): def __init__(self, pathDir, getCountImages): self._pathDir = pathDi...
35.784483
120
0.630691
[ "MIT" ]
bozhikovstanislav/UI-Pylinac
VMAT/Dmlc/main.py
4,151
Python
import numpy as np import pickle import math try: from utilities import dot_loss, next_batch except ImportError: from utilities.utilities import dot_loss, next_batch class DontCacheRef(Exception): pass class BasicConverter(object): def __init__(self, learning_rate = 0.05, batch_size = 1, num_epochs =...
45.261649
177
0.578001
[ "BSD-3-Clause" ]
Tevien/HEPDrone
nndrone/converters.py
12,628
Python
from . import registry def step(match): def outer(func): registry.add(match, func) def inner(*args, **kwargs): func(*args, **kwargs) return inner return outer
18.636364
35
0.565854
[ "Apache-2.0" ]
tswicegood/maxixe
maxixe/decorators.py
205
Python
import emoji emoji.emojize('\:sunglasses:?') #Transformação #Comentário String['Curso em Videos Python'] frase[9:13] frase[9:21:2] frase[:5] frase[15:] frase[9::3] #Aula Curso Em Video Python 9 => revisão 2 [13/07/2020 14h00m] #Funcionalidades de Trasnformação Objeti.Methodo() #Comentário frase.fi...
24.055556
94
0.702079
[ "MIT" ]
ErosMLima/python-server-connection
natural-languages-python.py
876
Python
_HAS_OPS = False def _register_extensions(): import os import imp import torch # load the custom_op_library and register the custom ops lib_dir = os.path.dirname(__file__) _, path, _ = imp.find_module("_C", [lib_dir]) torch.ops.load_library(path) try: _register_extensions() _HAS...
31
115
0.619861
[ "BSD-3-Clause" ]
AryanRaj315/vision
torchvision/extension.py
1,581
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...
32.480519
80
0.708517
[ "Apache-2.0" ]
HubBucket-Team/io
tensorflow_io/hadoop/python/ops/hadoop_dataset_ops.py
2,501
Python
import os from os.path import splitext names=os.listdir() number=1 f_name="" videos=[] ext = [".3g2", ".3gp", ".asf", ".asx", ".avi", ".flv", ".m2ts", ".mkv", ".mov", ".mp4", ".mpg", ".mpeg", ".rm", ".swf", ".vob", ".wmv"] for fileName in names: if fileName.endswith(tuple(ext)): f_name, f_ext= splitext(fi...
21.391304
135
0.579268
[ "MIT" ]
eren-ozdemir/get-subtitles
RenameSubs.py
492
Python
# Copyright (c) 2018 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 app...
35.222222
76
0.629513
[ "Apache-2.0" ]
skylarch/Paddle
python/paddle/fluid/tests/unittests/test_while_op.py
2,853
Python
from models.joint_fpn import JointFpn from trainers.segmentation_trainer import SegmentationTrainer from data_generators.joint_data_generator import JointDataGenerator from data_generators.scenenet_rgbd_data_generator import ScenenetRGBDDataGenerator from utils.config import process_config from utils.dirs import create...
32.377049
82
0.729114
[ "Apache-2.0" ]
Barchid/Indoor_Segmentation
train_joint.py
1,975
Python
# coding: utf-8 import warnings import numpy as np import pandas as pd from packaging import version from sklearn.metrics import pairwise_distances_chunked from sklearn.utils import check_X_y,check_random_state from sklearn.preprocessing import LabelEncoder import functools from pyclustering.cluster.clarans import cla...
37.988827
123
0.691324
[ "Unlicense" ]
wgova/automations
clust_indices.py
6,800
Python
import numpy GenSpeedF = 0 IntSpdErr = 0 LastGenTrq = 0 LastTime = 0 LastTimePC = 0 LastTimeVS = 0 PitCom = numpy.zeros(3) VS_Slope15 = 0 ...
33.538462
52
0.298165
[ "Apache-2.0" ]
tonino102008/openfast
ExampleCases/OpFAST_WF1x1/globalDISCON.py
436
Python
from .base import Uploader from .photo import PhotoUploader from .doc import DocUploader from .audio import AudioUploader
24.4
32
0.836066
[ "MIT" ]
Doncode/vkbottle
vkbottle/api/uploader/__init__.py
122
Python
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np import pytest from common.onnx_layer_test_class import Caffe2OnnxLayerTest class TestImageScaler(Caffe2OnnxLayerTest): def create_net(self, shape, scale, ir_version): """ ONNX net ...
31.518519
103
0.57971
[ "Apache-2.0" ]
3Demonica/openvino
tests/layer_tests/onnx_tests/test_image_scaler.py
5,106
Python
lista = ['item1', 'item2', 'item3', 123, 12.43, 898.34, 00.989] print(lista) del lista[0] # pode remover tudo ou apenas um item de um indice permanentemente popped = lista.pop(0) #pode remover um item pelo indice de uma lista, porem o item tirado pode ser posto em uma variavel lista.remove('item3') # pode remover um it...
37.6
120
0.711246
[ "MIT" ]
Alex4gtx/estudos
python/cursoemvideo-python/03-mundo-3/listas/lista 1/listas.py
1,318
Python
import random ### Advantage Logic ### def advantage(rollfunc): roll1 = rollfunc roll2 = rollfunc if roll1 > roll2: return roll1 else: return roll2 ### Disadvantage Logic ### def disadvantage(rollfunc): roll1 = rollfunc roll2 = rollfunc if roll1 < roll2: return roll1 ...
20.162162
35
0.651475
[ "MIT" ]
bwnelb/dnd5e
DieRolls.py
746
Python
# Copyright 2021 NVIDIA 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 wr...
30.059322
78
0.68424
[ "Apache-2.0" ]
Pandinosaurus/legate.pandas
legate/pandas/frontend/accessors.py
3,547
Python
""" This is the UGaLi analysis sub-package. Classes related to higher-level data analysis live here. Modules objects : mask : """
13.454545
56
0.655405
[ "MIT" ]
DarkEnergySurvey/ugali
ugali/analysis/__init__.py
148
Python
from keras.models import Sequential, load_model from keras.layers.core import Dense, Dropout, Activation,Flatten from keras.layers.recurrent import LSTM, GRU, SimpleRNN from keras.layers.convolutional import Convolution2D, Convolution1D, MaxPooling2D, MaxPooling1D, AveragePooling2D from keras.layers.normalization impor...
36.235294
113
0.663312
[ "Apache-2.0" ]
SharanRajani/SoundQX
test_gen_spec.py
3,080
Python
from myelin.utils import CallbackList, Experience class RLInteraction: """An episodic interaction between an agent and an environment.""" def __init__(self, env, agent, callbacks=None, termination_conditions=None): self.env = env self.agent = agent self.callbacks = CallbackList(callba...
35.921569
80
0.606987
[ "MIT" ]
davidrobles/myelin
myelin/core/interactions.py
1,832
Python
from __future__ import division import numpy as np from scipy import ndimage as ndi from ..morphology import dilation, erosion, square from ..util import img_as_float, view_as_windows from ..color import gray2rgb def _find_boundaries_subpixel(label_img): """See ``find_boundaries(..., mode='subpixel')``. Not...
43.030172
83
0.54102
[ "MIT" ]
IZ-ZI/-EECS-393-_Attendance-System
venv/lib/python3.8/site-packages/skimage/segmentation/boundaries.py
9,983
Python
from __future__ import print_function import argparse import gym from itertools import count import numpy as np import mxnet as mx import mxnet.ndarray as F from mxnet import gluon from mxnet.gluon import nn from mxnet import autograd parser = argparse.ArgumentParser(description='MXNet actor-critic example') parser...
34.846154
85
0.604029
[ "Apache-2.0" ]
Jeffery-Song/MXNet-RDMA
example/gluon/actor_critic.py
3,624
Python
import click from typing import Sequence, Tuple from click.formatting import measure_table, iter_rows class OrderedCommand(click.Command): def get_params(self, ctx): rv = super().get_params(ctx) rv.sort(key=lambda o: (not o.required, o.name)) return rv def format_options(self, ctx, f...
40.964706
120
0.617461
[ "Apache-2.0" ]
yellowdog/virtual-screening-public
src/cli.py
3,482
Python
from django.utils.translation import ugettext_lazy as _ from mayan.apps.events.classes import EventTypeNamespace namespace = EventTypeNamespace( label=_('File metadata'), name='file_metadata' ) event_file_metadata_document_file_submit = namespace.add_event_type( label=_('Document file submitted for ...
33.058824
69
0.782918
[ "Apache-2.0" ]
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
mayan/apps/file_metadata/events.py
562
Python
import argparse import glob import os import time import vlc import cv2 import numpy as np from enum import Enum from tqdm import tqdm from PIL import Image, ImageDraw, ImageFont from align.align_trans import get_reference_facial_points from align.detector import load_detect_faces_models, process_faces from align.vis...
30.844828
98
0.587144
[ "MIT" ]
kovibalu/face.evoLVe.PyTorch
test_video_stream.py
8,945
Python
from userinput import * from types import SimpleNamespace import sys from PyQt5.QtCore import pyqtSignal as pys class numberInput(QtWidgets.QMainWindow,Ui_MainWindow): input_num=pys(str) def __init__(self,opacity=1,loc=(200,200),parent=None): super(numberInput,self).__init__(parent) ...
31.8
61
0.638365
[ "MIT" ]
magxTz/udventVersion2.0
udvent_reworked_v2_2_friday/input_Number.py
2,226
Python
""" Copyright 2020 The Magma Authors. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES O...
41.907216
79
0.588438
[ "BSD-3-Clause" ]
0xa6e/magma
orc8r/gateway/python/magma/magmad/tests/sync_rpc_client_tests.py
4,065
Python
from typing import Dict, List from sortedcontainers import SortedDict from shamrock.types.blockchain_format.coin import Coin from shamrock.types.blockchain_format.sized_bytes import bytes32 from shamrock.types.mempool_item import MempoolItem class Mempool: def __init__(self, max_size_in_cost: int): self...
37.315217
120
0.629187
[ "Apache-2.0" ]
zcomputerwiz/shamrock-blockchain
shamrock/full_node/mempool.py
3,433
Python
import time import copy import pickle import warnings import numpy as np import scipy.sparse as sp import torch import torch.nn.functional as F from sklearn.metrics import roc_auc_score, average_precision_score, precision_recall_curve, auc def sparse_to_tuple(sparse_mx): if not sp.isspmatrix_coo(sparse_mx): ...
41.770492
126
0.635597
[ "MIT" ]
DM2-ND/GAug
vgae/utils.py
5,096
Python
# -*- coding: utf-8 -*- # @Author: Yanqi Gu # @Date: 2019-04-20 16:30:52 # @Last Modified by: Yanqi Gu # @Last Modified time: 2019-04-20 16:57:49
25
42
0.613333
[ "MIT" ]
Guyanqi/DPC4.5
DPDecisionTree/__init__.py
150
Python
def is_alpha(c): result = ord('A') <= ord(c.upper()) <= ord('Z') return result def is_ascii(c): result = 0 <= ord(c) <= 127 return result def is_ascii_extended(c): result = 128 <= ord(c) <= 255 return result
16.857143
51
0.567797
[ "MIT" ]
GoodPeopleAI/django-htk
utils/text/general.py
236
Python
# Copyright (c) 2016,2017,2018,2019 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Contains a collection of generally useful calculation tools.""" import functools from operator import itemgetter import numpy as np from numpy.core.numeric import ...
37.743357
95
0.640413
[ "BSD-3-Clause" ]
Exi666/MetPy
src/metpy/calc/tools.py
53,973
Python
# Copyright 2020-2022 Cambridge Quantum Computing # # 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 a...
38.95
86
0.694052
[ "Apache-2.0" ]
dhaycraft/pytket-extensions
modules/pytket-qsharp/pytket/extensions/qsharp/backends/estimator.py
2,337
Python
# Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Software where # it's copied from other people. In these cases, that will normally be # indicated. # # L...
30.813953
78
0.712453
[ "Apache-2.0" ]
CoyoteLeo/Nuitka
tests/benchmarks/constructs/LoopSmallRange.py
1,325
Python
# Cliente import socket HOST = socket.gethostname() # Endereco IP do Servidor PORT = 9999 # Porta que o Servidor esta udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) dest = (HOST, PORT) print('Para sair, digite $ + Enter') msg = input("Entre com a mensagem:\n") udp.sendto (msg.encode('utf-8'), dest) while msg !=...
33.666667
54
0.679208
[ "MIT" ]
LC-ardovino/INFNET
Projeto_de_Bloco/Etapa8/Ex03_cli.py
507
Python
import sys import random import numpy as np import cv2 src = cv2.imread('vlcsnap-2021-02-04-10h00m02s260.png') #src = cv2.imread('2_11_11.png') if src is None: print('Image load failed!') sys.exit() src = cv2.resize(src, (0, 0), fx=0.5, fy=0.5) src_gray = cv2.cvtColor(src, cv2.COLOR_BGR2GRAY) h, w = src.sha...
22.285714
81
0.653846
[ "MIT" ]
qwerlarlgus/YOLO_Projec
contours.py
1,312
Python
from typing import Literal EventType = Literal['call', 'line', 'return']
15
45
0.706667
[ "BSD-3-Clause" ]
Web-Dev-Collaborative/nbtutor
nbtutor/ipython/models/types.py
75
Python
from rqalpha.api import * def init(context): context.S1 = "510500.XSHG" context.UNIT = 10000 context.INIT_S = 2 context.MARGIN = 0.08 context.FIRST_P = 0 context.holdid = 0 context.sellcount = 0 context.inited = False logger.info("RunInfo: {}".format(context.run_info)) def before...
33.534091
104
0.626567
[ "Apache-2.0" ]
HackReborn/rqalpha
rqalpha/examples/mg_same_value.py
2,951
Python
from app.db import with_session from logic.admin import get_query_metastore_by_id def get_metastore_loader_class_by_name(name: str): from .loaders import ALL_METASTORE_LOADERS for loader in ALL_METASTORE_LOADERS: if loader.__name__ == name: return loader raise ValueError(f"Unknown lo...
29.28
87
0.775956
[ "Apache-2.0" ]
Aka-shi/querybook
querybook/server/lib/metastore/__init__.py
732
Python
import rain_alert
7
18
0.761905
[ "Unlicense" ]
frnkvsk/python100days
day35_env_sms/main.py
21
Python
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys imp...
33.65272
85
0.708566
[ "Apache-2.0" ]
josl/ASM_challenge
docs/conf.py
8,043
Python
# -*- coding: utf-8 -*- import scrapy from city_scrapers.spider import Spider from datetime import datetime, timedelta from dateutil.parser import parse as dateparse import re class Chi_school_community_action_councilSpider(Spider): name = 'chi_school_community_action_council' long_name = 'Chicago Public Schoo...
41.277778
120
0.549237
[ "MIT" ]
jim/city-scrapers
city_scrapers/spiders/chi_school_community_action_council.py
8,916
Python
import logging LOG = logging.getLogger(__name__) class FlushAndLockMySQLAction(object): def __init__(self, client, extra_flush=True): self.client = client self.extra_flush = extra_flush def __call__(self, event, snapshot_fsm, snapshot_vol): if event == 'pre-snapshot': if s...
35.047619
63
0.634511
[ "BSD-3-Clause" ]
a5a351e7/holland
plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/lock.py
736
Python
# -*- coding: utf-8 -*- # # Copyright 2017 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 requi...
37.724138
74
0.73309
[ "Apache-2.0" ]
bshaffer/google-cloud-sdk
lib/surface/iot/registries/credentials/list.py
2,188
Python
from torch import nn from pytorch_widedeep.wdtypes import * # noqa: F403 from pytorch_widedeep.models.tabular.mlp._layers import MLP from pytorch_widedeep.models.tabular._base_tabular_model import ( BaseTabularModelWithAttention, ) from pytorch_widedeep.models.tabular.transformers._encoders import SaintEncoder ...
41.565371
110
0.642013
[ "MIT" ]
TangleSpace/pytorch-widedeep
pytorch_widedeep/models/tabular/transformers/saint.py
11,763
Python
#!/usr/bin/env python # encoding: utf-8 import socket import sys import tempfile import time import subprocess import os # function to get free port from ycmd def GetUnusedLocalhostPort(): sock = socket.socket() # This tells the OS to give us any free port in the range [1024 - 65535] sock.bind(('', 0)) port =...
28.210145
107
0.552787
[ "MIT", "BSD-3-Clause" ]
darconeous/shattings
vim/bundle/vim-javacomplete2/autoload/javavibridge.py
3,893
Python
"""This file defines the database connection, plus some terminal commands for setting up and tearing down the database. Do not import anything directly from `backend.database._core`. Instead, import from `backend.database`. """ from typing import Optional import os import pandas as pd import click from flask import ...
28.816568
80
0.675975
[ "MIT" ]
stianberghansen/police-data-trust
backend/database/core.py
4,870
Python
#! /usr/bin/env python # -*- coding: latin-1; -*- ''' Copyright 2018 University of Liège 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 re...
27.757813
100
0.639178
[ "Apache-2.0" ]
mlucio89/CUPyDO
tests/PFEM_Metafor/waterColoumnFallWithFlexibleObstacle_obstacle_Mtf_E_1_0e6_EAS.py
3,555
Python
#!/usr/bin/env python import numpy import scipy from scipy import io data_dict = scipy.io.loadmat('../data/hmsvm_data_large_integer.mat', struct_as_record=False) parameter_list=[[data_dict]] def structure_discrete_hmsvm_bmrm (m_data_dict=data_dict): import shogun as sg try: _ = sg.create_machine("DualLibQPBMSO...
27.909091
92
0.754886
[ "BSD-3-Clause" ]
AbhinavTalari/shogun
examples/undocumented/python/structure_discrete_hmsvm_bmrm.py
1,228
Python
### # Copyright (c) 2003-2005, Jeremiah Fincher # Copyright (c) 2009, James McCoy # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyr...
43.5
80
0.625862
[ "BSD-3-Clause" ]
AntumDeluge/Limnoria
plugins/String/test.py
6,964
Python
# Copyright 2013: Mirantis 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 b...
43.772727
78
0.751817
[ "Apache-2.0" ]
LorenzoBianconi/rally
rally/common/objects/__init__.py
963
Python
from itertools import combinations from typing import Callable, Dict, Set, Tuple, Union import networkx as nx import pandas as pd from causal_networkx import ADMG from causal_networkx.discovery.classes import ConstraintDiscovery def _has_both_edges(dag, i, j): return dag.has_edge(i, j) and dag.has_edge(j, i) ...
38.933962
98
0.500969
[ "BSD-3-Clause" ]
adam2392/causal-networkx
causal_networkx/discovery/pcalg.py
8,254
Python
# Copyright 2016 Rackspace # Copyright 2016 Intel 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 # # http://www.apache.org/licenses/LICE...
38.366492
79
0.631141
[ "Apache-2.0" ]
FuzeSoft/OpenStack-Stein
glance-18.0.0/glance/tests/functional/db/test_migrations.py
7,328
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Arne Neumann <discoursegraphs.programming@arne.cl> """ The ``brat`` module converts discourse graphs into brat annotation files. """ import os import codecs import math import itertools from collections import defaultdict import brewer2mpl from unidecode import...
35.391892
102
0.661512
[ "BSD-3-Clause" ]
arne-cl/discoursegraphs
src/discoursegraphs/readwrite/brat.py
5,238
Python
from django.shortcuts import render from django.views.generic.detail import DetailView from todos.models import Task def index(request): return render(request, 'frontend/index.html') class TodoDetailView(DetailView): model = Task template_name = 'frontend/index.html'
20.357143
50
0.768421
[ "MIT" ]
yuliiabuchko/todo
frontend/views.py
285
Python
# Copyright (c) 2014 Ben Swartzlander. All rights reserved. # Copyright (c) 2014 Navneet Singh. All rights reserved. # Copyright (c) 2014 Clinton Knight. All rights reserved. # Copyright (c) 2014 Alex Meade. All rights reserved. # Copyright (c) 2014 Bob Callaway. All rights reserved. # # Licensed under the Apac...
40.660256
78
0.623837
[ "Apache-2.0" ]
potsmaster/cinder
cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_api.py
6,343
Python
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '0...
31
114
0.604579
[ "BSD-3-Clause" ]
Fanevanjanahary/django-offline-messages
offline_messages/migrations/0001_initial.py
961
Python
from functools import partial from typing import List, Optional, Union from transformers import (AlbertModel, AlbertTokenizer, BartModel, BigBirdModel, BigBirdTokenizer, BartTokenizer, BertModel, BertTokenizer, CamembertModel, CamembertTokenizer, CTRLModel, ...
48.176871
120
0.673539
[ "MIT" ]
SelvinDatatonic/bert-extractive-summarizer
summarizer/bert.py
7,082
Python
from json import load from typing import Union import pygame as pg from pygame import Surface, event from pygame.display import set_mode, set_caption, set_icon, get_surface, update from pygame.key import get_pressed as get_key_pressed from pygame.mouse import get_pressed as get_mouse_pressed from pygame.time import Cl...
31.126761
113
0.600226
[ "Apache-2.0" ]
Mio-coder/clicer
source/scripts/manager.py
4,420
Python
from __future__ import absolute_import from __future__ import print_function import graph_tool.all as gt import numpy as np from .base import LabelGraphClustererBase from .helpers import _membership_to_list_of_communities, _overlapping_membership_to_list_of_communities class StochasticBlockModel: """A Stochastic...
36.699219
115
0.673018
[ "BSD-2-Clause" ]
yuan776/scikit-multilearn
yyskmultilearn/cluster/graphtool.py
9,395
Python
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
33.915254
82
0.270365
[ "BSD-3-Clause" ]
BiYandong110/bokeh
tests/unit/bokeh/sampledata/test_glucose.py
2,001
Python
# -*- coding: utf-8 -*- # Copyright (c) 2019 - 2021 Geode-solutions # # 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, co...
46.348837
91
0.74009
[ "MIT" ]
Geode-solutions/OpenGeode-IO
bindings/python/tests/mesh/test-py-ply.py
1,993
Python
# YouTube: https://youtu.be/8lP9h4gaKYA # Publicação: https://caffeinealgorithm.com/blog/20210914/funcao-print-e-strings-em-python/ print('Estamos a usar a função print() e eu sou uma string.') print("Continuo a ser uma string.") print('A Maria disse que o Miguel estava "doente".') # A Maria disse que o Miguel es...
50
99
0.722222
[ "MIT" ]
caffeinealgorithm/code-programming-series
Programar em Python/02-Funcao-print-e-Strings.py
454
Python
# -*- coding: utf-8 -*- from __future__ import unicode_literals import math DESTRUIDO = 'Destruido' ATIVO = 'Ativo' GRAVIDADE = 10 # m/s^2 class Ator(): """ Classe que representa um ator. Ele representa um ponto cartesiano na tela. """ _caracter_ativo = 'A' _caracter_destruido = ' ' def _...
31.157233
118
0.648365
[ "MIT" ]
NTMaia/pythonbirds
atores.py
5,030
Python
import sys sys.path.append("..") import os import torch import torchvision as tv import numpy as np from torch.utils.data import DataLoader from torchvision import models import torch.nn as nn from utils import makedirs, tensor2cuda, load_model from argument import parser from visualization import VanillaBackprop impo...
39.593023
94
0.634655
[ "MIT" ]
peterhan91/Medical-Robust-Training
visualization/visualize.py
3,405
Python
from gzip import decompress from http import cookiejar from json import loads, dumps from os import environ from time import strftime, gmtime from urllib import request def get_url(ticker): env = environ.get('FLASK_ENV', 'development') if env == 'development': url = 'https://www.fundamentus.com.br/am...
35.178571
162
0.658883
[ "MIT" ]
pedroeml/stock-projection-service
historical_prices.py
1,970
Python
import numpy as np import numpy.ma as npma from scipy import stats import matplotlib.pyplot as plt import baspy as bp import fnmatch """ Created on Wed Nov 27 18:34 2019 @author: Christine McKenna ======================================================================== Purpose: Plots Supp Fig 2, a pdf of all possibl...
33.495575
75
0.573844
[ "Apache-2.0" ]
Priestley-Centre/Near_term_warming
analysis_figure_code/SuppFig2/SuppFig2.py
3,785
Python
import unittest import progresspie class TestCalculationMethods(unittest.TestCase): def test_is_black(self): self.assertEqual(progresspie.is_black(99, 99, 99), False) self.assertEqual(progresspie.is_black(0, 55, 55), False) self.assertEqual(progresspie.is_black(12, 55, 55), False) ...
28
65
0.698214
[ "MIT" ]
paujim/ProgressPie
test_progresspie.py
560
Python
import requests def gen_from_urls(urls: tuple) -> tuple: for resp in (requests.get(url) for url in urls): # yield returns only 1 items at a time. yield len(resp.content), resp.status_code, resp.url if __name__ == "__main__": urls = ( "https://www.oreilly.com/", "https://twitt...
24.368421
59
0.609071
[ "MIT" ]
archeranimesh/HeadFirstPython
SRC/Chapter_13-Advanced-Iteration/12_function_yield.py
463
Python
# Copyright 2015 Open Source Robotics Foundation, 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 ...
41.210127
156
0.607753
[ "Apache-2.0" ]
jlblancoc/ci
ros2_batch_job/__main__.py
32,556
Python
"""database session management.""" import logging import os from contextlib import contextmanager from typing import Iterator import attr import psycopg2 import sqlalchemy as sa from fastapi_utils.session import FastAPISessionMaker as _FastAPISessionMaker from sqlalchemy.orm import Session as SqlSession from stac_fas...
33.650794
87
0.708491
[ "MIT" ]
AsgerPetersen/stac-fastapi
stac_fastapi/sqlalchemy/stac_fastapi/sqlalchemy/session.py
2,120
Python
# -*- coding: utf-8 -*- import pkg_resources import platform API_YOUTU_END_POINT = 'http://api.youtu.qq.com/' API_TENCENTYUN_END_POINT = 'https://youtu.api.qcloud.com/' API_YOUTU_VIP_END_POINT = 'https://vip-api.youtu.qq.com/' APPID = 'xxx' SECRET_ID = 'xxx' SECRET_KEY = 'xx' USER_ID = 'xx' _config = { 'end_poin...
22.5
91
0.666667
[ "MIT" ]
qinyuanpei/wechat-assistant
TencentYoutuyun/conf.py
855
Python