hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a15d698b672da57e1bd866189e6b75785fbad8a | 893 | py | Python | configs/strong_baselines/mask_rcnn_r50_fpn_syncbn-all_rpn-2conv_lsj_100e_coco.py | JustWeZero/mmdetection | 6de523b5b1e71b9c989760faff0462e807827515 | [
"Apache-2.0"
] | 20,190 | 2018-09-10T01:11:53.000Z | 2022-03-31T22:31:33.000Z | configs/strong_baselines/mask_rcnn_r50_fpn_syncbn-all_rpn-2conv_lsj_100e_coco.py | Joker-co/mmdet_pro | 96abfd90cf0e38c5ce398795f949e9328eb85c1b | [
"Apache-2.0"
] | 6,736 | 2018-09-17T09:45:51.000Z | 2022-03-31T22:54:10.000Z | configs/strong_baselines/mask_rcnn_r50_fpn_syncbn-all_rpn-2conv_lsj_100e_coco.py | Joker-co/mmdet_pro | 96abfd90cf0e38c5ce398795f949e9328eb85c1b | [
"Apache-2.0"
] | 7,837 | 2018-09-11T02:58:23.000Z | 2022-03-31T22:31:38.000Z | _base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../common/lsj_100e_coco_instance.py'
]
norm_cfg = dict(type='SyncBN', requires_grad=True)
# Use MMSyncBN that handles empty tensor in head. It can be changed to
# SyncBN after https://github.com/pytorch/pytorch/issues/36530 is fixed
# Requires MMCV-full afte... | 38.826087 | 77 | 0.699888 |
4a15d6de9f39bb9a0d7510f74eb8a65279f95584 | 4,669 | py | Python | src/dashboard/views.py | franzcruspero/dj_class_views | a1b10c22658f3fc2a61bb29f3967e632e5571509 | [
"MIT"
] | null | null | null | src/dashboard/views.py | franzcruspero/dj_class_views | a1b10c22658f3fc2a61bb29f3967e632e5571509 | [
"MIT"
] | 4 | 2020-06-06T00:45:44.000Z | 2021-06-10T22:41:35.000Z | src/dashboard/views.py | franzcruspero/dj_class_views | a1b10c22658f3fc2a61bb29f3967e632e5571509 | [
"MIT"
] | null | null | null | from django.contrib import messages
from django.views.generic.edit import CreateView, UpdateView, DeleteView, ModelFormMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.core.urlresolvers import reverse
from django.views.generic.detail import DetailView
from django.views.generic.list import... | 35.105263 | 92 | 0.669951 |
4a15d85bf4e881221b45c743d8e72330e4cfe2ca | 11,129 | py | Python | guild/plugins/skopt_util.py | jukiewiczm/guildai | 478cc29cb102a8bd0bed693ce9626fe4949257a2 | [
"Apache-2.0"
] | null | null | null | guild/plugins/skopt_util.py | jukiewiczm/guildai | 478cc29cb102a8bd0bed693ce9626fe4949257a2 | [
"Apache-2.0"
] | null | null | null | guild/plugins/skopt_util.py | jukiewiczm/guildai | 478cc29cb102a8bd0bed693ce9626fe4949257a2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2019 TensorHub, 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 writ... | 32.926036 | 78 | 0.630874 |
4a15d90dbe5a9faf44f06f06dd0f71ebb9e263b9 | 5,658 | py | Python | tests/inventory/pipelines/test_data/fake_buckets.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | 1 | 2018-03-26T08:15:21.000Z | 2018-03-26T08:15:21.000Z | tests/inventory/pipelines/test_data/fake_buckets.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | tests/inventory/pipelines/test_data/fake_buckets.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Forseti Security 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 ap... | 38.753425 | 367 | 0.554259 |
4a15da5318cf55007f5bcc67bd1205f2afe4ca11 | 400 | py | Python | molsysmt/tools/string_pdb_id/to_openmm_Modeller.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/tools/string_pdb_id/to_openmm_Modeller.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/tools/string_pdb_id/to_openmm_Modeller.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | def to_openmm_Modeller(item, selection='all', model_indices='all', syntaxis='MolSysMT'):
from molsysmt.tools.string_pdb_id import is_string_pdb_id
from molsysmt.basic import convert
if not is_string_pdb_id(item):
raise ValueError
tmp_item = convert(item, to_form='openmm.Modeller', selection=s... | 30.769231 | 124 | 0.7625 |
4a15db1dc87ce151b5570098dce99c2487d5f2c4 | 1,882 | py | Python | test/integration/test_soft_argmax2d.py | Manza12/kornia | 580bbbffc771470445de27a7957d970b5a606172 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-03-24T12:43:02.000Z | 2021-03-24T12:43:08.000Z | test/integration/test_soft_argmax2d.py | Manza12/kornia | 580bbbffc771470445de27a7957d970b5a606172 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/test_soft_argmax2d.py | Manza12/kornia | 580bbbffc771470445de27a7957d970b5a606172 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import logging
import torch
import torch.nn as nn
import torch.optim as optim
from torch.testing import assert_allclose
import kornia
logger = logging.getLogger(__name__)
class TestIntegrationSoftArgmax2d:
# optimization
lr = 1e-3
num_iterations = 500
# data params
height = 240
width = 320... | 29.873016 | 89 | 0.619554 |
4a15dcf88a36573dd6f48087bdfd8496255b8fc0 | 413 | py | Python | gquant/plugin_nodes/strategy/__init__.py | philtrade/gQuant | 08b2a82a257c234b92f097b925f25cab16fd0926 | [
"Apache-2.0"
] | 1 | 2021-07-09T14:49:08.000Z | 2021-07-09T14:49:08.000Z | gquant/plugin_nodes/strategy/__init__.py | philtrade/gQuant | 08b2a82a257c234b92f097b925f25cab16fd0926 | [
"Apache-2.0"
] | null | null | null | gquant/plugin_nodes/strategy/__init__.py | philtrade/gQuant | 08b2a82a257c234b92f097b925f25cab16fd0926 | [
"Apache-2.0"
] | 1 | 2021-03-22T19:54:38.000Z | 2021-03-22T19:54:38.000Z | from .movingAverageStrategyNode import MovingAverageStrategyNode
from .portExpMovingAverageStrategyNode import (
PortExpMovingAverageStrategyNode, CpuPortExpMovingAverageStrategyNode)
from .xgboostStrategyNode import XGBoostStrategyNode
__all__ = ["MovingAverageStrategyNode",
"PortExpMovingAverageStrate... | 41.3 | 74 | 0.811138 |
4a15dd3b12735f3199cc4475ce804b098fabc96f | 836 | py | Python | BlackDesert/CraftingCalcPrototype1.py | SystemNinja/MyPythonPrograms | 6bdebb5017994c3431aea769319f702075fff9b9 | [
"MIT"
] | null | null | null | BlackDesert/CraftingCalcPrototype1.py | SystemNinja/MyPythonPrograms | 6bdebb5017994c3431aea769319f702075fff9b9 | [
"MIT"
] | null | null | null | BlackDesert/CraftingCalcPrototype1.py | SystemNinja/MyPythonPrograms | 6bdebb5017994c3431aea769319f702075fff9b9 | [
"MIT"
] | null | null | null | #****PROTOTYPE 1 - For option 1 from main program****
#Program that calculates how many resources are needed to craft items.
def nextHighest(n):
division = n%5
while division != 0:
n+=1
division = n%5
return n
material=int(input("Enter the ammount of beer that you want to produce:... | 38 | 79 | 0.636364 |
4a15dea87bfd58de369db36d01e63e9caf5fd002 | 1,767 | py | Python | tests/time_res/test_ozone_Minutely.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/time_res/test_ozone_Minutely.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/time_res/test_ozone_Minutely.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
#get_ipython().magic('matplotlib inline')
b1 = tsds.load_ozone()
df = b1.mPastData
for k in [1 , 5]:
df[b1.mTimeVar + "_" + str(k) + '_PerMinute'] = pd.date_range('2000-1-1', periods=df.shape[0], fre... | 29.949153 | 119 | 0.617431 |
4a15dec29b3a5dcbb71e128687a6bef75dc33605 | 9,854 | py | Python | docs/source/conf.py | dabeaz/llvmlite | 2521d7afb52c59f7121e2010b63dda9b70f96165 | [
"BSD-2-Clause"
] | 2 | 2018-12-17T14:00:22.000Z | 2020-01-11T05:49:28.000Z | docs/source/conf.py | dabeaz/llvmlite | 2521d7afb52c59f7121e2010b63dda9b70f96165 | [
"BSD-2-Clause"
] | null | null | null | docs/source/conf.py | dabeaz/llvmlite | 2521d7afb52c59f7121e2010b63dda9b70f96165 | [
"BSD-2-Clause"
] | 2 | 2018-05-05T11:31:14.000Z | 2021-12-21T22:23:21.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# llvmlite documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 29 14:18:42 2015.
#
# 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
# a... | 32.202614 | 86 | 0.71778 |
4a15dfc5bdf1997d91bbece3de9093bc71cb8385 | 744 | py | Python | floodsystem/risk.py | emilydarnell/Flood-warning-group-123 | 000ea2995588624269b3800fdfae194ebc109e99 | [
"MIT"
] | 1 | 2022-01-22T15:19:18.000Z | 2022-01-22T15:19:18.000Z | floodsystem/risk.py | emilydarnell/Flood-warning-group-123 | 000ea2995588624269b3800fdfae194ebc109e99 | [
"MIT"
] | null | null | null | floodsystem/risk.py | emilydarnell/Flood-warning-group-123 | 000ea2995588624269b3800fdfae194ebc109e99 | [
"MIT"
] | null | null | null | from floodsystem.datafetcher import fetch_measure_levels
import statistics
import datetime
def mean_level(station, days_back):
# given a particular station and a number of days, work out what the average relative level is over these days
# the easiest way is probably to average the actual water level over the ... | 49.6 | 115 | 0.74328 |
4a15dfd944e35f879b6736bf6e566a18944cd9a6 | 1,616 | py | Python | XSum-Topic-ConvS2S/fairseq/optim/lr_scheduler/fixed_schedule.py | zsquaredz/XSum | 10f2fac2e70801e7a3973c864b5a24b61d3f8bfe | [
"MIT"
] | 235 | 2018-11-26T16:53:27.000Z | 2022-03-24T13:04:48.000Z | XSum-Topic-ConvS2S/fairseq/optim/lr_scheduler/fixed_schedule.py | zsquaredz/XSum | 10f2fac2e70801e7a3973c864b5a24b61d3f8bfe | [
"MIT"
] | 24 | 2018-12-19T01:02:27.000Z | 2022-01-16T07:47:36.000Z | XSum-Topic-ConvS2S/fairseq/optim/lr_scheduler/fixed_schedule.py | zsquaredz/XSum | 10f2fac2e70801e7a3973c864b5a24b61d3f8bfe | [
"MIT"
] | 59 | 2018-12-07T18:57:05.000Z | 2022-03-24T13:34:09.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch.optim.lr_scheduler
f... | 37.581395 | 91 | 0.659035 |
4a15dfde7b84f4af969fddbd9fab00bd01cfb33d | 10,584 | py | Python | src/streetview/core.py | juliantrue/Streetview-Segmenting | 337740e6ebd2284c880ace09a11032c5914b39a4 | [
"MIT"
] | 1 | 2021-02-27T07:39:05.000Z | 2021-02-27T07:39:05.000Z | src/streetview/core.py | juliantrue/Streetview-Segmenting | 337740e6ebd2284c880ace09a11032c5914b39a4 | [
"MIT"
] | null | null | null | src/streetview/core.py | juliantrue/Streetview-Segmenting | 337740e6ebd2284c880ace09a11032c5914b39a4 | [
"MIT"
] | 1 | 2021-12-06T23:35:34.000Z | 2021-12-06T23:35:34.000Z | import os, shutil, logging, math
from collections import OrderedDict
import requests
import cv2
from .logging_facility import LoggingWrapper
"""
Usage:
location1: type tuple: (lat1, lon1)
location2: type tuple: (lat2, lon2)
Based on Haversine formula found here:
https://en.wikipedia.org/wiki/Haversine_formula
returns... | 37.136842 | 109 | 0.583239 |
4a15e0f62a3d1a02d55fc88642279f23cf0bbeb1 | 3,402 | py | Python | S4/S4 Library/simulation/visualization/portal_visualizer.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | 1 | 2021-05-20T19:33:37.000Z | 2021-05-20T19:33:37.000Z | S4/S4 Library/simulation/visualization/portal_visualizer.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | S4/S4 Library/simulation/visualization/portal_visualizer.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | from build_buy import register_build_buy_exit_callback, unregister_build_buy_exit_callback
from debugvis import Context
from sims4 import commands
from sims4.color import Color
import services
import sims4.log
logger = sims4.log.Logger('Debugvis')
class PortalVisualizer:
def __init__(self, layer, portal_obj_id=0,... | 47.915493 | 124 | 0.698707 |
4a15e30e8a5545c3cb4de655f8e75e59fe938833 | 772 | py | Python | tests/api_tests/conftest.py | JobtechSwe/castaway | e0917511b20152f0bd7e2802b73a0beae30a96f5 | [
"Apache-2.0"
] | null | null | null | tests/api_tests/conftest.py | JobtechSwe/castaway | e0917511b20152f0bd7e2802b73a0beae30a96f5 | [
"Apache-2.0"
] | null | null | null | tests/api_tests/conftest.py | JobtechSwe/castaway | e0917511b20152f0bd7e2802b73a0beae30a96f5 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
import requests
import tests.test_resources.settings as settings
@pytest.fixture
def session():
"""
creates a Session object which will persist over the entire test run ("session").
http connections will be reused (higher performance, less resource usage)
Returns a Session obje... | 24.903226 | 85 | 0.720207 |
4a15e4a20037ccf4f202fc1ecb1502f292b26744 | 13,665 | py | Python | darknet.py | TAMU-VITA/3D_Adversarial_Logo | c96b6e769fb2f4a5dd7bf06eb9f2b9d82ede3990 | [
"MIT"
] | 11 | 2020-06-25T00:14:08.000Z | 2020-08-06T18:23:29.000Z | darknet.py | bit-twidd1er/adversarial-yolo-snapshot | 8f77b313489d05e1f1a5a28d311c6e4b05d06bd5 | [
"MIT"
] | 1 | 2021-04-16T15:20:07.000Z | 2022-03-11T02:23:06.000Z | darknet.py | bit-twidd1er/adversarial-yolo-snapshot | 8f77b313489d05e1f1a5a28d311c6e4b05d06bd5 | [
"MIT"
] | 7 | 2019-11-27T09:13:05.000Z | 2022-02-22T12:34:17.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from region_loss import RegionLoss
from cfg import *
class MaxPoolStride1(nn.Module):
def __init__(self):
super(MaxPoolStride1, self).__init__()
def forward(self, x):
x = F.max_pool2d(F.pad(x, (0,1,0,1), mode... | 39.83965 | 200 | 0.484376 |
4a15e4c15324eaf081f48978013234f10610c5cb | 1,764 | py | Python | app.py | ARNAV-GHATE/TrashNet | abef8d1e1dcef06d1e8ed8eb6c2f3af7384323b0 | [
"MIT"
] | null | null | null | app.py | ARNAV-GHATE/TrashNet | abef8d1e1dcef06d1e8ed8eb6c2f3af7384323b0 | [
"MIT"
] | null | null | null | app.py | ARNAV-GHATE/TrashNet | abef8d1e1dcef06d1e8ed8eb6c2f3af7384323b0 | [
"MIT"
] | null | null | null | #from flask import Flask
#from flask import render_template
#from flask import request
#from PIL import Image
from prediction import *
import os
import cv2
from flask import Flask, render_template, request,jsonify
from PIL import Image
import tensorflow as tf
#import jinja2
app=Flask(__name__)
#app.jinja_env.line_state... | 28.451613 | 76 | 0.535147 |
4a15e5fc654fe86787527229b34409978d67069f | 4,343 | py | Python | contrib/seeds/generate-seeds.py | unifycoin/unifycoin | 7d0d5245610daab81e8b124c9b4dc03a73020b8f | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | unifycoin/unifycoin | 7d0d5245610daab81e8b124c9b4dc03a73020b8f | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | unifycoin/unifycoin | 7d0d5245610daab81e8b124c9b4dc03a73020b8f | [
"MIT"
] | 2 | 2019-06-28T12:47:30.000Z | 2019-12-16T04:56:50.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.244604 | 98 | 0.579784 |
4a15e672990b7081f8d6fe19ac03f5fb02171bd8 | 103 | py | Python | bitmovin_api_sdk/encoding/inputs/akamai_netstorage/customdata/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/encoding/inputs/akamai_netstorage/customdata/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/encoding/inputs/akamai_netstorage/customdata/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | from bitmovin_api_sdk.encoding.inputs.akamai_netstorage.customdata.customdata_api import CustomdataApi
| 51.5 | 102 | 0.912621 |
4a15e68fedb6cd1acb013624ecf9816eade18b13 | 68 | py | Python | setup.py | adam-of-barot/dgws-api | 0ecd2877531e69fc9c04afedba5141e34fd71a95 | [
"MIT"
] | 1 | 2022-01-02T12:11:30.000Z | 2022-01-02T12:11:30.000Z | setup.py | adam-of-barot/dgws-api | 0ecd2877531e69fc9c04afedba5141e34fd71a95 | [
"MIT"
] | null | null | null | setup.py | adam-of-barot/dgws-api | 0ecd2877531e69fc9c04afedba5141e34fd71a95 | [
"MIT"
] | null | null | null | import setuptools
if __name__ == "__main__":
setuptools.setup() | 17 | 26 | 0.720588 |
4a15e6a95eb281b6a1f6984aef0a07d502bdc224 | 263 | py | Python | core-python-robust-resource-and-error-handling/exception_chaining/explicit_chaining/chaining.py | hassonor/core-python | 92672aa72c1474061df5247a2dd4dfd9fab1642a | [
"MIT"
] | 1 | 2022-03-09T20:58:33.000Z | 2022-03-09T20:58:33.000Z | core-python-robust-resource-and-error-handling/exception_chaining/explicit_chaining/chaining.py | hassonor/core-python | 92672aa72c1474061df5247a2dd4dfd9fab1642a | [
"MIT"
] | null | null | null | core-python-robust-resource-and-error-handling/exception_chaining/explicit_chaining/chaining.py | hassonor/core-python | 92672aa72c1474061df5247a2dd4dfd9fab1642a | [
"MIT"
] | null | null | null | import math
class InclinationError(Exception):
pass
def inclination(dx, dy):
try:
return math.degrees(math.atan(dy / dx))
except ZeroDivisionError as e:
raise InclinationError("Slope cannot be vertical") from e
inclination(0, 5)
| 16.4375 | 65 | 0.684411 |
4a15e6c9f57ba152a330bd0c6a399e19bb4b35a1 | 223 | py | Python | ymidi/io/__init__.py | Owen-Cochell/yapmidi | 50a3a1800375a3f390eb40628387fb3d2a520b8e | [
"MIT"
] | null | null | null | ymidi/io/__init__.py | Owen-Cochell/yapmidi | 50a3a1800375a3f390eb40628387fb3d2a520b8e | [
"MIT"
] | null | null | null | ymidi/io/__init__.py | Owen-Cochell/yapmidi | 50a3a1800375a3f390eb40628387fb3d2a520b8e | [
"MIT"
] | null | null | null | """
This submodule contains I/O components of yap-midi.
Each section specializes in inputting and outputting
MIDI data to a certain location.
For example,
the alsaio class gets and outputs MIDI data to the ALSA daemon
""" | 27.875 | 62 | 0.784753 |
4a15e6cc9a08cffed8416ed6e99520413ded73fa | 25,732 | py | Python | utility.py | jocelyngate38/photobooth-software | db103a5eeb34f5e85faf8ac17709be021f848d42 | [
"MIT"
] | null | null | null | utility.py | jocelyngate38/photobooth-software | db103a5eeb34f5e85faf8ac17709be021f848d42 | [
"MIT"
] | null | null | null | utility.py | jocelyngate38/photobooth-software | db103a5eeb34f5e85faf8ac17709be021f848d42 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from PyQt5.QtCore import (QUrl, QFile, QFileInfo, QPoint, QRect, QRectF, QSettings, QSize, QPointF,
Qt, QTextStream, QThread, pyqtSignal, pyqtSlot, QTimer, QDateTime, QIODevice, QElapsedTimer)
from PyQt5.QtGui import (QIcon, QKeySequence, QFont, QBrush, QPixmap, QPaint... | 36.447592 | 120 | 0.600731 |
4a15e7ca36679def5ecd39424af663fdc398a093 | 5,045 | py | Python | train_i3d.py | Lechatelia/video_detection_tools | 1eebaf3e4b358a940e21f37d387de23503d5bda0 | [
"Apache-2.0"
] | null | null | null | train_i3d.py | Lechatelia/video_detection_tools | 1eebaf3e4b358a940e21f37d387de23503d5bda0 | [
"Apache-2.0"
] | null | null | null | train_i3d.py | Lechatelia/video_detection_tools | 1eebaf3e4b358a940e21f37d387de23503d5bda0 | [
"Apache-2.0"
] | null | null | null | import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
#os.environ["CUDA_VISIBLE_DEVICES"]='0,1,2,3'
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-mode', type=str, help='rgb or flow')
parser.add_argument('-save_model', type=str)
parser.add_argument('-root', type=str)
args = pa... | 37.649254 | 194 | 0.61328 |
4a15e89583605ccc27471d0d2048fdae53bb67dc | 12,534 | py | Python | docs/conf.py | anukaal/python-bigquery-connection | 10b677a34e2b0d76ed4d2c3f22006996857e23f5 | [
"Apache-2.0"
] | 18 | 2020-05-26T20:04:57.000Z | 2022-03-28T21:16:46.000Z | docs/conf.py | anukaal/python-bigquery-connection | 10b677a34e2b0d76ed4d2c3f22006996857e23f5 | [
"Apache-2.0"
] | 52 | 2020-05-26T22:01:46.000Z | 2022-03-08T16:59:59.000Z | docs/conf.py | anukaal/python-bigquery-connection | 10b677a34e2b0d76ed4d2c3f22006996857e23f5 | [
"Apache-2.0"
] | 9 | 2020-05-19T23:27:25.000Z | 2022-01-29T08:07:35.000Z | # -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 32.811518 | 88 | 0.707117 |
4a15e95286a2efe921d727a73f67fd11992e87ae | 377 | py | Python | changes/api/serializer/models/comment.py | bowlofstew/changes | ebd393520e0fdb07c240a8d4e8747281b6186e28 | [
"Apache-2.0"
] | null | null | null | changes/api/serializer/models/comment.py | bowlofstew/changes | ebd393520e0fdb07c240a8d4e8747281b6186e28 | [
"Apache-2.0"
] | null | null | null | changes/api/serializer/models/comment.py | bowlofstew/changes | ebd393520e0fdb07c240a8d4e8747281b6186e28 | [
"Apache-2.0"
] | null | null | null | from changes.api.serializer import Crumbler, register
from changes.models import Comment
@register(Comment)
class CommentCrumbler(Crumbler):
def crumble(self, instance, attrs):
return {
'id': instance.id.hex,
'user': instance.user,
'text': instance.text,
'da... | 26.928571 | 61 | 0.633952 |
4a15ea50b891ad686683495c6dffda276f1499ab | 9,637 | py | Python | userbot/modules/emotion.py | Furuhashii/TaliauBot | c59c3494faa4b3dd2d51ffb4b910c10cefc16098 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/emotion.py | Furuhashii/TaliauBot | c59c3494faa4b3dd2d51ffb4b910c10cefc16098 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/emotion.py | Furuhashii/TaliauBot | c59c3494faa4b3dd2d51ffb4b910c10cefc16098 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Lord-Userbot
from time import sleep
from userbot import CMD_HELP, bot
from userbot.events import register
from telethon import events
import asyncio
@bot.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.1
animation_t... | 30.400631 | 64 | 0.217495 |
4a15ea5dd8e24307c09dac0f015a5e6ed79bbd59 | 643 | py | Python | src/cipr/commands/app.py | six8/corona-cipr | a2f45761080c874afa39bf95fd5c4467c8eae272 | [
"MIT"
] | 1 | 2015-04-19T20:53:15.000Z | 2015-04-19T20:53:15.000Z | src/cipr/commands/app.py | six8/corona-cipr | a2f45761080c874afa39bf95fd5c4467c8eae272 | [
"MIT"
] | null | null | null | src/cipr/commands/app.py | six8/corona-cipr | a2f45761080c874afa39bf95fd5c4467c8eae272 | [
"MIT"
] | 2 | 2016-04-11T15:35:10.000Z | 2020-04-13T10:42:32.000Z | import clik
from os import path
import os
from optparse import make_option as opt
from cipr.commands.cfg import CiprCfg
from cipr.commands import env
def _args(opts):
env.project_directory = opts.project_directory
return dict(
env = env,
ciprcfg = CiprCfg(path.join(env.project_directory, '.ci... | 23.814815 | 71 | 0.679627 |
4a15eb83ee61430cd91694b98fec5588198fb378 | 4,040 | py | Python | app/main/controller/langid_controller.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 11 | 2018-02-07T00:16:54.000Z | 2021-05-13T22:47:07.000Z | app/main/controller/langid_controller.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 47 | 2018-11-26T23:17:37.000Z | 2022-03-25T16:12:05.000Z | app/main/controller/langid_controller.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 9 | 2019-05-23T22:06:03.000Z | 2020-10-27T20:45:04.000Z | from flask import request, current_app as app
from flask_restplus import Resource, Namespace, fields
import redis
import hashlib
import json
import importlib
import tenacity
from twitter_text import extract_urls_with_indices, extract_emojis_with_indices
api = Namespace('langid', description='langid operations')
langi... | 37.06422 | 133 | 0.62896 |
4a15ebc94cc81949f42bbb3871a625a56468ef33 | 79 | py | Python | torchsar/version.py | aisari/torchsar | 05a46610d68bc884743a483565279f361ade5384 | [
"Apache-2.0"
] | 3 | 2021-06-04T13:13:07.000Z | 2021-08-24T16:28:31.000Z | torchsar/version.py | aisari/torchsar | 05a46610d68bc884743a483565279f361ade5384 | [
"Apache-2.0"
] | null | null | null | torchsar/version.py | aisari/torchsar | 05a46610d68bc884743a483565279f361ade5384 | [
"Apache-2.0"
] | 2 | 2021-08-15T09:01:03.000Z | 2021-12-21T08:53:53.000Z | # Copyright (c) 2015-2030, Zhi Liu. All rights reserved.
__version__ = '1.1'
| 19.75 | 57 | 0.683544 |
4a15ec11c1288a3e857d72689baeb1a59c6dd600 | 1,731 | py | Python | ipregistry/cache.py | ipregistry/ipregistry-python | 224888fa198c98423a5ac949eb588e7941de89a8 | [
"Apache-2.0"
] | 7 | 2019-07-28T08:29:54.000Z | 2021-08-06T10:42:31.000Z | ipregistry/cache.py | ipregistry/ipregistry-python | 224888fa198c98423a5ac949eb588e7941de89a8 | [
"Apache-2.0"
] | 15 | 2020-07-05T15:22:58.000Z | 2022-01-10T17:01:20.000Z | ipregistry/cache.py | ipregistry/ipregistry-python | 224888fa198c98423a5ac949eb588e7941de89a8 | [
"Apache-2.0"
] | 3 | 2020-01-06T13:43:41.000Z | 2020-09-25T11:59:04.000Z | """
Copyright 2019 Ipregistry (https://ipregistry.co).
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 app... | 23.391892 | 76 | 0.64818 |
4a15ecb2004abcb64e9d12196bb5c7c031896d2f | 609,866 | py | Python | python/paddle/fluid/layers/nn.py | hang245141253/Paddle | ee13a2ab88c1896c2f73ebe7c9c78364b6befd54 | [
"Apache-2.0"
] | 1 | 2021-12-27T02:49:16.000Z | 2021-12-27T02:49:16.000Z | python/paddle/fluid/layers/nn.py | wozna/Paddle | 0ecf441af14d554c85f69a206e3e3a9bdd86fb13 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/layers/nn.py | wozna/Paddle | 0ecf441af14d554c85f69a206e3e3a9bdd86fb13 | [
"Apache-2.0"
] | 1 | 2021-02-08T16:02:12.000Z | 2021-02-08T16:02:12.000Z | # 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 appli... | 40.035843 | 946 | 0.58213 |
4a15edafcbb84c1ebd75e34457942d20c19ace82 | 14,830 | py | Python | kedro/template/{{ cookiecutter.repo_name }}/kedro_cli.py | LTHODAVDOPL/kedro | d2c9648794cdda5ad28ea99cfc2661c076876932 | [
"Apache-2.0"
] | 1 | 2019-09-28T22:38:00.000Z | 2019-09-28T22:38:00.000Z | kedro/template/{{ cookiecutter.repo_name }}/kedro_cli.py | LTHODAVDOPL/kedro | d2c9648794cdda5ad28ea99cfc2661c076876932 | [
"Apache-2.0"
] | null | null | null | kedro/template/{{ cookiecutter.repo_name }}/kedro_cli.py | LTHODAVDOPL/kedro | d2c9648794cdda5ad28ea99cfc2661c076876932 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2019 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... | 33.552036 | 97 | 0.668105 |
4a15edee3fa31ac384a6eb60262aa7235c970c64 | 667 | py | Python | vectorformats/Formats/Format.py | AstunTechnology/featureserver | 0697730de12b7bc4c8d90bab829d95a865253e77 | [
"BSD-3-Clause-Open-MPI",
"MIT"
] | 55 | 2015-01-20T14:29:59.000Z | 2020-12-13T12:54:28.000Z | vectorformats/Formats/Format.py | makinacorpus/featureserver | 379c1a7f51e75517ae7237751e1908f45c0c4d9a | [
"BSD-3-Clause-Open-MPI",
"MIT"
] | 3 | 2015-06-24T23:34:03.000Z | 2017-02-05T02:16:19.000Z | vectorformats/Formats/Format.py | makinacorpus/featureserver | 379c1a7f51e75517ae7237751e1908f45c0c4d9a | [
"BSD-3-Clause-Open-MPI",
"MIT"
] | 19 | 2015-02-08T12:32:25.000Z | 2021-12-01T08:14:32.000Z | class Format(object):
"""Base Format class. To set properties on your subclasses, you can
pass them as kwargs to your format constructor."""
def __init__(self, *args, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
def getFormatedAttributName(se... | 30.318182 | 71 | 0.554723 |
4a15ee4d7bf765ef330be0ad229c700613610459 | 7,514 | py | Python | ml_belt/prep.py | adrianogfreitas/ml_belt | a013abe772e5479c3c72d6b4d464fdf06827db57 | [
"MIT"
] | 1 | 2019-12-04T20:29:31.000Z | 2019-12-04T20:29:31.000Z | ml_belt/prep.py | adrianogfreitas/ml_belt | a013abe772e5479c3c72d6b4d464fdf06827db57 | [
"MIT"
] | null | null | null | ml_belt/prep.py | adrianogfreitas/ml_belt | a013abe772e5479c3c72d6b4d464fdf06827db57 | [
"MIT"
] | null | null | null | """Module for common preprocessing tasks."""
import time
import pandas as pd
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
# TODO: acertar docstrings
# TODO: drop_by
# TODO: apply_custom_item_level (escolher axis)
# TODO: colocar um acompanhamento de progresso
class Prep(object):
"""Preprocessing /... | 27.82963 | 107 | 0.553234 |
4a15ee77dc7d39c301ec2fe8c20b1ff3c7889f2c | 7,252 | py | Python | tests/test_user_model.py | StanZhouyu/stanblog | 5ff202297f72d1c17bd5572c6ada7f30dee4bdc6 | [
"MIT"
] | null | null | null | tests/test_user_model.py | StanZhouyu/stanblog | 5ff202297f72d1c17bd5572c6ada7f30dee4bdc6 | [
"MIT"
] | 4 | 2020-03-24T15:48:27.000Z | 2022-03-08T21:09:18.000Z | tests/test_user_model.py | StanZhouyu/stanblog | 5ff202297f72d1c17bd5572c6ada7f30dee4bdc6 | [
"MIT"
] | null | null | null | import unittest
import time
from app import create_app, db
from app.models import User, AnonymousUser, Role, Permission, Follow
from datetime import datetime
class UserModelTestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.app_context = self.app.app_context()
... | 37 | 81 | 0.627689 |
4a15ef0f77ec3b5606012acfb170ed75d80a68c7 | 11,843 | py | Python | ros/src/waypoint_updater/waypoint_updater.py | greenfield932/CarND-Capstone | effa605590a2ebf6ef9e9d00815910718c3ec4f1 | [
"MIT"
] | null | null | null | ros/src/waypoint_updater/waypoint_updater.py | greenfield932/CarND-Capstone | effa605590a2ebf6ef9e9d00815910718c3ec4f1 | [
"MIT"
] | null | null | null | ros/src/waypoint_updater/waypoint_updater.py | greenfield932/CarND-Capstone | effa605590a2ebf6ef9e9d00815910718c3ec4f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, Waypoint
import math
from scipy.spatial import KDTree
from std_msgs.msg import Int32
import numpy as np
'''
This node will publish waypoints from the car's current position to some `x` distance ahead.
As ment... | 40.697595 | 123 | 0.645276 |
4a15efe7e7ec2fa21f447b80b6509c643696011f | 818 | py | Python | emmet-api/emmet/api/routes/magnetism/resources.py | acrutt/emmet | e98100c9932f145a3ad3087ddb7aa9b779d9a191 | [
"BSD-3-Clause-LBNL"
] | null | null | null | emmet-api/emmet/api/routes/magnetism/resources.py | acrutt/emmet | e98100c9932f145a3ad3087ddb7aa9b779d9a191 | [
"BSD-3-Clause-LBNL"
] | null | null | null | emmet-api/emmet/api/routes/magnetism/resources.py | acrutt/emmet | e98100c9932f145a3ad3087ddb7aa9b779d9a191 | [
"BSD-3-Clause-LBNL"
] | null | null | null | from maggma.api.resource import ReadOnlyResource
from emmet.core.magnetism import MagnetismDoc
from maggma.api.query_operator import PaginationQuery, SortQuery, SparseFieldsQuery
from emmet.api.routes.magnetism.query_operators import MagneticQuery
from emmet.api.core.global_header import GlobalHeaderProcessor
def ma... | 30.296296 | 83 | 0.690709 |
4a15f00f46d57c144a0475f2eebb8d1f0a5f4937 | 1,139 | py | Python | catalyst/contrib/data/__init__.py | tadejsv/catalyst | 2553ce8fd7cecc025ad88819aea73faf8abb229b | [
"Apache-2.0"
] | 206 | 2018-10-05T19:16:47.000Z | 2019-01-19T21:10:41.000Z | catalyst/contrib/data/__init__.py | tadejsv/catalyst | 2553ce8fd7cecc025ad88819aea73faf8abb229b | [
"Apache-2.0"
] | 20 | 2018-10-07T06:30:49.000Z | 2019-01-17T17:26:15.000Z | catalyst/contrib/data/__init__.py | tadejsv/catalyst | 2553ce8fd7cecc025ad88819aea73faf8abb229b | [
"Apache-2.0"
] | 22 | 2018-10-06T12:34:08.000Z | 2019-01-10T16:00:48.000Z | # flake8: noqa
from catalyst.settings import SETTINGS
from catalyst.contrib.data.collate_fn import FilteringCollateFn
from catalyst.contrib.data.dataset import (
ListDataset,
MergeDataset,
NumpyDataset,
PathsDataset,
)
from catalyst.contrib.data.dataset_ml import (
MetricLearningTrainDataset,
... | 23.244898 | 89 | 0.778753 |
4a15f0f445fb75774b43831f0a0cab645e5abf88 | 43 | py | Python | builder_engine/custom_components/metrics.py | DiablosWhisper/machine_learning_toolpack | 3f4b82b549a3d70b95fc7a2c01959cd99d2b88b9 | [
"Apache-2.0"
] | null | null | null | builder_engine/custom_components/metrics.py | DiablosWhisper/machine_learning_toolpack | 3f4b82b549a3d70b95fc7a2c01959cd99d2b88b9 | [
"Apache-2.0"
] | null | null | null | builder_engine/custom_components/metrics.py | DiablosWhisper/machine_learning_toolpack | 3f4b82b549a3d70b95fc7a2c01959cd99d2b88b9 | [
"Apache-2.0"
] | null | null | null | from tensorflow.keras.metrics import Metric | 43 | 43 | 0.883721 |
4a15f1b0b491567d960bc1489b0ee09302a0037c | 5,326 | py | Python | tests/test_binary_convert_read.py | yangboz/maro | 0973783e55ca07bf8e177910c9d47854117a4ea8 | [
"MIT"
] | 598 | 2020-09-23T00:50:22.000Z | 2022-03-31T08:12:54.000Z | tests/test_binary_convert_read.py | gx9702/maro | 38c796f0a7ed1e0f64c299d96c6e0df032401fa9 | [
"MIT"
] | 235 | 2020-09-22T10:20:48.000Z | 2022-03-31T02:10:03.000Z | tests/test_binary_convert_read.py | gx9702/maro | 38c796f0a7ed1e0f64c299d96c6e0df032401fa9 | [
"MIT"
] | 116 | 2020-09-22T09:19:04.000Z | 2022-02-12T05:04:07.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT licence
import os
import tempfile
import unittest
from maro.data_lib import BinaryConverter, BinaryReader
from maro.data_lib.item_meta import BinaryMeta
class TestBinaryConverter(unittest.TestCase):
def test_convert_with_events(self):
out_d... | 31.892216 | 142 | 0.639317 |
4a15f1c928a3e9fb3ac3098185f586f64e60561d | 2,175 | py | Python | tests/functional_tests/util_resources.py | sherkitty/main | 2cbcb6597c0ff6b95c9fa9cd43b6815649ae1b64 | [
"MIT"
] | 1 | 2021-10-30T10:36:18.000Z | 2021-10-30T10:36:18.000Z | tests/functional_tests/util_resources.py | sherkitty/main | 2cbcb6597c0ff6b95c9fa9cd43b6815649ae1b64 | [
"MIT"
] | null | null | null | tests/functional_tests/util_resources.py | sherkitty/main | 2cbcb6597c0ff6b95c9fa9cd43b6815649ae1b64 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2021 The Sherkitty Project
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, t... | 41.037736 | 89 | 0.765057 |
4a15f1d5aeff7592250c05b4c7a4f6b14aba366a | 2,029 | py | Python | src/__init__.py | fulcrum-rocks/w3af-ci-scan | 98fd3ab75739bd77b5a0314aa4e4e8022b94e5c1 | [
"MIT"
] | null | null | null | src/__init__.py | fulcrum-rocks/w3af-ci-scan | 98fd3ab75739bd77b5a0314aa4e4e8022b94e5c1 | [
"MIT"
] | null | null | null | src/__init__.py | fulcrum-rocks/w3af-ci-scan | 98fd3ab75739bd77b5a0314aa4e4e8022b94e5c1 | [
"MIT"
] | null | null | null | import subprocess
import os
def getFormatedConfig(url):
result = """
#Configure HTTP settings
http-settings
set timeout 30
back
#Configure scanner global behaviors
misc-settings
set max_discovery_time 20
set fuzz_cookies True
set fuzz_form_files True
set fuzz_url_parts True
set fuzz_url_filena... | 26.012821 | 182 | 0.755545 |
4a15f429d8063cb5824490e339b34e7092ccf450 | 9,698 | py | Python | scrub/tools/coverity/get_coverity_warnings.py | ablack-jpl/scrub | 46739b4a82eab7c37e7f02cf9d537c3a58d40e01 | [
"Apache-2.0"
] | null | null | null | scrub/tools/coverity/get_coverity_warnings.py | ablack-jpl/scrub | 46739b4a82eab7c37e7f02cf9d537c3a58d40e01 | [
"Apache-2.0"
] | null | null | null | scrub/tools/coverity/get_coverity_warnings.py | ablack-jpl/scrub | 46739b4a82eab7c37e7f02cf9d537c3a58d40e01 | [
"Apache-2.0"
] | null | null | null | import re
import os
import logging
from distutils.version import StrictVersion
WARNING_LEVEL = 'Low'
ID_PREFIX = 'coverity'
def get_error_indices(raw_input_file):
"""This function gets the indices of the first line of all Coverity warnings.
Inputs:
- raw_input_file: Full path to the file containing ... | 38.63745 | 112 | 0.619612 |
4a15f59e01edcf65305feae60cde2c3a85a06613 | 9,114 | py | Python | Greengrass Core/trialteration_core.py | simformsolutions/Beacon-positioning-using-aws-greengrass | c82cb3f266dbc9cfdbe17f8bcbd27807a3162e15 | [
"Apache-2.0"
] | 1 | 2019-04-05T07:16:05.000Z | 2019-04-05T07:16:05.000Z | Greengrass Core/trialteration_core.py | simformsolutions/Beacon-positioning-using-aws-greengrass | c82cb3f266dbc9cfdbe17f8bcbd27807a3162e15 | [
"Apache-2.0"
] | null | null | null | Greengrass Core/trialteration_core.py | simformsolutions/Beacon-positioning-using-aws-greengrass | c82cb3f266dbc9cfdbe17f8bcbd27807a3162e15 | [
"Apache-2.0"
] | null | null | null | #python basicdiscovery.py --endpoint a3drj1nn7u6229.iot.us-east-1.amazonaws.com --rootCA root-ca-cert.pem --cert c511834aea.cert.pem --key c511834aea.private.key --thingName rpi2 --topic 'hello/world/send' --mode both
import os
import sys
import time
import uuid
import json
import logging
import argparse
from AWSIoTPy... | 37.04878 | 217 | 0.651854 |
4a15f67f195a0429a9bee2e33b198faefbae42d2 | 141 | py | Python | Leetcode/2001-3000/2177. Find Three Consecutive Integers That Sum to a Given Number/2177.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/2001-3000/2177. Find Three Consecutive Integers That Sum to a Given Number/2177.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/2001-3000/2177. Find Three Consecutive Integers That Sum to a Given Number/2177.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | class Solution:
def sumOfThree(self, num: int) -> List[int]:
if num % 3:
return []
x = num // 3
return [x - 1, x, x + 1]
| 20.142857 | 46 | 0.503546 |
4a15f76da7405d7fb6d0584362a438b886bf9001 | 3,121 | py | Python | gui/tests/test_numpad.py | a-bombarda/mvm-gui | e00c3fe39cf25c6fb2d2725891610da8885d1d76 | [
"MIT"
] | null | null | null | gui/tests/test_numpad.py | a-bombarda/mvm-gui | e00c3fe39cf25c6fb2d2725891610da8885d1d76 | [
"MIT"
] | null | null | null | gui/tests/test_numpad.py | a-bombarda/mvm-gui | e00c3fe39cf25c6fb2d2725891610da8885d1d76 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# from pytestqt import qt_compat
from pytestqt.qt_compat import qt_api
import pytest
import time
from .mvm_basics import *
from mainwindow import MainWindow
from numpad.numpad import NumPad
from PyQt5.QtCore import QCoreApplication
"""
TH01
"""
def test_createNumPad(qtbot):
'''
Test th... | 24.574803 | 72 | 0.707466 |
4a15f7bb59f4c659e7e9dd4bfbef8b1d8367a93d | 8,160 | py | Python | google-cloud-firestore/synth.py | naveed-ahmad/google-cloud-ruby | ec86e413a157e09ee0ff1080468dd75556d0908f | [
"Apache-2.0"
] | 1 | 2021-01-02T05:11:13.000Z | 2021-01-02T05:11:13.000Z | google-cloud-firestore/synth.py | naveed-ahmad/google-cloud-ruby | ec86e413a157e09ee0ff1080468dd75556d0908f | [
"Apache-2.0"
] | null | null | null | google-cloud-firestore/synth.py | naveed-ahmad/google-cloud-ruby | ec86e413a157e09ee0ff1080468dd75556d0908f | [
"Apache-2.0"
] | 2 | 2019-10-14T17:26:31.000Z | 2019-10-16T03:38:26.000Z | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 36.756757 | 130 | 0.668995 |
4a15f7c820cf5b1857dd3d3b389f99bc589da94a | 875 | py | Python | deepcave/__init__.py | PhMueller/DeepCAVE | 2aec109470e667d4bbbe0cd0d9abb11e683a23c4 | [
"Apache-2.0"
] | null | null | null | deepcave/__init__.py | PhMueller/DeepCAVE | 2aec109470e667d4bbbe0cd0d9abb11e683a23c4 | [
"Apache-2.0"
] | null | null | null | deepcave/__init__.py | PhMueller/DeepCAVE | 2aec109470e667d4bbbe0cd0d9abb11e683a23c4 | [
"Apache-2.0"
] | null | null | null | import os
import sys
from deepcave.runs.recorder import Recorder
from deepcave.runs.objective import Objective
from deepcave.__version__ import __version__
version = __version__
exec_file = sys.argv[0]
if "server.py" in exec_file or "worker.py" in exec_file:
from deepcave.utils.cache import Cache # noqa
fro... | 27.34375 | 77 | 0.685714 |
4a15f9612734cead03c7da5c99fee9dda6a80f42 | 19,741 | py | Python | AddToFile.py | nchauhan890/sublime-text-add-to-file | 44272a036fe6adb32a104da0004a8277fbb9fbb7 | [
"MIT"
] | 2 | 2018-07-26T09:35:57.000Z | 2021-05-05T18:49:24.000Z | AddToFile.py | nchauhan890/sublime-text-add-to-file | 44272a036fe6adb32a104da0004a8277fbb9fbb7 | [
"MIT"
] | 2 | 2018-06-28T15:37:31.000Z | 2018-07-07T10:59:46.000Z | AddToFile.py | nchauhan890/sublime-text-add-to-file | 44272a036fe6adb32a104da0004a8277fbb9fbb7 | [
"MIT"
] | 2 | 2018-11-14T12:17:13.000Z | 2021-01-26T12:06:11.000Z | import os
import sublime
import sublime_plugin
class AddToCommand(sublime_plugin.TextCommand):
"""main AddToFile command which handles display and selection
of views and runs command to insert text
contains various methods to help separate functions provided"""
def get_preview(self, view):
... | 46.123832 | 80 | 0.527937 |
4a15fb4d1a30dd546c9f0de35c5225ff1d052a1d | 2,200 | py | Python | docs/examples/viz_mde.py | fury-gl/helios | 14e39e0350b4b9666775ba0c4840d2e9887678c2 | [
"MIT"
] | 3 | 2021-10-13T14:38:57.000Z | 2021-10-16T19:40:14.000Z | docs/examples/viz_mde.py | fury-gl/helios | 14e39e0350b4b9666775ba0c4840d2e9887678c2 | [
"MIT"
] | 14 | 2021-07-04T19:00:57.000Z | 2021-10-16T18:35:45.000Z | docs/examples/viz_mde.py | fury-gl/helios | 14e39e0350b4b9666775ba0c4840d2e9887678c2 | [
"MIT"
] | 3 | 2021-06-06T14:43:59.000Z | 2021-10-17T19:03:54.000Z | """
=====================================================
Minmum Distortion Embedding: Anchored Constraints
=====================================================
"""
import numpy as np
import argparse
from fury.window import record
from helios import NetworkDraw
from helios.layouts.mde import MDE
# from
# https://... | 24.719101 | 77 | 0.642727 |
4a15fb9ffe95133ed1f8d82e90a4e18c6325c377 | 1,710 | py | Python | utils/ema.py | TomerMe2/FixMatch-Computational-Learning-Project | f68e01d074964dfc5387639a15abe75a24eaa074 | [
"MIT"
] | 12 | 2020-12-07T04:24:58.000Z | 2022-02-16T15:33:26.000Z | utils/ema.py | TomerMe2/FixMatch-Computational-Learning-Project | f68e01d074964dfc5387639a15abe75a24eaa074 | [
"MIT"
] | 1 | 2021-07-15T23:02:22.000Z | 2021-07-15T23:02:22.000Z | utils/ema.py | TomerMe2/FixMatch-Computational-Learning-Project | f68e01d074964dfc5387639a15abe75a24eaa074 | [
"MIT"
] | 1 | 2021-07-14T10:21:48.000Z | 2021-07-14T10:21:48.000Z | # Imported from https://github.com/YUE-FAN/FixMatch-PyTorch/blob/master/utils/ema.py
import torch
class EMA(object):
def __init__(self, model, alpha=0.999):
self.model = model
self.alpha = alpha
self.shadow = self.get_model_state()
self.backup = {}
self.param_keys = [k for ... | 29.482759 | 84 | 0.599415 |
4a15fbd02a7063019b2ff7b254d708a51a642946 | 3,087 | py | Python | mvntime.py | gaol/maven-repository-extension | 4f37003f25f7e082c15941d125dc26291d8465a3 | [
"Apache-2.0"
] | 1 | 2020-05-01T13:03:04.000Z | 2020-05-01T13:03:04.000Z | mvntime.py | gaol/maven-repository-extension | 4f37003f25f7e082c15941d125dc26291d8465a3 | [
"Apache-2.0"
] | null | null | null | mvntime.py | gaol/maven-repository-extension | 4f37003f25f7e082c15941d125dc26291d8465a3 | [
"Apache-2.0"
] | null | null | null | #!/bin/python
import sys
import os
import os.path
import optparse
import re
from urlparse import urlparse
import urllib2
import base64
MVN_DOWNLOAD_RE = re.compile(r'\[INFO\] Downloaded: ([^\n]*) \(([^\n]*) ([K]?B) at ([^\n]*) KB\/sec\)')
def calculate(url, username = None, password = None):
result = {}
f = No... | 37.192771 | 183 | 0.628766 |
4a15fbedd7eeab9df4a3ce9b6206236e6eb31390 | 6,779 | py | Python | pylinex/model/ScaledModel.py | CU-NESS/pylinex | b6f342595b6a154e129eb303782e5268088f34d5 | [
"Apache-2.0"
] | null | null | null | pylinex/model/ScaledModel.py | CU-NESS/pylinex | b6f342595b6a154e129eb303782e5268088f34d5 | [
"Apache-2.0"
] | null | null | null | pylinex/model/ScaledModel.py | CU-NESS/pylinex | b6f342595b6a154e129eb303782e5268088f34d5 | [
"Apache-2.0"
] | null | null | null | """
File: pylinex/model/ScaledModel.py
Author: Keith Tauscher
Date: 2 Aug 2018
Description: File containing a class which represents a model which simply
scales the output of a different model.
"""
import numpy as np
from ..util import real_numerical_types
from .Model import Model
class ScaledModel(Model... | 34.586735 | 79 | 0.615578 |
4a15fc50761ea35c94787a8d9f21371982791151 | 2,143 | py | Python | src/beanmachine/ppl/compiler/tests/binary_vs_multiary_addition_perf_test.py | dmitryvinn/beanmachine | 1ac1bc2a38f22372d96f3f3321bd851834ef1456 | [
"MIT"
] | null | null | null | src/beanmachine/ppl/compiler/tests/binary_vs_multiary_addition_perf_test.py | dmitryvinn/beanmachine | 1ac1bc2a38f22372d96f3f3321bd851834ef1456 | [
"MIT"
] | null | null | null | src/beanmachine/ppl/compiler/tests/binary_vs_multiary_addition_perf_test.py | dmitryvinn/beanmachine | 1ac1bc2a38f22372d96f3f3321bd851834ef1456 | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Test performance of multiary addition optimization """
import platform
import unittest
import beanmachine.ppl as bm
from beanmachine.ppl... | 28.197368 | 84 | 0.692954 |
4a15fd06959332cd87c8f93b2dc164eb643a3812 | 1,204 | py | Python | python/misc/missing_third_angle.py | christopher-burke/warmups | 140c96ada87ec5e9faa4622504ddee18840dce4a | [
"MIT"
] | null | null | null | python/misc/missing_third_angle.py | christopher-burke/warmups | 140c96ada87ec5e9faa4622504ddee18840dce4a | [
"MIT"
] | 2 | 2022-03-10T03:49:14.000Z | 2022-03-14T00:49:54.000Z | python/misc/missing_third_angle.py | christopher-burke/warmups | 140c96ada87ec5e9faa4622504ddee18840dce4a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Missing Third Angle.
You are given 2 out of 3 of the angles in a triangle, in degrees.
Write a function that classifies the missing angle as either "acute", "right",
or "obtuse" based on its degrees.
Source:
https://edabit.com/challenge/PKPmS5zwefc7M5emK
"""
def calc_missing_angle(a: in... | 22.716981 | 79 | 0.653654 |
4a15fd739b1bfa6dec10c587dd198a7df20dcfc2 | 2,715 | py | Python | tests/test_middle_simplistic.py | vltr/middle | f7782610fbb1d9232a3b4cfea057a9331db2775e | [
"MIT"
] | 11 | 2018-06-25T11:36:10.000Z | 2020-10-02T09:29:24.000Z | tests/test_middle_simplistic.py | vltr/middle | f7782610fbb1d9232a3b4cfea057a9331db2775e | [
"MIT"
] | 158 | 2018-06-22T14:35:45.000Z | 2022-03-28T21:57:06.000Z | tests/test_middle_simplistic.py | vltr/middle | f7782610fbb1d9232a3b4cfea057a9331db2775e | [
"MIT"
] | 2 | 2019-08-17T19:27:44.000Z | 2020-03-24T18:47:23.000Z | import typing as t
from enum import Enum, IntEnum, unique
import middle
@unique
class PlatformEnum(str, Enum):
XBOX1 = "XBOX1"
PLAYSTATION4 = "PLAYSTATION4"
PC = "PC"
@unique
class LanguageEnum(IntEnum):
ENGLISH = 1
JAPANESE = 2
SPANISH = 3
GERMAN = 4
PORTUGUESE = 5
@unique
class... | 26.105769 | 76 | 0.605893 |
4a15ff8c0df8e7a4c8d79f1f9ec8d9607e620ac6 | 2,647 | py | Python | box-graph/box.py | Linh181/Density-based-Clustering | 7327c486d77a43c0a00c36048153e50db93e606f | [
"MIT"
] | null | null | null | box-graph/box.py | Linh181/Density-based-Clustering | 7327c486d77a43c0a00c36048153e50db93e606f | [
"MIT"
] | null | null | null | box-graph/box.py | Linh181/Density-based-Clustering | 7327c486d77a43c0a00c36048153e50db93e606f | [
"MIT"
] | null | null | null | from point import ClusterPoint
from enum import Enum
class Box():
DEFAULT_LABEL = -1
class Func(Enum):
"""
Function of a box. Can be one of the following:\\
NONE: No core points in box \\
CORE: Only core points in box \\
PARTIAL: Contains at least one core point
... | 31.891566 | 131 | 0.55119 |
4a16008a10085ec7478a02259069a3e5a84fe4f5 | 97,620 | py | Python | nova/tests/unit/conductor/test_conductor.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/conductor/test_conductor.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/conductor/test_conductor.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 IBM Corp.
# Copyright 2013 Red Hat, 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 r... | 46.797699 | 79 | 0.591703 |
4a160103739de1c0fc46a0f7a7e267576486bd2f | 4,626 | py | Python | hendaza_custom_site/hooks.py | MostafaFekry/hendaza_custom_site | 6c39145b004935e8b0c6174cf7769e72ecddd4dd | [
"MIT"
] | null | null | null | hendaza_custom_site/hooks.py | MostafaFekry/hendaza_custom_site | 6c39145b004935e8b0c6174cf7769e72ecddd4dd | [
"MIT"
] | null | null | null | hendaza_custom_site/hooks.py | MostafaFekry/hendaza_custom_site | 6c39145b004935e8b0c6174cf7769e72ecddd4dd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "hendaza_custom_site"
app_title = "Hendaza Custom Site"
app_publisher = "MostafaFekry"
app_description = "Custom site for Hendaza"
app_icon = "octicon octicon-globe"
app_color = "grey"
app_email = "mosta... | 26.284091 | 87 | 0.688067 |
4a160136f9b7cd3bc1045bf3cb026d28ce825d94 | 6,686 | py | Python | tests/core_test.py | wendazhou/jax | d7894198a1ad0e54de42450c27ad5e715cb59aa1 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-06-13T20:51:49.000Z | 2021-06-14T02:37:06.000Z | tests/core_test.py | wendazhou/jax | d7894198a1ad0e54de42450c27ad5e715cb59aa1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/core_test.py | wendazhou/jax | d7894198a1ad0e54de42450c27ad5e715cb59aa1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-03-14T10:07:22.000Z | 2019-03-14T10:07:22.000Z | # 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, ... | 25.616858 | 82 | 0.616961 |
4a16025e5cd7c2112db297d1d6c67aba1d3e6d50 | 12,541 | py | Python | golos/utils.py | Chainers/golos-python | 7c06a933256c7ca0c52d4348526d3712ac00e7ab | [
"MIT"
] | 1 | 2018-04-11T15:44:21.000Z | 2018-04-11T15:44:21.000Z | golos/utils.py | Chainers/steep-golos | 7c06a933256c7ca0c52d4348526d3712ac00e7ab | [
"MIT"
] | null | null | null | golos/utils.py | Chainers/steep-golos | 7c06a933256c7ca0c52d4348526d3712ac00e7ab | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import logging
import os
import re
import time
from datetime import datetime
from json import JSONDecodeError
from math import log10
from urllib.parse import urlparse
import w3lib.url
from langdetect import DetectorFactory, detect
from langdetect.lang_detect_exception import LangDet... | 29.438967 | 99 | 0.597879 |
4a1602ade40568248d2086c08d7611531250080c | 846 | py | Python | leetcode/medium/Trees/BinTreeFromPre&Inorder.py | cheshtaaagarrwal/DS-Algos | d64f07355a0ea4342e868a359f34be28c183f8ff | [
"MIT"
] | null | null | null | leetcode/medium/Trees/BinTreeFromPre&Inorder.py | cheshtaaagarrwal/DS-Algos | d64f07355a0ea4342e868a359f34be28c183f8ff | [
"MIT"
] | null | null | null | leetcode/medium/Trees/BinTreeFromPre&Inorder.py | cheshtaaagarrwal/DS-Algos | d64f07355a0ea4342e868a359f34be28c183f8ff | [
"MIT"
] | 1 | 2021-10-11T23:11:55.000Z | 2021-10-11T23:11:55.000Z | # Given preorder and inorder traversal of a tree, construct the binary tree.
# Note:
# You may assume that duplicates do not exist in the tree.
# For example, given
# preorder = [3,9,20,15,7]
# inorder = [9,3,15,20,7]
# Return the following binary tree:
# 3
# / \
# 9 20
# / \
# 15 7
class Tree... | 22.864865 | 81 | 0.591017 |
4a16032bd9e701fdf452266a77a991d4788d993e | 257 | py | Python | twist_plotter/utils/math_tools.py | alexemm/DataMonitor | 6560ac38a1cee4a324e521c6d529b9a09f41ade9 | [
"MIT"
] | null | null | null | twist_plotter/utils/math_tools.py | alexemm/DataMonitor | 6560ac38a1cee4a324e521c6d529b9a09f41ade9 | [
"MIT"
] | null | null | null | twist_plotter/utils/math_tools.py | alexemm/DataMonitor | 6560ac38a1cee4a324e521c6d529b9a09f41ade9 | [
"MIT"
] | null | null | null | from Equation import Expression
import numpy as np
def text2lambda(text):
return Expression(text, 'x')
def create_data_from_function(f, begin, end, steps=69):
x = np.linspace(begin, end, steps)
y = np.array(list(map(f, x)))
return x, y
| 18.357143 | 55 | 0.680934 |
4a16033401d9d62994a137225ad1681f90724f01 | 13,099 | py | Python | sopel/modules/admin.py | torstehu/sopel | 514d6b8c70b5853d96dd2093d87eecfd8b176c62 | [
"EFL-2.0"
] | null | null | null | sopel/modules/admin.py | torstehu/sopel | 514d6b8c70b5853d96dd2093d87eecfd8b176c62 | [
"EFL-2.0"
] | null | null | null | sopel/modules/admin.py | torstehu/sopel | 514d6b8c70b5853d96dd2093d87eecfd8b176c62 | [
"EFL-2.0"
] | null | null | null | # coding=utf-8
"""
admin.py - Sopel Admin Module
Copyright 2010-2011, Sean B. Palmer (inamidst.com) and Michael Yanovich
(yanovich.net)
Copyright © 2012, Elad Alfassa, <elad@fedoraproject.org>
Copyright 2013, Ari Koivula <ari@koivu.la>
Copyright 2019, Florian Strzelecki, https://github.com/Exirel
Licensed under the Eif... | 32.584577 | 125 | 0.672876 |
4a1603c7ec5f97c7265df5fbfd5aa9d8c6aa9fed | 170 | py | Python | tests/pipelines/pype/relativenesting/nested/arb/relnestarbstep.py | mofm/pypyr | f417f69ba9a607d8a93019854105cfbc4dc9c36d | [
"Apache-2.0"
] | 31 | 2017-03-24T11:27:34.000Z | 2020-05-27T20:06:28.000Z | tests/pipelines/pype/relativenesting/nested/arb/relnestarbstep.py | mofm/pypyr | f417f69ba9a607d8a93019854105cfbc4dc9c36d | [
"Apache-2.0"
] | 89 | 2017-04-12T09:50:32.000Z | 2020-08-13T13:18:36.000Z | tests/pipelines/pype/relativenesting/nested/arb/relnestarbstep.py | mofm/pypyr | f417f69ba9a607d8a93019854105cfbc4dc9c36d | [
"Apache-2.0"
] | 6 | 2017-06-04T14:19:59.000Z | 2020-02-10T13:16:40.000Z | """Arbitrary testing step that adds arb_in to out list in context."""
def run_step(context):
"""Add arb_in to out.."""
context['out'].append(context['arb_in'])
| 24.285714 | 69 | 0.664706 |
4a1603f78c7ce7159693d881d42e230ca6155e5f | 560 | py | Python | symphony/cli/pyinventory/common/constant.py | englishthomas/magma-1 | a67e255c9d4d6367c0a6186becee85643f9ebe7a | [
"BSD-3-Clause"
] | null | null | null | symphony/cli/pyinventory/common/constant.py | englishthomas/magma-1 | a67e255c9d4d6367c0a6186becee85643f9ebe7a | [
"BSD-3-Clause"
] | null | null | null | symphony/cli/pyinventory/common/constant.py | englishthomas/magma-1 | a67e255c9d4d6367c0a6186becee85643f9ebe7a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2004-present Facebook All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "2.6.1"
EQUIPMENTS_TO_SEARCH = 10
LOCATIONS_TO_SEARCH = 5
USER_ROLE = 0
SUPERUSER_ROLE = 3
SCHEMA_FILE_NAME = "survey_sc... | 25.454545 | 58 | 0.698214 |
4a1604322cf217a63f9c8443682c004d3158cd2c | 10,968 | py | Python | youwol/routers/environment/upload_assets/upload.py | youwol/py-youwol | 85a8877e302c9da1aea168bf1d964d19036c1134 | [
"MIT"
] | null | null | null | youwol/routers/environment/upload_assets/upload.py | youwol/py-youwol | 85a8877e302c9da1aea168bf1d964d19036c1134 | [
"MIT"
] | 1 | 2022-03-14T09:40:15.000Z | 2022-03-14T09:40:15.000Z | youwol/routers/environment/upload_assets/upload.py | youwol/py-youwol | 85a8877e302c9da1aea168bf1d964d19036c1134 | [
"MIT"
] | null | null | null | import asyncio
import json
from typing import Mapping, Dict, cast
from aiohttp import FormData, ClientSession
from fastapi import HTTPException
from youwol.backends.treedb.models import PathResponse
from youwol.environment.clients import RemoteClients, LocalClients
from youwol.environment.youwol_environment import Yo... | 41.078652 | 119 | 0.625182 |
4a1604d7185920fec98335756e83ee84346d2470 | 56,396 | py | Python | CFM_main/fcts_snowpackflow.py | mvdebolskiy/CommunityFirnModel | 5380479cdf776132d549f48e9d71b674564ad9cc | [
"MIT"
] | 21 | 2019-03-28T13:56:51.000Z | 2022-01-28T12:39:10.000Z | CFM_main/fcts_snowpackflow.py | mvdebolskiy/CommunityFirnModel | 5380479cdf776132d549f48e9d71b674564ad9cc | [
"MIT"
] | 2 | 2021-06-10T06:53:49.000Z | 2022-01-12T22:07:02.000Z | CFM_main/fcts_snowpackflow.py | mvdebolskiy/CommunityFirnModel | 5380479cdf776132d549f48e9d71b674564ad9cc | [
"MIT"
] | 12 | 2017-10-09T08:16:25.000Z | 2021-12-11T03:51:40.000Z | #!/usr/bin/env python
'''
This script contains all the functions required to make the pereferential flow scheme of snowpack work
https://models.slf.ch/p/snowpack/source/tree/HEAD/branches/dev/snowpack/snowpackCore/ReSolver1d.cc
'''
import numpy as np
from constants import *
from scipy.sparse import diags as diag... | 58.868476 | 196 | 0.623821 |
4a1606b551d3612fb9dabfbd89b60be051f406be | 3,857 | py | Python | alpaca_trade_api/models/public_stream.py | 164747/alpaca-trade-api-python | 94134a2ea226eab653329e1f1790e1b1d9e74f16 | [
"Apache-2.0"
] | null | null | null | alpaca_trade_api/models/public_stream.py | 164747/alpaca-trade-api-python | 94134a2ea226eab653329e1f1790e1b1d9e74f16 | [
"Apache-2.0"
] | null | null | null | alpaca_trade_api/models/public_stream.py | 164747/alpaca-trade-api-python | 94134a2ea226eab653329e1f1790e1b1d9e74f16 | [
"Apache-2.0"
] | null | null | null | import datetime
import typing
import pytz
from pydantic import BaseModel, Field
from alpaca_trade_api.models import public_rest
class SocketBase(BaseModel):
symbol: str = Field(alias='S')
event_type: str = Field(alias='T')
class Trade(SocketBase):
exchange_id: str = Field(alias='x')
trade_id: int ... | 30.132813 | 103 | 0.542909 |
4a16073c8890124ff7a3544859d5dbb11598f7b6 | 14,969 | py | Python | compressor/management/commands/compress.py | andriyor/django-compressor | be782489af21b51cad2e8a60dd6b0a3bed20bff3 | [
"MIT"
] | null | null | null | compressor/management/commands/compress.py | andriyor/django-compressor | be782489af21b51cad2e8a60dd6b0a3bed20bff3 | [
"MIT"
] | null | null | null | compressor/management/commands/compress.py | andriyor/django-compressor | be782489af21b51cad2e8a60dd6b0a3bed20bff3 | [
"MIT"
] | null | null | null | # flake8: noqa
import os
import sys
import concurrent.futures
from threading import Lock
from collections import OrderedDict, defaultdict
from fnmatch import fnmatch
from importlib import import_module
import django
from django.core.management.base import BaseCommand, CommandError
import django.template
from django.t... | 45.776758 | 116 | 0.56637 |
4a16079010024c573b51432c99c0b72c13d6606c | 3,420 | py | Python | paperlib/get_vta.py | guimarais/Hmode_Figures | 964b93a56421fa2594687e2eebcd66762ae4b170 | [
"MIT"
] | null | null | null | paperlib/get_vta.py | guimarais/Hmode_Figures | 964b93a56421fa2594687e2eebcd66762ae4b170 | [
"MIT"
] | null | null | null | paperlib/get_vta.py | guimarais/Hmode_Figures | 964b93a56421fa2594687e2eebcd66762ae4b170 | [
"MIT"
] | null | null | null | import dd
import numpy as np
from ipfnpytools.trz_to_rhop import trz_to_rhop
class objview(object):
def __init__(self, d):
self.__dict__=d
def get_vta(shotnr, tBegin=0.0, tEnd=10.0, magdiag='EQH', verbose=False):
"""Reads the VTA(Vertical Thomson Array) shotfile and maps data to rho pol. The Edge and ... | 35.257732 | 175 | 0.589766 |
4a1607ee1443c07a6a7d62a28a959a6d488b4074 | 9,545 | py | Python | mms/model_service_worker.py | zmhassan/mxnet-model-server | a491823309a7ef2845797512fe6b01f7eab03ce6 | [
"Apache-2.0"
] | null | null | null | mms/model_service_worker.py | zmhassan/mxnet-model-server | a491823309a7ef2845797512fe6b01f7eab03ce6 | [
"Apache-2.0"
] | null | null | null | mms/model_service_worker.py | zmhassan/mxnet-model-server | a491823309a7ef2845797512fe6b01f7eab03ce6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
# or in the "license" file... | 38.333333 | 107 | 0.608486 |
4a1608fb506ae3b138329b1b05400e02c1797868 | 8,589 | py | Python | tests/test_04_dxf_high_level_structs/test_406_blocks_section.py | jpsantos-mf/ezdxf | 2b542a551b2cfc3c0920a5dbf302ff58cea90fbd | [
"MIT"
] | null | null | null | tests/test_04_dxf_high_level_structs/test_406_blocks_section.py | jpsantos-mf/ezdxf | 2b542a551b2cfc3c0920a5dbf302ff58cea90fbd | [
"MIT"
] | null | null | null | tests/test_04_dxf_high_level_structs/test_406_blocks_section.py | jpsantos-mf/ezdxf | 2b542a551b2cfc3c0920a5dbf302ff58cea90fbd | [
"MIT"
] | null | null | null | # Copyright (c) 2011-2019, Manfred Moitzi
# License: MIT License
import pytest
import ezdxf
from ezdxf.tools.test import load_entities
from ezdxf.sections.blocks import BlocksSection
from ezdxf.lldxf.tagwriter import TagCollector
from ezdxf.entities import factory
from ezdxf.lldxf.const import BLK_NON_CONSTANT_ATTRIBU... | 17.109562 | 76 | 0.681686 |
4a1609e549990afe65668d7ed63c9ad6a61c2da3 | 6,104 | py | Python | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_projects_response.py | erexer/polyaxon | be14dae1ed56d568983388736bcdaf27a7baa4a4 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_projects_response.py | erexer/polyaxon | be14dae1ed56d568983388736bcdaf27a7baa4a4 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_projects_response.py | erexer/polyaxon | be14dae1ed56d568983388736bcdaf27a7baa4a4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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 ... | 27.128889 | 85 | 0.586173 |
4a160a6521ed6df9d9de6090aa5ed89b5079a4c2 | 2,179 | py | Python | lambda_sample/index.py | pahud/lambda-layer-eksctl | 203966a6afc58c3e3dd8f42d680aff156a1160c8 | [
"MIT-0"
] | 1 | 2019-11-15T05:48:27.000Z | 2019-11-15T05:48:27.000Z | lambda_sample/index.py | pahud/lambda-layer-eksctl | 203966a6afc58c3e3dd8f42d680aff156a1160c8 | [
"MIT-0"
] | 4 | 2019-11-15T02:24:51.000Z | 2020-06-12T04:30:26.000Z | lambda_sample/index.py | pahud/lambda-layer-eksctl | 203966a6afc58c3e3dd8f42d680aff156a1160c8 | [
"MIT-0"
] | 1 | 2020-04-21T22:28:18.000Z | 2020-04-21T22:28:18.000Z | import subprocess
import os
import json
import logging
import botocore
logger = logging.getLogger()
logger.setLevel(logging.INFO)
os.environ['PATH'] = '/opt/eksctl:' + os.environ['PATH']
outdir = os.environ.get('TEST_OUTDIR', '/tmp')
def eksctl(*args, **kwargs):
output = subprocess.check_output(['eksctl']+list... | 26.901235 | 85 | 0.636072 |
4a160b2f40eb772937cae0707b12ad9efd556abb | 39,196 | py | Python | src/genie/libs/parser/iosxr/show_routing.py | devbollinger/genieparser | ad5ce7ba8f5153d1aeb9cffcfc4dde0871f3401c | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxr/show_routing.py | devbollinger/genieparser | ad5ce7ba8f5153d1aeb9cffcfc4dde0871f3401c | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxr/show_routing.py | devbollinger/genieparser | ad5ce7ba8f5153d1aeb9cffcfc4dde0871f3401c | [
"Apache-2.0"
] | null | null | null | '''
show_route.py
'''
import re
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, \
Any, \
Optional
# ====================================================
# schema for show route ipv4
# ====================================================
class ShowRouteIpv4Schema(... | 42.837158 | 103 | 0.448158 |
4a160c22b83e59ed4cc03a215bd00cec8d9ce349 | 4,448 | py | Python | StockAnalysisSystem/plugin/SubService/WebServiceProvider/sas_terminal.py | SleepySoft/StockAnalysisSystem | 75f95738831614f7946f85d09118e447f7ac6dc7 | [
"Apache-2.0"
] | 138 | 2018-01-03T03:32:49.000Z | 2022-03-12T02:57:46.000Z | StockAnalysisSystem/plugin/SubService/WebServiceProvider/sas_terminal.py | SleepySoft/StockAnalysisSystem | 75f95738831614f7946f85d09118e447f7ac6dc7 | [
"Apache-2.0"
] | 9 | 2018-01-01T03:16:24.000Z | 2021-05-27T09:57:24.000Z | StockAnalysisSystem/plugin/SubService/WebServiceProvider/sas_terminal.py | SleepySoft/StockAnalysisSystem | 75f95738831614f7946f85d09118e447f7ac6dc7 | [
"Apache-2.0"
] | 50 | 2019-08-05T01:02:30.000Z | 2022-03-07T00:52:14.000Z | import StockAnalysisSystem.core.api as sasApi
from StockAnalysisSystem.interface.interface import SasInterface
from StockAnalysisSystem.core.Utility.digit_utility import to_int
class TerminalContext:
def __init__(self, result_handler, **kwargs):
self.context = kwargs
self.result_handler = result_h... | 35.584 | 117 | 0.558903 |
4a160c5eff50fe322558281fabf9dc4f7ec52a04 | 3,973 | py | Python | examples/dfp/v201411/placement_service/create_placements.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | 1 | 2015-08-12T14:47:40.000Z | 2015-08-12T14:47:40.000Z | examples/dfp/v201411/placement_service/create_placements.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | 1 | 2020-07-24T15:10:10.000Z | 2020-07-24T15:10:10.000Z | examples/dfp/v201411/placement_service/create_placements.py | coxmediagroup/googleads-python-lib | f85d5d8ab771e93b03b616ef65e2d3082aeef484 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 35.792793 | 78 | 0.687893 |
4a160c94b4b50e4dbd9b875c032174ea97dab589 | 99 | py | Python | src/dataset/__init__.py | ireina7/gzsl-seg | 9aad220274b4a58b59f5da430f873b5dfc21e458 | [
"MIT"
] | 1 | 2022-03-15T04:46:00.000Z | 2022-03-15T04:46:00.000Z | src/dataset/__init__.py | ireina7/gzsl-seg | 9aad220274b4a58b59f5da430f873b5dfc21e458 | [
"MIT"
] | null | null | null | src/dataset/__init__.py | ireina7/gzsl-seg | 9aad220274b4a58b59f5da430f873b5dfc21e458 | [
"MIT"
] | null | null | null |
all = [
'common',
'transform_pixel',
'semantic',
'voc',
]
from dataset.common import *
| 8.25 | 28 | 0.585859 |
4a160db1433f15df935abb230d2f115373f5a5c5 | 7,407 | py | Python | monai/networks/nets/unet.py | vsivan97/MONAI | 33cb186b4664bb032fe9837b305c0a06cdf6d289 | [
"Apache-2.0"
] | null | null | null | monai/networks/nets/unet.py | vsivan97/MONAI | 33cb186b4664bb032fe9837b305c0a06cdf6d289 | [
"Apache-2.0"
] | null | null | null | monai/networks/nets/unet.py | vsivan97/MONAI | 33cb186b4664bb032fe9837b305c0a06cdf6d289 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 - 2021 MONAI Consortium
# 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... | 36.850746 | 120 | 0.599163 |
4a160e45981a120d40286f2ce15c44eff6ec9f4e | 7,338 | py | Python | rqt_dotgraph/rqt_dotgraph.py | xydesa/rqt_dotgraph | 3a182142464f562d89e7aa48b12ac6a50b013b5a | [
"CC0-1.0"
] | null | null | null | rqt_dotgraph/rqt_dotgraph.py | xydesa/rqt_dotgraph | 3a182142464f562d89e7aa48b12ac6a50b013b5a | [
"CC0-1.0"
] | null | null | null | rqt_dotgraph/rqt_dotgraph.py | xydesa/rqt_dotgraph | 3a182142464f562d89e7aa48b12ac6a50b013b5a | [
"CC0-1.0"
] | null | null | null | """
rqt GUI plugin to visualize dot graphs.
This software was developed by employees of the Federal Government in the course of
their official duties. Pursuant to title 17 Section 105 of the United States Code, this
software is not subject to copyright protection and is in the public domain. The
Government assumes no ... | 38.21875 | 88 | 0.668711 |
4a160e50b3c647c22ad382fa3d6f07aefff0ef5d | 5,021 | py | Python | archive/old_plots/plot_metadata.py | garudlab/mother_infant | 98a27c83bf5ece9497d5a030c6c9396a8c514781 | [
"BSD-2-Clause"
] | 2 | 2020-08-09T06:19:11.000Z | 2021-08-18T17:12:23.000Z | archive/old_plots/plot_metadata.py | garudlab/mother_infant | 98a27c83bf5ece9497d5a030c6c9396a8c514781 | [
"BSD-2-Clause"
] | null | null | null | archive/old_plots/plot_metadata.py | garudlab/mother_infant | 98a27c83bf5ece9497d5a030c6c9396a8c514781 | [
"BSD-2-Clause"
] | 8 | 2019-02-20T22:21:55.000Z | 2021-02-13T00:55:40.000Z | import matplotlib
matplotlib.use('Agg')
import parse_midas_data
import pylab
import sys
import numpy
import diversity_utils
import gene_diversity_utils
import stats_utils
import os
# Load time metadata
subject_sample_time_map = parse_midas_data.parse_subject_sample_time_map()
# store data in these variables
num_vi... | 38.328244 | 174 | 0.730532 |
4a160e5ae28a10966bbea903fc8c56c280016b1a | 280 | py | Python | src/dsrlib/filemgr/windows.py | fraca7/dsremap | fb8f4fb13e74b512ed0cac05387fbe9694faebcf | [
"MIT"
] | 8 | 2020-09-06T02:15:10.000Z | 2022-01-12T22:49:20.000Z | src/dsrlib/filemgr/windows.py | fraca7/dsremap | fb8f4fb13e74b512ed0cac05387fbe9694faebcf | [
"MIT"
] | 5 | 2021-03-29T20:37:46.000Z | 2021-09-19T13:20:24.000Z | src/dsrlib/filemgr/windows.py | fraca7/dsremap | fb8f4fb13e74b512ed0cac05387fbe9694faebcf | [
"MIT"
] | 2 | 2020-09-16T01:45:49.000Z | 2021-06-12T12:38:15.000Z | #!/usr/bin/env python3
import os
from .base import FileManager
@FileManager.register
class FileManagerWindows:
@staticmethod
def showFile(filename):
code = os.system('explorer.exe /select,"%s"' % filename)
return code is None or code == 0
| 20 | 65 | 0.653571 |
4a160f8526d199779ca8ddf1d219b7b3f74c1078 | 280 | py | Python | maintenance_repair_services/maintenance_and_repair_services/doctype/item_category/item_category.py | nismaHamdouna/mrs | 6e45de16a4ddf3f7ecbee38f433ba430b4ff7081 | [
"MIT"
] | 1 | 2019-05-28T13:43:14.000Z | 2019-05-28T13:43:14.000Z | maintenance_repair_services/maintenance_and_repair_services/doctype/item_category/item_category.py | nismaHamdouna/mrs | 6e45de16a4ddf3f7ecbee38f433ba430b4ff7081 | [
"MIT"
] | null | null | null | maintenance_repair_services/maintenance_and_repair_services/doctype/item_category/item_category.py | nismaHamdouna/mrs | 6e45de16a4ddf3f7ecbee38f433ba430b4ff7081 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Maintenance and Repair Services and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ItemCategory(Document):
pass
| 25.454545 | 70 | 0.789286 |
4a16101c7a3ab68e507e736cee5fd57a8c349126 | 54,357 | py | Python | Lib/configparser.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 1 | 2019-09-04T02:06:21.000Z | 2019-09-04T02:06:21.000Z | Lib/configparser.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 4 | 2020-04-02T14:59:42.000Z | 2021-02-10T14:30:18.000Z | Lib/configparser.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 2 | 2018-05-03T01:08:13.000Z | 2019-12-02T03:03:43.000Z | """Configuration file parser.
A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.
Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.
class:
ConfigParse... | 39.851173 | 79 | 0.583752 |
4a1610799b3d8fb731b9481cd6b108f1866ff54b | 3,238 | py | Python | tests/ut/python/dataset/test_convertcolor.py | PowerOlive/mindspore | bda20724a94113cedd12c3ed9083141012da1f15 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/ut/python/dataset/test_convertcolor.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/ut/python/dataset/test_convertcolor.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.795455 | 94 | 0.70908 |
4a1610f6c9cb9429adb8113e1112ea51ad93472f | 4,030 | py | Python | ctgan/synthesizer/tests/test_synthesizer.py | ljk423/ctgan-tf | 916ae47e1932d5dd76152fc9e59e9de88142590d | [
"MIT"
] | 2 | 2020-11-26T18:59:04.000Z | 2021-06-05T04:39:51.000Z | ctgan/synthesizer/tests/test_synthesizer.py | ljk423/ctgan-tf | 916ae47e1932d5dd76152fc9e59e9de88142590d | [
"MIT"
] | null | null | null | ctgan/synthesizer/tests/test_synthesizer.py | ljk423/ctgan-tf | 916ae47e1932d5dd76152fc9e59e9de88142590d | [
"MIT"
] | 1 | 2021-01-17T15:20:39.000Z | 2021-01-17T15:20:39.000Z | import tensorflow as tf
import numpy as np
import pandas as pd
import joblib
import os
from unittest import TestCase
from ctgan.utils import generate_data, get_test_variables
from ctgan.synthesizer import CTGANSynthesizer
class TestSynthesizer(TestCase):
def setUp(self):
self._vars = get_test_variables()... | 37.314815 | 79 | 0.628784 |
4a16115a4c772657d5e3d0429a04651aa027f693 | 6,542 | py | Python | Computer science/Programming languages/Python/Python libraries/Networking/BeautifulSoup; working with HTML/documentation.py | chanchanchong/PYTHON-TRACK-IN-HYPERSKILL | 462fe08ff4a2b183fd45a0235ab1ec7a788bd54c | [
"MIT"
] | null | null | null | Computer science/Programming languages/Python/Python libraries/Networking/BeautifulSoup; working with HTML/documentation.py | chanchanchong/PYTHON-TRACK-IN-HYPERSKILL | 462fe08ff4a2b183fd45a0235ab1ec7a788bd54c | [
"MIT"
] | null | null | null | Computer science/Programming languages/Python/Python libraries/Networking/BeautifulSoup; working with HTML/documentation.py | chanchanchong/PYTHON-TRACK-IN-HYPERSKILL | 462fe08ff4a2b183fd45a0235ab1ec7a788bd54c | [
"MIT"
] | null | null | null | # Beautiful Soup Documentation
# Beautiful Soup is a Python library for pulling data out of
# HTML and XML files. It works with your favorite parser to
# provide idiomatic ways of navigating, searching , and
# modifying the parse tree. It commonly saves programmers hours
# or days of work.
# These instructions illustr... | 33.721649 | 315 | 0.701162 |
4a16117447d9f51eae4bd1073bfc807974032d2f | 3,026 | py | Python | indico/modules/events/registration/settings.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | 1 | 2021-06-11T20:02:10.000Z | 2021-06-11T20:02:10.000Z | indico/modules/events/registration/settings.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | null | null | null | indico/modules/events/registration/settings.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.core.settings.converters import EnumConverter
from indico.modules.designer import PageOrientat... | 39.815789 | 111 | 0.678784 |
4a1611c46c0282f7887721219bbe00dd1f5a8ae5 | 1,935 | py | Python | easyp2p/platforms/peerberry.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/platforms/peerberry.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/platforms/peerberry.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # Copyright (c) 2018-2020 Niko Sandschneider
"""
Download and parse PeerBerry statement.
"""
import json
from easyp2p.p2p_parser import P2PParser
from easyp2p.p2p_session import P2PSession
from easyp2p.platforms.base_platform import BasePlatform
class PeerBerry(BasePlatform):
"""
Contains methods for do... | 30.234375 | 76 | 0.658915 |
4a1612723bb7d4de6bff793a73dc6ca566e54f4b | 6,218 | py | Python | radiomicsfeatureextractionpipeline/backend/test/mock_ups/dal/series_repository.py | Maastro-CDS-Imaging-Group/SQLite4Radiomics | e3a7afc181eec0fe04c18da00edc3772064e6758 | [
"Apache-2.0"
] | null | null | null | radiomicsfeatureextractionpipeline/backend/test/mock_ups/dal/series_repository.py | Maastro-CDS-Imaging-Group/SQLite4Radiomics | e3a7afc181eec0fe04c18da00edc3772064e6758 | [
"Apache-2.0"
] | 6 | 2021-06-09T19:39:27.000Z | 2021-09-30T16:41:40.000Z | radiomicsfeatureextractionpipeline/backend/test/mock_ups/dal/series_repository.py | Maastro-CDS-Imaging-Group/SQLite4Radiomics | e3a7afc181eec0fe04c18da00edc3772064e6758 | [
"Apache-2.0"
] | null | null | null | from typing import List, Any, Dict, Optional
from dal.database_connector import DatabaseConnector
from dal.series_repository import SeriesRepository
from logic.entities.patient import Patient
from logic.entities.series import Series
from logic.entities.study import Study
from test.mock_ups.dal.repository import Reposi... | 45.720588 | 120 | 0.745417 |
4a161286967e230220bc2976dd4eca63d5659bd7 | 289 | py | Python | rethinkdb/helpers.py | MichalMazurek/rethinkdb-python | 28a21960ad5a303e4690c6b3fb3da5b8d6c547ca | [
"Apache-2.0"
] | 1 | 2020-08-01T23:15:00.000Z | 2020-08-01T23:15:00.000Z | rethinkdb/helpers.py | MichalMazurek/rethinkdb-python | 28a21960ad5a303e4690c6b3fb3da5b8d6c547ca | [
"Apache-2.0"
] | null | null | null | rethinkdb/helpers.py | MichalMazurek/rethinkdb-python | 28a21960ad5a303e4690c6b3fb3da5b8d6c547ca | [
"Apache-2.0"
] | null | null | null | import six
def decode_utf8(string, encoding='utf-8'):
if hasattr(string, 'decode'):
return string.decode(encoding)
return string
def chain_to_bytes(*strings):
return b''.join([six.b(string) if isinstance(string, six.string_types) else string for string in strings])
| 26.272727 | 110 | 0.712803 |
4a1612a00115805e1da874f66292cb43007da142 | 7,929 | py | Python | i18n/generate.py | eduNEXT/i18n-tools | 99b20c17d1a0ca07a8839f33e0e9068248a581e5 | [
"Apache-2.0"
] | 1 | 2021-04-01T17:26:41.000Z | 2021-04-01T17:26:41.000Z | i18n/generate.py | eduNEXT/i18n-tools | 99b20c17d1a0ca07a8839f33e0e9068248a581e5 | [
"Apache-2.0"
] | null | null | null | i18n/generate.py | eduNEXT/i18n-tools | 99b20c17d1a0ca07a8839f33e0e9068248a581e5 | [
"Apache-2.0"
] | 1 | 2019-02-03T03:18:21.000Z | 2019-02-03T03:18:21.000Z | #!/usr/bin/env python
"""
See https://edx-wiki.atlassian.net/wiki/display/ENG/PO+File+workflow
This task merges and compiles the human-readable .po files on the
local filesystem into machine-readable .mo files. This is typically
necessary as part of the build process since these .mo files are
needed by Django when se... | 38.678049 | 118 | 0.656829 |
4a1612d2e148834369dfbed64f45d0799d7f7ce3 | 491 | py | Python | gallery/migrations/0001_initial.py | gabyxbinnaeah/Photo-Gallery | 6155df3a70d0955a01e6f2257789076c6a85abf4 | [
"MIT"
] | null | null | null | gallery/migrations/0001_initial.py | gabyxbinnaeah/Photo-Gallery | 6155df3a70d0955a01e6f2257789076c6a85abf4 | [
"MIT"
] | null | null | null | gallery/migrations/0001_initial.py | gabyxbinnaeah/Photo-Gallery | 6155df3a70d0955a01e6f2257789076c6a85abf4 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-04 10:30
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Locations',
fields=[
('id', models.BigAutoF... | 22.318182 | 117 | 0.578411 |
4a1613270b9760a5203acaee92592581a40d8f21 | 7,006 | py | Python | aiida/backends/tests/cmdline/commands/test_database.py | borellim/aiida_core | eebef392c81e8b130834a92e1d7abf5e2e30b3ce | [
"BSD-2-Clause"
] | 1 | 2019-03-15T10:37:53.000Z | 2019-03-15T10:37:53.000Z | aiida/backends/tests/cmdline/commands/test_database.py | odarbelaeze/aiida_core | 934b4ccdc73a993f2a6656caf516500470e3da08 | [
"BSD-2-Clause"
] | null | null | null | aiida/backends/tests/cmdline/commands/test_database.py | odarbelaeze/aiida_core | 934b4ccdc73a993f2a6656caf516500470e3da08 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 46.092105 | 115 | 0.690979 |
4a161330fe015383fbc607159b9aeb5ee0be2b81 | 284 | py | Python | boids/record_fixture.py | ioanadiana/badboids | 3982c722a16dd59298e9374837690b3f2da708ca | [
"MIT"
] | null | null | null | boids/record_fixture.py | ioanadiana/badboids | 3982c722a16dd59298e9374837690b3f2da708ca | [
"MIT"
] | null | null | null | boids/record_fixture.py | ioanadiana/badboids | 3982c722a16dd59298e9374837690b3f2da708ca | [
"MIT"
] | null | null | null | import yaml
import boids
from copy import deepcopy
before=deepcopy(boids.boids)
boids.update_boids(boids.boids)
after=boids.boids
fixture={"before":before,"after":after}
fixture_file=open("fixture_update_position.yml",'w')
fixture_file.write(yaml.dump(fixture))
fixture_file.close()
| 23.666667 | 52 | 0.809859 |
4a161355c96432da19609497891858fded684d17 | 253 | py | Python | gabrieltool/statemachine/predicate_zoo.py | phtruongan/state-machine-editor | f0bbf4260c5821237d253870a9fb07304111f94b | [
"Apache-2.0"
] | null | null | null | gabrieltool/statemachine/predicate_zoo.py | phtruongan/state-machine-editor | f0bbf4260c5821237d253870a9fb07304111f94b | [
"Apache-2.0"
] | null | null | null | gabrieltool/statemachine/predicate_zoo.py | phtruongan/state-machine-editor | f0bbf4260c5821237d253870a9fb07304111f94b | [
"Apache-2.0"
] | 1 | 2019-07-02T12:15:56.000Z | 2019-07-02T12:15:56.000Z | # -*- coding: utf-8 -*-
"""Processing Function on State Machine Inputs.
"""
def has_obj_cls(app_state, cls_name):
return (cls_name in app_state)
def always(app_state):
return True
def tpod_dnn(img, **kwargs):
print('tpod_dnn called!')
| 15.8125 | 47 | 0.675889 |
4a1613998e7c861d69287648fc13969365539cef | 1,237 | py | Python | tests/test_regions.py | i4s-pserrano/python-nomad | 0f8dd9dfa1d448465be490f0acf9f5df96cd893f | [
"MIT"
] | 109 | 2016-06-06T09:18:02.000Z | 2022-03-17T17:41:20.000Z | tests/test_regions.py | i4s-pserrano/python-nomad | 0f8dd9dfa1d448465be490f0acf9f5df96cd893f | [
"MIT"
] | 104 | 2016-06-04T23:06:06.000Z | 2021-12-08T04:49:43.000Z | tests/test_regions.py | i4s-pserrano/python-nomad | 0f8dd9dfa1d448465be490f0acf9f5df96cd893f | [
"MIT"
] | 80 | 2016-06-05T00:33:23.000Z | 2021-11-20T15:17:38.000Z | import pytest
import sys
# integration tests requires nomad Vagrant VM or Binary running
def test_get_regions(nomad_setup):
assert isinstance(nomad_setup.regions.get_regions(), list) == True
def test_dunder_getitem_exist(nomad_setup):
n = nomad_setup.regions["global"]
if int(sys.version[0]) == 3:
... | 22.907407 | 70 | 0.743735 |
4a1613d7fd2c83d5e078983d841accb7c774d6bf | 41,125 | py | Python | backend/venv/lib/python3.9/site-packages/pip/_vendor/distlib/wheel.py | LucaCilibrasi/docker_viruclust | 88149c17fd4b94a54397d0cb4a9daece00122c49 | [
"Apache-2.0"
] | null | null | null | backend/venv/lib/python3.9/site-packages/pip/_vendor/distlib/wheel.py | LucaCilibrasi/docker_viruclust | 88149c17fd4b94a54397d0cb4a9daece00122c49 | [
"Apache-2.0"
] | null | null | null | backend/venv/lib/python3.9/site-packages/pip/_vendor/distlib/wheel.py | LucaCilibrasi/docker_viruclust | 88149c17fd4b94a54397d0cb4a9daece00122c49 | [
"Apache-2.0"
] | 1 | 2022-01-13T10:05:55.000Z | 2022-01-13T10:05:55.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2017 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import base64
import codecs
import datetime
import distutils.util
import hashlib
import imp
impo... | 40.358194 | 101 | 0.50203 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.