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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bcaf587226e364670ce5e0f8600abbff8ae69593 | 4,951 | py | Python | client/basic/settings.py | slash26/DevOps | 0fe118e234157a58da009fe9b14a527bc5dbe7f7 | [
"MIT"
] | null | null | null | client/basic/settings.py | slash26/DevOps | 0fe118e234157a58da009fe9b14a527bc5dbe7f7 | [
"MIT"
] | null | null | null | client/basic/settings.py | slash26/DevOps | 0fe118e234157a58da009fe9b14a527bc5dbe7f7 | [
"MIT"
] | null | null | null | """
Django settings for basic project.
Generated by 'django-admin startproject' using Django 1.11.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
i... | 26.195767 | 91 | 0.686326 |
4c0690e855abc6b81b5e5f77a0262b61c37de51a | 235 | py | Python | Python/09. Errors and Exceptions/002. Incorrect Regex.py | AnTeater515/HackerRank-Coding_Solutions | c5c1337ed6d70c6d7a1850b2a99aab10c285c290 | [
"MIT"
] | 1 | 2020-10-18T22:06:12.000Z | 2020-10-18T22:06:12.000Z | Python/09. Errors and Exceptions/002. Incorrect Regex.py | AnTeater515/HackerRank-Coding-Solutions_Python3_C-_Oracle-SQL | c5c1337ed6d70c6d7a1850b2a99aab10c285c290 | [
"MIT"
] | null | null | null | Python/09. Errors and Exceptions/002. Incorrect Regex.py | AnTeater515/HackerRank-Coding-Solutions_Python3_C-_Oracle-SQL | c5c1337ed6d70c6d7a1850b2a99aab10c285c290 | [
"MIT"
] | null | null | null | # Problem: https://www.hackerrank.com/challenges/incorrect-regex/problem
# Score: 20
import re
for _ in range(int(input())):
try:
print(bool(re.compile(input())))
except re.error:
print('False')
| 18.076923 | 73 | 0.604255 |
994878c9cc53eef5954248fc3f3067fc9263021d | 107 | py | Python | kivymd/uix/pickers/datepicker/__init__.py | vhn0912/KivyMD | 2f6f2b78a3c1f9ff15d18ede24fd034a8db5371d | [
"MIT"
] | 668 | 2018-08-31T12:38:18.000Z | 2020-07-31T21:29:10.000Z | kivymd/uix/pickers/datepicker/__init__.py | vhn0912/KivyMD | 2f6f2b78a3c1f9ff15d18ede24fd034a8db5371d | [
"MIT"
] | 377 | 2018-10-23T15:46:29.000Z | 2020-08-01T14:03:36.000Z | kivymd/uix/pickers/datepicker/__init__.py | vhn0912/KivyMD | 2f6f2b78a3c1f9ff15d18ede24fd034a8db5371d | [
"MIT"
] | 275 | 2018-09-04T19:27:51.000Z | 2020-07-31T01:14:48.000Z | from .datepicker import ( # NOQA F401
BaseDialogPicker,
DatePickerInputField,
MDDatePicker,
)
| 17.833333 | 38 | 0.71028 |
8e16064e69928e9c5218ceefee5c62e96e586c6b | 1,550 | py | Python | Calculator.py | Mostafa-At-GitHub/Basic-Programs-Python | afd2edcb7bd6ea176c38b4c0c0e3ae9813e98c39 | [
"MIT"
] | 1 | 2021-09-21T05:50:17.000Z | 2021-09-21T05:50:17.000Z | Calculator.py | rahulsust/Basic-Programs-Python | afd2edcb7bd6ea176c38b4c0c0e3ae9813e98c39 | [
"MIT"
] | null | null | null | Calculator.py | rahulsust/Basic-Programs-Python | afd2edcb7bd6ea176c38b4c0c0e3ae9813e98c39 | [
"MIT"
] | 1 | 2022-01-26T15:00:11.000Z | 2022-01-26T15:00:11.000Z | def calc(choice, first_num, second_num):
# Python does not have switch case
# There are other ways to implement this, dictionary mapping for example, but I started off with this
if(choice=='addition' or choice=='add'):
return first_num+second_num
elif (choice=='subtraction' or choice=='subtract'):
... | 39.74359 | 102 | 0.663871 |
3c62941a7722b0bb93a4d7692d82d6bef517d3d0 | 2,870 | py | Python | donghuangzhong/src/lib/scapy/layers/pflog.py | onsis/hack-tools | 1a1dfebfab8c83379f17563900d3aeb9f240c658 | [
"Apache-2.0"
] | 171 | 2016-09-22T23:35:35.000Z | 2021-12-21T21:56:17.000Z | extrabacon-2.0/scapy/layers/pflog.py | FDlucifer/CVE-2016-6366 | 0ba7426a9bf2a01c807608b7e1b63f87fe2699a5 | [
"MIT"
] | 3 | 2016-09-27T01:05:07.000Z | 2016-11-02T03:12:21.000Z | extrabacon-2.0/scapy/layers/pflog.py | FDlucifer/CVE-2016-6366 | 0ba7426a9bf2a01c807608b7e1b63f87fe2699a5 | [
"MIT"
] | 79 | 2016-09-22T23:16:29.000Z | 2021-05-07T16:17:13.000Z | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
from scapy.packet import *
from scapy.fields import *
from scapy.layers.inet import IP
if conf.ipv6_enabled:
from sca... | 51.25 | 108 | 0.411847 |
607a83671019e29faf10d73b1990f1dcb2f9c76a | 1,847 | py | Python | interactive_graph/exceptions.py | essweine/interactive-graph | 9d745782932b1f12403d7ff9af580f3aac5ee428 | [
"MIT"
] | null | null | null | interactive_graph/exceptions.py | essweine/interactive-graph | 9d745782932b1f12403d7ff9af580f3aac5ee428 | [
"MIT"
] | null | null | null | interactive_graph/exceptions.py | essweine/interactive-graph | 9d745782932b1f12403d7ff9af580f3aac5ee428 | [
"MIT"
] | null | null | null | class VertexError(Exception):
def __init__(self, vertex, action, reason):
self.vertex = vertex
self.action = action
self.message = "Action {a} could not be performed for vertex {v}: {r}".format(
a = action, v = vertex, r = reason)
def __str__(self):
return self.messag... | 36.94 | 115 | 0.68327 |
27215617831a355062fecd82e4b3135d4f32a486 | 6,874 | py | Python | src/parallel_model.py | RozDavid/mask_rcnn_ros | 264cc00d66ec0214f2e60863abffabbf71be147f | [
"MIT"
] | null | null | null | src/parallel_model.py | RozDavid/mask_rcnn_ros | 264cc00d66ec0214f2e60863abffabbf71be147f | [
"MIT"
] | null | null | null | src/parallel_model.py | RozDavid/mask_rcnn_ros | 264cc00d66ec0214f2e60863abffabbf71be147f | [
"MIT"
] | null | null | null | """
Mask R-CNN
Multi-GPU Support for Keras.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
Ideas and a small code snippets from these sources:
https://github.com/fchollet/keras/issues/2436
https://medium.com/@kuza55/transparent-multi-gpu-training... | 39.505747 | 95 | 0.612016 |
07cc6da81cbd4fe54e61c143e3db18443e3b7922 | 593 | py | Python | src/pyrin/audit/exceptions.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | src/pyrin/audit/exceptions.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | src/pyrin/audit/exceptions.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
audit exceptions module.
"""
from pyrin.core.exceptions import CoreException, CoreBusinessException
class AuditManagerException(CoreException):
"""
audit manager exception.
"""
pass
class AuditManagerBusinessException(CoreBusinessException, AuditManagerException):
""... | 16.942857 | 82 | 0.689713 |
eac869e65c316650bba1b73f4d49ec7e025621fa | 472 | py | Python | src/asm/cmsui/format.py | ctheune/assembly-cms | 20e000373fc30d9a14cb5dc882499b5eed1d86ee | [
"ZPL-2.1"
] | null | null | null | src/asm/cmsui/format.py | ctheune/assembly-cms | 20e000373fc30d9a14cb5dc882499b5eed1d86ee | [
"ZPL-2.1"
] | null | null | null | src/asm/cmsui/format.py | ctheune/assembly-cms | 20e000373fc30d9a14cb5dc882499b5eed1d86ee | [
"ZPL-2.1"
] | null | null | null | import grok
import datetime
import whenIO
class DateFormat(grok.View):
grok.context(datetime.datetime)
grok.name('format')
def render(self):
# XXX L10N or simple 'XXX time ago'
return self.context.strftime('%d.%m.%Y %H:%M')
def when(self):
w = whenIO.WhenIO()
return ... | 18.153846 | 54 | 0.627119 |
c85a0f1580da2f7ba0a1769b7643a34d930181d2 | 5,998 | py | Python | hikyuu/hku_config.py | scanfyu/hikyuu | 55265de4d8d4773391f2dcd1211acec9fe901f53 | [
"MIT"
] | 2 | 2020-05-01T06:23:14.000Z | 2020-05-21T02:42:48.000Z | hikyuu/hku_config.py | scanfyu/hikyuu | 55265de4d8d4773391f2dcd1211acec9fe901f53 | [
"MIT"
] | 1 | 2019-04-16T03:23:15.000Z | 2019-04-16T03:23:15.000Z | hikyuu/hku_config.py | archya/hikyuu | 2305a977a78bab832bf8fcb4d66482dfef442c9d | [
"MIT"
] | 1 | 2020-03-31T16:45:23.000Z | 2020-03-31T16:45:23.000Z | #!/usr/bin/python
# -*- coding: utf8 -*-
# cp936
#===============================================================================
# 作者:fasiondog
# 历史:1)20100220, Added by fasiondog
#===============================================================================
import os
import sys
import shutil
usr_dir = os.path.ex... | 29.546798 | 105 | 0.615205 |
bd7608cd42204b73ebb6f6326856d4647af969fc | 1,422 | py | Python | config/settings/test.py | dontmindifiduda/django_pitt_crash | 5d0eb67d4ac762b0576ed35559770f979eda1120 | [
"MIT"
] | null | null | null | config/settings/test.py | dontmindifiduda/django_pitt_crash | 5d0eb67d4ac762b0576ed35559770f979eda1120 | [
"MIT"
] | null | null | null | config/settings/test.py | dontmindifiduda/django_pitt_crash | 5d0eb67d4ac762b0576ed35559770f979eda1120 | [
"MIT"
] | null | null | null | """
With these settings, tests run faster.
"""
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
"DJANGO_SECRET_KEY",
default="fo4q5qENK... | 33.857143 | 80 | 0.510549 |
2814a4a6bd6a8cdca034d5b49dace17de93ae627 | 3,196 | py | Python | ucscentralsdk/mometa/mgmt/MgmtDataItem.py | ragupta-git/ucscentralsdk | 2678008b5fb6b0fafafec388d0874147e95a1086 | [
"Apache-2.0"
] | null | null | null | ucscentralsdk/mometa/mgmt/MgmtDataItem.py | ragupta-git/ucscentralsdk | 2678008b5fb6b0fafafec388d0874147e95a1086 | [
"Apache-2.0"
] | null | null | null | ucscentralsdk/mometa/mgmt/MgmtDataItem.py | ragupta-git/ucscentralsdk | 2678008b5fb6b0fafafec388d0874147e95a1086 | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for MgmtDataItem ManagedObject."""
from ...ucscentralmo import ManagedObject
from ...ucscentralcoremeta import UcsCentralVersion, MoPropertyMeta, MoMeta
from ...ucscentralmeta import VersionMeta
class MgmtDataItemConsts():
OP_STATUS_ALL_SUCCESS = "all-success"
... | 52.393443 | 251 | 0.665207 |
a601accdeeeb7476911a4e4d3ac370a4494a9db8 | 8,212 | py | Python | isi_sdk_9_0_0/isi_sdk_9_0_0/models/auth_role_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/auth_role_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/auth_role_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_9_0_0.models.auth_a... | 32.97992 | 132 | 0.597297 |
8507e331769ae13e145c4314073b4c3af7dfdeeb | 79,870 | py | Python | google/cloud/iot_v1/gapic/device_manager_client.py | vam-google/python-iot | 6054a14c007ea967bcef275fc4aafc70e48b8b5d | [
"Apache-2.0"
] | null | null | null | google/cloud/iot_v1/gapic/device_manager_client.py | vam-google/python-iot | 6054a14c007ea967bcef275fc4aafc70e48b8b5d | [
"Apache-2.0"
] | 40 | 2019-07-16T10:04:48.000Z | 2020-01-20T09:04:59.000Z | google/cloud/iot_v1/gapic/device_manager_client.py | vam-google/python-iot | 6054a14c007ea967bcef275fc4aafc70e48b8b5d | [
"Apache-2.0"
] | 2 | 2019-07-18T00:05:31.000Z | 2019-11-27T14:17:22.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2020 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... | 43.266522 | 157 | 0.60149 |
fbf17435a82371bca41098ab2ea85f411eb3d384 | 734 | py | Python | 5249-minimum-remove-to-make-valid-parentheses.py | daicang/Leetcode | 676b05c1222670f73294eb2ed2665433eac148f4 | [
"MIT"
] | null | null | null | 5249-minimum-remove-to-make-valid-parentheses.py | daicang/Leetcode | 676b05c1222670f73294eb2ed2665433eac148f4 | [
"MIT"
] | null | null | null | 5249-minimum-remove-to-make-valid-parentheses.py | daicang/Leetcode | 676b05c1222670f73294eb2ed2665433eac148f4 | [
"MIT"
] | null | null | null | class Solution(object):
def minRemoveToMakeValid(self, s):
"""
:type s: str
:rtype: str
"""
stack = []
remove = []
for i, val in enumerate(s):
if val == '(':
stack.append(i)
elif val == ')':
if stack:
... | 18.35 | 38 | 0.404632 |
daa50afbff51dd78b6b6bde9003c79c32343634f | 1,053 | py | Python | traces/norway/plot_mahimahi_bandwidth.py | matvaibhav/pensieve | 52faa79f5ab5d16fa98e40801244bfca3c45170d | [
"MIT"
] | 462 | 2017-07-19T00:20:34.000Z | 2022-03-28T06:07:14.000Z | traces/norway/plot_mahimahi_bandwidth.py | matvaibhav/pensieve | 52faa79f5ab5d16fa98e40801244bfca3c45170d | [
"MIT"
] | 145 | 2017-08-25T02:27:19.000Z | 2022-02-25T08:34:41.000Z | traces/norway/plot_mahimahi_bandwidth.py | matvaibhav/pensieve | 52faa79f5ab5d16fa98e40801244bfca3c45170d | [
"MIT"
] | 277 | 2017-08-11T14:27:19.000Z | 2022-03-08T05:23:43.000Z | import numpy as np
import matplotlib.pyplot as plt
PACKET_SIZE = 1500.0 # bytes
BITS_IN_BYTE = 8.0
MBITS_IN_BITS = 1000000.0
MILLISECONDS_IN_SECONDS = 1000.0
N = 100
LINK_FILE = './mahimahi/bus.ljansbakken-oslo-report.2010-09-28_1407CEST.log'
time_all = []
packet_sent_all = []
last_time_stamp = 0
packet_sent = 0
w... | 24.488372 | 76 | 0.709402 |
ad0491199f42282ec0ba32f448f4ca475e7f5c51 | 3,186 | py | Python | jina/types/document/converters.py | Immich/jina | 1f5f7cf4d82029d76ab41df157526fe6f6e0da50 | [
"Apache-2.0"
] | null | null | null | jina/types/document/converters.py | Immich/jina | 1f5f7cf4d82029d76ab41df157526fe6f6e0da50 | [
"Apache-2.0"
] | null | null | null | jina/types/document/converters.py | Immich/jina | 1f5f7cf4d82029d76ab41df157526fe6f6e0da50 | [
"Apache-2.0"
] | null | null | null | import mimetypes
import struct
import urllib.parse
import urllib.request
import zlib
import numpy as np
def png_to_buffer_1d(arr: 'np.ndarray', width: int, height: int) -> bytes:
pixels = []
arr = 255 - arr
for p in arr[::-1]:
pixels.extend([p, p, p, 255])
buf = bytearray(pixels)
# rever... | 32.845361 | 98 | 0.624922 |
a7a5b700e4c9507b8289878a38e21476887746bd | 739 | py | Python | zeus/models/author.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 221 | 2017-07-03T17:29:21.000Z | 2021-12-07T19:56:59.000Z | zeus/models/author.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 298 | 2017-07-04T18:08:14.000Z | 2022-03-03T22:24:51.000Z | zeus/models/author.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 24 | 2017-07-15T13:46:45.000Z | 2020-08-16T16:14:45.000Z | from zeus.config import db
from zeus.db.mixins import RepositoryBoundMixin
from zeus.db.types import GUID
from zeus.db.utils import model_repr
class Author(RepositoryBoundMixin, db.Model):
"""
The author of a source. Generally used for things like commit authors.
This is different than User, which indica... | 32.130435 | 79 | 0.718539 |
c84c35eb433c8c285cdd1c7e73948024d7c3d4e9 | 1,160 | py | Python | copy/setup.py | Carglglz/micropython-lib | 07102c56aa1087b97ee313cedc1d89fd20452e11 | [
"PSF-2.0"
] | 2 | 2019-06-25T15:19:18.000Z | 2019-07-08T12:23:04.000Z | copy/setup.py | Carglglz/micropython-lib | 07102c56aa1087b97ee313cedc1d89fd20452e11 | [
"PSF-2.0"
] | null | null | null | copy/setup.py | Carglglz/micropython-lib | 07102c56aa1087b97ee313cedc1d89fd20452e11 | [
"PSF-2.0"
] | 3 | 2021-02-24T12:16:11.000Z | 2022-01-04T08:35:59.000Z | import sys
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system's.
sys.path.pop(0)
from setuptools import setup
sys.path.append("..")
import sdist_upip
setup(name='micropython-copy',
version='3.3.3-2',
description='CPython copy module ported to MicroPython',
... | 55.238095 | 502 | 0.75 |
7f566aa8a9a7dab32466b3d31290857e866a4802 | 8,051 | py | Python | softwareprocess/test/dispatchTest.py | agupta7/CSSE | 9bc19882b21df128a12fe1ee2356f1dd69c8fe32 | [
"MIT"
] | null | null | null | softwareprocess/test/dispatchTest.py | agupta7/CSSE | 9bc19882b21df128a12fe1ee2356f1dd69c8fe32 | [
"MIT"
] | null | null | null | softwareprocess/test/dispatchTest.py | agupta7/CSSE | 9bc19882b21df128a12fe1ee2356f1dd69c8fe32 | [
"MIT"
] | null | null | null | import unittest
import softwareprocess.prod.dispatch as dispatch
class DispatchTest(unittest.TestCase):
# Acceptance tests
#--- test cases enumerated in Excel sheet 201720Assignment4
def test100_010_DispatchAdjust(self):
dict = dispatch.dispatch({'op': 'adjust'})
self.assertEquals(dict['op'], '... | 60.533835 | 188 | 0.650602 |
b39c6dfa5d0579d3e2318a2e7f5e9c3990da5057 | 77 | py | Python | core/__init__.py | LucaCeccagnoli/PoggersHEMA | 4c35749750a9cb75024487b3f44bc2506df2a338 | [
"MIT"
] | null | null | null | core/__init__.py | LucaCeccagnoli/PoggersHEMA | 4c35749750a9cb75024487b3f44bc2506df2a338 | [
"MIT"
] | null | null | null | core/__init__.py | LucaCeccagnoli/PoggersHEMA | 4c35749750a9cb75024487b3f44bc2506df2a338 | [
"MIT"
] | null | null | null | # il package core contiene le view per il caricamento delle pagine principali | 77 | 77 | 0.831169 |
956314201a46f44049e4743d3e4f79c9124f45b1 | 7,399 | py | Python | Dataset.py | wilsonlau-uw/Extract-Follow-up-Recommendations- | 49fc2cdfe9a02e11c20cff86f403013bfc781073 | [
"MIT"
] | null | null | null | Dataset.py | wilsonlau-uw/Extract-Follow-up-Recommendations- | 49fc2cdfe9a02e11c20cff86f403013bfc781073 | [
"MIT"
] | null | null | null | Dataset.py | wilsonlau-uw/Extract-Follow-up-Recommendations- | 49fc2cdfe9a02e11c20cff86f403013bfc781073 | [
"MIT"
] | null | null | null | from Config import Config
import Util
import pandas as pd
import numpy as np
import nltk
import pickle
from sklearn.preprocessing import LabelBinarizer
from keras.preprocessing.text import text_to_word_sequence
from keras.preprocessing.sequence import pad_sequences
from sklearn.model_selection import train_test_spli... | 38.73822 | 132 | 0.583457 |
f1bfb40ce21bf0739fe58d098cfe962c01f52b32 | 206 | py | Python | Python/1 - if,else,switch case and math operations/1_validate_interval.py | joaomateusferr/teach_programming | f275e3decf88c24ba1c5d95a0b344c45490a21b4 | [
"MIT"
] | null | null | null | Python/1 - if,else,switch case and math operations/1_validate_interval.py | joaomateusferr/teach_programming | f275e3decf88c24ba1c5d95a0b344c45490a21b4 | [
"MIT"
] | null | null | null | Python/1 - if,else,switch case and math operations/1_validate_interval.py | joaomateusferr/teach_programming | f275e3decf88c24ba1c5d95a0b344c45490a21b4 | [
"MIT"
] | null | null | null | def main():
n = int(input('Insert a number: '))
if n >= -1 and n <= 1:
print("It's in the range between -1 and 1")
else:
print("It's not in the range between -1 and 1")
main() | 20.6 | 55 | 0.529126 |
ebacd0cbb5b62fecb7075239682a772cdfbb91e8 | 3,428 | py | Python | Python/Telegram_Bot/markovmeme/client.py | iamakkkhil/Rotten-Scripts | 116ae502271d699db88add5fd1cf733d01134b7d | [
"MIT"
] | 1,127 | 2020-02-16T04:14:00.000Z | 2022-03-31T21:37:24.000Z | Python/Telegram_Bot/markovmeme/client.py | iamakkkhil/Rotten-Scripts | 116ae502271d699db88add5fd1cf733d01134b7d | [
"MIT"
] | 1,123 | 2020-06-20T04:00:11.000Z | 2022-03-31T13:23:45.000Z | Python/Telegram_Bot/markovmeme/client.py | iamakkkhil/Rotten-Scripts | 116ae502271d699db88add5fd1cf733d01134b7d | [
"MIT"
] | 669 | 2020-05-30T16:14:43.000Z | 2022-03-31T14:36:11.000Z | #!/usr/bin/env python
"""
Copyright (C) 2019-2020 Vanessa Sochat.
This Source Code Form is subject to the terms of the
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from markovmeme.utils import list_corpus
from markov... | 25.58209 | 86 | 0.616394 |
30c05b5d92f0c5c94419614c24fb2681b4cb5c75 | 525 | py | Python | zvt/domain/quotes/stock/stock_5m_kdata.py | loveher147/zvt | e16d8e20daa5d0c069294f063d8f5a021bb8e8bf | [
"MIT"
] | null | null | null | zvt/domain/quotes/stock/stock_5m_kdata.py | loveher147/zvt | e16d8e20daa5d0c069294f063d8f5a021bb8e8bf | [
"MIT"
] | null | null | null | zvt/domain/quotes/stock/stock_5m_kdata.py | loveher147/zvt | e16d8e20daa5d0c069294f063d8f5a021bb8e8bf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# this file is generated by gen_kdata_schema function, dont't change it
from sqlalchemy.orm import declarative_base
from zvt.contract.register import register_schema
from zvt.domain.quotes import StockKdataCommon
KdataBase = declarative_base()
class Stock5mKdata(KdataBase, StockKdataCommon):... | 29.166667 | 110 | 0.792381 |
177dd015bbf154d57e58c65c378ff4b23e751d8e | 8,623 | py | Python | blue_st_sdk/features/feature_stepper_motor.py | Higgcz/BlueSTSDK_Python | fdd2de0e891b901d35e94901ae06023ee2ab65a3 | [
"BSD-3-Clause"
] | 1 | 2020-02-18T16:50:42.000Z | 2020-02-18T16:50:42.000Z | blue_st_sdk/features/feature_stepper_motor.py | Higgcz/BlueSTSDK_Python | fdd2de0e891b901d35e94901ae06023ee2ab65a3 | [
"BSD-3-Clause"
] | null | null | null | blue_st_sdk/features/feature_stepper_motor.py | Higgcz/BlueSTSDK_Python | fdd2de0e891b901d35e94901ae06023ee2ab65a3 | [
"BSD-3-Clause"
] | null | null | null | ################################################################################
# COPYRIGHT(c) 2018 STMicroelectronics #
# #
# Redistribution and use in source and binary forms, with or without ... | 39.555046 | 94 | 0.602806 |
12f1ffa88eb59124478c15f27d373d8850cb2f4f | 407 | py | Python | metal/commands/execute.py | NoelDeMartin/metal | 538aa0cb4ac413aefeacb1ec8b52ed5d6fd6028e | [
"MIT"
] | 2 | 2019-05-03T09:24:12.000Z | 2021-11-15T11:31:54.000Z | metal/commands/execute.py | NoelDeMartin/metal | 538aa0cb4ac413aefeacb1ec8b52ed5d6fd6028e | [
"MIT"
] | null | null | null | metal/commands/execute.py | NoelDeMartin/metal | 538aa0cb4ac413aefeacb1ec8b52ed5d6fd6028e | [
"MIT"
] | null | null | null | import os
import click
from ..cli import cli, pass_runtime
@cli.command(name="exec")
@click.argument('command', nargs=-1)
@click.option('--service', help='Service name')
@pass_runtime
def execute(runtime, command, service):
"""Execute a command into the given service"""
if service is None:
service = ... | 23.941176 | 55 | 0.700246 |
9052e2fe7e5d7b1af5ab48faa6c0b87ac8a69f8f | 734 | py | Python | api/migrations/0002_alter_address_id_alter_address_state_alter_person_id.py | Qinchengqiang/django-api | 621aedb799df69ad9ea6cdea2216fc10b78f895a | [
"MIT"
] | null | null | null | api/migrations/0002_alter_address_id_alter_address_state_alter_person_id.py | Qinchengqiang/django-api | 621aedb799df69ad9ea6cdea2216fc10b78f895a | [
"MIT"
] | null | null | null | api/migrations/0002_alter_address_id_alter_address_state_alter_person_id.py | Qinchengqiang/django-api | 621aedb799df69ad9ea6cdea2216fc10b78f895a | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-03-21 07:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='address',
name='id',
field=mo... | 25.310345 | 74 | 0.56812 |
41b8698b5620f3a910b8277ab4fe2b7f4ae29fa4 | 1,074 | py | Python | api/generated/python/azure-iiot-opc-registry/models/publisher_query_api_model.py | jaz230/Industrial-IoT | bd4c5abfe579cbb7086a621e8381978e6c70a563 | [
"MIT"
] | 1 | 2020-01-22T12:03:08.000Z | 2020-01-22T12:03:08.000Z | api/generated/python/azure-iiot-opc-registry/models/publisher_query_api_model.py | likithadt/Industrial-IoT | d4ea7b330eff08455ca0556fed76aa74d2034da5 | [
"MIT"
] | null | null | null | api/generated/python/azure-iiot-opc-registry/models/publisher_query_api_model.py | likithadt/Industrial-IoT | d4ea7b330eff08455ca0556fed76aa74d2034da5 | [
"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 2.3.33.0
# ... | 32.545455 | 76 | 0.591248 |
512e17216919f0e15505dbb1607d00225f5eb400 | 5,779 | py | Python | master/scan_results/masscan_json_to_csv.py | frite/scantron | 71a772531ac2055169a1b0e779a8497b8ebd57fd | [
"Apache-2.0"
] | null | null | null | master/scan_results/masscan_json_to_csv.py | frite/scantron | 71a772531ac2055169a1b0e779a8497b8ebd57fd | [
"Apache-2.0"
] | 1 | 2021-06-10T23:47:03.000Z | 2021-06-10T23:47:03.000Z | master/scan_results/masscan_json_to_csv.py | frite/scantron | 71a772531ac2055169a1b0e779a8497b8ebd57fd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Standard Python libraries.
# import argparse
import csv
import json
import glob
import os
import re
import shutil
import sys
# Scan result with a banner.
"""
{
"ip": "192.168.1.100",
"timestamp": "1535461676",
"ports": [
{
"port": 443,
"proto": "tcp... | 33.795322 | 120 | 0.549057 |
89a6c796a7233af0c9ffbf93740a0b94adf7bbf1 | 1,164 | py | Python | 03-class-design/UserSession.py | johnehunt/PythonCleanCode | b0ade446cc98cdc1379f06ad20cc3c6de772a2bb | [
"Apache-2.0"
] | 1 | 2020-05-11T13:58:29.000Z | 2020-05-11T13:58:29.000Z | 03-class-design/UserSession.py | johnehunt/PythonCleanCode | b0ade446cc98cdc1379f06ad20cc3c6de772a2bb | [
"Apache-2.0"
] | null | null | null | 03-class-design/UserSession.py | johnehunt/PythonCleanCode | b0ade446cc98cdc1379f06ad20cc3c6de772a2bb | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
# Does this meet the SRP?
class UserSession:
"""Represents information about the User and their Session"""
def __init__(self, id, name, start_date):
self.user_id = id
self.username = name
self.user_since = start_date
self.session_start_time = datet... | 24.25 | 65 | 0.621993 |
e25549702e99a6bba0fe12015180c3cb1fbe5733 | 6,982 | py | Python | utils/viterbi.py | alexanderrichard/cvpr2016_python3 | cddd77420d1be25fe2bba3b069d2cb966c6e366a | [
"MIT"
] | null | null | null | utils/viterbi.py | alexanderrichard/cvpr2016_python3 | cddd77420d1be25fe2bba3b069d2cb966c6e366a | [
"MIT"
] | null | null | null | utils/viterbi.py | alexanderrichard/cvpr2016_python3 | cddd77420d1be25fe2bba3b069d2cb966c6e366a | [
"MIT"
] | null | null | null | #!/usr/bin/python2.7
import numpy as np
from .grammar import PathGrammar
from .length_model import PoissonModel
import glob
import re
# Viterbi decoding
class Viterbi(object):
### helper structure ###
class TracebackNode(object):
def __init__(self, label, predecessor, boundary = False):
s... | 49.169014 | 162 | 0.638213 |
a9ad1a8ef5e51f4b290b311d53dbf794629aabf7 | 35,026 | py | Python | examples/pytorch/question-answering/run_qa.py | dkurt/optimum | a94954d2b891d470fde68d8c1fc635ee9cdd6413 | [
"Apache-2.0"
] | 1 | 2021-11-13T18:29:11.000Z | 2021-11-13T18:29:11.000Z | examples/pytorch/question-answering/run_qa.py | adbmd/optimum | a94954d2b891d470fde68d8c1fc635ee9cdd6413 | [
"Apache-2.0"
] | null | null | null | examples/pytorch/question-answering/run_qa.py | adbmd/optimum | a94954d2b891d470fde68d8c1fc635ee9cdd6413 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Team. 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/LI... | 46.951743 | 124 | 0.672443 |
ba3780a7c0c467e5475d5953fb962e1e12693b8b | 3,931 | py | Python | examples/04_glm_first_level/plot_adhd_dmn.py | chouhanaryan/nilearn | e26312be96fe5c0211da28889ddd3ab1bd0ddc49 | [
"BSD-2-Clause"
] | 827 | 2015-01-30T23:11:42.000Z | 2022-03-29T21:21:05.000Z | examples/04_glm_first_level/plot_adhd_dmn.py | chouhanaryan/nilearn | e26312be96fe5c0211da28889ddd3ab1bd0ddc49 | [
"BSD-2-Clause"
] | 2,845 | 2015-01-04T22:14:41.000Z | 2022-03-31T20:28:09.000Z | examples/04_glm_first_level/plot_adhd_dmn.py | chouhanaryan/nilearn | e26312be96fe5c0211da28889ddd3ab1bd0ddc49 | [
"BSD-2-Clause"
] | 484 | 2015-02-03T10:58:19.000Z | 2022-03-29T21:57:16.000Z | """Default Mode Network extraction of AHDH dataset
===============================================
This example shows a full step-by-step workflow of fitting a GLM to data
extracted from a seed on the Posterior Cingulate Cortex and saving the results.
More specifically:
1. A sequence of fMRI volumes are loaded.
2. A... | 38.920792 | 81 | 0.56347 |
29dbb36b80e750703b2946b9fb1b0fd054c7df40 | 7,827 | py | Python | tests/test_choices.py | rlmv/django-model-utils | bf1adce0b819b59ca8e5075ca1f45230286a1ae8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_choices.py | rlmv/django-model-utils | bf1adce0b819b59ca8e5075ca1f45230286a1ae8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_choices.py | rlmv/django-model-utils | bf1adce0b819b59ca8e5075ca1f45230286a1ae8 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from django.test import TestCase
from model_utils import Choices
class ChoicesTests(TestCase):
def setUp(self):
self.STATUS = Choices('DRAFT', 'PUBLISHED')
def test_getattr(self):
self.assertEqual(self.STATUS.DRAFT, 'DRAFT')
def test_indexing(sel... | 29.874046 | 96 | 0.529449 |
3f0f9987ce9a1bbb47aa4d5fabb350d006572b51 | 738 | py | Python | config.py | Peet-pitz/News-Highlight | 352a414e370473409c2c78969e284887b3221210 | [
"MIT"
] | null | null | null | config.py | Peet-pitz/News-Highlight | 352a414e370473409c2c78969e284887b3221210 | [
"MIT"
] | null | null | null | config.py | Peet-pitz/News-Highlight | 352a414e370473409c2c78969e284887b3221210 | [
"MIT"
] | null | null | null | import os
class Config() :
"""
Gereral configuration of the parent class
"""
NEWS_API_BASE_URL = 'https://newsapi.org/v2/sources?sources={}&apiKey={}'
NEWS_API_KEY = os.environ.get('NEWS_API_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
class ProdConfig(Config) :
"""
production confi... | 21.085714 | 84 | 0.674797 |
74da318bfadec8f35a9fd51bb7d4ea49ee55583a | 8,210 | py | Python | tests/unit/test_dbapi_connection.py | kdeggelman/python-bigquery | 973e23649b59973494e5c706504bc833453155a8 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_dbapi_connection.py | kdeggelman/python-bigquery | 973e23649b59973494e5c706504bc833453155a8 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_dbapi_connection.py | kdeggelman/python-bigquery | 973e23649b59973494e5c706504bc833453155a8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.816143 | 85 | 0.703289 |
222f5e0bca3a6dcd1260d43fb42e2db279954776 | 937 | py | Python | territory/migrations/0006_auto_20200608_1400.py | ChanTerelLy/partnerweb3 | 4f37f032242cbc67d57b7161ecb5960d9cfde76d | [
"MIT"
] | null | null | null | territory/migrations/0006_auto_20200608_1400.py | ChanTerelLy/partnerweb3 | 4f37f032242cbc67d57b7161ecb5960d9cfde76d | [
"MIT"
] | null | null | null | territory/migrations/0006_auto_20200608_1400.py | ChanTerelLy/partnerweb3 | 4f37f032242cbc67d57b7161ecb5960d9cfde76d | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2020-06-08 11:00
from django.db import migrations
import django_resized.forms
import partnerweb_project.storage_backends
class Migration(migrations.Migration):
dependencies = [
('territory', '0005_auto_20200607_2239'),
]
operations = [
migrations.AlterFiel... | 36.038462 | 215 | 0.684098 |
b25f933aebcc8dce0193cdefa8516393d4096ab9 | 604 | py | Python | tests/unit/operators/__init__.py | IM-SIM/airflow-pentaho-plugin | 460dea1bdb11804e8b5707e3735b54bb2d419665 | [
"Apache-2.0"
] | 29 | 2020-03-26T15:20:00.000Z | 2022-03-03T08:08:09.000Z | tests/unit/operators/__init__.py | IM-SIM/airflow-pentaho-plugin | 460dea1bdb11804e8b5707e3735b54bb2d419665 | [
"Apache-2.0"
] | 16 | 2020-05-06T10:01:05.000Z | 2022-03-28T07:05:40.000Z | tests/unit/operators/__init__.py | IM-SIM/airflow-pentaho-plugin | 460dea1bdb11804e8b5707e3735b54bb2d419665 | [
"Apache-2.0"
] | 7 | 2020-04-01T16:55:23.000Z | 2021-08-19T12:51:17.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Aneior Studio, SL
#
# 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 ... | 40.266667 | 74 | 0.75 |
3937d7abd558d60328dce973f8ceb1a8719ae33f | 4,005 | py | Python | src/einsteinpy/plotting/geodesics_scatter.py | Tushar-Tyagi/einsteinpy | ffb2f3a7d64ee6e5a442e620cc82f59c362f49e4 | [
"MIT"
] | null | null | null | src/einsteinpy/plotting/geodesics_scatter.py | Tushar-Tyagi/einsteinpy | ffb2f3a7d64ee6e5a442e620cc82f59c362f49e4 | [
"MIT"
] | null | null | null | src/einsteinpy/plotting/geodesics_scatter.py | Tushar-Tyagi/einsteinpy | ffb2f3a7d64ee6e5a442e620cc82f59c362f49e4 | [
"MIT"
] | null | null | null | import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.animation import FuncAnimation
from einsteinpy.metric import Schwarzschild
class ScatterGeodesicPlotter:
"""
Class for plotting static matplotlib plots.
"""
def __init__(
self, mass, time=0 * u.s, at... | 30.340909 | 85 | 0.590262 |
40b90b4ab576ff45a5e06f34c3e9b3df1568e64f | 913 | py | Python | src/test/python/test_regressions.py | tschoonj/jep | 639f6cbe512b5ce4b51412564dba8db5bbbf1e3b | [
"Zlib"
] | 1 | 2020-11-13T00:12:59.000Z | 2020-11-13T00:12:59.000Z | src/test/python/test_regressions.py | tschoonj/jep | 639f6cbe512b5ce4b51412564dba8db5bbbf1e3b | [
"Zlib"
] | 1 | 2020-07-15T19:39:23.000Z | 2020-07-16T23:48:05.000Z | src/test/python/test_regressions.py | tschoonj/jep | 639f6cbe512b5ce4b51412564dba8db5bbbf1e3b | [
"Zlib"
] | null | null | null | from __future__ import print_function
import unittest
import sys
from jep_pipe import jep_pipe
from jep_pipe import build_java_process_cmd
import jep
TestFieldTypes = jep.findClass('jep.test.types.TestFieldTypes')
class TestRegressions(unittest.TestCase):
def test_out(self):
from java.lang import System
... | 28.53125 | 91 | 0.709748 |
8ea2e46315053dc47590c85437066081bc99f8c8 | 14,984 | py | Python | jina/peapods/runtimes/container/__init__.py | MaxielMrvaljevic/jina | 8d832d88e06a1e0dc31631d243306736807ecf15 | [
"Apache-2.0"
] | 2 | 2021-09-02T04:36:13.000Z | 2021-11-12T11:22:54.000Z | jina/peapods/runtimes/container/__init__.py | sheetal01761/jina | 520fc0794fb43d96e1fc85534e9df3cf9c89c42e | [
"Apache-2.0"
] | null | null | null | jina/peapods/runtimes/container/__init__.py | sheetal01761/jina | 520fc0794fb43d96e1fc85534e9df3cf9c89c42e | [
"Apache-2.0"
] | null | null | null | import argparse
import os
import sys
import time
import warnings
from typing import Union, Optional, Dict, TYPE_CHECKING
from pathlib import Path
from platform import uname
from ..zmq.base import ZMQRuntime
from ...zmq import Zmqlet
from .... import __docker_host__
from .helper import get_docker_network
from ....excep... | 34.846512 | 114 | 0.577549 |
88e93c8b9ae0b34ff3ef98341a3972f64310c062 | 295 | py | Python | examples/idioms/programs/173.2427-format-a-number-with-grouped-thousands.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 31 | 2020-05-02T13:34:26.000Z | 2021-06-06T17:25:52.000Z | examples/idioms/programs/173.2427-format-a-number-with-grouped-thousands.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 108 | 2019-11-18T19:41:52.000Z | 2022-03-18T13:58:17.000Z | examples/idioms/programs/173.2427-format-a-number-with-grouped-thousands.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 4 | 2020-05-19T08:57:44.000Z | 2020-09-21T08:53:46.000Z | """Format a number with grouped thousands.
Number will be formatted with a comma separator between every group of thousands.
Source: cup
"""
# Implementation author: cup
# Created on 2018-09-17T20:09:08.888749Z
# Last modified on 2018-09-17T20:09:08.888749Z
# Version 1
print("f'{1000:,}'")
| 21.071429 | 81 | 0.738983 |
408286c8f21a305040b9afc684035edf6e29a768 | 1,249 | py | Python | extensions/interactions/NumberWithUnits/NumberWithUnits.py | Panda2498/oppia | fccfd7e89c6904c244deaccdee80cc5658f2520a | [
"Apache-2.0"
] | null | null | null | extensions/interactions/NumberWithUnits/NumberWithUnits.py | Panda2498/oppia | fccfd7e89c6904c244deaccdee80cc5658f2520a | [
"Apache-2.0"
] | 1 | 2020-01-26T14:02:43.000Z | 2020-01-26T14:02:43.000Z | extensions/interactions/NumberWithUnits/NumberWithUnits.py | ryanboris/oppia | bc39e54e00d53ea2f00bca906fe02162d0c422ac | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 34.694444 | 74 | 0.748599 |
4471ae46a056c6f54a07d05d602c1d1629fd1cea | 19 | py | Python | .venv/Lib/site-packages/_black_version.py | Vqid/permafrost | b5dc9972fba72e2e1971ecfe9d702ae013586bdf | [
"BSD-3-Clause"
] | 1 | 2020-10-05T05:38:26.000Z | 2020-10-05T05:38:26.000Z | .venv/Lib/site-packages/_black_version.py | Vqid/permafrost | b5dc9972fba72e2e1971ecfe9d702ae013586bdf | [
"BSD-3-Clause"
] | null | null | null | .venv/Lib/site-packages/_black_version.py | Vqid/permafrost | b5dc9972fba72e2e1971ecfe9d702ae013586bdf | [
"BSD-3-Clause"
] | null | null | null | version = "22.3.0"
| 9.5 | 18 | 0.578947 |
3076d131d3ff377d08c51102d0d4bf2223b56563 | 3,579 | py | Python | scipy/ndimage/tests/test_filters.py | ogrisel/scipy | e356524e69eebb2135d64724073f71138c15dc9e | [
"BSD-3-Clause"
] | 1 | 2020-11-07T04:53:55.000Z | 2020-11-07T04:53:55.000Z | scipy/ndimage/tests/test_filters.py | ogrisel/scipy | e356524e69eebb2135d64724073f71138c15dc9e | [
"BSD-3-Clause"
] | null | null | null | scipy/ndimage/tests/test_filters.py | ogrisel/scipy | e356524e69eebb2135d64724073f71138c15dc9e | [
"BSD-3-Clause"
] | 1 | 2019-08-13T21:23:57.000Z | 2019-08-13T21:23:57.000Z | ''' Some tests for filters '''
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_equal, assert_raises
import scipy.ndimage as sndi
def test_ticket_701():
# Test generic filter sizes
arr = np.arange(4).reshape((2,2))
func = lambda x: np.... | 36.896907 | 78 | 0.656887 |
b75e402540c94ec10c7ce1d48073dfd09d130456 | 2,322 | py | Python | docs_generator/reference_docs_generator.py | software-mansion/protostar | e9f701d3b02dde78e5292a4698ca3c6c7d39b485 | [
"MIT"
] | 11 | 2022-01-31T14:27:32.000Z | 2022-03-28T18:24:45.000Z | docs_generator/reference_docs_generator.py | software-mansion/protostar | e9f701d3b02dde78e5292a4698ca3c6c7d39b485 | [
"MIT"
] | 105 | 2022-01-31T15:25:29.000Z | 2022-03-31T12:28:13.000Z | docs_generator/reference_docs_generator.py | software-mansion/protostar | e9f701d3b02dde78e5292a4698ca3c6c7d39b485 | [
"MIT"
] | 1 | 2022-03-28T16:18:28.000Z | 2022-03-28T16:18:28.000Z | from pathlib import Path
from typing import List
from protostar.cli.cli_app import CLIApp
from protostar.cli.command import Command
class ReferenceDocsGenerator:
@staticmethod
def save_to_markdown_file(filepath: Path, content: str):
with open(filepath, "w", encoding="utf_8") as file:
file... | 38.065574 | 86 | 0.593023 |
6964c539c7c40e76486d8a3b5af0d1174e8134c2 | 767 | py | Python | simsim/cmd.py | kidig/simsim | 4c541d43b75b4020185a2fd38f1ba8db4de40a57 | [
"MIT"
] | 2 | 2019-04-18T13:40:48.000Z | 2019-05-13T21:02:08.000Z | simsim/cmd.py | kidig/simsim | 4c541d43b75b4020185a2fd38f1ba8db4de40a57 | [
"MIT"
] | 3 | 2020-03-31T02:46:16.000Z | 2021-05-02T13:25:52.000Z | simsim/cmd.py | kidig/simsim | 4c541d43b75b4020185a2fd38f1ba8db4de40a57 | [
"MIT"
] | null | null | null | import operator
from argparse import ArgumentParser
from simsim import compare
def main():
def get_file(value):
return open(value, 'r')
parser = ArgumentParser()
parser.add_argument('file', type=get_file, nargs=2)
args = parser.parse_args()
file_a, file_b = [f for f in args.file]
re... | 26.448276 | 77 | 0.604954 |
266ab6ebb8475dac5396d4dd9da06774f9a938f2 | 19,857 | py | Python | second/pytorch/models/pointpillars.py | jerry99s/second.pytorch | 80143908a349b9f3ff1642d21dacaf23455b3cf8 | [
"MIT"
] | 1,541 | 2018-10-04T00:32:01.000Z | 2022-03-30T17:54:59.000Z | second/pytorch/models/pointpillars.py | Karthik-Ragunath/second.pytorch | 414de8936a165d7cdba4a6eb15ce9603201d2e61 | [
"MIT"
] | 466 | 2018-10-06T01:05:28.000Z | 2022-03-31T08:49:44.000Z | second/pytorch/models/pointpillars.py | Karthik-Ragunath/second.pytorch | 414de8936a165d7cdba4a6eb15ce9603201d2e61 | [
"MIT"
] | 537 | 2018-10-04T07:36:13.000Z | 2022-03-27T10:12:02.000Z | """
PointPillars fork from SECOND.
Code written by Alex Lang and Oscar Beijbom, 2018.
Licensed under MIT License [see LICENSE].
"""
import torch
from torch import nn
from torch.nn import functional as F
from second.pytorch.models.voxel_encoder import get_paddings_indicator, register_vfe
from second.pytorch.models.mid... | 41.628931 | 117 | 0.59586 |
21a29d29fb9477dfc8fc1204849ca1606fd4345f | 142 | py | Python | src/foreign_if/python/main/python/frovedis/dataframe/optype.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | src/foreign_if/python/main/python/frovedis/dataframe/optype.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | src/foreign_if/python/main/python/frovedis/dataframe/optype.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
class OPT:
"A python container for operator types enumerator"
EQ = 1
NE = 2
GT = 3
GE = 4
LT = 5
LE = 6
| 11.833333 | 52 | 0.584507 |
87aae5d94ecbc42dbf7e4960e69629ac49a9f5a0 | 1,163 | py | Python | OasisPy/background.py | ahstewart/OASIS | 82f1ee805e8bfcac4a2640579d9581ecca6ca0ca | [
"MIT"
] | null | null | null | OasisPy/background.py | ahstewart/OASIS | 82f1ee805e8bfcac4a2640579d9581ecca6ca0ca | [
"MIT"
] | null | null | null | OasisPy/background.py | ahstewart/OASIS | 82f1ee805e8bfcac4a2640579d9581ecca6ca0ca | [
"MIT"
] | 1 | 2020-06-02T15:33:34.000Z | 2020-06-02T15:33:34.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 1 16:57:44 2018
@author: andrew
"""
from astropy.io import fits
from scipy.ndimage.filters import gaussian_filter
import numpy as np
def background_match_to_template(image, template, sigma=20):
print("-> Matching science image background to t... | 36.34375 | 70 | 0.717111 |
48056a5d4d0319969fbad935ef8367e0be22a997 | 1,498 | py | Python | apps/sessiongateway/check_request_session.py | vikkyB2/UserMaintenance | 0ae9db17d694ae67ac82145524cae4a1f69d54c6 | [
"MIT"
] | null | null | null | apps/sessiongateway/check_request_session.py | vikkyB2/UserMaintenance | 0ae9db17d694ae67ac82145524cae4a1f69d54c6 | [
"MIT"
] | null | null | null | apps/sessiongateway/check_request_session.py | vikkyB2/UserMaintenance | 0ae9db17d694ae67ac82145524cae4a1f69d54c6 | [
"MIT"
] | null | null | null | import json
import string
from datetime import datetime
from apps.sessiongateway.session_storage import checkfetchSessionDataExsists,updateSession,updatesessionExpiry
from apps.DBUtils.sql_utils import excecuteFetchoneQuery
from apps.Utils.date_time_utils import isNewDay
#validate session with sessionId
def ... | 46.8125 | 139 | 0.674232 |
ac204443534e78235c993548bb8c0758623084e6 | 295 | py | Python | pyrs/setup.py | Enc0de-Git/pyrs | 8846031d24fee10b3d9b4f0ffe3f81df448e5dd6 | [
"BSD-3-Clause"
] | null | null | null | pyrs/setup.py | Enc0de-Git/pyrs | 8846031d24fee10b3d9b4f0ffe3f81df448e5dd6 | [
"BSD-3-Clause"
] | null | null | null | pyrs/setup.py | Enc0de-Git/pyrs | 8846031d24fee10b3d9b4f0ffe3f81df448e5dd6 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
setup(name='pyrpg',
version='1.32',
description='The pyrs API for retroshare rewritten for python 3',
author='Enc0de',
author_email='enc0deisbae@riseup.net',
url='https://github.com/Enc0de-Git/pyrs',
py_modules=['pyrs'],
)
| 24.583333 | 71 | 0.644068 |
e0dfe36ab0a919346c89d784484651549efe1d81 | 37,857 | py | Python | src/transformers/models/layoutlmv2/tokenization_layoutlmv2_fast.py | dctelus/transformers | 6786cbc4b14ebff0ac59c768cadd109391db9a08 | [
"Apache-2.0"
] | 3 | 2022-01-15T08:06:07.000Z | 2022-03-10T07:13:18.000Z | src/transformers/models/layoutlmv2/tokenization_layoutlmv2_fast.py | arron1227/transformers | b18dfd95e1f60ae65a959a7b255fc06522170d1b | [
"Apache-2.0"
] | 1 | 2022-03-23T19:49:13.000Z | 2022-03-23T19:49:13.000Z | src/transformers/models/layoutlmv2/tokenization_layoutlmv2_fast.py | arron1227/transformers | b18dfd95e1f60ae65a959a7b255fc06522170d1b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# 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... | 46.852723 | 132 | 0.626674 |
038f9cee5720ec8790a4de4f7a9655802bf51833 | 17,016 | py | Python | test_data/samples/dnspython_versioned_output.py | jgberry/ssort | 65c4b0a1f2e9e93e65855967f9a438046b24d9e1 | [
"MIT"
] | null | null | null | test_data/samples/dnspython_versioned_output.py | jgberry/ssort | 65c4b0a1f2e9e93e65855967f9a438046b24d9e1 | [
"MIT"
] | null | null | null | test_data/samples/dnspython_versioned_output.py | jgberry/ssort | 65c4b0a1f2e9e93e65855967f9a438046b24d9e1 | [
"MIT"
] | null | null | null | # Taken from Dnspython
# ISC License
#
# Copyright (C) Dnspython Contributors
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE IS P... | 35.898734 | 79 | 0.605254 |
2e24590c6e6a4b7215c03957f0c3153cc66b6ad0 | 834 | py | Python | module3/solution/get_image_metadata.py | axel-sirota/getting-started-azure-computer-vision | a201bbadd5dec6192e1ac9abb0fa7a34e38c1176 | [
"MIT"
] | null | null | null | module3/solution/get_image_metadata.py | axel-sirota/getting-started-azure-computer-vision | a201bbadd5dec6192e1ac9abb0fa7a34e38c1176 | [
"MIT"
] | null | null | null | module3/solution/get_image_metadata.py | axel-sirota/getting-started-azure-computer-vision | a201bbadd5dec6192e1ac9abb0fa7a34e38c1176 | [
"MIT"
] | null | null | null | import os
from azure.cognitiveservices.vision.computervision import ComputerVisionClient
from msrest.authentication import CognitiveServicesCredentials
# Authenticate
subscription_key = os.environ["AZURE_COMPUTER_VISION_SUBSCRIPTION_KEY"]
endpoint = os.environ["AZURE_COMPUTER_VISION_ENDPOINT"]
computervision_client... | 37.909091 | 140 | 0.83693 |
eafb44e4182213eff738c4734e5a65073f8527e7 | 386 | py | Python | singleton.py | xdtianyu/SmallTalkService | 20eb27192dd94c37bc96592ce1395546c19af0a8 | [
"Apache-2.0"
] | null | null | null | singleton.py | xdtianyu/SmallTalkService | 20eb27192dd94c37bc96592ce1395546c19af0a8 | [
"Apache-2.0"
] | null | null | null | singleton.py | xdtianyu/SmallTalkService | 20eb27192dd94c37bc96592ce1395546c19af0a8 | [
"Apache-2.0"
] | null | null | null | '''
File name: singleton.py
Author: xdtianyu@gmail.com
Date created: 2015-03-15 12:34:57
Date last modified: 2015-03-15 12:41:23
Python Version: 2.7.6
'''
def singleton(class_):
instances = {}
def getinstance(*args, **kwargs):
if class_ not in instances:
instances[class_] = class_(*... | 24.125 | 51 | 0.658031 |
92636cff5ff256c49d345989b392fa437616a543 | 1,760 | py | Python | usage/python/tools/source/globus/usage/ogsadaipacket.py | jtfrey/globus-toolkit | ee55e99c6d6a6dd2dbd4246c0537e0b083069a5d | [
"Apache-2.0"
] | 44 | 2015-02-04T22:01:05.000Z | 2021-01-27T21:18:47.000Z | usage/python/tools/source/globus/usage/ogsadaipacket.py | jtfrey/globus-toolkit | ee55e99c6d6a6dd2dbd4246c0537e0b083069a5d | [
"Apache-2.0"
] | 69 | 2015-04-07T16:07:26.000Z | 2020-06-17T20:00:34.000Z | usage/python/tools/source/globus/usage/ogsadaipacket.py | ellert/globus-toolkit | 14761278bf048b0d9bd3d46ab4c3c987b968f2d3 | [
"Apache-2.0"
] | 51 | 2015-04-07T14:29:47.000Z | 2021-09-23T08:44:18.000Z | # Copyright 1999-2009 University of Chicago
#
# 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 t... | 29.830508 | 75 | 0.653977 |
7548af1913c0a8d762e56e3cdf8918eb9b77cf06 | 1,171 | py | Python | dyndnsc/detector/command.py | infothrill/python-dyndnsc | 7ee6c55b3cca751d7bd7155ac935d4ad13189684 | [
"MIT"
] | 35 | 2015-02-13T02:54:49.000Z | 2022-03-16T17:03:07.000Z | dyndnsc/detector/command.py | infothrill/python-dyndnsc | 7ee6c55b3cca751d7bd7155ac935d4ad13189684 | [
"MIT"
] | 121 | 2015-02-04T15:48:08.000Z | 2022-03-27T17:25:58.000Z | dyndnsc/detector/command.py | infothrill/python-dyndnsc | 7ee6c55b3cca751d7bd7155ac935d4ad13189684 | [
"MIT"
] | 9 | 2015-04-30T15:48:06.000Z | 2018-07-05T12:50:25.000Z | # -*- coding: utf-8 -*-
"""Module containing logic for command based detectors."""
from .base import IPDetector
class IPDetector_Command(IPDetector):
"""IPDetector to detect IP address executing shell command/script."""
configuration_key = "command"
def __init__(self, command="", *args, **kwargs):
... | 27.232558 | 86 | 0.628523 |
691e568fa0a32abaa536deff6ee8a13621c1ee7e | 2,366 | py | Python | official/vision/image_classification/efficientnet/tfhub_export.py | akshit-protonn/models | 38c8c6fe4144c93d6aadd19981c2b90570c29eba | [
"Apache-2.0"
] | 82,518 | 2016-02-05T12:07:23.000Z | 2022-03-31T23:09:47.000Z | official/vision/image_classification/efficientnet/tfhub_export.py | akshit-protonn/models | 38c8c6fe4144c93d6aadd19981c2b90570c29eba | [
"Apache-2.0"
] | 9,021 | 2016-03-08T01:02:05.000Z | 2022-03-31T08:06:35.000Z | official/vision/image_classification/efficientnet/tfhub_export.py | akshit-protonn/models | 38c8c6fe4144c93d6aadd19981c2b90570c29eba | [
"Apache-2.0"
] | 54,341 | 2016-02-06T17:19:55.000Z | 2022-03-31T10:27:44.000Z | # Copyright 2021 The TensorFlow 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 applica... | 34.289855 | 80 | 0.765427 |
148dc46db381666f75a396ed4874d0ba44f71be6 | 3,163 | py | Python | silver/models/documents/pdf.py | Nielssie/silver | 736679a9bd6bb93029a31b491d33000ee6b02819 | [
"Apache-2.0"
] | null | null | null | silver/models/documents/pdf.py | Nielssie/silver | 736679a9bd6bb93029a31b491d33000ee6b02819 | [
"Apache-2.0"
] | null | null | null | silver/models/documents/pdf.py | Nielssie/silver | 736679a9bd6bb93029a31b491d33000ee6b02819 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 Presslabs SRL
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 32.27551 | 93 | 0.695858 |
d86c6a62390c5ba6f4437f35ce36d18bbcbacc22 | 317 | py | Python | txircd/modules/__init__.py | guyguy2001/txircd | d548975a775a3582ebb2f480474cfa3e79a26b8c | [
"BSD-3-Clause"
] | 19 | 2015-07-06T21:24:15.000Z | 2021-04-01T13:05:46.000Z | txircd/modules/__init__.py | guyguy2001/txircd | d548975a775a3582ebb2f480474cfa3e79a26b8c | [
"BSD-3-Clause"
] | 37 | 2015-01-16T10:01:28.000Z | 2021-06-01T14:17:49.000Z | txircd/modules/__init__.py | guyguy2001/txircd | d548975a775a3582ebb2f480474cfa3e79a26b8c | [
"BSD-3-Clause"
] | 4 | 2016-09-15T02:48:43.000Z | 2020-01-14T17:23:50.000Z | from twisted.plugin import pluginPackagePaths
import os
__path__.extend(pluginPackagePaths(__name__))
for dir, subdirs, files in os.walk(os.path.dirname(os.path.realpath(__file__))):
for subdir in subdirs:
__path__.append(os.path.join(dir, subdir)) # Also include all module subdirectories in the path
__all__ = [] | 45.285714 | 97 | 0.791798 |
eadc23bea876e8a666d4a5cccc2e2294b28e791f | 1,587 | py | Python | test/integration/ggrc/services/test_query/test_document.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-08-26T06:56:01.000Z | 2021-07-08T13:56:20.000Z | test/integration/ggrc/services/test_query/test_document.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2021-02-02T23:04:30.000Z | 2022-03-02T09:54:47.000Z | test/integration/ggrc/services/test_query/test_document.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2016-08-23T10:51:19.000Z | 2016-08-23T10:51:19.000Z | # coding: utf-8
# Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for /query api endpoint."""
import ddt
from ggrc.models import all_models
from integration.ggrc import TestCase
from integration.ggrc.api_helper import Api
from integration.ggrc.... | 29.943396 | 78 | 0.601134 |
93095e6804250696f52744fbd8771cda93908e93 | 4,882 | py | Python | wrap_traits.py | kdz/pystemm | c98dd548e3db60013fb4f26c2f1522a29f683d71 | [
"MIT"
] | null | null | null | wrap_traits.py | kdz/pystemm | c98dd548e3db60013fb4f26c2f1522a29f683d71 | [
"MIT"
] | 1 | 2015-10-17T16:35:09.000Z | 2015-10-17T16:35:09.000Z | wrap_traits.py | kdz/pystemm | c98dd548e3db60013fb4f26c2f1522a29f683d71 | [
"MIT"
] | null | null | null | ## This module provides utility functions around the Enthought "traits" module
## Other parts of PySTEMM use these utility functions
import traits.api as TR
## A bunch of Boolean functions for specific trait combinations
def isPrimitive(cTrait):
return isinstance(cTrait.trait_type, (TR.Int, TR.String, TR.Bool, T... | 39.056 | 116 | 0.698484 |
29315ded8fe5cf70f19f907ddb288856a374cde8 | 554 | py | Python | ejercicio_dic6.py | omarefg/platzi-python-intro | f11c5a84bcf8dfe632e15133fa2a86923df0b274 | [
"MIT"
] | null | null | null | ejercicio_dic6.py | omarefg/platzi-python-intro | f11c5a84bcf8dfe632e15133fa2a86923df0b274 | [
"MIT"
] | 1 | 2021-06-02T00:51:34.000Z | 2021-06-02T00:51:34.000Z | ejercicio_dic6.py | omarefg/platzi_python-intro | f11c5a84bcf8dfe632e15133fa2a86923df0b274 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
def foreign_exchange_calculator(ammount):
mex_to_col_rate = 145.97
return mex_to_col_rate * ammount
def run():
print("C A L C U L A D O R A D E D I V I S A S")
print("Convierte pesos mexicanos a pesos Colombianos.")
print("")
ammount = float(input("Ingresa la canti... | 26.380952 | 90 | 0.66426 |
051d59839309df0434a575be04b3db96d2b9644f | 22,769 | py | Python | cufflinks/colors.py | gjeusel/cufflinks | 4a37516f98270f1e97c0d874cc509d34b896607c | [
"MIT"
] | 1 | 2018-04-04T06:09:37.000Z | 2018-04-04T06:09:37.000Z | cufflinks/colors.py | gjeusel/cufflinks | 4a37516f98270f1e97c0d874cc509d34b896607c | [
"MIT"
] | null | null | null | cufflinks/colors.py | gjeusel/cufflinks | 4a37516f98270f1e97c0d874cc509d34b896607c | [
"MIT"
] | null | null | null | ##
# Special thanks to @krey for the python3 support
##
import numpy as np
import colorsys
import colorlover as cl
import operator
import copy
from collections import deque
from six import string_types
from IPython.display import HTML, display
from . import themes
from .utils import inverseDict
from .auth import get... | 30.644684 | 121 | 0.467961 |
46349862f386bd1d932b891892734dba189c7a75 | 6,947 | py | Python | src/layers.py | lvyufeng/image_captioning_mindspore | 1795e72840ce003f98ac619fd63a527f05c41d3a | [
"MIT"
] | null | null | null | src/layers.py | lvyufeng/image_captioning_mindspore | 1795e72840ce003f98ac619fd63a527f05c41d3a | [
"MIT"
] | null | null | null | src/layers.py | lvyufeng/image_captioning_mindspore | 1795e72840ce003f98ac619fd63a527f05c41d3a | [
"MIT"
] | null | null | null | import math
import mindspore.nn as nn
import mindspore.ops as ops
from mindspore.ops import constexpr
from mindspore.common.initializer import initializer, Normal, Uniform, HeUniform, _calculate_fan_in_and_fan_out
@constexpr
def compute_kernel_size(inp_shape, output_size):
kernel_width, kernel_height = inp_shape[2... | 41.849398 | 139 | 0.659133 |
bed2dd5feb25c8cc24bed9379e61d2d97104ab1b | 6,924 | py | Python | backend/dawn_dust_31563/settings.py | crowdbotics-apps/dawn-dust-31563 | 656ca1641f117e2338ec80f202f975d120906a47 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/dawn_dust_31563/settings.py | crowdbotics-apps/dawn-dust-31563 | 656ca1641f117e2338ec80f202f975d120906a47 | [
"FTL",
"AML",
"RSA-MD"
] | 8 | 2021-10-19T19:21:56.000Z | 2021-10-19T19:22:03.000Z | backend/dawn_dust_31563/settings.py | crowdbotics-apps/dawn-dust-31563 | 656ca1641f117e2338ec80f202f975d120906a47 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for dawn_dust_31563 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impo... | 29.589744 | 112 | 0.730791 |
4b6cdbda366632caa763da22a8bba21aba50bee1 | 1,724 | py | Python | core/migrations/0001_initial.py | Latiftanga/recipe-api | c405c63a13aa9e573fdf18a1836f00fd74e3d7a9 | [
"MIT"
] | null | null | null | core/migrations/0001_initial.py | Latiftanga/recipe-api | c405c63a13aa9e573fdf18a1836f00fd74e3d7a9 | [
"MIT"
] | null | null | null | core/migrations/0001_initial.py | Latiftanga/recipe-api | c405c63a13aa9e573fdf18a1836f00fd74e3d7a9 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-09 16:12
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
f... | 50.705882 | 266 | 0.638631 |
8fd171ca423246a0df0dfd6d9ed272007078e831 | 118 | py | Python | polyaxon/tracker/apps.py | wbuchwalter/polyaxon | a01396ea86a74082c457bfbc2c91d283b6ff6fba | [
"MIT"
] | null | null | null | polyaxon/tracker/apps.py | wbuchwalter/polyaxon | a01396ea86a74082c457bfbc2c91d283b6ff6fba | [
"MIT"
] | null | null | null | polyaxon/tracker/apps.py | wbuchwalter/polyaxon | a01396ea86a74082c457bfbc2c91d283b6ff6fba | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class TrackerConfig(AppConfig):
name = 'tracker'
verbose_name = 'tracker'
| 16.857143 | 33 | 0.728814 |
b76e977f094cbd872baafba3e8879b680e1824d9 | 3,095 | py | Python | gae_app/lib/flask_admin/tests/sqlamodel/test_inlineform.py | dcifuen/gentlemeet | a1209247de7af5f09723323ab8925e0e3b50bbe1 | [
"Apache-2.0"
] | 1 | 2015-03-27T21:57:40.000Z | 2015-03-27T21:57:40.000Z | gae_app/lib/flask_admin/tests/sqlamodel/test_inlineform.py | dcifuen/gentlemeet | a1209247de7af5f09723323ab8925e0e3b50bbe1 | [
"Apache-2.0"
] | null | null | null | gae_app/lib/flask_admin/tests/sqlamodel/test_inlineform.py | dcifuen/gentlemeet | a1209247de7af5f09723323ab8925e0e3b50bbe1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from nose.tools import eq_, ok_, raises
from wtforms import fields
from flask.ext.admin.contrib.sqla import ModelView
from flask.ext.admin.contrib.sqla.fields import InlineModelFormList
from . import setup
def test_inline_form():
app, db, admin = setup()
client = app.test_client()
... | 32.239583 | 114 | 0.616155 |
cb6b58abf8cc25c4c947b577f9076746c7f45fa9 | 335 | py | Python | pyqt_comic_viewer/bookmarkAction.py | yjg30737/pyqt-comic-viewer | 03f881ccd3e26ed82f03c18f84edc51fcbb21e14 | [
"MIT"
] | null | null | null | pyqt_comic_viewer/bookmarkAction.py | yjg30737/pyqt-comic-viewer | 03f881ccd3e26ed82f03c18f84edc51fcbb21e14 | [
"MIT"
] | null | null | null | pyqt_comic_viewer/bookmarkAction.py | yjg30737/pyqt-comic-viewer | 03f881ccd3e26ed82f03c18f84edc51fcbb21e14 | [
"MIT"
] | null | null | null | from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QAction
class BookmarkAction(QAction):
clicked = pyqtSignal(QAction)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.triggered.connect(self.__sendClicked)
def __sendClicked(self):
self.cli... | 25.769231 | 50 | 0.704478 |
4e1b85fa5c8ddf938b5d5ed74d2f8ce96d6be6a5 | 1,852 | py | Python | utils/util.py | terenceylchow124/Meme-MultiModal | 114ff75e18685476aba2c67720124a348bc00dde | [
"MIT"
] | 6 | 2021-07-15T03:32:11.000Z | 2022-02-07T11:28:42.000Z | utils/util.py | terenceylchow124/Meme-MultiModal | 114ff75e18685476aba2c67720124a348bc00dde | [
"MIT"
] | null | null | null | utils/util.py | terenceylchow124/Meme-MultiModal | 114ff75e18685476aba2c67720124a348bc00dde | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 28 20:30:31 2021
@author: ASUS
"""
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import precision_recall_fscore_support
from sklearn.metrics import accuracy_score, f1_score, recall_score, preci... | 31.389831 | 84 | 0.665227 |
0bb57084328d61b4438eaeb0ab34760d41cdb19c | 433 | py | Python | setup.py | star-baba/res50_sa_ssd | c7c0f218307b50e7ac1fd8945868df01f1743467 | [
"MIT"
] | 1 | 2020-06-16T12:53:25.000Z | 2020-06-16T12:53:25.000Z | setup.py | star-baba/res50_sa_ssd | c7c0f218307b50e7ac1fd8945868df01f1743467 | [
"MIT"
] | 3 | 2020-06-06T02:00:34.000Z | 2020-06-23T16:38:25.000Z | setup.py | star-baba/res50_sa_ssd | c7c0f218307b50e7ac1fd8945868df01f1743467 | [
"MIT"
] | 1 | 2021-04-27T06:40:21.000Z | 2021-04-27T06:40:21.000Z | from distutils.core import setup
setup(
name='pytorch_SSD',
version='0.0.2',
packages=['ssd', 'ssd.core', 'ssd.core.boxes', 'ssd.train', 'ssd.models', 'ssd_data', 'ssd_data.datasets',
'ssd_data.augmentations'],
url='https://github.com/jjjkkkjjj/pytorch_SSD',
license='MIT',
author=... | 30.928571 | 110 | 0.660508 |
83c03ce326f6728c6bf83238d3e1a1f11f86c9c4 | 2,352 | py | Python | KnowledgeQuizTool/MillionHeroes/test/hero.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | KnowledgeQuizTool/MillionHeroes/test/hero.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | 68 | 2020-09-05T04:22:49.000Z | 2022-03-25T18:47:08.000Z | KnowledgeQuizTool/MillionHeroes/test/hero.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | import urllib.request, sys,base64,json,os,time,string,re
from PIL import Image
from aip import AipOcr
from aitext import Ai
start = time.time()
os.system("adb shell /system/bin/screencap -p /sdcard/screenshot.png")
os.system("adb pull /sdcard/screenshot.png ./screenshot.png")
'''
汉王ocr 涨价涨价了。。
host = 'http://text.ali... | 24.757895 | 127 | 0.64966 |
c21ad5e0f82f9f58855c24ceb46954a8e9bfbce5 | 1,084 | py | Python | rlexperiments/common/tf_util.py | asprenger/rl-experiments | 738794b0c8f1151fd973a502bc3e512be7ec1213 | [
"MIT"
] | 6 | 2018-05-01T14:37:56.000Z | 2021-08-19T09:24:03.000Z | rlexperiments/common/tf_util.py | asprenger/rl-experiments | 738794b0c8f1151fd973a502bc3e512be7ec1213 | [
"MIT"
] | null | null | null | rlexperiments/common/tf_util.py | asprenger/rl-experiments | 738794b0c8f1151fd973a502bc3e512be7ec1213 | [
"MIT"
] | null | null | null | import os
import sys
import multiprocessing
import numpy as np
import tensorflow as tf
def create_session(cuda_visible_devices='0', gpu_memory_fraction=0.5):
ncpu = multiprocessing.cpu_count()
if sys.platform == 'darwin': ncpu //= 2
os.environ["CUDA_VISIBLE_DEVICES"] = cuda_visible_devices
config = tf.... | 36.133333 | 76 | 0.675277 |
b7a5348b4f9c0e8a14d799a07c87575c0ff47697 | 6,929 | py | Python | arcade/examples/sprite_move_scrolling_box.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | arcade/examples/sprite_move_scrolling_box.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | arcade/examples/sprite_move_scrolling_box.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | """
Scroll around a large screen.
Artwork from https://kenney.nl
If Python and Arcade are installed, this example can be run from the command line with:
python -m arcade.examples.sprite_move_scrolling
"""
import random
import arcade
SPRITE_SCALING = 0.5
DEFAULT_SCREEN_WIDTH = 800
DEFAULT_SCREEN_HEIGHT = 600
SCREEN... | 33.47343 | 119 | 0.640208 |
497c54322558d88356de30f8b3c2af5ebe60417f | 29 | py | Python | adminarea/views/__init__.py | eieste/SSHock | 04bcbb2593e104c0ecb1b5dc9b79b19b4681c96b | [
"MIT"
] | null | null | null | adminarea/views/__init__.py | eieste/SSHock | 04bcbb2593e104c0ecb1b5dc9b79b19b4681c96b | [
"MIT"
] | 2 | 2019-12-13T08:06:34.000Z | 2020-06-05T19:46:47.000Z | adminarea/views/__init__.py | eieste/SSHock | 04bcbb2593e104c0ecb1b5dc9b79b19b4681c96b | [
"MIT"
] | null | null | null | from .appintegration import * | 29 | 29 | 0.827586 |
3ea34dcaf17f778afab2751d18dac7ffc6805e3b | 2,506 | py | Python | tests/test_queryobjs.py | salesforce/python-argusclient | fae816e3356ec258948873948d94d2683e935592 | [
"BSD-3-Clause"
] | 16 | 2017-03-21T06:56:20.000Z | 2021-11-18T17:36:17.000Z | tests/test_queryobjs.py | salesforce/python-argusclient | fae816e3356ec258948873948d94d2683e935592 | [
"BSD-3-Clause"
] | 34 | 2016-12-02T16:40:52.000Z | 2021-09-30T13:27:49.000Z | tests/test_queryobjs.py | salesforce/python-argusclient | fae816e3356ec258948873948d94d2683e935592 | [
"BSD-3-Clause"
] | 36 | 2016-11-22T10:05:28.000Z | 2021-11-18T17:36:23.000Z | #
# Copyright (c) 2016, salesforce.com, inc.
# All rights reserved.
# Licensed under the BSD 3-Clause license.
# For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
import unittest
from argusclient import *
scope = "test.scope"
metric = "test.metric"
aggre... | 45.563636 | 193 | 0.743815 |
f3096b5b6b2b56421c1854ebe77a4a88ce21e145 | 4,976 | py | Python | chapter4/noise_simulation7.py | 443ki/ProRob_Code | e63df939dfffc84c63dff5bf3726aecec635770a | [
"MIT"
] | null | null | null | chapter4/noise_simulation7.py | 443ki/ProRob_Code | e63df939dfffc84c63dff5bf3726aecec635770a | [
"MIT"
] | null | null | null | chapter4/noise_simulation7.py | 443ki/ProRob_Code | e63df939dfffc84c63dff5bf3726aecec635770a | [
"MIT"
] | null | null | null | import sys
sys.path.append('../scripts/')
from ideal_robot import *
from scipy.stats import expon, norm, uniform # exporn:指数分布,norm:ガウス分布, uniform:一様分布
# In[]:
class Robot(IdealRobot): # クラスの継承
def __init__(self, pose, agent=None, sensor=None, color="black", \
noise_per_meter=5, noise_std=math.pi/6... | 35.29078 | 107 | 0.623392 |
b4823d3cada6844e3e4a00153ef2003792e27244 | 7,580 | py | Python | setup.py | g1n0st/taichi | 1ecca41e8b4a03af5b3da2d068b8cb6d79395524 | [
"MIT"
] | 2 | 2021-05-03T12:59:01.000Z | 2021-11-22T04:30:28.000Z | setup.py | g1n0st/taichi | 1ecca41e8b4a03af5b3da2d068b8cb6d79395524 | [
"MIT"
] | null | null | null | setup.py | g1n0st/taichi | 1ecca41e8b4a03af5b3da2d068b8cb6d79395524 | [
"MIT"
] | null | null | null | import glob
import multiprocessing
import os
import platform
import shutil
import subprocess
import sys
from setuptools import Extension, find_packages, setup
from setuptools.command.build_ext import build_ext
from setuptools.command.build_py import build_py
from setuptools.command.egg_info import egg_info
classifier... | 35.092593 | 79 | 0.618865 |
8355c4c2599ff44f1b53b01b7e1091484630aa2c | 115,846 | py | Python | pymatgen/analysis/gb/grain.py | munrojm/pymatgen | 95514da2c1f4bd0ee897e657de768ca987fe05e9 | [
"MIT"
] | null | null | null | pymatgen/analysis/gb/grain.py | munrojm/pymatgen | 95514da2c1f4bd0ee897e657de768ca987fe05e9 | [
"MIT"
] | 3 | 2021-11-11T16:01:44.000Z | 2021-11-24T22:24:18.000Z | pymatgen/analysis/gb/grain.py | munrojm/pymatgen | 95514da2c1f4bd0ee897e657de768ca987fe05e9 | [
"MIT"
] | null | null | null | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Module containing classes to generate grain boundaries.
"""
import itertools
import logging
import warnings
from fractions import Fraction
from functools import reduce
from math import cos, floor, gcd
imp... | 47.130187 | 120 | 0.473076 |
5c13d85b61ad8765d57fe0eb6f69c42c5885aa7e | 1,430 | py | Python | pipeline/validators/base.py | zfj1998/bk-sops | d3f7feb1009d68d0858941996a48e2d689917949 | [
"Apache-2.0"
] | 1 | 2019-12-23T07:23:35.000Z | 2019-12-23T07:23:35.000Z | pipeline/validators/base.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 9 | 2020-02-12T03:15:49.000Z | 2021-06-10T22:04:51.000Z | pipeline/validators/base.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 1 | 2022-01-17T11:32:05.000Z | 2022-01-17T11:32:05.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 37.631579 | 115 | 0.772727 |
4e2323d0a0e6607bbc3283a5f761758a86b2eccc | 24,625 | py | Python | sdk/python/pulumi_azure_native/storage/v20160501/storage_account.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storage/v20160501/storage_account.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storage/v20160501/storage_account.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"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... | 54.240088 | 2,369 | 0.680406 |
afc87fe88fde09972ec9bfec8d9dc279e2f65467 | 40,345 | py | Python | rpython/rtyper/test/test_rstr.py | wdv4758h/mu-client-pypy | d2fcc01f0b4fe3ffa232762124e3e6d38ed3a0cf | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | rpython/rtyper/test/test_rstr.py | wdv4758h/mu-client-pypy | d2fcc01f0b4fe3ffa232762124e3e6d38ed3a0cf | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | rpython/rtyper/test/test_rstr.py | wdv4758h/mu-client-pypy | d2fcc01f0b4fe3ffa232762124e3e6d38ed3a0cf | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | import random
import py
from rpython.flowspace.model import summary
from rpython.annotator.model import AnnotatorError
from rpython.rtyper.lltypesystem.lltype import typeOf, Signed, malloc
from rpython.rtyper.lltypesystem.rstr import LLHelpers, STR
from rpython.rtyper.rstr import AbstractLLHelpers
from rpython.rtyper... | 33.287954 | 188 | 0.468856 |
ae8560297f07d380c3c8150e0b41af6cf4cf0eec | 12,969 | py | Python | polls/api/views.py | PrashanthBubby/new | 753cb8916e1eede0513550b14339c9bd81e18976 | [
"MIT"
] | null | null | null | polls/api/views.py | PrashanthBubby/new | 753cb8916e1eede0513550b14339c9bd81e18976 | [
"MIT"
] | null | null | null | polls/api/views.py | PrashanthBubby/new | 753cb8916e1eede0513550b14339c9bd81e18976 | [
"MIT"
] | null | null | null | from rest_framework.generics import (ListAPIView,
CreateAPIView,
UpdateAPIView,
RetrieveAPIView,
RetrieveUpdateAPIView,
)
from polls.mo... | 41.302548 | 148 | 0.695273 |
da4b6e73482b4545662b88723d2d689e22aacbe8 | 3,110 | py | Python | Code/Base/py-askap/current/askap/coordinates.py | rtobar/askapsoft | 6bae06071d7d24f41abe3f2b7f9ee06cb0a9445e | [
"BSL-1.0",
"Apache-2.0",
"OpenSSL"
] | 1 | 2020-06-18T08:37:43.000Z | 2020-06-18T08:37:43.000Z | Code/Base/py-askap/current/askap/coordinates.py | ATNF/askapsoft | d839c052d5c62ad8a511e58cd4b6548491a6006f | [
"BSL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | Code/Base/py-askap/current/askap/coordinates.py | ATNF/askapsoft | d839c052d5c62ad8a511e58cd4b6548491a6006f | [
"BSL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | # Copyright (c) 2017 CSIRO
# Australia Telescope National Facility (ATNF)
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# PO Box 76, Epping NSW 1710, Australia
# atnf-enquiries@csiro.au
#
# This file is part of the ASKAP software distribution.
#
# The ASKAP software distribution is free softwar... | 27.767857 | 76 | 0.634084 |
5cc712a32329923e5d1e9ff08a7294f7f7400f92 | 98 | py | Python | weworkbot/__init__.py | MakDon/we-work-bot | 086a7c270d332a71237d77135e89f0d3265d5a0a | [
"MIT"
] | 34 | 2019-07-27T13:47:09.000Z | 2022-03-17T15:03:03.000Z | weworkbot/__init__.py | MakDon/we-work-bot | 086a7c270d332a71237d77135e89f0d3265d5a0a | [
"MIT"
] | 2 | 2019-09-29T14:52:13.000Z | 2021-01-25T14:29:42.000Z | weworkbot/__init__.py | MakDon/we-work-bot | 086a7c270d332a71237d77135e89f0d3265d5a0a | [
"MIT"
] | 8 | 2020-02-09T07:56:53.000Z | 2022-01-29T01:44:06.000Z | from .bot_mgr import bot_mgr
from .bot_mgr import BotMgr
from .bot import Bot
name = 'weworkbot'
| 16.333333 | 28 | 0.77551 |
9d7f442d29b677cd2e8be7c70715764df2362bf7 | 6,028 | py | Python | trac/web/tests/href.py | NetSpida/trac | 6ad75b926591e114ba504f6a72a38fd305d77fb1 | [
"BSD-3-Clause"
] | null | null | null | trac/web/tests/href.py | NetSpida/trac | 6ad75b926591e114ba504f6a72a38fd305d77fb1 | [
"BSD-3-Clause"
] | null | null | null | trac/web/tests/href.py | NetSpida/trac | 6ad75b926591e114ba504f6a72a38fd305d77fb1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2013 Edgewall Software
# Copyright (C) 2005-2007 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://... | 45.323308 | 87 | 0.577306 |
9a41c7df307acc710dca5d79f682191c785aa9dd | 168 | py | Python | projects/views.py | bpomerenke/heroku_django_poc | 68569436c0d335dd7afe22c82eba44be12f7697f | [
"MIT"
] | null | null | null | projects/views.py | bpomerenke/heroku_django_poc | 68569436c0d335dd7afe22c82eba44be12f7697f | [
"MIT"
] | null | null | null | projects/views.py | bpomerenke/heroku_django_poc | 68569436c0d335dd7afe22c82eba44be12f7697f | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the projects index.") | 33.6 | 70 | 0.767857 |
fa283a1decc3b9d77e354c85fd13d191828d6f84 | 6,243 | py | Python | src/python3/request/posts_collection.py | microsoftarchive/msgraph-sdk-python | 1320ba9116be0d00a1d7fce3484ea979e24ee82d | [
"MIT"
] | 7 | 2019-07-17T06:59:53.000Z | 2021-05-13T15:23:37.000Z | src/python3/request/posts_collection.py | microsoftarchive/msgraph-sdk-python | 1320ba9116be0d00a1d7fce3484ea979e24ee82d | [
"MIT"
] | null | null | null | src/python3/request/posts_collection.py | microsoftarchive/msgraph-sdk-python | 1320ba9116be0d00a1d7fce3484ea979e24ee82d | [
"MIT"
] | 2 | 2020-06-30T13:06:59.000Z | 2021-06-03T09:47:35.000Z | # -*- coding: utf-8 -*-
"""
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#
# This file was generated and any changes will be overwritten.
"""
from __future__ import unicode_literals
from ..collection_base impo... | 37.608434 | 151 | 0.644722 |
e908805a532a8def0ad2a98f2dbdd08163062f81 | 4,342 | py | Python | examples/plot_matching_imbalanced_classes.py | atong01/unbalanced_gromov_wasserstein | 7675d8512d81007cc29e7564f1f6784d81f39740 | [
"MIT"
] | 1 | 2020-09-11T02:05:11.000Z | 2020-09-11T02:05:11.000Z | examples/plot_matching_imbalanced_classes.py | dpduanpu/unbalanced_gromov_wasserstein | 8f37685e801ae65bda9fc421070b92e414bc2980 | [
"MIT"
] | null | null | null | examples/plot_matching_imbalanced_classes.py | dpduanpu/unbalanced_gromov_wasserstein | 8f37685e801ae65bda9fc421070b92e414bc2980 | [
"MIT"
] | null | null | null | import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
import torch
from sklearn.cluster import KMeans
from solver.utils_numpy import euclid_dist
from ot.gromov import gromov_wasserstein
from solver.tlb_kl_sinkhorn_solver import TLBSinkhornSolver
path = os.getcwd() + "/output... | 34.460317 | 118 | 0.551589 |
eb4e7e906ee39fbeb4c1cb72e5513956c6983422 | 18,671 | py | Python | tests/unit/test_sns_listener.py | texxIO/localstack | 7d4a7f80a8b06df1d562d2a0bbaa33a508681803 | [
"Apache-2.0"
] | 1 | 2020-02-10T22:11:38.000Z | 2020-02-10T22:11:38.000Z | tests/unit/test_sns_listener.py | texxIO/localstack | 7d4a7f80a8b06df1d562d2a0bbaa33a508681803 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_sns_listener.py | texxIO/localstack | 7d4a7f80a8b06df1d562d2a0bbaa33a508681803 | [
"Apache-2.0"
] | 1 | 2019-10-08T06:52:46.000Z | 2019-10-08T06:52:46.000Z | import json
import uuid
import unittest
import dateutil.parser
from localstack.services.sns import sns_listener
class SNSTests(unittest.TestCase):
def setUp(self):
self.subscriber = {
'Protocol': 'sqs',
'RawMessageDelivery': 'false',
'TopicArn': 'arn',
}
... | 38.897917 | 110 | 0.453805 |
5cc07869be87761df4f83c3e323b9cb877877988 | 120 | py | Python | mathmodel/quant/__init__.py | h-WAVES/Mathmodel | 4f099d9c7ee170d4cbd841fd865b8d227fa89705 | [
"MIT"
] | 1 | 2021-03-18T03:56:37.000Z | 2021-03-18T03:56:37.000Z | mathmodel/quant/__init__.py | h-WAVES/Mathmodel | 4f099d9c7ee170d4cbd841fd865b8d227fa89705 | [
"MIT"
] | 1 | 2021-03-19T12:51:02.000Z | 2021-03-19T12:51:02.000Z | mathmodel/quant/__init__.py | h-WAVES/Mathmodel | 4f099d9c7ee170d4cbd841fd865b8d227fa89705 | [
"MIT"
] | null | null | null | from .cost_calculation import *
__all__ = ['is_five',
'b_cost',
's_cost',
'get_cost']
| 17.142857 | 31 | 0.5 |
0e35d3d01013537adac1ed5c1ee17ad05c828b8e | 1,763 | py | Python | toolkit/molecular_bands.py | bmorris3/freckles | 057a23b34d760b712c26b47e8734312243639e78 | [
"MIT"
] | 1 | 2021-09-03T15:19:23.000Z | 2021-09-03T15:19:23.000Z | toolkit/molecular_bands.py | bmorris3/freckles | 057a23b34d760b712c26b47e8734312243639e78 | [
"MIT"
] | null | null | null | toolkit/molecular_bands.py | bmorris3/freckles | 057a23b34d760b712c26b47e8734312243639e78 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import astropy.units as u
__all__ = ['Band', 'bands_TiO', 'bands_off_TiO', 'bands_balmer']
class Band(object):
"""Fitting metadata on molecular absorption bands"""
def __init__(self, core, min, max):... | 40.068182 | 90 | 0.620533 |
9d4ffe87aa4d26678981ba4990a3627feffa3b05 | 798 | py | Python | day2/part2/get_required_amount_of_ribbon.py | willienel/advent-of-code-2015 | 229d97bde2115d8339f1fb236e5016748673a0e7 | [
"Apache-2.0"
] | null | null | null | day2/part2/get_required_amount_of_ribbon.py | willienel/advent-of-code-2015 | 229d97bde2115d8339f1fb236e5016748673a0e7 | [
"Apache-2.0"
] | null | null | null | day2/part2/get_required_amount_of_ribbon.py | willienel/advent-of-code-2015 | 229d97bde2115d8339f1fb236e5016748673a0e7 | [
"Apache-2.0"
] | null | null | null | import os
def get_required_amount_of_ribbon(dimensions):
required_amount_of_ribbon = 0
for dimension in dimensions:
length, width, height = dimension
shortest_side, second_shortest_side = sorted([length, width, height])[:2]
present_amount_required = shortest_side * 2 + second_shor... | 24.9375 | 85 | 0.691729 |
fef8f8fad164ed8808a7ed832c24e4847a6bcae9 | 391 | py | Python | img_app/asgi.py | Irina-Nazarova/Service_for_upload_images | fcbcfca15e53a3f416f8ca61e2dc21326a32a8d8 | [
"MIT"
] | null | null | null | img_app/asgi.py | Irina-Nazarova/Service_for_upload_images | fcbcfca15e53a3f416f8ca61e2dc21326a32a8d8 | [
"MIT"
] | null | null | null | img_app/asgi.py | Irina-Nazarova/Service_for_upload_images | fcbcfca15e53a3f416f8ca61e2dc21326a32a8d8 | [
"MIT"
] | null | null | null | """
ASGI config for img_app project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault("DJANGO_SETTI... | 23 | 78 | 0.785166 |
b83e3260f86fc5c3e9ed9dcd5c503844829356a4 | 5,030 | py | Python | nuitka/nodes/ContainerOperationNodes.py | jayvdb/Nuitka | 0ff702e065b1b53231ba0cae451385a3da0fe766 | [
"Apache-2.0"
] | 1 | 2019-03-31T09:56:11.000Z | 2019-03-31T09:56:11.000Z | nuitka/nodes/ContainerOperationNodes.py | jayvdb/Nuitka | 0ff702e065b1b53231ba0cae451385a3da0fe766 | [
"Apache-2.0"
] | null | null | null | nuitka/nodes/ContainerOperationNodes.py | jayvdb/Nuitka | 0ff702e065b1b53231ba0cae451385a3da0fe766 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 33.986486 | 87 | 0.722664 |
7bda85c2cf09569deec2df22ac5322229a2c7133 | 9,032 | py | Python | tutorials/install/turtlesim/lib/python3.8/site-packages/turtlesim/srv/_kill.py | cclehui/study_ros | ecf7c258b561c4e6d6359471519e318c2ef888ae | [
"MIT"
] | 3 | 2021-08-20T03:25:37.000Z | 2022-03-31T02:47:28.000Z | tutorials/install/turtlesim/lib/python3.8/site-packages/turtlesim/srv/_kill.py | cclehui/study_ros | ecf7c258b561c4e6d6359471519e318c2ef888ae | [
"MIT"
] | null | null | null | tutorials/install/turtlesim/lib/python3.8/site-packages/turtlesim/srv/_kill.py | cclehui/study_ros | ecf7c258b561c4e6d6359471519e318c2ef888ae | [
"MIT"
] | null | null | null | # generated from rosidl_generator_py/resource/_idl.py.em
# with input from turtlesim:srv/Kill.idl
# generated code does not contain a copyright notice
# Import statements for member types
import rosidl_parser.definition # noqa: E402, I100
class Metaclass_Kill_Request(type):
"""Metaclass of message 'Kill_Reque... | 34.738462 | 134 | 0.610496 |
29458766909b66ac3d5166718188e2d977c2f4e6 | 160 | py | Python | spiderBasic/urllibTest/requestTest/requestTest.py | turoDog/LearningPython | 8e87e1a6926e2d6d7f131fbadaf63a03e2aa41cd | [
"Apache-2.0"
] | 2 | 2018-07-11T02:13:44.000Z | 2019-04-06T02:41:44.000Z | spiderBasic/urllibTest/requestTest/requestTest.py | turoDog/LearningPython | 8e87e1a6926e2d6d7f131fbadaf63a03e2aa41cd | [
"Apache-2.0"
] | null | null | null | spiderBasic/urllibTest/requestTest/requestTest.py | turoDog/LearningPython | 8e87e1a6926e2d6d7f131fbadaf63a03e2aa41cd | [
"Apache-2.0"
] | null | null | null | import urllib.request
request = urllib.request.Request('https://python.org')
response = urllib.request.urlopen(request)
print(response.read().decode('utf-8'))
| 26.666667 | 54 | 0.7625 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.