hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6b1d964e26ac4a5763f230df2788c94fa9547e51 | 69,766 | py | Python | salt/modules/bigip.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:21.000Z | 2020-01-02T09:03:21.000Z | salt/modules/bigip.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | null | null | null | salt/modules/bigip.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:24.000Z | 2020-01-02T09:03:24.000Z | # -*- coding: utf-8 -*-
'''
An execution module which can manipulate an f5 bigip via iControl REST
:maturity: develop
:platform: f5_bigip_11.6
'''
# Import python libs
from __future__ import absolute_import
import json
import logging as logger
# Import third party libs
try:
import requests
i... | 31.59692 | 171 | 0.618353 |
12fb7e00f96ab5db12948a35295803f3ad109c79 | 1,676 | py | Python | koreto/rndm.py | xvdp/koreto | 70f683aeec5e43a15549d447b8f540fa4c5fde4f | [
"MIT"
] | null | null | null | koreto/rndm.py | xvdp/koreto | 70f683aeec5e43a15549d447b8f540fa4c5fde4f | [
"MIT"
] | null | null | null | koreto/rndm.py | xvdp/koreto | 70f683aeec5e43a15549d447b8f540fa4c5fde4f | [
"MIT"
] | null | null | null | """ random utilities """
import numpy as np
from koreto import WITH_TORCH
if WITH_TORCH:
import torch
# pylint: disable=no-member
def unique_randint(low, high, size, overflow=1.2, out_type="torch"):
""" returns a unique set of random ints
Args
low (int)
high (int)
si... | 29.403509 | 75 | 0.597852 |
5a1de7d4d772805ff3d96f4283f18971d5f2aed6 | 4,024 | py | Python | goose/utils/__init__.py | chenjue/python-goose | 840ced108731a287422bc4383df69737753a1cdd | [
"Apache-2.0"
] | 3,052 | 2015-01-01T09:03:06.000Z | 2022-03-30T17:47:30.000Z | goose/utils/__init__.py | 17702296834/python-goose | 09023ec9f5ef26a628a2365616c0a7c864f0ecea | [
"Apache-2.0"
] | 87 | 2015-01-01T02:55:22.000Z | 2021-11-19T01:52:48.000Z | goose/utils/__init__.py | 17702296834/python-goose | 09023ec9f5ef26a628a2365616c0a7c864f0ecea | [
"Apache-2.0"
] | 765 | 2015-01-02T13:45:53.000Z | 2022-02-12T16:20:44.000Z | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | 28.13986 | 79 | 0.645129 |
1b035a028b650810306046d4feb72ad53ced2070 | 2,923 | py | Python | src/python/pants/util/eval.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | 94 | 2015-01-15T21:24:20.000Z | 2022-02-16T16:55:43.000Z | src/python/pants/util/eval.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | 5 | 2020-07-18T01:04:43.000Z | 2021-05-10T08:40:56.000Z | src/python/pants/util/eval.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | 47 | 2015-02-25T02:20:07.000Z | 2022-03-21T00:59:16.000Z | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import range, str
from textwrap import dedent
from future.utils import str... | 37.961039 | 98 | 0.657886 |
74a6c399649d26d5f4053baefbffd70b0bf38fa9 | 2,834 | py | Python | pythonProject1/venv/Lib/site-packages/json_api_doc/serialization.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | 23 | 2019-01-11T10:14:39.000Z | 2021-11-12T12:03:49.000Z | pythonProject1/venv/Lib/site-packages/json_api_doc/serialization.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | 22 | 2018-05-16T20:50:42.000Z | 2020-12-04T01:22:54.000Z | pythonProject1/venv/Lib/site-packages/json_api_doc/serialization.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | 12 | 2019-01-05T17:12:40.000Z | 2020-11-30T14:54:28.000Z | # -*- coding: utf-8 -*-
from collections import OrderedDict
def serialize(data={}, errors={}, meta={}, links={}):
"""
:param data: Dict with data to serialize
:param errors: Dict with error data to serialize
:param meta: Dict with meta data to serialize
:returns: Dict normalized as a valid JSON A... | 25.079646 | 76 | 0.529287 |
09f749cba566314c7bca117724db1325a857c58e | 443 | py | Python | SNE_lab/config.py | LplusKira/SNE_lab | dd51d5bb8e18244605a9e25f26264fc0ff743c00 | [
"MIT"
] | 2 | 2019-02-21T14:53:34.000Z | 2020-04-02T07:13:04.000Z | SNE_lab/config.py | LplusKira/SNE_lab | dd51d5bb8e18244605a9e25f26264fc0ff743c00 | [
"MIT"
] | null | null | null | SNE_lab/config.py | LplusKira/SNE_lab | dd51d5bb8e18244605a9e25f26264fc0ff743c00 | [
"MIT"
] | null | null | null | from os import environ
import logging
# For logging
DEBUG2LOG_LEVEL = {
'DEBUG': logging.DEBUG,
'INFO': logging.INFO,
'WARNING': logging.WARNING,
'ERROR': logging.ERROR,
'CRITICAL': logging.CRITICAL,
}
DEBUG = environ.get('DEBUG') # Logging level
LOG_LEVEL = DEBUG2LOG_LEVEL.get(DEBUG, DEBUG2LOG_LE... | 24.611111 | 63 | 0.704289 |
57d29f34a45a92774203f5e23f2e7422c6249f3d | 962 | py | Python | book_center/book_center/bc_contact/forms.py | geodimitrov/Python-Web-Framework-SoftUni | 06b7e11aee0024a564d1b266d5ed6271351ac116 | [
"MIT"
] | null | null | null | book_center/book_center/bc_contact/forms.py | geodimitrov/Python-Web-Framework-SoftUni | 06b7e11aee0024a564d1b266d5ed6271351ac116 | [
"MIT"
] | null | null | null | book_center/book_center/bc_contact/forms.py | geodimitrov/Python-Web-Framework-SoftUni | 06b7e11aee0024a564d1b266d5ed6271351ac116 | [
"MIT"
] | null | null | null | from book_center.bc_contact.models import BookCenterContactFormModel
from book_center.utils.validators import validate_bot_catcher_empty
from book_center.utils.mixins import NoLabelFormMixin
from django import forms
class ContactForm(NoLabelFormMixin, forms.ModelForm):
def __init__(self, *args, **kwargs):
... | 34.357143 | 103 | 0.678794 |
c5d28e372b6292e7b2ead24bf808ded021689a57 | 858 | py | Python | jhu_primitives/core/JHUEvaluator.py | jagterberg/primitives-interfaces | b5d31999593baa926a4fbd5d3bdd752d8c468e6a | [
"Apache-2.0"
] | null | null | null | jhu_primitives/core/JHUEvaluator.py | jagterberg/primitives-interfaces | b5d31999593baa926a4fbd5d3bdd752d8c468e6a | [
"Apache-2.0"
] | 10 | 2017-09-12T05:45:43.000Z | 2017-09-18T15:26:43.000Z | jhu_primitives/core/JHUEvaluator.py | youngser/D3M | a9998ca12644264d61e8ce5258a54f25b5f9f726 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# JHUEvaluator.py
from sklearn.metrics import adjusted_rand_score
from Evaluator import Evaluator
class JHUEvaluator(Evaluator):
def __init__(self):
pass
def get_accuracy(self, **kwargs):
"""
Use ARI to evaluate our procedure
** Keyword Arguments **:
... | 23.189189 | 71 | 0.60373 |
0dbb97a36009acf8010021e28956dabffa12debf | 11,580 | py | Python | yt_dlp/extractor/twitcasting.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 11 | 2022-01-06T22:09:50.000Z | 2022-03-12T22:26:22.000Z | yt_dlp/extractor/twitcasting.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 4 | 2022-02-25T08:20:18.000Z | 2022-03-17T16:16:20.000Z | yt_dlp/extractor/twitcasting.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 3 | 2022-02-19T08:59:13.000Z | 2022-03-06T16:11:21.000Z | import itertools
import re
from .common import InfoExtractor
from ..dependencies import websockets
from ..utils import (
clean_html,
ExtractorError,
float_or_none,
get_element_by_class,
get_element_by_id,
parse_duration,
qualities,
str_to_int,
traverse_obj,
try_get,
unified_... | 41.805054 | 175 | 0.545941 |
92a6f4e670e05251b47413f65819bdaa9f7caaa4 | 399 | py | Python | fsapi/netRemote_sys_audio.py | jentz1986/shng-undok-plugin | c684a3c2d3f5e747bfc4df0000fb445a74b47334 | [
"MIT"
] | null | null | null | fsapi/netRemote_sys_audio.py | jentz1986/shng-undok-plugin | c684a3c2d3f5e747bfc4df0000fb445a74b47334 | [
"MIT"
] | null | null | null | fsapi/netRemote_sys_audio.py | jentz1986/shng-undok-plugin | c684a3c2d3f5e747bfc4df0000fb445a74b47334 | [
"MIT"
] | null | null | null | from .fsapi_exception import *
from .fsapi_node import *
@FSAPI_Node('bool', 'mute')
class FSAPI_Node_Mute(object):
key = 'netRemote.sys.audio.mute'
max_age = 5
get_url = "GET/{}"
set_url = "SET/{}"
@FSAPI_Node('u8', 'volume')
class FSAPI_Node_Volume(object):
key = 'netRemote.sys.a... | 21 | 39 | 0.60401 |
0b7d5fe62ce497f7d92855e7298e6a3e8731ffc1 | 3,239 | py | Python | repos/system_upgrade/common/actors/yumconfigscanner/libraries/yumconfigscanner.py | tmds/leapp-repository | 7c9ea115a68530eb25f5c23d3fcadd60c501bf78 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/common/actors/yumconfigscanner/libraries/yumconfigscanner.py | tmds/leapp-repository | 7c9ea115a68530eb25f5c23d3fcadd60c501bf78 | [
"Apache-2.0"
] | 1 | 2022-03-07T15:34:11.000Z | 2022-03-07T15:35:15.000Z | repos/system_upgrade/common/actors/yumconfigscanner/libraries/yumconfigscanner.py | tmds/leapp-repository | 7c9ea115a68530eb25f5c23d3fcadd60c501bf78 | [
"Apache-2.0"
] | null | null | null | import re
from leapp.libraries.common.config.version import get_source_major_version
from leapp.libraries.stdlib import api, run
from leapp.models import YumConfig
# When the output spans multiple lines, each of the lines after the first one
# start with a ' <SPACES> : '
YUM_LOADED_PLUGINS_NEXT_LINE_START = ' +... | 36.806818 | 114 | 0.656993 |
2abc6896348156a7f4f26309b66b60487b9f0ce8 | 12,120 | py | Python | pinet/CurveLanes/util_hourglass.py | ybarancan/STSU | 0b9efa88739c517a7ca00e61faefa4b45714d312 | [
"Apache-2.0"
] | 67 | 2021-10-06T13:48:44.000Z | 2022-03-31T04:00:20.000Z | pinet/CurveLanes/util_hourglass.py | w23215/STSU | 0b9efa88739c517a7ca00e61faefa4b45714d312 | [
"Apache-2.0"
] | 6 | 2021-11-03T08:37:31.000Z | 2022-03-19T10:13:10.000Z | pinet/CurveLanes/util_hourglass.py | w23215/STSU | 0b9efa88739c517a7ca00e61faefa4b45714d312 | [
"Apache-2.0"
] | 10 | 2021-12-08T10:54:45.000Z | 2022-03-22T06:44:14.000Z | #########################################################################
##
## Some utility for training, data processing, and network.
##
#########################################################################
import torch
import torch.nn as nn
from pinet.CurveLanes.parameters import Parameters
p = Parameters()
d... | 38.35443 | 131 | 0.607096 |
87d599367e2119855815b539cb6f6f9661600024 | 452 | py | Python | replierClass.py | jujinesy/pl-Steve28-lq_Python_ForKakaoBot | f613b8d7377150a5458b5738d281cfb81c82beac | [
"MIT"
] | 7 | 2020-10-13T14:41:21.000Z | 2020-11-12T09:36:41.000Z | replierClass.py | jujinesy/pl-Steve28-lq_Python_ForKakaoBot | f613b8d7377150a5458b5738d281cfb81c82beac | [
"MIT"
] | null | null | null | replierClass.py | jujinesy/pl-Steve28-lq_Python_ForKakaoBot | f613b8d7377150a5458b5738d281cfb81c82beac | [
"MIT"
] | 2 | 2020-10-30T03:39:58.000Z | 2020-10-30T05:05:42.000Z | data = []
class replier:
global data
def __init__(self, packName, room, isDebugChat):
self.isDebugChat = isDebugChat
self.packName = packName
self.room = room
self.data = data
def clear(self):
del data[:]
def reply(self, msg):
data.append(msg)
print(data)
class KakaoLink:
glo... | 17.384615 | 50 | 0.599558 |
d54930a413bdd87764aba5d721e26de74100bd1e | 573 | py | Python | config/celery_app.py | DevSusu/uudaemon | e1184a4e2f596611db3595398bb81fc5d3e6af6e | [
"MIT"
] | null | null | null | config/celery_app.py | DevSusu/uudaemon | e1184a4e2f596611db3595398bb81fc5d3e6af6e | [
"MIT"
] | 1 | 2022-03-01T09:07:12.000Z | 2022-03-01T09:07:12.000Z | config/celery_app.py | DevSusu/uudaemon | e1184a4e2f596611db3595398bb81fc5d3e6af6e | [
"MIT"
] | null | null | null | import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
app = Celery("uudaemon")
# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
# -... | 31.833333 | 72 | 0.78185 |
dbecfb1a26b666f96f07cf6f06afbfe696ab6e35 | 1,612 | py | Python | tests/test_util.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | 1 | 2021-02-17T04:27:16.000Z | 2021-02-17T04:27:16.000Z | tests/test_util.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | null | null | null | tests/test_util.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | 1 | 2018-11-29T06:45:05.000Z | 2018-11-29T06:45:05.000Z | # -*- coding: utf-8 -*-
"""
test_util
~~~~~~~~~~~~~~~
Tests util functions.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from sphinx.util import encode_uri, split_docinfo
def test_encode_uri():
expected = (u'https://ru.wikipedia... | 36.636364 | 93 | 0.645161 |
6f5630a27ba643ee41f05a2373014ea8fb2ba0a0 | 6,459 | py | Python | myfitnesspaw/types.py | hooman130/myfitnesspaw | 3523b0efae2af3d590205d8ace06978ee136b8fe | [
"MIT"
] | 2 | 2020-09-16T02:50:28.000Z | 2020-09-21T16:43:41.000Z | myfitnesspaw/types.py | hooman130/myfitnesspaw | 3523b0efae2af3d590205d8ace06978ee136b8fe | [
"MIT"
] | null | null | null | myfitnesspaw/types.py | hooman130/myfitnesspaw | 3523b0efae2af3d590205d8ace06978ee136b8fe | [
"MIT"
] | 1 | 2021-10-15T16:47:18.000Z | 2021-10-15T16:47:18.000Z | from dataclasses import dataclass
from datetime import date, datetime, timedelta
from pathlib import Path
from typing import Dict, List
import matplotlib.pyplot as plt
import numpy as np
from myfitnesspal.exercise import Exercise
from myfitnesspal.meal import Meal
from . import styles
@dataclass
class MaterializedD... | 31.507317 | 84 | 0.600248 |
2137e9e707f5797b3f9eb54d154b02ac384581d0 | 6,125 | py | Python | lux/vislib/altair/AltairRenderer.py | vyomtech/lux | 4d46ad9d98ad674508c7dadc4131b4707e4cac90 | [
"Apache-2.0"
] | 2 | 2021-12-05T10:11:32.000Z | 2022-01-23T21:43:03.000Z | lux/vislib/altair/AltairRenderer.py | vyomtech/lux | 4d46ad9d98ad674508c7dadc4131b4707e4cac90 | [
"Apache-2.0"
] | null | null | null | lux/vislib/altair/AltairRenderer.py | vyomtech/lux | 4d46ad9d98ad674508c7dadc4131b4707e4cac90 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 The Lux 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... | 43.439716 | 132 | 0.554939 |
762314bcfab8dbfdc238723be4badd6fc3a18275 | 5,805 | py | Python | google/ads/google_ads/v0/proto/common/value_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v0/proto/common/value_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v0/proto/common/value_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v0/proto/common/value.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.p... | 43 | 690 | 0.749526 |
be404df1a3076ca374670d814dc715f40782588a | 4,644 | py | Python | pinax/stripe/tests/__init__.py | proitm/pinax-stripe | c5b05f699fde6bd66cc633669604e5a6d1158d8a | [
"MIT"
] | 375 | 2015-11-14T17:43:26.000Z | 2021-11-16T10:59:02.000Z | pinax/stripe/tests/__init__.py | proitm/pinax-stripe | c5b05f699fde6bd66cc633669604e5a6d1158d8a | [
"MIT"
] | 470 | 2015-11-15T20:41:49.000Z | 2021-11-27T07:22:41.000Z | pinax/stripe/tests/__init__.py | proitm/pinax-stripe | c5b05f699fde6bd66cc633669604e5a6d1158d8a | [
"MIT"
] | 205 | 2015-11-17T20:25:28.000Z | 2021-11-22T21:56:52.000Z | TRANSFER_CREATED_TEST_DATA = {
"created": 1348360173,
"data": {
"object": {
"amount": 455,
"currency": "usd",
"date": 1348876800,
"description": None,
"id": "tr_XXXXXXXXXXXX",
"livemode": True,
"object": "transfer",
... | 28.84472 | 53 | 0.419035 |
e0bfcebfaa4f6f1edfaa4e4d4aae81ac6e28f2e1 | 677 | py | Python | company_interview_qs/graph_representations.py | santoshmano/pybricks | bcb3ab80417e8e896280062494ce6c046329b7e8 | [
"MIT"
] | null | null | null | company_interview_qs/graph_representations.py | santoshmano/pybricks | bcb3ab80417e8e896280062494ce6c046329b7e8 | [
"MIT"
] | null | null | null | company_interview_qs/graph_representations.py | santoshmano/pybricks | bcb3ab80417e8e896280062494ce6c046329b7e8 | [
"MIT"
] | null | null | null |
# Adjacency list
#
class Graph_1:
def __init__(self):
self.vertices = []
self.edges = []
# hashmap of vertex -> neigbors
Graph_2 = {}
class Graph:
def __init__(self):
self.vertices = []
class Vertex:
def __init__(self, val):
self.val = val
self.neighbors = []
... | 16.119048 | 38 | 0.570162 |
d49f55aa3d7a2ac8f02f6acf16caec5b5ac526b9 | 443 | py | Python | gui/account/migrations/0013_auto_20151120_1029.py | alpha-zou/TAMP | 91f0e7b08e2d6a03b541b07dd4768bf5222044dd | [
"MIT"
] | 1 | 2020-03-20T06:52:07.000Z | 2020-03-20T06:52:07.000Z | gui/account/migrations/0013_auto_20151120_1029.py | alpha-zou/TAMP | 91f0e7b08e2d6a03b541b07dd4768bf5222044dd | [
"MIT"
] | 1 | 2021-11-12T15:20:56.000Z | 2021-11-12T15:20:56.000Z | gui/account/migrations/0013_auto_20151120_1029.py | alpha-zou/TAMP | 91f0e7b08e2d6a03b541b07dd4768bf5222044dd | [
"MIT"
] | 3 | 2019-03-10T19:56:17.000Z | 2020-03-20T07:00:10.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0012_auto_20151120_1025'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
... | 22.15 | 73 | 0.62754 |
31f8143105e64bd9a34fb3cf5d4c96e93973210a | 2,071 | py | Python | sources/models/libraries/library_reference_model.py | pablintino/Altium-DBlib-source | 65e85572f84048a7e7c5a116b429e09ac9a33e82 | [
"MIT"
] | 1 | 2021-06-23T20:19:45.000Z | 2021-06-23T20:19:45.000Z | sources/models/libraries/library_reference_model.py | pablintino/Altium-DBlib-source | 65e85572f84048a7e7c5a116b429e09ac9a33e82 | [
"MIT"
] | null | null | null | sources/models/libraries/library_reference_model.py | pablintino/Altium-DBlib-source | 65e85572f84048a7e7c5a116b429e09ac9a33e82 | [
"MIT"
] | null | null | null | #
# MIT License
#
# Copyright (c) 2020 Pablo Rodriguez Nava, @pablintino
#
# 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
# t... | 35.706897 | 96 | 0.736359 |
cf84760108af75bf1a96294e43463d944de92747 | 617 | py | Python | pyleecan/Methods/Slot/HoleMag/comp_mass_magnet_id.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | 4 | 2017-11-27T10:14:34.000Z | 2018-09-20T11:30:32.000Z | pyleecan/Methods/Slot/HoleMag/comp_mass_magnet_id.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | null | null | null | pyleecan/Methods/Slot/HoleMag/comp_mass_magnet_id.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | null | null | null | def comp_mass_magnet_id(self, index):
"""Compute the mass of the hole magnet of the corresponding index
Parameters
----------
self : HoleMag
A HoleMag object
index : int
Index of the magnet to compute the surface
Returns
-------
Mmag: float
Mass of the Magnet [m... | 23.730769 | 69 | 0.583468 |
49bdaebeb8d4aa02a20737a9d39dc66d5c1f6e2b | 6,369 | py | Python | docs/conf.py | nattster/lettuce_webdriver | 26b910ceef67d5b81030640ebbab0504bd59d643 | [
"MIT"
] | 24 | 2015-02-04T14:49:51.000Z | 2021-03-23T17:17:09.000Z | docs/conf.py | nattster/lettuce_webdriver | 26b910ceef67d5b81030640ebbab0504bd59d643 | [
"MIT"
] | 4 | 2015-07-13T22:41:22.000Z | 2016-10-03T20:17:22.000Z | docs/conf.py | nattster/lettuce_webdriver | 26b910ceef67d5b81030640ebbab0504bd59d643 | [
"MIT"
] | 12 | 2015-01-24T02:05:39.000Z | 2016-12-30T07:30:28.000Z | # -*- coding: utf-8 -*-
#
# pyramid_xmlrpc documentation build configuration file
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# The contents of this file are pickled, so don't put values in the
# namespace that aren't pickleable (module imports are okay, they're
# removed auto... | 30.473684 | 82 | 0.726645 |
d38c3d595e2bf2b095c24db6c7861973714b1b37 | 1,877 | py | Python | sccloud/tools/net_regressor.py | klarman-cell-observatory/scCloud.py | 5a04a2f22574db044d018656ac4705ec83840226 | [
"BSD-3-Clause"
] | 3 | 2019-07-29T12:30:28.000Z | 2019-09-20T17:15:35.000Z | sccloud/tools/net_regressor.py | klarman-cell-observatory/scCloud.py | 5a04a2f22574db044d018656ac4705ec83840226 | [
"BSD-3-Clause"
] | 3 | 2019-07-24T15:07:31.000Z | 2019-08-29T13:57:36.000Z | sccloud/tools/net_regressor.py | klarman-cell-observatory/scCloud.py | 5a04a2f22574db044d018656ac4705ec83840226 | [
"BSD-3-Clause"
] | 3 | 2019-07-24T22:50:34.000Z | 2020-12-08T01:19:34.000Z | import time
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import check_array
from sklearn.neural_network import MLPRegressor
import logging
logger = logging.getLogger("sccloud")
class MaxStdScaler(BaseEstimator, TransformerMixin):
def __init__(self, copy=True, fa... | 26.43662 | 91 | 0.647842 |
3c60d9e7f3c53fc98194c05c2b97608ea5a20763 | 4,880 | py | Python | test2.py | CodeChefVIT/stress-detector | 57e4c241b7a55e943ea7fabbf9cc50693c0033cc | [
"MIT"
] | 17 | 2020-05-15T04:04:53.000Z | 2022-02-19T19:42:19.000Z | test2.py | CodeChefVIT/stress-detector | 57e4c241b7a55e943ea7fabbf9cc50693c0033cc | [
"MIT"
] | 13 | 2020-04-16T12:19:35.000Z | 2022-03-12T00:51:07.000Z | test2.py | CodeChefVIT/stress-detector | 57e4c241b7a55e943ea7fabbf9cc50693c0033cc | [
"MIT"
] | 11 | 2020-04-15T09:43:07.000Z | 2021-03-11T16:53:23.000Z | import dlib
import cv2
from keras.models import load_model
from keras.preprocessing.image import img_to_array
from scipy.spatial import distance as dist
import imutils
from imutils import face_utils
import matplotlib.pyplot as plt
import numpy as np
class VideoCamera(object):
def __init__(cap):
#real time ... | 39.354839 | 139 | 0.661475 |
39556f33663e6add04256f117dd9db9cccfef9a3 | 3,500 | py | Python | tests/test_qurl_templatetag.py | eltonplima/django-qurl-templatetag | 000bff1e5f5a9a835016ed9cd565aa3c97104c30 | [
"MIT"
] | 31 | 2015-03-17T02:25:49.000Z | 2021-11-04T08:19:08.000Z | tests/test_qurl_templatetag.py | mohandoz/django-qurl-templatetag | 8a785b112437d05cb54846b79012967fee1cb534 | [
"MIT"
] | 167 | 2016-11-15T02:12:27.000Z | 2020-04-21T21:27:48.000Z | tests/test_qurl_templatetag.py | mohandoz/django-qurl-templatetag | 8a785b112437d05cb54846b79012967fee1cb534 | [
"MIT"
] | 12 | 2015-03-12T14:54:58.000Z | 2021-06-01T14:30:52.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_qurl_templatetag
----------------------------------
Tests for `qurl_templatetag` module.
"""
from django.test import TestCase
from django.template import Template, Context, TemplateSyntaxError
from qurl_templatetag.templatetags.qurl import Qurl
class QUrlTemp... | 29.661017 | 73 | 0.532286 |
41cbbe945de67a903f7bf235ffebbcb63b3e0c99 | 833 | py | Python | Chapter08/8A_OpenBankAPI/props/socgen2_k_local.py | uyenphuong18406/Hands-On-Artificial-Intelligence-for-Banking | 3a10a14194368478bb8b78d3d17e9c6a7b7253db | [
"MIT"
] | 115 | 2020-06-18T15:00:58.000Z | 2022-03-02T10:13:19.000Z | Chapter08/8A_OpenBankAPI/props/socgen2_k_local.py | uyenphuong18406/Hands-On-Artificial-Intelligence-for-Banking | 3a10a14194368478bb8b78d3d17e9c6a7b7253db | [
"MIT"
] | 9 | 2016-03-13T06:58:16.000Z | 2021-11-30T10:06:47.000Z | Chapter08/8A_OpenBankAPI/props/socgen2_k_local.py | uyenphuong18406/Hands-On-Artificial-Intelligence-for-Banking | 3a10a14194368478bb8b78d3d17e9c6a7b7253db | [
"MIT"
] | 60 | 2020-07-22T14:53:10.000Z | 2022-03-23T10:17:59.000Z | # This is just for socgen-k test, you make sure Socgen-k server is working well.
# https://socgen-k-api.openbankproject.com/
# API server URL
BASE_URL = "http://127.0.0.1:8080"
API_VERSION = "v2.0.0"
API_VERSION_V210 = "v2.1.0"
# API server will redirect your browser to this URL, should be non-functional
# You will pa... | 27.766667 | 80 | 0.753902 |
911b8570dbe4dd13160970c51c2cd287f8cc9dae | 4,147 | py | Python | myuw/test/views/test_rest_search.py | uw-it-aca/myuw | 3fa1fabeb3c09d81a049f7c1a8c94092d612438a | [
"Apache-2.0"
] | 18 | 2015-02-04T01:09:11.000Z | 2021-11-25T03:10:39.000Z | myuw/test/views/test_rest_search.py | uw-it-aca/myuw | 3fa1fabeb3c09d81a049f7c1a8c94092d612438a | [
"Apache-2.0"
] | 2,323 | 2015-01-15T19:45:10.000Z | 2022-03-21T19:57:06.000Z | myuw/test/views/test_rest_search.py | uw-it-aca/myuw | 3fa1fabeb3c09d81a049f7c1a8c94092d612438a | [
"Apache-2.0"
] | 9 | 2015-01-15T19:29:26.000Z | 2022-02-11T04:51:23.000Z | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
# -*- coding: utf-8 -*-
from django.test.utils import override_settings
from django.urls import reverse
from myuw.test.api import MyuwApiTest
@override_settings(
RESTCLIENTS_ADMIN_AUTH_MODULE='rc_django.tests.can_proxy_restcli... | 39.875 | 77 | 0.613214 |
586ad94d5bd76f1b1d97ebb93dce2b9562afad60 | 5,422 | py | Python | password_generator.py | JBucho/PasswordGenerator | 52bd12a751724189f81ca84385fc27eb986deea7 | [
"MIT"
] | null | null | null | password_generator.py | JBucho/PasswordGenerator | 52bd12a751724189f81ca84385fc27eb986deea7 | [
"MIT"
] | null | null | null | password_generator.py | JBucho/PasswordGenerator | 52bd12a751724189f81ca84385fc27eb986deea7 | [
"MIT"
] | null | null | null | # password generator
# requires at least python 3.6 to use secrets
import string
from secrets import choice
from pyperclip import copy
def password_gen_init():
"""Initialize generating password process.
Ask user about password parameters (length and strength) and
initializes process of generating passwo... | 31.34104 | 104 | 0.598857 |
3fb4f62a33f69d7f19d1b0b9592d1b40e20a81e8 | 3,221 | py | Python | multimodal/mmf/models/interfaces/image_models.py | yongkangzzz/mmfgroup | 098a78c83e1c2973dc895d1dc7fd30d7d3668143 | [
"MIT"
] | null | null | null | multimodal/mmf/models/interfaces/image_models.py | yongkangzzz/mmfgroup | 098a78c83e1c2973dc895d1dc7fd30d7d3668143 | [
"MIT"
] | null | null | null | multimodal/mmf/models/interfaces/image_models.py | yongkangzzz/mmfgroup | 098a78c83e1c2973dc895d1dc7fd30d7d3668143 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# Used for MMF internal models, hateful memes task,
# make predictions on raw images and texts
import os
import tempfile
from pathlib import Path
from typing import Type, Union
import torch
import torchvision.datasets.folder as tv_helpers
from omegaconf import DictC... | 32.535354 | 108 | 0.643899 |
6b1957f293395006b8c2d8d388281c65bf9f2402 | 1,932 | py | Python | src/crawler/crawler.py | BWAI-SWmaestro/BWAI_Crawler | b7402b9753dfcbe5189cca12f9446b09820c61d6 | [
"MIT"
] | null | null | null | src/crawler/crawler.py | BWAI-SWmaestro/BWAI_Crawler | b7402b9753dfcbe5189cca12f9446b09820c61d6 | [
"MIT"
] | 1 | 2021-06-02T03:57:49.000Z | 2021-06-02T03:57:49.000Z | src/crawler/crawler.py | BWAI-SWmaestro/BWAI_Crawler | b7402b9753dfcbe5189cca12f9446b09820c61d6 | [
"MIT"
] | null | null | null | import requests
from pymongo import *
from bs4 import BeautifulSoup
from etc.secret_info import MONGO_HOST, MONGO_ID, MONGO_PW, MONGO_DB_NAME
header = {
"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5)\
AppleWebKit 537.36 (KHTML, like Gecko) Chrome",
"Accept":"... | 28 | 93 | 0.557453 |
5f800e2b9c2ec80d89ccc7a2715c0740f87c4247 | 1,312 | py | Python | code/analyze_nets.py | tchittesh/EAS- | b21acfc77f43db8abbda8f0e4029389b779a05fc | [
"MIT"
] | null | null | null | code/analyze_nets.py | tchittesh/EAS- | b21acfc77f43db8abbda8f0e4029389b779a05fc | [
"MIT"
] | null | null | null | code/analyze_nets.py | tchittesh/EAS- | b21acfc77f43db8abbda8f0e4029389b779a05fc | [
"MIT"
] | null | null | null | import json
from os.path import join, isfile
import tensorflow as tf
from expdir_monitor.expdir_monitor import ExpdirMonitor
from data_providers.utils import get_data_provider_by_name
from models.utils import get_model_by_name
net_pool_path = '../net_pool_base1/Convnet/C10+/Conv_C10+_rl_small'
id2val = json.load(op... | 33.641026 | 98 | 0.762957 |
7b9060c106c1937398c29baa9383555ba4b08535 | 319 | py | Python | redhawk/test/test_common_node_init.py | spranesh/Redhawk | e2be5a6553df8449acecee2239b60c7bca0f22bc | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2016-10-04T11:46:32.000Z | 2017-07-09T15:23:55.000Z | redhawk/test/test_common_node_init.py | spranesh/Redhawk | e2be5a6553df8449acecee2239b60c7bca0f22bc | [
"BSD-2-Clause-FreeBSD"
] | 4 | 2016-03-07T13:16:48.000Z | 2018-03-21T00:25:04.000Z | redhawk/test/test_common_node_init.py | spranesh/Redhawk | e2be5a6553df8449acecee2239b60c7bca0f22bc | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2016-04-06T08:04:34.000Z | 2020-03-17T20:59:47.000Z | #!/usr/bin/env python
""" Test initialising of the Node class in redhawk/common/node.py"""
from __future__ import absolute_import
import redhawk.common.node as node
def TestNodeInit():
""" Test Node cannot be initialised. """
try:
n = node.Node()
except NotImplementedError as e:
return
assert(False)
| 22.785714 | 68 | 0.717868 |
3ca26b62bb4e359a496849fe80f97b733ce61088 | 272 | py | Python | config.py | Lyken17/UCF-Experiment | e33b11bcef5bb118daa0ebd964f2dcaac4bba883 | [
"Apache-2.0"
] | null | null | null | config.py | Lyken17/UCF-Experiment | e33b11bcef5bb118daa0ebd964f2dcaac4bba883 | [
"Apache-2.0"
] | null | null | null | config.py | Lyken17/UCF-Experiment | e33b11bcef5bb118daa0ebd964f2dcaac4bba883 | [
"Apache-2.0"
] | null | null | null | class dotdict(dict):
"""dot.notation access to dictionary attributes"""
__getattr__ = dict.get
__setattr__ = dict.__setitem__
__delattr__ = dict.__delitem__
database_dir = "/Users/lykensyu/Documents/ucf_sports_actions/"
output_dir = "data/collection.json" | 34 | 62 | 0.753676 |
3ee2832709a39c3f8ec0a9237c2848f0f88dafe8 | 223 | py | Python | pythonteste/desafio23.py | dangiotto/Python | 29a9d18d7595a5c21e65dafc39f7fd4c55d8971c | [
"MIT"
] | 1 | 2020-10-17T03:23:59.000Z | 2020-10-17T03:23:59.000Z | pythonteste/desafio23.py | dangiotto/Python | 29a9d18d7595a5c21e65dafc39f7fd4c55d8971c | [
"MIT"
] | null | null | null | pythonteste/desafio23.py | dangiotto/Python | 29a9d18d7595a5c21e65dafc39f7fd4c55d8971c | [
"MIT"
] | null | null | null | n = int(input('Digite um número entro 0 e 9999 :'))
u = n // 1 % 10
d = n //10 % 10
c = n //100 % 10
m = n //1000 % 10
print ('''Analisando o número {}
Unidade : {}
Dezena : {}
Centena : {}
Milhar: {}'''.format(n,u,d,c,m)) | 22.3 | 51 | 0.533632 |
7cbd0b26be19b96d536545fbdab8c37aa311da6d | 839 | py | Python | test/solution_tests/CHK/test_round_5.py | DPNT-Sourcecode/CHK-anrv01 | 84ff4fb65a416c87f0f18a76fec14bf525c81196 | [
"Apache-2.0"
] | null | null | null | test/solution_tests/CHK/test_round_5.py | DPNT-Sourcecode/CHK-anrv01 | 84ff4fb65a416c87f0f18a76fec14bf525c81196 | [
"Apache-2.0"
] | null | null | null | test/solution_tests/CHK/test_round_5.py | DPNT-Sourcecode/CHK-anrv01 | 84ff4fb65a416c87f0f18a76fec14bf525c81196 | [
"Apache-2.0"
] | null | null | null | from lib.solutions.CHK.checkout_solution import checkout
class Test:
def test_group_discount_buy_3(self):
input_skus = "XYY"
total_value = checkout(input_skus)
assert total_value == 45
def test_group_discount_buy_7(self):
input_skus = "XYYXSTS"
total_value = checkout(i... | 27.966667 | 56 | 0.675805 |
f18a298a9499da95b5d2cc69fe9bd95d077e3972 | 141 | py | Python | week06/lecture/examples/src6/1/hello1.py | uldash/CS50x | c3ee0f42ad514b57a13c3ffbb96238b3ca3730e1 | [
"MIT"
] | null | null | null | week06/lecture/examples/src6/1/hello1.py | uldash/CS50x | c3ee0f42ad514b57a13c3ffbb96238b3ca3730e1 | [
"MIT"
] | null | null | null | week06/lecture/examples/src6/1/hello1.py | uldash/CS50x | c3ee0f42ad514b57a13c3ffbb96238b3ca3730e1 | [
"MIT"
] | null | null | null | # get_string and print, with concatenation
from cs50 import get_string
answer = get_string("What's your name? ")
print("hello, " + answer)
| 20.142857 | 42 | 0.737589 |
e371914d51d10ee40a057149eed25367cff99329 | 2,644 | py | Python | scripts/report_usd_vwap.py | tellor-io/telliot-feed-examples | 3f825c90ad372f42c89eee0f5b54250f22ec0728 | [
"MIT"
] | 7 | 2021-11-10T21:14:57.000Z | 2022-03-26T07:27:23.000Z | scripts/report_usd_vwap.py | tellor-io/telliot-feed-examples | 3f825c90ad372f42c89eee0f5b54250f22ec0728 | [
"MIT"
] | 86 | 2021-11-09T13:12:58.000Z | 2022-03-31T17:28:56.000Z | scripts/report_usd_vwap.py | tellor-io/telliot-feed-examples | 3f825c90ad372f42c89eee0f5b54250f22ec0728 | [
"MIT"
] | 2 | 2021-11-27T12:51:22.000Z | 2022-03-12T16:38:00.000Z | """Submits AMPL/USD/VWAP to TellorX on Rinkeby fifteen minutes
past each midnight."""
import asyncio
from datetime import datetime
from typing import Optional
from telliot_core.apps.telliot_config import TelliotConfig
from telliot_core.contract.contract import Contract
from telliot_core.utils.abi import rinkeby_tellor... | 27.831579 | 87 | 0.704614 |
93008a31339f5cf01a5d2001fbc09c7e19912d31 | 3,164 | py | Python | rllib/evaluation/postprocessing.py | carlos-aguayo/ray | fedbdd5dc6a47aa9cba170816f8c0950193b4fd6 | [
"Apache-2.0"
] | 1 | 2021-04-08T12:02:58.000Z | 2021-04-08T12:02:58.000Z | rllib/evaluation/postprocessing.py | carlos-aguayo/ray | fedbdd5dc6a47aa9cba170816f8c0950193b4fd6 | [
"Apache-2.0"
] | null | null | null | rllib/evaluation/postprocessing.py | carlos-aguayo/ray | fedbdd5dc6a47aa9cba170816f8c0950193b4fd6 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import scipy.signal
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.utils.annotations import DeveloperAPI
def discount(x: np.ndarray, gamma: float):
return scipy.signal.lfilter([1], [1, -gamma], x[::-1], axis=0)[::-1]
class Postprocessing:
"""Constant definitions for ... | 37.666667 | 79 | 0.619469 |
a44a4231fa12b52d4dbb4a4c31e144cce9f32f67 | 491 | py | Python | examples/null_support/client.py | amrhgh/django-grpc-framework | 158e1d9001bd426410ca962e2f72b14ee3e2f935 | [
"Apache-2.0"
] | 269 | 2020-05-06T03:22:43.000Z | 2022-03-26T21:05:24.000Z | examples/null_support/client.py | amrhgh/django-grpc-framework | 158e1d9001bd426410ca962e2f72b14ee3e2f935 | [
"Apache-2.0"
] | 19 | 2020-06-03T03:46:39.000Z | 2022-03-30T20:24:55.000Z | examples/null_support/client.py | amrhgh/django-grpc-framework | 158e1d9001bd426410ca962e2f72b14ee3e2f935 | [
"Apache-2.0"
] | 39 | 2020-05-27T07:23:12.000Z | 2022-03-27T13:10:24.000Z | import grpc
import snippets_pb2
import snippets_pb2_grpc
from google.protobuf.struct_pb2 import NullValue
with grpc.insecure_channel('localhost:50051') as channel:
stub = snippets_pb2_grpc.SnippetControllerStub(channel)
request = snippets_pb2.Snippet(id=1, title='snippet title')
# send non-null value
... | 30.6875 | 63 | 0.753564 |
e3dd8e113ee5ea78f2427e00566dbe5262b6c470 | 983 | py | Python | src/dlepard/tcpproxy.py | acooks/dlepard | 9300773a566290897839b845c4ec9f2feba3e93b | [
"MIT"
] | 5 | 2019-04-09T10:10:23.000Z | 2020-11-11T19:23:18.000Z | src/dlepard/tcpproxy.py | acooks/dlepard | 9300773a566290897839b845c4ec9f2feba3e93b | [
"MIT"
] | 6 | 2020-11-11T20:13:40.000Z | 2020-11-24T17:59:05.000Z | src/dlepard/tcpproxy.py | Rohde-Schwarz/dlepard | 9300773a566290897839b845c4ec9f2feba3e93b | [
"MIT"
] | 2 | 2021-09-28T05:44:04.000Z | 2021-10-04T07:41:32.000Z | import asyncio
import logging
log = logging.getLogger("DLEPard")
class TCPProxy(asyncio.Protocol):
def __init__(self, ipv4adr, port, addr, receive_handler, loop=None):
if loop is None:
self.loop = asyncio.get_event_loop()
else:
self.loop = loop
self.running = Fals... | 27.305556 | 86 | 0.63174 |
50eb0a4a5d538ccc08e42e52d6f4bd5eb4a2e81d | 4,729 | py | Python | model/resnet_hgap.py | haifangong/SYSU-HCP-at-ImageCLEF-VQA-Med-2021 | 78b4ea80d21938f2c5ca07df071e776a13fe5fb1 | [
"MIT"
] | 3 | 2021-05-19T15:42:12.000Z | 2022-03-30T08:00:51.000Z | model/resnet_hgap.py | Rodger-Huang/SYSU-HCP-at-ImageCLEF-VQA-Med-2021 | 78b4ea80d21938f2c5ca07df071e776a13fe5fb1 | [
"MIT"
] | null | null | null | model/resnet_hgap.py | Rodger-Huang/SYSU-HCP-at-ImageCLEF-VQA-Med-2021 | 78b4ea80d21938f2c5ca07df071e776a13fe5fb1 | [
"MIT"
] | 1 | 2021-10-16T09:09:58.000Z | 2021-10-16T09:09:58.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models import resnet50
import os, sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
class resnet50HGap(nn.Module):
def __init__(self, pretrained=True, num_classes=330):
super(res... | 33.778571 | 80 | 0.562698 |
851ed24d07befc813915cbc6b6a0163608039250 | 4,570 | py | Python | synology_api/auth.py | VincentRoma/synology-api | 8894d6c2d47fc2330616428224abb35ce91e5421 | [
"MIT"
] | null | null | null | synology_api/auth.py | VincentRoma/synology-api | 8894d6c2d47fc2330616428224abb35ce91e5421 | [
"MIT"
] | null | null | null | synology_api/auth.py | VincentRoma/synology-api | 8894d6c2d47fc2330616428224abb35ce91e5421 | [
"MIT"
] | null | null | null | import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
class Authentication:
def __init__(self, ip_address, port, username, password, secure=False, cert_verify=False):
self._ip_address = ip_address
self._port = port
self._username = username
self._p... | 34.360902 | 110 | 0.569803 |
5341b355d102541c4eb6d52cee0905eb8192fc13 | 3,013 | py | Python | moi/home/migrations/0017_auto_20160508_1144.py | Ecotrust/F2S-MOI | aeb38942d6539c50f252ea3ff6fbff07aabc5088 | [
"Apache-2.0"
] | null | null | null | moi/home/migrations/0017_auto_20160508_1144.py | Ecotrust/F2S-MOI | aeb38942d6539c50f252ea3ff6fbff07aabc5088 | [
"Apache-2.0"
] | 33 | 2015-05-06T00:47:20.000Z | 2016-11-08T21:13:44.000Z | moi/home/migrations/0017_auto_20160508_1144.py | Ecotrust/F2S-MOI | aeb38942d6539c50f252ea3ff6fbff07aabc5088 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-05-08 11:44
from __future__ import unicode_literals
import core.models
from django.db import migrations
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0016_a... | 125.541667 | 2,529 | 0.759044 |
d9109d1830a24c617348f4d700ddfba22ff91114 | 5,697 | py | Python | trade_network_classification/trade_data/img_train.py | gg4u/cnc_2017 | 1a5c52c3207ba131139214d14a2161af2db80a5c | [
"MIT"
] | null | null | null | trade_network_classification/trade_data/img_train.py | gg4u/cnc_2017 | 1a5c52c3207ba131139214d14a2161af2db80a5c | [
"MIT"
] | null | null | null | trade_network_classification/trade_data/img_train.py | gg4u/cnc_2017 | 1a5c52c3207ba131139214d14a2161af2db80a5c | [
"MIT"
] | 1 | 2020-12-17T14:46:01.000Z | 2020-12-17T14:46:01.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 13 19:23:04 2017
@author: xinruyue
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
import os
import pickle
import numpy as np
import random
BATCH_SIZE = 100
#d... | 26.872642 | 95 | 0.677023 |
c6301c3eb68bb404ced5de84aa5ea501b52607a4 | 314 | py | Python | rl_trainer/episode_serializer/episode_serializer.py | Roboy/nips-2018-ai-for-prosthetics | acb69f267a0cc852842828edbbfb47d1840c0a17 | [
"BSD-3-Clause"
] | 3 | 2018-08-31T15:04:53.000Z | 2019-07-13T01:11:10.000Z | rl_trainer/episode_serializer/episode_serializer.py | Roboy/nips-2018-ai-for-prosthetics | acb69f267a0cc852842828edbbfb47d1840c0a17 | [
"BSD-3-Clause"
] | null | null | null | rl_trainer/episode_serializer/episode_serializer.py | Roboy/nips-2018-ai-for-prosthetics | acb69f267a0cc852842828edbbfb47d1840c0a17 | [
"BSD-3-Clause"
] | null | null | null | from typeguard import typechecked
from rl_trainer.commons import Episode
class EpisodeSerializer:
def serialize(self, episode: Episode, output_fname: str) -> None:
raise NotImplementedError
class EpisodeParser:
def parse(self, episode_fname: str) -> Episode:
raise NotImplementedError
| 22.428571 | 69 | 0.751592 |
783dca9356a1a1541d9c0961307f1bce6fbf4700 | 94 | py | Python | dream/game/reward.py | icyblade/dream | 818e77f1c25e51f8cd966f7aa4eb1bcd4207b208 | [
"MIT"
] | null | null | null | dream/game/reward.py | icyblade/dream | 818e77f1c25e51f8cd966f7aa4eb1bcd4207b208 | [
"MIT"
] | null | null | null | dream/game/reward.py | icyblade/dream | 818e77f1c25e51f8cd966f7aa4eb1bcd4207b208 | [
"MIT"
] | null | null | null | class Reward(float):
"""Reward of Texas Hold'em.
It's just a float.
"""
pass
| 13.428571 | 31 | 0.553191 |
2cb6143ba5fa048d7742fb195c25de4b7c86b934 | 2,451 | py | Python | Personal scripts/Physics/oribt.py | powplowdevs/2021-2022-Projects | 1b704e9dbb2768a3acf271b2de87ccb28ab8b933 | [
"MIT"
] | null | null | null | Personal scripts/Physics/oribt.py | powplowdevs/2021-2022-Projects | 1b704e9dbb2768a3acf271b2de87ccb28ab8b933 | [
"MIT"
] | null | null | null | Personal scripts/Physics/oribt.py | powplowdevs/2021-2022-Projects | 1b704e9dbb2768a3acf271b2de87ccb28ab8b933 | [
"MIT"
] | null | null | null | import pygame
import pymunk
import numpy as np
import math
#Start pygame
pygame.init()
#Make display
HEIGHT = 600
WITDH = 600
display = pygame.display.set_mode((WITDH,HEIGHT))
#SET FPS
FPS = 50
clock = pygame.time.Clock()
#our pymunk simulation "world" or space
space = pymunk.Space()
#CONVERT PYGAME CORDS TO PYMUN... | 25.268041 | 66 | 0.616075 |
a6e35b478c90aaf64c8e8acc39655636d11c8dd6 | 1,138 | py | Python | mandelbrot/main.py | marvingabler/chaos | 7f668379318554639467e35acc56d8fb1b83ac9e | [
"MIT"
] | null | null | null | mandelbrot/main.py | marvingabler/chaos | 7f668379318554639467e35acc56d8fb1b83ac9e | [
"MIT"
] | null | null | null | mandelbrot/main.py | marvingabler/chaos | 7f668379318554639467e35acc56d8fb1b83ac9e | [
"MIT"
] | null | null | null | from PIL import Image, ImageDraw
MAX_ITER = 80
def mandelbrot(c):
z = 0
n = 0
while abs(z) <= 2 and n < MAX_ITER:
z = z*z + c
n += 1
return n
def print_mandelbrot():
for a in range(-10, 10, 5):
for b in range(-10, 10, 5):
c = complex(a / 10, b / 10)
... | 23.708333 | 66 | 0.557996 |
2461fb5068422e5a47f163fe9adc0a3adbfe67aa | 14,163 | py | Python | BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py | KrzysztofKoch1/edk2 | 4d621893471c6299de06aeac56f4c6cddc5c9ebe | [
"BSD-2-Clause"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py | KrzysztofKoch1/edk2 | 4d621893471c6299de06aeac56f4c6cddc5c9ebe | [
"BSD-2-Clause"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py | KrzysztofKoch1/edk2 | 4d621893471c6299de06aeac56f4c6cddc5c9ebe | [
"BSD-2-Clause"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | ## @file
# Module that encodes and decodes a EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER with
# a payload.
#
# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accom... | 46.742574 | 180 | 0.613006 |
72e8d17689f321af832e4b542e248f7553c2bab0 | 8,117 | py | Python | microbit_app/microbit_app.py | voltur01/remotebit | e114a316f0a8b62c9cdc2e87326ef11ccdb12598 | [
"MIT"
] | 2 | 2021-04-27T06:11:33.000Z | 2021-06-02T06:04:18.000Z | microbit_app/microbit_app.py | voltur01/remotebit | e114a316f0a8b62c9cdc2e87326ef11ccdb12598 | [
"MIT"
] | null | null | null | microbit_app/microbit_app.py | voltur01/remotebit | e114a316f0a8b62c9cdc2e87326ef11ccdb12598 | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: MIT
# Copyright (c) 2021 Volodymyr Turanskyy
# https://github.com/voltur01/remotebit
from microbit import *
import music
# mbv2_begin
import gc
import radio
import speech
# mbv2_end
def escape(s: str) -> str:
return s.replace('%', '%%').replace(' ', '%20').replace('\r', '%10').replace('... | 38.837321 | 115 | 0.521868 |
e4a52c990adb23aef82aa59eab6f255c18c4e7ea | 3,698 | py | Python | eclipse/layers/layer2_d1.py | imlegend19/MDSN-DevRank | bb1b71f72d2fb97044a62e8e0152dadb88de6411 | [
"MIT"
] | null | null | null | eclipse/layers/layer2_d1.py | imlegend19/MDSN-DevRank | bb1b71f72d2fb97044a62e8e0152dadb88de6411 | [
"MIT"
] | null | null | null | eclipse/layers/layer2_d1.py | imlegend19/MDSN-DevRank | bb1b71f72d2fb97044a62e8e0152dadb88de6411 | [
"MIT"
] | null | null | null | import pickle
from itertools import permutations
import networkx as nx
import openpyxl
from local_settings_eclipse import db
"""
Layer 2 Network:
Edge between developers who commented on 2 bugs which belong to same product.
Dataset Used : eclipse
Table : test_bugs_fixed_closed, test_longdescs_fixed_closed
"""
wit... | 26.042254 | 110 | 0.572742 |
20aa73712d5e3cba61fd0a612dcf20d5db5a8f42 | 3,471 | py | Python | pyBAScloudAPI/tests/setpoint_tests.py | bascloud/BASCloudAPI | 6a06d430720e99204f84f5362b4f22d7d4a72b76 | [
"MIT"
] | 3 | 2021-04-30T07:44:11.000Z | 2021-05-03T06:35:01.000Z | pyBAScloudAPI/tests/setpoint_tests.py | bascloud/BASCloudAPI | 6a06d430720e99204f84f5362b4f22d7d4a72b76 | [
"MIT"
] | 9 | 2021-06-23T04:21:51.000Z | 2022-01-17T04:15:06.000Z | pyBAScloudAPI/tests/setpoint_tests.py | bascloud/BAScloudAPI | 6a06d430720e99204f84f5362b4f22d7d4a72b76 | [
"MIT"
] | null | null | null | import unittest
import time
import datetime
from definitions import *
import pyBAScloudAPI as api
BCAPI = api.EntityContext(BASCLOUD_TEST_URL)
def errorHandler(e, j):
raise e
def authenticate():
currentDateTime = int(time.time())
print("CURRENT DATETIME: ", currentDateTime)
currentDateTimeString... | 36.925532 | 170 | 0.706425 |
06b4083ca1ee22bb6f067cf8606b3a7234c4bcb7 | 1,567 | py | Python | lib/asciidocpresenters/ingredient.py | joshua-stone/OpenRecipeBook-Ebook | bad9c10301ed9e9d37fbffb0709f3954c4ce540a | [
"MIT"
] | null | null | null | lib/asciidocpresenters/ingredient.py | joshua-stone/OpenRecipeBook-Ebook | bad9c10301ed9e9d37fbffb0709f3954c4ce540a | [
"MIT"
] | 1 | 2021-09-07T02:12:36.000Z | 2021-09-07T02:12:36.000Z | lib/asciidocpresenters/ingredient.py | joshua-stone/OpenRecipeBook-Ebook | bad9c10301ed9e9d37fbffb0709f3954c4ce540a | [
"MIT"
] | 1 | 2020-04-28T05:15:55.000Z | 2020-04-28T05:15:55.000Z | from helpers import generate_link, generate_temperature, ref_encode
class IngredientAsciidocPresenter(object):
def __init__(self, equipment):
self._data = equipment.data
@property
def data(self):
return self._data
@property
def config_id(self):
rendered = f"[[{ref_encode(s... | 24.484375 | 84 | 0.52776 |
ad12980ba2341df2e21da58a4426910ceb584154 | 10,579 | py | Python | saas/management/commands/ledger.py | naqibhakimi/djaodjin-saas | c5b9337b21782f62ef1a5e1bbe9c6421a2dcd2df | [
"BSD-2-Clause"
] | null | null | null | saas/management/commands/ledger.py | naqibhakimi/djaodjin-saas | c5b9337b21782f62ef1a5e1bbe9c6421a2dcd2df | [
"BSD-2-Clause"
] | null | null | null | saas/management/commands/ledger.py | naqibhakimi/djaodjin-saas | c5b9337b21782f62ef1a5e1bbe9c6421a2dcd2df | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2021, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | 41.324219 | 88 | 0.519992 |
bcc12a8b8b9734a9eae39c0940bd788b4c4cd817 | 2,854 | py | Python | tests_python/examples/proto_demo_noops.py | Piotr170687/tezos | c7e84dfae2837096a4188e835fb780ad514ec2d3 | [
"MIT"
] | 1 | 2021-11-03T08:21:08.000Z | 2021-11-03T08:21:08.000Z | tests_python/examples/proto_demo_noops.py | Piotr170687/tezos | c7e84dfae2837096a4188e835fb780ad514ec2d3 | [
"MIT"
] | null | null | null | tests_python/examples/proto_demo_noops.py | Piotr170687/tezos | c7e84dfae2837096a4188e835fb780ad514ec2d3 | [
"MIT"
] | 4 | 2021-04-27T15:00:34.000Z | 2021-09-26T21:50:01.000Z | import time
from tools import constants, paths
from launchers.sandbox import Sandbox
PROTO_DEMO = 'ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp'
PROTO_GENESIS = 'ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im'
PARAMS = ['-p', PROTO_GENESIS]
def forge_block_header_data(protocol_data):
"""
Returns... | 33.97619 | 78 | 0.628591 |
e7d23f920f4d312fabc0f66c213f518269907222 | 11,141 | py | Python | tools/convert_bdd_to_coco.py | keeploading/Detectron | bc95825306fcda093b2f652e1ab63ce9b42368ff | [
"Apache-2.0"
] | null | null | null | tools/convert_bdd_to_coco.py | keeploading/Detectron | bc95825306fcda093b2f652e1ab63ce9b42368ff | [
"Apache-2.0"
] | null | null | null | tools/convert_bdd_to_coco.py | keeploading/Detectron | bc95825306fcda093b2f652e1ab63ce9b42368ff | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import h5py
import json
import os
import scipy.misc
import sys
import detectron.utils.segms as segms_util
import detectron.utils.boxes as bboxs_util
from... | 33.863222 | 246 | 0.528498 |
9e0d8831afb1fe70af0ff97be00ba9d28c952481 | 11,785 | py | Python | my_vim_files/python27/Lib/distutils/version.py | satsaeid/dotfiles | 401c3213b31dd941b44e553c6f0441187b01c19a | [
"MIT"
] | null | null | null | my_vim_files/python27/Lib/distutils/version.py | satsaeid/dotfiles | 401c3213b31dd941b44e553c6f0441187b01c19a | [
"MIT"
] | null | null | null | my_vim_files/python27/Lib/distutils/version.py | satsaeid/dotfiles | 401c3213b31dd941b44e553c6f0441187b01c19a | [
"MIT"
] | null | null | null | #
# distutils/version.py
#
# Implements multiple version numbering conventions for the
# Python Module Distribution Utilities.
#
# $Id: version.py 70642 2009-03-28 00:48:48Z georg.brandl $
#
"""Provides classes to represent module version numbers (one class for
each style of version numbering). There are cu... | 39.283333 | 80 | 0.644039 |
2c641ff5cc60634519fbfbbe5065aad9fd04494c | 11,657 | py | Python | Redwood.py | RK900/Tree-Building | 80abbafd6e702772396f1cd1cccab0c7e68f5628 | [
"MIT"
] | 2 | 2016-07-26T04:34:37.000Z | 2017-07-03T02:01:23.000Z | Redwood.py | RK900/Tree-Building | 80abbafd6e702772396f1cd1cccab0c7e68f5628 | [
"MIT"
] | 1 | 2016-11-06T17:34:15.000Z | 2017-02-13T04:40:04.000Z | Redwood.py | RK900/Tree-Building | 80abbafd6e702772396f1cd1cccab0c7e68f5628 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 29 11:16:39 2015
@author: Rohan Koodli
"""
class Tree(object):#Version 2
"""
Tree Node
"""
def __init__(self, name='Aves', children=None):
self.name = name
self.children = []
if children is not None:
... | 32.83662 | 95 | 0.539504 |
09b812d7e92cfa8ac52b85806bbaed9770e462e8 | 46,701 | py | Python | tests/jsonpickle_test.py | mscuthbert/jsonpickle | 59bff149bfe6e99f3694e3fb7c58cdd023d8298e | [
"BSD-3-Clause"
] | null | null | null | tests/jsonpickle_test.py | mscuthbert/jsonpickle | 59bff149bfe6e99f3694e3fb7c58cdd023d8298e | [
"BSD-3-Clause"
] | null | null | null | tests/jsonpickle_test.py | mscuthbert/jsonpickle | 59bff149bfe6e99f3694e3fb7c58cdd023d8298e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008 John Paulett (john -at- paulett.org)
# Copyright (C) 2009, 2011, 2013 David Aguilar
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import doctest
import os
import unitte... | 35.352763 | 80 | 0.625276 |
b79abc445668b5f396bb8d5d57c397ad8da18d51 | 961 | py | Python | webcam/widgets.py | beda-software/django-webcam | c997f38d426ff439f37c32a9d32d939fc8d281a3 | [
"BSD-1-Clause"
] | 1 | 2019-10-10T16:24:01.000Z | 2019-10-10T16:24:01.000Z | webcam/widgets.py | beda-software/django-webcam | c997f38d426ff439f37c32a9d32d939fc8d281a3 | [
"BSD-1-Clause"
] | null | null | null | webcam/widgets.py | beda-software/django-webcam | c997f38d426ff439f37c32a9d32d939fc8d281a3 | [
"BSD-1-Clause"
] | 2 | 2018-02-04T13:01:04.000Z | 2020-03-01T20:10:39.000Z | from django.forms.widgets import Widget
from django.template.loader import render_to_string
class CameraWidget(Widget):
template = 'webcam/webcam.html'
def render(self, name, value, attrs=None):
defaults = {'name': name,
'format': self.attrs['format'],
'width':... | 36.961538 | 68 | 0.569199 |
ae6659cc34637189e2558693d65e43ed814a6f3e | 9,612 | py | Python | app/scheme/utils.py | egormm/geo-optic-net-monitoring | 9fab8595f6c51fd9f4f9f7e6ed29736d5f3ee985 | [
"MIT"
] | null | null | null | app/scheme/utils.py | egormm/geo-optic-net-monitoring | 9fab8595f6c51fd9f4f9f7e6ed29736d5f3ee985 | [
"MIT"
] | null | null | null | app/scheme/utils.py | egormm/geo-optic-net-monitoring | 9fab8595f6c51fd9f4f9f7e6ed29736d5f3ee985 | [
"MIT"
] | null | null | null | import base64
from collections import OrderedDict
from typing import List
import graphviz
def safe_init_nodes(source: List[str], graph: graphviz.dot, name: str) -> List[str]:
for node in source:
graph.node(f"{name}-{node}", label=node)
if not len(source):
graph.node(f"{name}-fake", style='inv... | 43.493213 | 117 | 0.439971 |
9d1c5c037eb71c3ede23aabe8562e20e0e21beb7 | 282 | py | Python | ultimatethumb/__init__.py | stephrdev/django-ultimatethumb | bb14a8d82041453f34439b82cb054a8de7e7bc8b | [
"BSD-3-Clause"
] | 4 | 2015-03-23T15:58:13.000Z | 2020-04-10T00:02:32.000Z | ultimatethumb/__init__.py | moccu/django-ultimatethumb | bb14a8d82041453f34439b82cb054a8de7e7bc8b | [
"BSD-3-Clause"
] | 23 | 2015-05-12T10:35:01.000Z | 2021-09-08T00:09:01.000Z | ultimatethumb/__init__.py | stephrdev/django-ultimatethumb | bb14a8d82041453f34439b82cb054a8de7e7bc8b | [
"BSD-3-Clause"
] | 4 | 2015-06-30T09:06:00.000Z | 2021-09-28T13:52:53.000Z | try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
# This is required for Python versions < 3.8
import importlib_metadata
try:
__version__ = importlib_metadata.version('django-ultimatethumb')
except Exception:
__version__ = 'HEAD'
| 25.636364 | 68 | 0.765957 |
a3676c816b770e7ea776c627fb4567a1ca29dd40 | 2,520 | py | Python | third_party/buildbot_8_4p1/buildbot/steps/package/rpm/rpmspec.py | bopopescu/build | 4e95fd33456e552bfaf7d94f7d04b19273d1c534 | [
"BSD-3-Clause"
] | null | null | null | third_party/buildbot_8_4p1/buildbot/steps/package/rpm/rpmspec.py | bopopescu/build | 4e95fd33456e552bfaf7d94f7d04b19273d1c534 | [
"BSD-3-Clause"
] | null | null | null | third_party/buildbot_8_4p1/buildbot/steps/package/rpm/rpmspec.py | bopopescu/build | 4e95fd33456e552bfaf7d94f7d04b19273d1c534 | [
"BSD-3-Clause"
] | 1 | 2020-07-23T11:05:06.000Z | 2020-07-23T11:05:06.000Z | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | 35 | 79 | 0.661508 |
11ad2d82868cdc71d25a93b3c19893f3c7f0579a | 30,317 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_hubs_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2019-08-23T21:14:00.000Z | 2021-09-07T18:32:34.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_hubs_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_hubs_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.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 may ... | 48.741158 | 191 | 0.660059 |
8e8b5e9af516e8c041ffcc94a346ec36027da104 | 181 | py | Python | Mundo 1/ex027.py | othiagomanhaes/Python | 8cfe6d50e31f6c9ff886e3961051cc4cbfb8569e | [
"MIT"
] | null | null | null | Mundo 1/ex027.py | othiagomanhaes/Python | 8cfe6d50e31f6c9ff886e3961051cc4cbfb8569e | [
"MIT"
] | null | null | null | Mundo 1/ex027.py | othiagomanhaes/Python | 8cfe6d50e31f6c9ff886e3961051cc4cbfb8569e | [
"MIT"
] | null | null | null | nome = str(input('Digite o teu nome completo: ')).strip()
name = nome.split()
print('O primeiro nome é: {}'.format(name[0]))
print('O último nome é: {}'.format(name[len(name)-1]))
| 30.166667 | 57 | 0.646409 |
dd84ffa55f84a34945ec9433580a6d212ff3b9b2 | 1,424 | py | Python | src/django_secret_sharing/migrations/0001_add_secret_model.py | vicktornl/django-secret-sharing | 984dafb7769e11b810387c972a5eb99d5ff100ce | [
"MIT"
] | 3 | 2022-02-24T15:44:56.000Z | 2022-03-01T13:17:33.000Z | src/django_secret_sharing/migrations/0001_add_secret_model.py | vicktornl/django-secret-sharing | 984dafb7769e11b810387c972a5eb99d5ff100ce | [
"MIT"
] | 4 | 2022-02-24T15:47:09.000Z | 2022-03-01T12:09:58.000Z | src/django_secret_sharing/migrations/0001_add_secret_model.py | vicktornl/django-secret-sharing | 984dafb7769e11b810387c972a5eb99d5ff100ce | [
"MIT"
] | null | null | null | # Generated by Django 3.0.12 on 2021-03-15 09:49
import uuid
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Secret",
fields=[
... | 29.061224 | 84 | 0.429775 |
ebd59a92c29c4ba6470cb4121af9687049e14a73 | 74 | py | Python | src/ga/__init__.py | yushikmr/OptModels | b82f1c8f80186c4617f681cca013b3dab03024fd | [
"MIT"
] | null | null | null | src/ga/__init__.py | yushikmr/OptModels | b82f1c8f80186c4617f681cca013b3dab03024fd | [
"MIT"
] | null | null | null | src/ga/__init__.py | yushikmr/OptModels | b82f1c8f80186c4617f681cca013b3dab03024fd | [
"MIT"
] | null | null | null | from .algorithm import *
from .construct import *
from .operators import * | 24.666667 | 24 | 0.77027 |
41e0bed44e76a24a13e888d27f01838624e8c5d3 | 13,367 | py | Python | pyxb/namespace/builtin.py | thorstenb/pyxb | 634e86f61dfb73a2900f32fc3d819e9c25365a49 | [
"Apache-2.0"
] | null | null | null | pyxb/namespace/builtin.py | thorstenb/pyxb | 634e86f61dfb73a2900f32fc3d819e9c25365a49 | [
"Apache-2.0"
] | null | null | null | pyxb/namespace/builtin.py | thorstenb/pyxb | 634e86f61dfb73a2900f32fc3d819e9c25365a49 | [
"Apache-2.0"
] | null | null | null | # Copyright 2009, Peter A. Bigot
#
# 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 ... | 47.400709 | 189 | 0.691629 |
c565df7d6caa3f041b072a2f142fb349f320b60b | 22,000 | py | Python | duckhunt.py | Grimnir9/cloudbot-stuff | 5639e5e461d485db77bb87dfd7cfa6a241342d5b | [
"MIT"
] | null | null | null | duckhunt.py | Grimnir9/cloudbot-stuff | 5639e5e461d485db77bb87dfd7cfa6a241342d5b | [
"MIT"
] | null | null | null | duckhunt.py | Grimnir9/cloudbot-stuff | 5639e5e461d485db77bb87dfd7cfa6a241342d5b | [
"MIT"
] | null | null | null | import random
import re
import operator
from time import time
from collections import defaultdict
from sqlalchemy import Table, Column, String, Integer, PrimaryKeyConstraint, desc
from sqlalchemy.sql import select
from cloudbot import hook
from cloudbot.event import EventType
from cloudbot.util import botvars
duck_ta... | 44.715447 | 397 | 0.598818 |
8dd2651427c62a5c0c62838eca8d436262515db7 | 422 | py | Python | tests/test_misc.py | vug/personalwebapp | 6e36010c2e031fc206d8a0ae3972686cfbe792d4 | [
"MIT"
] | null | null | null | tests/test_misc.py | vug/personalwebapp | 6e36010c2e031fc206d8a0ae3972686cfbe792d4 | [
"MIT"
] | null | null | null | tests/test_misc.py | vug/personalwebapp | 6e36010c2e031fc206d8a0ae3972686cfbe792d4 | [
"MIT"
] | null | null | null | import unittest
from .base import TestBase
class TestMisc(TestBase):
def test_user_model(self):
user = self.get_test_user()
assert user.is_authenticated()
assert user.is_active()
assert not user.is_anonymous()
def test_test_user(self):
user = self.get_test_user()
... | 24.823529 | 55 | 0.677725 |
9441617692b4780185ea9939d8cb40d3199c18e0 | 2,328 | py | Python | code/train/00_samples.py | data-intelligence-for-health-lab/delirium_prediction | a0a25819ef6c98e32563b4e3b986c1a26fc30ed7 | [
"MIT"
] | null | null | null | code/train/00_samples.py | data-intelligence-for-health-lab/delirium_prediction | a0a25819ef6c98e32563b4e3b986c1a26fc30ed7 | [
"MIT"
] | null | null | null | code/train/00_samples.py | data-intelligence-for-health-lab/delirium_prediction | a0a25819ef6c98e32563b4e3b986c1a26fc30ed7 | [
"MIT"
] | null | null | null |
# --- loading libraries -------------------------------------------------------
import os
import pandas as pd
# ------------------------------------------------------ loading libraries ----
# --- main routine ------------------------------------------------------------
# Loading train and validation datasets
train = ... | 68.470588 | 151 | 0.703179 |
ebf938aa541c986d0089382f0cbbdd429f0a1c50 | 2,691 | py | Python | citadel/indico_citadel/cli.py | tomasr8/indico-plugins | b85e4ad826fa362aa32eb236e73c9ab2f7c7f465 | [
"MIT"
] | null | null | null | citadel/indico_citadel/cli.py | tomasr8/indico-plugins | b85e4ad826fa362aa32eb236e73c9ab2f7c7f465 | [
"MIT"
] | null | null | null | citadel/indico_citadel/cli.py | tomasr8/indico-plugins | b85e4ad826fa362aa32eb236e73c9ab2f7c7f465 | [
"MIT"
] | null | null | null | # This file is part of the Indico plugins.
# Copyright (C) 2002 - 2022 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
import os
import sys
import time
import traceback
import click
from indico.... | 35.88 | 109 | 0.672612 |
50d45deb89578fe325acc61eb61f6d62c4ea8667 | 13,877 | py | Python | doc/ext/traffic-server.py | walkerfly/apache-trafficserver | c7cfa081ccc5c0b875a8ee665cde3399c48abd5c | [
"Apache-2.0"
] | null | null | null | doc/ext/traffic-server.py | walkerfly/apache-trafficserver | c7cfa081ccc5c0b875a8ee665cde3399c48abd5c | [
"Apache-2.0"
] | null | null | null | doc/ext/traffic-server.py | walkerfly/apache-trafficserver | c7cfa081ccc5c0b875a8ee665cde3399c48abd5c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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
#... | 36.71164 | 163 | 0.629747 |
b18d7ebac40838f08ad33a67ef2937277f23074f | 5,908 | py | Python | pyspike/spikes.py | ElsevierSoftwareX/SOFTX-D-16-00032 | 50b3d0bd1ceea236d8b4e95578cebf7c78a5035e | [
"BSD-2-Clause"
] | 5 | 2018-09-10T06:14:31.000Z | 2022-01-26T20:19:42.000Z | pyspike/spikes.py | ElsevierSoftwareX/SOFTX-D-16-00032 | 50b3d0bd1ceea236d8b4e95578cebf7c78a5035e | [
"BSD-2-Clause"
] | null | null | null | pyspike/spikes.py | ElsevierSoftwareX/SOFTX-D-16-00032 | 50b3d0bd1ceea236d8b4e95578cebf7c78a5035e | [
"BSD-2-Clause"
] | 5 | 2019-11-08T00:52:34.000Z | 2021-05-20T20:34:10.000Z | # Module containing several function to load and transform spike trains
# Copyright 2014, Mario Mulansky <mario.mulansky@gmx.net>
# Distributed under the BSD License
import numpy as np
from pyspike import SpikeTrain
############################################################
# spike_train_from_string
##############... | 46.888889 | 79 | 0.580399 |
2aa88002f3ed01517b2dcd3f0936fd9078689009 | 1,436 | py | Python | figthesis/figchangebs.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | figthesis/figchangebs.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | figthesis/figchangebs.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | import os
import numpy as np
from matplotlib import pyplot as plt
import figlatex
import fingersnr
cacheprefix = 'figthesis/figchangebs'
baselines = [8000, 1000, 200]
cache_snrseries = 'figthesis/figsnrplot.npz'
###########################
cache = lambda bs: f'{cacheprefix}-{bs}.npz'
if not all(os.path.exists(cac... | 27.09434 | 85 | 0.662953 |
d8a0f3ec1d33045ed352ac7af3ced96f00174913 | 15,433 | py | Python | flexmatch.py | houwenxin/TorchSSL | 4086504b4c8a4cb887bf480faa97ad607fef3ed1 | [
"MIT"
] | null | null | null | flexmatch.py | houwenxin/TorchSSL | 4086504b4c8a4cb887bf480faa97ad607fef3ed1 | [
"MIT"
] | null | null | null | flexmatch.py | houwenxin/TorchSSL | 4086504b4c8a4cb887bf480faa97ad607fef3ed1 | [
"MIT"
] | null | null | null | # import needed library
import os
import logging
import random
import warnings
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.multiprocessing as mp
from utils import net_builder, get_logger, count_parame... | 43.351124 | 127 | 0.603642 |
b2579c726883ee7229087849583b5b80bff7f4f4 | 143 | py | Python | tests/settings/images_store_format_all_with_thumbs.py | teolemon/django-dynamic-scraper | 2a46df8828fa8dcf4f74315abe99cc37b214b2e8 | [
"BSD-3-Clause"
] | null | null | null | tests/settings/images_store_format_all_with_thumbs.py | teolemon/django-dynamic-scraper | 2a46df8828fa8dcf4f74315abe99cc37b214b2e8 | [
"BSD-3-Clause"
] | null | null | null | tests/settings/images_store_format_all_with_thumbs.py | teolemon/django-dynamic-scraper | 2a46df8828fa8dcf4f74315abe99cc37b214b2e8 | [
"BSD-3-Clause"
] | null | null | null | from settings.base_settings import *
IMAGES_THUMBS = {
'medium': (50, 50),
'small': (25, 25),
}
DSCRAPER_IMAGES_STORE_FORMAT = 'ALL' | 15.888889 | 36 | 0.657343 |
18874981f9a1fa9bc9a21ad0ed50d36aa9bf2273 | 1,114 | py | Python | TIL/bs_move.py | FLY-CODE77/opencv | 5644e6c1ef43d81efb54ccde6c06f1adf000fb96 | [
"MIT"
] | 1 | 2020-10-23T14:29:24.000Z | 2020-10-23T14:29:24.000Z | TIL/bs_move.py | FLY-CODE77/opencv | 5644e6c1ef43d81efb54ccde6c06f1adf000fb96 | [
"MIT"
] | null | null | null | TIL/bs_move.py | FLY-CODE77/opencv | 5644e6c1ef43d81efb54ccde6c06f1adf000fb96 | [
"MIT"
] | null | null | null | import sys
import numpy as np
import cv2
cap = cv2.VideoCapture('PETS2000.avi')
if not cap.isOpened():
print('video not opened!')
sys.exit()
ret, back = cap.read()
if not ret :
print('back ground img error')
sys.exit()
back = cv2.cvtColor(back, cv2.COLOR_BGR2GRAY)
back = cv2.GaussianBlur(back, (0,... | 19.892857 | 61 | 0.609515 |
3e1bac8f67cfa6f88c8920b067b013028a6ea89b | 1,566 | py | Python | polling_stations/apps/councils/migrations/0001_initial.py | mtravis/UK-Polling-Stations | 26e0331dc29253dc436a0462ffaa01e974c5dc52 | [
"BSD-3-Clause"
] | 29 | 2015-03-10T08:41:34.000Z | 2022-01-12T08:51:38.000Z | polling_stations/apps/councils/migrations/0001_initial.py | mtravis/UK-Polling-Stations | 26e0331dc29253dc436a0462ffaa01e974c5dc52 | [
"BSD-3-Clause"
] | 4,112 | 2015-04-01T21:27:38.000Z | 2022-03-31T19:22:11.000Z | polling_stations/apps/councils/migrations/0001_initial.py | mtravis/UK-Polling-Stations | 26e0331dc29253dc436a0462ffaa01e974c5dc52 | [
"BSD-3-Clause"
] | 31 | 2015-03-18T14:52:50.000Z | 2022-02-24T10:31:07.000Z | # -*- coding: utf-8 -*-
from django.db import models, migrations
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
name="Council",
fields=[
(
"counci... | 34.8 | 88 | 0.488506 |
e536832762d5fa67c8474926fbe2fa84db8a23d0 | 6,037 | py | Python | thenewboston_node/business_logic/tests/test_models/test_signed_change_request/test_node_declaration_signed_change_request.py | andbortnik/thenewboston-node | bd63c7def5f224286dba70f9560252a7da8ea712 | [
"MIT"
] | null | null | null | thenewboston_node/business_logic/tests/test_models/test_signed_change_request/test_node_declaration_signed_change_request.py | andbortnik/thenewboston-node | bd63c7def5f224286dba70f9560252a7da8ea712 | [
"MIT"
] | null | null | null | thenewboston_node/business_logic/tests/test_models/test_signed_change_request/test_node_declaration_signed_change_request.py | andbortnik/thenewboston-node | bd63c7def5f224286dba70f9560252a7da8ea712 | [
"MIT"
] | null | null | null | import pytest
from thenewboston_node.business_logic.exceptions import ValidationError
from thenewboston_node.business_logic.models import NodeDeclarationSignedChangeRequest
from thenewboston_node.core.utils.types import hexstr
def test_can_create_node_declaration_signed_change_request(user_account_key_pair):
req... | 39.457516 | 119 | 0.764618 |
505ea1cd9832819f8d3dd590e458cbceaf3925a4 | 10,235 | py | Python | Pilot1/Uno_UQ/uno_inferUQ_keras2.py | j-woz/Benchmarks | d518162fdafb7cfa26071b6a30a3b456dad024f6 | [
"MIT"
] | 2 | 2021-02-06T06:47:19.000Z | 2021-02-24T13:45:02.000Z | Pilot1/Uno_UQ/uno_inferUQ_keras2.py | j-woz/Benchmarks | d518162fdafb7cfa26071b6a30a3b456dad024f6 | [
"MIT"
] | null | null | null | Pilot1/Uno_UQ/uno_inferUQ_keras2.py | j-woz/Benchmarks | d518162fdafb7cfa26071b6a30a3b456dad024f6 | [
"MIT"
] | 1 | 2019-08-14T14:29:42.000Z | 2019-08-14T14:29:42.000Z | #! /usr/bin/env python
from __future__ import division, print_function
import argparse
import logging
import os
import numpy as np
import pandas as pd
from itertools import cycle
from keras import backend as K
import keras
from keras.utils import get_custom_objects
import data_utils_.uno as uno
import candle
im... | 33.890728 | 118 | 0.670933 |
542a7d7ee2abd164d771374b53223f56c0008c96 | 24,019 | py | Python | Assets/Python/Plugins/Resources/Lib/calendar.py | OpenColonyShip/OpenColonyShip-Core | 3dd8fd5c86ca89b1bf76d4dc4e0372f2c924d2ae | [
"MIT"
] | null | null | null | Assets/Python/Plugins/Resources/Lib/calendar.py | OpenColonyShip/OpenColonyShip-Core | 3dd8fd5c86ca89b1bf76d4dc4e0372f2c924d2ae | [
"MIT"
] | null | null | null | Assets/Python/Plugins/Resources/Lib/calendar.py | OpenColonyShip/OpenColonyShip-Core | 3dd8fd5c86ca89b1bf76d4dc4e0372f2c924d2ae | [
"MIT"
] | null | null | null | """Calendar printing functions
Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday)."""
import sys
i... | 33.640056 | 125 | 0.559515 |
87e0587273f07a45d209c3760bad03c64753b18c | 2,000 | py | Python | scripts/practiceScripts/matrixplot.py | czbiohub/scRFE | 716b0f59b4b949e6842af3080276c7ea835618a9 | [
"MIT"
] | 11 | 2020-03-24T17:10:50.000Z | 2021-09-08T22:56:16.000Z | scripts/practiceScripts/matrixplot.py | czbiohub/scRFE | 716b0f59b4b949e6842af3080276c7ea835618a9 | [
"MIT"
] | null | null | null | scripts/practiceScripts/matrixplot.py | czbiohub/scRFE | 716b0f59b4b949e6842af3080276c7ea835618a9 | [
"MIT"
] | 1 | 2020-03-26T23:42:00.000Z | 2020-03-26T23:42:00.000Z | #!/usr/bin/env python
# coding: utf-8
# # Visualtization: Matrix Plot
# In[1]:
# this is for comparing results from 3m and 24m data
# In[2]:
# imports
import numpy as np
import pandas as pd
import scanpy as sc
from anndata import read_h5ad
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_s... | 19.417476 | 109 | 0.751 |
f4ccbbbbbc60c3a9dd71dad45c1a9677a4293296 | 70 | py | Python | countinggis/generators/every_other.py | Kodsport/nova-challenge-2018 | e9d5e3d63a79c2191ca55f48438344d8b7719d90 | [
"Apache-2.0"
] | 1 | 2019-09-13T13:38:16.000Z | 2019-09-13T13:38:16.000Z | countinggis/generators/every_other.py | Kodsport/nova-challenge-2018 | e9d5e3d63a79c2191ca55f48438344d8b7719d90 | [
"Apache-2.0"
] | null | null | null | countinggis/generators/every_other.py | Kodsport/nova-challenge-2018 | e9d5e3d63a79c2191ca55f48438344d8b7719d90 | [
"Apache-2.0"
] | null | null | null | print(1000000, 500000)
s = [2*i + 2 for i in range(500000)]
print(*s)
| 17.5 | 36 | 0.642857 |
049b4c02dc2b5ab0d90e1f1138eed62962509344 | 340 | py | Python | sympy/series/series.py | FabianBall/sympy | 9d849ddfc45427fe7f6733ce4d18fa397d0f43a9 | [
"BSD-3-Clause"
] | 15 | 2020-06-29T08:33:39.000Z | 2022-02-12T00:28:51.000Z | sympy/series/series.py | FabianBall/sympy | 9d849ddfc45427fe7f6733ce4d18fa397d0f43a9 | [
"BSD-3-Clause"
] | 13 | 2020-03-24T17:53:51.000Z | 2022-02-10T20:01:14.000Z | sympy/series/series.py | FabianBall/sympy | 9d849ddfc45427fe7f6733ce4d18fa397d0f43a9 | [
"BSD-3-Clause"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | from __future__ import print_function, division
from sympy.core.sympify import sympify
def series(expr, x=None, x0=0, n=6, dir="+"):
"""Series expansion of expr around point `x = x0`.
See the docstring of Expr.series() for complete details of this wrapper.
"""
expr = sympify(expr)
return expr.se... | 26.153846 | 76 | 0.682353 |
006029c8a30dde2c007cc732603613bfbb1de875 | 854 | py | Python | project_euler/problem_09/sol3.py | joeyzhou85/python | 9c0cbe33076a570a3c02825b7c6d9866a760e777 | [
"MIT"
] | 2 | 2019-07-30T18:26:58.000Z | 2021-06-06T14:08:59.000Z | project_euler/problem_09/sol3.py | joeyzhou85/python | 9c0cbe33076a570a3c02825b7c6d9866a760e777 | [
"MIT"
] | null | null | null | project_euler/problem_09/sol3.py | joeyzhou85/python | 9c0cbe33076a570a3c02825b7c6d9866a760e777 | [
"MIT"
] | 3 | 2019-04-29T02:36:37.000Z | 2019-10-05T12:17:59.000Z | """
Problem Statement:
A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
a^2 + b^2 = c^2
For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2.
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.
"""
from __future__ import print_function
def solutio... | 21.897436 | 79 | 0.567916 |
1b1bb76921f421f3fed5de32f31ef83ae7479f7c | 1,230 | py | Python | tie/processors.py | raphigaziano/TIE | ccf3ad938058557058fa4a2111ace539c62e1c43 | [
"WTFPL"
] | null | null | null | tie/processors.py | raphigaziano/TIE | ccf3ad938058557058fa4a2111ace539c62e1c43 | [
"WTFPL"
] | null | null | null | tie/processors.py | raphigaziano/TIE | ccf3ad938058557058fa4a2111ace539c62e1c43 | [
"WTFPL"
] | 2 | 2016-02-18T01:51:00.000Z | 2016-03-04T08:13:55.000Z | #!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Default Tag processing callbacks.
Callbacks should be callable objects (simple functions or objects with a
__call__ method) and must accept the following arguments:
match: A MatchObject instance, returned by regular expression string
matching.
... | 30 | 77 | 0.657724 |
fe6bff4fc20404c0e96ee83537fca7360624baf8 | 1,994 | py | Python | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/CancelTaskRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2021-03-08T02:59:17.000Z | 2021-03-08T02:59:17.000Z | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/CancelTaskRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/CancelTaskRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | # 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... | 35.607143 | 74 | 0.769308 |
63944715e9ec6bb65b97eda301d88741c32f563e | 26,153 | py | Python | hummingbot/strategy/liquidity_mining/liquidity_mining.py | phbrgnomo/hummingbot | 72382954a06a277248f44b321344186aef1c367c | [
"Apache-2.0"
] | 1 | 2021-07-01T20:56:32.000Z | 2021-07-01T20:56:32.000Z | hummingbot/strategy/liquidity_mining/liquidity_mining.py | phbrgnomo/hummingbot | 72382954a06a277248f44b321344186aef1c367c | [
"Apache-2.0"
] | null | null | null | hummingbot/strategy/liquidity_mining/liquidity_mining.py | phbrgnomo/hummingbot | 72382954a06a277248f44b321344186aef1c367c | [
"Apache-2.0"
] | 1 | 2021-10-12T15:40:43.000Z | 2021-10-12T15:40:43.000Z | from decimal import Decimal
import logging
import asyncio
from typing import Dict, List, Set
import pandas as pd
import numpy as np
from statistics import mean
from hummingbot.core.clock import Clock
from hummingbot.logger import HummingbotLogger
from hummingbot.strategy.strategy_py_base import StrategyPyBase
from humm... | 46.288496 | 119 | 0.61622 |
4e476557f705d88fc4424f85b7e9674bad23cea7 | 3,424 | py | Python | chowtest/__init__.py | jkclem/chowtest | f73f185dadcbb14e567ce65f942e6c8bdb432d4d | [
"MIT"
] | 8 | 2019-09-25T10:32:27.000Z | 2022-03-29T17:08:07.000Z | chowtest/__init__.py | jkclem/chowtest | f73f185dadcbb14e567ce65f942e6c8bdb432d4d | [
"MIT"
] | 2 | 2021-03-03T13:19:28.000Z | 2022-03-21T18:04:27.000Z | chowtest/__init__.py | jkclem/chowtest | f73f185dadcbb14e567ce65f942e6c8bdb432d4d | [
"MIT"
] | 5 | 2020-02-19T18:08:09.000Z | 2022-03-07T14:52:27.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 20 12:02:06 2019
@author: jkcle
"""
# defines a function to get performance information about a linear regression using sklearn
def linear_residuals(X, y):
# imports pandas as pd
import pandas as pd
# imports numpy as np
import numpy as np
# ... | 35.298969 | 92 | 0.688084 |
a550a89114635dd13627a919d82726511c31d624 | 23,535 | py | Python | yapf/yapflib/style.py | hugo-ricateau/yapf | 033bc1421a940b1fde8b91311f477928935a3f05 | [
"Apache-2.0"
] | null | null | null | yapf/yapflib/style.py | hugo-ricateau/yapf | 033bc1421a940b1fde8b91311f477928935a3f05 | [
"Apache-2.0"
] | null | null | null | yapf/yapflib/style.py | hugo-ricateau/yapf | 033bc1421a940b1fde8b91311f477928935a3f05 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.959677 | 82 | 0.712896 |
386f6bb5cf7e2912e02d05346145e523c2fdc590 | 7,756 | py | Python | bbarchivist/xmlutils.py | thurask/bbarchivist | 637beec4d5251871dc96a801ec2058371bb1c092 | [
"WTFPL"
] | 7 | 2015-12-12T14:28:57.000Z | 2022-01-11T23:28:07.000Z | bbarchivist/xmlutils.py | thurask/bbarchivist | 637beec4d5251871dc96a801ec2058371bb1c092 | [
"WTFPL"
] | null | null | null | bbarchivist/xmlutils.py | thurask/bbarchivist | 637beec4d5251871dc96a801ec2058371bb1c092 | [
"WTFPL"
] | 2 | 2017-05-07T18:55:08.000Z | 2019-04-10T05:12:30.000Z | #!/usr/bin/env python3
"""This module is used for XML handling."""
import re # regexes
try:
from defusedxml import ElementTree # safer XML parsing
except (ImportError, AttributeError):
from xml.etree import ElementTree # XML parsing
__author__ = "Thurask"
__license__ = "WTFPL v2"
__copyright__ = "2018-201... | 37.468599 | 946 | 0.687597 |
e224e2bb040df11488723a94a4fd7e9e94342479 | 3,190 | py | Python | tests/test_api_empty_sandbox.py | QualiSystemsLab/Sandbox-API-Python | 1e5027a4a4fe87a763379d21d1ce48393a6ad188 | [
"MIT"
] | 3 | 2018-01-23T23:20:58.000Z | 2022-01-10T21:54:16.000Z | tests/test_api_empty_sandbox.py | QualiSystemsLab/Sandbox-API-Python | 1e5027a4a4fe87a763379d21d1ce48393a6ad188 | [
"MIT"
] | null | null | null | tests/test_api_empty_sandbox.py | QualiSystemsLab/Sandbox-API-Python | 1e5027a4a4fe87a763379d21d1ce48393a6ad188 | [
"MIT"
] | 3 | 2017-10-10T16:10:49.000Z | 2018-03-16T19:00:15.000Z | """
Test the api methods that require an empty, PUBLIC blueprint
"""
import common
import pytest
from cloudshell.sandbox_rest.sandbox_api import SandboxRestApiSession
@pytest.fixture(scope="module")
def blueprint_id(admin_session: SandboxRestApiSession, empty_blueprint):
res_id = common.get_blueprint_id_from_na... | 36.666667 | 114 | 0.772727 |
fe2a9d2cac819b2d84d92a247f99bff73f444b12 | 245 | py | Python | Radius.py | subho781/MCA-Python-Assignment | ebeb443ed72091659eacd30c0221ffb69b7df547 | [
"MIT"
] | null | null | null | Radius.py | subho781/MCA-Python-Assignment | ebeb443ed72091659eacd30c0221ffb69b7df547 | [
"MIT"
] | null | null | null | Radius.py | subho781/MCA-Python-Assignment | ebeb443ed72091659eacd30c0221ffb69b7df547 | [
"MIT"
] | null | null | null | #program to calculate the area of the circle take radius as user input
pi = 3.14 #initializing the value of pi
radius = float(input("Enter the radius: "))
area = pi * (radius**2) #calculating the area
print("The area of the circle is", area ) | 49 | 71 | 0.718367 |
67f9e64cbe0263be066f0a9b392e5304e4812d68 | 148 | py | Python | libcloud_rest/api/versions.py | islamgulov/libcloud.rest | f76e3c013cf10d64e0b7e9090db4224405a1aeb8 | [
"Apache-2.0"
] | 5 | 2015-03-20T16:43:26.000Z | 2017-11-22T04:19:50.000Z | libcloud_rest/api/versions.py | coyo8/libcloud.rest | 07e662eceeb18e6659dffb0d1073adbb0b960efe | [
"Apache-2.0"
] | 2 | 2018-02-16T03:18:29.000Z | 2020-05-13T12:37:28.000Z | libcloud_rest/api/versions.py | coyo8/libcloud.rest | 07e662eceeb18e6659dffb0d1073adbb0b960efe | [
"Apache-2.0"
] | 5 | 2015-11-04T08:24:15.000Z | 2020-04-17T21:54:55.000Z | # -*- coding:utf-8 -*-
import libcloud
__all__ = [
'versions',
]
versions = {
libcloud.__version__: '0.1', # FIXME: it's just for test
}
| 13.454545 | 61 | 0.587838 |
18ae666d98fcdd105e07909b851d2f14807eede0 | 237 | py | Python | api/serializers/user_serializer.py | eHattori/django-model-architecture | 2f8a66f47c7000cda09f07d07709a5f235322b55 | [
"MIT"
] | 1 | 2017-06-07T20:23:48.000Z | 2017-06-07T20:23:48.000Z | api/serializers/user_serializer.py | eHattori/django-model-architecture | 2f8a66f47c7000cda09f07d07709a5f235322b55 | [
"MIT"
] | null | null | null | api/serializers/user_serializer.py | eHattori/django-model-architecture | 2f8a66f47c7000cda09f07d07709a5f235322b55 | [
"MIT"
] | null | null | null | from api.models.user import User
from rest_framework import serializers
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id', 'first_name', 'last_name', 'other_name') | 29.625 | 64 | 0.729958 |
773b133e5c8c955d77d9c3adfef9fd85a6fad001 | 61,115 | py | Python | ludwig/data/preprocessing.py | Yard1/ludwig | 510455f8d4fcd6b66e76d2c906d2c600fe724093 | [
"Apache-2.0"
] | null | null | null | ludwig/data/preprocessing.py | Yard1/ludwig | 510455f8d4fcd6b66e76d2c906d2c600fe724093 | [
"Apache-2.0"
] | null | null | null | ludwig/data/preprocessing.py | Yard1/ludwig | 510455f8d4fcd6b66e76d2c906d2c600fe724093 | [
"Apache-2.0"
] | 1 | 2019-09-05T09:19:39.000Z | 2019-09-05T09:19:39.000Z | #! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | 33.106717 | 109 | 0.616264 |
b2f4aad9bb9dad1954e58fdb5773e0cdacd496d5 | 16,819 | py | Python | ms_deisotope/peak_dependency_network/intervals.py | mstim/ms_deisotope | 29f4f466e92e66b65a2d21eca714aa627caa21db | [
"Apache-2.0"
] | 18 | 2017-09-01T12:26:12.000Z | 2022-02-23T02:31:29.000Z | ms_deisotope/peak_dependency_network/intervals.py | mstim/ms_deisotope | 29f4f466e92e66b65a2d21eca714aa627caa21db | [
"Apache-2.0"
] | 19 | 2017-03-12T20:40:36.000Z | 2022-03-31T22:50:47.000Z | ms_deisotope/peak_dependency_network/intervals.py | mstim/ms_deisotope | 29f4f466e92e66b65a2d21eca714aa627caa21db | [
"Apache-2.0"
] | 14 | 2016-05-06T02:25:30.000Z | 2022-03-31T14:40:06.000Z | from collections import deque
class SpanningMixin(object):
"""Provides methods for checking whether an entity
which has a defined start and end point over a single
dimension contains or overlaps with another entity in
that same dimension.
"""
def __init__(self, start, end):
self.start... | 32.220307 | 113 | 0.542006 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.