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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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_g... | 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 a... | 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
f... | 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 ... | 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... | 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... | 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):
... | 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 ... | 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 |
f73603e2be2d2a799d139e4f06fab91084f5f790 | 74,367 | py | Python | tools/bisect-perf-regression.py | hujiajie/pa-chromium | 1816ff80336a6efd1616f9e936880af460b1e105 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2020-05-03T06:33:56.000Z | 2021-11-14T18:39:42.000Z | tools/bisect-perf-regression.py | hujiajie/pa-chromium | 1816ff80336a6efd1616f9e936880af460b1e105 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/bisect-perf-regression.py | hujiajie/pa-chromium | 1816ff80336a6efd1616f9e936880af460b1e105 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""Performance Test Bisect Tool
This script bisects a series of changelists using binary search. It starts at
a bad revision where... | 32.760793 | 80 | 0.624242 |
"""Performance Test Bisect Tool
This script bisects a series of changelists using binary search. It starts at
a bad revision where a performance metric has regressed, and asks for a last
known-good revision. It will then binary search across this revision range by
syncing, building, and running a performance test... | false | 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.ar... | 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 us... | 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 ... | 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,... | 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=Tr... | 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(co... | 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)
fr... | 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 |
e(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):
quotient=int(mes... | 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():
| 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... | 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.a... | 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'
s_local':
return 'data/cityscapes'
elif dataset == 'synthia':
return 'data/synthia'
... | 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=N... | 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 | rom 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(BaseS... | 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: ... | 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(co... | true | true |
f73629463525a2647b03c609ca5952eb27adc3d4 | 7,419 | py | Python | Scripts/Plotting/Posteriors_cosmo_model1/Posteriors_cosmo_model1_alternative_dust.py | LBJ-Wade/GALLUMI_public | dbef3ff1ae6934c9551a44cbbe0270e2f17f5527 | [
"MIT"
] | 1 | 2021-12-15T00:17:15.000Z | 2021-12-15T00:17:15.000Z | Scripts/Plotting/Posteriors_cosmo_model1/Posteriors_cosmo_model1_alternative_dust.py | NNSSA/GALLUMI_public | 4529ab32ccfc281e5976f482fe556b672b8f464f | [
"MIT"
] | null | null | null | Scripts/Plotting/Posteriors_cosmo_model1/Posteriors_cosmo_model1_alternative_dust.py | NNSSA/GALLUMI_public | 4529ab32ccfc281e5976f482fe556b672b8f464f | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
import glob
from matplotlib import patches as mpatches
import scipy.ndimage
from scipy.interpolate import PchipInterpolator
plt.style.use("../template.mplstyle")
# purple - green - darkgoldenrod - blue - red
colors = ['purple', '#306B37', 'darkgoldenrod', '#3F7BB... | 45.515337 | 244 | 0.669632 | import numpy as np
from matplotlib import pyplot as plt
import glob
from matplotlib import patches as mpatches
import scipy.ndimage
from scipy.interpolate import PchipInterpolator
plt.style.use("../template.mplstyle")
colors = ['purple', '#306B37', 'darkgoldenrod', '#3F7BB6', '#BF4145']
linestyles = [(0, (1,1.05)), (... | true | true |
f7362a6ca3d104844807c89068693be7e4cdaf8b | 346 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py | jalauzon-msft/azure-sdk-for-python | 15967f5c6d3376f2334a382486ba86339786e028 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ---------------------------------------------------------------------... | 38.444444 | 76 | 0.416185 |
VERSION = "27.1.0"
| true | true |
f7362b15d038c90e57d13b0b966653c28ef74792 | 3,507 | py | Python | train.py | Yugeeth/chat-bot | 3198fb160f743c7be1f377d2febb889423da8c06 | [
"MIT"
] | null | null | null | train.py | Yugeeth/chat-bot | 3198fb160f743c7be1f377d2febb889423da8c06 | [
"MIT"
] | null | null | null | train.py | Yugeeth/chat-bot | 3198fb160f743c7be1f377d2febb889423da8c06 | [
"MIT"
] | null | null | null | import numpy as np
import random
import json
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from nltk_utils import bag_of_words, tokenize, stem
from model import NeuralNet
with open('intents.json', 'r') as f:
intents = json.load(f)
all_words = []
tags = []
xy... | 27.186047 | 75 | 0.633875 | import numpy as np
import random
import json
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from nltk_utils import bag_of_words, tokenize, stem
from model import NeuralNet
with open('intents.json', 'r') as f:
intents = json.load(f)
all_words = []
tags = []
xy... | true | true |
f7362b1d3b7934ae1c2a4ac2d3bcb7a2674d48d6 | 1,310 | py | Python | para_averaging.py | TurkuNLP/paraphrase-classification | 625f0cf5223ecff9d25c2a4f558ca39fa5ecc794 | [
"Apache-2.0"
] | null | null | null | para_averaging.py | TurkuNLP/paraphrase-classification | 625f0cf5223ecff9d25c2a4f558ca39fa5ecc794 | [
"Apache-2.0"
] | null | null | null | para_averaging.py | TurkuNLP/paraphrase-classification | 625f0cf5223ecff9d25c2a4f558ca39fa5ecc794 | [
"Apache-2.0"
] | null | null | null | import torch.nn.functional as F
import torch
import para_model
class ParaAvgModel(para_model.PARAModel):
def __init__(self, **args):
super().__init__(**args)
# self.drop_layer=torch.nn.Dropout(p=0.2)
self.cls_layer=torch.nn.Linear(self.bert.config.hidden_size*5, args['num_classes'])
d... | 43.666667 | 129 | 0.655725 | import torch.nn.functional as F
import torch
import para_model
class ParaAvgModel(para_model.PARAModel):
def __init__(self, **args):
super().__init__(**args)
self.cls_layer=torch.nn.Linear(self.bert.config.hidden_size*5, args['num_classes'])
def forward(self, batch):
input_id... | true | true |
f7362b4bfc9f1a5b48252b4883e71f75146af047 | 15,417 | py | Python | mne/viz/circle.py | joewalter/mne-python | b0629bea7f5e8e94d9e2e889f45a35f9657e6dbc | [
"BSD-3-Clause"
] | null | null | null | mne/viz/circle.py | joewalter/mne-python | b0629bea7f5e8e94d9e2e889f45a35f9657e6dbc | [
"BSD-3-Clause"
] | null | null | null | mne/viz/circle.py | joewalter/mne-python | b0629bea7f5e8e94d9e2e889f45a35f9657e6dbc | [
"BSD-3-Clause"
] | null | null | null | """Functions to plot on circle as for connectivity
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: Simplified BSD
from itertools i... | 37.23913 | 79 | 0.621846 | from __future__ import print_function
from itertools import cycle
from functools import partial
import numpy as np
from .utils import plt_show
from ..externals.six import string_types
def circular_layout(node_names, node_order, start_pos=90, start_between=True,
group_boundaries=None, gro... | true | true |
f7362b4e7693e7a3993c8f04eaae12595182ff80 | 34 | py | Python | turkishsuffix/__init__.py | ugur-zongur/turkishsuffix | f013e34f3094b5357244b1fd426ce9594c9c36ab | [
"MIT"
] | 8 | 2018-09-12T03:45:49.000Z | 2021-03-05T15:55:11.000Z | turkishsuffix/__init__.py | ugur-zongur/turkishsuffix | f013e34f3094b5357244b1fd426ce9594c9c36ab | [
"MIT"
] | 1 | 2020-04-07T16:06:12.000Z | 2020-04-07T16:06:12.000Z | turkishsuffix/__init__.py | ugur-zongur/turkishsuffix | f013e34f3094b5357244b1fd426ce9594c9c36ab | [
"MIT"
] | 2 | 2018-03-02T11:08:33.000Z | 2020-03-12T22:10:00.000Z | from .suffix import turkishSuffix
| 17 | 33 | 0.852941 | from .suffix import turkishSuffix
| true | true |
f7362c07e55a424db3a7dda53b5b90643a1ec703 | 9,664 | py | Python | lib/airflow/airflow/operators/subdag.py | SteNicholas/ai-flow | 2c70547981f1516f0e37bbe6936a1b7cccd31822 | [
"Apache-2.0"
] | 79 | 2021-10-15T07:32:27.000Z | 2022-03-28T04:10:19.000Z | lib/airflow/airflow/operators/subdag.py | SteNicholas/ai-flow | 2c70547981f1516f0e37bbe6936a1b7cccd31822 | [
"Apache-2.0"
] | 153 | 2021-10-15T05:23:46.000Z | 2022-02-23T06:07:10.000Z | lib/airflow/airflow/operators/subdag.py | SteNicholas/ai-flow | 2c70547981f1516f0e37bbe6936a1b7cccd31822 | [
"Apache-2.0"
] | 23 | 2021-10-15T02:36:37.000Z | 2022-03-17T02:59:27.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.835498 | 105 | 0.640625 |
from enum import Enum
from typing import Dict, Optional
from sqlalchemy.orm.session import Session
from airflow.api.common.experimental.get_task_instance import get_task_instance
from airflow.exceptions import AirflowException, TaskInstanceNotFound
from airflow.models import DagRun
from airflow.model... | true | true |
f7362d25cfa413edc1cc0f2e3479ec9ea1277b43 | 367 | py | Python | 1_The_Basics/1_1_Welcome/main.py | Aurora-College-SDD-2022/Python4SDD | 068b74bafd0c5fda2d9a99dc694911419d67b28a | [
"CC0-1.0"
] | null | null | null | 1_The_Basics/1_1_Welcome/main.py | Aurora-College-SDD-2022/Python4SDD | 068b74bafd0c5fda2d9a99dc694911419d67b28a | [
"CC0-1.0"
] | 3 | 2021-01-03T11:02:03.000Z | 2021-01-03T11:03:15.000Z | 1_The_Basics/1_1_Welcome/main.py | Aurora-College-SDD-2022/Python4SDD | 068b74bafd0c5fda2d9a99dc694911419d67b28a | [
"CC0-1.0"
] | 1 | 2021-02-18T22:05:16.000Z | 2021-02-18T22:05:16.000Z | """ your first python program.
Replace the words 'look at me I am coding' with your own message
to let the world know you are now an apprentice code monkey.
"""
def print_message():
"""prints a simple message."""
print("look at me I am coding")
#Ignore everything below this line...we will talk about it later... | 28.230769 | 64 | 0.708447 |
def print_message():
print("look at me I am coding")
if __name__ == "__main__":
print_message() | true | true |
f7362d59a01649e753aafc6708a779ef76437b4c | 8,296 | py | Python | python/GafferSceneUI/OutputsUI.py | ddesmond/gaffer | 4f25df88103b7893df75865ea919fb035f92bac0 | [
"BSD-3-Clause"
] | 561 | 2016-10-18T04:30:48.000Z | 2022-03-30T06:52:04.000Z | python/GafferSceneUI/OutputsUI.py | ddesmond/gaffer | 4f25df88103b7893df75865ea919fb035f92bac0 | [
"BSD-3-Clause"
] | 1,828 | 2016-10-14T19:01:46.000Z | 2022-03-30T16:07:19.000Z | python/GafferSceneUI/OutputsUI.py | ddesmond/gaffer | 4f25df88103b7893df75865ea919fb035f92bac0 | [
"BSD-3-Clause"
] | 120 | 2016-10-18T15:19:13.000Z | 2021-12-20T16:28:23.000Z | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | 31.30566 | 114 | 0.674301 | true | true | |
f7362d686b031b37aec567847d3c0a6b7d8027e9 | 1,864 | py | Python | tradebook/users/models.py | isuryanarayanan/tradebook-backend | 86c9e3c5adccb13b95945604c3d1e5c43066532c | [
"MIT"
] | null | null | null | tradebook/users/models.py | isuryanarayanan/tradebook-backend | 86c9e3c5adccb13b95945604c3d1e5c43066532c | [
"MIT"
] | null | null | null | tradebook/users/models.py | isuryanarayanan/tradebook-backend | 86c9e3c5adccb13b95945604c3d1e5c43066532c | [
"MIT"
] | null | null | null | """ User account models """
from django.db import models
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.base_user import BaseUserManager
class UserManager(BaseUserManager):
use_in_migrations = True
def _create_user(self, use... | 35.846154 | 84 | 0.688841 | from django.db import models
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.base_user import BaseUserManager
class UserManager(BaseUserManager):
use_in_migrations = True
def _create_user(self, username, email, password, **ex... | true | true |
f7362de671c7775a19073b3d25d77d55bee0b8d2 | 1,602 | py | Python | test/test_instructions/test_invocations.py | ronyhe/pyjvm | bb15bed8719335c09779f95d4bc16947b7bb7b98 | [
"MIT"
] | 15 | 2018-07-31T11:25:18.000Z | 2021-07-28T09:13:21.000Z | test/test_instructions/test_invocations.py | ronyhe/pyjvm | bb15bed8719335c09779f95d4bc16947b7bb7b98 | [
"MIT"
] | null | null | null | test/test_instructions/test_invocations.py | ronyhe/pyjvm | bb15bed8719335c09779f95d4bc16947b7bb7b98 | [
"MIT"
] | 1 | 2021-07-22T07:36:23.000Z | 2021-07-22T07:36:23.000Z | from jawa.constants import ConstantPool
from jawa.util.bytecode import Instruction
from pyjvm.core.actions import Pop, Invoke
from pyjvm.core.class_loaders import FixedClassLoader
from pyjvm.core.jvm_class import JvmClass, BytecodeMethod, MethodKey
from pyjvm.core.jvm_types import Integer, RootObjectType
from test.uti... | 27.62069 | 78 | 0.673533 | from jawa.constants import ConstantPool
from jawa.util.bytecode import Instruction
from pyjvm.core.actions import Pop, Invoke
from pyjvm.core.class_loaders import FixedClassLoader
from pyjvm.core.jvm_class import JvmClass, BytecodeMethod, MethodKey
from pyjvm.core.jvm_types import Integer, RootObjectType
from test.uti... | true | true |
f7362deaf881659f32749a483965edb06eda5a8f | 33,921 | py | Python | src/qtt/instrument_drivers/virtual_awg.py | jsaez8/qtt | fa6497ace86a255f33a2192ba01d063d07d6895e | [
"MIT"
] | null | null | null | src/qtt/instrument_drivers/virtual_awg.py | jsaez8/qtt | fa6497ace86a255f33a2192ba01d063d07d6895e | [
"MIT"
] | null | null | null | src/qtt/instrument_drivers/virtual_awg.py | jsaez8/qtt | fa6497ace86a255f33a2192ba01d063d07d6895e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 31 13:04:09 2016
@author: diepencjv
"""
# %%
import numpy as np
import scipy.signal
import logging
import warnings
import qcodes
from qcodes import Instrument
from qcodes.plots.pyqtgraph import QtPlot
from qcodes.data.data_array import DataArray
import qtt
import qtt.ut... | 41.774631 | 157 | 0.60296 |
import numpy as np
import scipy.signal
import logging
import warnings
import qcodes
from qcodes import Instrument
from qcodes.plots.pyqtgraph import QtPlot
from qcodes.data.data_array import DataArray
import qtt
import qtt.utilities.tools
logger = logging.getLogger(__name__)
class virtual_awg(Instrument):
... | true | true |
f7362e1dc422d449f05e6af959692365df74ce49 | 5,374 | py | Python | artic/deprecated/plot_amplicon_depth.py | MarkusHaak/fieldbioinformatics | 3d291477a3d84968816c8e57e6078fc80135f422 | [
"MIT"
] | 72 | 2018-12-21T22:48:50.000Z | 2022-02-24T17:04:53.000Z | artic/deprecated/plot_amplicon_depth.py | MarkusHaak/fieldbioinformatics | 3d291477a3d84968816c8e57e6078fc80135f422 | [
"MIT"
] | 70 | 2020-02-05T13:39:09.000Z | 2022-03-29T01:47:19.000Z | artic/deprecated/plot_amplicon_depth.py | MarkusHaak/fieldbioinformatics | 3d291477a3d84968816c8e57e6078fc80135f422 | [
"MIT"
] | 54 | 2019-03-11T13:33:21.000Z | 2022-03-21T09:27:50.000Z | #!/usr/bin/env python3
"""
Plot the mean read depth per amplicon.
This has been written for use in the ARTIC pipeline so there are no file checks - it assumes the following:
* the primer scheme is in ARTIC format
* the input depth files are in the format: `chrom\treadgroup\tposition\tdepth
* readgroup equates to p... | 34.896104 | 116 | 0.592668 |
from .vcftagprimersites import read_bed_file
import sys
import pandas as pd
import numpy as np
import argparse
import os
os.environ['QT_QPA_PLATFORM'] = 'offscreen'
import seaborn as sns
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def go(args):
primerScheme = read_bed_file(arg... | true | true |
f736303816e77fc8b6b0357f24619105dad9aa31 | 1,043 | py | Python | 2_Scraper-Scripts/RunThis.py | kshahnazari1998/SociaGrow-Public | 54042634ad8d16ea044bfd1fe265d68e1d74102b | [
"MIT"
] | null | null | null | 2_Scraper-Scripts/RunThis.py | kshahnazari1998/SociaGrow-Public | 54042634ad8d16ea044bfd1fe265d68e1d74102b | [
"MIT"
] | null | null | null | 2_Scraper-Scripts/RunThis.py | kshahnazari1998/SociaGrow-Public | 54042634ad8d16ea044bfd1fe265d68e1d74102b | [
"MIT"
] | null | null | null | import subprocess
import time
from VpnConnect import VpnConnects
vpc = VpnConnects()
while True:
time.sleep(10)
processf2 = subprocess.Popen(["python", "Targetaccountstatus.py"])
time.sleep(3600)
processf2.kill()
# Scrape User
processmain = subprocess.Popen(["python", "Ma... | 24.255814 | 71 | 0.634708 | import subprocess
import time
from VpnConnect import VpnConnects
vpc = VpnConnects()
while True:
time.sleep(10)
processf2 = subprocess.Popen(["python", "Targetaccountstatus.py"])
time.sleep(3600)
processf2.kill()
processmain = subprocess.Popen(["python", "ManagerAdmin.py"... | true | true |
f73632ee2a6251e65ea96df144d8af26abd3cbc3 | 1,818 | py | Python | python/heliosUpdateTargetSecretKey/heliosUpdateTargetSecretKey.py | ped998/scripts | 0dcaaf47f9676210e1c972a5d59d8d0de82a1d93 | [
"Apache-2.0"
] | null | null | null | python/heliosUpdateTargetSecretKey/heliosUpdateTargetSecretKey.py | ped998/scripts | 0dcaaf47f9676210e1c972a5d59d8d0de82a1d93 | [
"Apache-2.0"
] | null | null | null | python/heliosUpdateTargetSecretKey/heliosUpdateTargetSecretKey.py | ped998/scripts | 0dcaaf47f9676210e1c972a5d59d8d0de82a1d93 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Helios Update Secret Key for External Targets"""
from pyhesity import *
from datetime import datetime
import getpass
### command line arguments
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--username', type=str, default='helios')
parser.add_argument('-pwd', '-... | 35.647059 | 121 | 0.636964 |
from pyhesity import *
from datetime import datetime
import getpass
()
parser.add_argument('-u', '--username', type=str, default='helios')
parser.add_argument('-pwd', '--password', type=str)
parser.add_argument('-a', '--accesskey', type=str, required=True)
parser.add_argument('-s', '--secretkey', type=str, default='... | true | true |
f73632faf3e8e654e58ba098197bb5b21ddef5a6 | 6,133 | py | Python | managesf/controllers/api/v2/base.py | softwarefactory-project/managesf | 7018d041291f50b90e782ca31d0cfc67abd10170 | [
"Apache-2.0"
] | 1 | 2018-08-02T23:30:03.000Z | 2018-08-02T23:30:03.000Z | managesf/controllers/api/v2/base.py | softwarefactory-project/managesf | 7018d041291f50b90e782ca31d0cfc67abd10170 | [
"Apache-2.0"
] | 1 | 2021-12-13T18:24:10.000Z | 2021-12-13T20:10:39.000Z | managesf/controllers/api/v2/base.py | softwarefactory-project/managesf | 7018d041291f50b90e782ca31d0cfc67abd10170 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2017 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 38.093168 | 79 | 0.608022 |
import logging
import os.path
import re
from pecan import conf
from pecan import request, response, abort, expose
from pecan.rest import RestController
from managesf.model.yamlbkd.engine import SFResourceBackendEngine
from managesf import policy
from managesf.model import SFUserCRUD
from git.exc impo... | true | true |
f73633465de3445622fe64746dfb0a3abd0dc8d9 | 4,477 | py | Python | sponge-kb/sponge-kb-mpd-mpc/src/main/resources/sponge/mpd-mpc/mpd_mpc_player.py | mnpas/sponge | 7190f23ae888bbef49d0fbb85157444d6ea48bcd | [
"Apache-2.0"
] | 9 | 2017-12-16T21:48:57.000Z | 2022-01-06T12:22:24.000Z | sponge-kb/sponge-kb-mpd-mpc/src/main/resources/sponge/mpd-mpc/mpd_mpc_player.py | mnpas/sponge | 7190f23ae888bbef49d0fbb85157444d6ea48bcd | [
"Apache-2.0"
] | 3 | 2020-12-18T11:56:46.000Z | 2022-03-31T18:37:10.000Z | sponge-kb/sponge-kb-mpd-mpc/src/main/resources/sponge/mpd-mpc/mpd_mpc_player.py | mnpas/sponge | 7190f23ae888bbef49d0fbb85157444d6ea48bcd | [
"Apache-2.0"
] | 2 | 2019-12-29T16:08:32.000Z | 2020-06-15T14:05:34.000Z | """
Sponge Knowledge Base
MPD player.
"""
class MpdPlayer(Action):
def onConfigure(self):
self.withLabel("Player").withDescription("The MPD player.")
self.withArgs([
# The song info arguments.
StringType("song").withLabel("Song").withNullable().withReadOnly()
... | 58.142857 | 118 | 0.624972 |
class MpdPlayer(Action):
def onConfigure(self):
self.withLabel("Player").withDescription("The MPD player.")
self.withArgs([
StringType("song").withLabel("Song").withNullable().withReadOnly()
.withProvided(ProvidedMeta().withValue()),
StringType("... | true | true |
f7363416c8ea9009adc45b2b90d259e589d247e0 | 14,015 | py | Python | gsom.py | cperales/pygsom | ac4d4818f441d862cb5183e1d2ea814e3f805759 | [
"MIT"
] | null | null | null | gsom.py | cperales/pygsom | ac4d4818f441d862cb5183e1d2ea814e3f805759 | [
"MIT"
] | null | null | null | gsom.py | cperales/pygsom | ac4d4818f441d862cb5183e1d2ea814e3f805759 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015 Philipp Ludwig <git@philippludwig.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without ... | 36.028278 | 99 | 0.577595 |
from math import log, exp
import itertools
import math
import random
import scipy
class GSOMNode:
R = random.Random()
def __init__(self, dim, x, y, data):
self.weights = scipy.array([self.R.random() for _ in range(dim)])
self.error = 0.0
self.it... | true | true |
f736343fd5da597b2fb04dc9aa414c2b0598f993 | 4,724 | py | Python | elmerbot/commands/search.py | scott-hand/elmerbot | cb356da60dcf7d6b6d3bef22341765c043e48f87 | [
"MIT"
] | null | null | null | elmerbot/commands/search.py | scott-hand/elmerbot | cb356da60dcf7d6b6d3bef22341765c043e48f87 | [
"MIT"
] | null | null | null | elmerbot/commands/search.py | scott-hand/elmerbot | cb356da60dcf7d6b6d3bef22341765c043e48f87 | [
"MIT"
] | null | null | null | import discord
import string
from elmerbot.commands import ElmerCommand
__all__ = ["SearchCommand", "InfoCommand"]
class SearchCommand(ElmerCommand):
command = "search"
description = (
"Search for a whisky by name. Optionally put a number of results to limit it to in front of "
"your query.\... | 40.033898 | 117 | 0.556308 | import discord
import string
from elmerbot.commands import ElmerCommand
__all__ = ["SearchCommand", "InfoCommand"]
class SearchCommand(ElmerCommand):
command = "search"
description = (
"Search for a whisky by name. Optionally put a number of results to limit it to in front of "
"your query.\... | true | true |
f736354e5a0f20eea35eceff7914e22c35491058 | 7,259 | py | Python | tests/test_grid.py | eEcoLiDAR/lcMacroPipeline | 91709f93ef53a3e453f0ce967e1094688688f684 | [
"Apache-2.0"
] | 2 | 2021-02-17T14:41:50.000Z | 2021-04-07T12:06:21.000Z | tests/test_grid.py | eEcoLiDAR/lcMacroPipeline | 91709f93ef53a3e453f0ce967e1094688688f684 | [
"Apache-2.0"
] | 16 | 2020-03-11T08:39:46.000Z | 2020-05-20T10:42:29.000Z | tests/test_grid.py | eEcoLiDAR/Laserfarm | 91709f93ef53a3e453f0ce967e1094688688f684 | [
"Apache-2.0"
] | 2 | 2020-07-06T08:18:56.000Z | 2020-08-19T12:00:26.000Z | from pathlib import Path
import unittest
import numpy as np
import pylas
from laserfarm.grid import Grid
try:
import matplotlib
matplotlib_available = True
except ModuleNotFoundError:
matplotlib_available = False
if matplotlib_available:
matplotlib.use('Agg')
import matplotlib.pyplot as plt
cla... | 35.067633 | 87 | 0.573908 | from pathlib import Path
import unittest
import numpy as np
import pylas
from laserfarm.grid import Grid
try:
import matplotlib
matplotlib_available = True
except ModuleNotFoundError:
matplotlib_available = False
if matplotlib_available:
matplotlib.use('Agg')
import matplotlib.pyplot as plt
cla... | true | true |
f73635595a57c8cdfe5c9fda02943fccf1922333 | 2,431 | py | Python | examples/crud_rest_api/config.py | NeolithEra/Flask-AppBuilder | d9561bf89d925a2f5d74c226318884733b52718f | [
"BSD-3-Clause"
] | 3,862 | 2015-01-01T11:59:24.000Z | 2022-03-31T19:23:55.000Z | examples/crud_rest_api/config.py | NeolithEra/Flask-AppBuilder | d9561bf89d925a2f5d74c226318884733b52718f | [
"BSD-3-Clause"
] | 1,566 | 2015-01-01T23:26:11.000Z | 2022-03-31T16:23:08.000Z | examples/crud_rest_api/config.py | NeolithEra/Flask-AppBuilder | d9561bf89d925a2f5d74c226318884733b52718f | [
"BSD-3-Clause"
] | 1,352 | 2015-01-02T10:45:59.000Z | 2022-03-26T20:56:48.000Z | import os
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY = "\2\1thisismyscretkey\1\2\e\y\y\h"
OPENID_PROVIDERS = [
{"name": "Google", "url": "https://www.google.com/accounts/o8/id"},
{"name": "Yahoo", "url": "https://me.yahoo.com"},
{"name": "AOL", "url": "http://open... | 30.772152 | 84 | 0.588235 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY = "\2\1thisismyscretkey\1\2\e\y\y\h"
OPENID_PROVIDERS = [
{"name": "Google", "url": "https://www.google.com/accounts/o8/id"},
{"name": "Yahoo", "url": "https://me.yahoo.com"},
{"name": "AOL", "url": "http://open... | true | true |
f73635be840dcaa8541d5a931f7dd2184a0e9aca | 2,888 | py | Python | test/test_custom.py | lyon916/pyecharts | 40efd119ec7bccb4bc3d5dab985ec7aca2936911 | [
"MIT"
] | null | null | null | test/test_custom.py | lyon916/pyecharts | 40efd119ec7bccb4bc3d5dab985ec7aca2936911 | [
"MIT"
] | null | null | null | test/test_custom.py | lyon916/pyecharts | 40efd119ec7bccb4bc3d5dab985ec7aca2936911 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#coding=utf-8
from pyecharts import Bar, Line, Scatter, EffectScatter, Kline
def test_custom():
# custom_0
attr = ['A', 'B', 'C', 'D', 'E', 'F']
v1 = [10, 20, 30, 40, 50, 60]
v2 = [15, 25, 35, 45, 55, 65]
v3 = [38, 28, 58, 48, 78, 68]
bar = Bar("Line - Bar 示例")
bar.a... | 35.654321 | 79 | 0.532895 |
from pyecharts import Bar, Line, Scatter, EffectScatter, Kline
def test_custom():
attr = ['A', 'B', 'C', 'D', 'E', 'F']
v1 = [10, 20, 30, 40, 50, 60]
v2 = [15, 25, 35, 45, 55, 65]
v3 = [38, 28, 58, 48, 78, 68]
bar = Bar("Line - Bar 示例")
bar.add("bar", attr, v1)
line = Line()
li... | true | true |
f73636427e005194ae2caceac942ddd1063e52d3 | 1,078 | py | Python | code/src/plan2scene/texture_gen/custom_ops/noise.py | madhawav/plan2scene | cc3481f503fc096d1a50ea4fbcc668b2a3b75fb5 | [
"MIT"
] | 305 | 2021-06-09T23:30:34.000Z | 2022-03-30T02:49:45.000Z | code/src/plan2scene/texture_gen/custom_ops/noise.py | madhawav/plan2scene | cc3481f503fc096d1a50ea4fbcc668b2a3b75fb5 | [
"MIT"
] | 8 | 2021-06-11T01:59:26.000Z | 2022-03-24T21:32:21.000Z | code/src/plan2scene/texture_gen/custom_ops/noise.py | madhawav/plan2scene | cc3481f503fc096d1a50ea4fbcc668b2a3b75fb5 | [
"MIT"
] | 32 | 2021-06-09T23:19:23.000Z | 2022-03-05T14:03:15.000Z | # Code adapted from https://github.com/henzler/neuraltexture/blob/master/code/custom_ops/noise/noise.py
from torch import nn
from torch.autograd import Function
import plan2scene.texture_gen.utils.neural_texture_helper as utils_nt
import noise_cuda
import torch
import numpy as np
from torch.autograd import gradcheck
... | 29.944444 | 103 | 0.730056 |
from torch import nn
from torch.autograd import Function
import plan2scene.texture_gen.utils.neural_texture_helper as utils_nt
import noise_cuda
import torch
import numpy as np
from torch.autograd import gradcheck
class NoiseFunction(Function):
@staticmethod
def forward(ctx, position, seed):
ctx.sav... | true | true |
f736365887c9571c3e54f907948e54ccd5725e4e | 6,414 | py | Python | src/rdb/models/environment.py | juliangruendner/ketos_brain_api | 6ec7e01a0996abb03dba090d832a5e1020df4180 | [
"MIT"
] | null | null | null | src/rdb/models/environment.py | juliangruendner/ketos_brain_api | 6ec7e01a0996abb03dba090d832a5e1020df4180 | [
"MIT"
] | null | null | null | src/rdb/models/environment.py | juliangruendner/ketos_brain_api | 6ec7e01a0996abb03dba090d832a5e1020df4180 | [
"MIT"
] | null | null | null | from rdb.rdb import db, LowerCaseText
from enum import Enum
import datetime
from resources.adminAccess import is_admin_user
from flask import g
import rdb.models.image as Image
from dockerUtil.dockerClient import dockerClient, wait_for_it
import config
import requests
import uuid
from flask_restful import abort
import ... | 30.112676 | 128 | 0.63985 | from rdb.rdb import db, LowerCaseText
from enum import Enum
import datetime
from resources.adminAccess import is_admin_user
from flask import g
import rdb.models.image as Image
from dockerUtil.dockerClient import dockerClient, wait_for_it
import config
import requests
import uuid
from flask_restful import abort
import ... | true | true |
f736369cbe9d074b967f6f6e71550893a185fd79 | 4,636 | py | Python | src/ball_window.py | gltchitm/desktop-pong | aff92e8fc683d72e6139b33b56736dc2fe9c3ca0 | [
"MIT"
] | null | null | null | src/ball_window.py | gltchitm/desktop-pong | aff92e8fc683d72e6139b33b56736dc2fe9c3ca0 | [
"MIT"
] | null | null | null | src/ball_window.py | gltchitm/desktop-pong | aff92e8fc683d72e6139b33b56736dc2fe9c3ca0 | [
"MIT"
] | null | null | null | from gi.repository import Gtk, Gdk
import cairo
from random import getrandbits
from ball_drawing_area import BallDrawingArea
from store import store
from near import near
import config
def rand_velocity():
return config.BALL_VELOCITY if getrandbits(1) else -config.BALL_VELOCITY
class BallWindow(Gtk.Window):
... | 34.597015 | 110 | 0.622951 | from gi.repository import Gtk, Gdk
import cairo
from random import getrandbits
from ball_drawing_area import BallDrawingArea
from store import store
from near import near
import config
def rand_velocity():
return config.BALL_VELOCITY if getrandbits(1) else -config.BALL_VELOCITY
class BallWindow(Gtk.Window):
... | true | true |
f73637169849c878d792f9992621b4bc541554d0 | 1,918 | py | Python | task/collect_thirdparty_licenses.py | yshrk1597/nimclosedenv | 2fc92e4e3b03e9f9aed92642af742ac4d4ffb1e6 | [
"MIT"
] | null | null | null | task/collect_thirdparty_licenses.py | yshrk1597/nimclosedenv | 2fc92e4e3b03e9f9aed92642af742ac4d4ffb1e6 | [
"MIT"
] | null | null | null | task/collect_thirdparty_licenses.py | yshrk1597/nimclosedenv | 2fc92e4e3b03e9f9aed92642af742ac4d4ffb1e6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import os
import pathlib
import json
import urllib.parse
import requests
'''
json format
[
{
"name": "",
"url": "",
"category":"",
"filename-format":""
},
]
'''
def download(session, url, filename):
print(f"get {url}")
r = session.get(url)
if r.status_code =... | 29.507692 | 94 | 0.487487 |
import sys
import os
import pathlib
import json
import urllib.parse
import requests
def download(session, url, filename):
print(f"get {url}")
r = session.get(url)
if r.status_code == requests.codes.ok:
print(f"save {filename}")
data = r.text
with open(filename, "w", encoding='u... | true | true |
f7363798e2b7842fd9105ce3f50bac3499622d10 | 4,632 | py | Python | fortnox/services/cost_center_services.py | xalien10/fortnox-python | 7c5fe29a8adaa5a21288df4495996e20515ba8a7 | [
"MIT"
] | 21 | 2020-03-21T14:49:33.000Z | 2022-02-02T12:46:08.000Z | fortnox/services/cost_center_services.py | xalien10/fortnox-python | 7c5fe29a8adaa5a21288df4495996e20515ba8a7 | [
"MIT"
] | 5 | 2020-07-03T18:55:48.000Z | 2021-11-02T10:25:32.000Z | fortnox/services/cost_center_services.py | xalien10/fortnox-python | 7c5fe29a8adaa5a21288df4495996e20515ba8a7 | [
"MIT"
] | 3 | 2020-06-08T06:23:50.000Z | 2021-06-10T18:28:32.000Z | class CostCenterService(object):
"""
:class:`fortnox.CostCenterService` is used by :class:`fortnox.Client` to make
actions related to CostCenter resource.
Normally you won't instantiate this class directly.
"""
"""
Allowed attributes for CostCenter to send to Fortnox backend servers.
"... | 38.280992 | 152 | 0.656952 | class CostCenterService(object):
OPTS_KEYS_TO_PERSIST = ['Code', 'Description']
SERVICE = "CostCenter"
def __init__(self, http_client):
self.__http_client = http_client
@property
def http_client(self):
return self.__http_client
def list(self, **params):
_, _, cost_c... | true | true |
f736379af05a58f020259421e3c7351eadc9ff8b | 22,039 | py | Python | qa/rpc-tests/replace-by-fee.py | GregoryBetz/syscoin2 | 22f8fed70a89b6fcc2226fc433fa9a394cd022b1 | [
"MIT"
] | 1 | 2020-05-31T00:36:32.000Z | 2020-05-31T00:36:32.000Z | qa/rpc-tests/replace-by-fee.py | GregoryBetz/syscoin2 | 22f8fed70a89b6fcc2226fc433fa9a394cd022b1 | [
"MIT"
] | null | null | null | qa/rpc-tests/replace-by-fee.py | GregoryBetz/syscoin2 | 22f8fed70a89b6fcc2226fc433fa9a394cd022b1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Syscoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test replace by fee code
#
from test_framework.test_framework import SyscoinTestFramework
from test_... | 37.102694 | 105 | 0.602977 |
from test_framework.test_framework import SyscoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
import binascii
COIN = 100000000
MAX_REPLACEMENT_LIMIT = 100
def satoshi_round(amount):
return Decimal(amount).quantize(Decimal('0.000... | false | true |
f736383903fae4d8d7d3cbcadabd5161e1f75a1b | 5,125 | py | Python | src/foolysh/fsm.py | tcdude/foolysh | dedd6eb655b9eab1d1ac90c6624b0ca92f54486f | [
"MIT"
] | 2 | 2019-05-04T01:22:55.000Z | 2019-10-04T10:48:05.000Z | src/foolysh/fsm.py | tcdude/foolysh | dedd6eb655b9eab1d1ac90c6624b0ca92f54486f | [
"MIT"
] | 5 | 2020-03-09T16:15:13.000Z | 2022-01-13T02:02:27.000Z | src/foolysh/fsm.py | tcdude/foolysh | dedd6eb655b9eab1d1ac90c6624b0ca92f54486f | [
"MIT"
] | null | null | null | """
Provides the FSM class, a rudimentary implementation of a Finite State Machine.
"""
from typing import Any, Callable, Dict, List, Optional, Tuple
import sdl2
from .tools.common import to_snake_case
__author__ = 'Tiziano Bettio'
__license__ = 'MIT'
__version__ = '0.1'
__copyright__ = """Copyright (c) 2020 Tizian... | 38.246269 | 79 | 0.658537 |
from typing import Any, Callable, Dict, List, Optional, Tuple
import sdl2
from .tools.common import to_snake_case
__author__ = 'Tiziano Bettio'
__license__ = 'MIT'
__version__ = '0.1'
__copyright__ = """Copyright (c) 2020 Tiziano Bettio
Permission is hereby granted, free of charge, to any person obtaining a copy
o... | true | true |
f736392d8c764845b6ae8e78f7c882654f9d241a | 10,071 | py | Python | impactutils/transfer/ftpsender.py | cbworden/earthquake-impact-utils | fff41e41668896110bebbc7054a36dd60779655b | [
"CC0-1.0"
] | 3 | 2017-04-11T21:30:20.000Z | 2018-02-28T23:17:30.000Z | impactutils/transfer/ftpsender.py | cbworden/earthquake-impact-utils | fff41e41668896110bebbc7054a36dd60779655b | [
"CC0-1.0"
] | 103 | 2016-08-26T15:05:35.000Z | 2021-02-10T16:24:55.000Z | impactutils/transfer/ftpsender.py | cbworden/earthquake-impact-utils | fff41e41668896110bebbc7054a36dd60779655b | [
"CC0-1.0"
] | 9 | 2016-08-24T01:07:40.000Z | 2022-03-01T10:03:27.000Z | #!/usr/bin/env python
# stdlib imports
from ftplib import FTP, error_perm
import os.path
import shutil
import tempfile
# local
from .sender import Sender
class FTPSender(Sender):
'''Class for sending and deleting files and directories via FTP.
PDLSender uses a local installation of Product Distribution Lay... | 36.357401 | 125 | 0.577599 |
from ftplib import FTP, error_perm
import os.path
import shutil
import tempfile
from .sender import Sender
class FTPSender(Sender):
_required_properties = ['remote_directory', 'remote_host']
_optional_properties = ['user', 'password']
def send(self):
remote_host = self._properties['remote_ho... | true | true |
f7363a620e54c23fd07ebc30b998619f01c85f21 | 3,491 | py | Python | Examples/IPlugWebUI/scripts/update_version.py | badi91/iPlug2 | e508e85060871cef4ff16c9bc80c503c375e0a14 | [
"Zlib"
] | 1,305 | 2018-07-28T08:48:47.000Z | 2022-03-31T23:06:59.000Z | Examples/IPlugWebUI/scripts/update_version.py | badi91/iPlug2 | e508e85060871cef4ff16c9bc80c503c375e0a14 | [
"Zlib"
] | 582 | 2019-01-01T15:37:55.000Z | 2022-03-30T22:57:16.000Z | Examples/IPlugWebUI/scripts/update_version.py | badi91/iPlug2 | e508e85060871cef4ff16c9bc80c503c375e0a14 | [
"Zlib"
] | 284 | 2018-10-17T22:16:26.000Z | 2022-03-30T15:38:19.000Z | #!/usr/bin/python
# this script will update the versions in plist and installer files to match that in config.h
import plistlib, os, datetime, fileinput, glob, sys, string, shutil
scriptpath = os.path.dirname(os.path.realpath(__file__))
projectpath = os.path.abspath(os.path.join(scriptpath, os.pardir))
IPLUG2_ROOT ... | 36.364583 | 116 | 0.727872 |
import plistlib, os, datetime, fileinput, glob, sys, string, shutil
scriptpath = os.path.dirname(os.path.realpath(__file__))
projectpath = os.path.abspath(os.path.join(scriptpath, os.pardir))
IPLUG2_ROOT = "../../.."
sys.path.insert(0, os.path.join(os.getcwd(), IPLUG2_ROOT + '/Scripts'))
from parse_config impor... | false | true |
f7363ac8e3c301222fb9085a20025b96b226a9eb | 4,958 | py | Python | Chapter9/Figure9-1.py | liloganle/Reinforcement-Learning | 29ffb74a1c8e506c544245c9aff37e958e503f26 | [
"MIT"
] | 1 | 2018-08-27T10:09:06.000Z | 2018-08-27T10:09:06.000Z | Chapter9/Figure9-1.py | liloganle/Reinforcement-Learning | 29ffb74a1c8e506c544245c9aff37e958e503f26 | [
"MIT"
] | null | null | null | Chapter9/Figure9-1.py | liloganle/Reinforcement-Learning | 29ffb74a1c8e506c544245c9aff37e958e503f26 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
class RandomWalk(object):
def __init__(self, num_states=1000, groups=10, alpha=2e-5):
self.num_states = num_states # the number of states
self.groups = groups # the number... | 39.349206 | 107 | 0.594796 |
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
class RandomWalk(object):
def __init__(self, num_states=1000, groups=10, alpha=2e-5):
self.num_states = num_states
self.groups = groups
self.alpha = alpha
... | true | true |
f7363b31d00a4b9a3ce297b2c0f2291a97db0556 | 3,344 | py | Python | var/spack/repos/builtin/packages/spdlog/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/spdlog/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/spdlog/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2022-01-18T23:39:24.000Z | 2022-01-18T23:39:24.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Spdlog(CMakePackage):
"""Very fast, header only, C++ logging library"""
homepage = "h... | 54.819672 | 96 | 0.747309 |
from spack import *
class Spdlog(CMakePackage):
homepage = "https://github.com/gabime/spdlog"
url = "https://github.com/gabime/spdlog/archive/v0.9.0.tar.gz"
version('1.8.1', sha256='5197b3147cfcfaa67dd564db7b878e4a4b3d9f3443801722b3915cdeced656cb')
version('1.8.0', sha256='1e68e9b40cf63bb022a4b... | true | true |
f7363c67ecf0557ee81b88769cad34b8eafd3728 | 682 | py | Python | Python Advanced/Advanced/Tuples and Sets/Exercise/Task06.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | 1 | 2022-03-16T10:23:04.000Z | 2022-03-16T10:23:04.000Z | Python Advanced/Advanced/Tuples and Sets/Exercise/Task06.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | null | null | null | Python Advanced/Advanced/Tuples and Sets/Exercise/Task06.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | null | null | null | n = int(input())
even_set = set()
odd_set = set()
for index in range(1, n + 1):
name = input()
ascii_value = 0
for char in name:
ascii_value += ord(char)
ascii_value /= index
ascii_value = int(ascii_value)
if ascii_value % 2 == 0:
even_set.add(ascii_value)
else:
... | 22.733333 | 52 | 0.61437 | n = int(input())
even_set = set()
odd_set = set()
for index in range(1, n + 1):
name = input()
ascii_value = 0
for char in name:
ascii_value += ord(char)
ascii_value /= index
ascii_value = int(ascii_value)
if ascii_value % 2 == 0:
even_set.add(ascii_value)
else:
... | true | true |
f7363e2b72f9b4c0f235a44590c692b9349869a4 | 1,532 | py | Python | server/canonicalization/utils/log.py | hotpxl/canonicalization-server | ac3c0e93adf35015d7f6cfc8c6cf2e6ec45cdeae | [
"MIT"
] | 3 | 2015-10-29T21:43:27.000Z | 2020-05-26T09:17:41.000Z | server/canonicalization/utils/log.py | hotpxl/canonicalization-server | ac3c0e93adf35015d7f6cfc8c6cf2e6ec45cdeae | [
"MIT"
] | null | null | null | server/canonicalization/utils/log.py | hotpxl/canonicalization-server | ac3c0e93adf35015d7f6cfc8c6cf2e6ec45cdeae | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import logging
class _Formatter(logging.Formatter):
def __init__(self):
datefmt = '%m%d %H:%M:%S'
super(_Formatter, self).__init__(datefmt=datefmt)
def get_color(self, level):
if logging.WARNING <= level:
... | 27.357143 | 79 | 0.580287 | from __future__ import absolute_import
from __future__ import print_function
import logging
class _Formatter(logging.Formatter):
def __init__(self):
datefmt = '%m%d %H:%M:%S'
super(_Formatter, self).__init__(datefmt=datefmt)
def get_color(self, level):
if logging.WARNING <= level:
... | true | true |
f7363ff34bb5175c2483c71a8f1bc69582de84b2 | 3,302 | py | Python | techreview/settings.py | lcared/TechReview2021 | 96b5f9af3c35f2f1dc79e6c53b48623d84e21da8 | [
"MIT"
] | 1 | 2021-06-14T17:39:37.000Z | 2021-06-14T17:39:37.000Z | techreview/settings.py | mjelde/TechReview2021 | 96b5f9af3c35f2f1dc79e6c53b48623d84e21da8 | [
"MIT"
] | null | null | null | techreview/settings.py | mjelde/TechReview2021 | 96b5f9af3c35f2f1dc79e6c53b48623d84e21da8 | [
"MIT"
] | null | null | null | """
Django settings for techreview project.
Generated by 'django-admin startproject' using Django 3.1.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from path... | 25.796875 | 91 | 0.692611 |
from pathlib import Path
from decouple import config
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = config('SECRET_KEY')
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
... | true | true |
f73640ecbf844dab79db03ff22b848317b94f45e | 3,023 | py | Python | sphinx/source/tutorial/solutions/les_mis.py | timelyportfolio/bokeh | a976a85535cf137c6238ce9e90b41ab14ae8ce22 | [
"BSD-3-Clause"
] | 2 | 2021-09-01T12:36:06.000Z | 2021-11-17T10:48:36.000Z | sphinx/source/tutorial/solutions/les_mis.py | brian15co/bokeh | 6cecb7211277b9d838039d0eb15e50a10f9ac3d1 | [
"BSD-3-Clause"
] | null | null | null | sphinx/source/tutorial/solutions/les_mis.py | brian15co/bokeh | 6cecb7211277b9d838039d0eb15e50a10f9ac3d1 | [
"BSD-3-Clause"
] | 1 | 2016-03-18T03:01:59.000Z | 2016-03-18T03:01:59.000Z | import numpy as np
from bokeh.plotting import figure, output_file, show
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.sampledata.les_mis import data
# EXERCISE: try out different sort orders for the names
nodes = data['nodes']
names = [node['name'] for node in sorted(data['nodes'], key=lambda x: x['... | 32.505376 | 84 | 0.670526 | import numpy as np
from bokeh.plotting import figure, output_file, show
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.sampledata.les_mis import data
nodes = data['nodes']
names = [node['name'] for node in sorted(data['nodes'], key=lambda x: x['group'])]
N = len(nodes)
counts = np.empty((N, N))
fo... | true | true |
f73641597666934bb64b5e3940ed3742742977cd | 3,013 | py | Python | Scribe/other_estimators.py | aristoteleo/scribe-py | ea28d2b588f8648b9ce1679fe18c3142aee2aa58 | [
"BSD-3-Clause"
] | 32 | 2019-08-15T20:58:30.000Z | 2022-03-17T14:16:31.000Z | Scribe/other_estimators.py | aristoteleo/scribe-py | ea28d2b588f8648b9ce1679fe18c3142aee2aa58 | [
"BSD-3-Clause"
] | 6 | 2020-03-06T06:02:08.000Z | 2022-03-30T22:37:59.000Z | Scribe/other_estimators.py | aristoteleo/scribe-py | ea28d2b588f8648b9ce1679fe18c3142aee2aa58 | [
"BSD-3-Clause"
] | 10 | 2020-03-05T09:56:04.000Z | 2021-03-14T12:16:54.000Z | import pandas
import numpy as np
from multiprocessing import Pool
def __individual_corr(id1, id2, x, y):
return (id1, id2, corr(x, y)[0])
def __individual_mi(id1, id2, x, y):
return (id1, id2, mi(x, y))
def corr(self, number_of_processes=1):
"""Calculate pairwise correlation over the data
Argumen... | 35.869048 | 185 | 0.654165 | import pandas
import numpy as np
from multiprocessing import Pool
def __individual_corr(id1, id2, x, y):
return (id1, id2, corr(x, y)[0])
def __individual_mi(id1, id2, x, y):
return (id1, id2, mi(x, y))
def corr(self, number_of_processes=1):
self.corr_results = pandas.DataFrame({node_id: [np.nan for i... | true | true |
f73642dae27409c6118a87490a8475aae4fb34f2 | 5,536 | py | Python | liteflow/input.py | frankilepro/LiTeFlow | d07105ea00ad29b701e1b100d9cda2297eef19de | [
"Apache-2.0"
] | null | null | null | liteflow/input.py | frankilepro/LiTeFlow | d07105ea00ad29b701e1b100d9cda2297eef19de | [
"Apache-2.0"
] | null | null | null | liteflow/input.py | frankilepro/LiTeFlow | d07105ea00ad29b701e1b100d9cda2297eef19de | [
"Apache-2.0"
] | null | null | null | """Utilities for input pipelines."""
import tensorflow as tf
def shuffle(tensors,
capacity=32,
min_after_dequeue=16,
num_threads=1,
dtypes=None,
shapes=None,
seed=None,
shared_name=None,
name='shuffle'):
"""Wrapper ar... | 40.705882 | 83 | 0.627168 |
import tensorflow as tf
def shuffle(tensors,
capacity=32,
min_after_dequeue=16,
num_threads=1,
dtypes=None,
shapes=None,
seed=None,
shared_name=None,
name='shuffle'):
tensors = list(tensors)
with tf.name_scope(na... | true | true |
f73642fd4c1a40e9dd300d78c5863ed4603901d6 | 12,577 | py | Python | tsfresh/feature_selection/relevance.py | Nickwangpeng/tsfresh | 48118627d9d4644906613e25b077ce2ec82ca2f9 | [
"MIT"
] | 1 | 2020-03-25T22:08:04.000Z | 2020-03-25T22:08:04.000Z | tsfresh/feature_selection/relevance.py | Chao-Jiang/tsfresh | 48118627d9d4644906613e25b077ce2ec82ca2f9 | [
"MIT"
] | null | null | null | tsfresh/feature_selection/relevance.py | Chao-Jiang/tsfresh | 48118627d9d4644906613e25b077ce2ec82ca2f9 | [
"MIT"
] | 1 | 2019-12-30T14:07:12.000Z | 2019-12-30T14:07:12.000Z | # -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016
"""
Contains a feature selection method that evaluates the importance of the different extracted features. To do so,
for ev... | 45.078853 | 120 | 0.678699 |
from multiprocessing import Pool
import warnings
import numpy as np
import pandas as pd
from functools import partial, reduce
from tsfresh import defaults
from tsfresh.feature_selection.benjamini_hochberg_test import benjamini_hochberg_test
from tsfresh.feature_selection.significance_tests import target_binary_fe... | true | true |
f7364342837e8e9664cc1bea548231dfc7f87e39 | 5,173 | py | Python | welib/FEM/reduction.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | 24 | 2019-07-24T23:37:10.000Z | 2022-03-30T20:40:40.000Z | welib/FEM/reduction.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | null | null | null | welib/FEM/reduction.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | 11 | 2019-03-14T13:47:04.000Z | 2022-03-31T15:47:27.000Z | import numpy as np
from welib.system.eva import eig
def CraigBampton(MM, KK, Ileader, nModesCB=None, Ifollow=None, F=None, DD=None, fullModesOut=False):
"""
Performs the CraigBampton (CB) reduction of a system given some input master dofs index
and a number of modes. Reduced matrices, and Guyan and Crai... | 34.486667 | 167 | 0.594626 | import numpy as np
from welib.system.eva import eig
def CraigBampton(MM, KK, Ileader, nModesCB=None, Ifollow=None, F=None, DD=None, fullModesOut=False):
Ileader = np.asarray(Ileader).ravel()
if Ifollow is None:
Iall = np.arange(len(MM))
Ifollow = [i for i in Iall i... | true | true |
f7364375968b371ac7c5110a2aae3ab9342ca3bb | 2,884 | py | Python | .venv/lib/python3.8/site-packages/pycrop/tools.py | amon-wanyonyi/publication | caae5e04f9191493408145ac80dc943dba7e93ca | [
"MIT"
] | null | null | null | .venv/lib/python3.8/site-packages/pycrop/tools.py | amon-wanyonyi/publication | caae5e04f9191493408145ac80dc943dba7e93ca | [
"MIT"
] | null | null | null | .venv/lib/python3.8/site-packages/pycrop/tools.py | amon-wanyonyi/publication | caae5e04f9191493408145ac80dc943dba7e93ca | [
"MIT"
] | null | null | null | import os
import re
from math import floor
from PIL import Image
def default_save_path(path, size):
savepath, ext = os.path.splitext(path)
savepath = '%s__w%dh%d%s' % (savepath, *size, ext)
return savepath
def assure_path_exists(path):
if not os.path.exists(path):
os.makedirs(path)
def no... | 25.298246 | 69 | 0.601942 | import os
import re
from math import floor
from PIL import Image
def default_save_path(path, size):
savepath, ext = os.path.splitext(path)
savepath = '%s__w%dh%d%s' % (savepath, *size, ext)
return savepath
def assure_path_exists(path):
if not os.path.exists(path):
os.makedirs(path)
def no... | true | true |
f73644650dd1855dd44249090e286bf11f7c6b16 | 11,199 | py | Python | mlbench_core/optim/pytorch/fp_optimizers.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | null | null | null | mlbench_core/optim/pytorch/fp_optimizers.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | null | null | null | mlbench_core/optim/pytorch/fp_optimizers.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | null | null | null | # import ctypes
import logging
import math
import torch
import torch.distributed as dist
from torch.nn.utils import clip_grad_norm_
from mlbench_core.utils.pytorch.distributed import (
AllReduceAggregation,
AllReduceAggregationHVD,
)
try:
from apex.optimizers import FusedAdam
from apex import amp
exc... | 32.273775 | 150 | 0.628003 |
import logging
import math
import torch
import torch.distributed as dist
from torch.nn.utils import clip_grad_norm_
from mlbench_core.utils.pytorch.distributed import (
AllReduceAggregation,
AllReduceAggregationHVD,
)
try:
from apex.optimizers import FusedAdam
from apex import amp
except ImportError... | true | true |
f736477bb6aa66636e35c7f32ac0a2e1313242fa | 8,375 | py | Python | secmmf/mmf_data_loader/form_parsers.py | yj1990/sec_mmf | 72a8c0d5a6aadb4362c07a5606c70e51b08a53cd | [
"MIT"
] | 1 | 2019-12-20T17:52:14.000Z | 2019-12-20T17:52:14.000Z | secmmf/mmf_data_loader/form_parsers.py | yj1990/sec_mmf | 72a8c0d5a6aadb4362c07a5606c70e51b08a53cd | [
"MIT"
] | null | null | null | secmmf/mmf_data_loader/form_parsers.py | yj1990/sec_mmf | 72a8c0d5a6aadb4362c07a5606c70e51b08a53cd | [
"MIT"
] | null | null | null | import pandas as pd
import bs4 as bs
import untangle as ut
import requests
import urllib.request as rq
from collections import OrderedDict
from secmmf.mmf_data_loader.utils import get_edgar_url
class N_MFP2:
def __init__(self):
self.select_cols()
def born(self, tag):
# if tag is a single-nod... | 43.848168 | 109 | 0.488597 | import pandas as pd
import bs4 as bs
import untangle as ut
import requests
import urllib.request as rq
from collections import OrderedDict
from secmmf.mmf_data_loader.utils import get_edgar_url
class N_MFP2:
def __init__(self):
self.select_cols()
def born(self, tag):
childs... | true | true |
f73647b2a6012065708253b687595d2d32a619e0 | 6,002 | bzl | Python | go/private/actions/archive.bzl | tomlu/rules_go | 28dd92b09c978ad09c74c18161a1da844235adfb | [
"Apache-2.0"
] | 1 | 2020-12-02T20:04:26.000Z | 2020-12-02T20:04:26.000Z | go/private/actions/archive.bzl | tomlu/rules_go | 28dd92b09c978ad09c74c18161a1da844235adfb | [
"Apache-2.0"
] | null | null | null | go/private/actions/archive.bzl | tomlu/rules_go | 28dd92b09c978ad09c74c18161a1da844235adfb | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 36.375758 | 139 | 0.619294 |
load(
"@io_bazel_rules_go//go/private:common.bzl",
"as_tuple",
"split_srcs",
)
load(
"@io_bazel_rules_go//go/private:mode.bzl",
"LINKMODE_C_ARCHIVE",
"LINKMODE_C_SHARED",
"mode_string",
)
load(
"@io_bazel_rules_go//go/private:providers.bzl",
"GoArchive",
"GoArchiveD... | true | true |
f73647b504c490e3c41803e6e2a4d597213a1d43 | 1,900 | py | Python | gsadjust/data/__init__.py | jkennedy-usgs/sgp-gsadjust | 929d650674b942d33168bcdaae7da07db175a1c4 | [
"CC0-1.0"
] | 5 | 2019-01-08T13:51:23.000Z | 2020-04-22T19:04:20.000Z | gsadjust/data/__init__.py | jkennedy-usgs/sgp-gsadjust | 929d650674b942d33168bcdaae7da07db175a1c4 | [
"CC0-1.0"
] | 113 | 2018-06-14T21:39:59.000Z | 2022-01-21T19:34:12.000Z | gsadjust/data/__init__.py | jkennedy-usgs/sgp-gsadjust | 929d650674b942d33168bcdaae7da07db175a1c4 | [
"CC0-1.0"
] | 3 | 2021-01-26T07:10:42.000Z | 2022-03-15T12:39:35.000Z | """
data
====
GSadjust objects for non-Survey | Loop | Station objects (those are
represented as PyQt objects).
--------------------------------------------------------------------------------
The main data objects are:
ChannelList: Holds lists of observed data values (g, tilt, temp, etc.). The
lists are ... | 35.849057 | 81 | 0.728421 | from . import adjustment, analysis, channel, correction, datum, delta, tare
from .adjustment import (
AdjustedStation,
Adjustment,
AdjustmentOptions,
AdjustmentResults,
)
from .channel import ChannelList
from .datum import Datum
from .delta import (
Delta3Point,
DeltaList,
DeltaN... | true | true |
f73647cb9744604fcafbadc9ef4a6ae28b197403 | 937 | py | Python | named_entity_recognition1.py | DreamFireworks/nlp | e96e6f505964f1886e3de5347f2c1179cf2578e5 | [
"MIT"
] | null | null | null | named_entity_recognition1.py | DreamFireworks/nlp | e96e6f505964f1886e3de5347f2c1179cf2578e5 | [
"MIT"
] | null | null | null | named_entity_recognition1.py | DreamFireworks/nlp | e96e6f505964f1886e3de5347f2c1179cf2578e5 | [
"MIT"
] | null | null | null | import nltk
text="""A biography of Yue Fei, the Eguo Jintuo Zubian (鄂國金佗稡编), was written 60 years after his death by his grandson, the poet and historian Yue Ke (岳柯) (1183–post 1240).[3][4][5] In 1346 it was incorporated into the History of Song, a 496-chapter record of historical events and biographies of noted Song ... | 72.076923 | 621 | 0.770544 | import nltk
text="""A biography of Yue Fei, the Eguo Jintuo Zubian (鄂國金佗稡编), was written 60 years after his death by his grandson, the poet and historian Yue Ke (岳柯) (1183–post 1240).[3][4][5] In 1346 it was incorporated into the History of Song, a 496-chapter record of historical events and biographies of noted Song ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.