hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2b1515b9e65d57fbf2aa7118c59965ea71710713 | 2,978 | py | Python | XY/roc.py | andrewmaurer/FPM | 1c6ff2cee19a375111e43981496600ff3b8d2c80 | [
"MIT"
] | null | null | null | XY/roc.py | andrewmaurer/FPM | 1c6ff2cee19a375111e43981496600ff3b8d2c80 | [
"MIT"
] | null | null | null | XY/roc.py | andrewmaurer/FPM | 1c6ff2cee19a375111e43981496600ff3b8d2c80 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def tpr( y_pred, y_actual, threshold):
"""
y_pred : numpy array of predicted values between 0 and 1.
y_actual : numpy array of actual values, either 0 or 1.
threshold : value at which roundup begins.
Returns true positive r... | 40.243243 | 113 | 0.648758 |
c225c37ab0453fd3434b1b99a1226995f2e1260d | 1,193 | py | Python | nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py | mfalkiewicz/nipype | 775e21b78fb1ffa2ff9cb12e6f052868bd44d052 | [
"Apache-2.0"
] | 1 | 2015-01-19T13:12:27.000Z | 2015-01-19T13:12:27.000Z | nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import SwapDimensions
def test_SwapDimensions_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(deprecated='1.0.0',
... | 25.382979 | 67 | 0.642917 |
3ec28d6dc5c53b963374a9f3b4e1b0db0c86fe44 | 3,589 | py | Python | spiders/git/git/middlewares.py | dingzhaohan/deep_research | 8d4373e32d75a348368d46eca2dd1b26d8d93c4b | [
"Apache-2.0"
] | 2 | 2020-02-20T01:57:20.000Z | 2020-09-12T12:43:46.000Z | spiders/git/git/middlewares.py | dingzhaohan/deep_research | 8d4373e32d75a348368d46eca2dd1b26d8d93c4b | [
"Apache-2.0"
] | null | null | null | spiders/git/git/middlewares.py | dingzhaohan/deep_research | 8d4373e32d75a348368d46eca2dd1b26d8d93c4b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class GitSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy act... | 34.509615 | 78 | 0.665366 |
a5fe81eb9b396cdb94cfe8476bed9a44d8ff36d7 | 7,176 | py | Python | jira/resilientsession.py | zrhoffman/jira | bb99305f5c7c0d00348bdb75b1cfd37b652cce9d | [
"BSD-2-Clause"
] | null | null | null | jira/resilientsession.py | zrhoffman/jira | bb99305f5c7c0d00348bdb75b1cfd37b652cce9d | [
"BSD-2-Clause"
] | 27 | 2021-05-19T06:56:51.000Z | 2022-03-18T14:24:52.000Z | jira/resilientsession.py | zrhoffman/jira | bb99305f5c7c0d00348bdb75b1cfd37b652cce9d | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import logging
import random
from requests.exceptions import ConnectionError
from requests import Session
import time
from jira.exceptions import JIRAError
logging.getLogger("jira").addHandler(logging.NullHandler())
def raise_on_error(r, verb="???", **kwargs):
request = kwa... | 37.375 | 152 | 0.545847 |
c477802680d4fc51e49f3e9e751ef19794ad8c94 | 3,621 | py | Python | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"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.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 40.233333 | 123 | 0.677437 |
321701ae7bdf59e8821afe14c678069d40663db9 | 16,988 | py | Python | data_prep/visual_prep.py | pleonova/data-diary | e02ea27c82b87c0f5fb899191aea708de586c502 | [
"MIT"
] | 10 | 2020-06-04T17:49:06.000Z | 2022-01-02T17:03:18.000Z | data_prep/visual_prep.py | pleonova/data-diary | e02ea27c82b87c0f5fb899191aea708de586c502 | [
"MIT"
] | null | null | null | data_prep/visual_prep.py | pleonova/data-diary | e02ea27c82b87c0f5fb899191aea708de586c502 | [
"MIT"
] | 1 | 2021-05-10T04:00:06.000Z | 2021-05-10T04:00:06.000Z | import requests
import os
from datetime import date, datetime, timedelta as td
import matplotlib.dates as mdates
import pandas as pd
import numpy as np
import random
############ Data Munging ############
def time_dataframe_prep(df, start_date, end_date, start_date_column, end_date_column, category_column):
"""... | 36.850325 | 152 | 0.62191 |
ae2625dc5870ccd54054a96c2211c2cb15d0df81 | 391 | py | Python | src/easy/the-major-element/solutions/python/solution.py | rdtsc/codeeval-solutions | d5c06baf89125e9e9f4b163ee57e5a8f7e73e717 | [
"MIT"
] | null | null | null | src/easy/the-major-element/solutions/python/solution.py | rdtsc/codeeval-solutions | d5c06baf89125e9e9f4b163ee57e5a8f7e73e717 | [
"MIT"
] | null | null | null | src/easy/the-major-element/solutions/python/solution.py | rdtsc/codeeval-solutions | d5c06baf89125e9e9f4b163ee57e5a8f7e73e717 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import collections
for line in (line.rstrip() for line in sys.stdin):
frequency = collections.defaultdict(int)
for value in line.split(','):
frequency[value] += 1
majorTerm = 'None'
threshold = (line.count(',') + 1) // 2
for key, count in frequency.items():
if co... | 18.619048 | 50 | 0.647059 |
6296d8b900c7356fe0a6a8eb383288129a4a2b93 | 1,041 | py | Python | src/util/file_provider.py | fressive/koe-server | 5371fbaf66458b21f358bae7513c9c3ebb0c3da1 | [
"MIT"
] | null | null | null | src/util/file_provider.py | fressive/koe-server | 5371fbaf66458b21f358bae7513c9c3ebb0c3da1 | [
"MIT"
] | null | null | null | src/util/file_provider.py | fressive/koe-server | 5371fbaf66458b21f358bae7513c9c3ebb0c3da1 | [
"MIT"
] | null | null | null | from model.config import Config
import os
class FileProvider:
@staticmethod
def save(md5, data):
pass
@staticmethod
def get(md5):
pass
@staticmethod
def get_instance(provider):
if provider == "local_storage":
return LocalStorage()
elif provider == ... | 22.630435 | 62 | 0.600384 |
cfbfe96633dc1abc92ba66abe178a3c2965f9cbc | 811 | py | Python | CosmonautBlog/manage.py | WelcomeToTheRapture/CosmonautBlog | 7936a9e7efb71d733f2f281f91913c05d099e198 | [
"MIT"
] | null | null | null | CosmonautBlog/manage.py | WelcomeToTheRapture/CosmonautBlog | 7936a9e7efb71d733f2f281f91913c05d099e198 | [
"MIT"
] | null | null | null | CosmonautBlog/manage.py | WelcomeToTheRapture/CosmonautBlog | 7936a9e7efb71d733f2f281f91913c05d099e198 | [
"MIT"
] | 1 | 2018-02-14T03:41:22.000Z | 2018-02-14T03:41:22.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CosmonautBlog.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure tha... | 35.26087 | 77 | 0.644883 |
95faf988d9ab488921c6764be4ea87352e154dff | 3,264 | py | Python | python/getting_started/aws_signing.py | ludokriss/getting-started | 5a95297ad27e1d5328d30d59807568e3c3890591 | [
"MIT"
] | null | null | null | python/getting_started/aws_signing.py | ludokriss/getting-started | 5a95297ad27e1d5328d30d59807568e3c3890591 | [
"MIT"
] | null | null | null | python/getting_started/aws_signing.py | ludokriss/getting-started | 5a95297ad27e1d5328d30d59807568e3c3890591 | [
"MIT"
] | null | null | null | import datetime
import hashlib
import hmac
def now():
return datetime.datetime.utcnow()
class AwsSigningV4(object):
__ALGORITHM = "AWS4-HMAC-SHA256"
def __init__(
self,
aws_access_key_id,
aws_secret_access_key,
aws_host,
aws_region="eu-west-1",
aws_servic... | 37.517241 | 87 | 0.640319 |
7b624264f23ed022c902db0d42f57441ce2621bf | 8,206 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/bgplscommunitieslist_fdb216f1d4195f82ad738e19cb2b5d32.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/bgplscommunitieslist_fdb216f1d4195f82ad738e19cb2b5d32.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/bgplscommunitieslist_fdb216f1d4195f82ad738e19cb2b5d32.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 38.345794 | 190 | 0.659396 |
eacb3cae0b37cf147b73741fd472a6b338f66204 | 7,680 | py | Python | examples/s2s_trans/criterions/s2t_loss.py | fengpeng-yue/speech-to-speech-translation | 099aa326f29c51a882532952186e329a87d2c4d5 | [
"MIT"
] | 2 | 2022-03-30T08:20:16.000Z | 2022-03-30T08:25:48.000Z | examples/s2s_trans/criterions/s2t_loss.py | fengpeng-yue/speech-to-speech-translation | 099aa326f29c51a882532952186e329a87d2c4d5 | [
"MIT"
] | null | null | null | examples/s2s_trans/criterions/s2t_loss.py | fengpeng-yue/speech-to-speech-translation | 099aa326f29c51a882532952186e329a87d2c4d5 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from dataclasses import dataclass, field
import torch
from fairseq import metrics, utils
from fairseq.criterions import FairseqCr... | 38.592965 | 96 | 0.617708 |
5d5ae9fb1889ce013b5d71b5d377b8b7b97d7415 | 1,147 | py | Python | model_configs/ch_alpha/strnconcat_resnet50.py | kiyoon/PyVideoAI | c4d3ba7a69723aeae7da48245989ae11cbdb1f8b | [
"MIT"
] | 22 | 2021-06-01T07:40:01.000Z | 2022-03-14T07:09:01.000Z | model_configs/ch_alpha/strnconcat_resnet50.py | kiyoon/PyVideoAI | c4d3ba7a69723aeae7da48245989ae11cbdb1f8b | [
"MIT"
] | null | null | null | model_configs/ch_alpha/strnconcat_resnet50.py | kiyoon/PyVideoAI | c4d3ba7a69723aeae7da48245989ae11cbdb1f8b | [
"MIT"
] | null | null | null | import torch
from torch import optim
from ..models.epic.tsn import STRN, TRN
def load_model(num_classes, input_frame_length):
#class_counts = (num_classes,352)
class_counts = num_classes
segment_count = input_frame_length
base_model = 'resnet50rnconcat'
pretrained = 'imagenet'
# repo = 'epic-ki... | 25.488889 | 77 | 0.695728 |
957f4200738a6040e3c3d889da19865841b9db2c | 4,056 | py | Python | src/programy/clients/restful/flask/client.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | src/programy/clients/restful/flask/client.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | src/programy/clients/restful/flask/client.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | """
Copyright (c) 2016-2019 Keith Sterling http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, m... | 44.571429 | 120 | 0.698964 |
cc9a6f3175c34113ce09b3a73a7eed150e4fe5b7 | 10,455 | py | Python | portal/portal/management/commands/rebuild_index.py | junjun315/PaddlePaddle.org | 3feaa68376d8423e41d076814e901e6bf108c705 | [
"Apache-2.0"
] | null | null | null | portal/portal/management/commands/rebuild_index.py | junjun315/PaddlePaddle.org | 3feaa68376d8423e41d076814e901e6bf108c705 | [
"Apache-2.0"
] | null | null | null | portal/portal/management/commands/rebuild_index.py | junjun315/PaddlePaddle.org | 3feaa68376d8423e41d076814e901e6bf108c705 | [
"Apache-2.0"
] | null | null | null | import os
import re
import json
import math
from subprocess import check_output
import tempfile
import jieba
from bs4 import BeautifulSoup
from textblob import TextBlob as tb
from django.conf import settings
from django.core.management import BaseCommand
from .utils import sanitize_version
def get_section_for_api_t... | 38.4375 | 137 | 0.536872 |
bdbdb9a5bbe9b00ab67ec7d38d7d9fb41520517b | 377 | py | Python | easy/1342.py | nkwib/leetcode | 73f7492ba208417d8bf8340b6bf9dc68a6ded7f7 | [
"MIT"
] | null | null | null | easy/1342.py | nkwib/leetcode | 73f7492ba208417d8bf8340b6bf9dc68a6ded7f7 | [
"MIT"
] | null | null | null | easy/1342.py | nkwib/leetcode | 73f7492ba208417d8bf8340b6bf9dc68a6ded7f7 | [
"MIT"
] | null | null | null | class Solution:
def numberOfSteps (self, num: int) -> int:
count = 0
temp = num
while temp != 0:
print(temp)
if temp%2 == 0:
count += 1
temp = temp/2
else:
count += 1
temp -= 1
return ... | 22.176471 | 46 | 0.419098 |
3c0321e1224173df2fbeebf26fa7197f377d90eb | 122 | py | Python | backend/app/admin.py | rattrayalex/django-graphene-react-funtimes | e0690d2965301a5100479dad329d509ece5dcac3 | [
"MIT"
] | 3 | 2016-06-11T03:14:42.000Z | 2018-03-16T11:08:56.000Z | backend/app/admin.py | rattrayalex/django-graphene-react-funtimes | e0690d2965301a5100479dad329d509ece5dcac3 | [
"MIT"
] | null | null | null | backend/app/admin.py | rattrayalex/django-graphene-react-funtimes | e0690d2965301a5100479dad329d509ece5dcac3 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Company, Job
admin.site.register(Company)
admin.site.register(Job)
| 17.428571 | 32 | 0.803279 |
527fe792a38b1b19478a0a785e04808d36b15927 | 1,698 | py | Python | scripts/motors.py | kandahyon/pimouse_ros | 3234c406bef138969cf56a823586b240943dadb2 | [
"BSD-3-Clause"
] | 1 | 2021-02-27T19:00:46.000Z | 2021-02-27T19:00:46.000Z | scripts/motors.py | kandahyon/pimouse_ros | 3234c406bef138969cf56a823586b240943dadb2 | [
"BSD-3-Clause"
] | null | null | null | scripts/motors.py | kandahyon/pimouse_ros | 3234c406bef138969cf56a823586b240943dadb2 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#encoding: utf8
import sys, rospy, math
from pimouse_ros.msg import MotorFreqs
from geometry_msgs.msg import Twist
class Motor():
def __init__(self):
if not self.set_power(True): sys.exit(1)
rospy.on_shutdown(self.set_power)
self.sub_raw = rospy.Subscriber('motor_raw', MotorFreqs, self.ca... | 27.387097 | 82 | 0.703769 |
178a3e875d035354d05f81f1fd168e888fa83bbb | 5,786 | py | Python | JSONWireProtocol/AppiumVDC-SauceLabs.py | phillram/saucelabs-simple-python | b7ff7cbffff9ce041d30f9bb173aaf5f77b1cc6f | [
"MIT"
] | 2 | 2019-04-30T23:28:49.000Z | 2019-10-04T01:10:16.000Z | JSONWireProtocol/AppiumVDC-SauceLabs.py | phillram/saucelabs-simple-python | b7ff7cbffff9ce041d30f9bb173aaf5f77b1cc6f | [
"MIT"
] | 1 | 2019-06-18T02:50:26.000Z | 2019-06-18T02:50:26.000Z | JSONWireProtocol/AppiumVDC-SauceLabs.py | phillram/saucelabs-simple-python | b7ff7cbffff9ce041d30f9bb173aaf5f77b1cc6f | [
"MIT"
] | 2 | 2019-04-30T22:45:41.000Z | 2019-06-14T21:29:55.000Z | ####################################################################
# Skeleton for Appium Virtual Tests on Sauce Labs
####################################################################
###################################################################
# Imports that are good to use
################################... | 36.389937 | 150 | 0.53664 |
e3291906efc42dc7baf459b6a7bf50a3c8833881 | 1,116 | py | Python | DadosAbertosBrasil/_utils/get_data.py | GusFurtado/DadosAbertosBrasil | d8848f4c5c1107b3b67fd4ef73689541d06c3e28 | [
"MIT"
] | 21 | 2020-06-08T22:58:33.000Z | 2022-01-27T03:25:01.000Z | DadosAbertosBrasil/_utils/get_data.py | GusFurtado/DadosAbertosBrasil | d8848f4c5c1107b3b67fd4ef73689541d06c3e28 | [
"MIT"
] | null | null | null | DadosAbertosBrasil/_utils/get_data.py | GusFurtado/DadosAbertosBrasil | d8848f4c5c1107b3b67fd4ef73689541d06c3e28 | [
"MIT"
] | 8 | 2021-02-19T19:28:01.000Z | 2022-02-14T23:13:43.000Z | '''Função que captura os dados das APIs.
Adiciona o endpoint, path e parâmetros do request e retorna um arquivo JSON.
'''
from typing import Union
import requests
def get_data(
endpoint: str,
path: Union[str, list],
params: dict = None
) -> dict:
'''Coleta os dados requisitados das... | 24.26087 | 76 | 0.612007 |
eebad6c45b7bed279f8f306014d65dbcc832b79b | 17,564 | py | Python | tests/catalyst/callbacks/test_control_flow.py | sergunya17/catalyst | f98d71138c09cd1b5a69b788cb5006115f5c7fda | [
"Apache-2.0"
] | 2,693 | 2019-01-23T19:16:12.000Z | 2022-03-31T02:12:42.000Z | tests/catalyst/callbacks/test_control_flow.py | Ran485/catalyst | 84bc7576c981278f389279d87dda85dd66a758b6 | [
"Apache-2.0"
] | 763 | 2019-01-22T20:12:56.000Z | 2022-03-27T18:36:10.000Z | tests/catalyst/callbacks/test_control_flow.py | Ran485/catalyst | 84bc7576c981278f389279d87dda85dd66a758b6 | [
"Apache-2.0"
] | 445 | 2019-01-23T17:07:09.000Z | 2022-03-30T05:38:45.000Z | # flake8: noqa
import random
import unittest
from unittest.mock import Mock
from catalyst.dl import Callback, CallbackOrder, ControlFlowCallback
class _Runner:
def __init__(self, stage, loader_key, global_epoch, epoch):
self.stage_key = stage
self.loader_key = loader_key
self.global_epoch... | 32.227523 | 97 | 0.59713 |
c94ca62d3a9fb49a50f8afdc718c75b9a5015405 | 1,605 | py | Python | src/ssl/create_ssl.py | snikch/chia-blockchain | 5f2000dbaf854deb7c0c7654d1ee6a84e06e233c | [
"Apache-2.0"
] | 1 | 2021-04-12T09:10:51.000Z | 2021-04-12T09:10:51.000Z | src/ssl/create_ssl.py | snikch/chia-blockchain | 5f2000dbaf854deb7c0c7654d1ee6a84e06e233c | [
"Apache-2.0"
] | 1 | 2022-03-25T19:11:21.000Z | 2022-03-25T19:11:21.000Z | src/ssl/create_ssl.py | fakecoinbase/Chia-Networkslashchia-blockchain | 84e6a4da18fb0a790a870cbd516f13c9bc7f0716 | [
"Apache-2.0"
] | 1 | 2022-01-26T11:57:29.000Z | 2022-01-26T11:57:29.000Z | from datetime import datetime, timedelta
from cryptography import x509
from cryptography.x509.oid import NameOID
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmet... | 37.325581 | 86 | 0.722741 |
d586bfd8e0f6f7f5703181913b97a8dc306e042a | 783 | py | Python | app/__init__.py | jonnygovish/pitch-hub | 16fc71394cc0ff8edfebd760accb13a004507a8c | [
"MIT"
] | null | null | null | app/__init__.py | jonnygovish/pitch-hub | 16fc71394cc0ff8edfebd760accb13a004507a8c | [
"MIT"
] | null | null | null | app/__init__.py | jonnygovish/pitch-hub | 16fc71394cc0ff8edfebd760accb13a004507a8c | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from config import config_options
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
bootstrap = Bootstrap()
db = SQLAlchemy()
login_manager = LoginManager()
login_manager.session_protection = 'strong'
login_manager.login_view = '... | 25.258065 | 60 | 0.805875 |
aa412877d3124f1b364bf9931a469c9b0985d902 | 8,515 | py | Python | resources/user.py | coulbyl/e-vent-hub | b65db41142e9153e11d721abfca4bc688bb654a5 | [
"MIT"
] | null | null | null | resources/user.py | coulbyl/e-vent-hub | b65db41142e9153e11d721abfca4bc688bb654a5 | [
"MIT"
] | 1 | 2021-05-17T12:33:59.000Z | 2021-05-17T12:33:59.000Z | resources/user.py | coulbyl/e-vent-hub | b65db41142e9153e11d721abfca4bc688bb654a5 | [
"MIT"
] | 1 | 2021-05-27T12:24:57.000Z | 2021-05-27T12:24:57.000Z | import functools
from flask_restful import Resource, abort
from flask_jwt_extended import (
get_jwt, jwt_required, create_access_token, create_refresh_token,
get_jwt_identity
)
from models.user import UserModel
from models.event import EventModel
from models.token import TokenBlockList
from parsers.user import... | 36.234043 | 89 | 0.627481 |
90153c20cbd9c7ef7e7219cfcf25dbb8f4be9541 | 15,955 | py | Python | python2.7/site-packages/twisted/web/woven/model.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | python2.7/site-packages/twisted/web/woven/model.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | python2.7/site-packages/twisted/web/woven/model.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | # -*- test-case-name: twisted.web.test.test_woven -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
__version__ = "$Revision: 1.53 $"[11:-2]
import types
import weakref
import warnings
from zope.interface import implements
from twisted.python import components, reflect
from twis... | 32.694672 | 137 | 0.600752 |
9e27275a98face7d8fed9e80ae8333ef7012e31c | 2,599 | py | Python | selim/test.py | tilacyn/dsb2018_topcoders | e0f95ef70bc062d4dea321d2aa73231a9538cd63 | [
"MIT"
] | null | null | null | selim/test.py | tilacyn/dsb2018_topcoders | e0f95ef70bc062d4dea321d2aa73231a9538cd63 | [
"MIT"
] | null | null | null | selim/test.py | tilacyn/dsb2018_topcoders | e0f95ef70bc062d4dea321d2aa73231a9538cd63 | [
"MIT"
] | null | null | null | import cv2
from models.model_factory import make_model
from os.path import join as opjoin
import numpy as np
from matplotlib import pyplot as plt
def dice(y_true, y_pred):
intersection = np.sum(y_true * y_pred)
return 2 * intersection / (np.sum(y_true) + np.sum(y_pred))
def pad(image):
return np.pad(imag... | 37.128571 | 104 | 0.637168 |
5f7865b8119c8191c5722ee49d9a3542cfc3d9d4 | 2,579 | py | Python | app/user/views.py | gDoe24/recipe-app-api | d3eb24534062b61370da367416aeec6c98eed1fa | [
"MIT"
] | null | null | null | app/user/views.py | gDoe24/recipe-app-api | d3eb24534062b61370da367416aeec6c98eed1fa | [
"MIT"
] | 7 | 2020-03-06T13:41:34.000Z | 2022-02-13T05:23:39.000Z | app/user/views.py | gDoe24/recipe-app-api | d3eb24534062b61370da367416aeec6c98eed1fa | [
"MIT"
] | 1 | 2020-02-04T20:41:43.000Z | 2020-02-04T20:41:43.000Z | from rest_framework import generics, authentication, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from rest_framework.response import Response
from rest_framework.authtoken.models import Token
from rest_framework.views import APIView
from core.m... | 28.977528 | 81 | 0.799922 |
8f370cee3b13ad0839c802bab2b5698c1cf5557f | 263 | py | Python | weird_fish/main.py | synchronizedsynecdoche/weird-fish | 56ba5f46f95c9940d23f607415b8964e115f5f21 | [
"MIT"
] | null | null | null | weird_fish/main.py | synchronizedsynecdoche/weird-fish | 56ba5f46f95c9940d23f607415b8964e115f5f21 | [
"MIT"
] | null | null | null | weird_fish/main.py | synchronizedsynecdoche/weird-fish | 56ba5f46f95c9940d23f607415b8964e115f5f21 | [
"MIT"
] | null | null | null | import requests
from Accounts import Accounts
class weird_fish:
def __init__(self, url: str ="https://mastodon.social"):
self.url = url
server = Accounts(self.url)
user = server.get_account(1)
print(user.intro())
weird_fish() | 23.909091 | 60 | 0.653992 |
f0d45896b4903a2c8e913fd2fad7f2a113ec47d3 | 5,991 | py | Python | src/shared/utils.py | LukeSavefrogs/ICTSM-Maximo-Automation | 5e6b776882cab1d05e3760667a6764d129a33765 | [
"Apache-2.0"
] | null | null | null | src/shared/utils.py | LukeSavefrogs/ICTSM-Maximo-Automation | 5e6b776882cab1d05e3760667a6764d129a33765 | [
"Apache-2.0"
] | null | null | null | src/shared/utils.py | LukeSavefrogs/ICTSM-Maximo-Automation | 5e6b776882cab1d05e3760667a6764d129a33765 | [
"Apache-2.0"
] | null | null | null | import os, sys
import inspect
import json
import logging
from deprecated import deprecated
from shared.cache import Cache
logger = logging.getLogger(__name__)
class Credentials (Cache):
FILENAME_TEMPLATE = "{product}_credentials.yaml"
PRODUCT_NAME = ""
def __init__(self, product_name:str, max_login_fails:int =... | 29.367647 | 155 | 0.703055 |
34dbbaa0581b39f11dbcf551a7be5cef9076ed13 | 13,665 | py | Python | backend/edw/models/mixins/entity/add_date_terms_validation.py | MMotionMan/django-edw | 0f686429d29e0f40409a3b2318664973b2844c08 | [
"BSD-3-Clause"
] | 4 | 2019-09-18T05:51:12.000Z | 2020-10-23T08:50:00.000Z | backend/edw/models/mixins/entity/add_date_terms_validation.py | Vvvnukova/django-edw | 18397c2e6e2d7ddebad4d83ffee16425e7ac4e9f | [
"BSD-3-Clause"
] | 10 | 2020-04-29T11:46:44.000Z | 2022-03-11T23:38:27.000Z | backend/edw/models/mixins/entity/add_date_terms_validation.py | Vvvnukova/django-edw | 18397c2e6e2d7ddebad4d83ffee16425e7ac4e9f | [
"BSD-3-Clause"
] | 13 | 2020-04-09T07:49:48.000Z | 2022-03-02T07:06:28.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import calendar
from django.db import transaction
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from edw.models.entity import EntityModel
from edw.models.term import TermModel
from edw.utils.d... | 44.366883 | 121 | 0.586096 |
037cb54aac999a27c21c13f841feb80028eba68f | 1,366 | py | Python | ote_sdk/ote_sdk/utils/labels_utils.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | null | null | null | ote_sdk/ote_sdk/utils/labels_utils.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | null | null | null | ote_sdk/ote_sdk/utils/labels_utils.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | 1 | 2020-12-13T22:13:51.000Z | 2020-12-13T22:13:51.000Z | """
This module implements utilities for labels
"""
# Copyright (C) 2021-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from typing import List, Optional
from ote_sdk.entities.label import LabelEntity
from ote_sdk.entities.label_schema import LabelSchemaEntity
from ote_sdk.entities.scored_label impor... | 27.32 | 78 | 0.7306 |
aa128f184c0616907b9128b6a5fe85fb6b3d9ed1 | 64 | py | Python | 1(Multiples of 3 of 5)/multiples.py | thatdeep/project_euler | acce3a2f9814c80e330dc63ef60cf51da9e236c4 | [
"MIT"
] | null | null | null | 1(Multiples of 3 of 5)/multiples.py | thatdeep/project_euler | acce3a2f9814c80e330dc63ef60cf51da9e236c4 | [
"MIT"
] | null | null | null | 1(Multiples of 3 of 5)/multiples.py | thatdeep/project_euler | acce3a2f9814c80e330dc63ef60cf51da9e236c4 | [
"MIT"
] | null | null | null | print(len(set(range(3, 1001, 3)).union(set(range(5, 1001, 5))))) | 64 | 64 | 0.640625 |
5ba7558cb7b54cdb49000ea90db79e54ac7800f7 | 18,505 | py | Python | gitmanager.py | gruberan/SmokeDetector | 30bd05a942e384b082dccd2a20b3c18b1e8b0cd5 | [
"Apache-2.0",
"MIT"
] | null | null | null | gitmanager.py | gruberan/SmokeDetector | 30bd05a942e384b082dccd2a20b3c18b1e8b0cd5 | [
"Apache-2.0",
"MIT"
] | null | null | null | gitmanager.py | gruberan/SmokeDetector | 30bd05a942e384b082dccd2a20b3c18b1e8b0cd5 | [
"Apache-2.0",
"MIT"
] | null | null | null | # coding=utf-8
import sys
import platform
import time
import json
from datetime import datetime
from threading import Lock
import regex
import requests
from requests.auth import HTTPBasicAuth
from urllib.parse import quote_plus
from urllib.parse import quote
from globalvars import GlobalVars
if GlobalVars.on_windows... | 42.345538 | 115 | 0.548879 |
6bef30d67ebacd187a126d8d3bb17a4b4e027472 | 3,256 | py | Python | fastapi/maskrcnn.py | mkang30/ImageSegmentation | 4180c0a3c4e68f242820887b56c10500670b00a9 | [
"MIT"
] | 5 | 2020-07-21T06:14:23.000Z | 2022-03-21T06:29:32.000Z | fastapi/maskrcnn.py | mkang30/ImageSegmentation | 4180c0a3c4e68f242820887b56c10500670b00a9 | [
"MIT"
] | 4 | 2021-06-08T22:01:54.000Z | 2022-03-12T00:40:35.000Z | fastapi/maskrcnn.py | mkang30/ImageSegmentation | 4180c0a3c4e68f242820887b56c10500670b00a9 | [
"MIT"
] | 1 | 2021-06-04T03:36:30.000Z | 2021-06-04T03:36:30.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 4 13:31:36 2020
@author: minseongkang
"""
import numpy as np
from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.utils.visualizer import Visualizer
from detectron2.da... | 31.61165 | 118 | 0.596437 |
05f1eaeda4caf29ffecb9990176a0d1ef0e91b31 | 7,742 | py | Python | trax/layers/metrics_test.py | GeorgeDittmar/trax | a0483a12cb7ebece40b5e302e8e81fd9249c6ef6 | [
"Apache-2.0"
] | 1 | 2020-11-20T22:29:41.000Z | 2020-11-20T22:29:41.000Z | trax/layers/metrics_test.py | anilkeshwani/trax | 327ca0999bcbc1794c263db6b09c3a202e82a065 | [
"Apache-2.0"
] | null | null | null | trax/layers/metrics_test.py | anilkeshwani/trax | 327ca0999bcbc1794c263db6b09c3a202e82a065 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.400966 | 78 | 0.560191 |
2178251f19e06c7f3edbe8190e006900c282c6a7 | 416 | py | Python | example/cluster_sample.py | sabi2345/ooda_flow_diagram | f6ccc7ea5987d30910479240379bd8976d3202fc | [
"MIT"
] | null | null | null | example/cluster_sample.py | sabi2345/ooda_flow_diagram | f6ccc7ea5987d30910479240379bd8976d3202fc | [
"MIT"
] | null | null | null | example/cluster_sample.py | sabi2345/ooda_flow_diagram | f6ccc7ea5987d30910479240379bd8976d3202fc | [
"MIT"
] | null | null | null | from graphviz import Digraph
g = Digraph('G', filename='cluster_edge.gv')
g.attr(compound='true')
with g.subgraph(name='cluster0') as c:
c.edges(['ab', 'ac', 'bd', 'cd'])
with g.subgraph(name='cluster1') as c:
c.edges(['eg', 'ef'])
g.edge('b', 'f', lhead='cluster1')
g.edge('d', 'e')
g.edge('c', 'g', ltail='... | 24.470588 | 52 | 0.605769 |
72af09744564f0fcc83d1f43a8bd1a04d8a8fa38 | 7,603 | py | Python | demo/quant/quant_embedding/train.py | jiansowa/PaddleSlim | a45431c99a775782b7fe5633f313d36ff582e797 | [
"Apache-2.0"
] | null | null | null | demo/quant/quant_embedding/train.py | jiansowa/PaddleSlim | a45431c99a775782b7fe5633f313d36ff582e797 | [
"Apache-2.0"
] | 1 | 2020-07-14T09:50:51.000Z | 2020-07-14T09:50:51.000Z | demo/quant/quant_embedding/train.py | jiansowa/PaddleSlim | a45431c99a775782b7fe5633f313d36ff582e797 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import argparse
import logging
import os
import time
import math
import random
import numpy as np
import paddle
import paddle.fluid as fluid
import six
import reader
from net import skip_gram_word2vec
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s')
logger =... | 33.200873 | 82 | 0.574642 |
f16297d2b104e2e503e7ee5211f59295382f58f1 | 417 | py | Python | venv/Scripts/pip3-script.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip3-script.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip3-script.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | #!C:\Users\shehz\PycharmProjects\Assignment4\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.a... | 32.076923 | 69 | 0.673861 |
b9108ffa2e39756350c8070d0af9f4af7e62f33c | 11,087 | py | Python | teslamate_car_data.py | krezac/tesla-data-source | e78f7ecf37c368efff85b721aa1e4dc2940d1985 | [
"MIT"
] | null | null | null | teslamate_car_data.py | krezac/tesla-data-source | e78f7ecf37c368efff85b721aa1e4dc2940d1985 | [
"MIT"
] | 1 | 2021-01-01T13:57:51.000Z | 2021-01-01T13:57:51.000Z | teslamate_car_data.py | krezac/tesla-data-source | e78f7ecf37c368efff85b721aa1e4dc2940d1985 | [
"MIT"
] | 1 | 2021-01-01T16:12:57.000Z | 2021-01-01T16:12:57.000Z | from typing import Callable, List, Dict, Optional
import pendulum
import logging
from teslamate_data_source import TeslamateDataSource
from ds_types import Configuration, LapStatus, CarStatus, DriverChange, LapsList, JsonLapsResponse, JsonStatusResponse, ForecastResult
from labels import generate_labels
import lap_ana... | 40.761029 | 150 | 0.741319 |
d306847891fcffe133058b50a0f1b852209e0f44 | 182 | py | Python | empoweru/wagtail_hooks.py | harsh1930/fitgirl-inc | a10ff5c49ba9ae9c0859ee721f8763fe1da592c2 | [
"MIT"
] | 6 | 2018-09-11T15:30:10.000Z | 2020-01-14T17:29:07.000Z | empoweru/wagtail_hooks.py | harsh1930/fitgirl-inc | a10ff5c49ba9ae9c0859ee721f8763fe1da592c2 | [
"MIT"
] | 722 | 2018-08-29T17:27:38.000Z | 2022-03-11T23:28:33.000Z | empoweru/wagtail_hooks.py | harsh1930/fitgirl-inc | a10ff5c49ba9ae9c0859ee721f8763fe1da592c2 | [
"MIT"
] | 13 | 2018-08-29T07:42:01.000Z | 2019-04-21T22:34:30.000Z | from wagtail.core import hooks
@hooks.register('construct_main_menu')
def hide_explorer_menu_item_from_frank(request, menu_items):
menu_items[:] = [item for item in menu_items ] | 36.4 | 60 | 0.796703 |
5d64735092f050957f7570058609a67eb2b2236d | 2,798 | py | Python | examples/basic_operations/remove_ad.py | Insutanto/google-ads-python | f63e318ca39f2ecc6546fba69994456815727578 | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/remove_ad.py | Insutanto/google-ads-python | f63e318ca39f2ecc6546fba69994456815727578 | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/remove_ad.py | Insutanto/google-ads-python | f63e318ca39f2ecc6546fba69994456815727578 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 43.046154 | 79 | 0.699071 |
65060f468bc44d25c1a5b2f958ec602d7da2f9d4 | 28,433 | py | Python | paramak/reactor.py | PlasmaFAIR/paramak | 8d40e8ddf398c55333eb2daa4a679ec634b5a00a | [
"MIT"
] | null | null | null | paramak/reactor.py | PlasmaFAIR/paramak | 8d40e8ddf398c55333eb2daa4a679ec634b5a00a | [
"MIT"
] | null | null | null | paramak/reactor.py | PlasmaFAIR/paramak | 8d40e8ddf398c55333eb2daa4a679ec634b5a00a | [
"MIT"
] | null | null | null | import collections
import json
from collections import Counter
from collections.abc import Iterable
from pathlib import Path
from typing import List, Optional, Tuple, Union
import cadquery as cq
import matplotlib.pyplot as plt
from cadquery import Compound, exporters
import paramak
from paramak.utils import _replace,... | 36.1743 | 110 | 0.597404 |
832d32efbd21d6a3d99a0662648bbfd6522235f8 | 2,999 | py | Python | google/cloud/security/inventory/pipelines/load_projects_pipeline.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | 1 | 2018-03-26T08:15:21.000Z | 2018-03-26T08:15:21.000Z | google/cloud/security/inventory/pipelines/load_projects_pipeline.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | google/cloud/security/inventory/pipelines/load_projects_pipeline.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 41.082192 | 103 | 0.647549 |
612418bfb724ac9a4a11078923e2ddf2f58a883f | 55,171 | py | Python | chinook/ARPES_lib.py | jminar/chinook | 3125bdfecc1ccef9aff2bb0ee0da5f50df4826ae | [
"MIT"
] | null | null | null | chinook/ARPES_lib.py | jminar/chinook | 3125bdfecc1ccef9aff2bb0ee0da5f50df4826ae | [
"MIT"
] | null | null | null | chinook/ARPES_lib.py | jminar/chinook | 3125bdfecc1ccef9aff2bb0ee0da5f50df4826ae | [
"MIT"
] | 1 | 2021-02-22T11:12:58.000Z | 2021-02-22T11:12:58.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#Created on Sat Nov 18 21:15:20 2017
#@author: rday
#MIT License
#Copyright (c) 2018 Ryan Patrick Day
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to de... | 43.169797 | 408 | 0.543438 |
65871d9167d953aad8ae2926c7bbe23b3a3c1871 | 3,942 | py | Python | indico/modules/events/abstracts/clone.py | kadet1090/indico | 36a1036017bdce5c910e889fea7017f18a1dd026 | [
"MIT"
] | 1 | 2021-08-11T19:13:18.000Z | 2021-08-11T19:13:18.000Z | indico/modules/events/abstracts/clone.py | kadet1090/indico | 36a1036017bdce5c910e889fea7017f18a1dd026 | [
"MIT"
] | null | null | null | indico/modules/events/abstracts/clone.py | kadet1090/indico | 36a1036017bdce5c910e889fea7017f18a1dd026 | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from indico.core.db import db
from indico.core.db.sqlalchemy.util... | 47.493976 | 119 | 0.699645 |
f11c1e7b232788560290d087dcf9db32e2b5a70b | 432 | py | Python | WEB(BE)/vacation/urls.py | osamhack2021/WEB_SONAGI-ON_updraft | c63d62b8348ba991811814aeafa337a6b3785ca2 | [
"MIT"
] | 1 | 2022-03-09T17:04:26.000Z | 2022-03-09T17:04:26.000Z | WEB(BE)/vacation/urls.py | osamhack2021/WEB_SONAGI-ON_updraft | c63d62b8348ba991811814aeafa337a6b3785ca2 | [
"MIT"
] | null | null | null | WEB(BE)/vacation/urls.py | osamhack2021/WEB_SONAGI-ON_updraft | c63d62b8348ba991811814aeafa337a6b3785ca2 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import VacationWriteView, VacationRewriteView, VacationDeleteView, VacationListView
urlpatterns = [
path("write", VacationWriteView.as_view(), name="write-vacation"),
path("rewrite", VacationRewriteView.as_view(), name="rewrite-vacation"),
path("delete", VacationDel... | 48 | 95 | 0.75463 |
43ad9f5f7d9eac7b6b62d791d66abddd146c1227 | 2,419 | py | Python | ch12/adaptive_lr.py | kbrezinski/stat-453-deep-learning | b10240b5c3a970231dcea9221d3d179d26fc197d | [
"BSD-3-Clause"
] | null | null | null | ch12/adaptive_lr.py | kbrezinski/stat-453-deep-learning | b10240b5c3a970231dcea9221d3d179d26fc197d | [
"BSD-3-Clause"
] | null | null | null | ch12/adaptive_lr.py | kbrezinski/stat-453-deep-learning | b10240b5c3a970231dcea9221d3d179d26fc197d | [
"BSD-3-Clause"
] | null | null | null |
import torch
import matplotlib.pyplot as plt
import numpy as np
plot = True
Tensor = torch.Tensor
class RMSProp:
def __init__(self, params: Tensor, lr: float, beta: int = 0.9, eps: float = 1e-8):
self.params = params
self.beta = beta
self.lr = lr
self.rms = 0
self.eps = ... | 24.938144 | 124 | 0.542373 |
5b45e3c6b4982892f7c9aad14676849f0553e104 | 13,322 | py | Python | lib/galaxy/webapps/galaxy/api/visualizations.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/webapps/galaxy/api/visualizations.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | 6 | 2021-11-11T20:57:49.000Z | 2021-12-10T15:30:33.000Z | lib/galaxy/webapps/galaxy/api/visualizations.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | """
Visualizations resource control over the API.
NOTE!: this is a work in progress and functionality and data structures
may change often.
"""
import json
import logging
from fastapi import (
Body,
Path,
Response,
status,
)
from galaxy import (
exceptions,
util,
web,
)
from galaxy.manage... | 39.767164 | 111 | 0.654256 |
f017f04cf276557ad0b4aa91fd4351882bb16242 | 4,620 | py | Python | route/user_setting.py | lsh23/openNAMU | 18f780afe5e81ef1f347fe556b6fd98bb4914a53 | [
"BSD-3-Clause"
] | null | null | null | route/user_setting.py | lsh23/openNAMU | 18f780afe5e81ef1f347fe556b6fd98bb4914a53 | [
"BSD-3-Clause"
] | null | null | null | route/user_setting.py | lsh23/openNAMU | 18f780afe5e81ef1f347fe556b6fd98bb4914a53 | [
"BSD-3-Clause"
] | null | null | null | from .tool.func import *
def user_setting_2(conn, server_init):
curs = conn.cursor()
support_language = server_init.server_set_var['language']['list']
ip = ip_check()
if ban_check() == 1:
return re_error('/ban')
if ip_or_user(ip) == 0:
if flask.request.method == 'POST':
... | 49.148936 | 184 | 0.456926 |
21d79843c44930e6d6aa473a327bb0eb2c5a06bb | 2,318 | py | Python | examples/pixelcnn/main.py | joelgarde/flax | 7d12d20f8272ce9c639711e92db89fdaf7f1a94a | [
"Apache-2.0"
] | 4 | 2020-05-28T11:25:47.000Z | 2021-04-30T13:08:48.000Z | examples/pixelcnn/main.py | joelgarde/flax | 7d12d20f8272ce9c639711e92db89fdaf7f1a94a | [
"Apache-2.0"
] | null | null | null | examples/pixelcnn/main.py | joelgarde/flax | 7d12d20f8272ce9c639711e92db89fdaf7f1a94a | [
"Apache-2.0"
] | 2 | 2021-04-30T13:08:58.000Z | 2021-12-08T00:50:25.000Z | # Copyright 2021 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 32.647887 | 77 | 0.731665 |
7cbaeda80df6c36a7e60e860da660bbc8fefe504 | 6,272 | py | Python | toontown/toon/DistributedNPCFisherman.py | DankMickey/Project-Altis-Educational-Source | 0a74999fb52d4e690a41b984703119f63c372d20 | [
"Apache-2.0"
] | 1 | 2021-06-25T02:56:32.000Z | 2021-06-25T02:56:32.000Z | toontown/toon/DistributedNPCFisherman.py | AnythingTechPro/Project-Altis | 7ead614abdb5072ca06323982de461f4e775d1b3 | [
"Apache-2.0"
] | null | null | null | toontown/toon/DistributedNPCFisherman.py | AnythingTechPro/Project-Altis | 7ead614abdb5072ca06323982de461f4e775d1b3 | [
"Apache-2.0"
] | 2 | 2021-02-25T06:02:05.000Z | 2021-06-19T03:11:22.000Z | from direct.gui.DirectGui import *
from direct.interval.LerpInterval import LerpPosHprInterval
from direct.task.Task import Task
from pandac.PandaModules import *
import time
from toontown.toon.DistributedNPCToonBase import *
from toontown.toon import NPCToons
from toontown.chat.ChatGlobals import *
from toontown.fishi... | 38.012121 | 139 | 0.626276 |
c2bc8f745d1537156d93a6d3fa986af332259e23 | 2,913 | py | Python | samples/client/petstore/python/petstore_api/models/dog.py | GitHub30/openapi-generator | 790f3d46aa5e6510d6f3701022d224f5f38fc73c | [
"Apache-2.0"
] | 5 | 2019-12-03T13:50:09.000Z | 2021-11-14T12:59:48.000Z | samples/openapi3/client/petstore/python/petstore_api/models/dog.py | cedricziel/openapi-generator | a6a1264f252abd7c55e58a6653cdf308df88826e | [
"Apache-2.0"
] | 7 | 2021-03-01T21:26:03.000Z | 2022-02-27T10:10:20.000Z | samples/openapi3/client/petstore/python/petstore_api/models/dog.py | cedricziel/openapi-generator | a6a1264f252abd7c55e58a6653cdf308df88826e | [
"Apache-2.0"
] | 4 | 2019-04-08T17:06:09.000Z | 2020-06-09T18:16:08.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
... | 25.778761 | 174 | 0.542739 |
252df59419c2216b1ff5ff2d4d2e1272e736d48b | 5,021 | py | Python | tests/unit/test_ansible_inventory.py | dav-pascual/mrack | f31b4ef1f1f847c3e95567ec012323be65a1e177 | [
"Apache-2.0"
] | 1 | 2020-06-25T10:17:23.000Z | 2020-06-25T10:17:23.000Z | tests/unit/test_ansible_inventory.py | dav-pascual/mrack | f31b4ef1f1f847c3e95567ec012323be65a1e177 | [
"Apache-2.0"
] | 4 | 2020-07-15T15:57:51.000Z | 2020-07-28T22:04:21.000Z | tests/unit/test_ansible_inventory.py | dav-pascual/mrack | f31b4ef1f1f847c3e95567ec012323be65a1e177 | [
"Apache-2.0"
] | 3 | 2020-04-20T11:46:52.000Z | 2020-07-01T11:55:51.000Z | import pytest
from mrack.errors import ConfigError
from mrack.outputs.ansible_inventory import AnsibleInventoryOutput, get_group
from .mock_data import (
common_inventory_layout,
create_metadata,
get_db_from_metadata,
provisioning_config,
)
def ensure_all_groups_present(metadata, inventory):
"""... | 30.065868 | 88 | 0.625971 |
496090dee1b1a37f0258399f919c53044fd29a93 | 2,953 | py | Python | src/z_ainc.py | takumihonda/BAIU2018_5.3.6 | 7d0768406aa44a0aeb03eacd5ab0a1141f5158e4 | [
"MIT"
] | null | null | null | src/z_ainc.py | takumihonda/BAIU2018_5.3.6 | 7d0768406aa44a0aeb03eacd5ab0a1141f5158e4 | [
"MIT"
] | null | null | null | src/z_ainc.py | takumihonda/BAIU2018_5.3.6 | 7d0768406aa44a0aeb03eacd5ab0a1141f5158e4 | [
"MIT"
] | null | null | null | from netCDF4 import Dataset
import numpy as np
import os
import sys
from datetime import datetime, timedelta
from tools_BAIU import prep_proj_multi
quick = True
quick = False
def main( time=datetime(2018, 7, 2, 0), hpa=500 ):
ctime = time.strftime('%Y%m%d%H%M%S')
anal = "/data_ballantine02/miyoshi-t/honda/... | 27.858491 | 143 | 0.585506 |
095ac6e5e6caaac1e0a5f43d3b45c7984e64a738 | 15,814 | py | Python | tf2onnx/utils.py | brevettiai/tensorflow-onnx | d4be5af3c2ee6cd9a2053499715661bda7c392ae | [
"Apache-2.0"
] | null | null | null | tf2onnx/utils.py | brevettiai/tensorflow-onnx | d4be5af3c2ee6cd9a2053499715661bda7c392ae | [
"Apache-2.0"
] | null | null | null | tf2onnx/utils.py | brevettiai/tensorflow-onnx | d4be5af3c2ee6cd9a2053499715661bda7c392ae | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
"""
tf2onnx.utils - misc utilities for tf2onnx
"""
import os
import re
import shutil
import tempfile
import types
import zipfile
import logging
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
import numpy as np
from google.protobuf... | 30.064639 | 115 | 0.665423 |
966e66fcb677b846e5397370ec8ba028e58fdde8 | 4,081 | py | Python | strategies/custsignalmod.py | jthhk/Binance-volatility-trading-bot | d815716d2161c5d07cea0506049d73450bd5ef5b | [
"MIT"
] | 4 | 2021-11-10T11:47:39.000Z | 2022-02-03T07:07:37.000Z | strategies/custsignalmod.py | jthhk/Binance-volatility-trading-bot | d815716d2161c5d07cea0506049d73450bd5ef5b | [
"MIT"
] | null | null | null | strategies/custsignalmod.py | jthhk/Binance-volatility-trading-bot | d815716d2161c5d07cea0506049d73450bd5ef5b | [
"MIT"
] | 1 | 2022-01-14T13:03:56.000Z | 2022-01-14T13:03:56.000Z | # Available indicators here: https://python-tradingview-ta.readthedocs.io/en/latest/usage.html#retrieving-the-analysis
from tradingview_ta import TA_Handler, Interval, Exchange
# use for environment variables
import os
# use if needed to pass args to external modules
import sys
# used for directory handling
import glo... | 36.115044 | 224 | 0.657927 |
4df3bd6ac92ce6f5531252987c9efa62d1d20269 | 779 | py | Python | checkov/common/bridgecrew/integration_features/integration_feature_registry.py | jamesholland-uk/checkov | d73fd4bd7096d48ab3434a92a177bcc55605460a | [
"Apache-2.0"
] | 4,013 | 2019-12-09T13:16:54.000Z | 2022-03-31T14:31:01.000Z | checkov/common/bridgecrew/integration_features/integration_feature_registry.py | jamesholland-uk/checkov | d73fd4bd7096d48ab3434a92a177bcc55605460a | [
"Apache-2.0"
] | 1,258 | 2019-12-17T09:55:51.000Z | 2022-03-31T19:17:17.000Z | checkov/common/bridgecrew/integration_features/integration_feature_registry.py | jamesholland-uk/checkov | d73fd4bd7096d48ab3434a92a177bcc55605460a | [
"Apache-2.0"
] | 638 | 2019-12-19T08:57:38.000Z | 2022-03-30T21:38:37.000Z |
class IntegrationFeatureRegistry:
def __init__(self):
self.features = []
def register(self, integration_feature):
self.features.append(integration_feature)
self.features.sort(key=lambda f: f.order)
def run_pre_scan(self):
for integration in self.features:
if ... | 26.862069 | 59 | 0.654685 |
1e9a0c30ea225459810cadbdc2ebb0220071d3b7 | 7,293 | py | Python | loc/helper/deco.py | guluc3m/loc-server | b25b6b2deec5d27c840d60f33e5aa33bd56ba08a | [
"MIT"
] | null | null | null | loc/helper/deco.py | guluc3m/loc-server | b25b6b2deec5d27c840d60f33e5aa33bd56ba08a | [
"MIT"
] | 7 | 2017-12-10T17:12:04.000Z | 2017-12-29T12:23:18.000Z | loc/helper/deco.py | guluc3m/loc-server | b25b6b2deec5d27c840d60f33e5aa33bd56ba08a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# League of Code server implementation
# https://github.com/guluc3m/loc-server
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Grupo de Usuarios de Linux UC3M <http://gul.es>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated doc... | 30.3875 | 81 | 0.586179 |
b7c3273036ce2ce55748461c81618e2faca4799f | 905 | py | Python | examples/dump_ast.py | eliben/pycparser | 615317a473f09b9b9d444313ac15e52e7763c7c1 | [
"BSD-3-Clause"
] | 2,407 | 2015-01-03T03:05:38.000Z | 2022-03-31T13:31:25.000Z | examples/dump_ast.py | eliben/pycparser | 615317a473f09b9b9d444313ac15e52e7763c7c1 | [
"BSD-3-Clause"
] | 355 | 2015-01-11T20:35:32.000Z | 2022-03-31T03:07:53.000Z | examples/dump_ast.py | eliben/pycparser | 615317a473f09b9b9d444313ac15e52e7763c7c1 | [
"BSD-3-Clause"
] | 618 | 2015-01-09T14:10:57.000Z | 2022-03-22T05:16:44.000Z | #-----------------------------------------------------------------
# pycparser: dump_ast.py
#
# Basic example of parsing a file and dumping its parsed AST.
#
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------
from __future__ import print_fu... | 32.321429 | 74 | 0.603315 |
9a101dd99242a871a2b0b965bd6888bb306a6e86 | 29,267 | py | Python | quantumflow/stdgates.py | stjordanis/quantumflow | bf965f0ca70cd69b387f9ca8407ab38da955e925 | [
"Apache-2.0"
] | 99 | 2018-12-03T20:41:39.000Z | 2022-02-21T13:56:08.000Z | quantumflow/stdgates.py | stjordanis/quantumflow | bf965f0ca70cd69b387f9ca8407ab38da955e925 | [
"Apache-2.0"
] | null | null | null | quantumflow/stdgates.py | stjordanis/quantumflow | bf965f0ca70cd69b387f9ca8407ab38da955e925 | [
"Apache-2.0"
] | 24 | 2018-12-03T20:41:41.000Z | 2022-01-03T01:11:45.000Z |
# Copyright 2016-2018, Rigetti Computing
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
""" QuantumFlow Standard Gates """
# Kudos: Many gate definitions adapted from Nick Rubin's reference-qvm
from math import sqrt, ... | 29.208583 | 78 | 0.483856 |
839bc0112654b0a19d47837c9fe608b478bf1786 | 216 | py | Python | pandastools/__init__.py | phil65/pandastools | c00230df7e848d737e5a1e0d0db4d6dcf245ff04 | [
"MIT"
] | 1 | 2021-05-06T06:51:27.000Z | 2021-05-06T06:51:27.000Z | pandastools/__init__.py | phil65/pandastools | c00230df7e848d737e5a1e0d0db4d6dcf245ff04 | [
"MIT"
] | 109 | 2020-07-24T04:10:14.000Z | 2021-10-11T23:49:32.000Z | pandastools/__init__.py | phil65/pandastools | c00230df7e848d737e5a1e0d0db4d6dcf245ff04 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for PandasTools."""
from . import accessors
__author__ = """Philipp Temminghoff"""
__email__ = "phil65@kodi.tv"
__version__ = "0.5.1"
__all__ = ["accessors", "utils"]
| 18 | 40 | 0.657407 |
86d00a437384b586dc8e77b13c2300cd50e3183f | 3,290 | py | Python | salt/auth/mysql.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 12 | 2015-01-21T00:18:25.000Z | 2021-07-11T07:35:26.000Z | salt/auth/mysql.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | salt/auth/mysql.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 12 | 2015-01-05T09:50:42.000Z | 2019-08-19T01:43:40.000Z | # -*- coding: utf-8 -*-
'''
Provide authentication using MySQL.
When using MySQL as an authentication backend, you will need to create or
use an existing table that has a username and a password column.
To get started, create a simple table that holds just a username and
a password. The password field will hold a SH... | 25.703125 | 99 | 0.649848 |
d7019cc9a0ccd2e7192ab816a62f2fa0ee1e5a7b | 2,765 | py | Python | Python/Clone_Graph.py | YohanGupta/Hacktoberfest2020_ | b395193a1f63345fa57ab32fa8da8dc51afb05be | [
"MIT"
] | 77 | 2020-10-01T01:37:10.000Z | 2021-09-30T08:44:44.000Z | Python/Clone_Graph.py | YohanGupta/Hacktoberfest2020_ | b395193a1f63345fa57ab32fa8da8dc51afb05be | [
"MIT"
] | 399 | 2020-09-30T18:48:08.000Z | 2021-04-17T00:16:21.000Z | Python/Clone_Graph.py | YohanGupta/Hacktoberfest2020_ | b395193a1f63345fa57ab32fa8da8dc51afb05be | [
"MIT"
] | 470 | 2020-09-30T18:53:00.000Z | 2021-09-09T10:15:55.000Z | """
Given a graph, clone the graph and output the cloned version of the graph.
The key thing is to map each node to its cloned version.
Steps
1. Map the starting or given node to its cloned version in a hash table.
2. Traverse the graph using a BFS.
3. For each current node get and clone its edges if each edge has no... | 28.802083 | 99 | 0.6217 |
c6268b88622be83b05dba7b5226695e15ce2e711 | 8,119 | py | Python | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/backup_resource_vault_configs_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/backup_resource_vault_configs_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/backup_resource_vault_configs_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 46.130682 | 163 | 0.684321 |
a6f979b24cedecb92cc56f0b094b33ef48fb3825 | 142 | py | Python | kwat/path/clean.py | KwatME/ccal | d96dfa811482eee067f346386a2181ec514625f4 | [
"MIT"
] | 5 | 2017-05-05T17:50:28.000Z | 2019-01-30T19:23:02.000Z | kwat/path/clean.py | KwatME/ccal | d96dfa811482eee067f346386a2181ec514625f4 | [
"MIT"
] | 5 | 2017-05-05T01:52:31.000Z | 2019-04-20T21:06:05.000Z | kwat/path/clean.py | KwatME/ccal | d96dfa811482eee067f346386a2181ec514625f4 | [
"MIT"
] | 5 | 2017-07-17T18:55:54.000Z | 2019-02-02T04:46:19.000Z | from re import sub
def clean(na):
nac = sub(r"[^\w.]", "_", na.strip().lower())
print("{} => {}".format(na, nac))
return nac
| 12.909091 | 49 | 0.5 |
ba867831b830e9bab556f3faeb37447c307097c1 | 454 | py | Python | imperative/python/megengine/data/transform/__init__.py | Olalaye/MegEngine | 695d24f24517536e6544b07936d189dbc031bbce | [
"Apache-2.0"
] | 5,168 | 2020-03-19T06:10:04.000Z | 2022-03-31T11:11:54.000Z | imperative/python/megengine/data/transform/__init__.py | Olalaye/MegEngine | 695d24f24517536e6544b07936d189dbc031bbce | [
"Apache-2.0"
] | 286 | 2020-03-25T01:36:23.000Z | 2022-03-31T10:26:33.000Z | imperative/python/megengine/data/transform/__init__.py | Olalaye/MegEngine | 695d24f24517536e6544b07936d189dbc031bbce | [
"Apache-2.0"
] | 515 | 2020-03-19T06:10:05.000Z | 2022-03-30T09:15:59.000Z | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | 41.272727 | 88 | 0.757709 |
db9f8c38aada5720b66f02636ada1f841c10776a | 2,158 | py | Python | Structural/proxy.py | lpdswing/DesignPatternsPython | 6f4b8416b0624ecda0cca3dadd306f938da9a118 | [
"Apache-2.0"
] | 3 | 2020-07-21T11:43:22.000Z | 2020-07-21T11:56:50.000Z | Structural/proxy.py | lpdswing/DesignPatternsPython | 6f4b8416b0624ecda0cca3dadd306f938da9a118 | [
"Apache-2.0"
] | null | null | null | Structural/proxy.py | lpdswing/DesignPatternsPython | 6f4b8416b0624ecda0cca3dadd306f938da9a118 | [
"Apache-2.0"
] | null | null | null | # 代理模式
# 虚拟代理
class LazyProperty:
def __init__(self, method):
self.method = method
self.method_name = method.__name__
def __get__(self, instance, owner):
if not instance:
return None
value = self.method(instance)
setattr(instance, self.method_name, value)
... | 23.714286 | 77 | 0.57924 |
9f2203e3f3da901d33d182d7321053c704a5752b | 3,684 | py | Python | kobo-book-downloader/__main__.py | jmvermeulen/kobo-book-downloader | 18d039182b1eff648077f6319b943ba1a3890d35 | [
"Unlicense"
] | 146 | 2017-11-06T08:22:33.000Z | 2022-03-28T20:51:34.000Z | kobo-book-downloader/__main__.py | jmvermeulen/kobo-book-downloader | 18d039182b1eff648077f6319b943ba1a3890d35 | [
"Unlicense"
] | 17 | 2018-07-25T13:49:51.000Z | 2021-12-08T15:16:53.000Z | kobo-book-downloader/__main__.py | jmvermeulen/kobo-book-downloader | 18d039182b1eff648077f6319b943ba1a3890d35 | [
"Unlicense"
] | 24 | 2019-05-04T12:51:01.000Z | 2022-03-28T20:51:39.000Z | from Commands import Commands
from Globals import Globals
from Kobo import Kobo, KoboException
from Settings import Settings
import argparse
def Initialize() -> None:
Globals.Kobo = Kobo()
Globals.Settings = Settings()
if not Globals.Settings.AreAuthenticationSettingsSet():
Globals.Kobo.AuthenticateDevice()
G... | 43.341176 | 151 | 0.737242 |
ad683c3a9e5df934cd229ab81c2770f5f442de1e | 5,084 | py | Python | evaluate/classifier.py | DylanTao94/ContraD | 115c8e96e1ec2bcae1f37c2428236a59db555799 | [
"MIT"
] | null | null | null | evaluate/classifier.py | DylanTao94/ContraD | 115c8e96e1ec2bcae1f37c2428236a59db555799 | [
"MIT"
] | null | null | null | evaluate/classifier.py | DylanTao94/ContraD | 115c8e96e1ec2bcae1f37c2428236a59db555799 | [
"MIT"
] | null | null | null | import torch
from torch.nn import CrossEntropyLoss
from evaluate import BaseEvaluator
from evaluate import AverageMeter
from training.criterion import nt_xent
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def accuracy(output, target, topk=(1,)):
"""Computes the accuracy over the k top pr... | 27.781421 | 88 | 0.620771 |
defe87e6e8cf9ed132ab7613c1f175bd1f3d803f | 1,753 | py | Python | bin/prepare_bfs_data.py | digital-land/dataset | 31b20eef25305f2ad3273238d38e0c7da9689cad | [
"MIT"
] | 1 | 2020-03-17T19:10:14.000Z | 2020-03-17T19:10:14.000Z | bin/prepare_bfs_data.py | digital-land/dataset | 31b20eef25305f2ad3273238d38e0c7da9689cad | [
"MIT"
] | 10 | 2020-03-17T08:41:31.000Z | 2021-10-05T09:48:52.000Z | bin/prepare_bfs_data.py | digital-land/dataset | 31b20eef25305f2ad3273238d38e0c7da9689cad | [
"MIT"
] | 1 | 2020-02-24T13:55:33.000Z | 2020-02-24T13:55:33.000Z | #!/usr/bin/env python3
import os
import sys
import json
# add parent directory
sys.path.append(".")
from analyse_dataset import BrownfieldDatasetAnalyser
from organisation import fetch_organisations
from points_to_features import convert_json_to_geojson
from brownfield import brownfield_dataset_path
def process_or... | 27.825397 | 75 | 0.725613 |
aef1b3280b63c03141cc937985e968f56ff27c88 | 11,295 | py | Python | volatility/volatility/win32/hashdump.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | 2 | 2018-07-16T13:30:40.000Z | 2018-07-17T12:02:05.000Z | volatility/volatility/win32/hashdump.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | null | null | null | volatility/volatility/win32/hashdump.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | null | null | null | # Volatility
# Copyright (c) 2008-2013 Volatility Foundation
# Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu>
#
# This file is part of Volatility.
#
# Volatility 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... | 31.816901 | 93 | 0.607083 |
151e3b1d4f8ecc9ac04e34d12cfc782f0050d00f | 1,227 | py | Python | opacus/tests/grad_samples/instance_norm1d_test.py | iamgroot42/opacus | 51708309e71c030aa2bf15d6dccc7bcbbe9ed570 | [
"Apache-2.0"
] | 195 | 2019-12-11T23:55:47.000Z | 2020-08-27T04:17:29.000Z | opacus/tests/grad_samples/instance_norm1d_test.py | iamgroot42/opacus | 51708309e71c030aa2bf15d6dccc7bcbbe9ed570 | [
"Apache-2.0"
] | 35 | 2020-01-21T11:04:29.000Z | 2020-08-27T05:30:57.000Z | opacus/tests/grad_samples/instance_norm1d_test.py | iamgroot42/opacus | 51708309e71c030aa2bf15d6dccc7bcbbe9ed570 | [
"Apache-2.0"
] | 39 | 2020-01-04T20:05:20.000Z | 2020-08-25T23:09:38.000Z | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 29.926829 | 88 | 0.695192 |
e58ceabd1879c49a97b65c149982935f4b4fde66 | 80,233 | py | Python | tests/python/relay/test_op_level3.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 90 | 2021-11-30T11:58:10.000Z | 2022-03-31T02:24:04.000Z | tests/python/relay/test_op_level3.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 64 | 2021-11-22T23:58:23.000Z | 2022-03-31T03:19:22.000Z | tests/python/relay/test_op_level3.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 27 | 2021-12-09T22:39:27.000Z | 2022-03-24T23:21:48.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 u... | 38.741188 | 116 | 0.538145 |
d9e5b6c42b14d6f5fe11db606dd90e87d2b6a645 | 663 | py | Python | config.py | blackshirt/dompetku | 51b907dc25c927ef42b4522499c1884affd42980 | [
"BSD-2-Clause"
] | 1 | 2016-05-15T16:58:54.000Z | 2016-05-15T16:58:54.000Z | config.py | blackshirt/dompetku | 51b907dc25c927ef42b4522499c1884affd42980 | [
"BSD-2-Clause"
] | null | null | null | config.py | blackshirt/dompetku | 51b907dc25c927ef42b4522499c1884affd42980 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright @2014 blackshirtmuslim@yahoo.com
# Licensed: see Python license
"""Config file on top of root dir"""
import os
_data_path = os.path.join(os.path.dirname(__file__), 'data') # relatif ke main script
_db_file = 'dompetku.sqlite'
_db = os.path.join(_data_path, _db_file)
dbconfig = {... | 19.5 | 86 | 0.52187 |
cb69b3d3f0e33f5240fa393199c33b0da6a621b7 | 1,909 | py | Python | research/cv/ntsnet/src/config_gpu.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ntsnet/src/config_gpu.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ntsnet/src/config_gpu.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 29.369231 | 78 | 0.629125 |
d3dd616cbd48264f6df0f88fefe656b4aff0660c | 376 | py | Python | biblioteca/models.py | Camilotk/projeto_pratico_django | b76510d79c7a92774dc33de7271e75adae5f3875 | [
"Apache-2.0"
] | null | null | null | biblioteca/models.py | Camilotk/projeto_pratico_django | b76510d79c7a92774dc33de7271e75adae5f3875 | [
"Apache-2.0"
] | null | null | null | biblioteca/models.py | Camilotk/projeto_pratico_django | b76510d79c7a92774dc33de7271e75adae5f3875 | [
"Apache-2.0"
] | null | null | null | from django.db import models
# Create your models here.
class Livro(models.Model):
autor = models.CharField(max_length=50)
editora = models.CharField(max_length=50)
isbn = models.IntegerField()
numeroPaginas = models.IntegerField()
titulo = models.CharField(max_length=50)
anoPublicacao = model... | 28.923077 | 45 | 0.734043 |
e24e3c5dfab691e4eac98f23eebebdd12939aa40 | 5,857 | py | Python | saleor/graphql/core/enums.py | greentornado/saleor | 7f58917957a23c4dd90b47214a4500c91c735dee | [
"CC-BY-4.0"
] | 3 | 2021-06-22T12:38:18.000Z | 2021-07-11T15:01:57.000Z | saleor/graphql/core/enums.py | greentornado/saleor | 7f58917957a23c4dd90b47214a4500c91c735dee | [
"CC-BY-4.0"
] | 111 | 2021-06-30T08:51:06.000Z | 2022-03-28T04:48:49.000Z | saleor/graphql/core/enums.py | IslamDEVO/es-saleor-nginx | a56a4aaf23fc308aad7b7489bc090fd4fcdb6315 | [
"CC-BY-4.0"
] | 6 | 2021-11-08T16:43:05.000Z | 2022-03-22T17:31:16.000Z | import graphene
from django.conf import settings
from ...account import error_codes as account_error_codes
from ...app import error_codes as app_error_codes
from ...attribute import error_codes as attribute_error_codes
from ...channel import error_codes as channel_error_codes
from ...checkout import error_codes as che... | 44.371212 | 86 | 0.799385 |
d50e820c6c6bc89a9346382c79f057e179f1da12 | 3,301 | py | Python | python/paddle/fluid/tests/unittests/test_ones_op.py | licanisme/Paddle | d11c140e280880b9d031fa38361f3230aef6cf9c | [
"Apache-2.0"
] | 3 | 2021-06-11T06:48:10.000Z | 2021-09-02T10:18:06.000Z | python/paddle/fluid/tests/unittests/test_ones_op.py | 92lqllearning/Paddle | d11c140e280880b9d031fa38361f3230aef6cf9c | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_ones_op.py | 92lqllearning/Paddle | d11c140e280880b9d031fa38361f3230aef6cf9c | [
"Apache-2.0"
] | 1 | 2020-11-05T08:41:11.000Z | 2020-11-05T08:41:11.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 35.494624 | 74 | 0.645865 |
e99145bd815e63f8da5059fa118d10dfeafec823 | 996 | py | Python | taps/ctypes/frechet.py | schinavro/taps | c03b4e23ed299824c1b062225b837a0b7cfff216 | [
"MIT"
] | null | null | null | taps/ctypes/frechet.py | schinavro/taps | c03b4e23ed299824c1b062225b837a0b7cfff216 | [
"MIT"
] | null | null | null | taps/ctypes/frechet.py | schinavro/taps | c03b4e23ed299824c1b062225b837a0b7cfff216 | [
"MIT"
] | null | null | null | # ctypes_test.py
import ctypes
import pathlib
if __name__ == "__main__":
# Load the shared library into ctypes
libname = pathlib.Path().absolute() / "libcfrechet.so"
c_lib = ctypes.CDLL(libname)
dist = c_lib.frechet_distance
dist.argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int,
ctype... | 26.918919 | 73 | 0.630522 |
fa60f0334b791638eb7c32cbfa2c32f7416a05f7 | 105,175 | py | Python | sdk/python/pulumi_azure_native/devices/v20210331/outputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/devices/v20210331/outputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/devices/v20210331/outputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 41.769261 | 452 | 0.656534 |
8ba0aabb7996ee351c685bcd22750de541da6dac | 2,218 | py | Python | chemistry.py | clede/chemistry | 5fb4141054734f4372a196dae6ef77d27e85ca3e | [
"Apache-2.0"
] | null | null | null | chemistry.py | clede/chemistry | 5fb4141054734f4372a196dae6ef77d27e85ca3e | [
"Apache-2.0"
] | null | null | null | chemistry.py | clede/chemistry | 5fb4141054734f4372a196dae6ef77d27e85ca3e | [
"Apache-2.0"
] | null | null | null | import initialization
class Unit(object):
"""A unit of measurement for a substance or supplement. e.g. capsule,
tablet, drop, or milligram, etc."""
# In the future we will need to track relationships between different units.
# e.g. a 'gram' consists of 1000 'milligrams'.
def __init__(self, singul... | 30.805556 | 81 | 0.613165 |
4896d85f9e37ebf1025231690559aa4f8b50303a | 8,627 | py | Python | pyflux/gas/tests/gas_llev_tests_poisson.py | ThomasHoppe/pyflux | 297f2afc2095acd97c12e827dd500e8ea5da0c0f | [
"BSD-3-Clause"
] | 2,091 | 2016-04-01T02:52:10.000Z | 2022-03-29T11:38:15.000Z | pyflux/gas/tests/gas_llev_tests_poisson.py | EricSchles/pyflux | 297f2afc2095acd97c12e827dd500e8ea5da0c0f | [
"BSD-3-Clause"
] | 160 | 2016-04-26T14:52:18.000Z | 2022-03-15T02:09:07.000Z | pyflux/gas/tests/gas_llev_tests_poisson.py | EricSchles/pyflux | 297f2afc2095acd97c12e827dd500e8ea5da0c0f | [
"BSD-3-Clause"
] | 264 | 2016-05-02T14:03:31.000Z | 2022-03-29T07:48:20.000Z | import numpy as np
import pyflux as pf
import pandas as pd
countdata = pd.read_csv('http://www.pyflux.com/notebooks/leicester_goals_scored.csv')
countdata.columns= ["Time","Goals","Season2"]
data = countdata['Goals'].values
def test_poisson_couple_terms():
"""
Tests latent variable list length is correct, and that ... | 39.392694 | 114 | 0.706503 |
287ce8f88b8e9be8c3bfacdde841b638a724ac14 | 1,458 | py | Python | www/lib/components/data/network_interfaces_io.py | cripplet/ipfire-material-design | 972dac352a097bbfe556bf4a6cad900c037cca21 | [
"MIT"
] | null | null | null | www/lib/components/data/network_interfaces_io.py | cripplet/ipfire-material-design | 972dac352a097bbfe556bf4a6cad900c037cca21 | [
"MIT"
] | 3 | 2019-07-13T08:03:22.000Z | 2019-07-13T08:06:03.000Z | www/lib/components/data/network_interfaces_io.py | cripplet/ipfire-material-design | 972dac352a097bbfe556bf4a6cad900c037cca21 | [
"MIT"
] | null | null | null | from typing import AnyStr
import json
from lib.components import shared
from lib.components.data import shared as shared_data
_NETWORK_DATA_SUBPATH_PATTERN = '/interface/if_octets-'
def get_network_interfaces():
return [
i.rsplit('.', 1)[0] for i in
shared_data.get_logged_members(
'{root}/{... | 31.021277 | 75 | 0.691358 |
c5d284c36f82b92b2116b8d04acc617d6392aca4 | 8,129 | py | Python | examples/adwords/v201802/reporting/parallel_report_download.py | stelaxi/googleads-python-lib | 7830f303a63217e7c7190f9b085bce9c4f677727 | [
"Apache-2.0"
] | 1 | 2018-06-25T18:44:30.000Z | 2018-06-25T18:44:30.000Z | examples/adwords/v201802/reporting/parallel_report_download.py | stelaxi/googleads-python-lib | 7830f303a63217e7c7190f9b085bce9c4f677727 | [
"Apache-2.0"
] | null | null | null | examples/adwords/v201802/reporting/parallel_report_download.py | stelaxi/googleads-python-lib | 7830f303a63217e7c7190f9b085bce9c4f677727 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 35.190476 | 80 | 0.672038 |
edd0ec043c1b4e5b49f85a5a85f5c32aa6a40983 | 1,321 | py | Python | behavior_regularized_offline_rl/brac/train_online_test.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | behavior_regularized_offline_rl/brac/train_online_test.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | behavior_regularized_offline_rl/brac/train_online_test.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 31.452381 | 74 | 0.763815 |
b4ce968bee28a92439ae50122067c63d37f5b6a0 | 779 | py | Python | fgs.py | trejsu/ensemble-adv-training | 0d385fbd87c86fc7826cb04a75c9a6bd219e5d69 | [
"MIT"
] | 133 | 2017-06-01T01:52:35.000Z | 2021-12-14T03:08:11.000Z | fgs.py | trejsu/ensemble-adv-training | 0d385fbd87c86fc7826cb04a75c9a6bd219e5d69 | [
"MIT"
] | 5 | 2017-09-04T07:18:40.000Z | 2020-04-14T15:19:39.000Z | fgs.py | trejsu/ensemble-adv-training | 0d385fbd87c86fc7826cb04a75c9a6bd219e5d69 | [
"MIT"
] | 42 | 2017-06-04T01:16:40.000Z | 2020-10-20T08:11:21.000Z |
import keras.backend as K
from attack_utils import gen_grad
def symbolic_fgs(x, grad, eps=0.3, clipping=True):
"""
FGSM attack.
"""
# signed gradient
normed_grad = K.sign(grad)
# Multiply by constant epsilon
scaled_grad = eps * normed_grad
# Add perturbation to original example to ... | 19.974359 | 72 | 0.631579 |
8f31b1ec2bacc22c66607c767971b71c038a359e | 16,082 | py | Python | intersight/apis/workflow_build_task_meta_owner_api.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/apis/workflow_build_task_meta_owner_api.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/apis/workflow_build_task_meta_owner_api.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
import re
# python 2 and python 3 compatibility library
from s... | 56.826855 | 818 | 0.652096 |
71e2146809a8acd688ab14fcc199ec5f954e5f16 | 1,055 | py | Python | AC09/Server/Model/usuario.py | lucaskurata/API | 7f67ad3babf525d3caeab7b58bff59abbfef5615 | [
"Apache-2.0"
] | null | null | null | AC09/Server/Model/usuario.py | lucaskurata/API | 7f67ad3babf525d3caeab7b58bff59abbfef5615 | [
"Apache-2.0"
] | null | null | null | AC09/Server/Model/usuario.py | lucaskurata/API | 7f67ad3babf525d3caeab7b58bff59abbfef5615 | [
"Apache-2.0"
] | null | null | null | class Usuario():
def __init__(self, id_Usuario, nome, segredo):
self.id_Usuario = id_Usuario
self.nome = nome
self.segredo = segredo
def __dict__(self):
dicio = dict()
dicio['id_Usuario'] = self.id_Usuario
dicio['nome'] = self.nome
dicio['segredo'] = self... | 30.142857 | 83 | 0.546919 |
45362447ee575e9c471259c9b80047711573631a | 543 | py | Python | bgp/tables.py | maznu/peering-manager | d249fcf530f4cc48b39429badb79bc203e0148ba | [
"Apache-2.0"
] | 127 | 2017-10-12T00:27:45.000Z | 2020-08-07T11:13:55.000Z | bgp/tables.py | maznu/peering-manager | d249fcf530f4cc48b39429badb79bc203e0148ba | [
"Apache-2.0"
] | 247 | 2017-12-26T12:55:34.000Z | 2020-08-08T11:57:35.000Z | bgp/tables.py | maznu/peering-manager | d249fcf530f4cc48b39429badb79bc203e0148ba | [
"Apache-2.0"
] | 63 | 2017-10-13T06:46:05.000Z | 2020-08-08T00:41:57.000Z | import django_tables2 as tables
from bgp.models import Relationship
from utils.tables import BaseTable, ButtonsColumn, ColourColumn, SelectColumn
class RelationshipTable(BaseTable):
pk = SelectColumn()
name = tables.Column(linkify=True)
color = ColourColumn()
actions = ButtonsColumn(Relationship, but... | 31.941176 | 77 | 0.690608 |
7b235c7b944b91fc209f09f8852ca84b908f87f4 | 4,123 | py | Python | locations/spiders/perkins.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/perkins.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/perkins.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
class PerkinsSpider(scrapy.Spider):
name = "perkins"
item_attributes = {"brand": "Perkins"}
allowed_domains = ["stores.perkinsrestaurants.com"]
start_urls = ("https://stores.perkinsrestaurants.com/sitemap.x... | 35.239316 | 95 | 0.502304 |
ff197bd8e4b69272f42af3474e9210866bacd8c5 | 1,963 | py | Python | kindle-notes/utils/html/base.py | Drinkey/kindle-notes | 35300164d12a63264b318b778880d124a8f68e0c | [
"MIT"
] | null | null | null | kindle-notes/utils/html/base.py | Drinkey/kindle-notes | 35300164d12a63264b318b778880d124a8f68e0c | [
"MIT"
] | 9 | 2019-02-22T09:02:19.000Z | 2019-02-24T14:51:55.000Z | kindle-notes/utils/html/base.py | Drinkey/kindle-notes | 35300164d12a63264b318b778880d124a8f68e0c | [
"MIT"
] | null | null | null | import re
from enum import Enum
import requests_html
from utils.objects import KindleNotes, NoteElement
def get_note_heading_text(heading):
rex = re.search(r'Highlight.*\-\s(.*)\s\> Location.*', heading)
if rex:
return rex.group(1)
return ''
def html_parser(html, selector):
return html.find(s... | 33.844828 | 96 | 0.641875 |
df89bdba14d3c5677079ef5ef1c63a79bfbea18e | 2,015 | py | Python | networkx/algorithms/centrality/harmonic.py | AaronOpfer/networkx | f04ca835c3503f04f9b3e933270575980e44205b | [
"BSD-3-Clause"
] | 3 | 2020-08-04T20:29:41.000Z | 2020-11-09T09:28:19.000Z | networkx/algorithms/centrality/harmonic.py | AaronOpfer/networkx | f04ca835c3503f04f9b3e933270575980e44205b | [
"BSD-3-Clause"
] | 30 | 2020-04-15T19:37:40.000Z | 2020-04-22T21:19:35.000Z | networkx/algorithms/centrality/harmonic.py | AaronOpfer/networkx | f04ca835c3503f04f9b3e933270575980e44205b | [
"BSD-3-Clause"
] | 2 | 2020-03-12T23:20:22.000Z | 2021-02-15T21:54:02.000Z | # Copyright (C) 2015 by
# Alessandro Luongo
# BSD license.
#
# Authors:
# Alessandro Luongo <alessandro.luongo@studenti.unimi.it>
#
"""Functions for computing the harmonic centrality of a graph."""
from functools import partial
import networkx as nx
__all__ = ['harmonic_centrality']
def harmonic_central... | 29.202899 | 82 | 0.664516 |
f715517d413224bd0e232c087a3dc3de8fac5148 | 2,409 | py | Python | DATA/10_64_64_64_1E7/analy.py | Aieener/SUS_3D | 8fc5a768a2339238939522baf96bce98bf61902e | [
"MIT"
] | null | null | null | DATA/10_64_64_64_1E7/analy.py | Aieener/SUS_3D | 8fc5a768a2339238939522baf96bce98bf61902e | [
"MIT"
] | null | null | null | DATA/10_64_64_64_1E7/analy.py | Aieener/SUS_3D | 8fc5a768a2339238939522baf96bce98bf61902e | [
"MIT"
] | null | null | null | # analy.py
# A python program to analyze the SUS weighting function in order to reach the following goals:
# 1. plot the weight function
# 2. generate the normalized distribution for Z=1
# 3. extrapolate the N distribution for different Zs given by the user.
# Author: Yuding Ai
# Date: 2015 Oct 23
import math
import n... | 23.38835 | 95 | 0.632213 |
d897337abce84a3f711b6e51390d7a815fa7b388 | 581 | py | Python | acmgnyr2014/e.py | AnAverageHuman/competitive | 4c4b9bdbe91fde1c52f731426f9a53bff97796e1 | [
"BSD-3-Clause"
] | null | null | null | acmgnyr2014/e.py | AnAverageHuman/competitive | 4c4b9bdbe91fde1c52f731426f9a53bff97796e1 | [
"BSD-3-Clause"
] | null | null | null | acmgnyr2014/e.py | AnAverageHuman/competitive | 4c4b9bdbe91fde1c52f731426f9a53bff97796e1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
P = int(input())
for _ in range(P):
K, N = map(int, input().split())
b = []
while N > 0:
empty = len(b)
for (i, x) in enumerate(b):
if x == 0:
empty = i
break
for i in range(empty):
b[i] -= 1
i... | 18.741935 | 50 | 0.387263 |
e22b6747bdc779a95fc9a672afa26d7f663d52c1 | 1,148 | py | Python | test/vanilla/Expected/AcceptanceTests/Xml/setup.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/Xml/setup.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/Xml/setup.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"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.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 30.210526 | 94 | 0.630662 |
cb80f3125c3a61420af5aaf2477b4df6a0cf0a80 | 87 | py | Python | mypics/apps.py | ngetichnicholas/My-Gallery | 0b5e86b648c488d3d6c6ff86e4a094cc42e8a30b | [
"MIT"
] | 1 | 2021-07-31T08:01:11.000Z | 2021-07-31T08:01:11.000Z | mypics/apps.py | ngetichnicholas/My-Gallery | 0b5e86b648c488d3d6c6ff86e4a094cc42e8a30b | [
"MIT"
] | null | null | null | mypics/apps.py | ngetichnicholas/My-Gallery | 0b5e86b648c488d3d6c6ff86e4a094cc42e8a30b | [
"MIT"
] | 1 | 2022-03-29T19:01:07.000Z | 2022-03-29T19:01:07.000Z | from django.apps import AppConfig
class MypicsConfig(AppConfig):
name = 'mypics'
| 14.5 | 33 | 0.747126 |
f1f03e3f0be8934083020c10afc5563cb3179072 | 269 | py | Python | aiocogeo/errors.py | vincentsarago/aiocogeo | bda7334cfc2c761b92563a6cd952cf31c54ca495 | [
"MIT"
] | null | null | null | aiocogeo/errors.py | vincentsarago/aiocogeo | bda7334cfc2c761b92563a6cd952cf31c54ca495 | [
"MIT"
] | null | null | null | aiocogeo/errors.py | vincentsarago/aiocogeo | bda7334cfc2c761b92563a6cd952cf31c54ca495 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
@dataclass
class CogReadError(Exception):
message: str
@dataclass
class InvalidTiffError(CogReadError):
...
@dataclass
class TileNotFoundError(CogReadError):
...
@dataclass
class MissingAssets(CogReadError):
... | 12.809524 | 38 | 0.739777 |
74272a7fe1e9f313d6253fc51ff385ac70aa1bd8 | 31,233 | py | Python | stateRepresentation.py | xc-liu/pacman-rl-agent | 5372f8c479b1a1f25132602978f9eb908fce774e | [
"Unlicense"
] | null | null | null | stateRepresentation.py | xc-liu/pacman-rl-agent | 5372f8c479b1a1f25132602978f9eb908fce774e | [
"Unlicense"
] | null | null | null | stateRepresentation.py | xc-liu/pacman-rl-agent | 5372f8c479b1a1f25132602978f9eb908fce774e | [
"Unlicense"
] | null | null | null | import math
import time
import numpy as np
from score_keeper import get_timesteps
symmetric = True
def kalman(v, r, q):
"""
v - array to filter
t - time steps, usually just range(len(v))
r - how much we trust our path def=0.1
q - decreasing it makes it smoother def=0.01
"""
p = 12... | 45.59562 | 162 | 0.554862 |
7bafd531f0ca42d80bcb7e40a1a93322746fc122 | 13,685 | py | Python | train_refinedet.py | HaoIrving/RefineDet.PyTorch | ae453a7b701aeb0cb82b46f9c72f23ae4520ddcd | [
"MIT"
] | null | null | null | train_refinedet.py | HaoIrving/RefineDet.PyTorch | ae453a7b701aeb0cb82b46f9c72f23ae4520ddcd | [
"MIT"
] | null | null | null | train_refinedet.py | HaoIrving/RefineDet.PyTorch | ae453a7b701aeb0cb82b46f9c72f23ae4520ddcd | [
"MIT"
] | null | null | null | from data import *
from utils.augmentations import SSDAugmentation
from layers.modules import RefineDetMultiBoxLoss
#from ssd import build_ssd
from models.refinedet import build_refinedet
# from models.refinedet_bn import build_refinedet
import os
import sys
import time
import torch
import torch.nn as nn
import torch.... | 40.131965 | 252 | 0.612934 |
a01aa5afdf9beda1e93d25cbfa3280ed982f5c0d | 4,063 | py | Python | old/parameterisation.py | abyrne55/osvr-review | 777884dcbcb2283247ffe256da51254aa3d6896b | [
"MIT"
] | null | null | null | old/parameterisation.py | abyrne55/osvr-review | 777884dcbcb2283247ffe256da51254aa3d6896b | [
"MIT"
] | null | null | null | old/parameterisation.py | abyrne55/osvr-review | 777884dcbcb2283247ffe256da51254aa3d6896b | [
"MIT"
] | null | null | null | # Direct Port of constructParams.m
import numpy as np
def construct_admm_parameters(dataset, labelset, epsilon, bias, flag):
datacells = dataset.T
labelcells = labelset.T
N = datacells.size
T = np.zeros((N,1))
num_pairs_max = 0;
num_intensity = 0;
# Collect Statistics of the ... | 37.275229 | 136 | 0.578144 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.