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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f40fb601a6e75fde5ab7ce766c16c7c8d4a65f72 | 403 | py | Python | cng.py | divine-coder/CODECHEF-PYTHON | a1e34d6f9f75cf7b9497f1ef2f937cb4f64f1543 | [
"MIT"
] | null | null | null | cng.py | divine-coder/CODECHEF-PYTHON | a1e34d6f9f75cf7b9497f1ef2f937cb4f64f1543 | [
"MIT"
] | 4 | 2020-10-04T07:49:30.000Z | 2021-10-02T05:24:40.000Z | cng.py | divine-coder/CODECHEF-PYTHON | a1e34d6f9f75cf7b9497f1ef2f937cb4f64f1543 | [
"MIT"
] | 7 | 2020-10-04T07:46:55.000Z | 2021-11-05T14:30:00.000Z | def y(a,b,n):
if n==0:
return True
if n<0:
return False
return y(a,b,n-a) or y(a,b,n-b)
import sys
if __name__=='__main__':
t=int(sys.stdin.readline())
for i in range(t):
a,b=sys.stdin.readline().split()
a=int(a)
b=int(b)
p=(a*b)-1
while p>0:
if not y(a... | 19.190476 | 40 | 0.444169 |
7a2e4c7622b367ab597bd0565522d82d5809786a | 8,075 | py | Python | slo_generator/utils.py | guden/slo-generator | cdc9cb155e608bc5949cf8a20226041570062071 | [
"Apache-2.0"
] | null | null | null | slo_generator/utils.py | guden/slo-generator | cdc9cb155e608bc5949cf8a20226041570062071 | [
"Apache-2.0"
] | null | null | null | slo_generator/utils.py | guden/slo-generator | cdc9cb155e608bc5949cf8a20226041570062071 | [
"Apache-2.0"
] | 1 | 2020-10-08T16:30:04.000Z | 2020-10-08T16:30:04.000Z | # Copyright 2019 Google 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
#
# Unless required by applicable law or agreed to in wr... | 27.941176 | 79 | 0.626625 |
46d0cc532de0cd72dbcd140bbc5855e9240571ee | 5,586 | py | Python | tests/unit/states/test_lvm.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | null | null | null | tests/unit/states/test_lvm.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | null | null | null | tests/unit/states/test_lvm.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import skipIf, TestCase
from tests.support.mock import (
... | 31.738636 | 76 | 0.555138 |
d5d8798affc3dcd78411423f9a1dfcc98513c78e | 6,355 | py | Python | napari/_vispy/layers/points.py | Mishrasubha/napari | c4d1038fc3ed30dc228949cbdedf12826ec2efc2 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/layers/points.py | Mishrasubha/napari | c4d1038fc3ed30dc228949cbdedf12826ec2efc2 | [
"BSD-3-Clause"
] | 1 | 2022-03-22T10:57:53.000Z | 2022-03-22T18:19:23.000Z | napari/_vispy/layers/points.py | Mishrasubha/napari | c4d1038fc3ed30dc228949cbdedf12826ec2efc2 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from ...settings import get_settings
from ...utils.colormaps.standardize_color import transform_color
from ...utils.events import disconnect_events
from ..utils.gl import BLENDING_MODES
from ..utils.text import update_text
from ..visuals.points import PointsVisual
from .base import VispyBaseLayer
... | 34.917582 | 79 | 0.601574 |
5cb21b5102c434e9cfa57952769971c98655b537 | 24,124 | py | Python | certbot/certbot/crypto_util.py | qyl2021/certbot | 60a91eb688ab3329dcc8af17cedd5921c887c0ea | [
"Apache-2.0"
] | 1 | 2021-06-24T21:44:22.000Z | 2021-06-24T21:44:22.000Z | certbot/certbot/crypto_util.py | qyl2021/certbot | 60a91eb688ab3329dcc8af17cedd5921c887c0ea | [
"Apache-2.0"
] | null | null | null | certbot/certbot/crypto_util.py | qyl2021/certbot | 60a91eb688ab3329dcc8af17cedd5921c887c0ea | [
"Apache-2.0"
] | null | null | null | """Certbot client crypto utility functions.
.. todo:: Make the transition to use PSS rather than PKCS1_v1_5 when the server
is capable of handling the signatures.
"""
import hashlib
import logging
import re
import warnings
from typing import List, Set
# See https://github.com/pyca/cryptography/issues/4275
from c... | 35.792285 | 95 | 0.689562 |
50d1a25fa7ed9417c295459c38ce6316a16d0c8c | 857 | py | Python | scripts/05_modules/mograph/set_modata_weights_r18.py | youdiaozi/cinema4d_py_sdk_extended | 2ac9af05d450bda3351c776a3a75e0993c01a5cc | [
"Apache-2.0"
] | 1 | 2019-12-27T13:53:18.000Z | 2019-12-27T13:53:18.000Z | scripts/05_modules/mograph/set_modata_weights_r18.py | ZeusbasePython/cinema4d_py_sdk_extended | 2ac9af05d450bda3351c776a3a75e0993c01a5cc | [
"Apache-2.0"
] | null | null | null | scripts/05_modules/mograph/set_modata_weights_r18.py | ZeusbasePython/cinema4d_py_sdk_extended | 2ac9af05d450bda3351c776a3a75e0993c01a5cc | [
"Apache-2.0"
] | 1 | 2020-01-28T15:16:28.000Z | 2020-01-28T15:16:28.000Z | """
Copyright: MAXON Computer GmbH
Description:
- Sets a weight of 1.0 for all clones of the active Cloner object.
Class/method highlighted:
- c4d.modules.mograph.GeSetMoDataWeights()
Compatible:
- Win / Mac
- R18, R19, R20, R21
"""
import c4d
def main():
# Checks if there is an active object
... | 23.162162 | 74 | 0.679113 |
1527eb815a403c1a4957c207f417db4987149426 | 654 | py | Python | config.py | XSLiuLab/pypresent | 5b04d729d89538cca41756e03dbdb8ac6c5b3ba7 | [
"MIT"
] | null | null | null | config.py | XSLiuLab/pypresent | 5b04d729d89538cca41756e03dbdb8ac6c5b3ba7 | [
"MIT"
] | null | null | null | config.py | XSLiuLab/pypresent | 5b04d729d89538cca41756e03dbdb8ac6c5b3ba7 | [
"MIT"
] | null | null | null | import os
from pprint import pprint
# Update these paths according to your netMHCpan/netMHCIIpan downloads
NETMHCPAN40_PATH = '/public/tools/netMHC/netMHCpan-4.0/netMHCpan'
NETMHCIIPAN32_PATH = '/public/tools/netMHC/netMHCIIpan-3.2/netMHCIIpan'
# Update based on your desired tmp directory
TEMP_DIR = '/home/wsx/tmp/ne... | 23.357143 | 71 | 0.737003 |
6c39ee32f290cc77e15dbb926273359db840b32e | 1,751 | py | Python | tools/export_tflite.py | unverbraucht/tensorflow-open_nsfw | b5d9b4f7ce507ffd73ef376bc1f929fb424da242 | [
"BSD-2-Clause"
] | null | null | null | tools/export_tflite.py | unverbraucht/tensorflow-open_nsfw | b5d9b4f7ce507ffd73ef376bc1f929fb424da242 | [
"BSD-2-Clause"
] | null | null | null | tools/export_tflite.py | unverbraucht/tensorflow-open_nsfw | b5d9b4f7ce507ffd73ef376bc1f929fb424da242 | [
"BSD-2-Clause"
] | null | null | null | import os
import sys
import argparse
import tensorflow as tf
sys.path.append((os.path.normpath(
os.path.join(os.path.dirname(os.path.realpath(__file__)),
'..'))))
from model import OpenNsfwModel, InputType
"""Exports a tflite version of tensorflow-open_nsfw
Note: The ... | 35.02 | 155 | 0.64763 |
dbbfe2858dda5f0552950a0a3c0ae3e59ad0ff73 | 892 | py | Python | src/spyd/game/client/exceptions.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | 4 | 2015-05-05T16:44:42.000Z | 2020-10-27T09:45:23.000Z | src/spyd/game/client/exceptions.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | null | null | null | src/spyd/game/client/exceptions.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | 2 | 2016-12-13T22:21:08.000Z | 2020-03-14T16:44:20.000Z | from spyd.game.server_message_formatter import smf
class InvalidPlayerNumberReference(Exception): pass
class GenericError(Exception):
def __init__(self, message_fmt, *fmt_args, **fmt_kwargs):
self.message = smf.vformat(message_fmt, fmt_args, fmt_kwargs)
class StateError(GenericError): pass
class UsageErr... | 37.166667 | 75 | 0.674888 |
2df6f7a4129f8f07ed518d0093874fbbba080a90 | 116 | py | Python | yatube/context_processors.py | qoukka/hw05_final | f234514034c513e37035674fcd6b629f873b4b6b | [
"MIT"
] | null | null | null | yatube/context_processors.py | qoukka/hw05_final | f234514034c513e37035674fcd6b629f873b4b6b | [
"MIT"
] | 12 | 2021-03-19T13:16:24.000Z | 2022-03-12T00:52:03.000Z | yatube/context_processors.py | qoukka/hw05_final | f234514034c513e37035674fcd6b629f873b4b6b | [
"MIT"
] | null | null | null | import datetime as dt
def year(request):
now = dt.datetime.today()
return {
'year': now.year
} | 14.5 | 29 | 0.577586 |
be2c85b0a985b325b43a5da3d0a4b9c54dc06b0b | 3,212 | py | Python | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/delete_custom_policy_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/delete_custom_policy_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/delete_custom_policy_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DeleteCustomPolicyRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): ... | 28.175439 | 136 | 0.570672 |
f0b9f5ae0965e8df0e559cd53406b0b5a456fb30 | 1,884 | py | Python | classify/knn.py | lianghongh/AppClassify | cfec54b7b9f8c05cebf10bc8d108b74eaf2f5785 | [
"Apache-2.0"
] | null | null | null | classify/knn.py | lianghongh/AppClassify | cfec54b7b9f8c05cebf10bc8d108b74eaf2f5785 | [
"Apache-2.0"
] | null | null | null | classify/knn.py | lianghongh/AppClassify | cfec54b7b9f8c05cebf10bc8d108b74eaf2f5785 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklearn.cross_validation import cross_val_score
from matplotlib import pyplot as plt
def readData(path):
data=[]
tag_d={"SF":0,"SS":1,"IF":2,"IS":3,"IR":4}
benchmark=["bwaves","gamess","gromacs","hmmer","leslie3d","mcf","sjeng","as... | 35.54717 | 261 | 0.620488 |
efe9967ecfd550d7527964f1a551345d45a3a2d4 | 814 | py | Python | tests/test_decorators.py | sturmianseq/django-hug | 778b16f568ce9fdb01f360b7bff89c9d8b6c2ef7 | [
"MIT"
] | 3 | 2019-03-11T16:40:37.000Z | 2020-08-06T18:27:48.000Z | tests/test_decorators.py | sturmianseq/django-hug | 778b16f568ce9fdb01f360b7bff89c9d8b6c2ef7 | [
"MIT"
] | null | null | null | tests/test_decorators.py | sturmianseq/django-hug | 778b16f568ce9fdb01f360b7bff89c9d8b6c2ef7 | [
"MIT"
] | 1 | 2021-08-18T12:54:51.000Z | 2021-08-18T12:54:51.000Z | import djhug
from djhug.routes import Options
def test_req_resp_view_decorators():
@djhug.response.register_renderer
def resp_renderer(data):
return data
@djhug.request.register_parser
def req_parser(request):
return request.POST
@djhug.request.parser(req_parser)
@djhug.reque... | 27.133333 | 68 | 0.728501 |
8deed3aef45da9c0844e9193ab0026cec0c43943 | 446 | py | Python | app.py | brunogalletti/devopslab | dd8e0797a16efbad6abe60e782d9152aacda7ae6 | [
"MIT"
] | null | null | null | app.py | brunogalletti/devopslab | dd8e0797a16efbad6abe60e782d9152aacda7ae6 | [
"MIT"
] | null | null | null | app.py | brunogalletti/devopslab | dd8e0797a16efbad6abe60e782d9152aacda7ae6 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_wtf.csrf import CSRFProtect
import os
app = Flask(__name__)
csrf = CSRFProtect(app)
@app.route("/")
def pagina_inicial():
return "Hello World - Bruno Galle... | 29.733333 | 146 | 0.502242 |
9a5cdfdb6de1ddab9bd1623828173fc7f8bb202b | 12,932 | py | Python | txweb/btforms/__init__.py | talkincode/toughweb | dce6662bd5dede148a9518e80b6c9a504083c223 | [
"MIT"
] | 1 | 2016-05-03T07:53:42.000Z | 2016-05-03T07:53:42.000Z | txweb/btforms/__init__.py | talkincode/toughweb | dce6662bd5dede148a9518e80b6c9a504083c223 | [
"MIT"
] | null | null | null | txweb/btforms/__init__.py | talkincode/toughweb | dce6662bd5dede148a9518e80b6c9a504083c223 | [
"MIT"
] | null | null | null | #coding:utf-8
import sys,os
import copy
import re
import itertools
import net
"""basic from web.py: makes web apps (http://webpy.org)"""
__version__ = "0.37"
__author__ = [
"Aaron Swartz <me@aaronsw.com>",
"Anand Chitipothu <anandology@gmail.com>"
]
__license__ = "public domain"
__contributors__ = "see https:... | 29.324263 | 197 | 0.539592 |
0aa215294da50f51fe17bf55a3b6852d165359f2 | 779 | py | Python | docs/permissions_compiler/glossary.py | Karss7/iroha | 16dbbe6fb07a54b59eea9079e741617a2a44b7a4 | [
"Apache-2.0"
] | null | null | null | docs/permissions_compiler/glossary.py | Karss7/iroha | 16dbbe6fb07a54b59eea9079e741617a2a44b7a4 | [
"Apache-2.0"
] | 2 | 2020-02-18T11:25:35.000Z | 2020-02-20T04:09:45.000Z | docs/permissions_compiler/glossary.py | Karss7/iroha | 16dbbe6fb07a54b59eea9079e741617a2a44b7a4 | [
"Apache-2.0"
] | 1 | 2020-07-25T11:15:16.000Z | 2020-07-25T11:15:16.000Z | #
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
def read_titles(level_char='='):
headings = []
with open('concepts_architecture/glossary.rst') as gfile:
lines = gfile.readlines()
prevline = ''
prevlen = 0
for line in lines:
... | 27.821429 | 87 | 0.577664 |
da4febf635ddbce764171a4a649b6eddbcf3d593 | 4,631 | py | Python | tests/test_zopetestbrowser.py | kidosoft/splinter | 6d5052fd73c0a626299574cea76924e367c67faa | [
"BSD-3-Clause"
] | null | null | null | tests/test_zopetestbrowser.py | kidosoft/splinter | 6d5052fd73c0a626299574cea76924e367c67faa | [
"BSD-3-Clause"
] | null | null | null | tests/test_zopetestbrowser.py | kidosoft/splinter | 6d5052fd73c0a626299574cea76924e367c67faa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2013 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import os
import unittest
import sys
from splinter import Browser
from .base import BaseBrowserTests
from .fake_webapp import EXAMPLE_A... | 36.464567 | 95 | 0.655798 |
548a8e1e8fd17e74c602e78f81555d4c0794a124 | 4,640 | py | Python | mailchimp_marketing_asyncio/models/inline_response2009_site.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/inline_response2009_site.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/inline_response2009_site.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | 1 | 2022-03-09T14:52:22.000Z | 2022-03-09T14:52:22.000Z | # coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: apihelp@mailchimp.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import... | 26.666667 | 119 | 0.555172 |
8876cff29558e1665724342f923874feb02fbfc0 | 6,465 | py | Python | threathunter_common_python/threathunter_common/metrics/influxdbmetrics.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | 2 | 2019-03-17T04:03:08.000Z | 2019-05-01T09:42:23.000Z | threathunter_common_python/threathunter_common/metrics/influxdbmetrics.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | null | null | null | threathunter_common_python/threathunter_common/metrics/influxdbmetrics.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | 4 | 2019-06-24T05:47:24.000Z | 2020-09-29T05:00:31.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import urlparse
from influxdb.influxdb08 import InfluxDBClient
from influxdb import InfluxDBClient as InfluxDBClientNew
from threathunter_common.metrics.metrics import Metrics
from threathunter_common.util import utf8
__author__ = "... | 40.917722 | 172 | 0.58082 |
c336476bbfa841c43b2843f7dd3deb00033aa77b | 26,307 | py | Python | ml-agents/mlagents/trainers/models.py | IRiViI/ml-agents | 0895265360acb4fbb88ca9130d61f0fc349e6484 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/models.py | IRiViI/ml-agents | 0895265360acb4fbb88ca9130d61f0fc349e6484 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/models.py | IRiViI/ml-agents | 0895265360acb4fbb88ca9130d61f0fc349e6484 | [
"Apache-2.0"
] | null | null | null | import logging
from enum import Enum
from typing import Callable, List
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as c_layers
from mlagents.trainers.custom_layer_specs import CustomLayerSpecs, CustomConvLayerSpecs, CustomDenseLayerSpecs
from mlagents.trainers.trainer import UnityTrai... | 38.573314 | 115 | 0.567644 |
fa12ff5f760dd0c804df886ed25eac1d5e39352e | 3,529 | py | Python | app/recipe/views.py | apparanto/recipe-app-api | 7d742623bbdb6128b14e65523d064a2eb0380920 | [
"MIT"
] | null | null | null | app/recipe/views.py | apparanto/recipe-app-api | 7d742623bbdb6128b14e65523d064a2eb0380920 | [
"MIT"
] | null | null | null | app/recipe/views.py | apparanto/recipe-app-api | 7d742623bbdb6128b14e65523d064a2eb0380920 | [
"MIT"
] | null | null | null | from rest_framework import viewsets, mixins, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.decorators import action
from rest_framework.response import Response
from core.models import Tag, Ingredient, Recipe
from recipe ... | 35.29 | 77 | 0.673279 |
a3a0d54c306aaad7669ccd031ea9f1bf26540314 | 8,122 | py | Python | datasets/wikitext/wikitext.py | tongni1975/nlp | 378484960c660244896ed96886bc0ad08eccf90e | [
"Apache-2.0"
] | 2 | 2021-09-28T01:36:21.000Z | 2021-12-22T08:24:17.000Z | datasets/wikitext/wikitext.py | tongni1975/nlp | 378484960c660244896ed96886bc0ad08eccf90e | [
"Apache-2.0"
] | null | null | null | datasets/wikitext/wikitext.py | tongni1975/nlp | 378484960c660244896ed96886bc0ad08eccf90e | [
"Apache-2.0"
] | 1 | 2020-12-08T10:36:30.000Z | 2020-12-08T10:36:30.000Z | """TODO(wikitext): Add a description here."""
from __future__ import absolute_import, division, print_function
import os
import nlp
# TODO(wikitext): BibTeX citation
_CITATION = """\
@InProceedings{wikitext,
author={Stephen, Merity and Caiming ,Xiong and James, Bradbury and Richard Socher}
year={2016}
}
""... | 43.902703 | 125 | 0.518961 |
29901082cfe41a60c85794f2fffe009745ae2148 | 206 | py | Python | hknweb/markdown_pages/urls.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | 20 | 2018-01-07T02:15:43.000Z | 2021-09-15T04:25:50.000Z | hknweb/markdown_pages/urls.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | 292 | 2018-02-01T18:31:18.000Z | 2022-03-30T22:15:08.000Z | hknweb/markdown_pages/urls.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | 85 | 2017-11-13T06:33:13.000Z | 2022-03-30T20:32:55.000Z | from django.urls import path
from django.urls import re_path
from . import views
app_name = "pages"
urlpatterns = [
path("", views.editor),
re_path(r"^(?P<path>[\w\d\.\-_]+)/", views.display),
]
| 17.166667 | 56 | 0.645631 |
03682197f1aedf6639e0dd77a863c2334bfbfc70 | 1,128 | py | Python | release/lightgbm_tests/workloads/train_moderate.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 22 | 2018-05-08T05:52:34.000Z | 2020-04-01T10:09:55.000Z | release/lightgbm_tests/workloads/train_moderate.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 73 | 2021-09-25T07:11:39.000Z | 2022-03-26T07:10:59.000Z | release/lightgbm_tests/workloads/train_moderate.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 10 | 2018-04-27T10:50:59.000Z | 2020-02-24T02:41:43.000Z | """Moderate cluster training
This training run will start 32 workers on 32 nodes (including head node).
Test owner: Yard1 (primary), krfricke
Acceptance criteria: Should run through and report final results.
"""
import json
import os
import time
import ray
from lightgbm_ray import RayParams
from ray.util.lightgbm.... | 22.56 | 85 | 0.659574 |
6951b9712ac47efc136c8087d1bb8727de4dedd2 | 949 | py | Python | movie_reader/solution.py | kyclark/playful_python_2 | 75f5f20a80f0a4f28adae1523b64b53d83a8c5cd | [
"MIT"
] | 6 | 2020-04-30T01:42:11.000Z | 2021-11-14T23:52:51.000Z | movie_reader/solution.py | kyclark/playful_python_2 | 75f5f20a80f0a4f28adae1523b64b53d83a8c5cd | [
"MIT"
] | null | null | null | movie_reader/solution.py | kyclark/playful_python_2 | 75f5f20a80f0a4f28adae1523b64b53d83a8c5cd | [
"MIT"
] | 7 | 2020-02-18T16:49:59.000Z | 2020-11-29T13:22:22.000Z | #!/usr/bin/env python3
import argparse
import os
import sys
import time
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='Movie Reader',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
... | 21.568182 | 79 | 0.501581 |
db947e203534edd0b12b89adadd3df47e01cb533 | 1,474 | py | Python | Easy/69.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 6 | 2017-09-25T18:05:50.000Z | 2019-03-27T00:23:15.000Z | Easy/69.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 1 | 2017-10-29T12:04:41.000Z | 2018-08-16T18:00:37.000Z | Easy/69.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | null | null | null | # ------------------------------
# 69. Sqrt(x)
#
# Description:
# Implement int sqrt(int x).
# Compute and return the square root of x.
# x is guaranteed to be a non-negative integer.
#
# Example 1:
#
# Input: 4
# Output: 2
#
# Example 2:
#
# Input: 8
# Output: 2
# Explanation: The square root of 8 is 2.82842..., ... | 22.676923 | 126 | 0.457938 |
c9c2e3cce3e0b18539b946b32c93bfc1fef9d950 | 36,341 | py | Python | tensorflow_probability/python/math/ode/bdf.py | joeyhaohao/probability | ab3670768102dc37753a433a0668e28ab333f104 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/math/ode/bdf.py | joeyhaohao/probability | ab3670768102dc37753a433a0668e28ab333f104 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/math/ode/bdf.py | joeyhaohao/probability | ab3670768102dc37753a433a0668e28ab333f104 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability 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 o... | 42.703878 | 101 | 0.667483 |
a8478b1eaaee9a202745be7433ab8c1d03355773 | 355 | py | Python | plottwist/tools/__init__.py | Plot-Twist-Short-Film/plottwist-tools-outliner | fa340ae6f252f0dfba8753939508ae4a26b03c69 | [
"MIT"
] | null | null | null | plottwist/tools/__init__.py | Plot-Twist-Short-Film/plottwist-tools-outliner | fa340ae6f252f0dfba8753939508ae4a26b03c69 | [
"MIT"
] | null | null | null | plottwist/tools/__init__.py | Plot-Twist-Short-Film/plottwist-tools-outliner | fa340ae6f252f0dfba8753939508ae4a26b03c69 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Initialization module for plottwist-tools
"""
from __future__ import print_function, division, absolute_import
__author__ = "Tomas Poveda"
__license__ = "MIT"
__maintainer__ = "Tomas Poveda"
__email__ = "tpovedatd@gmail.com"
from pkgutil import extend_path
__path__... | 20.882353 | 64 | 0.75493 |
1ba89b2f9f519b2d9532789da1dc007acd51829e | 1,792 | py | Python | tests/wsgi/test_POST.py | rsms/smisk | f12a5606dfff49a15fa91448ff36652d60add4c0 | [
"MIT"
] | 4 | 2015-11-05T11:51:12.000Z | 2020-12-30T18:55:58.000Z | tests/wsgi/test_POST.py | rsms/smisk | f12a5606dfff49a15fa91448ff36652d60add4c0 | [
"MIT"
] | 5 | 2021-11-16T17:21:51.000Z | 2021-11-16T17:22:09.000Z | tests/wsgi/test_POST.py | rsms/smisk | f12a5606dfff49a15fa91448ff36652d60add4c0 | [
"MIT"
] | null | null | null | '''This module exposes the post bug that Eric Moritz is experiences
where smisk segfaults
:See: Fixed in 77188bce80d5 <http://hg.hunch.se/smisk/diff/77188bce80d5/src/Stream.c>
'''
from smisk import wsgi
import smisk.core
from StringIO import StringIO
def safe_copyfileobj(fsrc, fdst, length=16*1024, size=0):
'''
... | 30.372881 | 87 | 0.657924 |
3d64880e58de776a5c9e5f972a916aff5148f1c5 | 1,802 | py | Python | di/utils/inspection/factory.py | dlski/python-di | 04dcdf58f3cf820e2d2ba5086e4e89822ae1f409 | [
"MIT"
] | 8 | 2021-02-05T16:17:31.000Z | 2022-03-03T00:01:33.000Z | di/utils/inspection/factory.py | dlski/python-di | 04dcdf58f3cf820e2d2ba5086e4e89822ae1f409 | [
"MIT"
] | null | null | null | di/utils/inspection/factory.py | dlski/python-di | 04dcdf58f3cf820e2d2ba5086e4e89822ae1f409 | [
"MIT"
] | null | null | null | import inspect
from typing import (
Any,
Callable,
Collection,
Dict,
List,
Optional,
Sequence,
Type,
get_type_hints,
)
from di.utils.compat import cached_property
class FactoryInspection:
_kinds = (
inspect.Parameter.POSITIONAL_ONLY,
inspect.Parameter.POSITIONA... | 27.723077 | 86 | 0.642064 |
85d1e208c40555805b4866b6902c6741f92f26a2 | 1,522 | py | Python | software/motor_cmd_source/nodes/motor_cmd_sin_source.py | iorodeo/water_channel_ros | fefaf1c58f6b386da136cfdd8e39362c8843c7c8 | [
"Apache-2.0"
] | null | null | null | software/motor_cmd_source/nodes/motor_cmd_sin_source.py | iorodeo/water_channel_ros | fefaf1c58f6b386da136cfdd8e39362c8843c7c8 | [
"Apache-2.0"
] | null | null | null | software/motor_cmd_source/nodes/motor_cmd_sin_source.py | iorodeo/water_channel_ros | fefaf1c58f6b386da136cfdd8e39362c8843c7c8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import roslib
roslib.load_manifest('motor_cmd_source')
import rospy
import threading
import math
from std_msgs.msg import Header
from msg_and_srv.msg import MotorCmdMsg
class MotorCmdSinSrc(object):
def __init__(self):
self.update_rate = rospy.get_param('update_rate',50)
sel... | 29.269231 | 79 | 0.607096 |
aab3f69c2054c860c49c6f3259eb9e26ebe5bc1c | 1,023 | py | Python | miragecore/core/file.py | shotastage/mirage-django | afdc1ca1fa6db01af174cf31310b6ef690d9254a | [
"Apache-2.0"
] | null | null | null | miragecore/core/file.py | shotastage/mirage-django | afdc1ca1fa6db01af174cf31310b6ef690d9254a | [
"Apache-2.0"
] | 77 | 2019-05-10T22:24:54.000Z | 2021-07-02T03:11:01.000Z | miragecore/core/file.py | shotastage/mirage-django | afdc1ca1fa6db01af174cf31310b6ef690d9254a | [
"Apache-2.0"
] | 1 | 2018-12-08T09:57:54.000Z | 2018-12-08T09:57:54.000Z | """
Mirage Framework
file.py
Created by Shota Shimazu on 2018/10/21
Copyright (c) 2018-2020 Shota Shimazu All Rights Reserved.
This software is released under the Apache License, see LICENSE for detail.
https://github.com/shotastage/mirageframework/blob/master/LICENSE
"""
import os
import shutil
import contextlib
... | 17.338983 | 75 | 0.684262 |
858b2f4a4ff2b96da72042d0f15243ed1437e891 | 14,098 | py | Python | qiskit/transpiler/passes/routing/lookahead_swap.py | ares201005/qiskit-terra | 2ace54c00276a136b76407851bace247bd7e2c16 | [
"Apache-2.0"
] | 1 | 2019-12-09T08:25:14.000Z | 2019-12-09T08:25:14.000Z | qiskit/transpiler/passes/routing/lookahead_swap.py | ares201005/qiskit-terra | 2ace54c00276a136b76407851bace247bd7e2c16 | [
"Apache-2.0"
] | 1 | 2020-03-29T19:57:14.000Z | 2020-03-29T21:49:25.000Z | qiskit/transpiler/passes/routing/lookahead_swap.py | ares201005/qiskit-terra | 2ace54c00276a136b76407851bace247bd7e2c16 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 41.464706 | 94 | 0.648745 |
5c45ea794b64bd0090cf62727429f3932eff04bf | 942 | py | Python | dev/06_25_2018/PWM_Measure_Voltage.py | npwebste/UPS_Controller | a90ce2229108197fd48f956310ae2929e0fa5d9a | [
"AFL-1.1"
] | null | null | null | dev/06_25_2018/PWM_Measure_Voltage.py | npwebste/UPS_Controller | a90ce2229108197fd48f956310ae2929e0fa5d9a | [
"AFL-1.1"
] | null | null | null | dev/06_25_2018/PWM_Measure_Voltage.py | npwebste/UPS_Controller | a90ce2229108197fd48f956310ae2929e0fa5d9a | [
"AFL-1.1"
] | null | null | null | #!/usr/bin/python
# Universal Power Supply Controller
# USAID Middle East Water Security Initiative
#
# Developed by: Nathan Webster
# Primary Investigator: Nathan Johnson
#
# Version History (mm_dd_yyyy)
# 1.00 03_24_2018_NW
#
######################################################
# Import Libraries
from ADS1256_defin... | 28.545455 | 80 | 0.687898 |
d945da65656e7cf92a5d45f21e4dbca1f339a292 | 1,343 | py | Python | tests/test_messages.py | konradko/zmq-services | 51dceb20e9a9ad0e5fe48d3762366c7a090b2f47 | [
"MIT"
] | null | null | null | tests/test_messages.py | konradko/zmq-services | 51dceb20e9a9ad0e5fe48d3762366c7a090b2f47 | [
"MIT"
] | null | null | null | tests/test_messages.py | konradko/zmq-services | 51dceb20e9a9ad0e5fe48d3762366c7a090b2f47 | [
"MIT"
] | null | null | null | from zmqservices import messages
class TestMessage(object):
message = messages.Message(data='asdf')
def test_validate(self):
self.message.validate()
def test_validate_serialized_data(self):
self.message.validate_serialized_data(self.message.data)
def test_serialize(self):
se... | 23.982143 | 66 | 0.667163 |
94771c4d02fe80ba74e9b6bddf5400d3cf4d787d | 1,262 | py | Python | partners/migrations/0002_auto_20180915_2328.py | vaishnavisuguru/uno-cpi | 6f69b374bf38f53b7a1d98cec3bcb976659b1512 | [
"MIT"
] | null | null | null | partners/migrations/0002_auto_20180915_2328.py | vaishnavisuguru/uno-cpi | 6f69b374bf38f53b7a1d98cec3bcb976659b1512 | [
"MIT"
] | null | null | null | partners/migrations/0002_auto_20180915_2328.py | vaishnavisuguru/uno-cpi | 6f69b374bf38f53b7a1d98cec3bcb976659b1512 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.1 on 2018-09-16 04:28
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('projects', '0001_initial'),
('partners', '0001_initial'),
('home', '0002_contact_partner... | 32.358974 | 113 | 0.627575 |
abf69703fd228fb2a8e3b322bf7af33e6a8c0e38 | 4,133 | py | Python | nni/retiarii/mutator.py | ggzhang0071/nni | f4145e62d89c3ca383cf00f2de5dfd2d1025ad92 | [
"MIT"
] | 9,680 | 2019-05-07T01:42:30.000Z | 2022-03-31T16:48:33.000Z | nni/retiarii/mutator.py | soma2000-lang/nni | eaad98528c7aa714c9848800d607d6aa3bdd531d | [
"MIT"
] | 1,957 | 2019-05-06T21:44:21.000Z | 2022-03-31T09:21:53.000Z | nni/retiarii/mutator.py | soma2000-lang/nni | eaad98528c7aa714c9848800d607d6aa3bdd531d | [
"MIT"
] | 1,571 | 2019-05-07T06:42:55.000Z | 2022-03-31T03:19:24.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import (Any, Iterable, List, Optional, Tuple)
from .graph import Model, Mutation, ModelStatus
__all__ = ['Sampler', 'Mutator', 'InvalidMutation']
Choice = Any
class Sampler:
"""
Handles `Mutator.choice()` calls.
"""... | 33.877049 | 113 | 0.654972 |
dc8c617feb2af40bb45cc357f6c2daa6d7326ffa | 383 | py | Python | build/drone_optique/catkin_generated/pkg.installspace.context.pc.py | Gamma-Software/ros_ws | bf887839ed0d8ee65349ccee1db30570f03ebf32 | [
"Apache-2.0"
] | null | null | null | build/drone_optique/catkin_generated/pkg.installspace.context.pc.py | Gamma-Software/ros_ws | bf887839ed0d8ee65349ccee1db30570f03ebf32 | [
"Apache-2.0"
] | null | null | null | build/drone_optique/catkin_generated/pkg.installspace.context.pc.py | Gamma-Software/ros_ws | bf887839ed0d8ee65349ccee1db30570f03ebf32 | [
"Apache-2.0"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "drone_optique"
PROJECT_SPACE_DIR = "/... | 42.555556 | 68 | 0.712794 |
fcaa895259f1cdfab772efbe03188fa09decef0f | 2,345 | py | Python | powerhub/clipboard.py | macdaliot/PowerHub | 3c73e23843ec83a6423276be753a0368af6e7fa2 | [
"MIT"
] | null | null | null | powerhub/clipboard.py | macdaliot/PowerHub | 3c73e23843ec83a6423276be753a0368af6e7fa2 | [
"MIT"
] | null | null | null | powerhub/clipboard.py | macdaliot/PowerHub | 3c73e23843ec83a6423276be753a0368af6e7fa2 | [
"MIT"
] | null | null | null | from sqlalchemy.exc import OperationalError
def init_clipboard(db=None):
if db:
return init_clipboard_with_db(db)
else:
return init_clipboard_without_db()
def init_clipboard_without_db():
class Entry(object):
def __init__(self, id=id, content=None, time=None, IP=None):
... | 26.954023 | 76 | 0.544563 |
5a0699b34a134e71c1ef4e2b1eadd6f1eb79d1a2 | 1,788 | py | Python | ontap9/python/36_create_nfsvol_pri_svm.py | mhauke/ntap-automation | 4233c17e2cf7ce40cb8dc61ab5d7d193178b764e | [
"Apache-2.0"
] | null | null | null | ontap9/python/36_create_nfsvol_pri_svm.py | mhauke/ntap-automation | 4233c17e2cf7ce40cb8dc61ab5d7d193178b764e | [
"Apache-2.0"
] | null | null | null | ontap9/python/36_create_nfsvol_pri_svm.py | mhauke/ntap-automation | 4233c17e2cf7ce40cb8dc61ab5d7d193178b764e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
################################################################################
#
# Title: 36_create_nfsvol_pri_svm.py
# Author: Adrian Bronder
# Date: 2020-03-17
# Description: Create volume on primary SVM
# with ONTAP Python client library
#
# Resources: netapp_ontap.resources.volume
#
#... | 24.833333 | 80 | 0.618009 |
74b69219600bf2031b3c9c1757ac264d078572ab | 1,153 | py | Python | meiduo_mall/apps/contents/models.py | kura-Lee/meiduo-mall | 8406eb49a41f8c8e726cca13231493b6422d427d | [
"MIT"
] | 1 | 2022-01-30T13:09:19.000Z | 2022-01-30T13:09:19.000Z | meiduo_mall/apps/contents/models.py | kura-Lee/meiduo-mall | 8406eb49a41f8c8e726cca13231493b6422d427d | [
"MIT"
] | null | null | null | meiduo_mall/apps/contents/models.py | kura-Lee/meiduo-mall | 8406eb49a41f8c8e726cca13231493b6422d427d | [
"MIT"
] | null | null | null | from django.db import models
from utils.models import BaseModel
class ContentCategory(BaseModel):
"""广告内容类别"""
name = models.CharField(max_length=50, verbose_name='名称')
key = models.CharField(max_length=50, verbose_name='类别键名')
class Meta:
db_table = 'tb_content_category'
verbose_name ... | 32.942857 | 94 | 0.692975 |
a8cb317d97da318122841bd5e7db9fb3b68e6ea6 | 1,178 | py | Python | botx/bots/mixins/middlewares.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 13 | 2021-01-21T12:43:10.000Z | 2022-03-23T11:11:59.000Z | botx/bots/mixins/middlewares.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 259 | 2020-02-26T08:51:03.000Z | 2022-03-23T11:08:36.000Z | botx/bots/mixins/middlewares.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 5 | 2019-12-02T16:19:22.000Z | 2021-11-22T20:33:34.000Z | """Implementation for bot classes."""
from typing import Any, Callable, Type
from botx import typing
from botx.middlewares.base import BaseMiddleware
from botx.middlewares.exceptions import ExceptionMiddleware
class MiddlewareMixin:
"""Middleware mixin for bot."""
exception_middleware: ExceptionMiddleware
... | 28.047619 | 78 | 0.663837 |
595899a331c566c59f8958ad55a8a5f2f36c38e6 | 8,639 | py | Python | examples/resnet_cifar10_tf.py | LucianaMarques/mlbench-benchmarks | 1310a782894a3aa664cfb813ca7590e69ad2c674 | [
"Apache-2.0"
] | 12 | 2019-02-23T19:21:59.000Z | 2021-10-17T16:23:33.000Z | examples/resnet_cifar10_tf.py | LucianaMarques/mlbench-benchmarks | 1310a782894a3aa664cfb813ca7590e69ad2c674 | [
"Apache-2.0"
] | 63 | 2018-10-09T12:18:23.000Z | 2022-02-24T11:24:03.000Z | examples/resnet_cifar10_tf.py | LucianaMarques/mlbench-benchmarks | 1310a782894a3aa664cfb813ca7590e69ad2c674 | [
"Apache-2.0"
] | 6 | 2019-02-23T19:22:02.000Z | 2021-08-23T08:16:50.000Z | r"""Distributed TensorFlow with Monitored Training Session.
Adapted from official tutorial::
https://www.tensorflow.org/deploy/distributed
Launch::
mpirun -n 3 --allow-run-as-root python ....
"""
import argparse
import logging
import os
import tensorflow as tf
from mpi4py import MPI
from mlbench_core.uti... | 33.878431 | 100 | 0.60632 |
3e8881a5c39d1c589411730ebf62fb36153632ad | 6,218 | py | Python | datastructure/graph/union_find.py | NLe1/Pyrithms | 07d115a79eb0c30980ed1699cef31a8230b927aa | [
"BSD-2-Clause"
] | 1 | 2020-05-22T22:22:56.000Z | 2020-05-22T22:22:56.000Z | datastructure/graph/union_find.py | NLe1/Pyrithms | 07d115a79eb0c30980ed1699cef31a8230b927aa | [
"BSD-2-Clause"
] | null | null | null | datastructure/graph/union_find.py | NLe1/Pyrithms | 07d115a79eb0c30980ed1699cef31a8230b927aa | [
"BSD-2-Clause"
] | null | null | null | """
Wikipedia(https://en.wikipedia.org/wiki/Disjoint-set_data_structure):
In computer science, a disjoint-set data structure (also called a union–find data structure or merge–find set) is a data structure that tracks a set of elements partitioned into a number of disjoint (non-overlapping) subsets.
This is implement... | 30.480392 | 227 | 0.595529 |
4ae05197378cc9689adfa0325cca82007f77e5d2 | 691 | py | Python | sa/profiles/Arista/EOS/get_vlans.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | sa/profiles/Arista/EOS/get_vlans.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | sa/profiles/Arista/EOS/get_vlans.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Arista.EOS.get_vlans
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# -----------------------------------------------------------... | 32.904762 | 100 | 0.48191 |
4db2512dd81eabf905a7081a9d75ca272890302f | 1,487 | py | Python | allennlp/tests/models/semantic_parsing/text2sql_parser_test.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 65 | 2020-11-13T05:36:29.000Z | 2022-03-26T22:45:46.000Z | allennlp/tests/models/semantic_parsing/text2sql_parser_test.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 11 | 2021-05-26T16:22:17.000Z | 2022-03-02T04:03:18.000Z | allennlp/tests/models/semantic_parsing/text2sql_parser_test.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 10 | 2019-12-06T11:32:37.000Z | 2022-01-06T15:39:09.000Z | from allennlp.common.testing import ModelTestCase
from allennlp.state_machines.states import GrammarStatelet
from allennlp.models.semantic_parsing.text2sql_parser import Text2SqlParser
from allennlp.semparse.worlds.text2sql_world import Text2SqlWorld
class Text2SqlParserTest(ModelTestCase):
def setUp(self):
... | 46.46875 | 104 | 0.659718 |
9455896fcb6ebd9e3bb1edd34a57200254d9a167 | 8,134 | py | Python | edinet_metering_measures_etl/task.py | BeeGroup-cimne/module_edinet | 0cda52e9d6222a681f85567e9bf0f7e5885ebf5e | [
"MIT"
] | null | null | null | edinet_metering_measures_etl/task.py | BeeGroup-cimne/module_edinet | 0cda52e9d6222a681f85567e9bf0f7e5885ebf5e | [
"MIT"
] | 13 | 2021-03-25T22:24:38.000Z | 2022-03-12T00:56:45.000Z | edinet_metering_measures_etl/task.py | BeeGroup-cimne/module_edinet | 0cda52e9d6222a681f85567e9bf0f7e5885ebf5e | [
"MIT"
] | 1 | 2019-03-13T09:49:56.000Z | 2019-03-13T09:49:56.000Z | import cPickle
import os
from datetime import datetime
from tempfile import NamedTemporaryFile
from bson import json_util, BSON
import json
from module_edinet.module_python2 import BeeModule2
import sys
from module_edinet.edinet_metering_measures_etl.hadoop_job import Hadoop_ETL
class ETL_mh_hadoop_tertiary(BeeModul... | 38.549763 | 156 | 0.607204 |
d7d279e69fa1054f20c35facff6eb261790c6a48 | 59 | py | Python | cmdbox/profiles/__init__.py | vitorfs/cmdbox | 97806c02caf5947ec855286212e61db714e3fb02 | [
"MIT"
] | 1 | 2019-09-07T11:49:11.000Z | 2019-09-07T11:49:11.000Z | cmdbox/profiles/__init__.py | vitorfs/cmdbox | 97806c02caf5947ec855286212e61db714e3fb02 | [
"MIT"
] | null | null | null | cmdbox/profiles/__init__.py | vitorfs/cmdbox | 97806c02caf5947ec855286212e61db714e3fb02 | [
"MIT"
] | 2 | 2018-09-04T08:33:17.000Z | 2020-09-18T20:26:46.000Z | default_app_config = 'cmdbox.profiles.apps.ProfilesConfig'
| 29.5 | 58 | 0.847458 |
7af7112418e16c41250ef193c95bb614d85bb8c4 | 4,453 | py | Python | Tasks/task6/task6.py | ZayJob/OS-and-N | a1f24382c791b76ac82bd7c86fe8c6f834f620f1 | [
"MIT"
] | null | null | null | Tasks/task6/task6.py | ZayJob/OS-and-N | a1f24382c791b76ac82bd7c86fe8c6f834f620f1 | [
"MIT"
] | null | null | null | Tasks/task6/task6.py | ZayJob/OS-and-N | a1f24382c791b76ac82bd7c86fe8c6f834f620f1 | [
"MIT"
] | null | null | null | import sys
import PySide2.QtWidgets as widgets
from PySide2 import QtCore, QtGui, QtWidgets
SPEED = 0.2
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 600)
self.centralwidget = QtWidgets.QWidget(MainWindow)
... | 37.737288 | 107 | 0.686279 |
d8a286fb3708b3cf3a0a4f138bf54be203e9324a | 2,597 | py | Python | src/models/metrics.py | pabloduque0/wmh_jax | a8b59017c5cc36d52e85a6709722cac69f6015ef | [
"Apache-2.0"
] | null | null | null | src/models/metrics.py | pabloduque0/wmh_jax | a8b59017c5cc36d52e85a6709722cac69f6015ef | [
"Apache-2.0"
] | null | null | null | src/models/metrics.py | pabloduque0/wmh_jax | a8b59017c5cc36d52e85a6709722cac69f6015ef | [
"Apache-2.0"
] | null | null | null | from typing import Callable, Mapping
import jax.numpy as jnp
import jax
import numpy as np
from collections import defaultdict
from jax.experimental import jax2tf
import tensorflow as tf
import tensorflow_addons as tfa
import scipy
@jax.jit
def dice_coefficient(y_true, y_pred, smooth: float = .0000001):
y_true_fla... | 33.294872 | 154 | 0.736619 |
ea8cbed51e5058312ad9f8ef75793991085c7014 | 33,726 | py | Python | openprescribing/frontend/views/bookmark_utils.py | annapowellsmith/openpresc | cfa9fb07d6fc2ee304159c04fcc132cefcf78745 | [
"MIT"
] | 91 | 2015-10-14T09:10:32.000Z | 2022-03-10T22:09:21.000Z | openprescribing/frontend/views/bookmark_utils.py | annapowellsmith/openpresc | cfa9fb07d6fc2ee304159c04fcc132cefcf78745 | [
"MIT"
] | 1,828 | 2015-12-04T14:52:27.000Z | 2022-03-31T08:51:14.000Z | openprescribing/frontend/views/bookmark_utils.py | HDRUK/openprescribing | 510e8c07e841cd42284c109774d1730b6463f376 | [
"MIT"
] | 27 | 2015-12-03T18:26:56.000Z | 2021-01-09T21:58:53.000Z | # -*- coding: utf-8 -*-
from datetime import date
from tempfile import NamedTemporaryFile
import html.parser
import logging
import os
import re
import subprocess
import urllib.parse
from anymail.message import attach_inline_image_file
from dateutil.relativedelta import relativedelta
from premailer import Premailer
imp... | 36.698585 | 88 | 0.610419 |
425ba0eaa3576fdb5a5ef0fa5d87595bff7e50eb | 3,864 | bzl | Python | third_party/parser/reflex.bzl | blais/oblique | 8cf9932b20b9d82a29f072d7c69c746e4643a77c | [
"Apache-2.0"
] | 1 | 2020-06-20T13:41:29.000Z | 2020-06-20T13:41:29.000Z | third_party/parser/reflex.bzl | blais/oblique | 8cf9932b20b9d82a29f072d7c69c746e4643a77c | [
"Apache-2.0"
] | null | null | null | third_party/parser/reflex.bzl | blais/oblique | 8cf9932b20b9d82a29f072d7c69c746e4643a77c | [
"Apache-2.0"
] | null | null | null | """Build rule for generating C or C++ sources with RE-Flex.
Examples
--------
This is a simple example.
```
genreflex(
name = "html_lex_lex",
src = "html.lex",
out = "html_lexer.c",
)
```
This example uses a `.tab.hh` file.
```
genreflex(
name = "rules_l",
src = "rules.lex",
includes = [
... | 30.1875 | 81 | 0.55823 |
423a6b219d74665ead0798d14bac9269148a22f3 | 8,943 | py | Python | tchannel/thrift/client.py | islavov/tchannel-python | ca3da9b4e0367d2e00078b158ab9e0bb4f328619 | [
"MIT"
] | 98 | 2015-07-10T23:42:11.000Z | 2021-11-08T11:21:02.000Z | tchannel/thrift/client.py | islavov/tchannel-python | ca3da9b4e0367d2e00078b158ab9e0bb4f328619 | [
"MIT"
] | 445 | 2015-07-10T23:58:02.000Z | 2021-08-24T14:58:39.000Z | tchannel/thrift/client.py | islavov/tchannel-python | ca3da9b4e0367d2e00078b158ab9e0bb4f328619 | [
"MIT"
] | 43 | 2015-07-22T19:14:57.000Z | 2021-09-14T12:12:38.000Z | # Copyright (c) 2016 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | 36.802469 | 79 | 0.654702 |
35f5ee950616111a38600f5ea35e0cc410b9733a | 347 | py | Python | ch02/nand_gate.py | fastso/deep-learning-from-scratch | efc8a0069697e76399e896ac4d593af86e57ad1e | [
"MIT"
] | 1 | 2018-12-13T23:07:17.000Z | 2018-12-13T23:07:17.000Z | ch02/nand_gate.py | fastso/deep-learning-from-scratch | efc8a0069697e76399e896ac4d593af86e57ad1e | [
"MIT"
] | 7 | 2017-08-06T09:13:18.000Z | 2019-07-08T05:32:32.000Z | ch02/nand_gate.py | fastso/deep-learning-from-scratch | efc8a0069697e76399e896ac4d593af86e57ad1e | [
"MIT"
] | null | null | null | import numpy as np
def NAND(x1, x2):
x = np.array([x1, x2])
w = np.array([-0.5, -0.5])
b = 0.7
tmp = np.sum(w * x) + b
if tmp <= 0:
return 0
else:
return 1
if __name__ == '__main__':
for xs in [(0, 0), (1, 0), (0, 1), (1, 1)]:
y = NAND(xs[0], xs[1])
print(... | 18.263158 | 47 | 0.420749 |
02c88fe7b8af7d9caf185dd55f8360272b205fae | 40,334 | py | Python | pymilvus/grpc_gen/schema_pb2.py | soothing-rain/pymilvus | 0e1aa63ff879412ac8e4f6765ab8bf9033c4244d | [
"Apache-2.0"
] | null | null | null | pymilvus/grpc_gen/schema_pb2.py | soothing-rain/pymilvus | 0e1aa63ff879412ac8e4f6765ab8bf9033c4244d | [
"Apache-2.0"
] | null | null | null | pymilvus/grpc_gen/schema_pb2.py | soothing-rain/pymilvus | 0e1aa63ff879412ac8e4f6765ab8bf9033c4244d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: schema.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobu... | 42.102296 | 3,467 | 0.755492 |
5fdb18f3416fdd6cdf6be8b7e4be145f8eaf1c73 | 764 | py | Python | tests/test_feature_downscale.py | Rlamboll/pyam | 0045b119aaa0054d18fed812f5c778d0ab7da4cc | [
"Apache-2.0"
] | null | null | null | tests/test_feature_downscale.py | Rlamboll/pyam | 0045b119aaa0054d18fed812f5c778d0ab7da4cc | [
"Apache-2.0"
] | null | null | null | tests/test_feature_downscale.py | Rlamboll/pyam | 0045b119aaa0054d18fed812f5c778d0ab7da4cc | [
"Apache-2.0"
] | null | null | null | import pytest
from pyam.testing import assert_iamframe_equal
@pytest.mark.parametrize("variable", (
('Primary Energy'),
(['Primary Energy', 'Primary Energy|Coal']),
))
def test_downscale_region(simple_df, variable):
simple_df.set_meta([1], name='test')
regions = ['reg_a', 'reg_b']
# return as new... | 34.727273 | 77 | 0.732984 |
51dcb12d23383ff0409d79cb89caf232ab47965f | 551 | py | Python | tratrarerro.py | JuniorhSilva/AgendaContatos | 91f2cf286ff5c7ba3db934dde4430e5a03e6d9fd | [
"MIT"
] | null | null | null | tratrarerro.py | JuniorhSilva/AgendaContatos | 91f2cf286ff5c7ba3db934dde4430e5a03e6d9fd | [
"MIT"
] | null | null | null | tratrarerro.py | JuniorhSilva/AgendaContatos | 91f2cf286ff5c7ba3db934dde4430e5a03e6d9fd | [
"MIT"
] | null | null | null | class TratarErro:
@staticmethod
def tratar_erro_int(valor):
try:
valor = int(valor)
return valor
except ValueError:
valor = None
return valor
@staticmethod
def erro_branco_variavel(valor):
if not valor == '':
sequencia ... | 25.045455 | 49 | 0.502722 |
14fdb9976d629a3a857b7c49c63c2989bdf44953 | 3,846 | py | Python | api/python/tests/test_session.py | sanketsaurav/quilt | c9d32121c62dc5478ca47ddc063a3e8bd33b990b | [
"Apache-2.0"
] | null | null | null | api/python/tests/test_session.py | sanketsaurav/quilt | c9d32121c62dc5478ca47ddc063a3e8bd33b990b | [
"Apache-2.0"
] | null | null | null | api/python/tests/test_session.py | sanketsaurav/quilt | c9d32121c62dc5478ca47ddc063a3e8bd33b990b | [
"Apache-2.0"
] | null | null | null | """
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', return_value='123456')
@patch('quilt3.session.login_with... | 31.52459 | 89 | 0.623765 |
63f06d5f318a65c6eaf8b98136fdf71a1d3a6bd2 | 2,360 | py | Python | setup.py | oubiwann/optcomplete | 9d6eb582fb048b41bea6d8532a610ee75982a335 | [
"BSD-3-Clause"
] | null | null | null | setup.py | oubiwann/optcomplete | 9d6eb582fb048b41bea6d8532a610ee75982a335 | [
"BSD-3-Clause"
] | null | null | null | setup.py | oubiwann/optcomplete | 9d6eb582fb048b41bea6d8532a610ee75982a335 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Install script for tengis.
#
__version__ = "$Revision$"
__author__ = "Martin Blais <blais@furius.ca>"
from distutils.core import setup
def read_version():
try:
return open('VERSION', 'r').readline().strip()
except IOError as e:
raise SystemExit(
"Error: y... | 36.875 | 79 | 0.705932 |
d0ec5903ba4d1a706aae3398f0fa59e27e5f15d2 | 3,560 | py | Python | app/recipe/views.py | likeclem30/RecipeApp-API | 553a5df25c754584f196f0463951a80c815333e9 | [
"MIT"
] | null | null | null | app/recipe/views.py | likeclem30/RecipeApp-API | 553a5df25c754584f196f0463951a80c815333e9 | [
"MIT"
] | 9 | 2021-03-19T08:13:24.000Z | 2022-03-12T00:13:16.000Z | app/recipe/views.py | likeclem30/RecipeApp-API | 553a5df25c754584f196f0463951a80c815333e9 | [
"MIT"
] | null | null | null | from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import viewsets, mixins, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import Tag, Ingredient, Recipe
from recipe i... | 34.563107 | 76 | 0.669944 |
ec4ed1df5ddd8b52454e8d2fdb91b6484601a881 | 29,554 | py | Python | test/evaluation/test_evaluator.py | dstefanov46/Reproducibility-Challenge-2021 | 55a0500c2aa6e8b2c117057f4259fbfd4b9b5f53 | [
"Apache-2.0"
] | 20 | 2021-07-22T08:32:36.000Z | 2022-03-11T10:21:25.000Z | test/evaluation/test_evaluator.py | dstefanov46/Reproducibility-Challenge-2021 | 55a0500c2aa6e8b2c117057f4259fbfd4b9b5f53 | [
"Apache-2.0"
] | 3 | 2021-10-15T18:59:46.000Z | 2022-02-07T16:59:32.000Z | test/evaluation/test_evaluator.py | dstefanov46/Reproducibility-Challenge-2021 | 55a0500c2aa6e8b2c117057f4259fbfd4b9b5f53 | [
"Apache-2.0"
] | 8 | 2021-08-04T16:12:19.000Z | 2022-01-12T18:28:58.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 26.965328 | 102 | 0.52196 |
3f96f6f37f1b79af14b83294b90bd1807dbb620b | 401 | py | Python | rest-api/flask_app/commands.py | sinedie/Flask-Svelte-Websockets-Nginx-Docker | 76daeec2c76f9f27ca526f53393ab4363020b92b | [
"WTFPL"
] | 4 | 2021-11-21T14:04:15.000Z | 2022-03-20T15:28:14.000Z | rest-api/flask_app/commands.py | sinedie/Utimate-flask-websocket-template | 76daeec2c76f9f27ca526f53393ab4363020b92b | [
"WTFPL"
] | null | null | null | rest-api/flask_app/commands.py | sinedie/Utimate-flask-websocket-template | 76daeec2c76f9f27ca526f53393ab4363020b92b | [
"WTFPL"
] | null | null | null | import click
from flask_app.database import db, User
def populate_db():
new_user = User('test', 'test@test.com', 'test')
db.session.add(new_user)
db.session.commit()
def create_db():
db.create_all()
def drop_db():
# if click.confirm('Are you sure?', abort=True):
# db.drop_all()
d... | 15.423077 | 52 | 0.628429 |
68c1b263a37bc1a11fcc2b625476ca826df9eb47 | 801 | py | Python | var/spack/repos/builtin/packages/libbacktrace/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/libbacktrace/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/libbacktrace/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libbacktrace(AutotoolsPackage):
"""A C library that may be linked into a C/C++ program to ... | 33.375 | 76 | 0.705368 |
bc707e6ecfe79e1cfa4715c093d453485f24290b | 2,172 | py | Python | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/notification_settings_fragment.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/notification_settings_fragment.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/notification_settings_fragment.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.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 ... | 43.44 | 78 | 0.64825 |
6bcc1d5bc908caf9c6e43fe444f222266bbb4077 | 4,594 | py | Python | unif/unif_train_cosine_pos.py | franpena-kth/learning-deep-learning | 9cd287b602dee1358672c4189445721a9c24f107 | [
"MIT"
] | null | null | null | unif/unif_train_cosine_pos.py | franpena-kth/learning-deep-learning | 9cd287b602dee1358672c4189445721a9c24f107 | [
"MIT"
] | null | null | null | unif/unif_train_cosine_pos.py | franpena-kth/learning-deep-learning | 9cd287b602dee1358672c4189445721a9c24f107 | [
"MIT"
] | null | null | null |
import time
import math
import torch
import wandb
from torch import nn
from unif.unif_data import CodeDescDataset
from unif.unif_evaluate import evaluate_top_n
from unif.unif_model import UNIFAttention
from unif.unif_model_no_attention import UNIFNoAttention
def timeSince(since):
now = time.time()
s = now -... | 35.890625 | 137 | 0.665651 |
322e8ba1f2af55d1a287b69af53fb7d622f79f15 | 794 | py | Python | Medium/0005 Longest Palindromic Substring.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | Medium/0005 Longest Palindromic Substring.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | Medium/0005 Longest Palindromic Substring.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | # https://leetcode.com/problems/longest-palindromic-substring/
class Solution:
def longestPalindrome(self, s: str) -> str:
res = ""
resLen = 0
for i in range(0, len(s)):
l,r = i,i
while l>=0 and r<len(s) and s[l]==s[r]:
... | 24.8125 | 62 | 0.308564 |
c9c57471e88bc4379226e6def988f5ba47f11001 | 1,460 | py | Python | 003 Longest Substring Without Repeating Characters.py | ChiFire/legend_LeetCode | 93fe97fef7e929fdbdc25fbb53955d44e14ecff8 | [
"MIT"
] | 872 | 2015-06-15T12:02:41.000Z | 2022-03-30T08:44:35.000Z | 003 Longest Substring Without Repeating Characters.py | ChiFire/legend_LeetCode | 93fe97fef7e929fdbdc25fbb53955d44e14ecff8 | [
"MIT"
] | 8 | 2015-06-21T15:11:59.000Z | 2022-02-01T11:22:34.000Z | 003 Longest Substring Without Repeating Characters.py | ChiFire/legend_LeetCode | 93fe97fef7e929fdbdc25fbb53955d44e14ecff8 | [
"MIT"
] | 328 | 2015-06-28T03:10:35.000Z | 2022-03-29T11:05:28.000Z | """
Given a string, find the length of the longest substring without repeating characters. For example, the longest
substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring
is "b", with the length of 1.
"""
__author__ = 'Danyang'
class Solution:
... | 37.435897 | 118 | 0.591781 |
1933da50fd23156b67e3dbfdda3d4a868e9f010a | 3,313 | py | Python | ci/tests/test_git_api.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | 29 | 2016-11-29T15:15:56.000Z | 2021-09-08T04:04:53.000Z | ci/tests/test_git_api.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | 108 | 2016-11-29T17:29:00.000Z | 2022-03-21T21:00:10.000Z | ci/tests/test_git_api.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | 11 | 2016-11-29T15:15:53.000Z | 2020-05-15T12:22:55.000Z |
# Copyright 2016 Battelle Energy Alliance, 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 agr... | 36.406593 | 74 | 0.668578 |
82c1dab9bb24337d25f6ffe9bfb38724a1d6d896 | 391 | py | Python | gallery/wsgi.py | osambo/photo-gallery | 8ac740c8e3bb9928b8f9c48fe98274872bc9c0cc | [
"MIT"
] | null | null | null | gallery/wsgi.py | osambo/photo-gallery | 8ac740c8e3bb9928b8f9c48fe98274872bc9c0cc | [
"MIT"
] | null | null | null | gallery/wsgi.py | osambo/photo-gallery | 8ac740c8e3bb9928b8f9c48fe98274872bc9c0cc | [
"MIT"
] | null | null | null | """
WSGI config for gallery project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | 23 | 78 | 0.785166 |
4d6820ed21026645f10f5bc37b77d103e0e977cb | 19,382 | py | Python | sdk/python/pulumi_azure_native/network/latest/get_virtual_network_gateway_connection.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/latest/get_virtual_network_gateway_connection.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/latest/get_virtual_network_gateway_connection.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"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
from ... import _utilities, _tables
from... | 44.556322 | 697 | 0.695387 |
da60f74d80ebf233e2cb8b1942b66f1f2bfb99a7 | 1,480 | py | Python | djangogram/users/forms.py | Hyeongstone/djangogram | a39ca44cb50409b1fcf2bce336af2bf79f308a57 | [
"MIT"
] | null | null | null | djangogram/users/forms.py | Hyeongstone/djangogram | a39ca44cb50409b1fcf2bce336af2bf79f308a57 | [
"MIT"
] | null | null | null | djangogram/users/forms.py | Hyeongstone/djangogram | a39ca44cb50409b1fcf2bce336af2bf79f308a57 | [
"MIT"
] | null | null | null | from django.contrib.auth import forms, get_user_model
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django import forms as django_form
User = get_user_model()
class UserChangeForm(forms.UserChangeForm):
class Meta(forms.UserChangeForm.Meta):
... | 25.517241 | 74 | 0.634459 |
12575f30466f314ec31e674df3d7ee23b0569186 | 14,608 | py | Python | backend/nft_market/contracts/assets/manager.py | DedicatedDev/OpenNFT | 218f6583316dcf8438789c1f6a51b110d53d22b7 | [
"MIT"
] | 87 | 2021-05-18T14:11:38.000Z | 2022-03-29T21:51:06.000Z | backend/nft_market/contracts/assets/manager.py | DedicatedDev/OpenNFT | 218f6583316dcf8438789c1f6a51b110d53d22b7 | [
"MIT"
] | 17 | 2021-06-08T22:03:20.000Z | 2022-02-04T19:07:10.000Z | backend/nft_market/contracts/assets/manager.py | DedicatedDev/OpenNFT | 218f6583316dcf8438789c1f6a51b110d53d22b7 | [
"MIT"
] | 69 | 2021-06-08T07:07:41.000Z | 2022-03-30T21:46:04.000Z | import sys
from enum import Enum
from pyteal import *
if __name__ == "__main__":
from helpers.state import GlobalState, LocalState
from helpers.parse import parse_args
else:
from .helpers.state import GlobalState, LocalState
from .helpers.parse import parse_args
class ManagerContract:
def __init... | 39.163539 | 86 | 0.369729 |
375fa1bd0b117947ab33cb28870c9aa11a914955 | 5,716 | py | Python | hpvm/projects/predtuner/predtuner/torchutil/indexing.py | vzyrianov/hpvm-autograd | 521cc3b684531548aea75f9fe3cc673aaa4a2e90 | [
"Apache-2.0"
] | null | null | null | hpvm/projects/predtuner/predtuner/torchutil/indexing.py | vzyrianov/hpvm-autograd | 521cc3b684531548aea75f9fe3cc673aaa4a2e90 | [
"Apache-2.0"
] | null | null | null | hpvm/projects/predtuner/predtuner/torchutil/indexing.py | vzyrianov/hpvm-autograd | 521cc3b684531548aea75f9fe3cc673aaa4a2e90 | [
"Apache-2.0"
] | null | null | null | """Tools for indexing into an nn.Module with layer name (str) or index (int)."""
from typing import Callable, Dict, Iterator, Optional, Set, Tuple, Union
from torch.nn import Module, Sequential
ModulePredT = Callable[[Module], bool]
class ModuleIndexer:
r"""Allows indexing into an nn.Module with index (int) to ... | 40.253521 | 102 | 0.635059 |
cf6598879eb2bee955e8449eef457de89caa53c6 | 456 | py | Python | onapi/unpublished.py | Lugal-PCZ/bbapi-toolkit | 7e0ef7b1843d8aad4ac31f21872a69655f6167f3 | [
"MIT"
] | 4 | 2019-12-13T13:34:17.000Z | 2022-03-28T20:17:41.000Z | onapi/unpublished.py | Lugal-PCZ/bbapi-toolkit | 7e0ef7b1843d8aad4ac31f21872a69655f6167f3 | [
"MIT"
] | 1 | 2019-08-20T16:30:39.000Z | 2019-09-23T16:32:12.000Z | onapi/unpublished.py | Lugal-PCZ/bbapi-toolkit | 7e0ef7b1843d8aad4ac31f21872a69655f6167f3 | [
"MIT"
] | null | null | null | # Note these are UNPUBLISHED endpoints. Though they may be useful, they cannot be relied
# upon for production purposes, and Blackbaud may change or restrict them without warning.
import requests as _requests
def get_rooms(client: object) -> list:
"""Get buildings and rooms.
Args:
client (object): T... | 25.333333 | 90 | 0.695175 |
c97290480fe82358260f9286231edbf8ad075039 | 30,224 | py | Python | nova/exception.py | bopopescu/openstack-12 | 2c7e0d1e63cae7aaa38095439843c9a2abb0382b | [
"Apache-2.0"
] | null | null | null | nova/exception.py | bopopescu/openstack-12 | 2c7e0d1e63cae7aaa38095439843c9a2abb0382b | [
"Apache-2.0"
] | null | null | null | nova/exception.py | bopopescu/openstack-12 | 2c7e0d1e63cae7aaa38095439843c9a2abb0382b | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | 27.933457 | 79 | 0.683894 |
dc8558deb5d76f6dd022e9bc13f0b1a1b5eb6da4 | 1,515 | py | Python | plox.py | jalhadi/plox | fa4a1e9428aeffa4f845e7c2d9e717ca5cf66a6b | [
"MIT"
] | null | null | null | plox.py | jalhadi/plox | fa4a1e9428aeffa4f845e7c2d9e717ca5cf66a6b | [
"MIT"
] | null | null | null | plox.py | jalhadi/plox | fa4a1e9428aeffa4f845e7c2d9e717ca5cf66a6b | [
"MIT"
] | null | null | null | import sys
from error import Error
from ast_printer import AstPrinter
from scanner import Scanner
from parser import Parser
from interpreter import Interpreter
class Lox:
def __init__(self):
self.interpreter = Interpreter()
if sys.version_info[0] < 3:
raise Exception("Python 3 or a mor... | 27.545455 | 77 | 0.558416 |
7a2e1a277ce37e43f8f841fbaa8b09857333bc09 | 1,321 | py | Python | 2020/01-2.py | SpangleLabs/advent-of-code | 9692f533c30f22e59f7055ca12253128ca8dac0a | [
"MIT"
] | 1 | 2021-12-04T11:30:53.000Z | 2021-12-04T11:30:53.000Z | 2020/01-2.py | SpangleLabs/advent-of-code | 9692f533c30f22e59f7055ca12253128ca8dac0a | [
"MIT"
] | null | null | null | 2020/01-2.py | SpangleLabs/advent-of-code | 9692f533c30f22e59f7055ca12253128ca8dac0a | [
"MIT"
] | null | null | null | expense_report = """1933
1963
1924
1832
1949
1826
1681
1548
1881
1973
1558
1979
1803
1975
1867
1934
1986
1220
1878
1985
2006
1535
1522
1884
1380
1922
1905
1582
1456
1877
1959
1953
634
1875
366
1968
1887
1848
1779
1894
1606
1429
1900
1309
2007
1944
1901
1559
1484
1996
1837
1892
1989
1684
1952
1990
1974
1890
1883
1993
15... | 6.260664 | 60 | 0.751703 |
dd882aa8940d73e19a6b099f53adfd59bd67faaf | 3,124 | py | Python | examples/hh_solver/plot_hh_simulation.py | nicolossus/neuromodels | 82f95a8670116ef26b71c02f9c94626c502bc989 | [
"MIT"
] | null | null | null | examples/hh_solver/plot_hh_simulation.py | nicolossus/neuromodels | 82f95a8670116ef26b71c02f9c94626c502bc989 | [
"MIT"
] | null | null | null | examples/hh_solver/plot_hh_simulation.py | nicolossus/neuromodels | 82f95a8670116ef26b71c02f9c94626c502bc989 | [
"MIT"
] | null | null | null | """
=====================================================================
Simulating a Hodgkin-Huxley system
=====================================================================
Solving a Hodgkin-Huxley system and visualizing the simulation results.
"""
import matplotlib as mpl
import matplotlib.pyplot as plt
import ... | 29.752381 | 79 | 0.509923 |
a15d01ce05e73da1c84c0a35c753620d1da049f0 | 9,532 | py | Python | build/PureCloudPlatformClientV2/models/physical_interface_entity_listing.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 1 | 2021-10-08T20:46:45.000Z | 2021-10-08T20:46:45.000Z | libs/PureCloudPlatformClientV2/models/physical_interface_entity_listing.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | null | null | null | libs/PureCloudPlatformClientV2/models/physical_interface_entity_listing.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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... | 26.115068 | 85 | 0.591586 |
9a12830f78bae2993a5446289d69319ba2d4355f | 6,079 | py | Python | apps/log-image-classifier/log-image-classifier.py | asutic/ncappzoo | cfac66c16e25105eedb258c895caead83db361de | [
"MIT"
] | null | null | null | apps/log-image-classifier/log-image-classifier.py | asutic/ncappzoo | cfac66c16e25105eedb258c895caead83db361de | [
"MIT"
] | null | null | null | apps/log-image-classifier/log-image-classifier.py | asutic/ncappzoo | cfac66c16e25105eedb258c895caead83db361de | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# ****************************************************************************
# Copyright(c) 2017 Intel Corporation.
# License: MIT See LICENSE file in root directory.
# ****************************************************************************
# How to sequentially classify multiple images usi... | 33.585635 | 88 | 0.569173 |
1010d78200749f22d415c401ff780b2f3d269a0b | 18 | py | Python | shopify/version.py | traaan/shopify_python_api | 23516d058963bfd2b98e5295072e984909fdbdc1 | [
"MIT"
] | null | null | null | shopify/version.py | traaan/shopify_python_api | 23516d058963bfd2b98e5295072e984909fdbdc1 | [
"MIT"
] | null | null | null | shopify/version.py | traaan/shopify_python_api | 23516d058963bfd2b98e5295072e984909fdbdc1 | [
"MIT"
] | null | null | null | VERSION = '8.2.0'
| 9 | 17 | 0.555556 |
df4bad3474a0f4f039559bf59dd96343ad382d64 | 9,377 | py | Python | flowsa/dataclean.py | JohnAndrewTaylor/flowsa | 21b14b19f08370db574bdd59219a2773983c6f95 | [
"CC0-1.0"
] | null | null | null | flowsa/dataclean.py | JohnAndrewTaylor/flowsa | 21b14b19f08370db574bdd59219a2773983c6f95 | [
"CC0-1.0"
] | null | null | null | flowsa/dataclean.py | JohnAndrewTaylor/flowsa | 21b14b19f08370db574bdd59219a2773983c6f95 | [
"CC0-1.0"
] | null | null | null | # dataclean.py (flowsa)
# !/usr/bin/env python3
# coding=utf-8
"""
Common functions to clean and harmonize dataframes
"""
import logging as log
import numpy as np
def clean_df(df, flowbyfields, fill_na_dict, drop_description=True):
"""
:param df:
:param flowbyfields: flow_by_activity_fields or flow_by_s... | 40.593074 | 97 | 0.626533 |
95d308519ed1f3a8a805f04b51a80c3e2ddcf64a | 781 | py | Python | src/models/hotel.py | lucas54neves/hotels-flask | ee5d772e2cdcca29af191227b2d0d107410e0a19 | [
"MIT"
] | null | null | null | src/models/hotel.py | lucas54neves/hotels-flask | ee5d772e2cdcca29af191227b2d0d107410e0a19 | [
"MIT"
] | null | null | null | src/models/hotel.py | lucas54neves/hotels-flask | ee5d772e2cdcca29af191227b2d0d107410e0a19 | [
"MIT"
] | null | null | null | from sql_alchemy import database
class HotelModel:
__tablename__ = 'hotels'
hotel_id = database.Column(database, primary_key=True)
name = database.Column(database.String(80))
stars = database.Column(database.Float(precision=1))
daily = database.Column(database.Float(precision=2))
city... | 30.038462 | 60 | 0.604353 |
f6b6040e14b6d393d9cfa52eace7a267578439a2 | 1,542 | py | Python | hyperion/utils.py | ExiaSR/hyperion | 0b14ef55ed00b964f1966c722f4162c475aa4895 | [
"MIT"
] | 3 | 2019-01-30T03:50:04.000Z | 2019-02-20T00:33:05.000Z | hyperion/utils.py | ExiaSR/hyperion | 0b14ef55ed00b964f1966c722f4162c475aa4895 | [
"MIT"
] | 173 | 2019-01-30T08:30:54.000Z | 2019-04-05T19:43:06.000Z | hyperion/utils.py | ExiaSR/hyperion | 0b14ef55ed00b964f1966c722f4162c475aa4895 | [
"MIT"
] | 2 | 2019-05-06T22:59:56.000Z | 2020-09-29T03:13:03.000Z | # pylint: disable=logging-not-lazy,invalid-name
import logging
import grequests
import requests
import humps
from hyperion.models.server import Server
logger = logging.getLogger(__name__)
class ForeignServerHttpUtils:
@staticmethod
def get(server: Server, url, **kwargs):
foreign_url = "{}{}{}".forma... | 33.521739 | 96 | 0.62192 |
de79743de3ac44ef7304fe656cf0647654d77996 | 6,308 | py | Python | translation-api/main.py | AI4Bharat/pratilipi | 5c6fcd586ea06a83dd38df2153f4c9430ea2b50b | [
"MIT"
] | 3 | 2022-01-18T08:53:15.000Z | 2022-01-27T22:58:01.000Z | translation-api/main.py | AI4Bharat/pratilipi | 5c6fcd586ea06a83dd38df2153f4c9430ea2b50b | [
"MIT"
] | 1 | 2022-01-21T09:10:42.000Z | 2022-01-24T07:12:59.000Z | translation-api/main.py | AI4Bharat/pratilipi | 5c6fcd586ea06a83dd38df2153f4c9430ea2b50b | [
"MIT"
] | null | null | null | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from typing import Optional
from pydantic import BaseModel
from starlette.responses import RedirectResponse
import time
import re
from math import floor
import webvtt
from io import StringIO
from indicTrans.inference.engine import Model, ... | 30.770732 | 109 | 0.695783 |
0eb80d4e524c504a61d82bbf73bbbb596e55979f | 84 | py | Python | zemfrog/templates/task/name.py | aprilahijriyan/zemfrog | 0a4ebc303caa8fadf89ca0cc8569de60c61f3252 | [
"MIT"
] | null | null | null | zemfrog/templates/task/name.py | aprilahijriyan/zemfrog | 0a4ebc303caa8fadf89ca0cc8569de60c61f3252 | [
"MIT"
] | null | null | null | zemfrog/templates/task/name.py | aprilahijriyan/zemfrog | 0a4ebc303caa8fadf89ca0cc8569de60c61f3252 | [
"MIT"
] | null | null | null | from zemfrog.globals import celery
@celery.task
def {{task_name}}():
pass
| 14 | 35 | 0.666667 |
4d6f8d474167f0524434d75e99ee756b41930747 | 2,572 | py | Python | 2nd_100/problem138.py | takekoputa/project-euler | 6f434be429bd26f5d0f84f5ab0f5fa2bd677c790 | [
"MIT"
] | null | null | null | 2nd_100/problem138.py | takekoputa/project-euler | 6f434be429bd26f5d0f84f5ab0f5fa2bd677c790 | [
"MIT"
] | null | null | null | 2nd_100/problem138.py | takekoputa/project-euler | 6f434be429bd26f5d0f84f5ab0f5fa2bd677c790 | [
"MIT"
] | 1 | 2021-11-02T12:08:46.000Z | 2021-11-02T12:08:46.000Z | # Question: https://projecteuler.net/problem=138
# https://www.wolframalpha.com/input/?i=1+-+2+b+%2B+%285+b%5E2%29%2F4+%3D+L%5E2++integer+solutions
# b = 1/5 (2 (9 - 4 sqrt(5))^(2 n) + sqrt(5) (9 - 4 sqrt(5))^(2 n) + 2 (9 + 4 sqrt(5))^(2 n) - sqrt(5) (9 + 4 sqrt(5))^(2 n) - 4), L = ± 1/10 (5 (9 - 4 sqrt(5))^(2 n) + 2 ... | 55.913043 | 281 | 0.488336 |
e3917623b8ee75ebc47f28430ea182841c428d1a | 9,232 | py | Python | dot_vs_learned_similarity/mf_simple.py | egonrian/google-research | 8177adbe9ca0d7e5a9463b54581fe6dd27be0974 | [
"Apache-2.0"
] | 3 | 2021-01-18T04:46:49.000Z | 2021-03-05T09:21:40.000Z | dot_vs_learned_similarity/mf_simple.py | JustinDurham/google-research | 9049acf9246c1b75170f0c6757e62a8f619a9db6 | [
"Apache-2.0"
] | 25 | 2020-07-25T08:53:09.000Z | 2022-03-12T00:43:02.000Z | dot_vs_learned_similarity/mf_simple.py | JustinDurham/google-research | 9049acf9246c1b75170f0c6757e62a8f619a9db6 | [
"Apache-2.0"
] | 4 | 2021-02-08T10:25:45.000Z | 2021-04-17T14:46:26.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 39.285106 | 80 | 0.666811 |
1386d91ff481d59740eae25de79645fef2ed8527 | 1,458 | py | Python | boto3_type_annotations/boto3_type_annotations/eks/client.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 119 | 2018-12-01T18:20:57.000Z | 2022-02-02T10:31:29.000Z | boto3_type_annotations/boto3_type_annotations/eks/client.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 15 | 2018-11-16T00:16:44.000Z | 2021-11-13T03:44:18.000Z | boto3_type_annotations/boto3_type_annotations/eks/client.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 11 | 2019-05-06T05:26:51.000Z | 2021-09-28T15:27:59.000Z | from typing import Optional
from botocore.client import BaseClient
from botocore.waiter import Waiter
from typing import Union
from typing import Dict
from botocore.paginate import Paginator
class Client(BaseClient):
def can_paginate(self, operation_name: str = None):
pass
def create_cluster(self, na... | 32.4 | 163 | 0.676955 |
7600824ebd5795525d1bc232093140c607fbb456 | 11,837 | py | Python | gooddata-metadata-client/gooddata_metadata_client/model/workspace_identifier.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 7 | 2022-01-24T16:27:06.000Z | 2022-02-25T10:18:49.000Z | gooddata-metadata-client/gooddata_metadata_client/model/workspace_identifier.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 29 | 2022-01-20T15:45:38.000Z | 2022-03-31T09:39:25.000Z | gooddata-metadata-client/gooddata_metadata_client/model/workspace_identifier.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 7 | 2022-01-20T07:11:15.000Z | 2022-03-09T14:50:17.000Z | """
OpenAPI definition
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v0
Contact: support@gooddata.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sy... | 42.426523 | 124 | 0.563403 |
5309c5149912f62e070c209048ad0c4edd524d81 | 661 | py | Python | src/car_control/src/reset.py | J-Ford/car_control | bf15e7af2b29f81e4fbb8e52effab571ebc4306d | [
"MIT"
] | null | null | null | src/car_control/src/reset.py | J-Ford/car_control | bf15e7af2b29f81e4fbb8e52effab571ebc4306d | [
"MIT"
] | null | null | null | src/car_control/src/reset.py | J-Ford/car_control | bf15e7af2b29f81e4fbb8e52effab571ebc4306d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import Float64
from std_msgs.msg import Empty
class CarReset(object):
def __init__(self):
rospy.init_node('reset_node', anonymous=False)
self.sub = rospy.Subscriber("reset", Empty, self._callback)
self.pub_speed = rospy.Publisher('throttle/setpoint', Float... | 25.423077 | 82 | 0.742814 |
baa0e729850721b65854bbeaf652a800708c0169 | 40,333 | py | Python | quantum/wsgi.py | cuiwow/quantum | ce11b62046a0501e9fcd8442524d3c151d315dfb | [
"Apache-2.0"
] | 1 | 2019-04-11T10:27:47.000Z | 2019-04-11T10:27:47.000Z | quantum/wsgi.py | cuiwow/quantum | ce11b62046a0501e9fcd8442524d3c151d315dfb | [
"Apache-2.0"
] | null | null | null | quantum/wsgi.py | cuiwow/quantum | ce11b62046a0501e9fcd8442524d3c151d315dfb | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... | 36.043789 | 79 | 0.611708 |
baf55bc76fe74d2cf1fba3a3379453d0129e30d0 | 5,196 | py | Python | .history/vision/tensorflow_object_detect/scripts/detect_lane_20210224044058.py | MingshanHe/Autopilot-Demo | 0b7178ae3f417f529d7015373a1e51eb71df28ab | [
"MIT"
] | 2 | 2021-03-09T14:00:55.000Z | 2022-02-15T02:51:27.000Z | .history/vision/tensorflow_object_detect/scripts/detect_lane_20210224044058.py | MingshanHe/Turtlebo3-Autopilot | 0b7178ae3f417f529d7015373a1e51eb71df28ab | [
"MIT"
] | null | null | null | .history/vision/tensorflow_object_detect/scripts/detect_lane_20210224044058.py | MingshanHe/Turtlebo3-Autopilot | 0b7178ae3f417f529d7015373a1e51eb71df28ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import rospy
import numpy as np
import cv2
from cv_bridge import CvBridge
from std_msgs.msg import UInt8, Float64, Float64[]
from sensor_msgs.msg import Image, CompressedImage
import time
class DetectLane():
def __init__(self):
self.sub_image_original = rospy... | 39.067669 | 115 | 0.651655 |
f084152c4ab9cb14dab875d2641ffdb8c5ce6a21 | 6,485 | py | Python | notebooks/db/update_historian.py | iliesaya/junctionx-kaust-2019 | 80986974289c160dcfbb74cd6210325100ef2dbe | [
"BSD-3-Clause"
] | 3 | 2020-02-25T19:23:15.000Z | 2021-11-28T09:41:41.000Z | notebooks/db/update_historian.py | iliesaya/junctionx-kaust-2019 | 80986974289c160dcfbb74cd6210325100ef2dbe | [
"BSD-3-Clause"
] | 1 | 2019-09-24T05:59:52.000Z | 2019-09-24T05:59:52.000Z | notebooks/db/update_historian.py | iliesaya/junctionx-kaust-2019 | 80986974289c160dcfbb74cd6210325100ef2dbe | [
"BSD-3-Clause"
] | 2 | 2019-09-13T09:03:46.000Z | 2019-09-14T16:55:23.000Z | #%%
# from libs.Grafana.config import Config
# from libs.Grafana.dbase import Database
import datetime
import pandas as pd
import numpy as np
import datetime
import time
import logging
import pprint
from time import time
import requests
from influxdb import InfluxDBClient
from influxdb.client import InfluxDBClien... | 29.747706 | 167 | 0.567155 |
bf1f04205ddc1a9e00ad60fa97d1f2ad3b4d8a98 | 1,701 | py | Python | app/core/migrations/0001_initial.py | jinimong/drf-tdd | 3282b4d387881921c35489755078f7101ebf57f0 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | jinimong/drf-tdd | 3282b4d387881921c35489755078f7101ebf57f0 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | jinimong/drf-tdd | 3282b4d387881921c35489755078f7101ebf57f0 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-27 06:54
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.029412 | 266 | 0.637272 |
615b22444d7fc37d583ad630bea2bd38eefecb41 | 747 | py | Python | repominder/apps/core/signals.py | simon-weber/repominder | 2b86f84de919858c83997a9e21ef711e895c9e9d | [
"MIT"
] | 4 | 2017-12-16T19:28:04.000Z | 2018-10-15T06:46:09.000Z | repominder/apps/core/signals.py | simon-weber/repominder | 2b86f84de919858c83997a9e21ef711e895c9e9d | [
"MIT"
] | 3 | 2018-01-20T02:10:26.000Z | 2020-02-13T00:27:17.000Z | repominder/apps/core/signals.py | simon-weber/repominder | 2b86f84de919858c83997a9e21ef711e895c9e9d | [
"MIT"
] | null | null | null | import logging
from django.conf import settings
from django.dispatch.dispatcher import receiver
from django_amazon_ses import post_send, pre_send
logger = logging.getLogger(__name__)
@receiver(pre_send)
def set_reply_to(sender, message=None, **kwargs):
if message:
if message.reply_to:
logger... | 27.666667 | 80 | 0.70415 |
5bf8ce19ae7c2d4386cbbc145891a9574ad5226c | 36,293 | py | Python | src/storage-blob-preview/azext_storage_blob_preview/operations/blob.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/storage-blob-preview/azext_storage_blob_preview/operations/blob.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/storage-blob-preview/azext_storage_blob_preview/operations/blob.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 50.197787 | 126 | 0.65638 |
7d8c66622dd75992f4b4d9871de1e19692c75aac | 12,070 | py | Python | src/oci/cloud_guard/models/create_managed_list_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/cloud_guard/models/create_managed_list_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/cloud_guard/models/create_managed_list_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 34.584527 | 245 | 0.660895 |
0bdbdf71a782d27b0f5d9e574a978932b5034ab3 | 409 | py | Python | pacman-arch/test/pacman/tests/upgrade082.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade082.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade082.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Install a package (correct architecture, auto)"
import os
machine = os.uname()[4]
p = pmpkg("dummy")
p.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
p.arch = machine
self.addpkg(p)
self.option["Architecture"] = ['auto']
self.args = "-U %s" % p.filename()
self.addrule("PACMAN_RETCODE=... | 20.45 | 67 | 0.662592 |
eea4570f5d0f05311d437cfcce63a0b54d5156fa | 350 | py | Python | rsopt/configuration/__init__.py | tanxicccc/rsopt | 8705e937f95a4bbe6ed3fb1a04b78f724a5f3931 | [
"Apache-2.0"
] | 6 | 2020-11-03T16:51:50.000Z | 2022-02-13T20:40:05.000Z | rsopt/configuration/__init__.py | tanxicccc/rsopt | 8705e937f95a4bbe6ed3fb1a04b78f724a5f3931 | [
"Apache-2.0"
] | 97 | 2020-05-18T18:24:49.000Z | 2022-03-23T15:42:42.000Z | rsopt/configuration/__init__.py | tanxicccc/rsopt | 8705e937f95a4bbe6ed3fb1a04b78f724a5f3931 | [
"Apache-2.0"
] | 4 | 2020-08-18T23:19:55.000Z | 2021-12-08T20:55:09.000Z | from rsopt.configuration.parameters import _PARAMETER_READERS, Parameters
from rsopt.configuration.settings import _SETTING_READERS, Settings
from rsopt.configuration.setup import _SETUP_READERS, Setup
from rsopt.configuration.options import Options
from rsopt.configuration.configuration import Configuration
from rsopt... | 58.333333 | 73 | 0.882857 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.