hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4a0fbb4cfee7ec85a999391bf78a422dea764f | 1,513 | py | Python | get_image_from_video.py | matiji66/face-card-machine | bb466a4e06815869ff801ae50f044bf29e53f20d | [
"Apache-2.0"
] | 39 | 2018-09-29T02:57:09.000Z | 2021-04-12T13:45:21.000Z | get_image_from_video.py | a543713743/face-attendance-machine | bb466a4e06815869ff801ae50f044bf29e53f20d | [
"Apache-2.0"
] | 2 | 2019-03-26T13:50:29.000Z | 2021-03-23T09:49:43.000Z | get_image_from_video.py | a543713743/face-attendance-machine | bb466a4e06815869ff801ae50f044bf29e53f20d | [
"Apache-2.0"
] | 20 | 2018-06-27T13:55:12.000Z | 2022-03-26T15:08:01.000Z | import cv2
# This is a demo of running face recognition on a video file and saving the results to a new video file.
#
# PLEASE NOTE: This example requires OpenCV (the `cv2` library) to be installed only to read from your webcam.
# OpenCV is *not* required to use the face_recognition library. It's only required if you ... | 38.794872 | 110 | 0.702578 | import cv2
# specific demo. If you have trouble installing it, try any of the other demos that don't require it instead.
import os
files = [path for path in os.listdir("./videos") if os.path.isfile(path) and path.endswith(".avi")]
frame_number = 0
for avi in files:
input_movie = cv2.VideoCapture(avi... | true | true |
1c4a0fd0c26a592c12df47d7e444bcfc3897cded | 37,709 | py | Python | sympy/functions/combinatorial/factorials.py | jainachal03/sympy | 7dbc2f49370b31ac6960524ea7e5444e2e5a50d5 | [
"BSD-3-Clause"
] | 1 | 2018-11-20T11:40:30.000Z | 2018-11-20T11:40:30.000Z | sympy/functions/combinatorial/factorials.py | jainachal03/sympy | 7dbc2f49370b31ac6960524ea7e5444e2e5a50d5 | [
"BSD-3-Clause"
] | 14 | 2018-02-08T10:11:03.000Z | 2019-04-16T10:32:46.000Z | sympy/functions/combinatorial/factorials.py | jainachal03/sympy | 7dbc2f49370b31ac6960524ea7e5444e2e5a50d5 | [
"BSD-3-Clause"
] | 1 | 2020-09-09T20:41:34.000Z | 2020-09-09T20:41:34.000Z | from typing import List
from functools import reduce
from sympy.core import S, sympify, Dummy, Mod
from sympy.core.cache import cacheit
from sympy.core.function import Function, ArgumentIndexError, PoleError
from sympy.core.logic import fuzzy_and
from sympy.core.numbers import Integer, pi, I
from sympy.core.relational... | 33.972072 | 106 | 0.497971 | from typing import List
from functools import reduce
from sympy.core import S, sympify, Dummy, Mod
from sympy.core.cache import cacheit
from sympy.core.function import Function, ArgumentIndexError, PoleError
from sympy.core.logic import fuzzy_and
from sympy.core.numbers import Integer, pi, I
from sympy.core.relational... | true | true |
1c4a104cf5b6c4c66a2d343c800f0bc19b3712c1 | 1,120 | py | Python | src/infi/pyutils/misc.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 1 | 2022-02-12T20:30:55.000Z | 2022-02-12T20:30:55.000Z | src/infi/pyutils/misc.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 5 | 2015-11-08T14:50:42.000Z | 2020-06-23T14:42:33.000Z | src/infi/pyutils/misc.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 4 | 2015-02-22T09:06:59.000Z | 2022-02-12T20:30:55.000Z | _NOTHING = object()
def recursive_getattr(obj, attr, default=_NOTHING):
for subattr in attr.split("."):
obj = getattr(obj, subattr, _NOTHING)
if obj is _NOTHING:
if default is not _NOTHING:
return default
raise AttributeError(attr)
return obj
class Repri... | 32.941176 | 62 | 0.621429 | _NOTHING = object()
def recursive_getattr(obj, attr, default=_NOTHING):
for subattr in attr.split("."):
obj = getattr(obj, subattr, _NOTHING)
if obj is _NOTHING:
if default is not _NOTHING:
return default
raise AttributeError(attr)
return obj
class Repri... | true | true |
1c4a10aa8c31765be89abb6d09a8c8e18a6945b0 | 5,744 | py | Python | qiskit/test/decorators.py | EnriqueL8/qiskit-terra | 08b801f1f8598c4e44680b4a75c232ed92db0262 | [
"Apache-2.0"
] | 2 | 2019-06-28T19:58:42.000Z | 2019-07-26T05:04:02.000Z | qiskit/test/decorators.py | EnriqueL8/qiskit-terra | 08b801f1f8598c4e44680b4a75c232ed92db0262 | [
"Apache-2.0"
] | null | null | null | qiskit/test/decorators.py | EnriqueL8/qiskit-terra | 08b801f1f8598c4e44680b4a75c232ed92db0262 | [
"Apache-2.0"
] | 1 | 2020-01-24T21:01:06.000Z | 2020-01-24T21:01:06.000Z | # -*- 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... | 31.56044 | 82 | 0.657556 |
import functools
import os
import sys
import unittest
from warnings import warn
from qiskit.util import _has_connection
from .testing_options import get_test_options
HAS_NET_CONNECTION = None
def is_aer_provider_available():
if sys.platform == 'darwin':
return False
try:
... | true | true |
1c4a1166d51808988f81418c99b6254b81daae63 | 4,071 | py | Python | alipay/aop/api/request/KoubeiServindustryPortfolioDataCreateRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/KoubeiServindustryPortfolioDataCreateRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/KoubeiServindustryPortfolioDataCreateRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.KoubeiServindustryPortfolioDataCreateModel import KoubeiServindustryPortfolioDataCreateModel
class KoubeiServindustryP... | 28.075862 | 166 | 0.651437 |
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.KoubeiServindustryPortfolioDataCreateModel import KoubeiServindustryPortfolioDataCreateModel
class KoubeiServindustryPortfolioDataCreateRequest(object):
def ... | true | true |
1c4a11f4340a879dad3ddc6e9c05271e621cc0f4 | 4,416 | py | Python | scripts/table4_run.py | nataliepopescu/osdi21-artifact | 6a268c90a8ce449256b5c290caeb7e0e3b9d7e5c | [
"MIT"
] | null | null | null | scripts/table4_run.py | nataliepopescu/osdi21-artifact | 6a268c90a8ce449256b5c290caeb7e0e3b9d7e5c | [
"MIT"
] | null | null | null | scripts/table4_run.py | nataliepopescu/osdi21-artifact | 6a268c90a8ce449256b5c290caeb7e0e3b9d7e5c | [
"MIT"
] | null | null | null | import os
import subprocess
import re
import time
from numpy import average
from ExpStats import runExpWithName
ROOT_PATH = os.path.dirname(os.path.realpath(__file__))
def parseThroughput(out):
try:
m = re.search(r'Requests/sec: ([0-9,.]+)', out)
# m = re.search(r'([0-9,]+) ns/iter', out)
... | 35.328 | 118 | 0.64538 | import os
import subprocess
import re
import time
from numpy import average
from ExpStats import runExpWithName
ROOT_PATH = os.path.dirname(os.path.realpath(__file__))
def parseThroughput(out):
try:
m = re.search(r'Requests/sec: ([0-9,.]+)', out)
s = m.group(1)
result = float(s.... | true | true |
1c4a1240142afa6606892ba452cdab5d9517361e | 396 | py | Python | apps/goods/migrations/0013_auto_20181010_1629.py | lianxiaopang/camel-store-api | b8021250bf3d8cf7adc566deebdba55225148316 | [
"Apache-2.0"
] | 12 | 2020-02-01T01:52:01.000Z | 2021-04-28T15:06:43.000Z | apps/goods/migrations/0013_auto_20181010_1629.py | lianxiaopang/camel-store-api | b8021250bf3d8cf7adc566deebdba55225148316 | [
"Apache-2.0"
] | 5 | 2020-02-06T08:07:58.000Z | 2020-06-02T13:03:45.000Z | apps/goods/migrations/0013_auto_20181010_1629.py | lianxiaopang/camel-store-api | b8021250bf3d8cf7adc566deebdba55225148316 | [
"Apache-2.0"
] | 11 | 2020-02-03T13:07:46.000Z | 2020-11-29T01:44:06.000Z | # Generated by Django 2.1.2 on 2018-10-10 08:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('goods', '0012_auto_20181010_1558'),
]
operations = [
migrations.AlterModelOptions(
name='goods',
options={'ordering': ('stat... | 22 | 97 | 0.598485 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('goods', '0012_auto_20181010_1558'),
]
operations = [
migrations.AlterModelOptions(
name='goods',
options={'ordering': ('status',), 'verbose_name': '商品', 'verbose_name_plur... | true | true |
1c4a12fad6dad46559aac33e6d98b82995bb2863 | 4,099 | py | Python | src/one_stack.py | noemiefedon/RELAY | 1bf9c27ee1bcf1be0a7652fcca0ea38dd47b14b8 | [
"MIT"
] | 1 | 2020-12-07T22:18:22.000Z | 2020-12-07T22:18:22.000Z | src/one_stack.py | noemiefedon/RELAY | 1bf9c27ee1bcf1be0a7652fcca0ea38dd47b14b8 | [
"MIT"
] | null | null | null | src/one_stack.py | noemiefedon/RELAY | 1bf9c27ee1bcf1be0a7652fcca0ea38dd47b14b8 | [
"MIT"
] | 1 | 2021-12-02T22:19:02.000Z | 2021-12-02T22:19:02.000Z | # -*- coding: utf-8 -*-
"""
Functions to check a design manufacturability
- check_ss_manufacturability
checks the manufacturability of a stacking sequence list
"""
__version__ = '1.0'
__author__ = 'Noemie Fedon'
import sys
import numpy as np
sys.path.append(r'C:\RELAY')
from src.contiguity import is_contig
from s... | 42.257732 | 1,024 | 0.56648 |
__version__ = '1.0'
__author__ = 'Noemie Fedon'
import sys
import numpy as np
sys.path.append(r'C:\RELAY')
from src.contiguity import is_contig
from src.disorientation import is_diso_ss
from src.balance import is_balanced
from src.dam_tol import is_dam_tol
from src.ten_percent_rule import is_ten_percent_rule
from src... | true | true |
1c4a1315d41ea7313fba33ea72615b897facc135 | 2,937 | py | Python | bayesian/__init__.py | prashbnair/fabric8-analytics-server | af1f71018b82ebafae7701a443412eed34de5a15 | [
"Apache-2.0"
] | null | null | null | bayesian/__init__.py | prashbnair/fabric8-analytics-server | af1f71018b82ebafae7701a443412eed34de5a15 | [
"Apache-2.0"
] | null | null | null | bayesian/__init__.py | prashbnair/fabric8-analytics-server | af1f71018b82ebafae7701a443412eed34de5a15 | [
"Apache-2.0"
] | null | null | null | """Module with the declaration of web application and its basic endpoints."""
import logging
import os
from f8a_worker.setup_celery import init_selinon
from flask import Flask
from flask import g
from flask import redirect
from flask import url_for
from flask_appconfig import AppConfig
from flask_cache import Cache
f... | 31.244681 | 96 | 0.712632 |
import logging
import os
from f8a_worker.setup_celery import init_selinon
from flask import Flask
from flask import g
from flask import redirect
from flask import url_for
from flask_appconfig import AppConfig
from flask_cache import Cache
from flask_sqlalchemy import SQLAlchemy
from raven.contrib.flask import Sentry
... | true | true |
1c4a13f112efc10a3c692c96f72757500976a370 | 688 | py | Python | leetcode/122/122.best-time-to-buy-and-sell-stock-ii.py | Yu-Ren-NEU/Leetcode | e82bc2734680606f676fe867dbcb9b9e71635bf5 | [
"MIT"
] | 1 | 2020-01-06T06:54:22.000Z | 2020-01-06T06:54:22.000Z | leetcode/122/122.best-time-to-buy-and-sell-stock-ii.py | Yu-Ren-NEU/Leetcode | e82bc2734680606f676fe867dbcb9b9e71635bf5 | [
"MIT"
] | 1 | 2020-01-07T02:22:06.000Z | 2020-01-07T02:22:06.000Z | leetcode/122/122.best-time-to-buy-and-sell-stock-ii.py | Yu-Ren-NEU/Leetcode | e82bc2734680606f676fe867dbcb9b9e71635bf5 | [
"MIT"
] | 2 | 2020-01-06T20:04:04.000Z | 2020-01-10T08:24:01.000Z | #
# @lc app=leetcode id=122 lang=python3
#
# [122] Best Time to Buy and Sell Stock II
#
# @lc code=start
class Solution:
def maxProfit(self, prices: []) -> int:
# 我们将数值画到x-y坐标系里
# 其实要求的就是单调上升的曲线, 找到相应的波峰
if not prices or len(prices) == 1:
return 0
result = 0
... | 20.848485 | 50 | 0.52907 |
class Solution:
def maxProfit(self, prices: []) -> int:
if not prices or len(prices) == 1:
return 0
result = 0
for i in range(1, len(prices)):
if prices[i] > prices[i-1]:
result += prices[i] - prices[i-1]
re... | true | true |
1c4a14c58058bc5cfda3413c3de34fb336ef5ce8 | 1,418 | py | Python | sw/scripts/jlink.py | alvarop/chaac | a86d3c71acf3f87584ba260cbfe207b3a09213ad | [
"MIT"
] | 21 | 2019-01-27T03:15:27.000Z | 2021-07-03T06:40:40.000Z | sw/scripts/jlink.py | alvarop/chaac | a86d3c71acf3f87584ba260cbfe207b3a09213ad | [
"MIT"
] | 1 | 2021-07-08T04:46:42.000Z | 2021-07-08T04:46:42.000Z | sw/scripts/jlink.py | alvarop/chaac | a86d3c71acf3f87584ba260cbfe207b3a09213ad | [
"MIT"
] | 3 | 2019-02-19T19:57:30.000Z | 2020-07-11T11:27:51.000Z | #!/usr/bin/env python
import argparse
import os
import sys
import time
import tempfile
import subprocess
JLINK_PATH = "/usr/bin/JLinkExe"
parser = argparse.ArgumentParser()
parser.add_argument("--dump", action="store_true")
parser.add_argument("--erase", action="store_true")
parser.add_argument("--device", default=... | 25.781818 | 77 | 0.665021 |
import argparse
import os
import sys
import time
import tempfile
import subprocess
JLINK_PATH = "/usr/bin/JLinkExe"
parser = argparse.ArgumentParser()
parser.add_argument("--dump", action="store_true")
parser.add_argument("--erase", action="store_true")
parser.add_argument("--device", default="stm32l432kc", help="... | true | true |
1c4a14e406aa1e3b330cf49b14434163e125ec06 | 78,955 | py | Python | futu/quote/open_quote_context.py | postpascal/py-futu-api | cb274d5ab5387dca190b739d161f2bc8eabe073d | [
"Apache-2.0"
] | 1 | 2019-09-01T08:49:46.000Z | 2019-09-01T08:49:46.000Z | futu/quote/open_quote_context.py | faruto/py-futu-api | cb274d5ab5387dca190b739d161f2bc8eabe073d | [
"Apache-2.0"
] | null | null | null | futu/quote/open_quote_context.py | faruto/py-futu-api | cb274d5ab5387dca190b739d161f2bc8eabe073d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Market quote and trade context setting
"""
import datetime
import math
from time import sleep
import pandas as pd
from futu.common.open_context_base import OpenContextBase, ContextStatus
from futu.quote.quote_query import *
class OpenQuoteContext(OpenContextBase):
"""行情上下文对象类"""
... | 41.841547 | 184 | 0.45184 |
import datetime
import math
from time import sleep
import pandas as pd
from futu.common.open_context_base import OpenContextBase, ContextStatus
from futu.quote.quote_query import *
class OpenQuoteContext(OpenContextBase):
def __init__(self, host='127.0.0.1', port=11111):
self._ctx_subscribe = {}
... | true | true |
1c4a1518d68c3a0ac4df0c03d4e9484fa9bf6c93 | 4,468 | py | Python | autocomplete_light/tests/autocomplete/generic.py | andybak/django-autocomplete-light | 19e46261a01a578d73bfae02bf772bc4d81984f9 | [
"MIT"
] | null | null | null | autocomplete_light/tests/autocomplete/generic.py | andybak/django-autocomplete-light | 19e46261a01a578d73bfae02bf772bc4d81984f9 | [
"MIT"
] | null | null | null | autocomplete_light/tests/autocomplete/generic.py | andybak/django-autocomplete-light | 19e46261a01a578d73bfae02bf772bc4d81984f9 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from .case import *
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Permission
from ...example_apps.autocomplete_test_case_app.models import User, Group
class AutocompleteGenericMock(autocomplete_light.AutocompleteGenericBase... | 30.60274 | 77 | 0.456356 | from __future__ import unicode_literals
from .case import *
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Permission
from ...example_apps.autocomplete_test_case_app.models import User, Group
class AutocompleteGenericMock(autocomplete_light.AutocompleteGenericBase... | true | true |
1c4a1587700058c4fc116b57e305bc04604cf101 | 168 | py | Python | cemm/exceptions.py | klaasnicolaas/python-cemm | fa1d9787bdf4d41e1850015e4d9df833d0b97b07 | [
"MIT"
] | 1 | 2022-02-20T17:26:02.000Z | 2022-02-20T17:26:02.000Z | cemm/exceptions.py | klaasnicolaas/python-cemm | fa1d9787bdf4d41e1850015e4d9df833d0b97b07 | [
"MIT"
] | 109 | 2021-10-02T02:55:42.000Z | 2022-03-30T04:32:25.000Z | cemm/exceptions.py | klaasnicolaas/python-cemm | fa1d9787bdf4d41e1850015e4d9df833d0b97b07 | [
"MIT"
] | null | null | null | """Exceptions for CEMM."""
class CEMMError(Exception):
"""General CEMM exception."""
class CEMMConnectionError(CEMMError):
"""CEMM connection exception."""
| 16.8 | 37 | 0.690476 |
class CEMMError(Exception):
class CEMMConnectionError(CEMMError):
| true | true |
1c4a15ad041bcfb763454dea5efe21d533781450 | 2,980 | py | Python | tests/unit/test_common.py | HemangChothani/google-resumable-media-python | 7dc40de34533e4474240fc831b79cee2baa82c6e | [
"Apache-2.0"
] | 1 | 2019-07-30T14:24:08.000Z | 2019-07-30T14:24:08.000Z | tests/unit/test_common.py | HemangChothani/google-resumable-media-python | 7dc40de34533e4474240fc831b79cee2baa82c6e | [
"Apache-2.0"
] | 3 | 2019-07-07T17:55:56.000Z | 2019-08-05T01:13:27.000Z | tests/unit/test_common.py | HemangChothani/google-resumable-media-python | 7dc40de34533e4474240fc831b79cee2baa82c6e | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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 writing, ... | 37.25 | 79 | 0.72349 |
import mock
import pytest
from google.resumable_media import common
class TestInvalidResponse(object):
def test_constructor(self):
response = mock.sentinel.response
error = common.InvalidResponse(
response, 1, u'a', [b'm'], True)
assert error.response is respon... | true | true |
1c4a160721a6fe7cb7d9b89d16df5a107e587737 | 1,182 | py | Python | ckanext/harvest/logic/auth/__init__.py | alphagov-mirror/ckanext-harvest | be4d134cf2e4d4548c67dc2f61b200948f0f74e0 | [
"PostgreSQL"
] | 86 | 2015-01-09T19:21:20.000Z | 2022-03-23T07:17:27.000Z | ckanext/harvest/logic/auth/__init__.py | alphagov-mirror/ckanext-harvest | be4d134cf2e4d4548c67dc2f61b200948f0f74e0 | [
"PostgreSQL"
] | 319 | 2015-01-13T13:40:08.000Z | 2022-03-24T12:13:42.000Z | ckanext/harvest/logic/auth/__init__.py | alphagov-mirror/ckanext-harvest | be4d134cf2e4d4548c67dc2f61b200948f0f74e0 | [
"PostgreSQL"
] | 154 | 2015-01-13T21:06:03.000Z | 2022-03-15T12:10:57.000Z | from ckan.plugins import toolkit as pt
from ckanext.harvest import model as harvest_model
def user_is_sysadmin(context):
'''
Checks if the user defined in the context is a sysadmin
rtype: boolean
'''
model = context['model']
user = context['user']
user_obj = model.User.get(user)
... | 26.266667 | 75 | 0.665821 | from ckan.plugins import toolkit as pt
from ckanext.harvest import model as harvest_model
def user_is_sysadmin(context):
model = context['model']
user = context['user']
user_obj = model.User.get(user)
if not user_obj:
raise pt.Objectpt.ObjectNotFound('User {0} not found').format(user)
ret... | true | true |
1c4a16408d89c66b6f8bf1f9a92e53a8e91f5fe6 | 8,378 | py | Python | fabric/fabfile.py | jim8786453/kiln_share | 2d70c8863f7db18069d13cdea319cd113a2d0bbb | [
"BSD-3-Clause"
] | 1 | 2018-03-21T12:27:56.000Z | 2018-03-21T12:27:56.000Z | fabric/fabfile.py | jim8786453/kiln_share | 2d70c8863f7db18069d13cdea319cd113a2d0bbb | [
"BSD-3-Clause"
] | null | null | null | fabric/fabfile.py | jim8786453/kiln_share | 2d70c8863f7db18069d13cdea319cd113a2d0bbb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from fabric.api import run, env, settings, cd, task, put, execute
from fabric.contrib.files import exists, upload_template
from fabric.operations import _prefix_commands, _prefix_env_vars, require, sudo, local as local_
env.use_ssh_config = True
LOCAL_HOST = os.environ.get('LOCAL_H... | 23.337047 | 111 | 0.630461 |
import os
from fabric.api import run, env, settings, cd, task, put, execute
from fabric.contrib.files import exists, upload_template
from fabric.operations import _prefix_commands, _prefix_env_vars, require, sudo, local as local_
env.use_ssh_config = True
LOCAL_HOST = os.environ.get('LOCAL_HOST')
LOCAL_USER = os.e... | false | true |
1c4a165fe953944a991af628f8e92d4c59b8d672 | 1,549 | py | Python | ml3d/torch/utils/roipool3d/roipool3d_utils.py | krshrimali/Open3D-ML | e6352ee84d38a4b90c71dd7f376f5570fe849537 | [
"MIT"
] | 447 | 2020-10-14T23:16:41.000Z | 2021-07-27T06:57:45.000Z | ml3d/torch/utils/roipool3d/roipool3d_utils.py | krshrimali/Open3D-ML | e6352ee84d38a4b90c71dd7f376f5570fe849537 | [
"MIT"
] | 179 | 2021-07-27T15:32:33.000Z | 2022-03-30T14:32:53.000Z | ml3d/torch/utils/roipool3d/roipool3d_utils.py | krshrimali/Open3D-ML | e6352ee84d38a4b90c71dd7f376f5570fe849537 | [
"MIT"
] | 92 | 2021-07-28T13:50:52.000Z | 2022-03-30T09:24:33.000Z | import torch
import open3d
if open3d.core.cuda.device_count() > 0:
from open3d.ml.torch.ops import roi_pool
import numpy as np
def enlarge_box3d(boxes3d, extra_width):
"""Enlarge 3D box.
Args:
boxes3d: (N, 7) [x, y, z, h, w, l, ry]
extra_width: extra width
"""
if isinstance(boxes3... | 28.163636 | 78 | 0.542285 | import torch
import open3d
if open3d.core.cuda.device_count() > 0:
from open3d.ml.torch.ops import roi_pool
import numpy as np
def enlarge_box3d(boxes3d, extra_width):
if isinstance(boxes3d, np.ndarray):
large_boxes3d = boxes3d.copy()
else:
large_boxes3d = boxes3d.clone()
large_boxes3d... | true | true |
1c4a18579c83b46e8f6e2e84863af984b6e3501c | 2,335 | py | Python | apricotlib/raptorx_secstr.py | malvikasharan/APRICOT | 529afadfb99fa8249fa4ecfb07253eab892c7a8e | [
"0BSD"
] | 5 | 2016-05-25T12:30:02.000Z | 2021-04-11T14:55:32.000Z | apricotlib/raptorx_secstr.py | malvikasharan/APRICOT | 529afadfb99fa8249fa4ecfb07253eab892c7a8e | [
"0BSD"
] | 1 | 2017-05-20T07:19:25.000Z | 2018-02-05T22:14:12.000Z | apricotlib/raptorx_secstr.py | malvikasharan/APRICOT | 529afadfb99fa8249fa4ecfb07253eab892c7a8e | [
"0BSD"
] | 6 | 2016-05-18T07:08:49.000Z | 2021-02-20T14:28:55.000Z | #!/usr/bin/env python
# Description = Predict 3 or 8 state secondary structure using RaptorX
import os
import subprocess
class RaptorxSecstrAnalysis(object):
def __init__(self, selected_proteins, raptorx_path,
fasta_path, outpath):
self._selected_proteins = selected_proteins
self... | 40.258621 | 78 | 0.568737 |
import os
import subprocess
class RaptorxSecstrAnalysis(object):
def __init__(self, selected_proteins, raptorx_path,
fasta_path, outpath):
self._selected_proteins = selected_proteins
self._raptorx_path = raptorx_path
self._fasta_path = fasta_path
self._outpath =... | true | true |
1c4a18e8aea20d95df3d8fe117a47346ed852aa9 | 357 | py | Python | tutorial/gallery.py | bricakeld/dash-docs | a79f52ac88c6ebff10a5b2e0af43e89410372dd4 | [
"MIT"
] | null | null | null | tutorial/gallery.py | bricakeld/dash-docs | a79f52ac88c6ebff10a5b2e0af43e89410372dd4 | [
"MIT"
] | 3 | 2021-03-31T19:16:27.000Z | 2021-12-13T20:27:16.000Z | tutorial/gallery.py | bricakeld/dash-docs | a79f52ac88c6ebff10a5b2e0af43e89410372dd4 | [
"MIT"
] | 1 | 2022-03-18T09:41:34.000Z | 2022-03-18T09:41:34.000Z | # -*- coding: utf-8 -*-
import dash_html_components as html
import dash_core_components as dcc
from textwrap import dedent
layout = html.Div(className='gallery', children=[
dcc.Markdown(dedent('''
## The Dash App Gallery has moved!
It is now at [https://dash-gallery.plotly.host/Portal/](https://dash-galle... | 27.461538 | 101 | 0.697479 |
import dash_html_components as html
import dash_core_components as dcc
from textwrap import dedent
layout = html.Div(className='gallery', children=[
dcc.Markdown(dedent('''
## The Dash App Gallery has moved!
It is now at [https://dash-gallery.plotly.host/Portal/](https://dash-gallery.plotly.host/Portal/)... | true | true |
1c4a1ab1f277c42ed8aa39fecf9d2cbfe95ad12c | 1,883 | py | Python | examples/ramps.py | plecto/motorway | ce42b77a9a2d48cf1a9fd2f3bc405accb98030df | [
"Apache-2.0"
] | 166 | 2015-01-19T05:39:24.000Z | 2022-02-26T15:09:34.000Z | examples/ramps.py | plecto/motorway | ce42b77a9a2d48cf1a9fd2f3bc405accb98030df | [
"Apache-2.0"
] | 17 | 2016-07-29T10:23:24.000Z | 2022-01-04T10:09:01.000Z | examples/ramps.py | plecto/motorway | ce42b77a9a2d48cf1a9fd2f3bc405accb98030df | [
"Apache-2.0"
] | 21 | 2016-09-08T12:26:50.000Z | 2021-07-08T09:54:16.000Z | import time
import uuid
from motorway.contrib.amazon_kinesis.ramps import KinesisRamp
from motorway.contrib.amazon_kinesis.intersections import KinesisInsertIntersection
from motorway.contrib.amazon_sqs.ramps import SQSRamp
from motorway.messages import Message
from motorway.ramp import Ramp
import random
class WordR... | 30.868852 | 100 | 0.659586 | import time
import uuid
from motorway.contrib.amazon_kinesis.ramps import KinesisRamp
from motorway.contrib.amazon_kinesis.intersections import KinesisInsertIntersection
from motorway.contrib.amazon_sqs.ramps import SQSRamp
from motorway.messages import Message
from motorway.ramp import Ramp
import random
class WordR... | true | true |
1c4a1e994f54a55d96dde9d569cf6f8d99b2a79c | 13,569 | py | Python | src/main/python/ui/batch.py | bmiller/beqdesigner | 36d0c780507a564536038e2c9fc3b03b75dedaf4 | [
"MIT"
] | 16 | 2019-04-12T00:04:56.000Z | 2022-03-15T14:26:56.000Z | src/main/python/ui/batch.py | bmiller/beqdesigner | 36d0c780507a564536038e2c9fc3b03b75dedaf4 | [
"MIT"
] | 400 | 2018-08-27T10:04:00.000Z | 2022-03-15T21:32:33.000Z | src/main/python/ui/batch.py | bmiller/beqdesigner | 36d0c780507a564536038e2c9fc3b03b75dedaf4 | [
"MIT"
] | 6 | 2018-09-19T21:02:27.000Z | 2020-10-18T04:11:01.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'batch.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui,... | 57.012605 | 147 | 0.72614 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_batchExtractDialog(object):
def setupUi(self, batchExtractDialog):
batchExtractDialog.setObjectName("batchExtractDialog")
batchExtractDialog.resize(1727, 925)
self.verticalLayout = QtWidgets.QVBoxLayout(batchExtractDialog)
... | true | true |
1c4a200a2dc8929dcf29774d5051e237b10a7a33 | 69,048 | py | Python | tensorflow/python/ops/math_ops.py | seyoung-hyun/tensorflow | 2ac978d2532dd359dd7ebbd27ac13dfa147d755d | [
"Apache-2.0"
] | 1 | 2018-10-16T07:59:09.000Z | 2018-10-16T07:59:09.000Z | tensorflow/python/ops/math_ops.py | seyoung-hyun/tensorflow | 2ac978d2532dd359dd7ebbd27ac13dfa147d755d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/math_ops.py | seyoung-hyun/tensorflow | 2ac978d2532dd359dd7ebbd27ac13dfa147d755d | [
"Apache-2.0"
] | 1 | 2018-10-16T07:58:38.000Z | 2018-10-16T07:58:38.000Z | # Copyright 2015 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... | 33.930221 | 86 | 0.683119 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import common_shapes
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python... | true | true |
1c4a20e25214c64f1fee4492086b179d9de887ea | 5,520 | py | Python | imsngpy/gpwatch.py | SilverRon/imsngpy | e9e55a73403bef4c73dcc242735efc28d79a3066 | [
"MIT"
] | 1 | 2021-12-22T08:58:47.000Z | 2021-12-22T08:58:47.000Z | imsngpy/gpwatch.py | SilverRon/imsngpy | e9e55a73403bef4c73dcc242735efc28d79a3066 | [
"MIT"
] | null | null | null | imsngpy/gpwatch.py | SilverRon/imsngpy | e9e55a73403bef4c73dcc242735efc28d79a3066 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#============================================================
# Module
#------------------------------------------------------------
import os
import sys
import time
# IMSNGpy modules
sys.path.append('/home/paek/imsngpy')
from misc import *
# Astropy
from astropy.io import... | 27.6 | 108 | 0.509058 |
import os
import sys
import time
sys.path.append('/home/paek/imsngpy')
from misc import *
from astropy.io import ascii
def get_size(start_path = '.'):
total_size = 0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filenames:
fp = os.path.join(dirpath, f)
if not os.path.islink(f... | true | true |
1c4a210a93526f7ae8c560a788759b5ed53c5f6f | 21,306 | py | Python | src/briefcase/commands/base.py | chuckyQ/briefcase | 06e84e7b1c3af016c828a5a640d277809de6644b | [
"BSD-3-Clause"
] | 3 | 2020-10-20T00:59:22.000Z | 2021-02-22T09:22:00.000Z | src/briefcase/commands/base.py | chuckyQ/briefcase | 06e84e7b1c3af016c828a5a640d277809de6644b | [
"BSD-3-Clause"
] | null | null | null | src/briefcase/commands/base.py | chuckyQ/briefcase | 06e84e7b1c3af016c828a5a640d277809de6644b | [
"BSD-3-Clause"
] | null | null | null |
import argparse
import importlib
import inspect
import os
import platform
import shutil
import sys
from abc import ABC, abstractmethod
from cgi import parse_header
from pathlib import Path
from urllib.parse import urlparse
import requests
import toml
from cookiecutter.main import cookiecutter
from cookiecutter.reposi... | 36.797927 | 107 | 0.597766 |
import argparse
import importlib
import inspect
import os
import platform
import shutil
import sys
from abc import ABC, abstractmethod
from cgi import parse_header
from pathlib import Path
from urllib.parse import urlparse
import requests
import toml
from cookiecutter.main import cookiecutter
from cookiecutter.reposi... | true | true |
1c4a21aabd3ae6db6ff20f418f668c968e995202 | 1,966 | py | Python | utils/setup.py | david8862/keras-CenterNet | e74b933f6dd5ffac04f2de3eb0d887742be8490f | [
"Apache-2.0"
] | null | null | null | utils/setup.py | david8862/keras-CenterNet | e74b933f6dd5ffac04f2de3eb0d887742be8490f | [
"Apache-2.0"
] | null | null | null | utils/setup.py | david8862/keras-CenterNet | e74b933f6dd5ffac04f2de3eb0d887742be8490f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import setuptools
from setuptools.extension import Extension
from distutils.command.build_ext import build_ext as DistUtilsBuildExt
class BuildExtension(setuptools.Command):
description = DistUtilsBuildExt.description
user_options = DistUtilsBuildExt.user_... | 32.229508 | 80 | 0.660224 |
import setuptools
from setuptools.extension import Extension
from distutils.command.build_ext import build_ext as DistUtilsBuildExt
class BuildExtension(setuptools.Command):
description = DistUtilsBuildExt.description
user_options = DistUtilsBuildExt.user_options
boolean_options = DistUtilsBuildE... | true | true |
1c4a21e7724b1a0546fadafe66916377d6168f66 | 6,287 | py | Python | engine/trainer/train.py | 7eta/udk_labeler | 8cd8a86bc1a78647c0aaf81ca78e6e518fb86ceb | [
"Apache-2.0"
] | 2 | 2021-03-08T02:29:09.000Z | 2021-03-08T02:29:11.000Z | engine/trainer/train.py | 7eta/udk_labeler | 8cd8a86bc1a78647c0aaf81ca78e6e518fb86ceb | [
"Apache-2.0"
] | null | null | null | engine/trainer/train.py | 7eta/udk_labeler | 8cd8a86bc1a78647c0aaf81ca78e6e518fb86ceb | [
"Apache-2.0"
] | null | null | null | import os
import argparse
import numpy as np
import torch
import torch.optim as optim
from engine.dataloader import get_dataloader
from engine.retinanet import model
from engine.retinanet import coco_eval
from engine.log.saver import Saver
from tqdm import tqdm
from collections import deque
from engine.log import logge... | 41.091503 | 119 | 0.585335 | import os
import argparse
import numpy as np
import torch
import torch.optim as optim
from engine.dataloader import get_dataloader
from engine.retinanet import model
from engine.retinanet import coco_eval
from engine.log.saver import Saver
from tqdm import tqdm
from collections import deque
from engine.log import logge... | true | true |
1c4a220909211a50d6280d47c38bfe37ab27a7a4 | 5,687 | py | Python | ipro/moduleModbusTCP.py | pavelk43/ipro_site | 6e5bab5df0ad62f4d78ca96062d02a7be56bc132 | [
"MIT"
] | null | null | null | ipro/moduleModbusTCP.py | pavelk43/ipro_site | 6e5bab5df0ad62f4d78ca96062d02a7be56bc132 | [
"MIT"
] | null | null | null | ipro/moduleModbusTCP.py | pavelk43/ipro_site | 6e5bab5df0ad62f4d78ca96062d02a7be56bc132 | [
"MIT"
] | null | null | null | import time, datetime
import payload
import socket
class moduleModbusTCP():
def __init__(self, ip, port = 502):
self.modbusCommands = { "read holdings" : 3,
"read inputs" : 4,
"write holding" : 6,
"write... | 33.452941 | 113 | 0.519958 | import time, datetime
import payload
import socket
class moduleModbusTCP():
def __init__(self, ip, port = 502):
self.modbusCommands = { "read holdings" : 3,
"read inputs" : 4,
"write holding" : 6,
"write... | false | true |
1c4a245d2bb97a1c4a9d4c44fe206db1ec8eb500 | 1,617 | py | Python | venv/Lib/site-packages/keystoneclient/tests/unit/v3/test_simple_cert.py | prasoon-uta/IBM-coud-storage | 82a6876316715efbd0b492d0d467dde0ab26a56b | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/keystoneclient/tests/unit/v3/test_simple_cert.py | prasoon-uta/IBM-coud-storage | 82a6876316715efbd0b492d0d467dde0ab26a56b | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/keystoneclient/tests/unit/v3/test_simple_cert.py | prasoon-uta/IBM-coud-storage | 82a6876316715efbd0b492d0d467dde0ab26a56b | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 IBM Corp.
# 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, software... | 39.439024 | 77 | 0.713667 |
import testresources
from keystoneclient.tests.unit import client_fixtures
from keystoneclient.tests.unit.v3 import utils
class SimpleCertTests(utils.ClientTestCase, testresources.ResourcedTestCase):
resources = [('examples', client_fixtures.EXAMPLES_RESOURCE)]
def test_get_ca_certificate(self... | true | true |
1c4a24828c826c88606ac6a3b6cd095dfec7005a | 15,703 | py | Python | tests/chainer_tests/test_optimizer.py | toshihikoyanase/chainer | 65b34a19d28f60f732c7069163ca23c710a309f4 | [
"MIT"
] | null | null | null | tests/chainer_tests/test_optimizer.py | toshihikoyanase/chainer | 65b34a19d28f60f732c7069163ca23c710a309f4 | [
"MIT"
] | 2 | 2018-01-09T23:05:30.000Z | 2018-01-19T01:19:34.000Z | tests/chainer_tests/test_optimizer.py | bkvogel/chainer | 894cd5d008f11eccdf6e1d7106f5b8bfff9ce005 | [
"MIT"
] | null | null | null | import copy
import unittest
import warnings
import mock
import numpy as np
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import optimizer
from chainer import optimizers
from chainer import testing
from chainer.testing import attr
class TestHyperparameter(unittest.TestCase... | 32.244353 | 79 | 0.650513 | import copy
import unittest
import warnings
import mock
import numpy as np
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import optimizer
from chainer import optimizers
from chainer import testing
from chainer.testing import attr
class TestHyperparameter(unittest.TestCase... | true | true |
1c4a24cc773c14d0bd1e71136945beaa0f74f406 | 880 | py | Python | algorithms/sorting/bubble_sort.py | FatiahBalo/python-ds | 9eb88425822b6da4d7bd673a124c13fbe6f17523 | [
"MIT"
] | 1,723 | 2019-07-30T07:06:22.000Z | 2022-03-31T15:22:22.000Z | algorithms/sorting/bubble_sort.py | FatiahBalo/python-ds | 9eb88425822b6da4d7bd673a124c13fbe6f17523 | [
"MIT"
] | 213 | 2019-10-06T08:07:47.000Z | 2021-10-04T15:38:36.000Z | algorithms/sorting/bubble_sort.py | FatiahBalo/python-ds | 9eb88425822b6da4d7bd673a124c13fbe6f17523 | [
"MIT"
] | 628 | 2019-10-06T10:26:25.000Z | 2022-03-31T01:41:00.000Z | """
Bubble Sort worst time complexity occurs when array is reverse sorted - O(n^2)
Best time scenario is when array is already sorted - O(n)
"""
def bubble_sort(array):
n = len(array)
for i in range(n):
for j in range(0, n-i-1):
if array[j] > array[j+1]:
array[j], array[j+1]... | 28.387097 | 78 | 0.590909 |
def bubble_sort(array):
n = len(array)
for i in range(n):
for j in range(0, n-i-1):
if array[j] > array[j+1]:
array[j], array[j+1] = array[j+1], array[j]
return array
def bubble_sort_optimized(array):
has_swapped = True
num_of_iterations = 0
while has_sw... | true | true |
1c4a25bdb5c01fe4151a35fa9ee19f84f4205240 | 59,338 | py | Python | sdks/python/apache_beam/runners/common.py | rehmanmuradali/beam | de8ff705145cbbc41bea7750a0a5d3553924ab3a | [
"Apache-2.0"
] | 1 | 2022-01-24T22:07:52.000Z | 2022-01-24T22:07:52.000Z | sdks/python/apache_beam/runners/common.py | rehmanmuradali/beam | de8ff705145cbbc41bea7750a0a5d3553924ab3a | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/runners/common.py | rehmanmuradali/beam | de8ff705145cbbc41bea7750a0a5d3553924ab3a | [
"Apache-2.0"
] | 1 | 2019-05-21T11:30:31.000Z | 2019-05-21T11:30:31.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 39.985175 | 112 | 0.695473 |
from __future__ import absolute_import
from __future__ import division
import threading
import traceback
from builtins import next
from builtins import object
from builtins import round
from builtins import zip
from typing import TYPE_CHECKING
from typing import Any
from typing import Dict
from ty... | true | true |
1c4a2669e7ad9b363505ce2e8e13f926ee994dbe | 55,879 | py | Python | vistrails/db/versions/v0_8_0/persistence/xml/auto_gen.py | celiafish/VisTrails | d8cb575b8b121941de190fe608003ad1427ef9f6 | [
"BSD-3-Clause"
] | 1 | 2015-05-11T16:46:49.000Z | 2015-05-11T16:46:49.000Z | vistrails/db/versions/v0_8_0/persistence/xml/auto_gen.py | celiafish/VisTrails | d8cb575b8b121941de190fe608003ad1427ef9f6 | [
"BSD-3-Clause"
] | null | null | null | vistrails/db/versions/v0_8_0/persistence/xml/auto_gen.py | celiafish/VisTrails | d8cb575b8b121941de190fe608003ad1427ef9f6 | [
"BSD-3-Clause"
] | null | null | null | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | 36.474543 | 93 | 0.546824 | , dao):
return self.daoList[dao]
def fromXML(self, node):
if node.tag != 'tag':
return None
data = node.get('id', None)
id = self.convertFromStr(data, 'long')
data = node.get('name', None)
name = self.convertFromStr(data, 'str')
... | false | true |
1c4a26ec5b0edc44879d37cfc3b85a407c83e08a | 9,618 | py | Python | src/python/pants/reporting/plaintext_reporter.py | qma/pants | 604f58a366b66bc5cfa83e7250cb8af8130832cf | [
"Apache-2.0"
] | null | null | null | src/python/pants/reporting/plaintext_reporter.py | qma/pants | 604f58a366b66bc5cfa83e7250cb8af8130832cf | [
"Apache-2.0"
] | null | null | null | src/python/pants/reporting/plaintext_reporter.py | qma/pants | 604f58a366b66bc5cfa83e7250cb8af8130832cf | [
"Apache-2.0"
] | 1 | 2019-06-10T17:24:34.000Z | 2019-06-10T17:24:34.000Z | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from collections imp... | 39.580247 | 109 | 0.694843 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from collections import namedtuple
import six
from colors import cyan, green, red, yellow
from pants.base.workunit import WorkUnit, WorkUnitLabel
from pants.repo... | true | true |
1c4a285a311b988d2b7f90c24434d040cd54642a | 3,886 | py | Python | setup.py | herrkaefer/psycopgr | 376e8511ac591d32533118b5006135458cb5f27f | [
"MIT"
] | 23 | 2017-12-01T03:47:23.000Z | 2022-01-06T23:36:56.000Z | setup.py | herrkaefer/psycopgr | 376e8511ac591d32533118b5006135458cb5f27f | [
"MIT"
] | 9 | 2017-11-10T00:33:50.000Z | 2021-06-06T01:27:20.000Z | setup.py | herrkaefer/psycopgr | 376e8511ac591d32533118b5006135458cb5f27f | [
"MIT"
] | 9 | 2017-11-09T13:38:10.000Z | 2022-02-17T16:08:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Ackownledgement:
# This file is modified from https://github.com/kennethreitz/setup.py
#
# Note: To use the 'upload' functionality of this file, you must:
# $ pipenv install twine --dev
import io
import os
import sys
from shutil import rmtree
from setuptools impor... | 28.785185 | 90 | 0.643592 |
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
NAME = 'psycopgr'
DESCRIPTION = 'A Python wrapper of pgRouting for routing from nodes to nodes on real map.'
URL = 'https://github.com/herrkaefer/psycopgr'
EMAIL = 'gloolar@gmail.com'
AUTHOR = 'Yang... | true | true |
1c4a2fa84a2670f568ddc2052bf3b41997f3a6af | 7,462 | py | Python | tests/components/media_player/test_async_helpers.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 4 | 2019-01-10T14:47:54.000Z | 2021-04-22T02:06:27.000Z | tests/components/media_player/test_async_helpers.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 6 | 2021-02-08T21:02:40.000Z | 2022-03-12T00:52:16.000Z | tests/components/media_player/test_async_helpers.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 3 | 2018-08-29T19:26:20.000Z | 2020-01-19T11:58:22.000Z | """The tests for the Async Media player helper functions."""
import unittest
import asyncio
import homeassistant.components.media_player as mp
from homeassistant.const import (
STATE_PLAYING, STATE_PAUSED, STATE_ON, STATE_OFF, STATE_IDLE)
from homeassistant.util.async_ import run_coroutine_threadsafe
from tests.c... | 33.3125 | 77 | 0.641785 | import unittest
import asyncio
import homeassistant.components.media_player as mp
from homeassistant.const import (
STATE_PLAYING, STATE_PAUSED, STATE_ON, STATE_OFF, STATE_IDLE)
from homeassistant.util.async_ import run_coroutine_threadsafe
from tests.common import get_test_home_assistant
class AsyncMediaPlayer... | true | true |
1c4a2fb0bc1d5a5a20808b69120dab5af1370e7c | 1,850 | py | Python | main.py | qianqianjun/DCGAN | 4e2d37f1d785e592e59334b91d197ef0475c1c99 | [
"MIT"
] | null | null | null | main.py | qianqianjun/DCGAN | 4e2d37f1d785e592e59334b91d197ef0475c1c99 | [
"MIT"
] | null | null | null | main.py | qianqianjun/DCGAN | 4e2d37f1d785e592e59334b91d197ef0475c1c99 | [
"MIT"
] | null | null | null | """
write by qianqianjun
2019.12.20
运行GAN进行训练的入口文件。
"""
import os
import tensorflow as tf
from train_argparse import hps
from dataset_loader import train_images
from data_provider import MnistData
from DCGAN import DCGAN
from utils import combine_imgs
# 创建生成结果目录
output_dir='./out'
if not os.path.exists(output_dir):
... | 30.327869 | 95 | 0.675676 | import os
import tensorflow as tf
from train_argparse import hps
from dataset_loader import train_images
from data_provider import MnistData
from DCGAN import DCGAN
from utils import combine_imgs
output_dir='./out'
if not os.path.exists(output_dir):
os.mkdir(output_dir)
dcgan=DCGAN(hps)
mnist_data=MnistData(tr... | true | true |
1c4a30464aa70d1e27bbeb964001a464d4795d36 | 11,724 | py | Python | shellbot/listener.py | bernard357/shellbot | daf64fbab4085d1591bf9a1aecd06b4fc615d132 | [
"Apache-2.0"
] | 11 | 2017-04-30T18:10:27.000Z | 2021-11-07T16:59:29.000Z | shellbot/listener.py | DataCraft-AI/shellbot | daf64fbab4085d1591bf9a1aecd06b4fc615d132 | [
"Apache-2.0"
] | 38 | 2017-04-20T17:33:05.000Z | 2017-11-10T20:19:07.000Z | shellbot/listener.py | DataCraft-AI/shellbot | daf64fbab4085d1591bf9a1aecd06b4fc615d132 | [
"Apache-2.0"
] | 3 | 2017-04-21T21:14:53.000Z | 2021-07-27T22:01:21.000Z | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Li... | 33.212465 | 81 | 0.598601 |
import json
import logging
from multiprocessing import Process
import random
from six import string_types
import time
import yaml
from .events import Event, Message, Join, Leave
class Listener(Process):
DEFER_DURATION = 2.0
EMPTY_DELAY = 0.005
FRESH_DURATION = 0.5
def __ini... | true | true |
1c4a30519feee2e48d05593d11019103cfebb776 | 469 | py | Python | src/Edge.py | ZacharyJohnson1/python-graph-theory | 885096f9066e22b477d0c58d9cec5db2a62571c1 | [
"MIT"
] | null | null | null | src/Edge.py | ZacharyJohnson1/python-graph-theory | 885096f9066e22b477d0c58d9cec5db2a62571c1 | [
"MIT"
] | null | null | null | src/Edge.py | ZacharyJohnson1/python-graph-theory | 885096f9066e22b477d0c58d9cec5db2a62571c1 | [
"MIT"
] | null | null | null | class Edge:
def __init__(self, u, v, w):
self.u = u
self.v = v
self.w = w
def __eq__(self, edge):
if self.u.id == edge.u.id and self.v.id == edge.v.id:
return True
return False
def __ge__(self, v):
return True if self.w > v.w else F... | 15.129032 | 61 | 0.503198 | class Edge:
def __init__(self, u, v, w):
self.u = u
self.v = v
self.w = w
def __eq__(self, edge):
if self.u.id == edge.u.id and self.v.id == edge.v.id:
return True
return False
def __ge__(self, v):
return True if self.w > v.w else F... | true | true |
1c4a3097d9a65dce695cc13d39c358f32e52ebdc | 81 | py | Python | abc/161/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/161/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/161/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | X, Y, Z = map(int, input().split())
X, Y = Y, X
X, Z = Z, X
print(f'{X} {Y} {Z}') | 20.25 | 35 | 0.444444 | X, Y, Z = map(int, input().split())
X, Y = Y, X
X, Z = Z, X
print(f'{X} {Y} {Z}') | true | true |
1c4a30bb90b9f5879da24bf6517fa49b6226eb8b | 73,574 | py | Python | user_agent_parser/constants.py | Purushot14/user-agent-parser | 5b6a3cb0d024ce1a2822a617e5a18b45806f8d1b | [
"MIT"
] | null | null | null | user_agent_parser/constants.py | Purushot14/user-agent-parser | 5b6a3cb0d024ce1a2822a617e5a18b45806f8d1b | [
"MIT"
] | null | null | null | user_agent_parser/constants.py | Purushot14/user-agent-parser | 5b6a3cb0d024ce1a2822a617e5a18b45806f8d1b | [
"MIT"
] | null | null | null | """
Created by prakash at 02/03/22
"""
__author__ = 'Prakash14'
class OS:
WINDOWS = "Windows"
WINDOWS_PHONE = "Windows Phone"
ANDROID = "Android"
MAC_OS = "Mac Os"
LINUX = "Linux"
IOS = "iOS"
CHROME_OS = "Chrome OS"
class DEVICE_TYPE:
COMPUTER = "Computer"
MOBILE = "Mobile"
... | 36.676969 | 69 | 0.58378 | __author__ = 'Prakash14'
class OS:
WINDOWS = "Windows"
WINDOWS_PHONE = "Windows Phone"
ANDROID = "Android"
MAC_OS = "Mac Os"
LINUX = "Linux"
IOS = "iOS"
CHROME_OS = "Chrome OS"
class DEVICE_TYPE:
COMPUTER = "Computer"
MOBILE = "Mobile"
SERVER = "Server"
BOT = "Bot"
clas... | true | true |
1c4a31324e044f38931eecf708b21caa5af9f43f | 1,130 | py | Python | Esophagus/genMaskedImg.py | mintanwei/artificial-intelligence-for-classification-and-segmentation-of-esophagus-precancerous-lesions | bb7bdc06f2426e99fb16f17bc081993e55db9a81 | [
"Apache-2.0"
] | null | null | null | Esophagus/genMaskedImg.py | mintanwei/artificial-intelligence-for-classification-and-segmentation-of-esophagus-precancerous-lesions | bb7bdc06f2426e99fb16f17bc081993e55db9a81 | [
"Apache-2.0"
] | null | null | null | Esophagus/genMaskedImg.py | mintanwei/artificial-intelligence-for-classification-and-segmentation-of-esophagus-precancerous-lesions | bb7bdc06f2426e99fb16f17bc081993e55db9a81 | [
"Apache-2.0"
] | null | null | null | import skimage.io
import os
import numpy as np
import cv2
input_img_dir = './dataset/endoscope/val/img'
input_mask_dir = './result/multi_task_99/mask_dialated3_6_1/128.0'
output_dir = './128.0_output'
T = 0.5
L = '_2'
if not os.path.exists(output_dir):
os.mkdir(output_dir)
overlay_color_mask = [255, ... | 34.242424 | 119 | 0.69646 | import skimage.io
import os
import numpy as np
import cv2
input_img_dir = './dataset/endoscope/val/img'
input_mask_dir = './result/multi_task_99/mask_dialated3_6_1/128.0'
output_dir = './128.0_output'
T = 0.5
L = '_2'
if not os.path.exists(output_dir):
os.mkdir(output_dir)
overlay_color_mask = [255, ... | true | true |
1c4a321cc9d033f7439e19db2a7247d1847aba3d | 3,334 | py | Python | api/group.py | D3AdCa7/CTF-Platform | 1b4b66f3a5f25f69dcd53d233718276607bed8ac | [
"MIT"
] | 4 | 2016-03-15T14:29:13.000Z | 2019-03-26T09:39:19.000Z | api/group.py | D3AdCa7/CTF-Platform | 1b4b66f3a5f25f69dcd53d233718276607bed8ac | [
"MIT"
] | null | null | null | api/group.py | D3AdCa7/CTF-Platform | 1b4b66f3a5f25f69dcd53d233718276607bed8ac | [
"MIT"
] | 3 | 2016-03-15T14:28:32.000Z | 2019-01-28T06:05:56.000Z | __author__ = "Collin Petty"
__copyright__ = "Carnegie Mellon University"
__license__ = "MIT"
__maintainer__ = ["Collin Petty", "Peter Chapman"]
__credits__ = ["David Brumely", "Collin Petty", "Peter Chapman", "Tyler Nighswander", "Garrett Barboza"]
__email__ = ["collin@cmu.edu", "peter@cmu.edu"]
__status__ = "Productio... | 43.868421 | 119 | 0.595081 | __author__ = "Collin Petty"
__copyright__ = "Carnegie Mellon University"
__license__ = "MIT"
__maintainer__ = ["Collin Petty", "Peter Chapman"]
__credits__ = ["David Brumely", "Collin Petty", "Peter Chapman", "Tyler Nighswander", "Garrett Barboza"]
__email__ = ["collin@cmu.edu", "peter@cmu.edu"]
__status__ = "Productio... | true | true |
1c4a353f8eb312454c2ccc0840d0e804a826813f | 1,475 | py | Python | tests/stores/test_ssh_tunnel.py | materialsproject/maggflow | 9f8d7a0865ec13212a3fd00d5edebd3cb7b40e7d | [
"BSD-3-Clause-LBNL"
] | 15 | 2017-06-15T16:35:23.000Z | 2022-03-05T09:57:02.000Z | tests/stores/test_ssh_tunnel.py | materialsproject/maggflow | 9f8d7a0865ec13212a3fd00d5edebd3cb7b40e7d | [
"BSD-3-Clause-LBNL"
] | 573 | 2017-06-14T15:54:27.000Z | 2022-03-31T23:20:55.000Z | tests/stores/test_ssh_tunnel.py | rkingsbury/maggma | 53def068df1cb410bfe91e7045903997813e173a | [
"BSD-3-Clause-LBNL"
] | 28 | 2017-06-14T20:50:26.000Z | 2022-03-04T16:56:40.000Z | import asyncio
import paramiko
import pymongo
import pytest
from monty.serialization import dumpfn, loadfn
from paramiko.ssh_exception import (
AuthenticationException,
NoValidConnectionsError,
SSHException,
)
from maggma.stores.mongolike import MongoStore, SSHTunnel
@pytest.fixture
def ssh_server_avail... | 27.314815 | 76 | 0.721356 | import asyncio
import paramiko
import pymongo
import pytest
from monty.serialization import dumpfn, loadfn
from paramiko.ssh_exception import (
AuthenticationException,
NoValidConnectionsError,
SSHException,
)
from maggma.stores.mongolike import MongoStore, SSHTunnel
@pytest.fixture
def ssh_server_avail... | true | true |
1c4a35ff9382304504947b41d126b9b2e6bc6f14 | 4,332 | py | Python | ray_exp.py | vakker/spg-experiments | 4824861c3ac66387078023c14ead47ba9a9e6c72 | [
"MIT"
] | null | null | null | ray_exp.py | vakker/spg-experiments | 4824861c3ac66387078023c14ead47ba9a9e6c72 | [
"MIT"
] | null | null | null | ray_exp.py | vakker/spg-experiments | 4824861c3ac66387078023c14ead47ba9a9e6c72 | [
"MIT"
] | 2 | 2021-02-15T11:12:27.000Z | 2021-04-20T17:15:10.000Z | import argparse
from datetime import datetime
import ray
from ray import tune
from ray.tune import CLIReporter
from ray.tune.suggest.variant_generator import grid_search
from spg_experiments import models
from spg_experiments.gym_env import PlaygroundEnv
def exp_name(prefix):
return prefix + '.' + datetime.now(... | 32.328358 | 76 | 0.557248 | import argparse
from datetime import datetime
import ray
from ray import tune
from ray.tune import CLIReporter
from ray.tune.suggest.variant_generator import grid_search
from spg_experiments import models
from spg_experiments.gym_env import PlaygroundEnv
def exp_name(prefix):
return prefix + '.' + datetime.now(... | true | true |
1c4a375ec65d60b933b68a9c2cccd74c1d4c9d3c | 2,168 | py | Python | test_scripts/B3_VanillaBSM_tests.py | Abhi1588/PricingToolBox | 2c0bded1a6374c481113c972c819101df043d9f2 | [
"MIT"
] | null | null | null | test_scripts/B3_VanillaBSM_tests.py | Abhi1588/PricingToolBox | 2c0bded1a6374c481113c972c819101df043d9f2 | [
"MIT"
] | null | null | null | test_scripts/B3_VanillaBSM_tests.py | Abhi1588/PricingToolBox | 2c0bded1a6374c481113c972c819101df043d9f2 | [
"MIT"
] | null | null | null |
def main():
spot = 100
strike = 100
maturity = 1
rate = 0.02
dividend = 0
vol = .05
# Put Call Parity
put = europeanPutOptionPrice(spot,strike,maturity,rate,dividend,vol)
call = europeanCallOptionPrice(spot,strike,maturity,rate,dividend,vol)
fwd = forwardPrice(spot,strike,matu... | 30.971429 | 98 | 0.642528 |
def main():
spot = 100
strike = 100
maturity = 1
rate = 0.02
dividend = 0
vol = .05
put = europeanPutOptionPrice(spot,strike,maturity,rate,dividend,vol)
call = europeanCallOptionPrice(spot,strike,maturity,rate,dividend,vol)
fwd = forwardPrice(spot,strike,maturity,rate,dividen... | true | true |
1c4a3ad80df40d707d4b56018ddf73806353244b | 1,790 | py | Python | config/settings/test.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | config/settings/test.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | config/settings/test.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | from .base import *
ENVIRONMENT_MODE = 'test'
ALLOWED_HOSTS += [
'backman-test.slcschools.org',
'beaconheights-test.slcschools.org',
'bennion-test.slcschools.org',
'bonneville-test.slcschools.org',
'bryant-test.slcschools.org',
'clayton-test.slcschools.org',
'dilworth-test.slcschools.org',... | 31.964286 | 66 | 0.698324 | from .base import *
ENVIRONMENT_MODE = 'test'
ALLOWED_HOSTS += [
'backman-test.slcschools.org',
'beaconheights-test.slcschools.org',
'bennion-test.slcschools.org',
'bonneville-test.slcschools.org',
'bryant-test.slcschools.org',
'clayton-test.slcschools.org',
'dilworth-test.slcschools.org',... | true | true |
1c4a3b9240115b8c64d64f4014238d4942020122 | 3,525 | py | Python | textbox/model/Seq2Seq/t5.py | StevenTang1998/TextBox | acd8298c7e6618384d585146f799d02cc475520c | [
"MIT"
] | 347 | 2021-01-09T07:55:55.000Z | 2022-03-27T00:46:36.000Z | textbox/model/Seq2Seq/t5.py | StevenTang1998/TextBox | acd8298c7e6618384d585146f799d02cc475520c | [
"MIT"
] | 18 | 2021-01-12T07:37:06.000Z | 2022-01-11T02:26:49.000Z | textbox/model/Seq2Seq/t5.py | StevenTang1998/TextBox | acd8298c7e6618384d585146f799d02cc475520c | [
"MIT"
] | 67 | 2021-01-09T07:23:52.000Z | 2022-03-27T12:02:12.000Z | # @Time : 2021/3/15
# @Author : Zhuohao Yu
# @Email : zhuohao@ruc.edu.cn
r"""
T5
################################################
Reference:
Colin et al. "Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer" at JMLR 2020.
"""
import torch
import torch.nn as nn
import torch.functio... | 38.736264 | 118 | 0.680284 |
import torch
import torch.nn as nn
import torch.functional as F
from textbox.model.abstract_generator import Seq2SeqGenerator
from transformers import T5Tokenizer, T5ForConditionalGeneration, T5Config
class T5(Seq2SeqGenerator):
def __init__(self, config, dataset):
super(T5, self).__init__(config, ... | true | true |
1c4a3c1daeaf23bbe73948eea1a5de1332e04d05 | 2,766 | py | Python | examples/complex/karman.py | david-moravec/classy_examples | f57e8b77db6f3e536a5367fb00ec850c6d901333 | [
"MIT"
] | null | null | null | examples/complex/karman.py | david-moravec/classy_examples | f57e8b77db6f3e536a5367fb00ec850c6d901333 | [
"MIT"
] | null | null | null | examples/complex/karman.py | david-moravec/classy_examples | f57e8b77db6f3e536a5367fb00ec850c6d901333 | [
"MIT"
] | null | null | null | from classy_blocks.classes.mesh import Mesh
from classy_blocks.classes.shapes import ExtrudedRing, Box
def get_mesh():
cylinder_diameter = 20e-3 # [m]
ring_thickness = 5e-3 # [m]
# domain size
domain_height = 0.05 # [m] (increase for "proper" simulation)
upstream_length = 0.03 # [m]
downstream... | 27.117647 | 79 | 0.58026 | from classy_blocks.classes.mesh import Mesh
from classy_blocks.classes.shapes import ExtrudedRing, Box
def get_mesh():
cylinder_diameter = 20e-3
ring_thickness = 5e-3
domain_height = 0.05
upstream_length = 0.03
downstream_length = 0.05
cell_size = 0.3*ring_thickness
bl_thic... | true | true |
1c4a3cc7dcf16ecf0590cb9b2204ae30f0f7f58c | 32,215 | py | Python | arcade/tilemap/tilemap.py | EnlNovius/arcade | 020d3aafecb6c202dd76cfdf1dbd576117a608c2 | [
"MIT"
] | null | null | null | arcade/tilemap/tilemap.py | EnlNovius/arcade | 020d3aafecb6c202dd76cfdf1dbd576117a608c2 | [
"MIT"
] | null | null | null | arcade/tilemap/tilemap.py | EnlNovius/arcade | 020d3aafecb6c202dd76cfdf1dbd576117a608c2 | [
"MIT"
] | null | null | null | """
This module provides functionality to load in JSON map files from
the Tiled Map Editor. This is achieved using the pytiled-parser
library.
For more info on Tiled see: https://www.mapeditor.org/
For more info on pytiled-parser see: https://github.com/Beefy-Swain/pytiled_parser
"""
import copy
import math
import o... | 38.673469 | 120 | 0.556418 |
import copy
import math
import os
from collections import OrderedDict
from pathlib import Path
from typing import Any, Dict, List, Optional, OrderedDict, Tuple, Union, cast
import pytiled_parser
import pytiled_parser.tiled_object
from arcade import (
AnimatedTimeBasedSprite,
AnimationKeyframe,
Sprite,
... | true | true |
1c4a3d45e3fd189c77bba8dbb394542a0543752f | 303 | py | Python | Achive/rpyc_MyService.py | rscd27p/DockerTest | aee56356f7cdaded1c6ef787e6cdf8415308c8c3 | [
"MIT"
] | 1 | 2021-08-30T14:22:15.000Z | 2021-08-30T14:22:15.000Z | Achive/rpyc_MyService.py | rscd27p/DockerTest | aee56356f7cdaded1c6ef787e6cdf8415308c8c3 | [
"MIT"
] | null | null | null | Achive/rpyc_MyService.py | rscd27p/DockerTest | aee56356f7cdaded1c6ef787e6cdf8415308c8c3 | [
"MIT"
] | null | null | null | import rpyc
import nidmm
class MyService(rpyc.Service):
exposed_nidmm = nidmm
if __name__ == "__main__":
from rpyc.utils.server import ThreadedServer
t = ThreadedServer(MyService, port = 18861, protocol_config = {"allow_public_attrs" : True, "allow_all_attrs" : True})
t.start()
| 27.545455 | 122 | 0.712871 | import rpyc
import nidmm
class MyService(rpyc.Service):
exposed_nidmm = nidmm
if __name__ == "__main__":
from rpyc.utils.server import ThreadedServer
t = ThreadedServer(MyService, port = 18861, protocol_config = {"allow_public_attrs" : True, "allow_all_attrs" : True})
t.start()
| true | true |
1c4a3d7c38a7fb4505e3308b90c0223962601a64 | 8,701 | py | Python | test/test.py | ahcorde/srdfdom | 1fb929e4aab58f5fe889d4bf2b4e330423605632 | [
"BSD-3-Clause"
] | null | null | null | test/test.py | ahcorde/srdfdom | 1fb929e4aab58f5fe889d4bf2b4e330423605632 | [
"BSD-3-Clause"
] | 1 | 2020-01-13T15:58:39.000Z | 2020-01-13T16:32:08.000Z | test/test.py | ahcorde/srdfdom | 1fb929e4aab58f5fe889d4bf2b4e330423605632 | [
"BSD-3-Clause"
] | 1 | 2019-12-31T16:07:31.000Z | 2019-12-31T16:07:31.000Z | #!/usr/bin/env python
PKG = 'srdfdom'
import sys
import rospkg
import unittest
from srdfdom.srdf import SRDF
from xml.dom.minidom import parseString
import xml.dom
# xml match code from test_xacro.py
# by Stuart Glaser and William Woodall
def first_child_element(elt):
c = elt.firstChild
while c:
if c.nodeT... | 38.5 | 120 | 0.635329 |
PKG = 'srdfdom'
import sys
import rospkg
import unittest
from srdfdom.srdf import SRDF
from xml.dom.minidom import parseString
import xml.dom
def first_child_element(elt):
c = elt.firstChild
while c:
if c.nodeType == xml.dom.Node.ELEMENT_NODE:
return c
c = c.nextSibling
return None
def next... | true | true |
1c4a3e0601d9a72176eb416461930fed869c830b | 1,543 | py | Python | zvt/domain/fundamental/valuation.py | aaron8tang/zvt | 568cf0d42577eb05b96e1a07ec512aed34245b2d | [
"MIT"
] | null | null | null | zvt/domain/fundamental/valuation.py | aaron8tang/zvt | 568cf0d42577eb05b96e1a07ec512aed34245b2d | [
"MIT"
] | null | null | null | zvt/domain/fundamental/valuation.py | aaron8tang/zvt | 568cf0d42577eb05b96e1a07ec512aed34245b2d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from sqlalchemy import Column, String, Float
from sqlalchemy.orm import declarative_base
from zvt.contract import Mixin
from zvt.contract.register import register_schema
ValuationBase = declarative_base()
class StockValuation(ValuationBase, Mixin):
"""
股票估值相关的数据,比如PE、市净率等。
"""
... | 21.732394 | 109 | 0.644848 |
from sqlalchemy import Column, String, Float
from sqlalchemy.orm import declarative_base
from zvt.contract import Mixin
from zvt.contract.register import register_schema
ValuationBase = declarative_base()
class StockValuation(ValuationBase, Mixin):
__tablename__ = 'stock_valuation'
code = Column(String(le... | true | true |
1c4a3e27ced94a73850bd98d2b3abc4188cff8f8 | 42 | py | Python | frappe/public/hello.py | process-success/frappeModifyed | 17031bdf5bb81d335d47aa3028a36be288bd9a1a | [
"MIT"
] | null | null | null | frappe/public/hello.py | process-success/frappeModifyed | 17031bdf5bb81d335d47aa3028a36be288bd9a1a | [
"MIT"
] | null | null | null | frappe/public/hello.py | process-success/frappeModifyed | 17031bdf5bb81d335d47aa3028a36be288bd9a1a | [
"MIT"
] | 1 | 2018-03-21T18:34:08.000Z | 2018-03-21T18:34:08.000Z | #!/usr/bin/python2.7
print("Hello world") | 21 | 21 | 0.690476 |
print("Hello world") | true | true |
1c4a3fee5a6e45dc07ce48fd0fa054883c373055 | 144 | py | Python | main.py | alwye/snake-game | dd35388576a4e44b0426cac67b08fed4cada7aa2 | [
"MIT"
] | null | null | null | main.py | alwye/snake-game | dd35388576a4e44b0426cac67b08fed4cada7aa2 | [
"MIT"
] | null | null | null | main.py | alwye/snake-game | dd35388576a4e44b0426cac67b08fed4cada7aa2 | [
"MIT"
] | null | null | null | """
Famous snake game
"""
from settings import *
from game import SnakeGame
if __name__ == "__main__":
game = SnakeGame()
game.run() | 12 | 26 | 0.652778 |
from settings import *
from game import SnakeGame
if __name__ == "__main__":
game = SnakeGame()
game.run() | true | true |
1c4a41169b1b0f2b1b6e98f644def8bec59c8f6f | 616 | py | Python | tests/test_replace_intensity.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | 64 | 2020-03-18T12:11:22.000Z | 2022-03-31T08:19:18.000Z | tests/test_replace_intensity.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | 148 | 2020-05-14T06:14:11.000Z | 2022-03-26T15:02:31.000Z | tests/test_replace_intensity.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | 16 | 2020-05-31T00:53:44.000Z | 2022-03-23T13:20:57.000Z | import pyclesperanto_prototype as cle
import numpy as np
def test_replace_intensity():
test1 = cle.push(np.asarray([
[0, 0, 0, 0, 0],
[0, 1, 2, 3, 0],
[0, 2, 3, 4, 0],
[0, 4, 4, 5, 0],
[0, 0, 0, 0, 0]
]))
reference = cle.push(np.asarray([
[0, 0, 0, 0, 0],
... | 20.533333 | 46 | 0.465909 | import pyclesperanto_prototype as cle
import numpy as np
def test_replace_intensity():
test1 = cle.push(np.asarray([
[0, 0, 0, 0, 0],
[0, 1, 2, 3, 0],
[0, 2, 3, 4, 0],
[0, 4, 4, 5, 0],
[0, 0, 0, 0, 0]
]))
reference = cle.push(np.asarray([
[0, 0, 0, 0, 0],
... | true | true |
1c4a42653316a4744277d052b7656cb48a32dd27 | 6,951 | py | Python | api/batch_processing/postprocessing/combine_api_outputs.py | alsnothome/CameraTraps | fddd64d5e1a941bb46557bec09af7091da334cf4 | [
"MIT"
] | null | null | null | api/batch_processing/postprocessing/combine_api_outputs.py | alsnothome/CameraTraps | fddd64d5e1a941bb46557bec09af7091da334cf4 | [
"MIT"
] | 1 | 2021-02-24T00:17:21.000Z | 2021-02-24T00:17:21.000Z | api/batch_processing/postprocessing/combine_api_outputs.py | isabella232/CameraTraps | 8a01a191cd061deac3aa8ab9edf89b210a89a0be | [
"MIT"
] | null | null | null | """
Merges two or more .json files in batch API output format, optionally
writing the results to another .json file.
- Concatenates image lists, erroring if images are not unique.
- Errors if class lists are conflicting; errors on unrecognized fields.
- Checks compatibility in info structs, within reason.
File format:... | 35.464286 | 108 | 0.630269 |
import argparse
import json
from typing import Any, Dict, Iterable, Mapping, List, Optional
def combine_api_output_files(input_files: List[str],
output_file: Optional[str] = None,
require_uniqueness: bool = True
) -> Dict[str, ... | true | true |
1c4a43254129f6dce18adb2aab2ca72a6cf10471 | 3,836 | py | Python | tests/core/contracts/test_contract_method_to_argument_matching.py | y19818/web3.py | 32a85a287ab63220d1e0c06d77be74de595ff02f | [
"MIT"
] | null | null | null | tests/core/contracts/test_contract_method_to_argument_matching.py | y19818/web3.py | 32a85a287ab63220d1e0c06d77be74de595ff02f | [
"MIT"
] | null | null | null | tests/core/contracts/test_contract_method_to_argument_matching.py | y19818/web3.py | 32a85a287ab63220d1e0c06d77be74de595ff02f | [
"MIT"
] | null | null | null | import json
import pytest
from web3._utils.abi import (
get_abi_input_types,
)
from web3._utils.function_identifiers import (
FallbackFn,
)
from web3.exceptions import (
ValidationError,
)
SINGLE_FN_NO_ARGS = json.loads('[{"constant":false,"inputs":[],"name":"a","outputs":[],"type":"function"... | 25.403974 | 294 | 0.539103 | import json
import pytest
from web3._utils.abi import (
get_abi_input_types,
)
from web3._utils.function_identifiers import (
FallbackFn,
)
from web3.exceptions import (
ValidationError,
)
SINGLE_FN_NO_ARGS = json.loads('[{"constant":false,"inputs":[],"name":"a","outputs":[],"type":"function"... | true | true |
1c4a437b86d7bfb9b1e7b2ed2f1ba8e9cb370973 | 754 | py | Python | setup.py | aaalgo/calign | 7e96f4c0df85200dec260e603711172486107f23 | [
"MIT"
] | null | null | null | setup.py | aaalgo/calign | 7e96f4c0df85200dec260e603711172486107f23 | [
"MIT"
] | null | null | null | setup.py | aaalgo/calign | 7e96f4c0df85200dec260e603711172486107f23 | [
"MIT"
] | null | null | null | from distutils.core import setup, Extension
picpac = Extension('_calign',
language = 'c++',
extra_compile_args = ['-O3', '-std=c++1y'],
include_dirs = ['/usr/local/include'],
libraries = ['opencv_highgui', 'opencv_core', 'boost_filesystem', 'boost_system', 'boost_python'],
libr... | 34.272727 | 106 | 0.570292 | from distutils.core import setup, Extension
picpac = Extension('_calign',
language = 'c++',
extra_compile_args = ['-O3', '-std=c++1y'],
include_dirs = ['/usr/local/include'],
libraries = ['opencv_highgui', 'opencv_core', 'boost_filesystem', 'boost_system', 'boost_python'],
libr... | true | true |
1c4a43914b6834384b739b37fc8cbf4a1fededbb | 25,191 | py | Python | faker/providers/job/da_DK/__init__.py | tristanHdez18/faker | 14cb25712e6efcb7bf8d9f30f404a7304722af6d | [
"MIT"
] | null | null | null | faker/providers/job/da_DK/__init__.py | tristanHdez18/faker | 14cb25712e6efcb7bf8d9f30f404a7304722af6d | [
"MIT"
] | 4 | 2022-02-04T17:24:59.000Z | 2022-03-29T20:02:57.000Z | faker/providers/job/da_DK/__init__.py | tristanHdez18/faker | 14cb25712e6efcb7bf8d9f30f404a7304722af6d | [
"MIT"
] | null | null | null | from .. import Provider as BaseProvider
class Provider(BaseProvider):
"""
Source: https://star.dk/it/saadan-arbejder-vi-med-it-i-styrelsen/oversigt-over-stillingsbetegnelser-og-kvalifikationer/. # NOQA
"""
jobs = [
"Lastvognsmekanikerlærling",
"Knallertmekaniker",
"Møbelarkit... | 26.158879 | 132 | 0.534596 | from .. import Provider as BaseProvider
class Provider(BaseProvider):
jobs = [
"Lastvognsmekanikerlærling",
"Knallertmekaniker",
"Møbelarkitekt",
"Forsyningsoperatørelev",
"Hospitalsfysiker",
"Økonomicontroller",
"Revisor",
"Skatterevisor",
... | true | true |
1c4a43a62d1b0c7b36182ef5fdb89f137fc4a846 | 11,479 | py | Python | onmt/translate/greedy_search.py | comydream/OpenNMT-py | 2f3c810069ca03b752d9886782648e576b39a06d | [
"MIT"
] | 1 | 2021-10-01T15:03:35.000Z | 2021-10-01T15:03:35.000Z | onmt/translate/greedy_search.py | urialon/OpenNMT-py | bdca05a3fac8f864b21c86a8ad03c09895212e70 | [
"MIT"
] | null | null | null | onmt/translate/greedy_search.py | urialon/OpenNMT-py | bdca05a3fac8f864b21c86a8ad03c09895212e70 | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
from onmt.translate.decode_strategy import DecodeStrategy
def sample_topp(logits, keep_topp):
sorted_logits, sorted_indices = torch.sort(logits,
descending=True,
dim=1)
... | 40.996429 | 79 | 0.623748 | import torch
import torch.nn.functional as F
from onmt.translate.decode_strategy import DecodeStrategy
def sample_topp(logits, keep_topp):
sorted_logits, sorted_indices = torch.sort(logits,
descending=True,
dim=1)
... | true | true |
1c4a44bbf72471eab126ed6a6523fab4eb11bffa | 1,995 | py | Python | efm_example.py | xurong-liang/cornac | 6e0a58b3c99de8c1bd685086c8a63b29aef66e28 | [
"Apache-2.0"
] | null | null | null | efm_example.py | xurong-liang/cornac | 6e0a58b3c99de8c1bd685086c8a63b29aef66e28 | [
"Apache-2.0"
] | null | null | null | efm_example.py | xurong-liang/cornac | 6e0a58b3c99de8c1bd685086c8a63b29aef66e28 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cornac 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 ... | 28.098592 | 92 | 0.717293 |
import cornac
from cornac.datasets import amazon_toy
from cornac.data import SentimentModality
from cornac.eval_methods import RatioSplit
rating = amazon_toy.load_feedback()
sentiment = amazon_toy.load_sentiment()
md = SentimentModality(data=sentiment)
split_data = RatioSplit(
data=rating,
... | true | true |
1c4a45973be19ede8307caaba8c7bcb5c4ecdae9 | 994 | py | Python | config/urls.py | lawiz22/PLOUC-Backend-master | b93fa2fea8d45df9f19c3c58037e59dad4981921 | [
"MIT"
] | null | null | null | config/urls.py | lawiz22/PLOUC-Backend-master | b93fa2fea8d45df9f19c3c58037e59dad4981921 | [
"MIT"
] | 3 | 2020-06-05T21:24:34.000Z | 2022-03-11T23:50:26.000Z | config/urls.py | lawiz22/PLOUC-Backend-master | b93fa2fea8d45df9f19c3c58037e59dad4981921 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from rest_framework.documentation import include_docs_urls
urlpatterns = [
# API (v1)
url(r'^', include('v1.accounts.urls')),
url(r'^', include('v1.credit... | 28.4 | 78 | 0.677062 | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from rest_framework.documentation import include_docs_urls
urlpatterns = [
url(r'^', include('v1.accounts.urls')),
url(r'^', include('v1.credits.urls')),... | true | true |
1c4a45acae68baad54b3c997b9a3965d7f7d11af | 13,496 | py | Python | arch/models/model.py | bigphoton/arch | 95a197d6b89bc2316b0d88b2b1345cbbb90088ec | [
"Unlicense"
] | null | null | null | arch/models/model.py | bigphoton/arch | 95a197d6b89bc2316b0d88b2b1345cbbb90088ec | [
"Unlicense"
] | null | null | null | arch/models/model.py | bigphoton/arch | 95a197d6b89bc2316b0d88b2b1345cbbb90088ec | [
"Unlicense"
] | null | null | null | """
Functions and objects describing optical components.
"""
import abc
import sympy
from ..connectivity import Connectivity
import arch.port as port
import numpy as np
import math
class Model(abc.ABC):
"""
Model base class. One of `block` or `ports` must be defined.
name: name of this model for indexing, stri... | 28.116667 | 102 | 0.680498 |
import abc
import sympy
from ..connectivity import Connectivity
import arch.port as port
import numpy as np
import math
class Model(abc.ABC):
def __init__(self, name, block=None, ports=None, **kwargs):
self.name = name
if block is not None and ports is None:
self.ports = list(block.ports)
elif ports ... | true | true |
1c4a46e3681387e261c445f0fe0ee20614d7a18e | 26,847 | py | Python | src/virtual-wan/azext_vwan/vendored_sdks/v2021_03_01/v2021_03_01/aio/operations/_nat_gateways_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2021_03_01/v2021_03_01/aio/operations/_nat_gateways_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2021_03_01/v2021_03_01/aio/operations/_nat_gateways_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.080439 | 191 | 0.665139 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
1c4a47a2ef218891b453fdd516b5d165a1dedf97 | 6,511 | py | Python | FACTScontrol.py | amahoro12/anne | 9b68c71c491bde4f57c2cbbf78a377239a9026d8 | [
"MIT"
] | null | null | null | FACTScontrol.py | amahoro12/anne | 9b68c71c491bde4f57c2cbbf78a377239a9026d8 | [
"MIT"
] | null | null | null | FACTScontrol.py | amahoro12/anne | 9b68c71c491bde4f57c2cbbf78a377239a9026d8 | [
"MIT"
] | null | null | null | import pandapower.control as ct
## Creates custom PI-controllers for the shunt and series FACTS device used in the test network.
# SHUNT CONTROLLER
class ShuntFACTS(ct.basic_controller.Controller):
def __init__(self, net, busVoltageInd, convLim, shuntIndex=0, q_mvar_rating=50, max_iter=30, in_service=True,
... | 43.993243 | 121 | 0.657196 | import pandapower.control as ct
convLim, shuntIndex=0, q_mvar_rating=50, max_iter=30, in_service=True,
recycle=False, order=0, level=0, **kwargs):
super().__init__(net, in_service=in_service, recycle=recycle, order=order, level=level,
initial_powerflow=True, *... | true | true |
1c4a482bb9e01f84eb19da55a5549ca75bbd457d | 128,109 | py | Python | tests/arm_tests.py | SantiagoRomani/gdb_arm | 9e3c2eec2c41337b2a88222a87ad0b2f418111c7 | [
"MIT"
] | 2 | 2021-05-20T09:30:31.000Z | 2022-02-23T03:34:51.000Z | tests/arm_tests.py | SantiagoRomani/gdb_arm | 9e3c2eec2c41337b2a88222a87ad0b2f418111c7 | [
"MIT"
] | null | null | null | tests/arm_tests.py | SantiagoRomani/gdb_arm | 9e3c2eec2c41337b2a88222a87ad0b2f418111c7 | [
"MIT"
] | null | null | null | """ Groups of tests for gdb_arm """
from num_analyzer import NumberAnalyzer
from string_analyzer import CharAnalyzer
from string_analyzer import StringAnalyzer
from data_analyzer import DataAnalyzer
from adr_analyzer import AddressAnalyzer
from reg_analyzer import RegisterAnalyzer
from reg_analyzer import RegisterBitsA... | 92.899927 | 120 | 0.498529 | from num_analyzer import NumberAnalyzer
from string_analyzer import CharAnalyzer
from string_analyzer import StringAnalyzer
from data_analyzer import DataAnalyzer
from adr_analyzer import AddressAnalyzer
from reg_analyzer import RegisterAnalyzer
from reg_analyzer import RegisterBitsAnalyzer
from reg_analyzer import Reg... | true | true |
1c4a4a032bbb9e6042445ab08cd24531a80ce7bd | 2,275 | py | Python | docs/source/conf.py | Gemicai/Gemicai | 1ce3be768979acc7251b4108a59292cba99624d1 | [
"MIT"
] | 5 | 2020-11-16T11:06:51.000Z | 2021-02-23T04:54:30.000Z | docs/source/conf.py | Gemicai/Gemicai | 1ce3be768979acc7251b4108a59292cba99624d1 | [
"MIT"
] | 1 | 2021-08-24T16:21:30.000Z | 2021-08-24T16:21:30.000Z | docs/source/conf.py | Gemicai/Gemicai | 1ce3be768979acc7251b4108a59292cba99624d1 | [
"MIT"
] | 1 | 2021-02-23T04:54:31.000Z | 2021-02-23T04:54:31.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 37.295082 | 88 | 0.665495 |
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
project = 'Gemicai'
copyright = '2020, Kevin Alberts, Niek Heinen, Mateusz Jaworski, Sieta de Jong'
author = 'Kevin Alberts, Niek Heinen, Mateusz Jaworski, Sieta de Jong'
release = '0.5.0'
... | true | true |
1c4a4bffc43ac8052868c75e692429c7af2a1d60 | 3,508 | py | Python | testproject/testproject/settings.py | io-ma/django-groups-manager | 5ab1e098ac44b319b166b529e7a46c6a83e5ddac | [
"MIT"
] | 1 | 2020-08-20T00:25:26.000Z | 2020-08-20T00:25:26.000Z | testproject/testproject/settings.py | dpineiden/django-groups-manager | d02361e6f2825c174410db676ec3fb28c54e0256 | [
"MIT"
] | null | null | null | testproject/testproject/settings.py | dpineiden/django-groups-manager | d02361e6f2825c174410db676ec3fb28c54e0256 | [
"MIT"
] | null | null | null | """
Django settings for testproject project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import os
import django
try:
import guardian
has_guardian = T... | 23.386667 | 82 | 0.686431 | import os
import django
try:
import guardian
has_guardian = True
except ImportError:
has_guardian = False
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = '9vg3q-kbo(p^zpom4!*o8*%tfu-14o=3++txo+sxwto)2@=qd='
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Applicatio... | true | true |
1c4a4c5663dcdc3e1fe9bb9a01798918c54fc1ba | 1,609 | py | Python | dataset/dataset_inspect.py | Lsplastic/Tensorflow_ssd | f2935079fb8d2cd2288ef5f7a415749243f34542 | [
"Apache-2.0"
] | null | null | null | dataset/dataset_inspect.py | Lsplastic/Tensorflow_ssd | f2935079fb8d2cd2288ef5f7a415749243f34542 | [
"Apache-2.0"
] | null | null | null | dataset/dataset_inspect.py | Lsplastic/Tensorflow_ssd | f2935079fb8d2cd2288ef5f7a415749243f34542 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Changan Wang
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | 44.694444 | 129 | 0.698571 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
def count_split_examples(split_path, file_prefix='.tfrecord'):
num_samples = 0
tfrecords_to_count = tf.gfile.Glob(os.path.join(split_p... | true | true |
1c4a4c7893d539bc2653916b6c930594e9f82081 | 466 | py | Python | data/scripts/templates/object/tangible/ship/attachment/booster/shared_ywing_booster_s01.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/ship/attachment/booster/shared_ywing_booster_s01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/ship/attachment/booster/shared_ywing_booster_s01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/attachment/booster/shared_ywing_booster_s01.iff"
result.attrib... | 27.411765 | 89 | 0.736052 | true | true | |
1c4a4ca689afea9e81b98745e6c04f99db6d9b09 | 148 | py | Python | app/rockband/apps.py | solattila/rock-band-api | 1521b2913b75c53310ba1b71d77d599966237483 | [
"MIT"
] | null | null | null | app/rockband/apps.py | solattila/rock-band-api | 1521b2913b75c53310ba1b71d77d599966237483 | [
"MIT"
] | null | null | null | app/rockband/apps.py | solattila/rock-band-api | 1521b2913b75c53310ba1b71d77d599966237483 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class RockbandConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'rockband'
| 21.142857 | 56 | 0.763514 | from django.apps import AppConfig
class RockbandConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'rockband'
| true | true |
1c4a4df4c0837afb763b5667c2f4dc1f6cf6ab1e | 1,129 | py | Python | python/meas_smag.py | dkkim1005/Neural_Network_Quantum_State | 7e94929c5ef65ce87f63bf20c81acaa524adca82 | [
"Unlicense"
] | null | null | null | python/meas_smag.py | dkkim1005/Neural_Network_Quantum_State | 7e94929c5ef65ce87f63bf20c81acaa524adca82 | [
"Unlicense"
] | null | null | null | python/meas_smag.py | dkkim1005/Neural_Network_Quantum_State | 7e94929c5ef65ce87f63bf20c81acaa524adca82 | [
"Unlicense"
] | 1 | 2022-01-26T05:13:38.000Z | 2022-01-26T05:13:38.000Z | #!/usr/bin/env python3
import numpy as np
from pynqs import sampler
floatType = 'float32'
symmType = 'tr'
# hyper parameter sets of rbm and MCMC sampler
kwargs = {
'nInputs' : 16,
'nHiddens' : 4,
'nChains' : 1000,
'seedNumber' : 0,
'seedDistance' : 123456789,
'init_mcmc_steps' : 300
}
# transverse-field st... | 27.536585 | 66 | 0.662533 |
import numpy as np
from pynqs import sampler
floatType = 'float32'
symmType = 'tr'
kwargs = {
'nInputs' : 16,
'nHiddens' : 4,
'nChains' : 1000,
'seedNumber' : 0,
'seedDistance' : 123456789,
'init_mcmc_steps' : 300
}
hfield = '-1.1'
filepath = './temp/build/RBMTrSymmCH-N%dA%dH%sV1'\
%(kwargs... | true | true |
1c4a4f10c49f9126358b074d166c4bcbaae00b6b | 6,641 | py | Python | pysph/sph/tests/test_linalg.py | nauaneed/pysph | 9cb9a859934939307c65a25cbf73e4ecc83fea4a | [
"BSD-3-Clause"
] | 293 | 2017-05-26T14:41:15.000Z | 2022-03-28T09:56:16.000Z | pysph/sph/tests/test_linalg.py | nauaneed/pysph | 9cb9a859934939307c65a25cbf73e4ecc83fea4a | [
"BSD-3-Clause"
] | 217 | 2017-05-29T15:48:14.000Z | 2022-03-24T16:16:55.000Z | pysph/sph/tests/test_linalg.py | nauaneed/pysph | 9cb9a859934939307c65a25cbf73e4ecc83fea4a | [
"BSD-3-Clause"
] | 126 | 2017-05-25T19:17:32.000Z | 2022-03-25T11:23:24.000Z | from pysph.sph.wc.linalg import (
augmented_matrix, gj_solve, mat_mult, mat_vec_mult
)
import numpy as np
import unittest
def gj_solve_helper(a, b, n):
m = np.zeros((n, n+1)).ravel().tolist()
augmented_matrix(a, b, n, 1, n, m)
result = [0.0]*n
is_singular = gj_solve(m, n, 1, result)
return is_... | 32.237864 | 73 | 0.512573 | from pysph.sph.wc.linalg import (
augmented_matrix, gj_solve, mat_mult, mat_vec_mult
)
import numpy as np
import unittest
def gj_solve_helper(a, b, n):
m = np.zeros((n, n+1)).ravel().tolist()
augmented_matrix(a, b, n, 1, n, m)
result = [0.0]*n
is_singular = gj_solve(m, n, 1, result)
return is_... | true | true |
1c4a4fe749a6730b16f54520019eb9f262e581a6 | 13,887 | py | Python | cvxpy/reductions/solvers/conic_solvers/conic_solver.py | QiuWJX/cvxpy | fd1c225b0cdf541618e292cae1a4c7ea25ddc934 | [
"ECL-2.0",
"Apache-2.0"
] | 556 | 2021-04-20T03:19:49.000Z | 2022-03-30T12:31:38.000Z | cvxpy/reductions/solvers/conic_solvers/conic_solver.py | QiuWJX/cvxpy | fd1c225b0cdf541618e292cae1a4c7ea25ddc934 | [
"ECL-2.0",
"Apache-2.0"
] | 358 | 2021-04-20T08:17:49.000Z | 2022-03-31T21:16:28.000Z | cvxpy/reductions/solvers/conic_solvers/conic_solver.py | phschiele/cvxpy | a43aed7447b87f6d0fbc6f71ae5c7b84183f3369 | [
"ECL-2.0",
"Apache-2.0"
] | 131 | 2021-04-21T09:00:12.000Z | 2022-03-29T04:43:51.000Z | """
Copyright 2017 Robin Verschueren, 2017 Akshay Agrawal
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... | 40.605263 | 93 | 0.585728 | from typing import Tuple
import numpy as np
import scipy.sparse as sp
import cvxpy.settings as s
from cvxpy.constraints import PSD, SOC, ExpCone, NonNeg, PowCone3D, Zero
from cvxpy.reductions.cvx_attr2constr import convex_attributes
from cvxpy.reductions.dcp2cone.cone_matrix_stuffing import ParamConeProg
from cvxpy.r... | true | true |
1c4a4ffc7df2bbba0362421473040901614f36f3 | 4,959 | py | Python | projects/RAMADDA_publish/sphinx/source/conf.py | Unidata/drilsdown | 55aca7168fb390f31c36729605401564e9b82c56 | [
"MIT"
] | 3 | 2018-05-25T00:19:12.000Z | 2021-01-08T15:54:36.000Z | projects/RAMADDA_publish/sphinx/source/conf.py | suvarchal/drilsdown | e82f58396f640fef847353caf1bd4b2bf016c7a6 | [
"MIT"
] | 11 | 2017-10-31T20:15:24.000Z | 2019-12-16T21:01:55.000Z | projects/RAMADDA_publish/sphinx/source/conf.py | suvarchal/drilsdown | e82f58396f640fef847353caf1bd4b2bf016c7a6 | [
"MIT"
] | 10 | 2018-02-08T22:23:28.000Z | 2019-09-29T23:25:19.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 30.423313 | 79 | 0.654971 |
project = 'RAMADDA Publish'
copyright = ''
author = 'Suvarchal'
version = ''
release = '1.3'
extensions = [
'sphinx.ext.githubpages',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
language = None
exclude_patterns = []
pygments_s... | true | true |
1c4a51c816367f7be461f80db74b01f5bb2fc407 | 124 | py | Python | model/group.py | Den21rus/barancev_training | 892cd38ffde0954278ea2cebe72379b9db55a29c | [
"Apache-2.0"
] | null | null | null | model/group.py | Den21rus/barancev_training | 892cd38ffde0954278ea2cebe72379b9db55a29c | [
"Apache-2.0"
] | null | null | null | model/group.py | Den21rus/barancev_training | 892cd38ffde0954278ea2cebe72379b9db55a29c | [
"Apache-2.0"
] | null | null | null |
class Group:
def __init__(self, username, password):
self.username = username
self.password = password | 20.666667 | 43 | 0.653226 |
class Group:
def __init__(self, username, password):
self.username = username
self.password = password | true | true |
1c4a522a10fa8856197c75ae296fd1e45edb4dc0 | 5,150 | py | Python | official/vision/detection/executor/detection_executor.py | Silas-Asamoah/models | 833e6939acb42f695b0ae3765f98fe494f06115c | [
"Apache-2.0"
] | 2 | 2019-11-30T03:43:50.000Z | 2019-11-30T03:43:55.000Z | official/vision/detection/executor/detection_executor.py | utpal0401/models | 426b2c6e894c22ffb17f32581305ea87c3b8b377 | [
"Apache-2.0"
] | 1 | 2021-03-31T21:30:38.000Z | 2021-03-31T21:30:38.000Z | official/vision/detection/executor/detection_executor.py | utpal0401/models | 426b2c6e894c22ffb17f32581305ea87c3b8b377 | [
"Apache-2.0"
] | 2 | 2019-11-10T07:48:51.000Z | 2020-02-04T04:17:41.000Z | # Copyright 2019 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... | 37.867647 | 80 | 0.66 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import logging
import os
import json
import tensorflow.compat.v2 as tf
from official.modeling.training import distributed_executor as executor
class DetectionDistributedExecutor(exe... | true | true |
1c4a52e6f133e6c9b67ce57eaeec57e4ff28a9dd | 2,392 | py | Python | tests/wallet/test_wallet_interested_store.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | tests/wallet/test_wallet_interested_store.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | tests/wallet/test_wallet_interested_store.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from secrets import token_bytes
import aiosqlite
import pytest
from chinilla.types.blockchain_format.coin import Coin
from chinilla.util.db_wrapper import DBWrapper
from chinilla.util.ints import uint64
from chinilla.wallet.wallet_interested_store import WalletInterestedStore
class TestWall... | 45.132075 | 95 | 0.695234 | from pathlib import Path
from secrets import token_bytes
import aiosqlite
import pytest
from chinilla.types.blockchain_format.coin import Coin
from chinilla.util.db_wrapper import DBWrapper
from chinilla.util.ints import uint64
from chinilla.wallet.wallet_interested_store import WalletInterestedStore
class TestWall... | true | true |
1c4a530ffc5d9d6be0b083b255751a4622ff6ed6 | 645 | py | Python | teal_algos/bubble.py | Taneristique/TEAL | e8860741be02a98b2562d36da46864e7bdc9594b | [
"MIT"
] | null | null | null | teal_algos/bubble.py | Taneristique/TEAL | e8860741be02a98b2562d36da46864e7bdc9594b | [
"MIT"
] | null | null | null | teal_algos/bubble.py | Taneristique/TEAL | e8860741be02a98b2562d36da46864e7bdc9594b | [
"MIT"
] | null | null | null | import time
start=time.time()
def bubble(x):
"""Function takes list element x as parameter which is consist of numbers"""
for i in range(len(x)-1): #number of the loops
for j in range(1,len(x)): #number of the comperations
if x[j-1]>x[j]: #swap i[j] with i[j-1]
chg=x[j]
... | 40.3125 | 122 | 0.542636 | import time
start=time.time()
def bubble(x):
for i in range(len(x)-1):
for j in range(1,len(x)):
if x[j-1]>x[j]:
chg=x[j]
x[j]=x[j-1]
x[j-1]=chg
if x[j-1]==x[j] or x[j-1]<x[j]:
pass
print('step... | true | true |
1c4a5380b287324f5ee930287fd0199210559d6b | 4,852 | py | Python | bin/additem.py | CakeLancelot/UnityPackFF | ee3368b16aec3c6b95c70778105dfcbf7379647f | [
"MIT"
] | 6 | 2020-11-03T13:23:40.000Z | 2021-10-06T15:25:29.000Z | bin/additem.py | CakeLancelot/UnityPackFF | ee3368b16aec3c6b95c70778105dfcbf7379647f | [
"MIT"
] | 1 | 2021-02-15T20:16:40.000Z | 2021-02-15T20:16:40.000Z | bin/additem.py | CakeLancelot/UnityPackFF | ee3368b16aec3c6b95c70778105dfcbf7379647f | [
"MIT"
] | 10 | 2020-11-03T15:08:10.000Z | 2022-02-13T07:32:52.000Z | #!/usr/bin/env python3
# Adds a (retextured) item into the game. Will need to be modified slightly
# to add items other than armor. Remember to use dumpxdt.py (and make it read
# the generated _new TableData!) so your server allows you to spawn the
# new items. Will also need to be modified to work with girls' or unis... | 32.783784 | 87 | 0.739489 |
from unitypack.asset import Asset
from unitypack.object import FFOrderedDict
from unitypack.modding import import_texture
# asset bundles
TABLEDATA_PATH = 'CustomAssetBundle-1dca92eecee4742d985b799d8226666d'
CHARTEX_PATH = 'CustomAssetBundle-aa120043d3c634fe9adfb5cbe08e6970'
ICONS_PATH = 'CustomAssetBundle-784f... | true | true |
1c4a540b90827e76c2c1079b89be91800a5d28c8 | 126 | py | Python | vit/formatter/wait_epoch.py | kinifwyne/vit | e2cbafce922b1e09c4a66e7dc9592c51fe628e9d | [
"MIT"
] | 179 | 2020-07-28T08:21:51.000Z | 2022-03-30T21:39:37.000Z | vit/formatter/wait_epoch.py | kinifwyne/vit | e2cbafce922b1e09c4a66e7dc9592c51fe628e9d | [
"MIT"
] | 255 | 2017-02-01T11:49:12.000Z | 2020-07-26T22:31:25.000Z | vit/formatter/wait_epoch.py | kinifwyne/vit | e2cbafce922b1e09c4a66e7dc9592c51fe628e9d | [
"MIT"
] | 26 | 2017-01-17T20:31:13.000Z | 2020-06-17T13:09:01.000Z | from vit.formatter.wait import Wait
class WaitEpoch(Wait):
def format(self, wait, task):
return self.epoch(wait)
| 21 | 35 | 0.698413 | from vit.formatter.wait import Wait
class WaitEpoch(Wait):
def format(self, wait, task):
return self.epoch(wait)
| true | true |
1c4a549672ab2b68bbe9ad8488637c7d44891b43 | 2,819 | py | Python | test/lint/check-doc.py | VaderCoinProject/vadercoin | b513c794b014d40e5aad281dd1f54845c46d216c | [
"MIT"
] | null | null | null | test/lint/check-doc.py | VaderCoinProject/vadercoin | b513c794b014d40e5aad281dd1f54845c46d216c | [
"MIT"
] | null | null | null | test/lint/check-doc.py | VaderCoinProject/vadercoin | b513c794b014d40e5aad281dd1f54845c46d216c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2020 The Vadercoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
This checks if all command line args are documented.
Return value is 0 to indicate no error.
Autho... | 42.074627 | 130 | 0.723306 |
from subprocess import check_output
import re
FOLDER_GREP = 'src'
FOLDER_TEST = 'src/test/'
REGEX_ARG = r'(?:ForceSet|SoftSet|Get|Is)(?:Bool)?Args?(?:Set)?\("(-[^"]+)"'
REGEX_DOC = r'AddArg\("(-[^"=]+?)(?:=|")'
CMD_ROOT_DIR = '$(git rev-parse --show-toplevel)/{}'.format(FOLDER_GREP)
CMD_GREP_ARGS = r"git grep --... | true | true |
1c4a564f9a4cae704bf503183576b795d60fbbf4 | 142 | py | Python | playrcc/src/gui/__init__.py | Gloryness/playrcc | 3816a935f19c786db59ba5a46a98cc527053cc29 | [
"MIT"
] | 4 | 2020-09-24T14:25:01.000Z | 2020-11-02T22:18:12.000Z | playrcc/src/gui/__init__.py | Gloryness/playrcc | 3816a935f19c786db59ba5a46a98cc527053cc29 | [
"MIT"
] | null | null | null | playrcc/src/gui/__init__.py | Gloryness/playrcc | 3816a935f19c786db59ba5a46a98cc527053cc29 | [
"MIT"
] | null | null | null | from .mainwindow import SecretCodeWindow
__title__ = 'gui'
__author__ = 'Goryness'
__license__ = 'MIT License'
__all__ = ['SecretCodeWindow'] | 23.666667 | 40 | 0.774648 | from .mainwindow import SecretCodeWindow
__title__ = 'gui'
__author__ = 'Goryness'
__license__ = 'MIT License'
__all__ = ['SecretCodeWindow'] | true | true |
1c4a5693a9652bf3ef6a37798165c3bbc52518da | 4,605 | py | Python | melodic/src/ros_comm/rospy/src/rospy/__init__.py | disorn-inc/ROS-melodic-python3-Opencv-4.1.1-CUDA | 3d265bb64712e3cd7dfa0ad56d78fcdebafdb4b0 | [
"BSD-3-Clause"
] | 2 | 2021-07-14T12:33:55.000Z | 2021-11-21T07:14:13.000Z | melodic/src/ros_comm/rospy/src/rospy/__init__.py | disorn-inc/ROS-melodic-python3-Opencv-4.1.1-CUDA | 3d265bb64712e3cd7dfa0ad56d78fcdebafdb4b0 | [
"BSD-3-Clause"
] | null | null | null | melodic/src/ros_comm/rospy/src/rospy/__init__.py | disorn-inc/ROS-melodic-python3-Opencv-4.1.1-CUDA | 3d265bb64712e3cd7dfa0ad56d78fcdebafdb4b0 | [
"BSD-3-Clause"
] | null | null | null | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... | 33.860294 | 146 | 0.728339 |
# yet
from std_msgs.msg import Header
from .client import spin, myargv, init_node, \
get_published_topics, \
wait_for_message, \
get_master, \
on_shutdown, \
get_param, get_param_cached, get_param_names, set_param, delete_param, has_param, search_param,\
... | true | true |
1c4a56aeca55d753088ec0ac5ef51be958e3e1da | 823 | py | Python | packages/__init__.py | fetchai/agents-yoti | d71d57508079e5cd3854037bc3c473e24915af6f | [
"Apache-2.0"
] | 4 | 2021-01-19T17:53:58.000Z | 2021-09-08T05:28:58.000Z | packages/__init__.py | fetchai/agents-yoti | d71d57508079e5cd3854037bc3c473e24915af6f | [
"Apache-2.0"
] | null | null | null | packages/__init__.py | fetchai/agents-yoti | d71d57508079e5cd3854037bc3c473e24915af6f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | 39.190476 | 80 | 0.575942 | true | true | |
1c4a571b018141a2957d2b7a89a4c12fd814a302 | 286 | py | Python | frappe/patches/v12_0/remove_deprecated_fields_from_doctype.py | jimmyrianto/frappe | 40051410436b11e0415c8c8f0a8335bdd572ce6e | [
"MIT"
] | 5 | 2017-09-12T15:56:31.000Z | 2022-03-09T13:50:21.000Z | frappe/patches/v12_0/remove_deprecated_fields_from_doctype.py | alexbow2008/frappe | ce592a40b4c5e80a9c6cbdc541105218bf98c966 | [
"MIT"
] | 212 | 2017-08-16T13:03:18.000Z | 2020-10-06T12:26:21.000Z | frappe/patches/v12_0/remove_deprecated_fields_from_doctype.py | alexbow2008/frappe | ce592a40b4c5e80a9c6cbdc541105218bf98c966 | [
"MIT"
] | 14 | 2020-11-04T11:22:44.000Z | 2022-02-01T20:59:37.000Z | import frappe
def execute():
frappe.reload_doc('core', 'doctype', 'doctype')
frappe.model.delete_fields({
'DocType': ['hide_heading', 'image_view', 'read_only_onload']
}, delete=1)
frappe.db.sql('''
DELETE from `tabProperty Setter`
WHERE property = 'read_only_onload'
''')
| 22 | 63 | 0.695804 | import frappe
def execute():
frappe.reload_doc('core', 'doctype', 'doctype')
frappe.model.delete_fields({
'DocType': ['hide_heading', 'image_view', 'read_only_onload']
}, delete=1)
frappe.db.sql('''
DELETE from `tabProperty Setter`
WHERE property = 'read_only_onload'
''')
| true | true |
1c4a57858093aea769da74e5245781bdca0980dc | 44,092 | py | Python | sdk/python/pulumi_azure_native/network/v20190501/_inputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/network/v20190501/_inputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/network/v20190501/_inputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # 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... | 43.698712 | 399 | 0.673909 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ._enums import *
__all__ = [
'BackendArgs',
'BackendPoolArgs',
'BackendPoolsSettingsArgs',
'CacheConfigurationArgs',
'ForwardingConfigurationAr... | true | true |
1c4a57868ba829a1a46f4c3661d4ed036f1ad5f9 | 1,295 | py | Python | src/tengi/telegram/telegram_api_utils.py | luckybots/tengi | 1eef42596fb59035a43d6e1fa7b2aa552b52dffc | [
"Apache-2.0"
] | 2 | 2021-08-09T18:02:59.000Z | 2022-01-15T15:11:02.000Z | src/tengi/telegram/telegram_api_utils.py | luckybots/tengi | 1eef42596fb59035a43d6e1fa7b2aa552b52dffc | [
"Apache-2.0"
] | null | null | null | src/tengi/telegram/telegram_api_utils.py | luckybots/tengi | 1eef42596fb59035a43d6e1fa7b2aa552b52dffc | [
"Apache-2.0"
] | null | null | null | from typing import Iterable
from telebot import types as bot_types
from telethon.tl import types as api_types
def api_to_bot_markup(api_markup: api_types.ReplyInlineMarkup) -> bot_types.InlineKeyboardMarkup:
bot_markup = bot_types.InlineKeyboardMarkup()
if api_markup is not None:
for api_r in api_mark... | 43.166667 | 109 | 0.601544 | from typing import Iterable
from telebot import types as bot_types
from telethon.tl import types as api_types
def api_to_bot_markup(api_markup: api_types.ReplyInlineMarkup) -> bot_types.InlineKeyboardMarkup:
bot_markup = bot_types.InlineKeyboardMarkup()
if api_markup is not None:
for api_r in api_mark... | true | true |
1c4a582f3f25a8a9a114c1133dfd741294ed8ca5 | 5,628 | py | Python | src/game/visualisation/visualise_step.py | IvanRoblesMunoz/hungry_geese_game | 806454bbd1178f214ceae51ea9724faffbb13396 | [
"MIT"
] | 1 | 2021-12-04T13:11:07.000Z | 2021-12-04T13:11:07.000Z | src/game/visualisation/visualise_step.py | IvanRoblesMunoz/hungry_geese_game | 806454bbd1178f214ceae51ea9724faffbb13396 | [
"MIT"
] | null | null | null | src/game/visualisation/visualise_step.py | IvanRoblesMunoz/hungry_geese_game | 806454bbd1178f214ceae51ea9724faffbb13396 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 28 18:03:25 2021
@author: roblesi
This module makes the visuals for the game.
"""
# pylint: disable=E0401
# =============================================================================
# Imports
# =================================================... | 29.621053 | 79 | 0.559168 |
import os
from pathlib import Path
from typing import Tuple
import pygame
from pygame import display
from src.game.visualisation.visualisation_statics import (
START_HEIGHT,
START_WIDTH,
WIDTH_STEP,
HEIGHT_STEP,
)
REPO_PATH = Path(os.getcwd())
ASSETS_PATH = REPO_PATH / "src/game/assets"
BA... | true | true |
1c4a583ce9a5a25fca06dd78ceeeadaabb85e3d8 | 16,466 | py | Python | electrumsv/util/__init__.py | electrumsv/electrumsv | a2d9027ccec338cadfca778888e6ef7f077b1651 | [
"MIT"
] | 136 | 2019-01-10T15:49:09.000Z | 2022-02-20T04:46:39.000Z | electrumsv/util/__init__.py | electrumsv/electrumsv | a2d9027ccec338cadfca778888e6ef7f077b1651 | [
"MIT"
] | 790 | 2019-01-07T01:53:35.000Z | 2022-03-30T23:04:28.000Z | electrumsv/util/__init__.py | electrumsv/electrumsv | a2d9027ccec338cadfca778888e6ef7f077b1651 | [
"MIT"
] | 65 | 2019-01-10T23:55:30.000Z | 2021-12-19T06:47:13.000Z | # ElectrumSV - lightweight Bitcoin SV client
# Copyright (C) 2019-2020 The ElectrumSV Developers
# Copyright (C) 2011 Thomas Voegtlin
#
# 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... | 34.665263 | 99 | 0.649034 |
from collections import defaultdict
from decimal import Decimal
from datetime import datetime, timedelta, tzinfo
import json
import hmac
import os
import stat
import sys
import threading
import time
import types
from typing import Any, Callable, cast, Dict, Iterable, List, Optional, Sequence, Se... | true | true |
1c4a5a1c7c070e81fc5736a95a9baebb21c9b24b | 896 | py | Python | unused/py3_tf2_wide_deep/python_v2/lib/utils/image_preprocessing.py | WenqiJiang/FPGA-Accelerator-for-Recommender-Systems | 6c3031487cd1447b7f5362483c14b108177387bb | [
"MIT"
] | 4 | 2020-03-03T12:51:05.000Z | 2021-06-19T17:34:45.000Z | unused/tf2_wide_deep/python/lib/utils/image_preprocessing.py | WenqiJiang/FPGA-Accelerator-for-Recommender-Systems | 6c3031487cd1447b7f5362483c14b108177387bb | [
"MIT"
] | null | null | null | unused/tf2_wide_deep/python/lib/utils/image_preprocessing.py | WenqiJiang/FPGA-Accelerator-for-Recommender-Systems | 6c3031487cd1447b7f5362483c14b108177387bb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: lapis-hong
# @Date : 2018/3/5
"""Provides custom function to preprocess images.
TODO: custom preprocess for CTR task
"""
import tensorflow as tf
def preprocess_image(image, is_training, height, width, depth):
"""Preprocess a single image of layout [height... | 35.84 | 69 | 0.679688 |
import tensorflow as tf
def preprocess_image(image, is_training, height, width, depth):
if is_training:
image = tf.image.resize_with_crop_or_pad(
image, height + 8, width + 8)
image = tf.image.random_crop(image, [height, width, depth])
image = tf... | true | true |
1c4a5a3252aa102f145f995b3c7e86bbde65c4e8 | 455 | py | Python | WebSite/PrayerWall/bookings/tests.py | Tinka8ell/Prayer-Wall | e9e6f3b94a88fc68f26a660b7abc5a781bad8f71 | [
"Apache-2.0"
] | null | null | null | WebSite/PrayerWall/bookings/tests.py | Tinka8ell/Prayer-Wall | e9e6f3b94a88fc68f26a660b7abc5a781bad8f71 | [
"Apache-2.0"
] | null | null | null | WebSite/PrayerWall/bookings/tests.py | Tinka8ell/Prayer-Wall | e9e6f3b94a88fc68f26a660b7abc5a781bad8f71 | [
"Apache-2.0"
] | null | null | null | from django.test import TestCase
# for management command testing
from io import StringIO
from django.core.management import call_command
# Create your tests for bookings here.
class StartEventTest(TestCase):
def test_command_output(self):
out = StringIO()
call_command("startevent 'My New Event'... | 30.333333 | 98 | 0.723077 | from django.test import TestCase
from io import StringIO
from django.core.management import call_command
class StartEventTest(TestCase):
def test_command_output(self):
out = StringIO()
call_command("startevent 'My New Event' 2020/11/27-20 ('online',) ('104', 2)", stdout=out)
self.asser... | true | true |
1c4a5a4d9077dba1b07057603efd5ddf4d638abb | 10,165 | py | Python | isi_sdk_8_2_2/isi_sdk_8_2_2/models/event_channel_extended_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_2/isi_sdk_8_2_2/models/event_channel_extended_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_2/isi_sdk_8_2_2/models/event_channel_extended_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: 9
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_8_2_2.models.event_c... | 31.085627 | 153 | 0.600787 |
import pprint
import re
import six
from isi_sdk_8_2_2.models.event_channel_parameters import EventChannelParameters
class EventChannelExtendedExtended(object):
swagger_types = {
'allowed_nodes': 'list[int]',
'enabled': 'bool',
'excluded_nodes': 'list[int]',
'id': 'int',
... | true | true |
1c4a5ab94d83ecf9ea0835ba18256570b96630c6 | 4,204 | py | Python | challenges/musicbox/musicbox.py | nickbjohnson4224/greyhat-crypto-ctf-2014 | 62d03ecf1126edc04944dc9183fa2ba01ed974e7 | [
"MIT"
] | 4 | 2015-04-18T02:25:20.000Z | 2018-12-17T20:46:07.000Z | challenges/musicbox/musicbox.py | nickbjohnson4224/greyhat-crypto-ctf-2014 | 62d03ecf1126edc04944dc9183fa2ba01ed974e7 | [
"MIT"
] | null | null | null | challenges/musicbox/musicbox.py | nickbjohnson4224/greyhat-crypto-ctf-2014 | 62d03ecf1126edc04944dc9183fa2ba01ed974e7 | [
"MIT"
] | null | null | null | import sys, struct, array
import SocketServer
# import StringIO as StringIO
# import pygame
p = 0x08d682598db70a889ff1bc7e3e00d602e9fe9e812162d4e3d06954b2ff554a4a21d5f0aab3eae5c49ac1aec7117709cba1b88b79ae9805d28ddb99be07ba05ea219654afe0c8dddac7e73165f3dcd851a3c8a3b6515766321420aff177eaaa7b3da39682d7e773aa863a729706d52... | 36.556522 | 519 | 0.766175 | import sys, struct, array
import SocketServer
p = 0x08d682598db70a889ff1bc7e3e00d602e9fe9e812162d4e3d06954b2ff554a4a21d5f0aab3eae5c49ac1aec7117709cba1b88b79ae9805d28ddb99be07ba05ea219654afe0c8dddac7e73165f3dcd851a3c8a3b6515766321420aff177eaaa7b3da39682d7e773aa863a729706d52e83a1d0e34d69b461c837ed239745d6c50f124e34f4d... | false | true |
1c4a5cf471c60ef2a56210e6cc5aeab54a57bcce | 4,028 | py | Python | configs/top_down/resnetv1d/coco/resnetv1d152_coco_256x192.py | jcwon0/BlurHPE | c97a57e92a8a7f171b0403aee640222a32513562 | [
"Apache-2.0"
] | null | null | null | configs/top_down/resnetv1d/coco/resnetv1d152_coco_256x192.py | jcwon0/BlurHPE | c97a57e92a8a7f171b0403aee640222a32513562 | [
"Apache-2.0"
] | null | null | null | configs/top_down/resnetv1d/coco/resnetv1d152_coco_256x192.py | jcwon0/BlurHPE | c97a57e92a8a7f171b0403aee640222a32513562 | [
"Apache-2.0"
] | null | null | null | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None... | 28.771429 | 80 | 0.606504 | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None... | true | true |
1c4a5d624386288eaed2cfbb319df3274578f578 | 28,100 | py | Python | paddlenlp/datasets/dataset.py | JunnYu/ConvBERT-Prod | a1351e1e7f9400cb8c71d0a15d23629b4cb055d4 | [
"Apache-2.0"
] | 11 | 2022-01-06T07:39:47.000Z | 2022-03-22T06:18:40.000Z | paddlenlp/datasets/dataset.py | JunnYu/ConvBERT-Prod | a1351e1e7f9400cb8c71d0a15d23629b4cb055d4 | [
"Apache-2.0"
] | null | null | null | paddlenlp/datasets/dataset.py | JunnYu/ConvBERT-Prod | a1351e1e7f9400cb8c71d0a15d23629b4cb055d4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 38.865837 | 138 | 0.574698 |
import atexit
import collections
import io
import math
import os
import warnings
import sys
import inspect
from multiprocess import Pool, RLock
import time
import paddle.distributed as dist
from paddle.io import Dataset, IterableDataset
from paddle.dataset.common import md5file
from paddle.utils.download... | true | true |
1c4a5d83d36d2e8c948aeb0969a624af35d58159 | 6,949 | py | Python | simple_python_profiler/main.py | jeshan/simple-python-profiler | a3d3a709781b5aaff38b55389c93efd132274344 | [
"MIT"
] | null | null | null | simple_python_profiler/main.py | jeshan/simple-python-profiler | a3d3a709781b5aaff38b55389c93efd132274344 | [
"MIT"
] | 1 | 2021-06-02T00:57:36.000Z | 2021-06-02T00:57:36.000Z | simple_python_profiler/main.py | jeshan/simple-python-profiler | a3d3a709781b5aaff38b55389c93efd132274344 | [
"MIT"
] | null | null | null | import functools
import inspect
import sys
from time import perf_counter_ns
from typing import List, Dict
from loguru import logger
from recursive_decorator import recursive_decorator
def fn_description(f):
return f'{f.__module__}.{f.__qualname__}'
def sort_fn(invocation):
return invocation.end - invocatio... | 27.466403 | 121 | 0.647287 | import functools
import inspect
import sys
from time import perf_counter_ns
from typing import List, Dict
from loguru import logger
from recursive_decorator import recursive_decorator
def fn_description(f):
return f'{f.__module__}.{f.__qualname__}'
def sort_fn(invocation):
return invocation.end - invocatio... | true | true |
1c4a610aebca605ce60f6577184339a699daaaa0 | 470 | py | Python | tests/performance/conftest.py | rspadim/aiocache | bf675ae912173bee25cc1d8c22b77f57de34375d | [
"BSD-3-Clause"
] | 213 | 2020-11-02T14:29:46.000Z | 2022-03-24T23:12:32.000Z | tests/performance/conftest.py | rspadim/aiocache | bf675ae912173bee25cc1d8c22b77f57de34375d | [
"BSD-3-Clause"
] | 48 | 2020-11-02T11:17:13.000Z | 2022-03-24T17:55:31.000Z | tests/performance/conftest.py | rspadim/aiocache | bf675ae912173bee25cc1d8c22b77f57de34375d | [
"BSD-3-Clause"
] | 49 | 2020-11-13T07:41:37.000Z | 2022-03-25T12:24:49.000Z | import pytest
from aiocache import Cache
from aiocache.backends.redis import RedisBackend
@pytest.fixture
def redis_cache(event_loop):
cache = Cache(Cache.REDIS, namespace="test", pool_max_size=1)
yield cache
for _, pool in RedisBackend.pools.items():
pool.close()
event_loop.run_until_co... | 22.380952 | 65 | 0.731915 | import pytest
from aiocache import Cache
from aiocache.backends.redis import RedisBackend
@pytest.fixture
def redis_cache(event_loop):
cache = Cache(Cache.REDIS, namespace="test", pool_max_size=1)
yield cache
for _, pool in RedisBackend.pools.items():
pool.close()
event_loop.run_until_co... | true | true |
1c4a624f74d426cc722ed45176fcf417a5aa38db | 2,970 | py | Python | spacy_crfsuite/tokenizer.py | lusterck/spacy_crfsuite | 21acb6431b8c3c98528d6994880ca7bb3b69f499 | [
"MIT"
] | 12 | 2020-07-29T17:08:06.000Z | 2022-03-28T10:39:39.000Z | spacy_crfsuite/tokenizer.py | marzi-heidari/spacy_crfsuite | b9f31aac9e727245791197aed4245f03a57a89ba | [
"MIT"
] | 5 | 2020-07-29T17:08:03.000Z | 2022-03-28T07:16:19.000Z | spacy_crfsuite/tokenizer.py | marzi-heidari/spacy_crfsuite | b9f31aac9e727245791197aed4245f03a57a89ba | [
"MIT"
] | 7 | 2020-08-06T11:08:30.000Z | 2022-01-20T14:25:19.000Z | import numpy as np
import spacy
from abc import ABCMeta, abstractmethod
from typing import Text, Optional, Any, Dict, Union
class Token:
def __init__(
self,
text: Text,
start: int,
end: Optional[int] = None,
data: Optional[Dict[Text, Any]] = None,
lemma: Optional[T... | 27.5 | 76 | 0.550168 | import numpy as np
import spacy
from abc import ABCMeta, abstractmethod
from typing import Text, Optional, Any, Dict, Union
class Token:
def __init__(
self,
text: Text,
start: int,
end: Optional[int] = None,
data: Optional[Dict[Text, Any]] = None,
lemma: Optional[T... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.