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
import datetime import os import shutil import subprocess import urllib.request from contextlib import closing import numpy as np import pandas as pd import requests import wbml.out __all__ = [ "DependencyError", "resource", "dependency", "asserted_dependency", "split_df", "data_path", "d...
31.176768
82
0.599708
[ "MIT" ]
wesselb/wbml
wbml/data/data.py
6,173
Python
#! /usr/bin/env python # coding utf-8 import sys from sys import exit import os import socket import requests import smtplib import ssl import dns.resolver """ Python script to monitor list of url (https/http/ns/mx) and send mail if down""" __author__ = "Benjamin Kittler" __copyright__ = "Copyright 2021, KITTLER" ...
29.096257
96
0.541996
[ "MIT" ]
bkittler/monitor2mail
monitor2mail.py
10,882
Python
from fuzzconfig import FuzzConfig import nonrouting import nets import pytrellis import re import fuzzloops jobs = [ { "cfg": FuzzConfig(job="BANKREF8", family="ECP5", device="LFE5U-45F", ncl="empty.ncl", tiles=["MIB_R71C3:BANKREF8"]), "side": "B", "pin": "R1" ...
26.984127
130
0.468235
[ "ISC" ]
AndresNavarro82/prjtrellis
fuzzers/ECP5/143-bankref8/fuzzer.py
1,700
Python
# Copyright (c) OpenMMLab. All rights reserved. import mmcv import warnings from copy import deepcopy from mmdet.datasets.builder import PIPELINES from mmdet.datasets.pipelines import Compose @PIPELINES.register_module() class MultiScaleFlipAug3D(object): """Test-time augmentation with multiple scales and flippi...
45.033058
78
0.576436
[ "Apache-2.0" ]
Comverser/mmdetection3d
mmdet3d/datasets/pipelines/test_time_aug.py
5,449
Python
import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * generator = cms.EDFilter("Pythia8GeneratorFilter", comEnergy = cms.double(13000.0), pythiaHepMCVerbosity = cms.untracked.bool(False), pythiaPylis...
44.065217
93
0.513567
[ "MIT" ]
jking79/Timing
GEN_SIM/Configuration/GenProduction/python/ThirteenTeV/HVDS/HVDS_MZP300_MDP20_Ctau500mm_Pythia8_13TeV_cff.py
2,027
Python
# code is based on https://github.com/katerakelly/pytorch-maml import torchvision import torchvision.datasets as dset import torchvision.transforms as transforms import torch from torch.utils.data import DataLoader,Dataset import random import os from PIL import Image import matplotlib.pyplot as plt import numpy as np ...
34.761589
129
0.668508
[ "MIT" ]
WendyBaiYunwei/FSL
miniimgnet/KD-gan/task_generator.py
5,249
Python
# coding: utf-8 """ Seldon Deploy API API to interact and manage the lifecycle of your machine learning models deployed through Seldon Deploy. # noqa: E501 OpenAPI spec version: v1alpha1 Contact: hello@seldon.io Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future...
24.756098
122
0.730049
[ "Apache-2.0" ]
RafalSkolasinski/seldon-deploy-client
python/test/test_cinder_volume_source.py
1,015
Python
import whois def get_whois(domain): try: query = whois.query(domain) assert isinstance(query, whois._3_adjust.Domain) return query.__dict__ except: pass return None def get_scans(domain): url = "http://" + domain urls = [url] scans = vt.get_url_reports([url])[ur...
22.90625
59
0.601637
[ "MIT" ]
sudo-rushil/CNN-LSTM_Domain_Classifier
intel_query.py
733
Python
# Generated file, please do not change!!! import typing from ...models.error import ErrorResponse from ...models.shipping_method import ShippingMethodPagedQueryResponse if typing.TYPE_CHECKING: from ...base_client import BaseClient class ByProjectKeyShippingMethodsMatchingCartRequestBuilder: _client: "Base...
32.510638
80
0.643979
[ "MIT" ]
lime-green/commercetools-python-sdk
src/commercetools/platform/client/matching_cart/by_project_key_shipping_methods_matching_cart_request_builder.py
1,528
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 ...
43.776818
139
0.670526
[ "Unlicense", "MIT" ]
amcclead7336/Enterprise_Data_Science_Final
venv/lib/python3.8/site-packages/azure/mgmt/containerservice/v2019_02_01/models/_models.py
60,806
Python
import pandas as pd from nibabel.tmpdirs import InTemporaryDirectory from nose.tools import (assert_raises, assert_true, ) from nistats.utils import _check_events_file_uses_tab_separators def make_data_for_test_runs(): data_for_temp_datafile = [ ['csf', 'c...
33.977612
78
0.664617
[ "BSD-3-Clause" ]
bthirion/nistats
nistats/tests/test_check_events_file_uses_tab_separators.py
4,553
Python
from django import forms from django.http import QueryDict from django.forms.formsets import formset_factory from abc import ABCMeta, abstractmethod from collections import OrderedDict from datetime import date import itertools import re from fields import SubmitButtonField, SubmitButtonWidget class Filter(object): ...
35.008547
102
0.595296
[ "MIT" ]
flagshipenterprise/django-prickly-reports
reporting/base.py
12,288
Python
"""A Mailman newsletter subscription interface. To use this plugin, enable the newsletter module and set the newsletter module and name settings in the admin settings page. """ from django.utils.translation import ugettext as _ from Mailman import MailList, Errors from models import Subscription from satchmo.configur...
34.621622
119
0.62178
[ "BSD-3-Clause" ]
sankroh/satchmo
satchmo/newsletter/mailman.py
5,124
Python
# Generated by Django 3.1.7 on 2021-02-25 17:55 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('backoffice', '0005_auto_20210225_1712'), ] operations = [ migrations.AddField( model_name='buyi...
30.866667
132
0.631749
[ "MIT" ]
mono57/verger.stock-mgmt
backoffice/migrations/0006_auto_20210225_1755.py
928
Python
# # Copyright (c) 2017 Digital Shadows Ltd. # # Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) # from ds_model import DSModel class InfrastructureSSL(DSModel): def __init__(self, id, payload): self._id = id self._payload = payload @property def id(self): ...
20.806452
83
0.634109
[ "Apache-2.0" ]
BenSterenson/phantom-apps
Apps/phdigitalshadows/dsapi/model/infrastructure_ssl.py
645
Python
from django.urls import path from django.views.i18n import JavaScriptCatalog from .views import HelloWorldView app_name = 'pokus1' # make possible use {% url 'pokus1:..' %} # however this is maybe deprecated; you can achieve same in include(), see project level urls.py urlpatterns = [ path('jsi18n/pokus1/', Ja...
34.142857
131
0.730126
[ "MIT" ]
zvolsky/example_translation
pokus1/urls.py
478
Python
#!/usr/bin/env python import os import sys import django from django.conf import settings from django.test.utils import get_runner def runtests(*test_args): """Setup and run django-lockdowns test suite.""" os.environ['DJANGO_SETTINGS_MODULE'] = 'lockdown.tests.test_settings' django.setup() if not ...
20.222222
73
0.705128
[ "BSD-3-Clause" ]
carta/django-lockdown
runtests.py
546
Python
import argparse import collections import functools import itertools import json import multiprocessing as mp import os import pathlib import re import subprocess import warnings os.environ['NO_AT_BRIDGE'] = '1' # Hide X org false warning. import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt impor...
36.582255
79
0.637411
[ "MIT" ]
HanMeh/dreamerv2
plotting.py
19,791
Python
from __future__ import division import requests import json import sys import os from elasticsearch import Elasticsearch from elasticsearch import exceptions try: # idrac_ip = os.environ['IDRAC_IP'] # idrac_username = os.environ['IDRAC_USERNAME'] # idrac_password = os.environ['IDRAC_PASSWORD'] # elastic_i...
28.252632
103
0.564083
[ "MIT" ]
collabnix/openusm
logging/logextractor/search_script.py
2,684
Python
tc = int(input()) while tc: tc -= 1 x = int(input()) if 1 <= x and x < 100: print("Easy") elif 100 <= x and x < 200: print("Medium") else: print("Hard")
19.6
30
0.44898
[ "MIT" ]
foooop/competitive
CodeChef/problems/PROBCAT/main.py
196
Python
""" Module Reader Writer This module provide the ReaderWriter class as a concrete implemenation of the AbstractReaderWriter. It handles the implementation details of interfacing with the hardware. """ from controlpyweb.abstract_reader_writer import AbstractReaderWriter import requests import json from typing import Un...
38
114
0.613522
[ "MIT" ]
washad/ControlPyWeb
controlpyweb/reader_writer.py
7,144
Python
''' Bootstrapped from https://github.com/NewKnowledge/imagenet and refined for D3M purposes Original implementation from Craig Corcoran ''' import os import math import numpy as np import tensorflow as tf from tensorflow.keras.applications import inception_v3, mobilenet_v2, xception from tensorflow.keras.mode...
43.208333
132
0.62111
[ "MIT" ]
Yonder-OSS/D3M-Primitives
primitives/image_classification/utils/imagenet.py
11,407
Python
import sys, os sys.path.insert(1, os.path.join(sys.path[0], '../../../')) import script.rio as io import script.initial_condition.noh1D as noh1D # Domain properties lx = 1.0 ly = 1.0 Nx = 512 Ny = 1 # Scheme execution options T = 0.6 CFL = 0.5 gamma = 5./3. BClayer = 1 quantityList = ['rho', 'rhou_x', 'rhou_y', '...
18.8
83
0.680851
[ "MIT" ]
will-iam/Variant
casepy/eulerRuO1/nNoh512x1/chars.py
470
Python
nome = input('Qual é o seu nome? ') print('Olá', nome + '! Prazer em te conhecer!')
28
47
0.619048
[ "Unlicense" ]
ZaikoXander/Python
Curso/Mundo 1/02.py
86
Python
element_list = ["X", "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "A...
101.625
120
0.306273
[ "Apache-2.0" ]
pFindStudio/pDeep3
pDeep/config/element.py
813
Python
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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://w...
36.188679
92
0.67049
[ "Apache-2.0" ]
HubBucket-Team/tensorrt
tftrt/examples/object_detection/test.py
3,836
Python
# Copyright 2009-present MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
43.10643
79
0.581503
[ "Apache-2.0" ]
Olegt0rr/mongo-python-driver
test/test_json_util.py
19,441
Python
#! -*- coding: utf-8 -*- # # (C) 2013 Internet Initiative Japan Inc. # All rights reserved. # # Created on 2013/05/15 # @author: yosinobu@iij.ad.jp """Notify project owner with email when the project created successfully.""" from pkg_resources import resource_filename from trac.config import Option, ListOption from tra...
37.523256
115
0.654478
[ "MIT" ]
iij/TracPortalPlugin
tracportalopt/project/notification.py
3,227
Python
# -*- coding: utf-8 -*- # # python_exameple documentation build configuration file, created by # sphinx-quickstart on Fri Feb 26 00:29:33 2016. # # 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 fil...
32.511864
79
0.719737
[ "MIT" ]
bascloud/BASCloudAPI
pyBAScloudAPI/docs/conf.py
9,591
Python
from ipdb import set_trace as st from icecream import ic import gc import os import wandb import pandas as pd from fastprogress import progress_bar from loguru import logger import numpy as np import torch from sklearn.metrics import accuracy_score import utils as U import configuration as C import result_handler as r...
36.870849
80
0.572258
[ "MIT" ]
fkubota/kaggle-Rainforest-Connection-Species-Audio-Detection
exp/exp002/trainner.py
10,030
Python
# Generated by Django 2.2.6 on 2019-12-28 22:57 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('FoodStore', '0002_auto_20191209_0246'), ] operations = [ migrations.AddField( model_name='foodhomepagemodel', name='...
24.041667
53
0.601386
[ "MIT" ]
CPU-sangoma/PlentyPot
FoodStore/migrations/0003_auto_20191229_0057.py
577
Python
#!/usr/bin/python import os import string call = " hook(10);\n"; call = " hook(10); hook2(10);hook3(0);hook4(0);\n"; def run_test(num_calls, compiler_command): f = open("program_options_test.cpp", "w") f.write("""#include <boost/program_options.hpp> using namespace boost::program_options; void do_it()...
26.203704
104
0.601413
[ "MIT" ]
angel2230/-tlbb
Game/boost/libs/program_options/test/program_options_size_test.py
1,415
Python
import cv2 import numpy as np from PIL import Image def draw_approx_polyDP(cnt, epsilon=0.01, closed=True): """用多边形来近似的表示曲线""" epsilon = epsilon * cv2.arcLength(cnt, closed) # 得到轮廓的周长信息作为参考值 return cv2.approxPolyDP(cnt, epsilon, closed) # 得到近似多边形框 def draw_convex_hull(cnt): """画凸包,传入的是一些点""" r...
27.904762
100
0.661628
[ "MIT" ]
strawsyz/straw
my_cv/utils/cv2_util.py
4,420
Python
try: from django.conf.urls import * except ImportError: # django < 1.4 from django.conf.urls.defaults import * urlpatterns = patterns("rush_forms.views", #url(r"^(?P<pk>\d+)/$", 'form_view', name='form-detail'), url(r"^(?P<pk>\d+)/$", 'rush_form_view', name='detai...
42
111
0.512987
[ "BSD-3-Clause" ]
goldhand/onegreek
onegreek/rush_forms/urls.py
462
Python
import logging import Queue import sia_client as sc logger = logging.getLogger(__name__) def from_upload_jobs(upload_jobs): """Creates a new upload queue from a list of upload jobs. Creates a new queue of files to upload by starting with the full input dataset and removing any files that are uploaded (...
32.222222
77
0.711494
[ "MIT" ]
mtlynch/sia_load_tester
sia_load_tester/upload_queue.py
1,740
Python
# --------------------------------------------------------------------- # Vendor: DCN # OS: DCWS # --------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # Pyth...
37.688889
90
0.533019
[ "BSD-3-Clause" ]
nocproject/noc
sa/profiles/DCN/DCWS/get_version.py
1,696
Python
"""django1 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.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-based...
38.333333
82
0.721739
[ "MIT" ]
ShiroDevC/Old_Code
python/Django/django1/urls.py
1,150
Python
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, print_function, unicode_literals, absolute_import """ This module implements classes for reading and generating Lammps inputset. For the ease of management we divide LAMMPS in...
40.210084
86
0.660815
[ "MIT" ]
JSelf42/pymatgen
pymatgen/io/lammps/sets.py
4,785
Python
# coding=utf-8 # Exemplos para entendiemnto """nome = input('Qual seu nome?' ) if nome == 'Rodrigo' or nome == 'RAYANNE': print('Que nome lindo vocé tem!') else: print('Que nome tão normal!!!') print('Bom dia, {}'.format(nome))""" n1 = float(input('Digite a primeira nota: ')) n2 = float(input('Digite a segunda ...
28.9
80
0.615917
[ "MIT" ]
rodrigobarbonifilho/Python
Python Aulas/Mundo 1/Aula 010c.py
583
Python
""" Read and plot a PPI from raw mini-MPL data ------------------------------------------ Example of how to read in raw data from the mini-MPL and plot out the PPI by converting it to PyART Author: Adam Theisen """ from matplotlib import pyplot as plt import act try: import pyart PYART_AVAILABLE = True e...
22.459459
86
0.701564
[ "BSD-3-Clause" ]
ANL-DIGR/ACT
examples/plot_raw_minimpl.py
831
Python
# Copyright 2017 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...
33.52459
89
0.666504
[ "Apache-2.0" ]
uve/tensorflow
tensorflow/contrib/eager/python/examples/linear_regression/linear_regression_test.py
4,090
Python
from office365.graph.graph_client import GraphClient from settings import settings def get_token(auth_ctx): """Acquire token via client credential flow (ADAL Python library is utilized)""" token = auth_ctx.acquire_token_with_client_credentials( "https://graph.microsoft.com", settings['client_c...
27.861111
84
0.612164
[ "MIT" ]
stardust85/Office365-REST-Python-Client
examples/outlook/send_message.py
1,003
Python
import tensorflow as tf import cv2 import numpy as np import os from sklearn.model_selection import train_test_split import random import sys my_image_path = 'my_face' others_image_path = 'other_people' image_data = [] label_data = [] def get_padding_size(image): #def get_padding_size(image): h, ...
40.283582
156
0.632827
[ "Apache-2.0" ]
linrio/WhetherOrNotMe
trainCNN.py
8,629
Python
# Copyright © 2019 Province of British Columbia # # 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 agr...
48.531306
135
0.635925
[ "Apache-2.0" ]
leksmall/lear
legal-api/tests/unit/services/test_authorization.py
27,130
Python
""" Tagger using mecab-service """ import traceback import requests from ..models import WordNode from .base import Tagger class MeCabServiceNode(WordNode): """ Parsed word node by MeCabServiceTagger Attributes ---------- surface : str Surface of word part : str Part of the w...
26.477273
77
0.5402
[ "Apache-2.0" ]
uezo/minette-python
minette/tagger/mecabservice.py
3,495
Python
version = '2.0' import mylib print 'self import in 2.0:', mylib
13
34
0.676923
[ "BSD-3-Clause" ]
mitsuhiko/multiversion
example/mylib-2.0/mylib.py
65
Python
from setuptools import setup, find_packages import os.path HERE = os.path.abspath(os.path.dirname(__file__)) def read(*parts): with open(os.path.join(HERE, *parts)) as f: return f.read() setup( name="doc484", version="0.3.4", author="Chad Dombrova", description="Generate PEP 484 type co...
29.827586
77
0.590173
[ "MIT" ]
chadrik/doc484
setup.py
1,730
Python
from django.contrib.gis.db import models from django.contrib.gis.tests.utils import mysql, spatialite # MySQL spatial indices can't handle NULL geometries. null_flag = not mysql class Country(models.Model): name = models.CharField(max_length=30) mpoly = models.MultiPolygonField() # SRID, by default, is 4326 ...
33.058824
79
0.716489
[ "Apache-2.0" ]
AppScale/appscale
AppServer/lib/django-1.4/django/contrib/gis/tests/geoapp/models.py
1,686
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 ...
29.85
76
0.579564
[ "MIT" ]
AutorestCI/azure-sdk-for-python
azure-mgmt-web/azure/mgmt/web/models/resource_metric_name.py
1,194
Python
"""A CSV annotation writer that writes the bbox in x, y, w, h format.""" from .types import CSVAnnotationWriter class WidthHeightCSV(CSVAnnotationWriter): """Writes annotations to a CSV file in the following format. image_name, x_min, y_min, width, height, label """ def get_csv_fieldnames(self): ...
33.961538
75
0.629672
[ "MIT" ]
arunraja-hub/discolight
src/discolight/writers/annotation/widthheightcsv.py
883
Python
import logging from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ValidationError from django.http import HttpResponseRedirect from django.shortcuts import render from django.urls import reverse_lazy from django.utils...
39.217391
103
0.625436
[ "Apache-2.0" ]
cbittner/rdmo
rdmo/projects/views/project_create.py
6,314
Python
from selenium import webdriver from selenium.webdriver.common.keys import Keys import json import os import urllib2 import argparse import sys searchterm = str(sys.argv[1]) # will also be the name of the folder url = "https://www.google.co.in/search?q="+searchterm+"&source=lnms&tbm=isch" browser = webdriver.Chrome() b...
39.302326
225
0.671006
[ "MIT" ]
danscime/Tip-Of-My-Shoe
Model/imagescrape.py
1,690
Python
# Object tracking with keypoints example. # Show the camera an object and then run the script. A set of keypoints will be extracted # once and then tracked in the following frames. If you want a new set of keypoints re-run # the script. NOTE: see the docs for arguments to tune find_keypoints and match_keypoints. import...
37.655172
106
0.687729
[ "MIT" ]
Jack19960208/openmv
usr/examples/09-Feature-Detection/keypoints.py
2,184
Python
import os test_data_dir = os.path.join(os.path.dirname(__file__), 'data') test_config_dir = os.path.join(test_data_dir, 'config-test') graph_data_dir = os.path.join(test_data_dir, 'graph_data') default_worker = {"platform": 'linux', 'arch': '64', 'label': 'linux', ...
33.32
63
0.552221
[ "BSD-3-Clause" ]
AnjuSThomas-anaconda/conda-concourse-ci
tests/utils.py
833
Python
import contextlib import ipaddress import json import os import random import re import time import warnings from collections import Counter from typing import Any, Dict, List, Optional, Set, Union import requests import test_infra.utils.waiting import waiting import yaml from assisted_service_client import models fro...
42.450853
120
0.679813
[ "Apache-2.0" ]
empovit/assisted-test-infra
discovery-infra/test_infra/helper_classes/cluster.py
52,257
Python
""" Purpose: Unsupervised learning sampler Date created: 2020-11-06 Ref repo: https://github.com/White-Link/UnsupervisedScalableRepresentationLearningTimeSeries Local folder: C:/Users/Work1/Desktop/Info/GitHub/python-examples-main/notebook-samples/unsupervised Contributor(s): Mark M. """ import os from pathlib...
23.978836
115
0.703442
[ "MIT" ]
MarkMoretto/python-examples-main
notebook-samples/unsupervised/pred_electricity_consumption.py
4,532
Python
""" Copyright (c) 2021 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from io import BufferedReader, BytesIO import pytest import requests import responses from flexmock import flexmock from atomic_reactor.uti...
33.457831
95
0.695355
[ "BSD-3-Clause" ]
hjmodi/atomic-reactor
tests/utils/test_pnc.py
2,777
Python
class Beam(object): def __init__(self): super().__init__() def get_number_of_rays(self): raise NotImplementedError("method is abstract") def get_rays(self): raise NotImplementedError("method is abstract") def get_ray(self, ray_index): raise NotImplementedError("metho...
23.136364
55
0.675835
[ "MIT" ]
oasys-kit/rafry
rafry/raytracer/beam.py
509
Python
from .hflip import hflip from .resize import resize from .pad import pad from .random_crop import random_crop from .to_tensor import to_tensor from .random_erasing import random_erasing from .random_sized_rect_crop import random_sized_rect_crop def transforms(item, cfg, mode): """ :param item: sample = deepco...
34.741935
97
0.717734
[ "MIT" ]
nickhuang1996/HJL-re-id
MDRSREID/utils/data_utils/transforms/torch_transforms/__init__.py
1,077
Python
import torch import torch.nn as nn import math from arcface.utils import l2_norm, Flatten, SentVec_TFIDF model_urls = { 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth', 'resnet50': 'https://download.pytorch.org...
33.618881
87
0.562142
[ "MIT" ]
DerryHub/the-TaobaoLive-Commodity-Identify-Competition
arcface/resnet_cbam.py
9,615
Python
# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal Transfer = 0 # type: Literal[0] RegisterSecondPassphrase = 1 # type: Literal[1] RegisterDelegate = 2 # type: Literal[2] CastVotes = 3 # type: Literal[3] RegisterMultisignatureAccount = 4 # type: Literal[4] CreateDapp...
30.571429
53
0.721963
[ "MIT" ]
ph4r05/monero-agent
monero_glue/messages/LiskTransactionType.py
428
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import inspect import setuptools from setuptools.command.test import test as TestCommand from setuptools import setup if sys.version_info < (3, 4, 0): sys.stderr.write('FATAL: This script needs to be run with Python 3.4+\n') sys.exit(1) __lo...
31.514286
114
0.636673
[ "Apache-2.0" ]
hjacobs/github-maintainer-cli
setup.py
4,412
Python
from mopidy import backend import pykka from mopidy_funkwhale import api, client, library, playback, playlists class FunkwhaleBackend(pykka.ThreadingActor, backend.Backend): def __init__(self, config, audio): super(FunkwhaleBackend, self).__init__() self.api = api.FunkwhaleApi(config) se...
35.181818
75
0.665375
[ "Apache-2.0" ]
gjabell/mopidy-funkwhale
mopidy_funkwhale/backend.py
774
Python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from dve.io.table import TableDataBase from jhunt.qt.widgets.mainwindow import MainWindow import datetime from PyQt5.QtWidgets import QApplication APPLICATION_NAME = "JHunt" def main(): adverts_file_name = ".jhunt_adverts" adverts_data_schema = [...
57.520548
201
0.526554
[ "MIT" ]
jeremiedecock/jhunt
jhunt/qt/main.py
4,199
Python
# coding=utf-8 # Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licen...
40.934579
141
0.736073
[ "Apache-2.0" ]
Alavandar08/models
models/image_segmentation/tensorflow/3d_unet_mlperf/inference/nnUNet/preprocess.py
4,380
Python
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange import hashlib import math from ccxt.base.errors import ExchangeError from ccxt.base....
39.406659
160
0.50264
[ "MIT" ]
Evan-carry-you/ccxt
python/ccxt/async_support/livecoin.py
33,141
Python
# # This source file is part of the EdgeDB open source project. # # Copyright 2015-present MagicStack Inc. and the EdgeDB 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...
30.609481
79
0.652212
[ "Apache-2.0" ]
mcaramma/edgedb
edb/lang/ir/inference/types.py
13,560
Python
# Date: May 2018 # Author: Joe English, PDST # eMail: computerscience@pdst.ie # Name: Guessing Game v7 # Purpose: A program to demonstrate data validation # Description: This is the exact same as version 6 except the input is validated # Guess Game v7 - while - go again? - data validation import random nu...
25.227273
81
0.609009
[ "CC0-1.0" ]
gitjot/python-for-lccs
Section 5 - Programming Logic/Guess game v7 - while - data validation.py
1,110
Python
from math import log, exp from numpy import inf, zeros, zeros_like as np_zeros_like, arange, asarray, empty from pandas import concat from anndata import AnnData from torch import cat, no_grad, randn, zeros_like, zeros as torch_zeros, ones, argmax from torch.nn import Module, Linear, Sequential, RNNCell, Softplus, Par...
37.434263
151
0.540975
[ "MIT" ]
jlakkis/sciPENN
src/sciPENN/Network/Model.py
9,396
Python
import os import sys import time import datetime import selenium from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.common.exceptions import NoSuchElementException from compare_images import * if __name__ == "__main__": # Create a Firefox window driver. ...
27.914286
96
0.738997
[ "Apache-2.0" ]
OpenGeoscience/vgl
src/testing/drawCountriesReg.py
977
Python
import json import hashlib from tornado import httpclient as hc from tornado import gen from graphite_beacon.handlers import LOGGER, AbstractHandler class PagerdutyHandler(AbstractHandler): name = 'pagerduty' # Default options defaults = { 'subdomain': None, 'apitoken': None, '...
30.462687
92
0.598726
[ "MIT" ]
z1nkum/graphite-beacon
graphite_beacon/handlers/pagerduty.py
2,041
Python
from uuid import uuid4 from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager, PermissionsMixin) from django.core.validators import EmailValidator from django.db import models class UserManager(BaseUserManager): def create_user(self, name, email, passwo...
28.730769
100
0.657965
[ "MIT" ]
MaryzangelaBessa/ElRoyale
users/models.py
1,497
Python
import argparse import os import numpy as np from keras.layers import Conv2D, Input, BatchNormalization, LeakyReLU, ZeroPadding2D, UpSampling2D from keras.layers.merge import add, concatenate from keras.models import Model import struct import cv2 import time from pathlib import Path #np.set_printoptions(threshold=np....
42.228216
136
0.532131
[ "MIT" ]
BG4WCE/keras-yolo3
yolo3_video.py
20,354
Python
""" Copyright 2018 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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
33.494505
88
0.674869
[ "Apache-2.0" ]
Gareth001/tcav
activation_generator.py
6,096
Python
from django.contrib import admin from django.urls import path, include from django.conf.urls import url from rest_framework.schemas import get_schema_view VERSION = 'V1.0.0' urlpatterns = [ path('admin/', admin.site.urls), url('api/{}/user/'.format(VERSION),include('app.user.urls',namespace='user')), url(...
30.538462
82
0.715365
[ "MIT" ]
JeremyAndress/API-User-Template
src/config/urls.py
397
Python
""" ======================== Obstacle Avoidance in 2D ======================== Plots a 2D DMP that goes through a point obstacle when there is no coupling term for obstacle avoidance and a 2D DMP that avoids the point obstacle with a coupling term. """ print(__doc__) import matplotlib.pyplot as plt import numpy as n...
30.738095
79
0.711077
[ "BSD-3-Clause" ]
DavidYaonanZhu/movement_primitives
examples/plot_obstacle_avoidance_2d.py
1,291
Python
#!/usr/bin/env python # # Copyright (c) 2018 All rights reserved # This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # # http://www.apache.org/licenses/LICENSE-2.0 # """Define the classes requir...
25.804878
71
0.713611
[ "Apache-2.0" ]
onap/integration-xtesting
security/onap_security/test_security_test.py
1,058
Python
#!/usr/bin/env python2.6 ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "Licens...
33.395604
81
0.676867
[ "Apache-2.0" ]
zhanganha/ambari
ambari-agent/src/main/python/ambari_agent/Heartbeat.py
3,039
Python
# GENERATED BY KOMAND SDK - DO NOT EDIT import komand import json class Input: FIREWALL = "firewall" class Output: ALLOWED = "allowed" CREATIONTIMESTAMP = "creationTimestamp" DESCRIPTION = "description" ID = "id" KIND = "kind" NAME = "name" NETWORK = "network" SELFLINK = "sel...
25.613924
176
0.551767
[ "MIT" ]
TonyHamil/insightconnect-plugins
google_cloud_compute/komand_google_cloud_compute/actions/get_firewall/schema.py
4,047
Python
"""This module contains the general information for EquipmentHealthLed ManagedObject.""" from ...ucsmo import ManagedObject from ...ucscoremeta import MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class EquipmentHealthLedConsts: COLOR_AMBER = "amber" COLOR_BLUE = "blue" COLOR_GREEN = "green" ...
56.266667
422
0.662322
[ "Apache-2.0" ]
Curlyfingers/ucsmsdk
ucsmsdk/mometa/equipment/EquipmentHealthLed.py
4,220
Python
from django import forms class PostForm(forms.Form): image = forms.ImageField() image_name = forms.CharField(widget=forms.TextInput(attrs={"class": "form-control","placeholder": "Image Name"})) image_caption = forms.CharField(widget=forms.Textarea(attrs={"class": "form-control","placeholder": "Image Captio...
47.5
122
0.726316
[ "MIT" ]
Irene-nandy/Instagram
instagramHome/froms.py
475
Python
# Licensed to Modin Development Team under one or more contributor license agreements. # See the NOTICE file distributed with this work for additional information regarding # copyright ownership. The Modin Development Team licenses this file to you under the # Apache License, Version 2.0 (the "License"); you may not u...
27.837963
116
0.633378
[ "ECL-2.0", "Apache-2.0" ]
atomicai/modin
modin/config/envvars.py
12,026
Python
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
40.888889
108
0.685688
[ "MIT" ]
PatrickJD/AWS
AB/lambda/elasticindex/elasticsearch/client/monitoring.py
2,208
Python
# Simple script for updating the build number in pubspec.yaml import re # Regex patter to be used to ID the correct line in pubspec.yaml version_line_pattern = "version:\s+\d+\.\d+\.\d+\+\d+" # Open pubspec.yaml and read lines into memory with open("pubspec.yaml", "r") as current_pubspec: contents = current_pubsp...
33.32
88
0.662665
[ "MIT" ]
EpicSalvation/FlutterStep
increment_build.py
833
Python
import math import warnings import numpy as np import matplotlib rcParams = matplotlib.rcParams from matplotlib.axes import Axes import matplotlib.axis as maxis from matplotlib import cbook from matplotlib import docstring from matplotlib.patches import Circle from matplotlib.path import Path from matplotlib.ticker i...
35.076216
106
0.559173
[ "BSD-3-Clause" ]
ashley8jain/IITD-complaint-system-web
lib/python2.7/matplotlib/projections/polar.py
26,693
Python
import cgi import errno import mimetypes import os import posixpath import re import shutil import stat import sys import tempfile try: from urllib.request import urlretrieve except ImportError: # Python 2 from urllib import urlretrieve from optparse import make_option from os import path import django fr...
40.364742
81
0.565437
[ "BSD-3-Clause" ]
LuanP/django
django/core/management/templates.py
13,280
Python
""" Using the csv module. """ import csv def parse(csvfilename): """ Reads CSV file named csvfilename, parses it's content and returns the data within the file as a list of lists. """ table = [] with open(csvfilename, "r") as csvfile: csvreader = csv.reader(csvfile, ...
21.860465
53
0.578723
[ "Apache-2.0" ]
Abu-Kaisar/Courses-
Rice-Python-Data-Analysis/week3/examples3_csvmodule.py
940
Python
""" Utility functions for training one epoch and evaluating one epoch """ import torch import torch.nn as nn import math from train.metrics import accuracy_MNIST_CIFAR as accuracy def train_epoch(model, optimizer, device, data_loader, epoch=0): model.train() epoch_loss = 0 epoch_train_acc = 0 ...
38.775862
103
0.663406
[ "MIT" ]
nfkjsfoeif/AutoGCN
train/train_superpixels_graph_classification.py
2,249
Python
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import io import logging import zipfile import requests from .record import Record logger = logging.getLogger(__name__) # Module API def collec...
27.017857
95
0.62657
[ "MIT" ]
almeidaah/collectors
collectors/icdpcs/collector.py
1,513
Python
# encoding: utf-8 import io from setuptools import find_packages, setup from har2case import __version__ with io.open("README.rst", encoding='utf-8') as f: long_description = f.read() install_requires = open("requirements.txt").readlines() setup( name='har2case', version=__version__, description='C...
28.25
83
0.645133
[ "MIT" ]
ddkwing/har2case
setup.py
1,130
Python
import requests import os class IntegrationDiscordDriver: _scope = '' _state = '' def scopes(self, scopes): pass def send(self, request, state='', scopes=('identify',)): self._scope = scopes self._state = state return request.redirect('https://discordapp.com/api/oaut...
31.058824
151
0.576389
[ "MIT" ]
josephmancuso/gbaleague-masonite2
app/integrations/IntegrationDiscordDriver.py
1,584
Python
#!/usr/bin/env python from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name='bcpy', version='0.1', author='Igor Neves Faustino', author_email='igornfaustino@gmail.com', url='https://github.com/igornfaustino/bcpy.git', descr...
26.304348
72
0.682645
[ "MIT" ]
bneurd/bcpy
setup.py
605
Python
from collections import OrderedDict, defaultdict, namedtuple from functools import partial from itertools import groupby from cached_property import cached_property import numpy as np from devito.ir import (SEQUENTIAL, PARALLEL, PARALLEL_IF_PVT, ROUNDABLE, DataSpace, Forward, IterationInstance,...
35.173189
90
0.581848
[ "MIT" ]
ccuetom/devito
devito/passes/clusters/aliases.py
42,243
Python
#!/usr/bin/env python import os import sys import platform import tempfile import urllib2 import shutil import boto from boto.exception import BotoClientError def merge_dicts(a, b): """ Merge two dictionaries. If there is a key collision, `b` overrides `a`. :param a: Dictionary of default settings :param ...
41.507205
133
0.545789
[ "Apache-2.0" ]
plus3it/SystemPrep
MasterScripts/systemprep-linuxmaster.py
14,403
Python
## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to ...
34.720721
112
0.463415
[ "Apache-2.0" ]
drjoeycadieux/awips2
cave/com.raytheon.viz.gfe/python/testFormatters/FirePeriodTable.py
3,854
Python
# Python stubs generated by omniidl from /tmp/corba/omni/share/idl/omniORB/COS/CosObjectIdentity.idl # DO NOT EDIT THIS FILE! import omniORB, _omnipy from omniORB import CORBA, PortableServer _0_CORBA = CORBA _omnipy.checkVersion(4,2, __file__, 1) try: property except NameError: def property(*args): ...
43.227723
185
0.830508
[ "MIT" ]
akaszynski/ansys_corba
ansys_corba/omniORB/COS/CosObjectIdentity_idl.py
4,366
Python
#!/usr/bin/env python3 # Copyright (c) 2014-2018 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 is a double-spend conflict.""" from decimal import Decimal...
46.178808
145
0.641761
[ "MIT" ]
zerohourcash/zerohourcash
test/functional/wallet_txn_doublespend.py
6,973
Python
git clone git add 文件/文件夹 git commit -m '提交说明' git push orgin('默认仓库名') master(分支名)
16.4
35
0.719512
[ "Apache-2.0" ]
demengliu/network
test.py
116
Python
import time try: import wandb wandb_log=True except ImportError: wandb_log=False import numpy as np from advbench.lib.plotting import plot_perturbed_wandb from einops import rearrange class AverageMeter: """Computes and stores the average and current value""" def __init__(self, avg_mom=0.5): ...
29.923664
135
0.53801
[ "MIT" ]
constrainedlearning/advbench
advbench/lib/meters.py
3,920
Python
from collections import OrderedDict from datetime import date, datetime, time, timedelta from decimal import Decimal from enum import Enum from pathlib import Path from typing import Any from uuid import UUID from .datetime_parse import parse_date, parse_datetime, parse_duration, parse_time from .exceptions import Con...
25.937107
113
0.660281
[ "MIT" ]
anentropic/pydantic
pydantic/validators.py
4,124
Python