hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | 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 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f735d895095411701d85cb27b09f83cd7ccb48b3 | 2,603 | py | Python | python/dask_cudf/setup.py | dominicshanshan/cudf | bfbdcb14164c737820a0a8a6334c92039d5e6621 | [
"Apache-2.0"
] | null | null | null | python/dask_cudf/setup.py | dominicshanshan/cudf | bfbdcb14164c737820a0a8a6334c92039d5e6621 | [
"Apache-2.0"
] | 1 | 2021-03-10T20:28:23.000Z | 2021-03-25T15:58:47.000Z | python/dask_cudf/setup.py | vyasr/cudf | 9617fcd452a66bdeb9c2275216e866b78f997508 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2021, NVIDIA CORPORATION.
import os
import re
import shutil
from setuptools import find_packages, setup
import versioneer
install_requires = [
"cudf",
"dask==2021.4.0",
"distributed>=2.22.0,<=2021.4.0",
"fsspec>=0.6.0",
"numpy",
"pandas>=1.0,<1.3.0dev0",
]
extras_requir... | 26.835052 | 78 | 0.623511 |
import os
import re
import shutil
from setuptools import find_packages, setup
import versioneer
install_requires = [
"cudf",
"dask==2021.4.0",
"distributed>=2.22.0,<=2021.4.0",
"fsspec>=0.6.0",
"numpy",
"pandas>=1.0,<1.3.0dev0",
]
extras_require = {
"test": [
"numpy",
"p... | true | true |
f735d9417c94a77fd8ca0384ef7cbaaf9998e431 | 2,717 | py | Python | venv/Lib/site-packages/nbformat/v4/tests/test_convert.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 603 | 2020-12-23T13:49:32.000Z | 2022-03-31T23:38:03.000Z | venv/Lib/site-packages/nbformat/v4/tests/test_convert.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | venv/Lib/site-packages/nbformat/v4/tests/test_convert.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 35 | 2021-03-26T03:12:04.000Z | 2022-03-23T10:15:10.000Z | # -*- coding: utf-8 -*-
import os
import io
import copy
from unittest import mock
from nbformat import validate
from .. import convert
from ..nbjson import reads
from . import nbexamples
from nbformat.v3.tests import nbexamples as v3examples
from nbformat import v3, v4
def test_upgrade_notebook():
nb03 = copy.de... | 29.532609 | 106 | 0.552448 | import os
import io
import copy
from unittest import mock
from nbformat import validate
from .. import convert
from ..nbjson import reads
from . import nbexamples
from nbformat.v3.tests import nbexamples as v3examples
from nbformat import v3, v4
def test_upgrade_notebook():
nb03 = copy.deepcopy(v3examples.nb0)
... | true | true |
f735d97c51df40ed12b2c8c8b79166d319cf9203 | 4,720 | py | Python | Memory_RNN.py | dhingratul/RNN | 9e1ac582dbf8251769817b34fc9d791fa8c20376 | [
"MIT"
] | null | null | null | Memory_RNN.py | dhingratul/RNN | 9e1ac582dbf8251769817b34fc9d791fa8c20376 | [
"MIT"
] | null | null | null | Memory_RNN.py | dhingratul/RNN | 9e1ac582dbf8251769817b34fc9d791fa8c20376 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 24 11:28:50 2017
@author: dhingratul
"""
from __future__ import print_function, division
import numpy as np
import tensorflow as tf
import helpers
# hyperparams
num_epochs = 10000
total_series_length = 100
truncated_backprop_length = 5
state_size = ... | 37.165354 | 77 | 0.670763 | from __future__ import print_function, division
import numpy as np
import tensorflow as tf
import helpers
num_epochs = 10000
total_series_length = 100
truncated_backprop_length = 5
state_size = 4 num_classes = 2 batch_size = 8
num_batches = total_series_length//batch_size//truncated_backprop_length
shift_batch = 0
... | true | true |
f735d995a995275b81d6509ee58d925327c4d02a | 2,246 | py | Python | fewshot/data/compress_tiered_imagenet.py | ashok-arjun/few-shot-ssl-public | f7577d80b7491e0f27234a2e9c0113782365c2e1 | [
"MIT"
] | 497 | 2018-03-02T00:50:53.000Z | 2022-03-22T06:30:59.000Z | fewshot/data/compress_tiered_imagenet.py | eleniTriantafillou/few-shot-ssl-public | 3cf522031aa40b4ffb61e4693d0b48fdd5669276 | [
"MIT"
] | 20 | 2018-03-19T06:15:30.000Z | 2021-11-20T07:21:38.000Z | fewshot/data/compress_tiered_imagenet.py | eleniTriantafillou/few-shot-ssl-public | 3cf522031aa40b4ffb61e4693d0b48fdd5669276 | [
"MIT"
] | 108 | 2018-03-02T06:56:13.000Z | 2021-12-23T03:40:43.000Z | # Copyright (c) 2018 Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell,
# Kevin Swersky, Joshua B. Tenenbaum, Hugo Larochelle, Richars S. Zemel.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in th... | 36.225806 | 80 | 0.691897 | import cv2
import numpy as np
import six
import sys
import pickle as pkl
from tqdm import tqdm
def compress(path, output):
with np.load(path, mmap_mode="r") as data:
images = data["images"]
array = []
for ii in tqdm(six.moves.xrange(images.shape[0]), desc='compress'):
im = images[ii]
im_str... | true | true |
f735db37f7d3724fd60e352c1e02af97aa1e9569 | 444 | py | Python | tests/transform/preprocessing/test_instance_unit_norm_scaler.py | selimfirat/pysad | dff2ff38258eb8a85c9d34cf5f0b876fc1dc9ede | [
"BSD-3-Clause"
] | 155 | 2020-08-17T12:52:38.000Z | 2022-03-19T02:59:26.000Z | tests/transform/preprocessing/test_instance_unit_norm_scaler.py | shubhsoni/pysad | dff2ff38258eb8a85c9d34cf5f0b876fc1dc9ede | [
"BSD-3-Clause"
] | 2 | 2020-10-22T09:50:28.000Z | 2021-02-15T02:01:44.000Z | tests/transform/preprocessing/test_instance_unit_norm_scaler.py | shubhsoni/pysad | dff2ff38258eb8a85c9d34cf5f0b876fc1dc9ede | [
"BSD-3-Clause"
] | 14 | 2020-10-09T17:08:23.000Z | 2022-03-25T11:30:12.000Z |
def test_instance_unit_norm_scaler():
import numpy as np
from pysad.transform.preprocessing import InstanceUnitNormScaler
X = np.random.rand(100, 25)
scaler = InstanceUnitNormScaler()
scaled_X = scaler.fit_transform(X)
assert np.all(np.isclose(np.linalg.norm(scaled_X, axis=1), 1.0))
sca... | 27.75 | 68 | 0.709459 |
def test_instance_unit_norm_scaler():
import numpy as np
from pysad.transform.preprocessing import InstanceUnitNormScaler
X = np.random.rand(100, 25)
scaler = InstanceUnitNormScaler()
scaled_X = scaler.fit_transform(X)
assert np.all(np.isclose(np.linalg.norm(scaled_X, axis=1), 1.0))
sca... | true | true |
f735dc85333b263fc7bc9284960f4d6199a4a30e | 815 | py | Python | irfca_blog/urls.py | abhishekadhikari23/irfca_blog | 2e14a52857304e17117177f1b1bc6f01c2b8d6e5 | [
"MIT"
] | null | null | null | irfca_blog/urls.py | abhishekadhikari23/irfca_blog | 2e14a52857304e17117177f1b1bc6f01c2b8d6e5 | [
"MIT"
] | null | null | null | irfca_blog/urls.py | abhishekadhikari23/irfca_blog | 2e14a52857304e17117177f1b1bc6f01c2b8d6e5 | [
"MIT"
] | null | null | null | """irfca_blog 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-ba... | 33.958333 | 77 | 0.704294 | from django.contrib import admin
from django.urls import path
from blog import views
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.home, name='home' ),
]
| true | true |
f735ddf7c597a5a4b3a06b755753649d01e3fa15 | 5,892 | py | Python | oteltrace/contrib/django/conf.py | ocelotl/opentelemetry-auto-instr-python-1 | f5c47bd1ee492ffde298794f283031c22891f60b | [
"BSD-3-Clause"
] | 2 | 2020-03-04T17:33:22.000Z | 2021-01-20T14:20:10.000Z | oteltrace/contrib/django/conf.py | ocelotl/opentelemetry-auto-instr-python-1 | f5c47bd1ee492ffde298794f283031c22891f60b | [
"BSD-3-Clause"
] | 4 | 2019-11-25T00:11:16.000Z | 2021-05-13T20:43:50.000Z | oteltrace/contrib/django/conf.py | ocelotl/opentelemetry-auto-instr-python-1 | f5c47bd1ee492ffde298794f283031c22891f60b | [
"BSD-3-Clause"
] | 3 | 2020-02-05T14:54:25.000Z | 2020-03-23T02:51:27.000Z | # Copyright 2019, OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.101124 | 104 | 0.667006 |
from __future__ import unicode_literals
import os
import importlib
from django.conf import settings as django_settings
from ...internal.logger import get_logger
log = get_logger(__name__)
DEFAULTS = {
'AGENT_HOSTNAME': 'localhost',
'AGENT_PORT': 8126,
'AUTO_INSTRUMENT': True,
'INSTRUMENT_CACHE': ... | true | true |
f735e01c64e62313be6f9983c47ef6c910fb9043 | 3,904 | py | Python | app/recipe/views.py | jhgutsol1290/recipe-app-api | 1c2ca015a05b0309f80b074e4df08e5180a1cbe7 | [
"MIT"
] | null | null | null | app/recipe/views.py | jhgutsol1290/recipe-app-api | 1c2ca015a05b0309f80b074e4df08e5180a1cbe7 | [
"MIT"
] | null | null | null | app/recipe/views.py | jhgutsol1290/recipe-app-api | 1c2ca015a05b0309f80b074e4df08e5180a1cbe7 | [
"MIT"
] | null | null | null | from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import viewsets, mixins, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import Tag, Ingredient, Recipe
from recipe... | 33.655172 | 74 | 0.660092 | from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import viewsets, mixins, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import Tag, Ingredient, Recipe
from recipe... | true | true |
f735e065a680a895d5a324a0b9b4e185811f440e | 1,040 | py | Python | test_sample.py | corganhejijun/frontal-trans | 1509babf2447a53a772703b09cb6a2daec6968a7 | [
"MIT"
] | 6 | 2019-10-07T07:34:28.000Z | 2020-11-17T13:04:37.000Z | test_sample.py | corganhejijun/frontal-trans | 1509babf2447a53a772703b09cb6a2daec6968a7 | [
"MIT"
] | 3 | 2019-09-18T09:56:36.000Z | 2020-11-25T09:54:06.000Z | test_sample.py | corganhejijun/frontal-trans | 1509babf2447a53a772703b09cb6a2daec6968a7 | [
"MIT"
] | 3 | 2019-11-01T04:39:07.000Z | 2021-04-21T08:19:19.000Z | # -*- coding: utf-8 -*-
import os
import cv2
from scipy import misc
from PIL import Image
sample_path = 'datasets/celeb_train/lfw_trans'
dest_path = sample_path + "/../dest"
middleSize = 64
imgSize = 256
kernel_size = (5, 5)
sigma = 5
if not os.path.exists(dest_path):
os.mkdir(dest_path)
fileList = os.listdir(s... | 33.548387 | 78 | 0.683654 | import os
import cv2
from scipy import misc
from PIL import Image
sample_path = 'datasets/celeb_train/lfw_trans'
dest_path = sample_path + "/../dest"
middleSize = 64
imgSize = 256
kernel_size = (5, 5)
sigma = 5
if not os.path.exists(dest_path):
os.mkdir(dest_path)
fileList = os.listdir(sample_path)
for index, fi... | true | true |
f735e0b0bfb2b3d775aacd5ba8c56eb9fc4ac69b | 3,506 | py | Python | gmn/src/d1_gmn/app/node_registry.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 15 | 2016-10-28T13:56:52.000Z | 2022-01-31T19:07:49.000Z | gmn/src/d1_gmn/app/node_registry.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 56 | 2017-03-16T03:52:32.000Z | 2022-03-12T01:05:28.000Z | gmn/src/d1_gmn/app/node_registry.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 11 | 2016-05-31T16:22:02.000Z | 2020-10-05T14:37:10.000Z | # This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | 31.303571 | 89 | 0.684541 |
import logging
import d1_common.xml
import d1_client.cnclient
import django.conf
import django.core.cache
log = logging.getLogger(__name__)
def get_cn_subjects():
cn_subjects = django.core.cache.cache.get("cn_subjects")
if cn_subjects is not None:
return cn_subjects
if django.conf.settings.S... | true | true |
f735e13bab66faf531dc0c6b42371e197f6d91a6 | 3,037 | py | Python | freezeyt/cli.py | encukou/freezeyt | f0783bb3e001f181ce33718b0cbd2ddbd0e56af0 | [
"MIT"
] | 7 | 2020-09-23T15:27:09.000Z | 2022-03-20T19:31:41.000Z | freezeyt/cli.py | encukou/freezeyt | f0783bb3e001f181ce33718b0cbd2ddbd0e56af0 | [
"MIT"
] | 160 | 2020-07-06T17:58:35.000Z | 2022-03-30T13:06:07.000Z | freezeyt/cli.py | encukou/freezeyt | f0783bb3e001f181ce33718b0cbd2ddbd0e56af0 | [
"MIT"
] | 10 | 2020-07-06T18:05:10.000Z | 2022-03-12T21:20:11.000Z | import sys
import click
import yaml
from freezeyt.freezer import freeze
from freezeyt.util import import_variable_from_module
@click.command()
@click.argument('module_name')
@click.argument('dest_path', required=False)
@click.option('--prefix',
help='URL where we want to deploy our static site '
... | 31.309278 | 96 | 0.609812 | import sys
import click
import yaml
from freezeyt.freezer import freeze
from freezeyt.util import import_variable_from_module
@click.command()
@click.argument('module_name')
@click.argument('dest_path', required=False)
@click.option('--prefix',
help='URL where we want to deploy our static site '
... | true | true |
f735e15ae6ba7a49fa2a7da756be5fc32bfde867 | 227 | py | Python | learn-to-code-with-python/17-Dictionaries-the-Basics/the-in-and-not-in-operators-on-a-dictionary.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | learn-to-code-with-python/17-Dictionaries-the-Basics/the-in-and-not-in-operators-on-a-dictionary.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | learn-to-code-with-python/17-Dictionaries-the-Basics/the-in-and-not-in-operators-on-a-dictionary.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | pokemon = {
"Fire": ["Charmander", "Charmeleon", "Charizard"],
"Water": ["Squirtle", "Warturtle", "Blastiose"],
"Grass": ["Bulbasaur", "Venusaur", "Ivysaur"]
}
print("Fire" in pokemon)
print("Electric" in pokemon)
| 25.222222 | 54 | 0.61674 | pokemon = {
"Fire": ["Charmander", "Charmeleon", "Charizard"],
"Water": ["Squirtle", "Warturtle", "Blastiose"],
"Grass": ["Bulbasaur", "Venusaur", "Ivysaur"]
}
print("Fire" in pokemon)
print("Electric" in pokemon)
| true | true |
f735e2a9e13dbd62de2c29ea355c89e45b70252a | 2,380 | py | Python | amime/modules/anime/TV-SHOW/KATEGORI/MAHOU SHOUJO/ktgr_action3.py | Myudi422/ccgnime_req | a0f7596ba101204539b4120dffa08912b6560efe | [
"MIT"
] | null | null | null | amime/modules/anime/TV-SHOW/KATEGORI/MAHOU SHOUJO/ktgr_action3.py | Myudi422/ccgnime_req | a0f7596ba101204539b4120dffa08912b6560efe | [
"MIT"
] | null | null | null | amime/modules/anime/TV-SHOW/KATEGORI/MAHOU SHOUJO/ktgr_action3.py | Myudi422/ccgnime_req | a0f7596ba101204539b4120dffa08912b6560efe | [
"MIT"
] | null | null | null | import httpx
from anilist.types import Anime
from pyrogram import filters
from pyrogram.types import CallbackQuery
from pyromod.helpers import ikb
from pyromod.nav import Pagination
from amime.amime import Amime
@Amime.on_callback_query(filters.regex(r"^tv_mahousj3 anime (?P<page>\d+)"))
async def anime_suggestions(... | 32.162162 | 118 | 0.485714 | import httpx
from anilist.types import Anime
from pyrogram import filters
from pyrogram.types import CallbackQuery
from pyromod.helpers import ikb
from pyromod.nav import Pagination
from amime.amime import Amime
@Amime.on_callback_query(filters.regex(r"^tv_mahousj3 anime (?P<page>\d+)"))
async def anime_suggestions(... | true | true |
f735e2aea9b9012219f860b604255299c65e9e32 | 593 | py | Python | test_ucf101.py | mental689/pytorch-c3d | 578bf43a2628decc50fd554437668d5490f6e77d | [
"Apache-2.0"
] | 3 | 2019-03-15T17:42:26.000Z | 2021-11-18T04:17:16.000Z | test_ucf101.py | mental689/pytorch-c3d | 578bf43a2628decc50fd554437668d5490f6e77d | [
"Apache-2.0"
] | null | null | null | test_ucf101.py | mental689/pytorch-c3d | 578bf43a2628decc50fd554437668d5490f6e77d | [
"Apache-2.0"
] | 1 | 2019-03-15T17:42:38.000Z | 2019-03-15T17:42:38.000Z | # coding: utf-8
from network.trainer import *
video_train_list = '/media/tuananhn/903a7d3c-0ce5-444b-ad39-384fcda231ed/UCF101/video-caffe/examples/c3d_ucf101/c3d_ucf101_train_split1.txt'
video_test_list = '/media/tuananhn/903a7d3c-0ce5-444b-ad39-384fcda231ed/UCF101/video-caffe/examples/c3d_ucf101/c3d_ucf101_test_split1... | 65.888889 | 140 | 0.789207 | from network.trainer import *
video_train_list = '/media/tuananhn/903a7d3c-0ce5-444b-ad39-384fcda231ed/UCF101/video-caffe/examples/c3d_ucf101/c3d_ucf101_train_split1.txt'
video_test_list = '/media/tuananhn/903a7d3c-0ce5-444b-ad39-384fcda231ed/UCF101/video-caffe/examples/c3d_ucf101/c3d_ucf101_test_split1.txt'
trainer = ... | true | true |
f735e312a81e88978793ec77d681c3348d55b18e | 14,779 | py | Python | niapy/algorithms/modified/saba.py | altaregos/NiaPy | 74f1b2827778d9086603f4a8cb523f6b5537212a | [
"MIT"
] | 202 | 2018-02-06T12:13:42.000Z | 2022-03-18T16:33:20.000Z | niapy/algorithms/modified/saba.py | altaregos/NiaPy | 74f1b2827778d9086603f4a8cb523f6b5537212a | [
"MIT"
] | 262 | 2018-02-06T14:49:15.000Z | 2022-03-25T19:49:46.000Z | niapy/algorithms/modified/saba.py | altaregos/NiaPy | 74f1b2827778d9086603f4a8cb523f6b5537212a | [
"MIT"
] | 136 | 2018-02-06T16:55:32.000Z | 2022-03-05T17:49:52.000Z | # encoding=utf8
import logging
import numpy as np
from niapy.algorithms.algorithm import Algorithm
logging.basicConfig()
logger = logging.getLogger('niapy.algorithms.modified')
logger.setLevel('INFO')
__all__ = ['AdaptiveBatAlgorithm', 'SelfAdaptiveBatAlgorithm']
class AdaptiveBatAlgorithm(Algorithm):
r"""Imp... | 37.41519 | 145 | 0.619528 | import logging
import numpy as np
from niapy.algorithms.algorithm import Algorithm
logging.basicConfig()
logger = logging.getLogger('niapy.algorithms.modified')
logger.setLevel('INFO')
__all__ = ['AdaptiveBatAlgorithm', 'SelfAdaptiveBatAlgorithm']
class AdaptiveBatAlgorithm(Algorithm):
Name = ['AdaptiveBatAl... | true | true |
f735e42af71bfc4069df8d626b6ce697fcedc245 | 1,726 | py | Python | ml-project/extract_face_yusril.py | YusrilHasanuddin/bangkit-capstone-CAP0166 | 51742f7af47fa285154793a6ea74de1d78d945b3 | [
"MIT"
] | 2 | 2021-07-20T17:31:29.000Z | 2021-12-27T06:42:42.000Z | ml-project/extract_face_yusril.py | YusrilHasanuddin/bangkit-capstone-CAP0166 | 51742f7af47fa285154793a6ea74de1d78d945b3 | [
"MIT"
] | 26 | 2021-05-02T14:05:27.000Z | 2021-06-06T14:22:35.000Z | ml-project/extract_face_yusril.py | YusrilHasanuddin/bangkit-capstone-CAP0166 | 51742f7af47fa285154793a6ea74de1d78d945b3 | [
"MIT"
] | 3 | 2021-05-23T06:13:14.000Z | 2021-06-09T11:04:29.000Z | import sys
import os
import traceback
from PIL import Image
from facenet_pytorch import MTCNN
import matplotlib.image as mpimg
import numpy as np
def detect_faces(image_path):
mtcnn = MTCNN(margin=20, keep_all=True,
post_process=False, device='cuda:0')
image = image_path
image = mpimg.im... | 31.962963 | 74 | 0.584009 | import sys
import os
import traceback
from PIL import Image
from facenet_pytorch import MTCNN
import matplotlib.image as mpimg
import numpy as np
def detect_faces(image_path):
mtcnn = MTCNN(margin=20, keep_all=True,
post_process=False, device='cuda:0')
image = image_path
image = mpimg.im... | true | true |
f735e441dcf5ae886a87accea2eb267ceb2901ee | 358 | py | Python | nms_stack/nms_cli/nms_stack/roles/ansible-role-glusterfs/molecule/default/tests/test_default.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 12 | 2021-04-06T06:27:18.000Z | 2022-03-18T10:52:29.000Z | nms_stack/nms_cli/nms_stack/roles/ansible-role-glusterfs/molecule/default/tests/test_default.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 6 | 2022-01-04T13:32:16.000Z | 2022-03-28T21:13:59.000Z | nms_stack/nms_cli/nms_stack/roles/ansible-role-glusterfs/molecule/default/tests/test_default.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 7 | 2021-09-27T13:14:42.000Z | 2022-03-28T16:24:15.000Z | # Copyright (c) 2014-present, Facebook, Inc.
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_hosts_file(host):
f = host.file('/etc/hosts')
assert f.exists
assert f.user =... | 22.375 | 63 | 0.717877 | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_hosts_file(host):
f = host.file('/etc/hosts')
assert f.exists
assert f.user == 'root'
assert f.group == 'root'
| true | true |
f735e520bdc3adc6f904a5797629bf0a08ce182c | 1,653 | py | Python | homeassistant/components/asuswrt/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2020-11-27T06:26:27.000Z | 2020-12-09T14:55:16.000Z | homeassistant/components/asuswrt/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 25 | 2021-11-24T06:24:10.000Z | 2022-03-31T06:23:06.000Z | homeassistant/components/asuswrt/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2022-01-02T18:49:54.000Z | 2022-01-25T02:03:54.000Z | """Support for ASUSWRT devices."""
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, Platform
from homeassistant.core import HomeAssistant
from .const import DATA_ASUSWRT, DOMAIN
from .router import AsusWrtRouter
PLATFORMS = [Platform.DEVICE_TRACKER, Platf... | 31.788462 | 87 | 0.745312 |
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, Platform
from homeassistant.core import HomeAssistant
from .const import DATA_ASUSWRT, DOMAIN
from .router import AsusWrtRouter
PLATFORMS = [Platform.DEVICE_TRACKER, Platform.SENSOR]
async def async_setup... | true | true |
f735e533e4d7419d51f09dc7c83e8618f578b234 | 6,225 | py | Python | isimip_publisher/tests/test_commands.py | ISI-MIP/isimip-publisher | d54f7325931df91c98e40c924eac085351fc5813 | [
"MIT"
] | null | null | null | isimip_publisher/tests/test_commands.py | ISI-MIP/isimip-publisher | d54f7325931df91c98e40c924eac085351fc5813 | [
"MIT"
] | 44 | 2019-12-04T10:47:13.000Z | 2021-03-29T16:43:06.000Z | isimip_publisher/tests/test_commands.py | ISI-MIP/isimip-publisher | d54f7325931df91c98e40c924eac085351fc5813 | [
"MIT"
] | 1 | 2019-12-04T09:09:26.000Z | 2019-12-04T09:09:26.000Z | import os
import shutil
from pathlib import Path
import pytest
from dotenv import load_dotenv
from isimip_publisher.utils.database import (Dataset, Resource,
init_database_session)
@pytest.fixture(scope='session')
def setup():
load_dotenv(Path().cwd() / '.env')
... | 35.571429 | 130 | 0.744418 | import os
import shutil
from pathlib import Path
import pytest
from dotenv import load_dotenv
from isimip_publisher.utils.database import (Dataset, Resource,
init_database_session)
@pytest.fixture(scope='session')
def setup():
load_dotenv(Path().cwd() / '.env')
... | true | true |
f735e5b4e2f72c64bab1404d35d76c84bea5704e | 1,404 | py | Python | pyweb/cli.py | gera2ld/pyhttpd | c7bbfd8ba22f09da1200a4d570ce128d83e5f82c | [
"MIT"
] | 2 | 2015-08-25T10:30:25.000Z | 2017-05-01T10:12:59.000Z | pyweb/cli.py | gera2ld/pyweb | c7bbfd8ba22f09da1200a4d570ce128d83e5f82c | [
"MIT"
] | null | null | null | pyweb/cli.py | gera2ld/pyweb | c7bbfd8ba22f09da1200a4d570ce128d83e5f82c | [
"MIT"
] | 1 | 2015-05-07T01:41:00.000Z | 2015-05-07T01:41:00.000Z | # -*- coding: utf-8 -*-
"""Console script for pyweb."""
import os
import sys
import platform
import click
from . import __version__
from .server import HTTPDaemon
from .utils import logger
@click.command()
@click.option('-b', '--bind', default=':4000', help='the address to bind, default as `:4000`')
@click.option('-r... | 25.527273 | 94 | 0.458689 |
import os
import sys
import platform
import click
from . import __version__
from .server import HTTPDaemon
from .utils import logger
@click.command()
@click.option('-b', '--bind', default=':4000', help='the address to bind, default as `:4000`')
@click.option('-r', '--root', default='.', help='the root directory of do... | true | true |
f735e5ce1ca1a10327b8aa4b68252afb05835453 | 34,509 | py | Python | pelicun/model.py | 13273781142/pelicun1 | 1177f069a083a25eb53ae7a9ddfa6c814660a423 | [
"BSD-3-Clause"
] | 20 | 2019-03-01T21:51:15.000Z | 2022-02-25T11:51:13.000Z | pelicun/model.py | 13273781142/pelicun1 | 1177f069a083a25eb53ae7a9ddfa6c814660a423 | [
"BSD-3-Clause"
] | 7 | 2018-12-04T18:55:39.000Z | 2021-09-26T00:20:34.000Z | pelicun/model.py | 13273781142/pelicun1 | 1177f069a083a25eb53ae7a9ddfa6c814660a423 | [
"BSD-3-Clause"
] | 14 | 2018-10-26T21:48:44.000Z | 2022-02-28T01:53:40.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Leland Stanford Junior University
# Copyright (c) 2018 The Regents of the University of California
#
# This file is part of pelicun.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | 40.598824 | 86 | 0.663131 |
from .base import *
class FragilityFunction(object):
def __init__(self, EDP_limit):
self._EDP_limit = EDP_limit
self._EDP_tags = [EDP_lim_i.name for EDP_lim_i in EDP_limit]
def P_exc(self, EDP, DSG_ID):
EDP = np.asarray(EDP, dtype=np.float64)
nvals = EDP.size
... | true | true |
f735e7a4939d5cc1f3c6d92e39265e3f54d99be0 | 2,093 | py | Python | old_game/spells/base.py | jwvhewitt/dmeternal | bb09f2d497daf9b40dd8cfee10c55be55fb7c3cb | [
"Apache-2.0"
] | 53 | 2015-07-03T21:25:36.000Z | 2022-02-18T23:08:38.000Z | old_game/spells/base.py | jwvhewitt/dmeternal | bb09f2d497daf9b40dd8cfee10c55be55fb7c3cb | [
"Apache-2.0"
] | 5 | 2015-07-03T21:27:12.000Z | 2016-12-08T14:40:38.000Z | old_game/spells/base.py | jwvhewitt/dmeternal | bb09f2d497daf9b40dd8cfee10c55be55fb7c3cb | [
"Apache-2.0"
] | 14 | 2016-02-02T06:49:51.000Z | 2022-02-24T13:24:35.000Z | from .. import invocations
# Enumerate some constants for the six spell colors.
SOLAR, EARTH, WATER, FIRE, AIR, LUNAR = list(range( 6))
class Spell( invocations.Invocation ):
def __init__( self, name, desc, fx, rank=1, gems=dict(), mpfudge=0, com_tar=None, exp_tar=None, ai_tar=None, shot_anim=None ):
self... | 36.086207 | 134 | 0.557573 | from .. import invocations
SOLAR, EARTH, WATER, FIRE, AIR, LUNAR = list(range( 6))
class Spell( invocations.Invocation ):
def __init__( self, name, desc, fx, rank=1, gems=dict(), mpfudge=0, com_tar=None, exp_tar=None, ai_tar=None, shot_anim=None ):
self.name=name
self.desc = desc
self.fx =... | true | true |
f735e7b770f1da0d8886b0e78f5cda6a16931206 | 24,389 | py | Python | release/scripts/startup/bl_ui/space_topbar.py | vlobanov/blender | 5c58740a08ef369435b48093b91fa7075fef8383 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/startup/bl_ui/space_topbar.py | vlobanov/blender | 5c58740a08ef369435b48093b91fa7075fef8383 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/startup/bl_ui/space_topbar.py | vlobanov/blender | 5c58740a08ef369435b48093b91fa7075fef8383 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2019-09-13T15:29:14.000Z | 2019-09-13T15:29:14.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 30.334577 | 104 | 0.613801 |
import bpy
from bpy.types import Header, Menu, Panel
class TOPBAR_HT_upper_bar(Header):
bl_space_type = 'TOPBAR'
def draw(self, context):
region = context.region
if region.alignment == 'RIGHT':
self.draw_right(context)
else:
self.draw_left(context)
def d... | true | true |
f735e8029c232fc98daab344aa931b6c8667ee1a | 5,397 | py | Python | example_unity_socket.py | sailab-code/SAILenv | e202be04de468a58e58ae858693245f5556c3597 | [
"MIT"
] | null | null | null | example_unity_socket.py | sailab-code/SAILenv | e202be04de468a58e58ae858693245f5556c3597 | [
"MIT"
] | 1 | 2021-02-25T16:47:39.000Z | 2021-04-22T08:08:53.000Z | example_unity_socket.py | sailab-code/SAILenv | e202be04de468a58e58ae858693245f5556c3597 | [
"MIT"
] | 2 | 2021-05-01T12:42:53.000Z | 2021-07-10T06:46:44.000Z | #
# Copyright (C) 2020 Enrico Meloni, Luca Pasqualini, Matteo Tiezzi
# University of Siena - Artificial Intelligence Laboratory - SAILab
#
#
# SAILenv is licensed under a MIT license.
#
# You should have received a copy of the license along with this
# work. If not, see <https://en.wikipedia.org/wiki/MIT_License>.
# ... | 32.512048 | 106 | 0.576987 |
import time
import numpy as np
import cv2
import tkinter as tk
from PIL import Image, ImageTk
from sailenv.agent import Agent
frames: int = 1000
def decode_image(array: np.ndarray):
image = cv2.cvtColor(array, cv2.COLOR_RGB2BGR)
return image
def draw_flow_lines(current_frame, optical_flow, line_step=1... | true | true |
f735e9ed972bd701f8c000f77a88cedb63fe8f5b | 14,425 | py | Python | src/AzureFunctions/ComputeGradient/AzureUtilities.py | georgeAccnt-GH/Azure2019 | 5c9774b644d3ea15590d72d3de9363df72abf7ab | [
"MIT"
] | 2 | 2020-09-18T09:18:06.000Z | 2021-01-10T05:26:53.000Z | src/AzureFunctions/ComputeGradient/AzureUtilities.py | georgeAccnt-GH/Azure2019 | 5c9774b644d3ea15590d72d3de9363df72abf7ab | [
"MIT"
] | 1 | 2021-04-16T06:21:14.000Z | 2021-04-16T16:29:43.000Z | src/AzureFunctions/ComputeGradient/AzureUtilities.py | georgeAccnt-GH/Azure2019 | 5c9774b644d3ea15590d72d3de9363df72abf7ab | [
"MIT"
] | 1 | 2020-01-23T21:45:49.000Z | 2020-01-23T21:45:49.000Z | import numpy as np
import segyio
import subprocess
import os, h5py
from scipy import interpolate
from devito import Eq, Operator
from azure.storage.blob import BlockBlobService, PublicAccess
blob_service = BlockBlobService(account_name='', account_key='')
##############################################################... | 33.941176 | 164 | 0.590017 | import numpy as np
import segyio
import subprocess
import os, h5py
from scipy import interpolate
from devito import Eq, Operator
from azure.storage.blob import BlockBlobService, PublicAccess
blob_service = BlockBlobService(account_name='', account_key='')
def convert_to_string(t):
if len(t) == 1:
return ... | true | true |
f735ea24e6fd85bb1e3da23800a0230330cffa36 | 419 | py | Python | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/install/cmd/shutdown/tasking_dsz.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 9 | 2019-11-22T04:58:40.000Z | 2022-02-26T16:47:28.000Z | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/install/cmd/shutdown/tasking_dsz.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | null | null | null | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/install/cmd/shutdown/tasking_dsz.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 8 | 2017-09-27T10:31:18.000Z | 2022-01-08T10:30:46.000Z | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: tasking_dsz.py
import mcl.framework
import mcl.tasking
class dsz:
INTERFACE = 16842801
PFAM = 4159
PROVIDER_ANY = 4159
PROVIDER = 16... | 29.928571 | 92 | 0.720764 | import mcl.framework
import mcl.tasking
class dsz:
INTERFACE = 16842801
PFAM = 4159
PROVIDER_ANY = 4159
PROVIDER = 16846911
RPC_INFO_SHUTDOWN = mcl.tasking.RpcInfo(mcl.framework.DSZ, [INTERFACE, PROVIDER_ANY, 0]) | true | true |
f735ea3e98c2932b4eebe3ab870b9d47c441fccc | 1,673 | py | Python | src/test/testcases/testIstepInvalid.py | madscientist159/sbe | 63aa1d2be90d345001937953370c3f4e1536e513 | [
"Apache-2.0"
] | null | null | null | src/test/testcases/testIstepInvalid.py | madscientist159/sbe | 63aa1d2be90d345001937953370c3f4e1536e513 | [
"Apache-2.0"
] | null | null | null | src/test/testcases/testIstepInvalid.py | madscientist159/sbe | 63aa1d2be90d345001937953370c3f4e1536e513 | [
"Apache-2.0"
] | null | null | null | # IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/test/testcases/testIstepInvalid.py $
#
# OpenPOWER sbe Project
#
# Contributors Listed Below - COPYRIGHT 2015,2016
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ... | 27.883333 | 69 | 0.641363 | import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
err = False
TESTDATA = [0,0,0,3,
0,0,0xA1,0x01,
0,0x02,0x00,0x1]
EXPDATA = [0xc0,0xde,0xa1,0x01,
0x00,0x02,0x00,0x0A,
0x00,0x0,0x0,0x03];
def main( ):
testUtil.runCycles( 10000000 )
testUtil... | true | true |
f735ebe8c181c4ca65d623419c429c65ce0e1e7a | 1,160 | py | Python | users/tests/test_forms.py | EaguaireSama/CodePanda | ebc7ca9246df6463430f04d4b08124ef2ba2c3f6 | [
"MIT"
] | 1 | 2021-04-17T18:32:51.000Z | 2021-04-17T18:32:51.000Z | users/tests/test_forms.py | EaguaireSama/CodePanda | ebc7ca9246df6463430f04d4b08124ef2ba2c3f6 | [
"MIT"
] | null | null | null | users/tests/test_forms.py | EaguaireSama/CodePanda | ebc7ca9246df6463430f04d4b08124ef2ba2c3f6 | [
"MIT"
] | 3 | 2021-04-10T15:20:46.000Z | 2021-04-11T12:04:57.000Z | from django.test import TestCase
from django.contrib.auth.models import User
from users.forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
class TestForms(TestCase):
def test_user_register_form_valid(self):
form = UserRegisterForm(
data = {
'username' :"user2",
'email' : "user2@email.com",
... | 21.481481 | 76 | 0.672414 | from django.test import TestCase
from django.contrib.auth.models import User
from users.forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
class TestForms(TestCase):
def test_user_register_form_valid(self):
form = UserRegisterForm(
data = {
'username' :"user2",
'email' : "user2@email.com",
... | true | true |
f735ec17ddf645bf613f2789c946c6c81183fceb | 1,696 | py | Python | payment/views.py | caioaraujo/bakery_payments_api_v2 | ade365bd2aa9561182be982286caa72923f36e13 | [
"MIT"
] | 4 | 2019-06-01T23:51:20.000Z | 2021-02-24T11:23:31.000Z | payment/views.py | caioaraujo/bakery_payments_api_v2 | ade365bd2aa9561182be982286caa72923f36e13 | [
"MIT"
] | 8 | 2020-06-13T23:10:46.000Z | 2022-02-28T13:58:02.000Z | payment/views.py | caioaraujo/bakery_payments_api_v2 | ade365bd2aa9561182be982286caa72923f36e13 | [
"MIT"
] | 1 | 2022-03-22T04:54:35.000Z | 2022-03-22T04:54:35.000Z | from django.utils.translation import ugettext as _
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from .serializers import PaymentInputSerializer, PaymentPatchSerializer, PaymentResponseSerializer
from .services import PaymentService
class PaymentView(GenericAPIView):... | 30.836364 | 98 | 0.668632 | from django.utils.translation import ugettext as _
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from .serializers import PaymentInputSerializer, PaymentPatchSerializer, PaymentResponseSerializer
from .services import PaymentService
class PaymentView(GenericAPIView):... | true | true |
f735ec7fb88fb24ceaca3d1817d3585bcfaba514 | 10,306 | py | Python | CBGM/mpisupport.py | catsmith/CBGM | 4fb85c6a0c67b6d790c94aa8d17284b66fc6206a | [
"MIT"
] | 8 | 2019-11-12T14:06:18.000Z | 2021-10-31T03:10:36.000Z | CBGM/mpisupport.py | catsmith/CBGM | 4fb85c6a0c67b6d790c94aa8d17284b66fc6206a | [
"MIT"
] | 1 | 2018-11-27T18:04:27.000Z | 2018-11-27T18:08:27.000Z | CBGM/mpisupport.py | catsmith/CBGM | 4fb85c6a0c67b6d790c94aa8d17284b66fc6206a | [
"MIT"
] | 2 | 2020-01-06T12:04:27.000Z | 2021-07-14T17:03:13.000Z | """
OpenMPI support wrapper
"""
import threading
import queue
import logging
import time
import resource
logger = logging.getLogger()
try:
from mpi4py import MPI
except ImportError:
logger.warning("MPI support unavailable")
def is_parent():
return MPI.COMM_WORLD.Get_rank() == 0
CHILD_RETRY_HELLO = 6... | 33.570033 | 160 | 0.555016 |
import threading
import queue
import logging
import time
import resource
logger = logging.getLogger()
try:
from mpi4py import MPI
except ImportError:
logger.warning("MPI support unavailable")
def is_parent():
return MPI.COMM_WORLD.Get_rank() == 0
CHILD_RETRY_HELLO = 60
class MpiParent(object):
... | true | true |
f735ecc745344aa1dc9776c189e320d619c7fee5 | 8,205 | py | Python | sphinx/source/conf.py | menefotto/Kats | 3fc8a3f819502d45736734eabb3601f42a6b7759 | [
"MIT"
] | 1 | 2021-06-22T03:40:33.000Z | 2021-06-22T03:40:33.000Z | sphinx/source/conf.py | menefotto/Kats | 3fc8a3f819502d45736734eabb3601f42a6b7759 | [
"MIT"
] | null | null | null | sphinx/source/conf.py | menefotto/Kats | 3fc8a3f819502d45736734eabb3601f42a6b7759 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# fmt: off
#
# Kats documentation build configuration file.
#
# 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
# auto... | 32.30315 | 79 | 0.709324 |
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "... | true | true |
f735eda6a7910c11a095f6cddcd4998435bc09a3 | 5,473 | py | Python | docs/conf.py | webbhuset/pipeline | 5e838c9a1b25f4dd72060202b7730ae3c71ea024 | [
"MIT"
] | null | null | null | docs/conf.py | webbhuset/pipeline | 5e838c9a1b25f4dd72060202b7730ae3c71ea024 | [
"MIT"
] | null | null | null | docs/conf.py | webbhuset/pipeline | 5e838c9a1b25f4dd72060202b7730ae3c71ea024 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 29.583784 | 79 | 0.661612 |
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
project = u'Pipeline'
copyright = u'2018, Webbhuset AB'
author = u'Webbhuset AB'
version = u''
release = u''
extensions = [
]
templates_path = ['_templates']
source_suffix = ['.rst']
master_doc = 'index'
language = None
excl... | true | true |
f735ee0c9e1e28a8ec6d114097af7d6120e0d6fe | 1,839 | py | Python | game_data.py | EthanRiley/Arkon | fe1dff2bdc8e783aae6d6b9ed975f792ab8f926a | [
"MIT"
] | 3 | 2016-03-11T19:17:17.000Z | 2016-03-12T13:49:01.000Z | game_data.py | EthanRiley/Arkon | fe1dff2bdc8e783aae6d6b9ed975f792ab8f926a | [
"MIT"
] | null | null | null | game_data.py | EthanRiley/Arkon | fe1dff2bdc8e783aae6d6b9ed975f792ab8f926a | [
"MIT"
] | null | null | null | import pygame, os, re, pygame.freetype
from pygame.locals import *
pygame.init()
class resource_handler(object):
def get_data_from_folder(self, data_dir, extension, iterfunc):
data = []
for file in os.listdir(data_dir):
if extension in file:
data.append({ 'name': file,... | 27.863636 | 79 | 0.612289 | import pygame, os, re, pygame.freetype
from pygame.locals import *
pygame.init()
class resource_handler(object):
def get_data_from_folder(self, data_dir, extension, iterfunc):
data = []
for file in os.listdir(data_dir):
if extension in file:
data.append({ 'name': file,... | true | true |
f735eecbca65eada9d6d39cba7d9783bdfd16701 | 2,886 | py | Python | plugins/modules/memsource_project.py | rooftopcellist/ansible-collection-memsource | e9b506e0da091461baac531e0921815369dfca29 | [
"Apache-2.0"
] | null | null | null | plugins/modules/memsource_project.py | rooftopcellist/ansible-collection-memsource | e9b506e0da091461baac531e0921815369dfca29 | [
"Apache-2.0"
] | null | null | null | plugins/modules/memsource_project.py | rooftopcellist/ansible-collection-memsource | e9b506e0da091461baac531e0921815369dfca29 | [
"Apache-2.0"
] | 1 | 2021-10-05T23:27:10.000Z | 2021-10-05T23:27:10.000Z | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
module: memsource_project
short_description: Manage a Memsource project
version_added: 0.0.1
description:
- Manage a Memsource project
author: 'Yanis Guenane (@Spredzy)'
options:
ui... | 23.655738 | 85 | 0.651421 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
module: memsource_project
short_description: Manage a Memsource project
version_added: 0.0.1
description:
- Manage a Memsource project
author: 'Yanis Guenane (@Spredzy)'
options:
uid:
description:
... | true | true |
f735ef00c592ff18ce03fb7b24d9baccd2ae3d16 | 389 | py | Python | bardo2/wsgi.py | Manzanero/bardo2-web | cfacb9ec321030ce0cafb62a1a7bcdb28726a99c | [
"MIT"
] | null | null | null | bardo2/wsgi.py | Manzanero/bardo2-web | cfacb9ec321030ce0cafb62a1a7bcdb28726a99c | [
"MIT"
] | null | null | null | bardo2/wsgi.py | Manzanero/bardo2-web | cfacb9ec321030ce0cafb62a1a7bcdb28726a99c | [
"MIT"
] | null | null | null | """
WSGI config for bardo2 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bardo2.settings')
application = get_wsgi_application()
| true | true |
f735ef49a6a7ff21aed43a74d854d9b11e62da8b | 2,537 | py | Python | treat.py | TwinIsland/img2java | 6b6788daa0a97acb1e455ead9d7bd09d7d881ab2 | [
"MIT"
] | null | null | null | treat.py | TwinIsland/img2java | 6b6788daa0a97acb1e455ead9d7bd09d7d881ab2 | [
"MIT"
] | null | null | null | treat.py | TwinIsland/img2java | 6b6788daa0a97acb1e455ead9d7bd09d7d881ab2 | [
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
import numpy as np
import cv2
from scipy import stats
import translate
from skimage import transform
#####################################
imgData = cv2.imread('van.jpg',0)
compressRate = 0.4
#####################################
imgData = np.array(imgData)
shape = imgData.shape
p... | 25.626263 | 95 | 0.589279 | from matplotlib import pyplot as plt
import numpy as np
import cv2
from scipy import stats
import translate
from skimage import transform
imgData = cv2.imread('van.jpg',0)
compressRate = 0.4
imgData = np.array(imgData)
shape = imgData.shape
pas = p = 'unknown'
def twoWayTreat():
global imgData
imgData = stat... | true | true |
f735ef8bb7eef76ac42f0236481b16ad8040fb74 | 1,811 | py | Python | tests/test_locate_trace.py | hover2pi/hotsoss | 82d8316d97096416d7f175516a80953e99fb6f44 | [
"MIT"
] | 2 | 2019-12-06T17:40:30.000Z | 2020-06-25T09:04:04.000Z | tests/test_locate_trace.py | hover2pi/hotsoss | 82d8316d97096416d7f175516a80953e99fb6f44 | [
"MIT"
] | 2 | 2021-11-15T17:49:23.000Z | 2022-02-08T17:15:09.000Z | tests/test_locate_trace.py | hover2pi/hotsoss | 82d8316d97096416d7f175516a80953e99fb6f44 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `locate_trace` module."""
import unittest
import numpy as np
from hotsoss import locate_trace as lt
def test_simulate_frame():
"""Test the simulate_frame function"""
# CLEAR and plot test
assert lt.simulate_frame(plot=True).shape == (256, 2048... | 24.472973 | 76 | 0.677526 |
import unittest
import numpy as np
from hotsoss import locate_trace as lt
def test_simulate_frame():
assert lt.simulate_frame(plot=True).shape == (256, 2048)
assert lt.simulate_frame(filt='F277W').shape == (256, 2048)
def test_isolate_signal():
frame = lt.simulate_frame()
asser... | true | true |
f735efd81dd59271b71383463bdf088ddbe47517 | 1,656 | py | Python | userbot/plugins/confuse.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/confuse.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/confuse.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | """Emoji
Available Commands:
.adi"""
import asyncio
from telethon import events
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.3
animation_ttl = range(0, 15)
input_str = event.pattern_match.group(1)
... | 33.12 | 93 | 0.278986 |
import asyncio
from telethon import events
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.3
animation_ttl = range(0, 15)
input_str = event.pattern_match.group(1)
if input_str == "adi":
awai... | true | true |
f735f1cc42cde14539830514433b678241a88a6b | 1,357 | py | Python | tests/cloudformation/checks/resource/aws/test_RDSMultiAZEnabled.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 4,013 | 2019-12-09T13:16:54.000Z | 2022-03-31T14:31:01.000Z | tests/cloudformation/checks/resource/aws/test_RDSMultiAZEnabled.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 1,258 | 2019-12-17T09:55:51.000Z | 2022-03-31T19:17:17.000Z | tests/cloudformation/checks/resource/aws/test_RDSMultiAZEnabled.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 638 | 2019-12-19T08:57:38.000Z | 2022-03-30T21:38:37.000Z | import os
import unittest
from checkov.cloudformation.checks.resource.aws.RDSMultiAZEnabled import check
from checkov.cloudformation.runner import Runner
from checkov.runner_filter import RunnerFilter
class TestRDSMultiAZEnabled(unittest.TestCase):
def test_summary(self):
runner = Runner()
curre... | 33.097561 | 102 | 0.696389 | import os
import unittest
from checkov.cloudformation.checks.resource.aws.RDSMultiAZEnabled import check
from checkov.cloudformation.runner import Runner
from checkov.runner_filter import RunnerFilter
class TestRDSMultiAZEnabled(unittest.TestCase):
def test_summary(self):
runner = Runner()
curre... | true | true |
f735f341c87bd4f4fdcc65b249d937ef404bd09f | 56,071 | py | Python | www/tests/issues.py | alan0526/brython | 440571d5e124b85ad2822ca84dd12e46fd3e1737 | [
"BSD-3-Clause"
] | 1 | 2022-02-15T09:11:51.000Z | 2022-02-15T09:11:51.000Z | www/tests/issues.py | alan0526/brython | 440571d5e124b85ad2822ca84dd12e46fd3e1737 | [
"BSD-3-Clause"
] | null | null | null | www/tests/issues.py | alan0526/brython | 440571d5e124b85ad2822ca84dd12e46fd3e1737 | [
"BSD-3-Clause"
] | 1 | 2022-02-27T17:45:52.000Z | 2022-02-27T17:45:52.000Z | from tester import assertRaises
# issue 5
assert(isinstance(__debug__, bool))
# issue #6 : unknown encoding: windows-1250
s = "Dziś jeść ryby"
b = s.encode('windows-1250')
assert b == b'Dzi\x9c je\x9c\xe6 ryby'
assert b.decode('windows-1250') == "Dziś jeść ryby"
# issue #7 : attribute set on module is not available ... | 18.389964 | 115 | 0.57709 | from tester import assertRaises
assert(isinstance(__debug__, bool))
s = "Dziś jeść ryby"
b = s.encode('windows-1250')
assert b == b'Dzi\x9c je\x9c\xe6 ryby'
assert b.decode('windows-1250') == "Dziś jeść ryby"
import inject_name_in_module
inject_name_in_module.xxx = 123
assert inject_name_in_module.xxx == 123
class ... | true | true |
f735f3e677422c352df9ec6eb83935b0d6721318 | 61 | py | Python | pyranet/__init__.py | accasio/3DPyraNet | 19f8d453ac5d089b5c5514ea744d895e6f8aee14 | [
"MIT"
] | null | null | null | pyranet/__init__.py | accasio/3DPyraNet | 19f8d453ac5d089b5c5514ea744d895e6f8aee14 | [
"MIT"
] | null | null | null | pyranet/__init__.py | accasio/3DPyraNet | 19f8d453ac5d089b5c5514ea744d895e6f8aee14 | [
"MIT"
] | 3 | 2019-09-11T10:01:29.000Z | 2019-10-04T09:12:17.000Z | from . import layers
from . import models
from . import keras | 20.333333 | 20 | 0.770492 | from . import layers
from . import models
from . import keras | true | true |
f735f482decbd6a9a885af3d4a25a4218a16a2f5 | 3,167 | py | Python | aps/util/edit_region_mask.py | kmunve/APS | 4c2f254ede83a3a311cbedc90c76db9ee367a000 | [
"MIT"
] | null | null | null | aps/util/edit_region_mask.py | kmunve/APS | 4c2f254ede83a3a311cbedc90c76db9ee367a000 | [
"MIT"
] | 1 | 2018-12-14T14:47:13.000Z | 2018-12-14T14:47:13.000Z | aps/util/edit_region_mask.py | kmunve/APS | 4c2f254ede83a3a311cbedc90c76db9ee367a000 | [
"MIT"
] | null | null | null | from pathlib import Path
import os
import numpy as np
import netCDF4
import matplotlib.pyplot as plt
from aps.util.nc_index_by_coordinate import tunnel_fast
# Creates the mask over the small regions of 20x20 km size
def create_small_regions_mask():
p = Path(os.path.dirname(os.path.abspath(__file__))).parent
nc... | 33.691489 | 122 | 0.663088 | from pathlib import Path
import os
import numpy as np
import netCDF4
import matplotlib.pyplot as plt
from aps.util.nc_index_by_coordinate import tunnel_fast
def create_small_regions_mask():
p = Path(os.path.dirname(os.path.abspath(__file__))).parent
nc_file = p / 'data' / 'terrain_parameters' / 'VarslingsOmr_2... | true | true |
f735f5f927d84cdc60937cb689e5e363a0be9c54 | 505 | py | Python | sqrtrading/wsgi.py | alexbid/sqrtrading | 1dadf3e42e9b747134861572b44f81cb8222c2f2 | [
"MIT"
] | null | null | null | sqrtrading/wsgi.py | alexbid/sqrtrading | 1dadf3e42e9b747134861572b44f81cb8222c2f2 | [
"MIT"
] | null | null | null | sqrtrading/wsgi.py | alexbid/sqrtrading | 1dadf3e42e9b747134861572b44f81cb8222c2f2 | [
"MIT"
] | null | null | null | """
WSGI config for sqrtrading project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
import sys
addPath = os.path.realpath(__file__).replace('sqrtrading/wsgi.py','')
s... | 24.047619 | 78 | 0.782178 |
import os
import sys
addPath = os.path.realpath(__file__).replace('sqrtrading/wsgi.py','')
sys.path.append(addPath)
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sqrtrading.settings")
application = get_wsgi_application()
| true | true |
f735f5fbd64d2154b36d035f777107f689429cdb | 611 | py | Python | test/python/LIM2Metrics/py3/base/common/Prototype/Prototype.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 20 | 2015-06-16T17:39:10.000Z | 2022-03-20T22:39:40.000Z | test/python/LIM2Metrics/py3/base/common/Prototype/Prototype.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 29 | 2015-12-29T19:07:22.000Z | 2022-03-22T10:39:02.000Z | test/python/LIM2Metrics/py3/base/common/Prototype/Prototype.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 12 | 2015-08-28T01:22:18.000Z | 2021-09-25T08:17:31.000Z | import copy
#
# Prototype Class
#
class Cookie:
def __init__(self, name):
self.name = name
def clone(self):
return copy.deepcopy(self)
#
# Concrete Prototypes to clone
#
class CoconutCookie(Cookie):
def __init__(self):
Cookie.__init__(self, 'Coconut')
#
# Client Class
#
class... | 16.972222 | 40 | 0.630115 | import copy
class Cookie:
def __init__(self, name):
self.name = name
def clone(self):
return copy.deepcopy(self)
class CoconutCookie(Cookie):
def __init__(self):
Cookie.__init__(self, 'Coconut')
class CookieMachine:
def __init__(self, cookie):
self.cookie = cookie... | true | true |
f735f6a1ba518112d8f3c4b8d18cb45e36f1179b | 8,475 | py | Python | .ci/ci_lib.py | ossys/mitogen | 8654af738b007fc659a77fe88c7da8cb0b5d51cd | [
"BSD-3-Clause"
] | null | null | null | .ci/ci_lib.py | ossys/mitogen | 8654af738b007fc659a77fe88c7da8cb0b5d51cd | [
"BSD-3-Clause"
] | 3 | 2021-03-26T00:43:30.000Z | 2022-03-29T22:03:58.000Z | deploy/mitogen/.ci/ci_lib.py | voloshanenko/smsgateway | a1509c7b98d844bc483a47173223062e6e1c2bc6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
from __future__ import absolute_import
from __future__ import print_function
import atexit
import os
import shlex
import shutil
import subprocess
import sys
import tempfile
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
os.chdir(
os.path.join(
os.path.dirname(__file__),... | 25.298507 | 79 | 0.584307 |
from __future__ import absolute_import
from __future__ import print_function
import atexit
import os
import shlex
import shutil
import subprocess
import sys
import tempfile
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
os.chdir(
os.path.join(
os.path.dirname(__file__),... | true | true |
f735f6cd5e14c234a77f347166f09b45b4e9ba7e | 3,327 | py | Python | src/game_management/phases.py | kesslermaximilian/JustOneBot | 1d7f861bc92fe6bc89e2061d8c22eb802db54d30 | [
"MIT"
] | 1 | 2021-05-23T09:29:02.000Z | 2021-05-23T09:29:02.000Z | src/game_management/phases.py | nonchris/JustOneBot | 4396dc042542938643932128892b19dc3802f394 | [
"MIT"
] | 1 | 2021-05-27T21:13:04.000Z | 2021-05-27T21:13:04.000Z | src/game_management/phases.py | nonchris/JustOneBot | 4396dc042542938643932128892b19dc3802f394 | [
"MIT"
] | 3 | 2021-05-23T16:59:39.000Z | 2021-05-27T21:09:33.000Z | from game_management.game import Game
from game_management.tools import Phase
from log_setup import logger
"""
This file is outdated and not used in the project. Due to circular import issues, this class is now declared
(and documented) in game.py
"""
class PhaseHandler:
def __init__(self, game: Game):
... | 45.575342 | 118 | 0.640517 | from game_management.game import Game
from game_management.tools import Phase
from log_setup import logger
class PhaseHandler:
def __init__(self, game: Game):
self.game = game
self.task_dictionary = {
Phase.initialised: None,
Phase.preparation: game.preparation,
... | true | true |
f735f71c29215f16bd0045a36820d4e8c5cdd059 | 3,347 | py | Python | procedure/problem/efficiency_performance/mo_nats.py | MinhTuDo/MD-MOENAS | edd6ec8c3f89cfbe9674873425c5056e72899edb | [
"MIT"
] | 3 | 2021-12-10T02:07:38.000Z | 2021-12-10T15:07:49.000Z | procedure/problem/efficiency_performance/mo_nats.py | ELO-Lab/MD-MOENAS | edd6ec8c3f89cfbe9674873425c5056e72899edb | [
"MIT"
] | null | null | null | procedure/problem/efficiency_performance/mo_nats.py | ELO-Lab/MD-MOENAS | edd6ec8c3f89cfbe9674873425c5056e72899edb | [
"MIT"
] | null | null | null | from procedure.problem.base import nats as base
import numpy as np
class EfficiencyAccuracyNATS(base.NATS):
def __init__(self, efficiency, **kwargs):
super().__init__(n_obj=2, **kwargs)
self.msg += efficiency + '={:.3f}, ' + 'valid-error' + '={:.3f}'
self.efficiency = efficiency
def _... | 34.505155 | 117 | 0.579026 | from procedure.problem.base import nats as base
import numpy as np
class EfficiencyAccuracyNATS(base.NATS):
def __init__(self, efficiency, **kwargs):
super().__init__(n_obj=2, **kwargs)
self.msg += efficiency + '={:.3f}, ' + 'valid-error' + '={:.3f}'
self.efficiency = efficiency
def _... | true | true |
f735f82e3b5af400f3030e9e85e6e6684e925602 | 720 | py | Python | poky-dunfell/meta/lib/oeqa/runtime/cases/gstreamer.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 14 | 2021-11-04T07:47:37.000Z | 2022-03-21T10:10:30.000Z | poky-dunfell/meta/lib/oeqa/runtime/cases/gstreamer.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | poky-dunfell/meta/lib/oeqa/runtime/cases/gstreamer.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #
# SPDX-License-Identifier: MIT
#
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.runtime.decorator.package import OEHasPackage
class GstreamerCliTest(OERuntimeTestCase):
@OEHasPackage(['gstreamer1.0'])
def test_gst_inspect_can_list_all_plugins(self):
status, output = self.target.run('gst-... | 37.894737 | 120 | 0.733333 |
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.runtime.decorator.package import OEHasPackage
class GstreamerCliTest(OERuntimeTestCase):
@OEHasPackage(['gstreamer1.0'])
def test_gst_inspect_can_list_all_plugins(self):
status, output = self.target.run('gst-inspect-1.0')
self.assertEq... | true | true |
f735f8c3575a57fd39b5854bb669d4259fcfaded | 277 | py | Python | core/admin.py | NarminSH/e-commerce-sellshop-project | a753038c8265473021e21f75b6b095bdc25f43d6 | [
"MIT"
] | null | null | null | core/admin.py | NarminSH/e-commerce-sellshop-project | a753038c8265473021e21f75b6b095bdc25f43d6 | [
"MIT"
] | null | null | null | core/admin.py | NarminSH/e-commerce-sellshop-project | a753038c8265473021e21f75b6b095bdc25f43d6 | [
"MIT"
] | null | null | null | from django.contrib import admin
from core.models import Contact, Slider
@admin.register(Contact)
class ContactAdmin(admin.ModelAdmin):
list_display = ('name', 'email')
list_filter = ('name', 'email')
search_fields = ('name', 'email')
admin.site.register(Slider) | 25.181818 | 39 | 0.718412 | from django.contrib import admin
from core.models import Contact, Slider
@admin.register(Contact)
class ContactAdmin(admin.ModelAdmin):
list_display = ('name', 'email')
list_filter = ('name', 'email')
search_fields = ('name', 'email')
admin.site.register(Slider) | true | true |
f735f8fc14c7fe9404c2a5d90d59491063b15f84 | 1,539 | py | Python | pygna/cli.py | Gee-3/pygna | 61f2128e918e423fef73d810e0c3af5761933096 | [
"MIT"
] | 32 | 2019-07-11T22:58:14.000Z | 2022-03-04T19:34:55.000Z | pygna/cli.py | Gee-3/pygna | 61f2128e918e423fef73d810e0c3af5761933096 | [
"MIT"
] | 3 | 2021-05-24T14:03:13.000Z | 2022-01-07T03:47:32.000Z | pygna/cli.py | Gee-3/pygna | 61f2128e918e423fef73d810e0c3af5761933096 | [
"MIT"
] | 5 | 2019-07-24T09:38:07.000Z | 2021-12-30T09:20:20.000Z | import logging
import argh
import pygna.command as cmd
import pygna.painter as paint
import pygna.utils as utils
import pygna.block_model as bm
import pygna.degree_model as dm
"""
autodoc
"""
logging.basicConfig(level=logging.INFO)
def main():
argh.dispatch_commands([
# network summary and graph file
... | 23.676923 | 43 | 0.654321 | import logging
import argh
import pygna.command as cmd
import pygna.painter as paint
import pygna.utils as utils
import pygna.block_model as bm
import pygna.degree_model as dm
logging.basicConfig(level=logging.INFO)
def main():
argh.dispatch_commands([
cmd.network_summary,
cmd.network_gr... | true | true |
f735f9986c5d76bff5fadb7e320bf1356ecee3fd | 16,822 | py | Python | Step2_Training_MIL/train_MIL_classification_trained_cnn_models.py | Gaskell-1206/MSI_vs_MSS_Classification | be6fd8a6961624367b2bb0e1299219e940f6f418 | [
"MIT"
] | null | null | null | Step2_Training_MIL/train_MIL_classification_trained_cnn_models.py | Gaskell-1206/MSI_vs_MSS_Classification | be6fd8a6961624367b2bb0e1299219e940f6f418 | [
"MIT"
] | null | null | null | Step2_Training_MIL/train_MIL_classification_trained_cnn_models.py | Gaskell-1206/MSI_vs_MSS_Classification | be6fd8a6961624367b2bb0e1299219e940f6f418 | [
"MIT"
] | null | null | null | # Run MIL classification use pretrained CNN models
# Reference: 1.Campanella, G. et al. Clinical-grade computational pathology using weakly supervised
# deep learning on whole slide images. Nat Med 25, 1301–1309 (2019).
# doi:10.1038/s41591-019-0508-1. Available from http://www.nature.com/articles... | 37.63311 | 140 | 0.603495 | import argparse
import os
import random
import sys
from pathlib import Path
from types import SimpleNamespace
from typing import Callable, Optional, Union
from urllib.error import HTTPError
import glob
import numpy as np
import pandas as pd
import pytorch_lightning as pl
import torch
import torch.backends.cudnn as cudn... | true | true |
f735f9f96a2b5bb581f1d6e28479603b2104d7a6 | 1,907 | py | Python | scripts/generate_thumbnail.py | ardtieboy/Gruyaert | ebfc2979504d0fec0c34187fe98033c5c8fbea15 | [
"CC-BY-3.0"
] | null | null | null | scripts/generate_thumbnail.py | ardtieboy/Gruyaert | ebfc2979504d0fec0c34187fe98033c5c8fbea15 | [
"CC-BY-3.0"
] | null | null | null | scripts/generate_thumbnail.py | ardtieboy/Gruyaert | ebfc2979504d0fec0c34187fe98033c5c8fbea15 | [
"CC-BY-3.0"
] | null | null | null | import os
from PIL import Image
import argparse
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('-f', '--folder_path', type=str, help='folder with images which need a thumbnail', required=True)
args = parser.parse_args()
folder_path = args.folder_path + "/"
print("Observed t... | 34.672727 | 117 | 0.576822 | import os
from PIL import Image
import argparse
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('-f', '--folder_path', type=str, help='folder with images which need a thumbnail', required=True)
args = parser.parse_args()
folder_path = args.folder_path + "/"
print("Observed t... | true | true |
f735fabc28e42dba49575f3d3bcf92895802488f | 1,422 | py | Python | examples/np.py | krooken/dd | dda262e6f4582c7f0c77c56a3f3bdfccc2847b7a | [
"BSD-3-Clause"
] | 90 | 2018-08-28T01:03:38.000Z | 2022-03-28T19:36:37.000Z | examples/np.py | krooken/dd | dda262e6f4582c7f0c77c56a3f3bdfccc2847b7a | [
"BSD-3-Clause"
] | 54 | 2018-07-25T00:10:57.000Z | 2022-02-08T16:15:35.000Z | examples/np.py | krooken/dd | dda262e6f4582c7f0c77c56a3f3bdfccc2847b7a | [
"BSD-3-Clause"
] | 21 | 2018-11-16T22:45:56.000Z | 2021-12-31T02:03:54.000Z | """How the variable order in a BDD affects the number of nodes.
Reference
=========
Randal Bryant
"On the complexity of VLSI implementations and graph representations
of Boolean functions with application to integer multiplication"
TOC, 1991
https://doi.org/10.1109/12.73590
"""
from dd import aut... | 26.830189 | 79 | 0.606892 | from dd import autoref as _bdd
def comparing_two_variable_orders():
n = 6
vrs = ['x{i}'.format(i=i) for i in range(2 * n)]
bdd = _bdd.BDD()
bdd.declare(*vrs)
expr_1 = r' /\ '.join(
" x{i} <=> x{j} ".format(i=i, j=(i + n + 1) % (2*n)) for i in range(n))
u = bdd.add_expr(expr_1)
... | true | true |
f735fb673f5ace9c6c08a1fafb4cdaf48e3d9e85 | 129,146 | py | Python | scipy/stats/_distn_infrastructure.py | siddhantwahal/scipy | 411fbbda0f942fcce3e4b314efb11c4553baaa7c | [
"BSD-3-Clause"
] | 1 | 2020-07-22T17:29:25.000Z | 2020-07-22T17:29:25.000Z | scipy/stats/_distn_infrastructure.py | siddhantwahal/scipy | 411fbbda0f942fcce3e4b314efb11c4553baaa7c | [
"BSD-3-Clause"
] | null | null | null | scipy/stats/_distn_infrastructure.py | siddhantwahal/scipy | 411fbbda0f942fcce3e4b314efb11c4553baaa7c | [
"BSD-3-Clause"
] | null | null | null | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from scipy._lib._util import getfullargspec_no_self as _getfullargspec
import sys
import keyword
import re
import types
import warnings
import inspect
from itertools import zip_longest
from scipy._lib import doccer... | 35.247271 | 195 | 0.569743 | from scipy._lib._util import getfullargspec_no_self as _getfullargspec
import sys
import keyword
import re
import types
import warnings
import inspect
from itertools import zip_longest
from scipy._lib import doccer
from ._distr_params import distcont, distdiscrete
from scipy._lib._util import check_random_state
from ... | true | true |
f735fbda2f7247a6884a2e835b13932d3b859e30 | 5,851 | py | Python | PaddleOCR/ppocr/utils/save_load.py | TangJiamin/Ultra_light_OCR_No.23 | 594aa286dc2f88614141838ce45c164647226cdb | [
"Apache-2.0"
] | null | null | null | PaddleOCR/ppocr/utils/save_load.py | TangJiamin/Ultra_light_OCR_No.23 | 594aa286dc2f88614141838ce45c164647226cdb | [
"Apache-2.0"
] | null | null | null | PaddleOCR/ppocr/utils/save_load.py | TangJiamin/Ultra_light_OCR_No.23 | 594aa286dc2f88614141838ce45c164647226cdb | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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... | 40.075342 | 81 | 0.609981 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import errno
import os
import pickle
import six
import paddle
__all__ = ['init_model', 'save_model', 'load_dygraph_pretrain']
def _mkdir_if_not_exist(path, logger):
if not os.path.exist... | true | true |
f735fbfbdbb3d26fc668de600ffcb5cd87869617 | 6,314 | py | Python | python/federatedml/linear_model/logistic_regression/homo_logistic_regression/homo_lr_base.py | QuantumA/FATE | 89a3dd593252128c1bf86fb1014b25a629bdb31a | [
"Apache-2.0"
] | 3,787 | 2019-08-30T04:55:10.000Z | 2022-03-31T23:30:07.000Z | python/federatedml/linear_model/logistic_regression/homo_logistic_regression/homo_lr_base.py | JavaGreenHands/FATE | ea1e94b6be50c70c354d1861093187e523af32f2 | [
"Apache-2.0"
] | 1,439 | 2019-08-29T16:35:52.000Z | 2022-03-31T11:55:31.000Z | python/federatedml/linear_model/logistic_regression/homo_logistic_regression/homo_lr_base.py | JavaGreenHands/FATE | ea1e94b6be50c70c354d1861093187e523af32f2 | [
"Apache-2.0"
] | 1,179 | 2019-08-29T16:18:32.000Z | 2022-03-31T12:55:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... | 45.1 | 111 | 0.660437 |
import functools
from federatedml.linear_model.linear_model_weight import LinearModelWeights
from federatedml.linear_model.logistic_regression.base_logistic_regression import BaseLogisticRegression
from federatedml.optim import activation
from federatedml.optim.optimizer import optimizer_factory
from federatedml.par... | true | true |
f735fc09c6875e47f9827a68f0d28372cc8084db | 7,598 | py | Python | draw_card/genshin_handle.py | dialogueX/nonebot_plugin_gamedraw | 60e969a43709eeb9a61d1a96b9f52b44ddb7dc73 | [
"MIT"
] | 1 | 2021-11-15T03:38:20.000Z | 2021-11-15T03:38:20.000Z | draw_card/genshin_handle.py | dialogueX/nonebot_plugin_gamedraw | 60e969a43709eeb9a61d1a96b9f52b44ddb7dc73 | [
"MIT"
] | null | null | null | draw_card/genshin_handle.py | dialogueX/nonebot_plugin_gamedraw | 60e969a43709eeb9a61d1a96b9f52b44ddb7dc73 | [
"MIT"
] | null | null | null | import os
from nonebot.adapters.cqhttp import MessageSegment, Message
import nonebot
import random
from .update_game_info import update_info
from .util import generate_img, init_star_rst, BaseData, set_list, get_star, init_up_char
from .config import GENSHIN_FIVE_P, GENSHIN_FOUR_P, GENSHIN_G_FIVE_P, GENSHIN_G_FOU... | 35.504673 | 140 | 0.595815 | import os
from nonebot.adapters.cqhttp import MessageSegment, Message
import nonebot
import random
from .update_game_info import update_info
from .util import generate_img, init_star_rst, BaseData, set_list, get_star, init_up_char
from .config import GENSHIN_FIVE_P, GENSHIN_FOUR_P, GENSHIN_G_FIVE_P, GENSHIN_G_FOU... | true | true |
f735fc72e40be41a0923043ba0a95bbe6b54bb26 | 4,541 | py | Python | engine/api/gcp/tasks/system_notify.py | torrotitans/torro_community | a3f153e69a860f0d6c831145f529d9e92193a0ae | [
"MIT"
] | 1 | 2022-01-12T08:31:59.000Z | 2022-01-12T08:31:59.000Z | engine/api/gcp/tasks/system_notify.py | torrotitans/torro_community | a3f153e69a860f0d6c831145f529d9e92193a0ae | [
"MIT"
] | null | null | null | engine/api/gcp/tasks/system_notify.py | torrotitans/torro_community | a3f153e69a860f0d6c831145f529d9e92193a0ae | [
"MIT"
] | 2 | 2022-01-19T06:26:32.000Z | 2022-01-26T15:25:15.000Z | from api.gcp.tasks.baseTask import baseTask
from utils.ldap_helper import Ldap
from db.connection_pool import MysqlConn
from config import configuration
import datetime
import traceback
import logging
from googleapiclient.errors import HttpError
from utils.status_code import response_code
import json
logger = logging.g... | 46.814433 | 119 | 0.568377 | from api.gcp.tasks.baseTask import baseTask
from utils.ldap_helper import Ldap
from db.connection_pool import MysqlConn
from config import configuration
import datetime
import traceback
import logging
from googleapiclient.errors import HttpError
from utils.status_code import response_code
import json
logger = logging.g... | true | true |
f735fffb7f5c66d98450e2d3ee3182ffd0ad3c39 | 8,258 | py | Python | Bkjwer/modules/bkjwer.py | quartz010/Bkjwer | 7ba02eeae60ff508ef97aae4108c35d541dbbb7a | [
"MIT"
] | 1 | 2020-07-03T01:13:39.000Z | 2020-07-03T01:13:39.000Z | Bkjwer/modules/bkjwer.py | r4ym0n/Bkjwer | 7ba02eeae60ff508ef97aae4108c35d541dbbb7a | [
"MIT"
] | null | null | null | Bkjwer/modules/bkjwer.py | r4ym0n/Bkjwer | 7ba02eeae60ff508ef97aae4108c35d541dbbb7a | [
"MIT"
] | null | null | null | import requests
import threading
from bs4 import BeautifulSoup
import re
TIMEOUT = 3
ATTEMPT = 5
class Bkjw:
"""
这个是Bkjw的类负责底层操作
"""
def __init__(self):
self.root_url = "http://172.16.64.236/"
self.session = requests.session()
self.std_info: Dict[str, str] = dict()
se... | 30.360294 | 119 | 0.530274 | import requests
import threading
from bs4 import BeautifulSoup
import re
TIMEOUT = 3
ATTEMPT = 5
class Bkjw:
def __init__(self):
self.root_url = "http://172.16.64.236/"
self.session = requests.session()
self.std_info: Dict[str, str] = dict()
self.islogedin = False
self.ne... | true | true |
f7360083f0e3a23374759cd4d02dd9eb724dd41f | 425 | py | Python | plotly/validators/scatterternary/_fillcolor.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/scatterternary/_fillcolor.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/scatterternary/_fillcolor.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class FillcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name='fillcolor', parent_name='scatterternary', **kwargs
):
super(FillcolorValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | 26.5625 | 77 | 0.637647 | import _plotly_utils.basevalidators
class FillcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name='fillcolor', parent_name='scatterternary', **kwargs
):
super(FillcolorValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | true | true |
f736013fa0db1433a9313e48251e3d7097d94f63 | 302 | py | Python | huxley/settings/__init__.py | jmosky12/huxley | 0a60cc4ac02969ee4d5f2c55bc090575fa2bbe9d | [
"BSD-3-Clause"
] | null | null | null | huxley/settings/__init__.py | jmosky12/huxley | 0a60cc4ac02969ee4d5f2c55bc090575fa2bbe9d | [
"BSD-3-Clause"
] | null | null | null | huxley/settings/__init__.py | jmosky12/huxley | 0a60cc4ac02969ee4d5f2c55bc090575fa2bbe9d | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
from .conference import *
from .main import *
from .logging import *
from .pipeline import *
try:
from .local import *
except ImportError:
pass
| 23.230769 | 77 | 0.731788 |
from .conference import *
from .main import *
from .logging import *
from .pipeline import *
try:
from .local import *
except ImportError:
pass
| true | true |
f736014e683b4c18936492975b531d7d84452019 | 8,495 | py | Python | docarray/array/mixins/io/from_gen.py | fastflair/docarray | 0bbdbc816b2f4a3b399779f6816875fbc1dfe862 | [
"Apache-2.0"
] | 1 | 2022-03-16T14:05:32.000Z | 2022-03-16T14:05:32.000Z | docarray/array/mixins/io/from_gen.py | fastflair/docarray | 0bbdbc816b2f4a3b399779f6816875fbc1dfe862 | [
"Apache-2.0"
] | null | null | null | docarray/array/mixins/io/from_gen.py | fastflair/docarray | 0bbdbc816b2f4a3b399779f6816875fbc1dfe862 | [
"Apache-2.0"
] | null | null | null | from typing import (
Type,
TYPE_CHECKING,
Optional,
overload,
Union,
List,
TextIO,
Dict,
Iterable,
)
if TYPE_CHECKING:
from ....types import T
import numpy as np
import csv
class FromGeneratorMixin:
"""Provide helper functions filling a :class:`DocumentArray`-like ... | 35.843882 | 122 | 0.593996 | from typing import (
Type,
TYPE_CHECKING,
Optional,
overload,
Union,
List,
TextIO,
Dict,
Iterable,
)
if TYPE_CHECKING:
from ....types import T
import numpy as np
import csv
class FromGeneratorMixin:
@classmethod
def _from_generator(cls: Type['T'], meth: str, *... | true | true |
f7360155a2cf41e1ff29c50118bef76ae6d76a51 | 7,617 | py | Python | meiduo_mall/meiduo_mall/apps/orders/serializers.py | zhiliangsu/MeiduoMall | a3968c52f6815ccda6513371d331580dc5aa58f3 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/orders/serializers.py | zhiliangsu/MeiduoMall | a3968c52f6815ccda6513371d331580dc5aa58f3 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/orders/serializers.py | zhiliangsu/MeiduoMall | a3968c52f6815ccda6513371d331580dc5aa58f3 | [
"MIT"
] | null | null | null | # from datetime import timezone
# from time import timezone
from django.utils import timezone
from django_redis import get_redis_connection
from django.db import transaction
from rest_framework import serializers
from decimal import Decimal
from goods.models import SKU
from orders.models import OrderInfo, OrderGoods
f... | 33.262009 | 106 | 0.527636 | from django.utils import timezone
from django_redis import get_redis_connection
from django.db import transaction
from rest_framework import serializers
from decimal import Decimal
from goods.models import SKU
from orders.models import OrderInfo, OrderGoods
from users.models import User
class CommitOrderSerializer(s... | true | true |
f73601a0b37f24e2fbfe3ca8a4805bee0040ab5b | 1,109 | py | Python | platform-tools/systrace/catapult/devil/devil/android/perf/perf_control_devicetest.py | NBPS-Robotics/FTC-Code-Team-9987---2022 | 180538f3ebd234635fa88f96ae7cf7441df6a246 | [
"MIT"
] | 7 | 2021-06-02T06:55:50.000Z | 2022-03-29T10:32:33.000Z | platform-tools/systrace/catapult/devil/devil/android/perf/perf_control_devicetest.py | NBPS-Robotics/FTC-Code-Team-9987---2022 | 180538f3ebd234635fa88f96ae7cf7441df6a246 | [
"MIT"
] | 7 | 2020-07-19T11:24:45.000Z | 2022-03-02T07:11:57.000Z | platform-tools/systrace/catapult/devil/devil/android/perf/perf_control_devicetest.py | NBPS-Robotics/FTC-Code-Team-9987---2022 | 180538f3ebd234635fa88f96ae7cf7441df6a246 | [
"MIT"
] | 1 | 2020-07-24T18:22:03.000Z | 2020-07-24T18:22:03.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0212
import os
import sys
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
from devil.android import... | 28.435897 | 72 | 0.724977 |
import os
import sys
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
from devil.android import device_test_case
from devil.android import device_utils
from devil.android.perf import perf_control
class TestPerfControl(device_test_case.DeviceTestCase):
def setUp(self):
supe... | true | true |
f73601c1555b67a9782615f2f35d1dff388162a4 | 1,052 | py | Python | redirect/models.py | ashbc/tgrsite | 180e5eb9c72a7a331276fe3de150ea2eea2db51e | [
"ISC"
] | 1 | 2019-06-29T15:25:05.000Z | 2019-06-29T15:25:05.000Z | redirect/models.py | ashbc/tgrsite | 180e5eb9c72a7a331276fe3de150ea2eea2db51e | [
"ISC"
] | 70 | 2017-06-21T13:13:57.000Z | 2019-03-20T22:14:56.000Z | redirect/models.py | ashbc/tgrsite | 180e5eb9c72a7a331276fe3de150ea2eea2db51e | [
"ISC"
] | null | null | null | from django.conf import settings
from django.db import models
# Create your models here.
from django.urls import reverse, NoReverseMatch
from django.utils.safestring import mark_safe
from users.models import Achievement
class Redirect(models.Model):
source = models.CharField(max_length=50)
sink = models.Cha... | 31.878788 | 94 | 0.695817 | from django.conf import settings
from django.db import models
from django.urls import reverse, NoReverseMatch
from django.utils.safestring import mark_safe
from users.models import Achievement
class Redirect(models.Model):
source = models.CharField(max_length=50)
sink = models.CharField(max_length=1024)
... | true | true |
f736028df695f0e29db9086d14746101266e6296 | 1,168 | py | Python | ynab_sdk/utils/parsers.py | csadorf/ynab-sdk-python | 845d3798e44bbc27261f73975089d8e19366e8e8 | [
"Apache-2.0"
] | 19 | 2019-05-04T00:26:31.000Z | 2021-09-01T07:31:20.000Z | ynab_sdk/utils/parsers.py | csadorf/ynab-sdk-python | 845d3798e44bbc27261f73975089d8e19366e8e8 | [
"Apache-2.0"
] | 100 | 2019-04-25T00:27:57.000Z | 2022-03-31T15:24:45.000Z | ynab_sdk/utils/parsers.py | csadorf/ynab-sdk-python | 845d3798e44bbc27261f73975089d8e19366e8e8 | [
"Apache-2.0"
] | 7 | 2019-11-13T06:30:06.000Z | 2022-03-25T15:37:53.000Z | import datetime
from typing import Any, Callable, List, Type, TypeVar, cast
import dateutil.parser
T = TypeVar("T")
def from_str(x: Any, nullable=False) -> str:
try:
assert isinstance(x, str)
except AssertionError as ex:
if nullable:
return from_none(x)
else:
... | 18.83871 | 61 | 0.586473 | import datetime
from typing import Any, Callable, List, Type, TypeVar, cast
import dateutil.parser
T = TypeVar("T")
def from_str(x: Any, nullable=False) -> str:
try:
assert isinstance(x, str)
except AssertionError as ex:
if nullable:
return from_none(x)
else:
... | true | true |
f73602915122c998815f4ae1a7673a36cb812cf8 | 1,916 | py | Python | grab/tools/watch.py | subeax/grab | 55518263c543da214d1f0cb54622bbc4fda66349 | [
"MIT"
] | null | null | null | grab/tools/watch.py | subeax/grab | 55518263c543da214d1f0cb54622bbc4fda66349 | [
"MIT"
] | null | null | null | grab/tools/watch.py | subeax/grab | 55518263c543da214d1f0cb54622bbc4fda66349 | [
"MIT"
] | null | null | null | import os
import signal
import sys
import logging
import time
class Watcher(object):
"""this class solves two problems with multithreaded
programs in Python, (1) a signal might be delivered
to any thread (which is just a malfeature) and (2) if
the thread that gets the signal is waiting, the signal
... | 31.409836 | 77 | 0.549582 | import os
import signal
import sys
import logging
import time
class Watcher(object):
def __init__(self):
self.child = os.fork()
if self.child == 0:
return
else:
self.watch()
def watch(self):
try:
os.wait()
except KeyboardInterrup... | true | true |
f73602a5ee89c8bf0c008b6b4c824014333bfd46 | 9,254 | py | Python | effdet/data/transforms.py | saikrishna-pallerla/efficientdet-pytorch | dc7b790f537d28476a26af6f793acc4757becd0d | [
"Apache-2.0"
] | null | null | null | effdet/data/transforms.py | saikrishna-pallerla/efficientdet-pytorch | dc7b790f537d28476a26af6f793acc4757becd0d | [
"Apache-2.0"
] | null | null | null | effdet/data/transforms.py | saikrishna-pallerla/efficientdet-pytorch | dc7b790f537d28476a26af6f793acc4757becd0d | [
"Apache-2.0"
] | null | null | null | """ COCO transforms (quick and dirty)
Hacked together by Ross Wightman
"""
import torch
from PIL import Image
import numpy as np
import random
import math
IMAGENET_DEFAULT_MEAN = (0.485, 0.456, 0.406)
IMAGENET_DEFAULT_STD = (0.229, 0.224, 0.225)
IMAGENET_INCEPTION_MEAN = (0.5, 0.5, 0.5)
IMAGENET_INCEPTION_STD = (0.5,... | 32.470175 | 115 | 0.623946 | import torch
from PIL import Image
import numpy as np
import random
import math
IMAGENET_DEFAULT_MEAN = (0.485, 0.456, 0.406)
IMAGENET_DEFAULT_STD = (0.229, 0.224, 0.225)
IMAGENET_INCEPTION_MEAN = (0.5, 0.5, 0.5)
IMAGENET_INCEPTION_STD = (0.5, 0.5, 0.5)
class ImageToNumpy:
def __call__(self, pil_img, annotation... | true | true |
f736036671e3bc02c896fbd18c45ee63e5da334e | 17,390 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/net_tools/haproxy.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/net_tools/haproxy.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/net_tools/haproxy.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Ravi Bhure <ravibhure@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: haproxy... | 36.153846 | 130 | 0.641978 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: haproxy
short_description: Enable, disable, and set weights for HAProxy backend servers using socket commands
author:
- Ravi Bhure (@ravibhure)
description:
- Enable, disable, drain and set weig... | true | true |
f73603a8189df32a0e6bb0bedf9ab460c5707be4 | 3,632 | py | Python | bot.py | austin1965/nuub_bot | 08fce234730ce506273199ca9c5c2a5f6e8e925a | [
"MIT"
] | null | null | null | bot.py | austin1965/nuub_bot | 08fce234730ce506273199ca9c5c2a5f6e8e925a | [
"MIT"
] | null | null | null | bot.py | austin1965/nuub_bot | 08fce234730ce506273199ca9c5c2a5f6e8e925a | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from helpers.logHelper import logger
import os
import logging
from pymongo import MongoClient
from helpers.getPrefix import getPrefix
import ast
from helpers.getWeather import getWeather
import time
from pretty_help import PrettyHelp
logging.basicConfig(level=logging.INF... | 34.590476 | 100 | 0.638491 | import discord
from discord.ext import commands
from helpers.logHelper import logger
import os
import logging
from pymongo import MongoClient
from helpers.getPrefix import getPrefix
import ast
from helpers.getWeather import getWeather
import time
from pretty_help import PrettyHelp
logging.basicConfig(level=logging.INF... | true | true |
f736049bbe2c9e2b1e12f6afa0bfd0873d6a897f | 1,415 | py | Python | huaweicloud-sdk-cbr/setup.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-cbr/setup.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-cbr/setup.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from os import path
from setuptools import setup, find_packages
NAME = "huaweicloudsdkcbr"
VERSION = "3.0.43-rc"
AUTHOR = "HuaweiCloud SDK"
AUTHOR_EMAIL = "hwcloudsdk@huawei.com"
URL = "https://github.com/huaweicloud/huaweicloud-sdk-python-v3"
DESCRIPTION = "CBR"
this_directory = path.abspath(path.di... | 30.76087 | 78 | 0.670671 | from os import path
from setuptools import setup, find_packages
NAME = "huaweicloudsdkcbr"
VERSION = "3.0.43-rc"
AUTHOR = "HuaweiCloud SDK"
AUTHOR_EMAIL = "hwcloudsdk@huawei.com"
URL = "https://github.com/huaweicloud/huaweicloud-sdk-python-v3"
DESCRIPTION = "CBR"
this_directory = path.abspath(path.dirname(__file__))... | true | true |
f736056e2d0a2321511326a08517deb01be3f66e | 7,202 | py | Python | metpy/calc/tests/test_basic.py | jtwhite79/MetPy | 8f1880be1ee98c17cd00ae556324386d2a6301ac | [
"BSD-3-Clause"
] | null | null | null | metpy/calc/tests/test_basic.py | jtwhite79/MetPy | 8f1880be1ee98c17cd00ae556324386d2a6301ac | [
"BSD-3-Clause"
] | null | null | null | metpy/calc/tests/test_basic.py | jtwhite79/MetPy | 8f1880be1ee98c17cd00ae556324386d2a6301ac | [
"BSD-3-Clause"
] | 1 | 2021-06-15T07:29:05.000Z | 2021-06-15T07:29:05.000Z | # Copyright (c) 2008-2015 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
import numpy as np
from numpy.testing import assert_array_equal
from metpy.units import units
from metpy.testing import assert_almost_equal, assert_array_almost_equal
from met... | 32.008889 | 90 | 0.62802 |
import numpy as np
from numpy.testing import assert_array_equal
from metpy.units import units
from metpy.testing import assert_almost_equal, assert_array_almost_equal
from metpy.calc.basic import *
def test_wind_comps_basic():
speed = np.array([4, 4, 4, 4, 25, 25, 25, 25, 10.]) * units.mph
dirs = np.array(... | true | true |
f736059c7aa090a309aa5bb0091aa6ddcfd2f100 | 8,218 | py | Python | docs/conf.py | 20tab/python-gmaps | f1d316592a7dbd23af3ff758cf37d08dec1572bc | [
"BSD-2-Clause"
] | 30 | 2015-01-01T03:27:58.000Z | 2021-09-20T04:17:26.000Z | docs/conf.py | 20tab/python-gmaps | f1d316592a7dbd23af3ff758cf37d08dec1572bc | [
"BSD-2-Clause"
] | 5 | 2015-08-21T12:51:42.000Z | 2016-10-25T09:32:46.000Z | docs/conf.py | 20tab/python-gmaps | f1d316592a7dbd23af3ff758cf37d08dec1572bc | [
"BSD-2-Clause"
] | 10 | 2015-06-25T01:25:28.000Z | 2021-12-25T18:35:03.000Z | # -*- coding: utf-8 -*-
#
# python-gmaps documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 3 16:14:10 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | 31.72973 | 79 | 0.71818 |
import sys
import os
sys.path.insert(0, os.path.abspath('./../src'))
extensions = ['sphinx.ext.autodoc', ]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'python-gmaps'
copyright = u'2013, Michał Jaworski'
# |version| and |release|, also used in various other places th... | true | true |
f7360609ceab8bc60001c9b2b02bcf339b33203d | 86,859 | py | Python | nova/api/ec2/cloud.py | tbreeds/nova | 3f8c69b2ef3eef886e36c0b7f397b83a36a7beb8 | [
"Apache-2.0"
] | 2 | 2018-11-18T16:03:18.000Z | 2019-05-15T04:34:55.000Z | nova/api/ec2/cloud.py | tbreeds/nova | 3f8c69b2ef3eef886e36c0b7f397b83a36a7beb8 | [
"Apache-2.0"
] | null | null | null | nova/api/ec2/cloud.py | tbreeds/nova | 3f8c69b2ef3eef886e36c0b7f397b83a36a7beb8 | [
"Apache-2.0"
] | 2 | 2015-12-28T14:36:29.000Z | 2018-11-18T16:03:20.000Z | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | 43.234943 | 79 | 0.580124 |
import base64
import time
from oslo_config import cfg
from oslo_log import log as logging
from oslo_log import versionutils
from oslo_utils import timeutils
import six
from nova.api.ec2 import ec2utils
from nova.api.ec2 import inst_state
from nova.api.metadata import password
from nova.api.openstack import extensio... | true | true |
f736067c291f132a6c0900f6b550c84cb433a313 | 2,513 | py | Python | themes/prompt-toolkit/base16/base16-ashes.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | null | null | null | themes/prompt-toolkit/base16/base16-ashes.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | null | null | null | themes/prompt-toolkit/base16/base16-ashes.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# base16-prompt-toolkit (https://github.com/memeplex/base16-prompt-toolkit)
# Base16 Prompt Toolkit template by Carlos Pita (carlosjosepita@gmail.com
# Ashes scheme by Jannik Siebert (https://github.com/janniks)
try:
# older than v2
from prompt_toolkit.output.vt100 import _256_colors
excep... | 30.277108 | 109 | 0.672503 |
try:
from prompt_toolkit.output.vt100 import _256_colors
except ModuleNotFoundError:
from prompt_toolkit.formatted_text.ansi import _256_colors
from pygments.style import Style
from pygments.token import (Keyword, Name, Comment, String, Error, Text,
Number, Operator, Literal, Token... | true | true |
f73607458de05c74a1a0f5bb517b47cd8333529d | 389 | py | Python | djangoapp/website/migrations/0002_userlocation_google_maps_location.py | jaysridhar/fuzzy-spoon | 43ff6c424c6fe8e0d46cbb1555ada57957bf0cb4 | [
"MIT"
] | null | null | null | djangoapp/website/migrations/0002_userlocation_google_maps_location.py | jaysridhar/fuzzy-spoon | 43ff6c424c6fe8e0d46cbb1555ada57957bf0cb4 | [
"MIT"
] | null | null | null | djangoapp/website/migrations/0002_userlocation_google_maps_location.py | jaysridhar/fuzzy-spoon | 43ff6c424c6fe8e0d46cbb1555ada57957bf0cb4 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-19 12:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='userlocation',
name='google_maps_locati... | 20.473684 | 47 | 0.601542 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='userlocation',
name='google_maps_location',
field=models.TextField(null=Tru... | true | true |
f73608570f38fd239f778eadc8b505e51cab2f8a | 3,010 | py | Python | Autodroid/notebook/azurlane.py | AutumnSun1996/GameTools | 05ed69c09e69e284092cfaffd9eb6313f654c729 | [
"BSD-3-Clause"
] | null | null | null | Autodroid/notebook/azurlane.py | AutumnSun1996/GameTools | 05ed69c09e69e284092cfaffd9eb6313f654c729 | [
"BSD-3-Clause"
] | null | null | null | Autodroid/notebook/azurlane.py | AutumnSun1996/GameTools | 05ed69c09e69e284092cfaffd9eb6313f654c729 | [
"BSD-3-Clause"
] | null | null | null | from .common import *
from azurlane.map_anchor import *
from azurlane import load_map
const["section"] = "azurlane"
def check_map_anchor(anchor):
s = const["s"]
if isinstance(anchor, str):
anchor = s.data["Anchors"][anchor]
if "ImageData" not in anchor:
load_image(anchor, s.section)
... | 28.666667 | 88 | 0.579402 | from .common import *
from azurlane.map_anchor import *
from azurlane import load_map
const["section"] = "azurlane"
def check_map_anchor(anchor):
s = const["s"]
if isinstance(anchor, str):
anchor = s.data["Anchors"][anchor]
if "ImageData" not in anchor:
load_image(anchor, s.section)
... | true | true |
f7360a0c4e6ebfce8f3547e0f10c143613ae8d9d | 1,943 | py | Python | jetbot/motor.py | geoc1234/jetbot | f2a8ab3bf581db53d22d788f98b7dd7ebde8bcb0 | [
"MIT"
] | 2,624 | 2019-03-18T23:46:13.000Z | 2022-03-31T01:50:47.000Z | jetbot/motor.py | geoc1234/jetbot | f2a8ab3bf581db53d22d788f98b7dd7ebde8bcb0 | [
"MIT"
] | 389 | 2019-03-19T06:00:11.000Z | 2022-03-28T14:08:53.000Z | jetbot/motor.py | geoc1234/jetbot | f2a8ab3bf581db53d22d788f98b7dd7ebde8bcb0 | [
"MIT"
] | 927 | 2019-03-18T23:27:46.000Z | 2022-03-31T17:22:24.000Z | import atexit
from Adafruit_MotorHAT import Adafruit_MotorHAT
import traitlets
from traitlets.config.configurable import Configurable
class Motor(Configurable):
value = traitlets.Float()
# config
alpha = traitlets.Float(default_value=1.0).tag(config=True)
beta = traitlets.Float(default_value=0.0... | 35.981481 | 82 | 0.63613 | import atexit
from Adafruit_MotorHAT import Adafruit_MotorHAT
import traitlets
from traitlets.config.configurable import Configurable
class Motor(Configurable):
value = traitlets.Float()
alpha = traitlets.Float(default_value=1.0).tag(config=True)
beta = traitlets.Float(default_value=0.0).tag(con... | true | true |
f7360acfd665c25a347616938a4061ba9447cf97 | 3,473 | py | Python | python/ray/tune/automlboard/run.py | dsctt/ray | 29d94a22114b02adfd3745c4991a3ce70592dd16 | [
"Apache-2.0"
] | 1 | 2021-09-20T15:45:59.000Z | 2021-09-20T15:45:59.000Z | python/ray/tune/automlboard/run.py | dsctt/ray | 29d94a22114b02adfd3745c4991a3ce70592dd16 | [
"Apache-2.0"
] | 53 | 2021-10-06T20:08:04.000Z | 2022-03-21T20:17:25.000Z | python/ray/tune/automlboard/run.py | dsctt/ray | 29d94a22114b02adfd3745c4991a3ce70592dd16 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import re
import django
import argparse
from django.core.management import execute_from_command_line
from common.exception import DatabaseError
root_path = os.path.dirname(os.path.abspath(__file__))
logger = logging.getLogger(__name__)
def run_board(args):
"""
Run main entry for Aut... | 28.467213 | 86 | 0.620789 | import logging
import os
import re
import django
import argparse
from django.core.management import execute_from_command_line
from common.exception import DatabaseError
root_path = os.path.dirname(os.path.abspath(__file__))
logger = logging.getLogger(__name__)
def run_board(args):
init_config(args)
fro... | true | true |
f7360b1ff28ca8cb8ff567284e2ce156676903d0 | 134 | py | Python | monkeys-and-frogs-on-fire/server/__main__.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 15 | 2020-04-17T12:02:14.000Z | 2022-03-16T03:01:34.000Z | monkeys-and-frogs-on-fire/server/__main__.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 49 | 2020-04-18T21:14:57.000Z | 2022-01-13T03:05:09.000Z | monkeys-and-frogs-on-fire/server/__main__.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 55 | 2020-04-17T12:01:11.000Z | 2021-12-28T10:14:02.000Z | from server.server import Server
def main():
server = Server(__file__)
server.run()
if __name__ == '__main__':
main()
| 12.181818 | 32 | 0.641791 | from server.server import Server
def main():
server = Server(__file__)
server.run()
if __name__ == '__main__':
main()
| true | true |
f7360c33495af521ae375f81a7d93ff6ad67026e | 483 | py | Python | matches/migrations/0018_matchdata_selected_team.py | ebaymademepoor/django_milestone_project_myTeam | 95d503e2c303b9525e9eaff2e08340f6e9f1987b | [
"ADSL"
] | null | null | null | matches/migrations/0018_matchdata_selected_team.py | ebaymademepoor/django_milestone_project_myTeam | 95d503e2c303b9525e9eaff2e08340f6e9f1987b | [
"ADSL"
] | 5 | 2020-06-05T19:45:53.000Z | 2022-03-11T23:41:23.000Z | matches/migrations/0018_matchdata_selected_team.py | Deirdre18/django_milestone_project_myTeam | 0555105f65076214087cfed73802470652dd1dcd | [
"ADSL"
] | 2 | 2019-04-30T11:08:14.000Z | 2019-07-24T20:04:50.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-03-29 17:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('matches', '0017_auto_20190313_1304'),
]
operations = [
migrations.AddField(
... | 23 | 76 | 0.63147 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('matches', '0017_auto_20190313_1304'),
]
operations = [
migrations.AddField(
model_name='matchdata',
name='selected_team',
... | true | true |
f7360c6d5fedf31018a93713b4dd66b4be3ad635 | 2,110 | py | Python | Handling-Program-Flow-in-Python/code.py | ashweta81/ga-learner-dsmp-repo | 283802b5efbe58ebdb63ef1ba9fb039bbb218245 | [
"MIT"
] | null | null | null | Handling-Program-Flow-in-Python/code.py | ashweta81/ga-learner-dsmp-repo | 283802b5efbe58ebdb63ef1ba9fb039bbb218245 | [
"MIT"
] | null | null | null | Handling-Program-Flow-in-Python/code.py | ashweta81/ga-learner-dsmp-repo | 283802b5efbe58ebdb63ef1ba9fb039bbb218245 | [
"MIT"
] | null | null | null | # --------------
##File path for the file
file_path
def read_file(path):
file = open(path,mode='r')
sentence=file.readline()
file.close()
return sentence
sample_message=read_file(file_path)
#Code starts here
# --------------
#Code starts here
message_1 = read_file (file_path_1)
message_2 =... | 23.444444 | 75 | 0.679621 | file_path
def read_file(path):
file = open(path,mode='r')
sentence=file.readline()
file.close()
return sentence
sample_message=read_file(file_path)
message_1 = read_file (file_path_1)
message_2 = read_file (file_path_2)
print(message_1)
print(message_2)
def fuse_msg(message_a,message_b):
... | true | true |
f7360f48b9aa14fc0cf71c333bfdbf38b258b6a6 | 840 | py | Python | apis/alembic/versions/cae154d4dcb4_change_systemparameter_key_to_name.py | iii-org/devops-system | 71f938c9e225ac24ab9102a8221dc5341a01889c | [
"Apache-2.0"
] | 4 | 2021-07-15T15:59:01.000Z | 2022-02-24T02:58:52.000Z | apis/alembic/versions/cae154d4dcb4_change_systemparameter_key_to_name.py | iii-org/devops-system | 71f938c9e225ac24ab9102a8221dc5341a01889c | [
"Apache-2.0"
] | 4 | 2020-06-12T04:05:46.000Z | 2021-11-09T03:53:13.000Z | apis/alembic/versions/cae154d4dcb4_change_systemparameter_key_to_name.py | iii-org/devops-system | 71f938c9e225ac24ab9102a8221dc5341a01889c | [
"Apache-2.0"
] | 2 | 2020-09-29T05:39:28.000Z | 2021-11-26T09:52:17.000Z | """change SystemParameter key to name
Revision ID: cae154d4dcb4
Revises: 17e220f9fafb
Create Date: 2021-09-24 13:42:12.722846
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cae154d4dcb4'
down_revision = '17e220f9fafb'
branch_labels = None
depends_on = None
... | 27.096774 | 105 | 0.705952 | from alembic import op
import sqlalchemy as sa
revision = 'cae154d4dcb4'
down_revision = '17e220f9fafb'
branch_labels = None
depends_on = None
def upgrade():
op.add_column('system_parameter', sa.Column('name', sa.String(), nullable=True))
op.drop_column('system_parameter', 'key')
def downgrade():
... | true | true |
f73610e4056f257cfc46cfe1ece51fdb25cc295b | 10,425 | py | Python | powerdnsadmin/models/setting.py | ryanolson/PowerDNS-Admin | 44c4531f029581690901b8098c5f9eb50a402966 | [
"MIT"
] | 2 | 2020-03-25T22:03:53.000Z | 2020-03-27T01:19:16.000Z | powerdnsadmin/models/setting.py | ryanolson/PowerDNS-Admin | 44c4531f029581690901b8098c5f9eb50a402966 | [
"MIT"
] | null | null | null | powerdnsadmin/models/setting.py | ryanolson/PowerDNS-Admin | 44c4531f029581690901b8098c5f9eb50a402966 | [
"MIT"
] | null | null | null | import sys
import traceback
import pytimeparse
from ast import literal_eval
from distutils.util import strtobool
from flask import current_app
from .base import db
class Setting(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64))
value = db.Column(db.Text())
defa... | 34.519868 | 89 | 0.539472 | import sys
import traceback
import pytimeparse
from ast import literal_eval
from distutils.util import strtobool
from flask import current_app
from .base import db
class Setting(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64))
value = db.Column(db.Text())
defa... | true | true |
f736128f8ec6359770146eeb234cd2fe4c28ef32 | 4,192 | py | Python | tests/functional/registration/test_check.py | stanislaw/textX | cccb0e0680635e884841f7ef929b1234131716d3 | [
"MIT"
] | 1 | 2021-06-15T14:38:47.000Z | 2021-06-15T14:38:47.000Z | tests/functional/registration/test_check.py | stanislaw/textX | cccb0e0680635e884841f7ef929b1234131716d3 | [
"MIT"
] | null | null | null | tests/functional/registration/test_check.py | stanislaw/textX | cccb0e0680635e884841f7ef929b1234131716d3 | [
"MIT"
] | null | null | null | """
Test check/validation command.
"""
import os
from textx.cli import textx
from click.testing import CliRunner
from pytest import raises
from textx.registration import metamodel_for_language
from textx.exceptions import TextXSyntaxError
this_folder = os.path.abspath(os.path.dirname(__file__))
def test_object_proc... | 35.82906 | 78 | 0.59709 | import os
from textx.cli import textx
from click.testing import CliRunner
from pytest import raises
from textx.registration import metamodel_for_language
from textx.exceptions import TextXSyntaxError
this_folder = os.path.abspath(os.path.dirname(__file__))
def test_object_processor_with_optional_parameter_default()... | true | true |
f73613364eee173b91e7c69db1a0a30aa83442ec | 2,584 | py | Python | 4/day_4.py | ophusdev/advent-of-code_2020 | c66cc25539df263f766209b70dffd96fef2d66f6 | [
"MIT"
] | null | null | null | 4/day_4.py | ophusdev/advent-of-code_2020 | c66cc25539df263f766209b70dffd96fef2d66f6 | [
"MIT"
] | null | null | null | 4/day_4.py | ophusdev/advent-of-code_2020 | c66cc25539df263f766209b70dffd96fef2d66f6 | [
"MIT"
] | null | null | null | import os
import re
class DayFour():
mandatory_fields = [
'byr',
'iyr',
'eyr',
'hgt',
'hcl',
'ecl',
'pid'
]
optional_fields = [
'cid'
]
def check_height(height):
if not any(unit in height for unit in ["cm", "in"]):
... | 27.2 | 76 | 0.517802 | import os
import re
class DayFour():
mandatory_fields = [
'byr',
'iyr',
'eyr',
'hgt',
'hcl',
'ecl',
'pid'
]
optional_fields = [
'cid'
]
def check_height(height):
if not any(unit in height for unit in ["cm", "in"]):
... | true | true |
f7361364bd7459b873d1e65cd0a4470f1ec4ff4c | 468 | py | Python | FictionTools/amitools/amitools/tools/typetool.py | polluks/Puddle-BuildTools | c1762d53a33002b62d8cffe3db129505a387bec3 | [
"BSD-2-Clause"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | FictionTools/amitools/amitools/tools/typetool.py | polluks/Puddle-BuildTools | c1762d53a33002b62d8cffe3db129505a387bec3 | [
"BSD-2-Clause"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | FictionTools/amitools/amitools/tools/typetool.py | polluks/Puddle-BuildTools | c1762d53a33002b62d8cffe3db129505a387bec3 | [
"BSD-2-Clause"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z | #!/usr/bin/env python3
#
# typetool [options] <path>
#
# a tool to inspect types
#
import sys
import os
from amitools.vamos.tools import tools_main, TypeTool
def main():
cfg_files = (
# first look in current dir
os.path.join(os.getcwd(), ".vamosrc"),
# then in home dir
os.path.ex... | 17.333333 | 53 | 0.615385 |
import sys
import os
from amitools.vamos.tools import tools_main, TypeTool
def main():
cfg_files = (
os.path.join(os.getcwd(), ".vamosrc"),
os.path.expanduser("~/.vamosrc"),
)
tools = [TypeTool()]
sys.exit(tools_main(tools, cfg_files))
if __name__ == "__main__":
... | true | true |
f73617115210975d3194a3f05821af4c1dce5a6e | 14,798 | py | Python | legacy-v6.0.2/dnsfilter/fortios_dnsfilter_profile.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 14 | 2018-09-25T20:35:25.000Z | 2021-07-14T04:30:54.000Z | legacy-v6.0.2/dnsfilter/fortios_dnsfilter_profile.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 32 | 2018-10-09T04:13:42.000Z | 2020-05-11T07:20:28.000Z | legacy-v6.0.2/dnsfilter/fortios_dnsfilter_profile.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 11 | 2018-10-09T00:14:53.000Z | 2021-11-03T10:54:09.000Z | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | 34.983452 | 100 | 0.49162 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fortios_dnsfilter_profile
short_description: Configure DNS... | true | true |
f736186a369638f36f71eb0d86650580c5cc6478 | 4,311 | py | Python | mmd_tools/panels/prop_material.py | cnDengyu/blender_mmd_tools | 7968b82283ca868c3382a7012b11a3d17ed266ea | [
"MIT"
] | 1 | 2019-12-08T16:58:30.000Z | 2019-12-08T16:58:30.000Z | mmd_tools/panels/prop_material.py | cnDengyu/blender_mmd_tools | 7968b82283ca868c3382a7012b11a3d17ed266ea | [
"MIT"
] | null | null | null | mmd_tools/panels/prop_material.py | cnDengyu/blender_mmd_tools | 7968b82283ca868c3382a7012b11a3d17ed266ea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from bpy.types import Panel
class MMDMaterialPanel(Panel):
bl_idname = 'MATERIAL_PT_mmd_tools_material'
bl_label = 'MMD Material'
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = 'material'
@classmethod
def poll(cls, context):
material = ... | 32.908397 | 105 | 0.582463 |
from bpy.types import Panel
class MMDMaterialPanel(Panel):
bl_idname = 'MATERIAL_PT_mmd_tools_material'
bl_label = 'MMD Material'
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = 'material'
@classmethod
def poll(cls, context):
material = context.active_object.ac... | true | true |
f7361a6109e98ebe74e50f1049a1e34fd2a5fae3 | 600 | py | Python | VideoSearchEngine/ObjectDetection/Yolo.py | AkshatSh/VideoSearchEngine | 57f64b241b8a7bbc377ce7826e1206f679f41def | [
"MIT"
] | 49 | 2018-05-22T09:06:18.000Z | 2022-02-26T10:03:43.000Z | VideoSearchEngine/ObjectDetection/Yolo.py | AkshatSh/VideoSearchEngine | 57f64b241b8a7bbc377ce7826e1206f679f41def | [
"MIT"
] | 17 | 2018-05-18T21:14:36.000Z | 2019-06-06T09:17:18.000Z | VideoSearchEngine/ObjectDetection/Yolo.py | AkshatSh/VideoSearchEngine | 57f64b241b8a7bbc377ce7826e1206f679f41def | [
"MIT"
] | 18 | 2018-06-06T22:14:26.000Z | 2021-11-23T08:59:31.000Z | '''
Citing this pytorch implementation of tiny yolo from: https://github.com/marvis/pytorch-yolo2/blob/master/models/tiny_yolo.py
Original YOLO: https://pjreddie.com/darknet/yolo/
'''
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
from .bbox_detector impo... | 27.272727 | 125 | 0.748333 |
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
from .bbox_detector import get_bbox
from .DarknetModels.darknet import DarkNet
class YoloNet(DarkNet):
def __init__(self):
super(YoloNet, self).__init__("cfg/yolov3.cfg")
self.load_weights... | true | true |
f7361a6bb9bd3f10ce248da79c13e23df401e67d | 1,019 | py | Python | tortoise/utils.py | EtzelWu/tortoise-orm | 6a79c87169c10ff25b0d84bca4db24f0c0737432 | [
"Apache-2.0"
] | null | null | null | tortoise/utils.py | EtzelWu/tortoise-orm | 6a79c87169c10ff25b0d84bca4db24f0c0737432 | [
"Apache-2.0"
] | null | null | null | tortoise/utils.py | EtzelWu/tortoise-orm | 6a79c87169c10ff25b0d84bca4db24f0c0737432 | [
"Apache-2.0"
] | null | null | null | class QueryAsyncIterator:
def __init__(self, query, callback=None):
self.query = query
self.sequence = None
self._sequence_iterator = None
self._callback = callback
def __aiter__(self):
return self
async def fetch_sequence(self) -> None:
self.sequence = awai... | 29.114286 | 64 | 0.67419 | class QueryAsyncIterator:
def __init__(self, query, callback=None):
self.query = query
self.sequence = None
self._sequence_iterator = None
self._callback = callback
def __aiter__(self):
return self
async def fetch_sequence(self) -> None:
self.sequence = awai... | true | true |
f7361eaeb5b96bfd9b18cd7dfe509faf9e14fb5d | 903 | py | Python | mypath.py | oganesManasian/pytorch-deeplab-xception | 83c042e18b06ced544acb0da66f04e6dc2280d94 | [
"MIT"
] | null | null | null | mypath.py | oganesManasian/pytorch-deeplab-xception | 83c042e18b06ced544acb0da66f04e6dc2280d94 | [
"MIT"
] | null | null | null | mypath.py | oganesManasian/pytorch-deeplab-xception | 83c042e18b06ced544acb0da66f04e6dc2280d94 | [
"MIT"
] | null | null | null | class Path(object):
@staticmethod
def db_root_dir(dataset):
if dataset == 'cityscapes':
# return 'data/cityscapes'
return '../../../cvlabdata2/forOganes/cityscapes'
# return '/path/to/datasets/cityscapes/' # folder that contains leftImg8bit/
elif dataset =... | 43 | 95 | 0.579181 | class Path(object):
@staticmethod
def db_root_dir(dataset):
if dataset == 'cityscapes':
return '../../../cvlabdata2/forOganes/cityscapes'
elif dataset == 'cityscapes_local':
return 'data/cityscapes'
elif dataset == 'synthia':
re... | true | true |
f7362076c28593cc39298e70687c32b09591d3cb | 2,134 | py | Python | DjangoSales/apps/main/forms.py | laloe/djangoRest | 7717ac1a28267d11ffce9e0038934ea9ef542da8 | [
"MIT"
] | null | null | null | DjangoSales/apps/main/forms.py | laloe/djangoRest | 7717ac1a28267d11ffce9e0038934ea9ef542da8 | [
"MIT"
] | null | null | null | DjangoSales/apps/main/forms.py | laloe/djangoRest | 7717ac1a28267d11ffce9e0038934ea9ef542da8 | [
"MIT"
] | null | null | null | from django import forms
from .models import (
Proveedor, Producto, Entradas
)
from django.utils import six
class ProveedorForm():
nombre = forms.CharField(widget=forms.TextInput(attrs={
'class': 'form-control'}), error_messages={'required': 'Please let us know what to call you!'}... | 39.518519 | 124 | 0.611059 | from django import forms
from .models import (
Proveedor, Producto, Entradas
)
from django.utils import six
class ProveedorForm():
nombre = forms.CharField(widget=forms.TextInput(attrs={
'class': 'form-control'}), error_messages={'required': 'Please let us know what to call you!'}... | true | true |
f7362278d0fb33ed86ffcdc67a341ef3f340434d | 32,161 | py | Python | tests/config/test_central.py | thesamesam/pkgcore | be2d9264a3fe61a323f0075cbc4838ed6ec5ffcf | [
"BSD-3-Clause"
] | null | null | null | tests/config/test_central.py | thesamesam/pkgcore | be2d9264a3fe61a323f0075cbc4838ed6ec5ffcf | [
"BSD-3-Clause"
] | null | null | null | tests/config/test_central.py | thesamesam/pkgcore | be2d9264a3fe61a323f0075cbc4838ed6ec5ffcf | [
"BSD-3-Clause"
] | null | null | null | from pkgcore.config import basics, central, errors
from pkgcore.config.hint import configurable
from snakeoil.errors import walk_exception_chain
from snakeoil.test import TestCase
# A bunch of functions used from various tests below.
def repo(cache):
return cache
@configurable({'content': 'ref:drawer', 'contents'... | 44.917598 | 121 | 0.527502 | from pkgcore.config import basics, central, errors
from pkgcore.config.hint import configurable
from snakeoil.errors import walk_exception_chain
from snakeoil.test import TestCase
def repo(cache):
return cache
@configurable({'content': 'ref:drawer', 'contents': 'refs:drawer'})
def drawer(content=None, contents=No... | true | true |
f73622b921f9f382287c967506369eda757d746e | 2,394 | py | Python | speedup.py | ueqri/akitaplot | 7590df560cb8e05e9f54cfcf3f447e1b1a642763 | [
"MIT"
] | null | null | null | speedup.py | ueqri/akitaplot | 7590df560cb8e05e9f54cfcf3f447e1b1a642763 | [
"MIT"
] | null | null | null | speedup.py | ueqri/akitaplot | 7590df560cb8e05e9f54cfcf3f447e1b1a642763 | [
"MIT"
] | null | null | null | from akitaplot import speedup_plot_base, speedup_base, metrics
grab = {
"name": "kernelTime",
"where": "driver",
"what": "kernel_time"
}
baseline = {
"displayName": "16 Unified MGPUSim",
"benchmarks": [
("FIR", metrics("example_data/uni/fir-1024000.csv")),
("AES", metrics("example_data/uni/aes-65536... | 39.245902 | 81 | 0.673768 | from akitaplot import speedup_plot_base, speedup_base, metrics
grab = {
"name": "kernelTime",
"where": "driver",
"what": "kernel_time"
}
baseline = {
"displayName": "16 Unified MGPUSim",
"benchmarks": [
("FIR", metrics("example_data/uni/fir-1024000.csv")),
("AES", metrics("example_data/uni/aes-65536... | true | true |
f73625b05e9348fb81d26dabd1722edb75b48270 | 5,586 | py | Python | gluon/packages/dal/pydal/contrib/portalocker.py | GeorgesBrantley/ResistanceGame | 65ec925ec8399af355e176c4814a749fde5f907d | [
"BSD-3-Clause"
] | 408 | 2015-01-01T10:31:47.000Z | 2022-03-26T17:41:21.000Z | gluon/packages/dal/pydal/contrib/portalocker.py | GeorgesBrantley/ResistanceGame | 65ec925ec8399af355e176c4814a749fde5f907d | [
"BSD-3-Clause"
] | 521 | 2015-01-08T14:45:54.000Z | 2022-03-24T11:15:22.000Z | gluon/packages/dal/pydal/contrib/portalocker.py | GeorgesBrantley/ResistanceGame | 65ec925ec8399af355e176c4814a749fde5f907d | [
"BSD-3-Clause"
] | 158 | 2015-01-25T20:02:00.000Z | 2022-03-01T06:29:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Cross-platform (posix/nt) API for flock-style file locking.
Synopsis::
import portalocker
file = open(\"somefile\", \"r+\")
portalocker.lock(file, portalocker.LOCK_EX)
file.seek(12)
file.write(\"foo\")
file.close()
If you know what you're doing, yo... | 24.077586 | 93 | 0.61672 |
import sys
import logging
PY2 = sys.version_info[0] == 2
logger = logging.getLogger("pydal")
os_locking = None
try:
import google.appengine
os_locking = "gae"
except:
try:
import fcntl
os_locking = "posix"
except:
try:
import msvcrt
import ctypes
... | true | true |
f73625c823d2d4f962aa9218ec9d19a20ef0e82e | 3,826 | py | Python | project/span_bert/utils.py | hancia/ToxicSpansDetection | 4a10600292af90a936767aee09559b39380e3d5e | [
"Apache-2.0"
] | 3 | 2021-03-23T08:07:54.000Z | 2021-11-13T07:13:32.000Z | project/span_bert/utils.py | hancia/ToxicSpansDetection | 4a10600292af90a936767aee09559b39380e3d5e | [
"Apache-2.0"
] | null | null | null | project/span_bert/utils.py | hancia/ToxicSpansDetection | 4a10600292af90a936767aee09559b39380e3d5e | [
"Apache-2.0"
] | null | null | null | import csv
from ast import literal_eval
from configparser import ConfigParser
from io import StringIO
import comet_ml
import pandas as pd
from easydict import EasyDict
def f1_semeval(pred_spans, true_spans):
"""
F1 (a.k.a. DICE) operating on two lists of offsets (e.g., character).
>>> assert f1([0, 1, 4,... | 38.646465 | 111 | 0.661526 | import csv
from ast import literal_eval
from configparser import ConfigParser
from io import StringIO
import comet_ml
import pandas as pd
from easydict import EasyDict
def f1_semeval(pred_spans, true_spans):
if len(true_spans) == 0:
return 1 if len(pred_spans) == 0 else 0
nom = 2 * len(set(pred_spans... | true | true |
f73625e7cfe600393ba0656bf47e99a78a52eb62 | 1,284 | py | Python | src/main/python/programmingtheiot/cda/emulated/HumiditySensorEmulatorTask.py | NULishengZhang/piot-python-components | 006674bc42443bb2a843bfd7dfa5b55be9843961 | [
"MIT"
] | null | null | null | src/main/python/programmingtheiot/cda/emulated/HumiditySensorEmulatorTask.py | NULishengZhang/piot-python-components | 006674bc42443bb2a843bfd7dfa5b55be9843961 | [
"MIT"
] | null | null | null | src/main/python/programmingtheiot/cda/emulated/HumiditySensorEmulatorTask.py | NULishengZhang/piot-python-components | 006674bc42443bb2a843bfd7dfa5b55be9843961 | [
"MIT"
] | null | null | null | #####
#
# This class is part of the Programming the Internet of Things project.
#
# It is provided as a simple shell to guide the student and assist with
# implementation for the Programming the Internet of Things exercises,
# and designed to be modified by the student as needed.
#
from programmingtheiot.data.Sensor... | 31.317073 | 137 | 0.76947 |
from programmingtheiot.data.SensorData import SensorData
import programmingtheiot.common.ConfigConst as ConfigConst
from programmingtheiot.common.ConfigUtil import ConfigUtil
from programmingtheiot.cda.sim.BaseSensorSimTask import BaseSensorSimTask
from pisense import SenseHAT
class HumiditySensorEmulatorTask(Bas... | true | true |
f73627a984cb39c8412520997364c7b7eb205157 | 11,362 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_firewall_ssh_localca.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_firewall_ssh_localca.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_firewall_ssh_localca.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
# Copyright 2019-2021 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | 32.743516 | 153 | 0.512498 | from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fmgr_firewall_ssh_localca
short_description: SSH proxy local... | true | true |
f73627be709cc2f9d7f3dc33e61adab4c0ac819f | 1,456 | py | Python | release.py | hui-z/ForgiveDB | be032eb325566be02081257ee42853754b14514b | [
"MIT"
] | 71 | 2017-07-04T11:58:06.000Z | 2021-11-08T12:07:49.000Z | release.py | hui-z/ForgiveDB | be032eb325566be02081257ee42853754b14514b | [
"MIT"
] | 6 | 2017-07-30T09:13:20.000Z | 2017-12-06T15:31:28.000Z | release.py | hui-z/ForgiveDB | be032eb325566be02081257ee42853754b14514b | [
"MIT"
] | 16 | 2017-08-09T06:31:59.000Z | 2021-12-01T13:09:52.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import sys
# codecov.io project token
import pypandoc
codecov_token = '' or os.environ.get('FORGIVE_DB_CODECOV_TOKEN')
base_dir = os.path.dirname(os.path.abspath(__file__))
sub_commands = {}
def run(*... | 22.75 | 70 | 0.635989 | from __future__ import absolute_import, unicode_literals
import os
import sys
import pypandoc
codecov_token = '' or os.environ.get('FORGIVE_DB_CODECOV_TOKEN')
base_dir = os.path.dirname(os.path.abspath(__file__))
sub_commands = {}
def run(*commands):
os.system('cd {} && {}'.format(base_dir, ' && '.join(comma... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.