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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f43e9ca847a226070c3451f53cbb8f6351e4a0 | 10,271 | py | Python | tests/integration/sync/v1/service/sync_map/test_sync_map_item.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 1,362 | 2015-01-04T10:25:18.000Z | 2022-03-24T10:07:08.000Z | tests/integration/sync/v1/service/sync_map/test_sync_map_item.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 299 | 2015-01-30T09:52:39.000Z | 2022-03-31T23:03:02.000Z | tests/integration/sync/v1/service/sync_map/test_sync_map_item.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 622 | 2015-01-03T04:43:09.000Z | 2022-03-29T14:11:00.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base import serialize
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response... | 42.26749 | 213 | 0.557687 |
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base import serialize
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class SyncMapItemTestCase(IntegrationTestCase):
def test_fetch_request(self):
self.holodeck.mock(Respons... | true | true |
08f43f44a866bea06317e95fadba808802a2ffb8 | 159 | py | Python | scraping/base_scraper.py | solomonxie/sengine_101 | 9f08fd86b5901947239c188cda03e3efe6ca0e62 | [
"Apache-2.0"
] | null | null | null | scraping/base_scraper.py | solomonxie/sengine_101 | 9f08fd86b5901947239c188cda03e3efe6ca0e62 | [
"Apache-2.0"
] | 1 | 2021-10-07T14:17:26.000Z | 2021-10-07T14:17:26.000Z | scraping/base_scraper.py | solomonxie/sengine_101 | 9f08fd86b5901947239c188cda03e3efe6ca0e62 | [
"Apache-2.0"
] | null | null | null | class BaseScraper:
def __init__(self):
pass
def start(self, url):
pass
def main():
pass
if __name__ == '__main__':
main()
| 10.6 | 26 | 0.54717 | class BaseScraper:
def __init__(self):
pass
def start(self, url):
pass
def main():
pass
if __name__ == '__main__':
main()
| true | true |
08f43fc940a0a065249b7ea844f3ce9c9e32b507 | 729 | py | Python | tools/mo/openvino/tools/mo/front/onnx/lrn_ext.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | tools/mo/openvino/tools/mo/front/onnx/lrn_ext.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | tools/mo/openvino/tools/mo/front/onnx/lrn_ext.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.front.onnx.extractors.utils import onnx_attr
from openvino.tools.mo.ops.lrn import AttributedLRN
class LRNFrontExtractor(FrontExtractorOp):
op = ... | 31.695652 | 67 | 0.643347 |
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.front.onnx.extractors.utils import onnx_attr
from openvino.tools.mo.ops.lrn import AttributedLRN
class LRNFrontExtractor(FrontExtractorOp):
op = 'LRN'
enabled = True
@classmethod
def extract(cls, node):
att... | true | true |
08f4408be6f9ea1cfd2bedb25b4c4ec77fb7ef1f | 3,056 | py | Python | experiments/loggers.py | yuqZY/ECG_Encoder_Physionet2015 | 5642de51838b028f2315e25ea2bd8e620ef0e65c | [
"MIT"
] | null | null | null | experiments/loggers.py | yuqZY/ECG_Encoder_Physionet2015 | 5642de51838b028f2315e25ea2bd8e620ef0e65c | [
"MIT"
] | null | null | null | experiments/loggers.py | yuqZY/ECG_Encoder_Physionet2015 | 5642de51838b028f2315e25ea2bd8e620ef0e65c | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
import logging
import time
import prettytable as pt
import csv
# logging.basicConfig(filename='./LOG/main.log')
log = logging.getLogger(__name__)
class Logger(ABC):
@abstractmethod
def log_epoch(self, epochs_df):
raise NotImplementedError("Need to impl... | 29.960784 | 82 | 0.52716 | from abc import ABC, abstractmethod
import logging
import time
import prettytable as pt
import csv
log = logging.getLogger(__name__)
class Logger(ABC):
@abstractmethod
def log_epoch(self, epochs_df):
raise NotImplementedError("Need to implement the log_epoch function!")
class Printer... | true | true |
08f4409c005d08496fb1834013ec40829aca4b3f | 1,573 | py | Python | checker/api/mojang.py | OrphicHymns/Monolith | cacc453945f8d6209cc40d54f7212e7555898c86 | [
"MIT"
] | 2 | 2021-10-17T04:39:50.000Z | 2022-01-10T12:35:25.000Z | checker/api/mojang.py | OrphicHymns/Monolith | cacc453945f8d6209cc40d54f7212e7555898c86 | [
"MIT"
] | null | null | null | checker/api/mojang.py | OrphicHymns/Monolith | cacc453945f8d6209cc40d54f7212e7555898c86 | [
"MIT"
] | null | null | null | from typing import Optional
from aiohttp_proxy import ProxyConnector
from aiohttp import ClientSession, ClientTimeout
from checker.functions import create_mojang_payload
from checker.api.types import Account, MojangLoginResponse
from checker.constants import MOJANG_AUTH, JSON_POST_HEADERS
async def mojang... | 37.452381 | 115 | 0.621106 | from typing import Optional
from aiohttp_proxy import ProxyConnector
from aiohttp import ClientSession, ClientTimeout
from checker.functions import create_mojang_payload
from checker.api.types import Account, MojangLoginResponse
from checker.constants import MOJANG_AUTH, JSON_POST_HEADERS
async def mojang... | true | true |
08f440a7436695bd4f218e058ebaa203748b321b | 3,942 | py | Python | saleor/graphql/app/tests/mutations/test_app_delete.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 15,337 | 2015-01-12T02:11:52.000Z | 2021-10-05T19:19:29.000Z | saleor/graphql/app/tests/mutations/test_app_delete.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 7,486 | 2015-02-11T10:52:13.000Z | 2021-10-06T09:37:15.000Z | saleor/graphql/app/tests/mutations/test_app_delete.py | aminziadna/saleor | 2e78fb5bcf8b83a6278af02551a104cfa555a1fb | [
"CC-BY-4.0"
] | 5,864 | 2015-01-16T14:52:54.000Z | 2021-10-05T23:01:15.000Z | import graphene
from .....app.error_codes import AppErrorCode
from .....app.models import App
from ....tests.utils import get_graphql_content
APP_DELETE_MUTATION = """
mutation appDelete($id: ID!){
appDelete(id: $id){
errors{
field
message
code
}
app{
... | 27.375 | 76 | 0.690005 | import graphene
from .....app.error_codes import AppErrorCode
from .....app.models import App
from ....tests.utils import get_graphql_content
APP_DELETE_MUTATION = """
mutation appDelete($id: ID!){
appDelete(id: $id){
errors{
field
message
code
}
app{
... | true | true |
08f440da363a756e2a9eb266e30c759123ee5814 | 533 | py | Python | main_app/api/serializers.py | ignaoya/polstats-django | b4d33d661c21d23288e91533a707734bbaed3617 | [
"MIT"
] | null | null | null | main_app/api/serializers.py | ignaoya/polstats-django | b4d33d661c21d23288e91533a707734bbaed3617 | [
"MIT"
] | 1 | 2021-05-21T07:05:41.000Z | 2021-05-21T07:05:41.000Z | main_app/api/serializers.py | ignaoya/polstats-django | b4d33d661c21d23288e91533a707734bbaed3617 | [
"MIT"
] | 1 | 2021-04-30T17:27:57.000Z | 2021-04-30T17:27:57.000Z | from rest_framework import serializers
from ..models import Article, Country, Source
class CountrySerializer(serializers.ModelSerializer):
class Meta:
model = Country
fields = ['name']
class SourceSerializer(serializers.ModelSerializer):
class Meta:
model = Source
fields = ['... | 25.380952 | 92 | 0.664165 | from rest_framework import serializers
from ..models import Article, Country, Source
class CountrySerializer(serializers.ModelSerializer):
class Meta:
model = Country
fields = ['name']
class SourceSerializer(serializers.ModelSerializer):
class Meta:
model = Source
fields = ['... | true | true |
08f4413b3811b245836f6e1d5dc91707ba3f0e60 | 1,047 | py | Python | CryptoCoin_ETL/producer.py | flh4/DataEngineering | df87a4a3c14b19fa469c3c1ab26920330f712317 | [
"MIT"
] | null | null | null | CryptoCoin_ETL/producer.py | flh4/DataEngineering | df87a4a3c14b19fa469c3c1ab26920330f712317 | [
"MIT"
] | null | null | null | CryptoCoin_ETL/producer.py | flh4/DataEngineering | df87a4a3c14b19fa469c3c1ab26920330f712317 | [
"MIT"
] | null | null | null | from kafka import KafkaProducer
from requests import request
from time import sleep
import json
def makeUrls(ids):
ids = ids
urls = []
for coin in ids:
urls.append("https://coinranking1.p.rapidapi.com/coin/"+str(ids[coin]))
return urls
def getApi_Key():
with open("keys.txt") as f:
return f.readline().rstri... | 21.367347 | 73 | 0.708691 | from kafka import KafkaProducer
from requests import request
from time import sleep
import json
def makeUrls(ids):
ids = ids
urls = []
for coin in ids:
urls.append("https://coinranking1.p.rapidapi.com/coin/"+str(ids[coin]))
return urls
def getApi_Key():
with open("keys.txt") as f:
return f.readline().rstri... | true | true |
08f44210e7f4633072a5086507e18dedc420b0ce | 2,792 | py | Python | Python3-Learn/TIC_TAC_TOE game.py | nikhiljain-413/Hacktoberfest2021_beginner | 56b008c9ed294c3fc23b44fa13faced99948236d | [
"MIT"
] | 65 | 2021-10-01T07:02:29.000Z | 2022-03-23T10:41:37.000Z | Python3-Learn/TIC_TAC_TOE game.py | nikhiljain-413/Hacktoberfest2021_beginner | 56b008c9ed294c3fc23b44fa13faced99948236d | [
"MIT"
] | 82 | 2021-10-01T14:21:42.000Z | 2022-03-29T03:43:58.000Z | Python3-Learn/TIC_TAC_TOE game.py | nikhiljain-413/Hacktoberfest2021_beginner | 56b008c9ed294c3fc23b44fa13faced99948236d | [
"MIT"
] | 210 | 2021-10-01T07:02:39.000Z | 2022-03-27T17:41:00.000Z |
# AUTHOR: Hitesh Vishnoi
# Python3 Concept: Tic Tac Toe Game !!
# GITHUB: https://github.com/hiteshv01
import numpy as np
import random
from time import sleep
# Creates an empty board
def create_board():
return(np.array([[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]))
# Che... | 23.462185 | 59 | 0.528295 |
import numpy as np
import random
from time import sleep
def create_board():
return(np.array([[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]))
def possibilities(board):
l = []
for i in range(len(board)):
for j in range(len(board)):
if board[i]... | true | true |
08f44262028fb9d3090f0d4b994cd5a5ef8689e8 | 3,683 | py | Python | app/core/migrations/0001_initial.py | claytonseraphin/haitian-food-recipe-app-api | e82b3034e47c2ce778d89b476a4573345c2a7746 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | claytonseraphin/haitian-food-recipe-app-api | e82b3034e47c2ce778d89b476a4573345c2a7746 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | claytonseraphin/haitian-food-recipe-app-api | e82b3034e47c2ce778d89b476a4573345c2a7746 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-09 17:45
import core.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
... | 52.614286 | 266 | 0.614173 |
import core.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.Create... | true | true |
08f443f43a05103b35e9b38e0b2521e3b96939a6 | 633 | py | Python | examples/miniapps/bundles/bundles/photos/__init__.py | vlad-ghita/python-dependency-injector | 5cf5bdda24851dd97cfa0f5054f4a8c35ddac014 | [
"BSD-3-Clause"
] | null | null | null | examples/miniapps/bundles/bundles/photos/__init__.py | vlad-ghita/python-dependency-injector | 5cf5bdda24851dd97cfa0f5054f4a8c35ddac014 | [
"BSD-3-Clause"
] | null | null | null | examples/miniapps/bundles/bundles/photos/__init__.py | vlad-ghita/python-dependency-injector | 5cf5bdda24851dd97cfa0f5054f4a8c35ddac014 | [
"BSD-3-Clause"
] | null | null | null | """Photos bundle."""
from dependency_injector import containers
from dependency_injector import providers
from . import entities
from . import repositories
class Photos(containers.DeclarativeContainer):
"""Photos bundle container."""
database = providers.Dependency()
file_storage = providers.Dependency... | 30.142857 | 73 | 0.624013 |
from dependency_injector import containers
from dependency_injector import providers
from . import entities
from . import repositories
class Photos(containers.DeclarativeContainer):
database = providers.Dependency()
file_storage = providers.Dependency()
photo = providers.Factory(entities.Photo)
ph... | true | true |
08f44410075e4a7db79c185037b3e671bc2fc924 | 170 | py | Python | tests/integration/projects/fastai2/tests/test_service.py | Shumpei-Kikuta/BentoML | 4fe508934ab431ea5c414ee9d8b84c2104688381 | [
"Apache-2.0"
] | 3,451 | 2019-04-02T01:47:42.000Z | 2022-03-31T16:20:49.000Z | tests/integration/projects/fastai2/tests/test_service.py | Shumpei-Kikuta/BentoML | 4fe508934ab431ea5c414ee9d8b84c2104688381 | [
"Apache-2.0"
] | 1,925 | 2019-04-03T00:19:05.000Z | 2022-03-31T22:41:54.000Z | tests/integration/projects/fastai2/tests/test_service.py | Shumpei-Kikuta/BentoML | 4fe508934ab431ea5c414ee9d8b84c2104688381 | [
"Apache-2.0"
] | 451 | 2019-04-02T01:53:41.000Z | 2022-03-29T08:49:06.000Z | import pandas
test_df = pandas.DataFrame([[1] * 5])
def test_fastai2_artifact_pack(service):
assert service.predict(test_df) == 5.0, 'Run inference before saving'
| 21.25 | 73 | 0.735294 | import pandas
test_df = pandas.DataFrame([[1] * 5])
def test_fastai2_artifact_pack(service):
assert service.predict(test_df) == 5.0, 'Run inference before saving'
| true | true |
08f4442e61343949a2c2700eb4ba43e91f4d1c8f | 5,962 | py | Python | docs/source/conf.py | dmathijs/patent_client | 0466d34ef7af8556a11a2cff865d0f89ef7bd542 | [
"Apache-2.0"
] | null | null | null | docs/source/conf.py | dmathijs/patent_client | 0466d34ef7af8556a11a2cff865d0f89ef7bd542 | [
"Apache-2.0"
] | null | null | null | docs/source/conf.py | dmathijs/patent_client | 0466d34ef7af8556a11a2cff865d0f89ef7bd542 | [
"Apache-2.0"
] | null | null | null | # -*- 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.111111 | 86 | 0.637035 |
project = "Patent Client"
copyright = "2018, Parker Hancock"
author = "Parker Hancock"
version = release = "2.0.2"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.mathjax",
"sphinx.ext.ifconfig"... | true | true |
08f444db9bbaba4c5b1745f0172dadb73fa046e6 | 10,139 | py | Python | pymfit/erwin_utils/imfit.py | johnnygreco/pymfit | 4af480771c8b9a463a3c1cf0abde1ac416649bbe | [
"MIT"
] | 4 | 2017-04-13T07:20:54.000Z | 2021-12-02T01:57:40.000Z | pymfit/erwin_utils/imfit.py | johnnygreco/pymfit | 4af480771c8b9a463a3c1cf0abde1ac416649bbe | [
"MIT"
] | 8 | 2017-04-14T02:30:35.000Z | 2019-02-28T17:26:51.000Z | pymfit/erwin_utils/imfit.py | johnnygreco/pymfit | 4af480771c8b9a463a3c1cf0abde1ac416649bbe | [
"MIT"
] | 3 | 2017-04-13T07:26:07.000Z | 2019-11-18T04:22:11.000Z | """
Python helper functions for imfit written by Peter Erwin.
Modified by Johnny Greco to be compatible with python 3.
"""
from __future__ import division, print_function
# Code for reading in and analyzing output of imfit
import glob
import numpy as np
from . import imfit_funcs as imfuncs
# dictionary mapping imf... | 32.706452 | 101 | 0.711411 | from __future__ import division, print_function
import glob
import numpy as np
from . import imfit_funcs as imfuncs
imfitFunctionMap = {"Exponential": {"function": imfuncs.Exponential, "nSkip": 2, "ell": 1, "a": [3]},
"Exponential_GenEllipse": {"function": imfuncs.Exponential, "nSkip": 3, "ell": 1, "a": [4]},
... | true | true |
08f444f0f6d489a4661b763a86fd67b31ff41e50 | 8,822 | py | Python | src/linked_lists.py | jakubtuchol/epi | 461d4dc16a4126cae838d6106f9ef972742fa62c | [
"MIT"
] | 16 | 2017-04-10T15:03:40.000Z | 2022-01-08T23:57:32.000Z | src/linked_lists.py | jakubtuchol/epi | 461d4dc16a4126cae838d6106f9ef972742fa62c | [
"MIT"
] | null | null | null | src/linked_lists.py | jakubtuchol/epi | 461d4dc16a4126cae838d6106f9ef972742fa62c | [
"MIT"
] | null | null | null | """
Chapter 8: Linked Lists
"""
class Node(object):
def __init__(self, value):
self.val = value
self.next = None
def merge_sorted_lists(ls_1, ls_2):
"""
Question 8.1: merge two sorted singly-linked lists
"""
dummy_head = Node(1000000)
tail = dummy_head
while ls_1 and ls... | 21.360775 | 75 | 0.584221 |
class Node(object):
def __init__(self, value):
self.val = value
self.next = None
def merge_sorted_lists(ls_1, ls_2):
dummy_head = Node(1000000)
tail = dummy_head
while ls_1 and ls_2:
if ls_1.val <= ls_2.val:
tail.next = ls_1
ls_1 = ls_1.next
... | true | true |
08f4454eb63990d658e0d07de1fd42ad70bdd208 | 4,418 | py | Python | MisPerris/settings.py | Alonso-Arias/misPerris2019 | 9e1649839f498dc2ad78e685ab7bef0683de3b73 | [
"MIT"
] | null | null | null | MisPerris/settings.py | Alonso-Arias/misPerris2019 | 9e1649839f498dc2ad78e685ab7bef0683de3b73 | [
"MIT"
] | 14 | 2019-12-05T01:02:44.000Z | 2022-03-12T00:06:57.000Z | MisPerris/settings.py | Alonso-Arias/misPerris2019 | 9e1649839f498dc2ad78e685ab7bef0683de3b73 | [
"MIT"
] | null | null | null | """
Django settings for MisPerris project.
Generated by 'django-admin startproject' using Django 2.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
#... | 27.440994 | 106 | 0.708239 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'upr!94$yy^!=id$)hqn)-xtbn@rtq&r110a+wl*$quk#=do$kt'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
08f445b91bf16e41718891bc52c10880778385c0 | 12,245 | py | Python | cnn_architectures.py | faresbs/sign-language-tutor | d4091d6cd582a80a5ad38759e973357b02731fc8 | [
"MIT"
] | null | null | null | cnn_architectures.py | faresbs/sign-language-tutor | d4091d6cd582a80a5ad38759e973357b02731fc8 | [
"MIT"
] | null | null | null | cnn_architectures.py | faresbs/sign-language-tutor | d4091d6cd582a80a5ad38759e973357b02731fc8 | [
"MIT"
] | 1 | 2021-07-24T17:11:15.000Z | 2021-07-24T17:11:15.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from torchvision import models
import torch.utils.model_zoo as model_zoo
model_urls = {
'inception_v3_google': 'https://download.pytorch.org/models/inception_v3_google-1a9a5a14.pth',
}
class vgg16(nn.Mo... | 35.288184 | 98 | 0.623438 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from torchvision import models
import torch.utils.model_zoo as model_zoo
model_urls = {
'inception_v3_google': 'https://download.pytorch.org/models/inception_v3_google-1a9a5a14.pth',
}
class vgg16(nn.Mo... | true | true |
08f445e2bcc55251c2246ece9609c8b99d7fed58 | 8,032 | py | Python | test/system/benchmark/vdbench/manager.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | null | null | null | test/system/benchmark/vdbench/manager.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | null | null | null | test/system/benchmark/vdbench/manager.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | null | null | null | import lib
import csv
import json
import asyncio
class Vdbench:
def __init__(self, init_name, id, pw, nic_ssh, vdbench_dir, output_dir, jvm=32):
self.init_name = init_name
self.id = id
self.pw = pw
self.nic_ssh = nic_ssh
self.opt = {} # size, openflags
self.jobs = ... | 38.990291 | 166 | 0.531997 | import lib
import csv
import json
import asyncio
class Vdbench:
def __init__(self, init_name, id, pw, nic_ssh, vdbench_dir, output_dir, jvm=32):
self.init_name = init_name
self.id = id
self.pw = pw
self.nic_ssh = nic_ssh
self.opt = {} self.jobs = []
self.cm... | true | true |
08f446aa67a240eddfd3a7f2b64f5c6be1eda8c3 | 7,320 | py | Python | openprocurement/auctions/swiftsure/tests/bidder.py | bdmbdsm/openprocurement.auctions.swiftsure | f5b93555eb12212c69c8168f861376eae85f4648 | [
"Apache-2.0"
] | null | null | null | openprocurement/auctions/swiftsure/tests/bidder.py | bdmbdsm/openprocurement.auctions.swiftsure | f5b93555eb12212c69c8168f861376eae85f4648 | [
"Apache-2.0"
] | null | null | null | openprocurement/auctions/swiftsure/tests/bidder.py | bdmbdsm/openprocurement.auctions.swiftsure | f5b93555eb12212c69c8168f861376eae85f4648 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from openprocurement.auctions.core.tests.base import snitch
from openprocurement.auctions.core.tests.bidder import (
AuctionBidderDocumentResourceTestMixin,
AuctionBidderDocumentWithDSResourceTestMixin
)
from openprocurement.auctions.core.tests.blanks.bidder_blanks impor... | 42.312139 | 128 | 0.679098 | import unittest
from openprocurement.auctions.core.tests.base import snitch
from openprocurement.auctions.core.tests.bidder import (
AuctionBidderDocumentResourceTestMixin,
AuctionBidderDocumentWithDSResourceTestMixin
)
from openprocurement.auctions.core.tests.blanks.bidder_blanks import (
features_bid... | true | true |
08f446c3cfef17bd6c8bb153c28443b0dcbc7f32 | 698 | py | Python | jobrun/multi.py | ToothAndClaw/auto3dgm_nazar | c8202c964ebb8f8e2410bbd739bfb01d1ba4dcf4 | [
"MIT"
] | null | null | null | jobrun/multi.py | ToothAndClaw/auto3dgm_nazar | c8202c964ebb8f8e2410bbd739bfb01d1ba4dcf4 | [
"MIT"
] | 9 | 2018-12-14T18:46:54.000Z | 2019-03-29T17:40:23.000Z | jobrun/multi.py | ToothAndClaw/auto3dgm_nazar | c8202c964ebb8f8e2410bbd739bfb01d1ba4dcf4 | [
"MIT"
] | 4 | 2018-12-07T21:03:30.000Z | 2019-01-26T22:07:11.000Z | from pathos.multiprocessing import ProcessingPool as Pool
import pathos.multiprocessing as multiprocessing
import logging
#mpl = multiprocessing.log_to_stderr()
#mpl.setLevel(logging.INFO)
import traceback
import pdb
from tvtk.api import tvtk
from numpy import all, amin, any, argmax, array, isclose, ndarray, where, e... | 29.083333 | 79 | 0.756447 | from pathos.multiprocessing import ProcessingPool as Pool
import pathos.multiprocessing as multiprocessing
import logging
import traceback
import pdb
from tvtk.api import tvtk
from numpy import all, amin, any, argmax, array, isclose, ndarray, where, empty
import random
from scipy.spatial.distance import cdist
from au... | true | true |
08f4472eae3e491929154a2c4fed5610b772989e | 5,986 | py | Python | tests/test_upsert_block.py | dhagrow/pydgraph | 36ae225dbaa24706f346b65c1dfb301c258131d7 | [
"Apache-2.0"
] | 260 | 2016-07-07T10:49:24.000Z | 2022-03-29T01:34:28.000Z | tests/test_upsert_block.py | dhagrow/pydgraph | 36ae225dbaa24706f346b65c1dfb301c258131d7 | [
"Apache-2.0"
] | 121 | 2016-07-05T13:18:11.000Z | 2022-03-21T11:08:51.000Z | tests/test_upsert_block.py | dhagrow/pydgraph | 36ae225dbaa24706f346b65c1dfb301c258131d7 | [
"Apache-2.0"
] | 89 | 2017-03-25T18:37:22.000Z | 2022-03-16T18:31:27.000Z | # Copyright 2019 Dgraph Labs, 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 writ... | 31.340314 | 104 | 0.545773 |
__author__ = 'Animesh Pathak <animesh@dgrpah.io>'
__maintainer__ = 'Animesh Pathak <animesh@dgrpah.io>'
import unittest
import logging
import json
from . import helper
class TestUpsertBlock(helper.ClientIntegrationTestCase):
def setUp(self):
super(TestUpsertBlock, self).setUp()
helper.drop_all(... | true | true |
08f4476ce72a67df80d488b79831c16d7594a80c | 824 | py | Python | omnizart/cli/patch_cnn/transcribe.py | nicolasanjoran/omnizart | b0e74af39b2e3a312ef32dbf0837626b2e043cb6 | [
"MIT"
] | 1,145 | 2020-11-13T10:07:47.000Z | 2022-03-29T17:35:36.000Z | omnizart/cli/patch_cnn/transcribe.py | nicolasanjoran/omnizart | b0e74af39b2e3a312ef32dbf0837626b2e043cb6 | [
"MIT"
] | 44 | 2020-12-29T04:51:16.000Z | 2022-03-15T06:52:04.000Z | omnizart/cli/patch_cnn/transcribe.py | nicolasanjoran/omnizart | b0e74af39b2e3a312ef32dbf0837626b2e043cb6 | [
"MIT"
] | 61 | 2020-12-19T09:09:42.000Z | 2022-03-23T01:26:22.000Z | import click
from omnizart.cli import silence_tensorflow
from omnizart.cli.common_options import add_common_options, COMMON_TRANSCRIBE_OPTIONS
from omnizart.utils import LazyLoader
patch_cnn = LazyLoader("patch_cnn", globals(), "omnizart.patch_cnn")
@click.command()
@add_common_options(COMMON_TRANSCRIBE_OPTIONS)
d... | 32.96 | 85 | 0.777913 | import click
from omnizart.cli import silence_tensorflow
from omnizart.cli.common_options import add_common_options, COMMON_TRANSCRIBE_OPTIONS
from omnizart.utils import LazyLoader
patch_cnn = LazyLoader("patch_cnn", globals(), "omnizart.patch_cnn")
@click.command()
@add_common_options(COMMON_TRANSCRIBE_OPTIONS)
d... | true | true |
08f44838263e946101b2c02db0ce2c54178cd7d7 | 8,054 | py | Python | tools/c7n_azure/tests_azure/test_storage_firewall_actions.py | al3pht/cloud-custodian | ce6613d1b716f336384c5e308eee300389e6bf50 | [
"Apache-2.0"
] | 2,415 | 2018-12-04T00:37:58.000Z | 2022-03-31T12:28:56.000Z | tools/c7n_azure/tests_azure/test_storage_firewall_actions.py | al3pht/cloud-custodian | ce6613d1b716f336384c5e308eee300389e6bf50 | [
"Apache-2.0"
] | 3,272 | 2018-12-03T23:58:17.000Z | 2022-03-31T21:15:32.000Z | tools/c7n_azure/tests_azure/test_storage_firewall_actions.py | al3pht/cloud-custodian | ce6613d1b716f336384c5e308eee300389e6bf50 | [
"Apache-2.0"
] | 773 | 2018-12-06T09:43:23.000Z | 2022-03-30T20:44:43.000Z | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import re
from azure.mgmt.storage.models import (DefaultAction,
StorageAccountUpdateParameters)
from c7n.utils import local_session
from c7n_azure.session import Session
from .azure_common import Base... | 36.443439 | 97 | 0.543581 | import re
from azure.mgmt.storage.models import (DefaultAction,
StorageAccountUpdateParameters)
from c7n.utils import local_session
from c7n_azure.session import Session
from .azure_common import BaseTest, arm_template
rg_name = 'test_storage'
class StorageTestFirewallActions... | true | true |
08f44c2e036d2e528679f6a2faea9159e5df172a | 15,141 | py | Python | crazyflie_demo/scripts/safety_check.py | CooperDrones/VIP_Crazyswarm | 331c8018efa8972d6f115798ea1dfda0dcb095b5 | [
"MIT"
] | null | null | null | crazyflie_demo/scripts/safety_check.py | CooperDrones/VIP_Crazyswarm | 331c8018efa8972d6f115798ea1dfda0dcb095b5 | [
"MIT"
] | null | null | null | crazyflie_demo/scripts/safety_check.py | CooperDrones/VIP_Crazyswarm | 331c8018efa8972d6f115798ea1dfda0dcb095b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import pickle
from datetime import datetime
from pytz import timezone
# Import crazyflie model modules
from a_cf_controller_phys import AltitudeControllerPhys, XYControllerPhys, YawControllerPhys, XYControllerTrajPhys
from data_plotter import DataPlotter
import crazyflie_param... | 41.368852 | 133 | 0.590648 |
import numpy as np
import pickle
from datetime import datetime
from pytz import timezone
from a_cf_controller_phys import AltitudeControllerPhys, XYControllerPhys, YawControllerPhys, XYControllerTrajPhys
from data_plotter import DataPlotter
import crazyflie_param as P
from tf import TransformListener
import rospy
fr... | true | true |
08f44c7313836412953adac9acbbdaeff19ba008 | 108,505 | py | Python | llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py | coderrick/compiler-design | f7719dbc5e1104d5cd2bc1e1345afcb223e1d146 | [
"Apache-2.0"
] | null | null | null | llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py | coderrick/compiler-design | f7719dbc5e1104d5cd2bc1e1345afcb223e1d146 | [
"Apache-2.0"
] | null | null | null | llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py | coderrick/compiler-design | f7719dbc5e1104d5cd2bc1e1345afcb223e1d146 | [
"Apache-2.0"
] | null | null | null | """
LLDB module which provides the abstract base class of lldb test case.
The concrete subclass can override lldbtest.TestBase in order to inherit the
common behavior for unitest.TestCase.setUp/tearDown implemented in this file.
The subclass should override the attribute mydir in order for the python runtime
to locat... | 39.950295 | 142 | 0.598959 |
from __future__ import absolute_import
from __future__ import print_function
import abc
from distutils.version import LooseVersion
from functools import wraps
import gc
import glob
import io
import os.path
import re
import shutil
import signal
from subprocess import *
import sys
import time
import traceback
import di... | true | true |
08f44db4ba352f3c1e8af68b81c51d5da2a08cf2 | 402 | py | Python | tests/flytekit/unit/tools/test_lazy_loader.py | sanketsaurav/flytekit | e3ed536ae1391a59a6cca4ea07f7310028667211 | [
"Apache-2.0"
] | null | null | null | tests/flytekit/unit/tools/test_lazy_loader.py | sanketsaurav/flytekit | e3ed536ae1391a59a6cca4ea07f7310028667211 | [
"Apache-2.0"
] | null | null | null | tests/flytekit/unit/tools/test_lazy_loader.py | sanketsaurav/flytekit | e3ed536ae1391a59a6cca4ea07f7310028667211 | [
"Apache-2.0"
] | 1 | 2019-08-28T22:27:07.000Z | 2019-08-28T22:27:07.000Z | from __future__ import absolute_import
from flytekit.tools import lazy_loader
import pytest
import six
def test_lazy_loader_error_message():
lazy_loader.LazyLoadPlugin(
"uninstalled_plugin",
[],
["made.up.module"]
)
with pytest.raises(ImportError) as e:
import made.up.modul... | 22.333333 | 61 | 0.691542 | from __future__ import absolute_import
from flytekit.tools import lazy_loader
import pytest
import six
def test_lazy_loader_error_message():
lazy_loader.LazyLoadPlugin(
"uninstalled_plugin",
[],
["made.up.module"]
)
with pytest.raises(ImportError) as e:
import made.up.modul... | true | true |
08f44e64460951ff661acb9f2bdf9b8c30f1c3e6 | 270 | py | Python | icenetgeoapi/generate_config.py | alan-turing-institute/IceNetOGCAPI | d161bf8efd2013d255986876cd3de4b92e1dc42e | [
"MIT"
] | null | null | null | icenetgeoapi/generate_config.py | alan-turing-institute/IceNetOGCAPI | d161bf8efd2013d255986876cd3de4b92e1dc42e | [
"MIT"
] | 9 | 2021-11-22T14:25:06.000Z | 2022-02-18T18:06:22.000Z | icenetgeoapi/generate_config.py | alan-turing-institute/IceNetGeoAPI | d161bf8efd2013d255986876cd3de4b92e1dc42e | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import chevron
import yaml
# Load
with open("pygeoapi.secrets", "r") as f:
hash = yaml.safe_load(f)
with open("pygeoapi.mustache.yml", "r") as f:
config = chevron.render(f, hash)
with open("pygeoapi.yml", "w") as f:
f.write(config)
| 19.285714 | 45 | 0.655556 | import chevron
import yaml
with open("pygeoapi.secrets", "r") as f:
hash = yaml.safe_load(f)
with open("pygeoapi.mustache.yml", "r") as f:
config = chevron.render(f, hash)
with open("pygeoapi.yml", "w") as f:
f.write(config)
| true | true |
08f44eb573cc5ff2a6c77588952947de41fb2c85 | 3,031 | py | Python | test/test_ui_commands.py | drm00/beets | c2d180cd86417898a6501440b09b65237b278547 | [
"MIT"
] | null | null | null | test/test_ui_commands.py | drm00/beets | c2d180cd86417898a6501440b09b65237b278547 | [
"MIT"
] | null | null | null | test/test_ui_commands.py | drm00/beets | c2d180cd86417898a6501440b09b65237b278547 | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation th... | 32.945652 | 71 | 0.676015 |
import os
import shutil
from test import _common
from test._common import unittest
from beets import library
from beets import ui
from beets.ui import commands
class QueryTest(_common.TestCase):
def setUp(self):
super(QueryTest, self).setUp()
self.libdir = os.path.join(self.temp_dir, 'testlibd... | true | true |
08f44f20b4c0a63a86202779554733c6fff03c9c | 2,465 | py | Python | setup.py | ramzitannous/drf-social-auth | d06a36a9f1c5e44857c24eb7760939e30a1ebb58 | [
"0BSD"
] | null | null | null | setup.py | ramzitannous/drf-social-auth | d06a36a9f1c5e44857c24eb7760939e30a1ebb58 | [
"0BSD"
] | null | null | null | setup.py | ramzitannous/drf-social-auth | d06a36a9f1c5e44857c24eb7760939e30a1ebb58 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import sys
from setuptools import setup
name = 'drf_social'
package = 'drf_social'
description = 'Social Authentication For Django Rest Framework'
url = 'https://github.com/ramzitannous/drf-social-auth'
author = 'Ramzi Tannous'
author_email = 'ramzi271... | 28.011364 | 72 | 0.621907 | import re
import os
import sys
from setuptools import setup
name = 'drf_social'
package = 'drf_social'
description = 'Social Authentication For Django Rest Framework'
url = 'https://github.com/ramzitannous/drf-social-auth'
author = 'Ramzi Tannous'
author_email = 'ramzi271996@gmail.com'
license = 'BSD'
def get_versi... | true | true |
08f4511aa89d33122bbf88480626f27cad7bc65f | 4,410 | py | Python | mayan/apps/ocr/south_migrations/0001_initial.py | mbehrle/mayan-edms | 9ebf27d2ea1666eaa36ad6ddc0fb9c6accf5cced | [
"Apache-2.0"
] | null | null | null | mayan/apps/ocr/south_migrations/0001_initial.py | mbehrle/mayan-edms | 9ebf27d2ea1666eaa36ad6ddc0fb9c6accf5cced | [
"Apache-2.0"
] | 1 | 2022-03-12T01:03:39.000Z | 2022-03-12T01:03:39.000Z | mayan/apps/ocr/south_migrations/0001_initial.py | mbehrle/mayan-edms | 9ebf27d2ea1666eaa36ad6ddc0fb9c6accf5cced | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'DocumentQueue'
db.create_table(u'ocr_documentqueue', (
(u'id', self.gf('django.db.models.fields.... | 59.594595 | 155 | 0.586395 | from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.create_table(u'ocr_documentqueue', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', se... | true | true |
08f45175203589a46b375c86cf89e2451fb5da25 | 344 | py | Python | scripts/load_sim.py | ori-goals/lfd-min-human-effort | f9fd70cdeb661151e5f81ac538ceb865531146b9 | [
"MIT"
] | 1 | 2020-07-31T07:37:56.000Z | 2020-07-31T07:37:56.000Z | scripts/load_sim.py | ori-goals/lfd-min-human-effort | f9fd70cdeb661151e5f81ac538ceb865531146b9 | [
"MIT"
] | null | null | null | scripts/load_sim.py | ori-goals/lfd-min-human-effort | f9fd70cdeb661151e5f81ac538ceb865531146b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from learn_to_manipulate.simulate import Simulation
import rospy
if __name__ == "__main__" :
rospy.init_node('learn_to_manipulate')
sim = Simulation.load_simulation('/home/marcrigter/2019-08-08-11-49_learnt1_key_teleop0.pkl')
case_number = 10
sim.run_new_episode(case_number, cont... | 31.272727 | 97 | 0.767442 | from learn_to_manipulate.simulate import Simulation
import rospy
if __name__ == "__main__" :
rospy.init_node('learn_to_manipulate')
sim = Simulation.load_simulation('/home/marcrigter/2019-08-08-11-49_learnt1_key_teleop0.pkl')
case_number = 10
sim.run_new_episode(case_number, controller_type = 'learnt'... | true | true |
08f45233be8effd13ee2099c420db19ae68ad23e | 6,352 | py | Python | lib/hypervisor/hv_kvm/netdev.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 396 | 2015-01-22T11:44:32.000Z | 2022-03-31T14:14:29.000Z | lib/hypervisor/hv_kvm/netdev.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 1,550 | 2015-04-05T09:53:50.000Z | 2022-03-28T17:42:20.000Z | lib/hypervisor/hv_kvm/netdev.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 119 | 2015-01-06T21:37:15.000Z | 2022-03-07T06:36:26.000Z | #
#
# Copyright (C) 2014 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and ... | 31.137255 | 80 | 0.712374 |
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
import os
import logging
import struct
import fcntl
from ganeti import errors
TUNSETIFF = 0x400454ca
TUNGETIFF = 0x800454d2
TUNGETFEATURES = 0x800454cf
IFF_TAP = 0x0002
IFF_NO_PI = 0x1000
IFF_ONE_QUEUE = 0x2000
IFF_VNET_HDR = 0x4000
IFF_MULT... | true | true |
08f4523f072efd61340ffaf2308e7d82f313ade7 | 5,911 | py | Python | agent/bot/lib/shell.py | Vexvain/ODIN | 7538f9a12fef906cdd7aaf3df9341da7b3edbbc1 | [
"MIT"
] | null | null | null | agent/bot/lib/shell.py | Vexvain/ODIN | 7538f9a12fef906cdd7aaf3df9341da7b3edbbc1 | [
"MIT"
] | null | null | null | agent/bot/lib/shell.py | Vexvain/ODIN | 7538f9a12fef906cdd7aaf3df9341da7b3edbbc1 | [
"MIT"
] | null | null | null | import sys
import subprocess
from os import chdir
from time import sleep
from queue import Queue
from threading import Thread, RLock
from . import ssh, sftp, screen, sscreenshare, keylogger
class Shell(object):
def __init__(self, sess_obj, services, home):
self.recv_queue = Queue()
self.disconnec... | 28.282297 | 110 | 0.530536 | import sys
import subprocess
from os import chdir
from time import sleep
from queue import Queue
from threading import Thread, RLock
from . import ssh, sftp, screen, sscreenshare, keylogger
class Shell(object):
def __init__(self, sess_obj, services, home):
self.recv_queue = Queue()
self.disconnec... | true | true |
08f452654d126782df27b01d81e2fa19886358ef | 1,975 | py | Python | c7n/resources/eks.py | sstarcher/cloud-custodian | fc5b51019e9c15d0582089133d080bceee489a94 | [
"Apache-2.0"
] | 1 | 2019-06-11T19:43:28.000Z | 2019-06-11T19:43:28.000Z | c7n/resources/eks.py | sstarcher/cloud-custodian | fc5b51019e9c15d0582089133d080bceee489a94 | [
"Apache-2.0"
] | 2 | 2018-05-08T23:39:01.000Z | 2018-05-14T16:53:43.000Z | c7n/resources/eks.py | sstarcher/cloud-custodian | fc5b51019e9c15d0582089133d080bceee489a94 | [
"Apache-2.0"
] | 2 | 2019-11-22T14:54:28.000Z | 2021-06-18T13:49:15.000Z | # Copyright 2018 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 32.377049 | 82 | 0.728101 | from __future__ import absolute_import, division, print_function, unicode_literals
from c7n.actions import Action
from c7n.filters.vpc import SecurityGroupFilter, SubnetFilter
from c7n.manager import resources
from c7n.query import QueryResourceManager
from c7n.utils import local_session, type_schema
@resources.regi... | true | true |
08f4526644dc87b79957697d5396018ce84e90bf | 1,667 | py | Python | inference.py | IvanPy96/Imagewoof-classification-PyTorch | 0055fcad8cc98d034331c7a72be43bee28fff37d | [
"MIT"
] | null | null | null | inference.py | IvanPy96/Imagewoof-classification-PyTorch | 0055fcad8cc98d034331c7a72be43bee28fff37d | [
"MIT"
] | null | null | null | inference.py | IvanPy96/Imagewoof-classification-PyTorch | 0055fcad8cc98d034331c7a72be43bee28fff37d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models, transforms
from sys import argv
import shutil
import requests
from PIL import Image
import warnings
warnings.filterwarnings("ignore")
script, file_link = argv
response = requests.get(fi... | 30.309091 | 156 | 0.631674 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models, transforms
from sys import argv
import shutil
import requests
from PIL import Image
import warnings
warnings.filterwarnings("ignore")
script, file_link = argv
response = requests.get(file_link, stream=True)
wi... | true | true |
08f45559a5c49dc9c6eaa3c03109585cf62c3a48 | 1,869 | py | Python | Incident-Response/Tools/cyphon/cyphon/sifter/datasifter/datamungers/migrations/0001_initial.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 1 | 2021-07-24T17:22:50.000Z | 2021-07-24T17:22:50.000Z | Incident-Response/Tools/cyphon/cyphon/sifter/datasifter/datamungers/migrations/0001_initial.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-28T03:40:31.000Z | 2022-02-28T03:40:52.000Z | Incident-Response/Tools/cyphon/cyphon/sifter/datasifter/datamungers/migrations/0001_initial.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-25T08:34:51.000Z | 2022-03-16T17:29:44.000Z | # -*- coding: utf-8 -*-
# Copyright 2017-2019 ControlScan, Inc.
#
# This file is part of Cyphon Engine.
#
# Cyphon Engine is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# Cyphon En... | 35.264151 | 129 | 0.653826 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('distilleries', '0001_initial'),
('datacondensers', '0001_initial'),
]
operations = [
mi... | true | true |
08f4564d6d00283438690d6910713585ee142a18 | 4,068 | py | Python | CircuitQuantifier/circuit_critic.py | utkarsh7236/SCILLA | e11e4d753823ad522a1b3168283b6e6ffe3ea393 | [
"Apache-2.0"
] | 17 | 2019-12-09T19:09:07.000Z | 2021-08-29T01:11:13.000Z | CircuitQuantifier/circuit_critic.py | utkarsh7236/SCILLA | e11e4d753823ad522a1b3168283b6e6ffe3ea393 | [
"Apache-2.0"
] | 1 | 2021-04-14T15:08:18.000Z | 2021-04-14T15:08:18.000Z | CircuitQuantifier/circuit_critic.py | utkarsh7236/SCILLA | e11e4d753823ad522a1b3168283b6e6ffe3ea393 | [
"Apache-2.0"
] | 2 | 2020-06-05T03:01:06.000Z | 2020-07-09T07:13:12.000Z | #!/usr/bin/env python
#====================================================
import copy
import uuid
import numpy as np
import threading
from Utilities.decorators import thread
#====================================================
class CircuitCritic(object):
def __init__(self, circuit_params):
self.circuit_p... | 27.486486 | 107 | 0.699361 |
import copy
import uuid
import numpy as np
import threading
from Utilities.decorators import thread
class CircuitCritic(object):
def __init__(self, circuit_params):
self.circuit_params = circuit_params
self.CRITICIZED_CIRCUITS = []
self.EXTRA_TASKS = []
self.RECEIVED_EX... | true | true |
08f4575b7ff27b8bb3e941042bd5a12a3eba3589 | 3,869 | py | Python | configs/hie/resnet18_baseconfig_labelsmooth_original.py | 18152189583/mmclassification-3D | 61bff05e893f123eae4497f7f1904f7447c65899 | [
"Apache-2.0"
] | null | null | null | configs/hie/resnet18_baseconfig_labelsmooth_original.py | 18152189583/mmclassification-3D | 61bff05e893f123eae4497f7f1904f7447c65899 | [
"Apache-2.0"
] | null | null | null | configs/hie/resnet18_baseconfig_labelsmooth_original.py | 18152189583/mmclassification-3D | 61bff05e893f123eae4497f7f1904f7447c65899 | [
"Apache-2.0"
] | null | null | null | # dataset settings
dataset_type = 'Hie_Dataset'
# img_norm_cfg = dict(
# mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromNIIFile'),
dict(type='ExtractDataFromObj'),
dict(type='NormalizeMedical', norm_type='full_volume_mean',
... | 35.495413 | 100 | 0.60946 | dataset_type = 'Hie_Dataset'
train_pipeline = [
dict(type='LoadImageFromNIIFile'),
dict(type='ExtractDataFromObj'),
dict(type='NormalizeMedical', norm_type='full_volume_mean',
instensity_min_val=0.5,
instensity_max_val=99.5),
dict(type='ResizeMedical', size=(160, 160, 80)),
... | true | true |
08f4599d4f2a02b8f29473eaeb94b1d2ebb98d36 | 10,770 | py | Python | scripts/make_reference_corpus_toy.py | leo-liuzy/neural_persona | de117711dbbcddee1b170b93542e31a68268938e | [
"Apache-2.0"
] | null | null | null | scripts/make_reference_corpus_toy.py | leo-liuzy/neural_persona | de117711dbbcddee1b170b93542e31a68268938e | [
"Apache-2.0"
] | null | null | null | scripts/make_reference_corpus_toy.py | leo-liuzy/neural_persona | de117711dbbcddee1b170b93542e31a68268938e | [
"Apache-2.0"
] | null | null | null | ### from https://github.com/dallascard/scholar/blob/master/preprocess_data.py
import os
import re
import string
import sys
from collections import Counter
from optparse import OptionParser
import numpy as np
from scipy import sparse
from tqdm import tqdm
from neural_persona.common.util import (read_jsonlist,
... | 35.780731 | 118 | 0.606035 | import os
import re
import string
import sys
from collections import Counter
from optparse import OptionParser
import numpy as np
from scipy import sparse
from tqdm import tqdm
from neural_persona.common.util import (read_jsonlist,
read_text,
... | true | true |
08f45a28b2f3235c1b9adfe9e6f6b6e27c65f329 | 188 | py | Python | backend/ultimate_frisbee_management/apps.py | oefsv/ulti-players | 156b4b34a7a1eba70a739973bd18ba403317543b | [
"MIT"
] | 6 | 2018-09-11T17:34:04.000Z | 2022-01-29T08:21:33.000Z | backend/ultimate_frisbee_management/apps.py | oefsv/ulti-players | 156b4b34a7a1eba70a739973bd18ba403317543b | [
"MIT"
] | 45 | 2018-09-18T14:35:02.000Z | 2022-03-02T02:56:23.000Z | backend/ultimate_frisbee_management/apps.py | oefsv/ulti-players | 156b4b34a7a1eba70a739973bd18ba403317543b | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class UltimateFrisbeeManagementConfig(AppConfig):
name = 'ultimate_frisbee_management'
def ready(self):
from .signals import permissions | 26.857143 | 49 | 0.771277 | from django.apps import AppConfig
class UltimateFrisbeeManagementConfig(AppConfig):
name = 'ultimate_frisbee_management'
def ready(self):
from .signals import permissions | true | true |
08f45aa9dc406572bdcd6c4eb960f083c4bbe467 | 1,388 | py | Python | Lyft-Dental/virtual_dental_clinc/vdc/doc_patient/migrations/0029_auto_20200605_1437.py | Abhik1998/Lyft-sample_project | 3f9a79fb86c7abee713ae37245f5e7971be09139 | [
"MIT"
] | 1 | 2021-01-09T08:42:24.000Z | 2021-01-09T08:42:24.000Z | Lyft-Dental/virtual_dental_clinc/vdc/doc_patient/migrations/0029_auto_20200605_1437.py | Abhik1998/Lyft-sample_project | 3f9a79fb86c7abee713ae37245f5e7971be09139 | [
"MIT"
] | null | null | null | Lyft-Dental/virtual_dental_clinc/vdc/doc_patient/migrations/0029_auto_20200605_1437.py | Abhik1998/Lyft-sample_project | 3f9a79fb86c7abee713ae37245f5e7971be09139 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-06-05 14:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc_patient', '0028_appointment_appointment_id'),
]
operations = [
migrations.AddField(
model_name='prescription',
n... | 31.545455 | 137 | 0.572767 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc_patient', '0028_appointment_appointment_id'),
]
operations = [
migrations.AddField(
model_name='prescription',
name='age',
field=models.DecimalField... | true | true |
08f45b3da6c3774299ae4a71dce59a298e008f08 | 1,144 | py | Python | toontown/ai/DistributedWinterCarolingTargetAI.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/ai/DistributedWinterCarolingTargetAI.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/ai/DistributedWinterCarolingTargetAI.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from direct.fsm.FSM import FSM
class DistributedWinterCarolingTargetAI(DistributedObjectAI, FSM):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedWinterCarolingTargetAI")
... | 35.75 | 93 | 0.672203 | from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from direct.fsm.FSM import FSM
class DistributedWinterCarolingTargetAI(DistributedObjectAI, FSM):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedWinterCarolingTargetAI")
... | true | true |
08f45c02f21959c15626911ce7e8d5b00f43a0ab | 4,110 | py | Python | couler/tests/secret_test.py | javoweb/couler | 1531f31816a1505401c5326dc5fec5a8bb7bf7cd | [
"Apache-2.0"
] | 1 | 2021-06-03T06:42:13.000Z | 2021-06-03T06:42:13.000Z | couler/tests/secret_test.py | javoweb/couler | 1531f31816a1505401c5326dc5fec5a8bb7bf7cd | [
"Apache-2.0"
] | 1 | 2021-05-01T10:50:00.000Z | 2021-05-01T10:50:00.000Z | couler/tests/secret_test.py | javoweb/couler | 1531f31816a1505401c5326dc5fec5a8bb7bf7cd | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Couler 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 law or... | 37.706422 | 79 | 0.610706 |
import couler.argo as couler
from couler.core import utils
from couler.tests.argo_yaml_test import ArgoYamlTest
_test_data_dir = "test_data"
couler.config_workflow(name="pytest")
class SecretTest(ArgoYamlTest):
def test_create_secret(self):
user_info = {"uname": "abc", "passwd": "def"}
s... | true | true |
08f45c592336b5dcd07569770973de1965660939 | 4,261 | py | Python | otherpy/distribute/simpleMNISTmodel.py | imocanu/jagerml | b0e953b9fefe4a21935a763d53015f6d85160c9f | [
"MIT"
] | null | null | null | otherpy/distribute/simpleMNISTmodel.py | imocanu/jagerml | b0e953b9fefe4a21935a763d53015f6d85160c9f | [
"MIT"
] | null | null | null | otherpy/distribute/simpleMNISTmodel.py | imocanu/jagerml | b0e953b9fefe4a21935a763d53015f6d85160c9f | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import os
import matplotlib.pyplot as plt
import time
def mnist_dataset(batch_size):
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train = x_train / np.float32(255)
y_train = y_train / np.float32(255)
train_dataset = tf.data.Da... | 36.418803 | 116 | 0.683408 | import tensorflow as tf
import numpy as np
import os
import matplotlib.pyplot as plt
import time
def mnist_dataset(batch_size):
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train = x_train / np.float32(255)
y_train = y_train / np.float32(255)
train_dataset = tf.data.Da... | true | true |
08f45c5f51108c2bd3641110145d7a6a54c07b9c | 128 | py | Python | team_builder/applications/admin.py | squadran2003/Social-Team-Builder | 08fdab7cf176de0daf38078cd9fcd5f17501cef8 | [
"MIT"
] | null | null | null | team_builder/applications/admin.py | squadran2003/Social-Team-Builder | 08fdab7cf176de0daf38078cd9fcd5f17501cef8 | [
"MIT"
] | null | null | null | team_builder/applications/admin.py | squadran2003/Social-Team-Builder | 08fdab7cf176de0daf38078cd9fcd5f17501cef8 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import Application
admin.site.register(Application)
| 21.333333 | 32 | 0.820313 | from django.contrib import admin
from .models import Application
admin.site.register(Application)
| true | true |
08f45d3492fc83107aab5f03ceb1c1e5e0110d5d | 334 | py | Python | djangocms_personlist/cms_app.py | kohout/djangocms-getaweb-personlist | a80efe54d454764d04a64db281487b18fdb60872 | [
"Unlicense"
] | null | null | null | djangocms_personlist/cms_app.py | kohout/djangocms-getaweb-personlist | a80efe54d454764d04a64db281487b18fdb60872 | [
"Unlicense"
] | null | null | null | djangocms_personlist/cms_app.py | kohout/djangocms-getaweb-personlist | a80efe54d454764d04a64db281487b18fdb60872 | [
"Unlicense"
] | null | null | null | from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
from .menu import TeamsMenu
class TeamApp(CMSApp):
name = _('Team Module')
urls = ['djangocms_personlist.urls']
app_name = 'khw-team'
menus = [TeamsMenu]
apphook_pool.regi... | 23.857143 | 55 | 0.754491 | from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
from .menu import TeamsMenu
class TeamApp(CMSApp):
name = _('Team Module')
urls = ['djangocms_personlist.urls']
app_name = 'khw-team'
menus = [TeamsMenu]
apphook_pool.regi... | true | true |
08f45d54bfc39791162799b341e208bb8971278c | 820 | py | Python | lab_05/integral.py | MrLIVB/BMSTU_Computational_Algorithms | c893a5015dbbecd97ed63c848d67cbc9d1a249dc | [
"MIT"
] | null | null | null | lab_05/integral.py | MrLIVB/BMSTU_Computational_Algorithms | c893a5015dbbecd97ed63c848d67cbc9d1a249dc | [
"MIT"
] | null | null | null | lab_05/integral.py | MrLIVB/BMSTU_Computational_Algorithms | c893a5015dbbecd97ed63c848d67cbc9d1a249dc | [
"MIT"
] | null | null | null | from legendre import legendre
import seidel
import matrix
import numpy as np
from math import sqrt, pi, e
def quadrature(k):
if k % 2:
return 0
else:
return 2 / (k + 1)
def integrate(a, b, n, f):
l = legendre(n)
A = np.zeros((n, n))
B = np.zeros((n, 1))
for k in range(n):
... | 19.52381 | 87 | 0.493902 | from legendre import legendre
import seidel
import matrix
import numpy as np
from math import sqrt, pi, e
def quadrature(k):
if k % 2:
return 0
else:
return 2 / (k + 1)
def integrate(a, b, n, f):
l = legendre(n)
A = np.zeros((n, n))
B = np.zeros((n, 1))
for k in range(n):
... | true | true |
08f45d5cf5f1b30fc69d1ce143d7b9a554f3cc0f | 403 | py | Python | utils/crypt.py | evrenesat/ganihomes | eece2d8d957989b176cc5a36d723f676862f8d17 | [
"BSD-2-Clause"
] | 24 | 2016-08-06T18:10:54.000Z | 2022-03-04T11:47:39.000Z | utils/crypt.py | evrenesat/ganihomes | eece2d8d957989b176cc5a36d723f676862f8d17 | [
"BSD-2-Clause"
] | 1 | 2017-03-28T02:36:50.000Z | 2017-03-28T07:18:57.000Z | utils/crypt.py | evrenesat/ganihomes | eece2d8d957989b176cc5a36d723f676862f8d17 | [
"BSD-2-Clause"
] | 13 | 2017-03-28T02:35:32.000Z | 2022-02-21T23:36:15.000Z | from itertools import izip, cycle
from urllib2 import base64
def sxor(data, decrypt=False, key='8239e9ehdu2$ # D ^@ $^d2frg456g4er62-r*/-*f823*-4f8324-*fd-*'):
if decrypt:
return ''.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(base64.standard_b64decode(data), cycle(key)))
else:
return base64.sta... | 44.777778 | 107 | 0.657568 | from itertools import izip, cycle
from urllib2 import base64
def sxor(data, decrypt=False, key='8239e9ehdu2$ # D ^@ $^d2frg456g4er62-r*/-*f823*-4f8324-*fd-*'):
if decrypt:
return ''.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(base64.standard_b64decode(data), cycle(key)))
else:
return base64.sta... | true | true |
08f45e32c821b2b7df819dc102b03c6be7b7e378 | 2,450 | py | Python | linear.py | obadao/multi-view-pose-estimation | 2d5ff2975180edc66628d1ba0fe0806ec177ef0c | [
"MIT"
] | 24 | 2019-06-11T01:29:37.000Z | 2021-12-21T00:30:14.000Z | linear.py | obadao/multi-view-pose-estimation | 2d5ff2975180edc66628d1ba0fe0806ec177ef0c | [
"MIT"
] | 2 | 2020-03-12T08:16:17.000Z | 2021-11-11T13:52:47.000Z | linear.py | obadao/multi-view-pose-estimation | 2d5ff2975180edc66628d1ba0fe0806ec177ef0c | [
"MIT"
] | 9 | 2019-06-10T01:58:29.000Z | 2021-06-01T22:39:10.000Z | # Rahil Mehrizi, Oct 2018
"""Creating Model to Predict 3D Poses from Multi-view 2D Joints"""
import torch
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
from collections import OrderedDict
class LinearModel(nn.Module):
def __init__(self, linear_size, num_joints):
super(LinearM... | 26.06383 | 77 | 0.572245 |
import torch
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
from collections import OrderedDict
class LinearModel(nn.Module):
def __init__(self, linear_size, num_joints):
super(LinearModel, self).__init__()
self.linear_size = linear_size
self.num_joints = num_... | true | true |
08f45fcf6e59a2bfe534ded7d4f9e74497407bc4 | 1,747 | py | Python | src/lib/python/image/azure_image_name.py | chen23/f5-bigip-image-generator | 70c0199ef833bdb1827460b8c12f2800e7808b62 | [
"Apache-2.0"
] | null | null | null | src/lib/python/image/azure_image_name.py | chen23/f5-bigip-image-generator | 70c0199ef833bdb1827460b8c12f2800e7808b62 | [
"Apache-2.0"
] | null | null | null | src/lib/python/image/azure_image_name.py | chen23/f5-bigip-image-generator | 70c0199ef833bdb1827460b8c12f2800e7808b62 | [
"Apache-2.0"
] | null | null | null | """Azure image name"""
# Copyright (C) 2019 F5 Networks, 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 l... | 41.595238 | 85 | 0.686892 |
from image.image_name import ImageName
from image.image_name import ImageNameRules
from image.image_name import ImageNameTransform
from util.config import get_config_value
class AzureImageName(ImageName):
def __init__(self):
# Tested special URL characters in Azure Portal and usa... | true | true |
08f45fe23552be5b6e4eebc4a3f82f2358ec9964 | 2,651 | py | Python | tests/env/packages/env_test_font-ttf-ubuntu_linux.py | swaldhoer/foxbms-2 | ee57761ba6c2817e5335b68dfda3513b436e3abd | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 47 | 2021-04-01T21:14:55.000Z | 2022-03-30T12:19:18.000Z | tests/env/packages/env_test_font-ttf-ubuntu_linux.py | jagatheesh31/foxbms-2 | ee57761ba6c2817e5335b68dfda3513b436e3abd | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 6 | 2021-06-01T08:25:54.000Z | 2021-11-17T07:55:05.000Z | tests/env/packages/env_test_font-ttf-ubuntu_linux.py | jagatheesh31/foxbms-2 | ee57761ba6c2817e5335b68dfda3513b436e3abd | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 24 | 2021-04-01T21:15:04.000Z | 2022-03-29T06:18:10.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010 - 2021, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provid... | 36.819444 | 98 | 0.732554 |
import logging
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"-v",
"--verbosity",
dest="verbosity",
action="count",
default=0,
help="set verbosity level",
)
args = parser.parse_args()
if args.verbosity == 1:
... | true | true |
08f45fec232bcf1f22f2671eb50515c568ddc3aa | 5,560 | py | Python | src/roughml/data/generators.py | billsioros/RoughML | b4a4a94f49b568c32e232187566698c1d216207a | [
"MIT"
] | null | null | null | src/roughml/data/generators.py | billsioros/RoughML | b4a4a94f49b568c32e232187566698c1d216207a | [
"MIT"
] | null | null | null | src/roughml/data/generators.py | billsioros/RoughML | b4a4a94f49b568c32e232187566698c1d216207a | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
import numpy as np
import sympy
from scipy import stats
from roughml.plot import as_grayscale_image
class SurfaceGenerator(ABC):
def __init__(
self, n_points, rms, skewness, kurtosis, corlength_x, corlength_y, alpha
):
self.n_points = n_points
self... | 27.8 | 160 | 0.566547 | from abc import ABC, abstractmethod
import numpy as np
import sympy
from scipy import stats
from roughml.plot import as_grayscale_image
class SurfaceGenerator(ABC):
def __init__(
self, n_points, rms, skewness, kurtosis, corlength_x, corlength_y, alpha
):
self.n_points = n_points
self... | true | true |
08f46136004ca81a965e6f39295709cc1c942114 | 1,528 | py | Python | tests/test_gosearch_emptydict.py | camiloaruiz/goatools | 3da97251ccb6c5e90b616c3f625513f8aba5aa10 | [
"BSD-2-Clause"
] | null | null | null | tests/test_gosearch_emptydict.py | camiloaruiz/goatools | 3da97251ccb6c5e90b616c3f625513f8aba5aa10 | [
"BSD-2-Clause"
] | null | null | null | tests/test_gosearch_emptydict.py | camiloaruiz/goatools | 3da97251ccb6c5e90b616c3f625513f8aba5aa10 | [
"BSD-2-Clause"
] | 1 | 2022-03-17T03:14:32.000Z | 2022-03-17T03:14:32.000Z | #!/usr/bin/env python
"""Test GoSearch class with both with and without annotations."""
import os
import sys
from collections import defaultdict
from goatools.base import download_go_basic_obo
from goatools.go_search import GoSearch
from goatools.associations import get_assoc_ncbi_taxids
__copyright__ = "Copyright (C... | 38.2 | 88 | 0.746073 |
import os
import sys
from collections import defaultdict
from goatools.base import download_go_basic_obo
from goatools.go_search import GoSearch
from goatools.associations import get_assoc_ncbi_taxids
__copyright__ = "Copyright (C) 2010-2018, DV Klopfenstein, H Tang, All rights reserved."
__author__ = "DV Klopfenstei... | true | true |
08f462255ef0b423b08cd4e0cd52fe4d09f27920 | 1,686 | py | Python | v1.0.0.test/toontown/hood/HQPeriscopeAnimatedProp.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-01T15:46:43.000Z | 2021-07-23T16:26:48.000Z | v1.0.0.test/toontown/hood/HQPeriscopeAnimatedProp.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 1 | 2019-06-29T03:40:05.000Z | 2021-06-13T01:15:16.000Z | v1.0.0.test/toontown/hood/HQPeriscopeAnimatedProp.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-28T21:18:46.000Z | 2021-02-25T06:37:25.000Z | import AnimatedProp
from direct.actor import Actor
from direct.interval.IntervalGlobal import *
class HQPeriscopeAnimatedProp(AnimatedProp.AnimatedProp):
def __init__(self, node):
AnimatedProp.AnimatedProp.__init__(self, node)
parent = node.getParent()
self.periscope = Actor.Actor(node, co... | 54.387097 | 697 | 0.705219 | import AnimatedProp
from direct.actor import Actor
from direct.interval.IntervalGlobal import *
class HQPeriscopeAnimatedProp(AnimatedProp.AnimatedProp):
def __init__(self, node):
AnimatedProp.AnimatedProp.__init__(self, node)
parent = node.getParent()
self.periscope = Actor.Actor(node, co... | true | true |
08f464ad78a74700ccb4e261425ed2e4940cd2f2 | 689 | py | Python | converter/markdown/concepts.py | codio/book-converter | ea3fd75f2ca8704ffad6bfcc83cf7af557bcd0b8 | [
"MIT"
] | 1 | 2019-09-14T12:22:25.000Z | 2019-09-14T12:22:25.000Z | converter/markdown/concepts.py | codio/book-converter | ea3fd75f2ca8704ffad6bfcc83cf7af557bcd0b8 | [
"MIT"
] | 4 | 2020-08-21T08:24:40.000Z | 2022-03-11T23:57:03.000Z | converter/markdown/concepts.py | codio/book-converter | ea3fd75f2ca8704ffad6bfcc83cf7af557bcd0b8 | [
"MIT"
] | null | null | null | import re
from converter.markdown.text_as_paragraph import TextAsParagraph
concepts_re = re.compile(r"""\\begin{concepts}(?P<block_contents>.*?)\\end{concepts}""", flags=re.DOTALL + re.VERBOSE)
class Consents(TextAsParagraph):
def __init__(self, latex_str, caret_token):
super().__init__(latex_str, caret... | 34.45 | 118 | 0.724238 | import re
from converter.markdown.text_as_paragraph import TextAsParagraph
concepts_re = re.compile(r"""\\begin{concepts}(?P<block_contents>.*?)\\end{concepts}""", flags=re.DOTALL + re.VERBOSE)
class Consents(TextAsParagraph):
def __init__(self, latex_str, caret_token):
super().__init__(latex_str, caret... | true | true |
08f464f1f96c8fd8482c000859f96286601a2ec7 | 8,540 | py | Python | topics_and_summary/datasets/common.py | CarlosSanabriaM/topics_and_summary | a22179a90b75f8584c91ce1a6c38f286c2cb5b30 | [
"MIT"
] | null | null | null | topics_and_summary/datasets/common.py | CarlosSanabriaM/topics_and_summary | a22179a90b75f8584c91ce1a6c38f286c2cb5b30 | [
"MIT"
] | null | null | null | topics_and_summary/datasets/common.py | CarlosSanabriaM/topics_and_summary | a22179a90b75f8584c91ce1a6c38f286c2cb5b30 | [
"MIT"
] | null | null | null | import abc
import os
import warnings
from copy import deepcopy
from typing import List, Callable
import pandas as pd
from topics_and_summary.preprocessing.dataset_preprocessing_options import DatasetPreprocessingOptions
from topics_and_summary.utils import join_paths, load_obj_from_disk, save_obj_to_disk, \
get_a... | 43.794872 | 120 | 0.677049 | import abc
import os
import warnings
from copy import deepcopy
from typing import List, Callable
import pandas as pd
from topics_and_summary.preprocessing.dataset_preprocessing_options import DatasetPreprocessingOptions
from topics_and_summary.utils import join_paths, load_obj_from_disk, save_obj_to_disk, \
get_a... | true | true |
08f46709b7095ebdd23e8d7506d283a9b76a69d2 | 14 | py | Python | tests/__init__.py | bakanaouji/crfmnes | e21ae1f084f796feaec61cb1b4b7b3680c755ce7 | [
"MIT"
] | 5 | 2021-12-17T10:46:08.000Z | 2021-12-20T06:47:16.000Z | tests/__init__.py | nomuramasahir0/crfmnes | 358a42595ce2e4a9a0e4243d2bf3c7f51a7fba0e | [
"MIT"
] | null | null | null | tests/__init__.py | nomuramasahir0/crfmnes | 358a42595ce2e4a9a0e4243d2bf3c7f51a7fba0e | [
"MIT"
] | 1 | 2018-11-02T14:57:29.000Z | 2018-11-02T14:57:29.000Z | import crfmnes | 14 | 14 | 0.928571 | import crfmnes | true | true |
08f468abcbbade43d49acf3f8f98700e99127b10 | 1,330 | py | Python | speakeasy/winenv/defs/winsock/winsock.py | cthulhusec/speakeasy | 1e9c20873cf31af2d08218550727b805c3822d4a | [
"MIT"
] | 2 | 2020-12-23T19:22:57.000Z | 2021-09-19T03:29:06.000Z | speakeasy/winenv/defs/winsock/winsock.py | mrexodia/speakeasy | 5e69b6913a959e15a84ee483896dadae15a25c1e | [
"MIT"
] | 1 | 2022-02-02T17:17:26.000Z | 2022-02-02T17:18:31.000Z | speakeasy/winenv/defs/winsock/winsock.py | mrexodia/speakeasy | 5e69b6913a959e15a84ee483896dadae15a25c1e | [
"MIT"
] | 1 | 2020-12-23T19:24:22.000Z | 2020-12-23T19:24:22.000Z | # Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
# Address families
AF_UNSPEC = 0
AF_INET = 2
AF_IPX = 6
AF_APPLETALK = 16
AF_NETBIOS = 17
AF_INET6 = 23
AF_IRDA = 26
AF_BTH = 32
# Socket types
SOCK_STREAM = 1
SOCK_DGRAM = 2
SOCK_RAW = 3
SOCK_RDM = 4
SOCK_SEQPACKET = 5
# Protocol types
IPPROTO_ICMP = 1
IPPROTO... | 18.732394 | 55 | 0.655639 |
AF_UNSPEC = 0
AF_INET = 2
AF_IPX = 6
AF_APPLETALK = 16
AF_NETBIOS = 17
AF_INET6 = 23
AF_IRDA = 26
AF_BTH = 32
SOCK_STREAM = 1
SOCK_DGRAM = 2
SOCK_RAW = 3
SOCK_RDM = 4
SOCK_SEQPACKET = 5
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
BTHPROTO_RFCOMM = 3
IPPROTO_TCP = 6
IPPROTO_UDP = 17
IPPROTO_ICMPV6 = 58
IPPROTO_RM = 113
WSA_FL... | true | true |
08f468e055b500ec9c462ef9720c334716ecc5fd | 4,357 | py | Python | pyNastran/converters/aflr/surf/test_surf_gui.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 293 | 2015-03-22T20:22:01.000Z | 2022-03-14T20:28:24.000Z | pyNastran/converters/aflr/surf/test_surf_gui.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 512 | 2015-03-14T18:39:27.000Z | 2022-03-31T16:15:43.000Z | pyNastran/converters/aflr/surf/test_surf_gui.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 136 | 2015-03-19T03:26:06.000Z | 2022-03-25T22:14:54.000Z | """
Defines:
- SURF tests
"""
import os
import unittest
from cpylog import SimpleLogger
import pyNastran
from pyNastran.bdf.mesh_utils.remove_unused import remove_unused
from pyNastran.bdf.mesh_utils.bdf_renumber import bdf_renumber
from pyNastran.bdf.mesh_utils.remove_cards import remap_cards, delete_elements, dele... | 38.901786 | 97 | 0.636218 | import os
import unittest
from cpylog import SimpleLogger
import pyNastran
from pyNastran.bdf.mesh_utils.remove_unused import remove_unused
from pyNastran.bdf.mesh_utils.bdf_renumber import bdf_renumber
from pyNastran.bdf.mesh_utils.remove_cards import remap_cards, delete_elements, delete_properties
from pyNastran.con... | true | true |
08f468fc35e34d346a37d0d8858f5434cf69cd3b | 986 | py | Python | mypy_boto3_builder/structures/argument.py | jbpratt78/mypy_boto3_builder | be4020782369b34e35f3b6a2117f00d947f3ae24 | [
"MIT"
] | 44 | 2019-11-09T04:29:31.000Z | 2022-02-11T10:51:41.000Z | mypy_boto3_builder/structures/argument.py | jbpratt78/mypy_boto3_builder | be4020782369b34e35f3b6a2117f00d947f3ae24 | [
"MIT"
] | 28 | 2019-11-26T23:50:19.000Z | 2021-05-31T18:52:46.000Z | mypy_boto3_builder/structures/argument.py | jbpratt78/mypy_boto3_builder | be4020782369b34e35f3b6a2117f00d947f3ae24 | [
"MIT"
] | 3 | 2019-11-09T16:43:04.000Z | 2019-12-20T15:05:33.000Z | """
Method or function argument.
"""
from dataclasses import dataclass
from typing import Set, Optional
from mypy_boto3_builder.type_annotations.fake_annotation import FakeAnnotation
from mypy_boto3_builder.type_annotations.type_constant import TypeConstant
@dataclass
class Argument:
"""
Method or function a... | 24.65 | 78 | 0.668357 | from dataclasses import dataclass
from typing import Set, Optional
from mypy_boto3_builder.type_annotations.fake_annotation import FakeAnnotation
from mypy_boto3_builder.type_annotations.type_constant import TypeConstant
@dataclass
class Argument:
name: str
type: Optional[FakeAnnotation]
default: Option... | true | true |
08f4695c75c8d37dddf50ac3e7eb47ad86f393fe | 19,800 | py | Python | sdk/python/pulumi_google_native/deploymentmanager/alpha/deployment_iam_policy.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/deploymentmanager/alpha/deployment_iam_policy.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/deploymentmanager/alpha/deployment_iam_policy.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.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, overload
from ... import _utilities
fro... | 80.161943 | 1,118 | 0.709091 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['DeploymentIamPolicyArgs', 'DeploymentIamPolicy']
@pulumi.input_type
class DeploymentIamPol... | true | true |
08f46a7935d6847f9101e701235fef1cb3fbaff0 | 70,593 | py | Python | ThirdParty/Twisted/vtkTwisted/src/twisted/internet/_sslverify.py | inviCRO/VTK | a2dc2e79d4ecb8f6da900535b32e1a2a702c7f48 | [
"BSD-3-Clause"
] | null | null | null | ThirdParty/Twisted/vtkTwisted/src/twisted/internet/_sslverify.py | inviCRO/VTK | a2dc2e79d4ecb8f6da900535b32e1a2a702c7f48 | [
"BSD-3-Clause"
] | null | null | null | ThirdParty/Twisted/vtkTwisted/src/twisted/internet/_sslverify.py | inviCRO/VTK | a2dc2e79d4ecb8f6da900535b32e1a2a702c7f48 | [
"BSD-3-Clause"
] | null | null | null | # -*- test-case-name: twisted.test.test_sslverify -*-
# Copyright (c) 2005 Divmod, Inc.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import division, absolute_import
import itertools
import warnings
from constantly import Names, NamedConstant
from hashlib import md5
from O... | 35.2965 | 113 | 0.649498 |
from __future__ import division, absolute_import
import itertools
import warnings
from constantly import Names, NamedConstant
from hashlib import md5
from OpenSSL import SSL, crypto
from twisted.python import log
from twisted.python._oldstyle import _oldStyle
from ._idna import _idnaBytes
class TLSVersion(Name... | true | true |
08f46bb168f1fd3710a422e46f021af9c097da20 | 306 | py | Python | web_api/yonyou/reqparsers/enum_items.py | zhanghe06/flask_restful | 6ef54f3f7efbbaff6169e963dcf45ab25e11e593 | [
"MIT"
] | 1 | 2020-12-04T03:15:47.000Z | 2020-12-04T03:15:47.000Z | web_api/yonyou/reqparsers/enum_items.py | zhanghe06/flask_restful | 6ef54f3f7efbbaff6169e963dcf45ab25e11e593 | [
"MIT"
] | 1 | 2021-06-01T22:24:27.000Z | 2021-06-01T22:24:27.000Z | web_api/yonyou/reqparsers/enum_items.py | zhanghe06/flask_restful | 6ef54f3f7efbbaff6169e963dcf45ab25e11e593 | [
"MIT"
] | 2 | 2020-12-04T03:16:18.000Z | 2021-09-04T14:10:12.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
@author: zhanghe
@software: PyCharm
@file: enum_items.py
@time: 2018-08-23 15:55
"""
from __future__ import unicode_literals
structure_key_item = 'enum_item'
structure_key_items = 'enum_items'
structure_key_item_cn = '枚举类型'
structure_key_items_cn = '枚举类型'
| 15.3 | 39 | 0.751634 |
from __future__ import unicode_literals
structure_key_item = 'enum_item'
structure_key_items = 'enum_items'
structure_key_item_cn = '枚举类型'
structure_key_items_cn = '枚举类型'
| true | true |
08f46c365da4a50eda804dc0088106547d4296a9 | 489 | py | Python | leetcode/python/strings/344_reverse_string.py | ajeet1308/code_problems | 5d99839b6319295c6d81dd86775c46a536e7a1ca | [
"MIT"
] | 61 | 2020-09-26T19:57:44.000Z | 2022-03-09T18:51:44.000Z | leetcode/python/strings/344_reverse_string.py | ajeet1308/code_problems | 5d99839b6319295c6d81dd86775c46a536e7a1ca | [
"MIT"
] | 88 | 2020-09-19T20:00:27.000Z | 2021-10-31T09:41:57.000Z | leetcode/python/strings/344_reverse_string.py | ajeet1308/code_problems | 5d99839b6319295c6d81dd86775c46a536e7a1ca | [
"MIT"
] | 218 | 2020-09-20T08:18:03.000Z | 2022-01-30T23:13:16.000Z | class Solution:
def reverseString(self, s) -> None:
"""
Do not return anything, modify s in-place instead.
"""
i = 0
j = len(s) - 1
while j > i:
tmp = s[i]
s[i] = s[j]
s[j] = tmp
j -= 1
i += 1
def main():
... | 18.807692 | 58 | 0.431493 | class Solution:
def reverseString(self, s) -> None:
i = 0
j = len(s) - 1
while j > i:
tmp = s[i]
s[i] = s[j]
s[j] = tmp
j -= 1
i += 1
def main():
strg = ["h","e","l","l","o"]
solution = Solution()
solution.reverseStri... | true | true |
08f46db8bae31559619bf86c17c9a20ee045c059 | 321 | py | Python | forensics/steg1/008.py | CAMSCSC/archive_learn | 21e9c3f0c26565a94f85e89c00f19179ca084b90 | [
"MIT"
] | null | null | null | forensics/steg1/008.py | CAMSCSC/archive_learn | 21e9c3f0c26565a94f85e89c00f19179ca084b90 | [
"MIT"
] | null | null | null | forensics/steg1/008.py | CAMSCSC/archive_learn | 21e9c3f0c26565a94f85e89c00f19179ca084b90 | [
"MIT"
] | null | null | null | def a2bits_list(chars):
list = [] #Create an empty list
for x in chars: #Cycle through all characters
data = bin(ord(x))[2:].rjust(8, '0') #Convert each character to binary, strip the '0b', and fill it up to 8 bits with empty 0s in the front
list.append(data) #Add the data to the list
return list #Return the lis... | 53.5 | 141 | 0.71028 | def a2bits_list(chars):
list = [] for x in chars: data = bin(ord(x))[2:].rjust(8, '0') list.append(data) return list | true | true |
08f46de9e0bf28b3744c64b01113f87eb03bb770 | 5,410 | py | Python | lib/words.py | JohnnyJayJay/lick_wikipedia_bot | d2164c0ae209450c034f9f379fc8b280ec7e79ed | [
"MIT"
] | null | null | null | lib/words.py | JohnnyJayJay/lick_wikipedia_bot | d2164c0ae209450c034f9f379fc8b280ec7e79ed | [
"MIT"
] | null | null | null | lib/words.py | JohnnyJayJay/lick_wikipedia_bot | d2164c0ae209450c034f9f379fc8b280ec7e79ed | [
"MIT"
] | null | null | null | import pronouncing
import pyphen
from num2words import num2words as n2w
from syllables import estimate
from lib.constants import (
BANNED_WORDS,
BANNED_PHRASES,
CHARS_ONLY,
PRONUNCIATION_OVERRIDES,
LICK_STRESSES,
LICK_NOTES
)
dic = pyphen.Pyphen(lang="en_UK")
def isLick(title: str):
"""
... | 29.086022 | 91 | 0.618484 | import pronouncing
import pyphen
from num2words import num2words as n2w
from syllables import estimate
from lib.constants import (
BANNED_WORDS,
BANNED_PHRASES,
CHARS_ONLY,
PRONUNCIATION_OVERRIDES,
LICK_STRESSES,
LICK_NOTES
)
dic = pyphen.Pyphen(lang="en_UK")
def isLick(title: str):
if c... | true | true |
08f46fa64085bd55141975a6cac2d34548183383 | 1,176 | py | Python | sjb/actions/oct_install.py | brenton/aos-cd-jobs | 34e427bb7091c52791bc93a34f062e57dc005082 | [
"Apache-2.0"
] | 45 | 2017-05-09T15:49:06.000Z | 2021-11-07T19:48:35.000Z | sjb/actions/oct_install.py | brenton/aos-cd-jobs | 34e427bb7091c52791bc93a34f062e57dc005082 | [
"Apache-2.0"
] | 1,313 | 2017-01-19T13:40:43.000Z | 2022-03-30T14:25:44.000Z | sjb/actions/oct_install.py | brenton/aos-cd-jobs | 34e427bb7091c52791bc93a34f062e57dc005082 | [
"Apache-2.0"
] | 165 | 2017-01-17T22:19:04.000Z | 2022-03-02T12:15:13.000Z | from __future__ import absolute_import, print_function, unicode_literals
from actions.named_shell_task import render_task
from .interface import Action
_OCT_INSTALL_TITLE = "INSTALL THE ORIGIN-CI-TOOL"
_OCT_INSTALL_ACTION = """latest="$( readlink "${HOME}/origin-ci-tool/latest" )"
touch "${latest}"
cp "${latest}/bin/... | 32.666667 | 88 | 0.72449 | from __future__ import absolute_import, print_function, unicode_literals
from actions.named_shell_task import render_task
from .interface import Action
_OCT_INSTALL_TITLE = "INSTALL THE ORIGIN-CI-TOOL"
_OCT_INSTALL_ACTION = """latest="$( readlink "${HOME}/origin-ci-tool/latest" )"
touch "${latest}"
cp "${latest}/bin/... | true | true |
08f4702867770b0705899d7056da7ec8d63e20da | 599 | py | Python | jax/version.py | xbfibe/jax | 9788a3584a458750792cd91e550bf2b8f802a4b6 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-05-08T14:48:47.000Z | 2019-05-08T14:48:47.000Z | jax/version.py | xbfibe/jax | 9788a3584a458750792cd91e550bf2b8f802a4b6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/version.py | xbfibe/jax | 9788a3584a458750792cd91e550bf2b8f802a4b6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.4375 | 74 | 0.75793 |
__version__ = "0.1.27"
| true | true |
08f472d9575b6e7ef49df55a06c88519a1dead0b | 3,487 | py | Python | msa_services/wlm_executor.py | eth-cscs/scops | 4474bf4aca5c7898e0007623cba117764b58cb86 | [
"BSD-3-Clause-Clear"
] | null | null | null | msa_services/wlm_executor.py | eth-cscs/scops | 4474bf4aca5c7898e0007623cba117764b58cb86 | [
"BSD-3-Clause-Clear"
] | 2 | 2021-08-16T08:19:56.000Z | 2021-08-16T08:20:09.000Z | msa_services/wlm_executor.py | eth-cscs/scops | 4474bf4aca5c7898e0007623cba117764b58cb86 | [
"BSD-3-Clause-Clear"
] | null | null | null | import io
import pandas as pd
import re
from hostlist import expand_hostlist, collect_hostlist
from remoteexec import remote_execute
from logzero import logger
def check_command_without_output(command, output):
if output != "" or output is None:
logger.error(f"{command} : {output}")
return False
... | 37.095745 | 92 | 0.700602 | import io
import pandas as pd
import re
from hostlist import expand_hostlist, collect_hostlist
from remoteexec import remote_execute
from logzero import logger
def check_command_without_output(command, output):
if output != "" or output is None:
logger.error(f"{command} : {output}")
return False
... | true | true |
08f4735e154205d90c88f18bcf73741a2c13b33d | 1,363 | py | Python | test/test_system/test_regression.py | jenyayel/gphotos-sync | 61c24732723053acf1d793cd97178640150d5023 | [
"MIT"
] | null | null | null | test/test_system/test_regression.py | jenyayel/gphotos-sync | 61c24732723053acf1d793cd97178640150d5023 | [
"MIT"
] | null | null | null | test/test_system/test_regression.py | jenyayel/gphotos-sync | 61c24732723053acf1d793cd97178640150d5023 | [
"MIT"
] | null | null | null | from unittest import TestCase
from gphotos.LocalData import LocalData
import test.test_setup as ts
from test.test_account import TestAccount
class TestSystem(TestCase):
def test_no_album_index(self):
"""for issue #89 - photos directly uploaded into albums dont 'list'"""
s = ts.SetupDbAndCredentia... | 40.088235 | 78 | 0.647836 | from unittest import TestCase
from gphotos.LocalData import LocalData
import test.test_setup as ts
from test.test_account import TestAccount
class TestSystem(TestCase):
def test_no_album_index(self):
s = ts.SetupDbAndCredentials()
args = ['--no-album-index', '--skip-shared-albums', '--index-only'... | true | true |
08f47434ad0775d34309e4e49cd4942ee6853cf0 | 421 | py | Python | currency_converter_api/asgi.py | tommygod3/currency-converter-api | e70e34ded4ab2c236dac857ab51ed1cea6dbb9ed | [
"MIT"
] | null | null | null | currency_converter_api/asgi.py | tommygod3/currency-converter-api | e70e34ded4ab2c236dac857ab51ed1cea6dbb9ed | [
"MIT"
] | null | null | null | currency_converter_api/asgi.py | tommygod3/currency-converter-api | e70e34ded4ab2c236dac857ab51ed1cea6dbb9ed | [
"MIT"
] | null | null | null | """
ASGI config for currency_converter_api project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefaul... | 24.764706 | 82 | 0.800475 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'currency_converter_api.settings')
application = get_asgi_application()
| true | true |
08f47565d85ed848412e0c1e76d215e7ac5119d8 | 7,932 | py | Python | lark/parser_frontends.py | ostracon/lark | bc1a8c6ca59ba04289bea9bc5e41923547eff452 | [
"MIT"
] | null | null | null | lark/parser_frontends.py | ostracon/lark | bc1a8c6ca59ba04289bea9bc5e41923547eff452 | [
"MIT"
] | null | null | null | lark/parser_frontends.py | ostracon/lark | bc1a8c6ca59ba04289bea9bc5e41923547eff452 | [
"MIT"
] | null | null | null | from functools import partial
from .utils import get_regexp_width, Serialize
from .parsers.grammar_analysis import GrammarAnalyzer
from .lexer import TraditionalLexer, ContextualLexer, Lexer, Token
from .parsers import earley, xearley, cyk
from .parsers.lalr_parser import LALR_Parser
from .grammar import Rule
from .tr... | 35.097345 | 136 | 0.639309 | from functools import partial
from .utils import get_regexp_width, Serialize
from .parsers.grammar_analysis import GrammarAnalyzer
from .lexer import TraditionalLexer, ContextualLexer, Lexer, Token
from .parsers import earley, xearley, cyk
from .parsers.lalr_parser import LALR_Parser
from .grammar import Rule
from .tr... | true | true |
08f4763bad8e7251c4c501cc188dac1032c4c1c5 | 1,252 | py | Python | extract.py | paraggupta1993/Parse_Research_Paper_PDF | 8331543ae0f5eae529f63d9b8ec4ba2e1229565d | [
"MIT"
] | null | null | null | extract.py | paraggupta1993/Parse_Research_Paper_PDF | 8331543ae0f5eae529f63d9b8ec4ba2e1229565d | [
"MIT"
] | null | null | null | extract.py | paraggupta1993/Parse_Research_Paper_PDF | 8331543ae0f5eae529f63d9b8ec4ba2e1229565d | [
"MIT"
] | null | null | null | import requests
import sys
INFINITE = 99999999
potential_second_heading = [
'keyword',
'keywords',
'introduction',
'1 introduction',
'1.introduction',
'1. introduction',
'1. introduction',
'1) introduction',
'Categories',
'General Term',
'Index Term',
'Literature Review'
]
def getIndex(lowercontent, word):
try:
... | 21.586207 | 69 | 0.722045 | import requests
import sys
INFINITE = 99999999
potential_second_heading = [
'keyword',
'keywords',
'introduction',
'1 introduction',
'1.introduction',
'1. introduction',
'1. introduction',
'1) introduction',
'Categories',
'General Term',
'Index Term',
'Literature Review'
]
def getIndex(lowercontent, word):
try:
... | false | true |
08f476c44889e25c808502a40a3ddac8a5dd0518 | 4,885 | py | Python | megatron/optimizer/__init__.py | ningchaoar/Megatron-LM | 39196e776a2e9d1bfb11622b988ad7dc9c0f471e | [
"MIT"
] | null | null | null | megatron/optimizer/__init__.py | ningchaoar/Megatron-LM | 39196e776a2e9d1bfb11622b988ad7dc9c0f471e | [
"MIT"
] | null | null | null | megatron/optimizer/__init__.py | ningchaoar/Megatron-LM | 39196e776a2e9d1bfb11622b988ad7dc9c0f471e | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. 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 re... | 40.708333 | 90 | 0.583214 |
from apex.optimizers import FusedAdam as Adam
from apex.optimizers import FusedSGD as SGD
from apex.optimizers import FusedLAMB as LAMB
from megatron import get_args
from megatron.model import LayerNorm
from .grad_scaler import ConstantGradScaler, DynamicGradScaler
from .optimizer import Float16OptimizerWithFloat16P... | true | true |
08f4783d9b6b85d287ced13c00a3ea2be4e617c3 | 1,545 | py | Python | lab_02/hebbian_net_lab_02/example_03.py | AsciiShell/hse_hlimds_labs | 45be83cf21e609fd4666958cef1195a15760bfba | [
"MIT"
] | 1 | 2022-02-04T16:50:39.000Z | 2022-02-04T16:50:39.000Z | lab_02/hebbian_net_lab_02/example_03.py | AsciiShell/hse_hlimds_labs | 45be83cf21e609fd4666958cef1195a15760bfba | [
"MIT"
] | null | null | null | lab_02/hebbian_net_lab_02/example_03.py | AsciiShell/hse_hlimds_labs | 45be83cf21e609fd4666958cef1195a15760bfba | [
"MIT"
] | null | null | null | import os
import pathlib
from net.draw import draw_flatten
from net.layers import Dense
from net.models import Model
from net.save_data import save_data
if __name__ == '__main__':
X = [
[0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1],
[0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1... | 35.113636 | 89 | 0.441424 | import os
import pathlib
from net.draw import draw_flatten
from net.layers import Dense
from net.models import Model
from net.save_data import save_data
if __name__ == '__main__':
X = [
[0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1],
[0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1... | true | true |
08f479d34e58a772e243aba145fbf0f3f6d0c588 | 470 | py | Python | changing-source-label/codes/1.2-tweet-without-media.py | 124015001/twitter-source-label-changer | e27541a4694f8f05b138c8e6c7f37a31e605e557 | [
"MIT"
] | 5 | 2021-11-11T22:30:12.000Z | 2022-03-03T09:36:30.000Z | changing-source-label/codes/1.2-tweet-without-media.py | 124015001/twitter-source-label-changer | e27541a4694f8f05b138c8e6c7f37a31e605e557 | [
"MIT"
] | 1 | 2021-10-15T11:05:14.000Z | 2021-10-15T11:05:14.000Z | changing-source-label/codes/1.2-tweet-without-media.py | 124015001/twitter-source-label-changer | e27541a4694f8f05b138c8e6c7f37a31e605e557 | [
"MIT"
] | 1 | 2021-10-15T10:21:36.000Z | 2021-10-15T10:21:36.000Z | import tweepy
# personal details
my_consumer_key ="customer_key"
my_consumer_secret ="secret_no"
my_access_token ="token_no"
my_access_token_secret ="secret_token"
# authentication of consumer key and secret
my_auth = tweepy.OAuthHandler(my_consumer_key, my_consumer_secret)
# Authentication of access token and secr... | 36.153846 | 67 | 0.831915 | import tweepy
my_consumer_key ="customer_key"
my_consumer_secret ="secret_no"
my_access_token ="token_no"
my_access_token_secret ="secret_token"
my_auth = tweepy.OAuthHandler(my_consumer_key, my_consumer_secret)
my_auth.set_access_token(my_access_token, my_access_token_secret)
my_api = tweepy.API(my_auth)
my_api.upd... | false | true |
08f47a8b3336f6fcf7f44141a38f42255ac53144 | 4,931 | py | Python | edb/server/protocol/system_api.py | jracabado/edgedb | 74308d3e751451f78f86448710766693f291b394 | [
"Apache-2.0"
] | null | null | null | edb/server/protocol/system_api.py | jracabado/edgedb | 74308d3e751451f78f86448710766693f291b394 | [
"Apache-2.0"
] | null | null | null | edb/server/protocol/system_api.py | jracabado/edgedb | 74308d3e751451f78f86448710766693f291b394 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2019-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 29.526946 | 78 | 0.638004 |
import http
import json
import immutables as immu
from edb import errors
from edb import edgeql
from edb.common import debug
from edb.common import markup
from edb.schema import schema as s_schema
from edb.server import compiler
from edb.server.compiler import IoFormat
from edb.server.compiler import enums
from ... | true | true |
08f47a95825d9302c739335606cd0fae6640271e | 945 | py | Python | artman/tasks/publish/__init__.py | landrito/artman | c7bc509ef07afe5b46eda3de407305eaa62cbb15 | [
"Apache-2.0"
] | null | null | null | artman/tasks/publish/__init__.py | landrito/artman | c7bc509ef07afe5b46eda3de407305eaa62cbb15 | [
"Apache-2.0"
] | null | null | null | artman/tasks/publish/__init__.py | landrito/artman | c7bc509ef07afe5b46eda3de407305eaa62cbb15 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 33.75 | 74 | 0.774603 |
from __future__ import absolute_import
from artman.tasks.publish import github
from artman.tasks.publish import local
from artman.tasks.publish import maven
from artman.tasks.publish import noop
__all__ = ('github', 'local', 'maven', 'noop')
| true | true |
08f47b472c71ce8a15ad0637dc84056991d6b27a | 4,750 | py | Python | 2Dimages/OEStructure.py | MobleyLab/SAMPL5_logD_PredictionAnalysis | c7675a8f183a465bee89599a6df9e360476ef868 | [
"MIT"
] | 1 | 2018-03-21T16:48:41.000Z | 2018-03-21T16:48:41.000Z | 2Dimages/OEStructure.py | MobleyLab/SAMPL5_logD_PredictionAnalysis | c7675a8f183a465bee89599a6df9e360476ef868 | [
"MIT"
] | null | null | null | 2Dimages/OEStructure.py | MobleyLab/SAMPL5_logD_PredictionAnalysis | c7675a8f183a465bee89599a6df9e360476ef868 | [
"MIT"
] | null | null | null | from openeye.oechem import *
from openeye.oegrapheme import *
from openeye.oeiupac import *
import pickle
from openeye.oedepict import *
# Load relavant dictionaries
d= pickle.load(open('../DataFiles/experimental.p','rb'))
molecules = pickle.load(open('../DataFiles/moleculeData.p','rb'))
# Set up figure options
opts ... | 38.934426 | 131 | 0.540211 | from openeye.oechem import *
from openeye.oegrapheme import *
from openeye.oeiupac import *
import pickle
from openeye.oedepict import *
d= pickle.load(open('../DataFiles/experimental.p','rb'))
molecules = pickle.load(open('../DataFiles/moleculeData.p','rb'))
opts = OE2DMolDisplayOptions(400, 400, OEScale_AutoScale)
... | false | true |
08f47dfeeef66312a0726b7141826e938790b83e | 1,336 | py | Python | tpdatasrc/tpgamefiles/rules/races/race066_drow.py | edoipi/TemplePlus | f0e552289822fea908f16daa379fa568b1bd286d | [
"MIT"
] | 69 | 2015-05-05T14:09:25.000Z | 2022-02-15T06:13:04.000Z | tpdatasrc/tpgamefiles/rules/races/race066_drow.py | edoipi/TemplePlus | f0e552289822fea908f16daa379fa568b1bd286d | [
"MIT"
] | 457 | 2015-05-01T22:07:45.000Z | 2022-03-31T02:19:10.000Z | tpdatasrc/tpgamefiles/rules/races/race066_drow.py | edoipi/TemplePlus | f0e552289822fea908f16daa379fa568b1bd286d | [
"MIT"
] | 25 | 2016-02-04T21:19:53.000Z | 2021-11-15T23:14:51.000Z | from toee import *
import race_defs
###################################################
print "Registering race: Drow"
raceEnum = race_elf + (2 << 5)
raceSpec = race_defs.RaceSpec()
raceSpec.hit_dice = dice_new("0d0")
raceSpec.level_modifier = 2
raceSpec.help_topic = "TAG_DROW"
raceSpec.flags ... | 34.25641 | 158 | 0.685629 | from toee import *
import race_defs
print "Registering race: Drow"
raceEnum = race_elf + (2 << 5)
raceSpec = race_defs.RaceSpec()
raceSpec.hit_dice = dice_new("0d0")
raceSpec.level_modifier = 2
raceSpec.help_topic = "TAG_DROW"
raceSpec.flags = 0
raceSpec.modifier_name = "Drow"
raceSpec.heigh... | false | true |
08f47e1546accc1cb1b38d5f3c04f687fdb716f8 | 4,098 | py | Python | segmentation_models/pspnet/model.py | zcoder/segmentation_models | d513142befb164cf4af5d9cb1e63788b205d149a | [
"MIT"
] | 2 | 2019-05-27T12:33:55.000Z | 2021-05-16T00:49:02.000Z | segmentation_models/pspnet/model.py | ZFTurbo/segmentation_models | 6f9dadcc4e0c5e4828edf1db7864f9587cb3e431 | [
"MIT"
] | null | null | null | segmentation_models/pspnet/model.py | ZFTurbo/segmentation_models | 6f9dadcc4e0c5e4828edf1db7864f9587cb3e431 | [
"MIT"
] | 1 | 2020-03-14T15:08:34.000Z | 2020-03-14T15:08:34.000Z | from .builder import build_psp
from ..utils import freeze_model
from ..utils import legacy_support
from ..backbones import get_backbone, get_feature_layers
def _get_layer_by_factor(backbone_name, factor):
feature_layers = get_feature_layers(backbone_name, n=3)
if factor == 4:
return feature_layers[-1]... | 36.918919 | 113 | 0.608346 | from .builder import build_psp
from ..utils import freeze_model
from ..utils import legacy_support
from ..backbones import get_backbone, get_feature_layers
def _get_layer_by_factor(backbone_name, factor):
feature_layers = get_feature_layers(backbone_name, n=3)
if factor == 4:
return feature_layers[-1]... | true | true |
08f47e575092c0a2266e4114e64675b4cc77ebaa | 1,405 | py | Python | neptune/new/types/atoms/artifact.py | Raalsky/neptune-client | 24ac58581774e61056d49cd1a22727799c14ad54 | [
"Apache-2.0"
] | 254 | 2020-01-27T14:18:57.000Z | 2022-03-31T21:40:33.000Z | neptune/new/types/atoms/artifact.py | Raalsky/neptune-client | 24ac58581774e61056d49cd1a22727799c14ad54 | [
"Apache-2.0"
] | 160 | 2020-02-05T11:00:22.000Z | 2022-03-31T08:50:24.000Z | neptune/new/types/atoms/artifact.py | Raalsky/neptune-client | 24ac58581774e61056d49cd1a22727799c14ad54 | [
"Apache-2.0"
] | 23 | 2020-02-07T09:19:50.000Z | 2022-02-15T09:52:56.000Z | #
# Copyright (c) 2021, Neptune Labs Sp. z o.o.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 31.931818 | 109 | 0.730249 | from dataclasses import dataclass
from typing import TypeVar, TYPE_CHECKING, Optional
from neptune.new.internal.artifacts.file_hasher import FileHasher
from neptune.new.types.atoms.atom import Atom
if TYPE_CHECKING:
from neptune.new.types.value_visitor import ValueVisitor
Ret = TypeVar("Ret")
@dataclass
class ... | true | true |
08f47ea8df38329edaa7feff368f698179c21a3b | 120 | py | Python | src/parser.py | EmaPajic/Intelligent-Drone-Safety-Systems | 6d8dd4d57bf78fe539ea010085be17d60014a2c6 | [
"MIT"
] | null | null | null | src/parser.py | EmaPajic/Intelligent-Drone-Safety-Systems | 6d8dd4d57bf78fe539ea010085be17d60014a2c6 | [
"MIT"
] | null | null | null | src/parser.py | EmaPajic/Intelligent-Drone-Safety-Systems | 6d8dd4d57bf78fe539ea010085be17d60014a2c6 | [
"MIT"
] | null | null | null | import csv
import sys
f = open(sys.argv[1], 'rb')
reader = csv.reader(f)
for row in reader:
print row
f.close()
| 10 | 27 | 0.641667 | import csv
import sys
f = open(sys.argv[1], 'rb')
reader = csv.reader(f)
for row in reader:
print row
f.close()
| false | true |
08f47ed53eb38bdce5be3ea2e4e34deac9b92bbe | 302 | py | Python | JavaScript/makebitmap.py | AvAudioPlayer/VtopBetaCaptchaParser | 83b2bba8b70aaef06d841e79c123064abb113dd4 | [
"MIT"
] | 1 | 2020-01-08T15:01:03.000Z | 2020-01-08T15:01:03.000Z | JavaScript/makebitmap.py | AvAudioPlayer/VtopBetaCaptchaParser | 83b2bba8b70aaef06d841e79c123064abb113dd4 | [
"MIT"
] | null | null | null | JavaScript/makebitmap.py | AvAudioPlayer/VtopBetaCaptchaParser | 83b2bba8b70aaef06d841e79c123064abb113dd4 | [
"MIT"
] | null | null | null | import json
f=open("bitmaps.json")
dic=json.load(f)
f.close()
print len(dic)
g=open("newmaps.py","w")
g.write("{\n")
for i in sorted(dic.keys()):
g.write('"'+str(i)+'":[\n')
val=dic[i]
for j in val:
g.write('\t'+str(j)+',\n')
g.write('],\n')
print "itworkd"
| 15.894737 | 34 | 0.509934 | import json
f=open("bitmaps.json")
dic=json.load(f)
f.close()
print len(dic)
g=open("newmaps.py","w")
g.write("{\n")
for i in sorted(dic.keys()):
g.write('"'+str(i)+'":[\n')
val=dic[i]
for j in val:
g.write('\t'+str(j)+',\n')
g.write('],\n')
print "itworkd"
| false | true |
08f47ee4e8d3ff794408f9f0672ec22217f5ae2b | 574 | py | Python | day3/parsers/collateral/textfsm_example1.py | austind/pyplus-ons | f0fcd6b2a980f75968ab54cd2ae39b42c1f68302 | [
"Apache-2.0"
] | null | null | null | day3/parsers/collateral/textfsm_example1.py | austind/pyplus-ons | f0fcd6b2a980f75968ab54cd2ae39b42c1f68302 | [
"Apache-2.0"
] | null | null | null | day3/parsers/collateral/textfsm_example1.py | austind/pyplus-ons | f0fcd6b2a980f75968ab54cd2ae39b42c1f68302 | [
"Apache-2.0"
] | 5 | 2019-11-19T18:41:41.000Z | 2020-06-18T14:58:09.000Z | #!/usr/bin/env python
from pprint import pprint
import textfsm
template_file = "textfsm_example1.tpl"
template = open(template_file)
with open("textfsm_example1.txt", "r") as infile:
raw_text_data = infile.read()
# The argument 'template' is a file handle and 'raw_text_data' is a string.
re_table = textfsm.TextF... | 22.96 | 75 | 0.756098 | from pprint import pprint
import textfsm
template_file = "textfsm_example1.tpl"
template = open(template_file)
with open("textfsm_example1.txt", "r") as infile:
raw_text_data = infile.read()
re_table = textfsm.TextFSM(template)
data = re_table.ParseText(raw_text_data)
template.close()
table_keys = re_table.head... | true | true |
08f47fccdc526f069494fc85b5c53d2153161c79 | 1,334 | py | Python | alignment/synthetics/datasets/augs.py | liujuanLT/insightface | b46598268381d823b74f992da678c869d7716380 | [
"MIT"
] | 1 | 2022-01-12T04:15:51.000Z | 2022-01-12T04:15:51.000Z | alignment/synthetics/datasets/augs.py | liujuanLT/insightface | b46598268381d823b74f992da678c869d7716380 | [
"MIT"
] | null | null | null | alignment/synthetics/datasets/augs.py | liujuanLT/insightface | b46598268381d823b74f992da678c869d7716380 | [
"MIT"
] | 1 | 2022-02-10T04:19:05.000Z | 2022-02-10T04:19:05.000Z | import numpy as np
import albumentations as A
from albumentations.core.transforms_interface import ImageOnlyTransform
class RectangleBorderAugmentation(ImageOnlyTransform):
def __init__(
self,
fill_value = 0,
limit = 0.3,
always_apply=False,
p=1.0,
... | 32.536585 | 74 | 0.627436 | import numpy as np
import albumentations as A
from albumentations.core.transforms_interface import ImageOnlyTransform
class RectangleBorderAugmentation(ImageOnlyTransform):
def __init__(
self,
fill_value = 0,
limit = 0.3,
always_apply=False,
p=1.0,
... | true | true |
08f4801983219dd5016280585fbc53f2520a4dc7 | 2,566 | py | Python | tests/models/test_combinations.py | JelleAalbers/hypney | 3e38e21743fc9babe0ed47af299d08242a9b6d32 | [
"MIT"
] | null | null | null | tests/models/test_combinations.py | JelleAalbers/hypney | 3e38e21743fc9babe0ed47af299d08242a9b6d32 | [
"MIT"
] | null | null | null | tests/models/test_combinations.py | JelleAalbers/hypney | 3e38e21743fc9babe0ed47af299d08242a9b6d32 | [
"MIT"
] | null | null | null | import hypney
import numpy as np
from scipy import stats
def test_mixture():
m1 = hypney.models.uniform(rate=40)
m2_free = hypney.models.uniform(rate=20)
m2_frozen = m2_free.freeze()
m3 = hypney.models.uniform(rate=30)
for m2 in m2_free, m2_frozen:
mix = hypney.models.mixture(m1, m2)
... | 29.494253 | 87 | 0.609899 | import hypney
import numpy as np
from scipy import stats
def test_mixture():
m1 = hypney.models.uniform(rate=40)
m2_free = hypney.models.uniform(rate=20)
m2_frozen = m2_free.freeze()
m3 = hypney.models.uniform(rate=30)
for m2 in m2_free, m2_frozen:
mix = hypney.models.mixture(m1, m2)
... | true | true |
08f481604507b019573bc84ab9cb92645f697785 | 5,434 | py | Python | source/operators/rekognition/start_celebrity_recognition.py | hasanp87/aws-media-insights-engine | 45d093e450a11d4c919d1d6f9a0f0017b2ae5a44 | [
"Apache-2.0"
] | 1 | 2020-09-11T19:12:21.000Z | 2020-09-11T19:12:21.000Z | source/operators/rekognition/start_celebrity_recognition.py | hasanp87/aws-media-insights-engine | 45d093e450a11d4c919d1d6f9a0f0017b2ae5a44 | [
"Apache-2.0"
] | null | null | null | source/operators/rekognition/start_celebrity_recognition.py | hasanp87/aws-media-insights-engine | 45d093e450a11d4c919d1d6f9a0f0017b2ae5a44 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
###############################################################################
# PURPOSE:
# Lambda function to recognize celebrities in an image or video file
#
###########################################... | 46.444444 | 116 | 0.665992 |
import os
import json
from botocore import config
import urllib
import boto3
from MediaInsightsEngineLambdaHelper import OutputHelper
from MediaInsightsEngineLambdaHelper import MasExecutionError
from MediaInsightsEngineLambdaHelper import DataPlane
operator_name = os.environ['OPERATOR_NAME']
output_object = Output... | true | true |
08f482655db9feb52bfd6b9986514716b8b49ad2 | 4,454 | py | Python | src/hunter.py | BenoitYU/inventory-hunter | 60901503009490f86f9bf9a9e7bb0c3b73fdf12d | [
"MIT"
] | null | null | null | src/hunter.py | BenoitYU/inventory-hunter | 60901503009490f86f9bf9a9e7bb0c3b73fdf12d | [
"MIT"
] | null | null | null | src/hunter.py | BenoitYU/inventory-hunter | 60901503009490f86f9bf9a9e7bb0c3b73fdf12d | [
"MIT"
] | null | null | null | import random
import sched
import sys
random.seed()
# scrapers 表示的是对应的config文件中的所有的链接爬取 每一个爬取任务就是一个scraper类实例 然后这个实例会被加入到scheduler中一直循环调用
# 需要注意的是 一个config文件对应着一件商品 一个上平对应着多个网站 每一个网站对应着一个爬取任务 每个爬取任务会被无休止循环执行
class Engine:
def __init__(self, alerters, config, scrapers):
self.alerters = alerters
s... | 38.068376 | 107 | 0.629771 | import random
import sched
import sys
random.seed()
class Engine:
def __init__(self, alerters, config, scrapers):
self.alerters = alerters
self.refresh_interval = config.refresh_interval
self.max_price = config.max_price
self.scheduler = sched.scheduler()
for s in ... | true | true |
08f4827f23b03c84beeb7cfb461dac765afc9e7d | 260 | py | Python | Client_DL/myconnutils.py | nhattruongpham/APS | 46166236d34b32457b71d6ef52423bcbf71bc1e8 | [
"MIT"
] | null | null | null | Client_DL/myconnutils.py | nhattruongpham/APS | 46166236d34b32457b71d6ef52423bcbf71bc1e8 | [
"MIT"
] | null | null | null | Client_DL/myconnutils.py | nhattruongpham/APS | 46166236d34b32457b71d6ef52423bcbf71bc1e8 | [
"MIT"
] | null | null | null | import pymysql
# Hàm trả về một connection.
def getConnection():
# Bạn có thể thay đổi các thông số kết nối.
connection = pymysql.connect(host='172.16.37.90', port=3306, user='root', passwd='Truong@1996', database='ParkingSlot')
return connection | 32.5 | 123 | 0.711538 | import pymysql
def getConnection():
connection = pymysql.connect(host='172.16.37.90', port=3306, user='root', passwd='Truong@1996', database='ParkingSlot')
return connection | true | true |
08f4840aba249ac58b968652fc63e0c1d51d12b4 | 2,718 | py | Python | tests/influx_utils.py | EmileCadorel/powerapi | 588413fe8f8369d02084bd7adff1d610273a4b9f | [
"BSD-3-Clause"
] | null | null | null | tests/influx_utils.py | EmileCadorel/powerapi | 588413fe8f8369d02084bd7adff1d610273a4b9f | [
"BSD-3-Clause"
] | null | null | null | tests/influx_utils.py | EmileCadorel/powerapi | 588413fe8f8369d02084bd7adff1d610273a4b9f | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2018, INRIA
# Copyright (c) 2018, University of Lille
# 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 copyright notice, thi... | 35.763158 | 89 | 0.740986 |
import datetime
from influxdb import InfluxDBClient
def generate_power_report(sensor, target, timestamp):
return {
'measurement': 'power_consumption',
'tags': {'sensor': sensor,
'target': target},
'time': str(datetime.datetime.fromtimestamp(timestamp)),
'fi... | true | true |
08f484b333238dd27c9e75ec57bd0445ca596fcc | 21,046 | py | Python | test/mitmproxy/proxy/layers/test_tls.py | gorogoroumaru/mitmproxy | f135be8e65de7564d628a1535bd198139a153572 | [
"MIT"
] | 1 | 2021-06-25T20:57:20.000Z | 2021-06-25T20:57:20.000Z | test/mitmproxy/proxy/layers/test_tls.py | gorogoroumaru/mitmproxy | f135be8e65de7564d628a1535bd198139a153572 | [
"MIT"
] | 13 | 2021-06-25T20:56:39.000Z | 2022-02-13T22:59:39.000Z | test/mitmproxy/proxy/layers/test_tls.py | gorogoroumaru/mitmproxy | f135be8e65de7564d628a1535bd198139a153572 | [
"MIT"
] | null | null | null | import ssl
import typing
import pytest
from OpenSSL import SSL
from mitmproxy import connection
from mitmproxy.connection import ConnectionState, Server
from mitmproxy.proxy import commands, context, events, layer
from mitmproxy.proxy.layers import tls
from mitmproxy.utils import data
from test.mitmproxy.proxy import... | 39.411985 | 120 | 0.632234 | import ssl
import typing
import pytest
from OpenSSL import SSL
from mitmproxy import connection
from mitmproxy.connection import ConnectionState, Server
from mitmproxy.proxy import commands, context, events, layer
from mitmproxy.proxy.layers import tls
from mitmproxy.utils import data
from test.mitmproxy.proxy import... | true | true |
08f4850866c185a2c43b47b4a39e3018f19784f6 | 1,307 | py | Python | optimus/io/oracle.py | XD-DENG/Optimus | 13e7b180f0970addae77cafe128bd2a93be138a2 | [
"Apache-2.0"
] | 1 | 2020-08-15T06:58:59.000Z | 2020-08-15T06:58:59.000Z | optimus/io/oracle.py | XD-DENG/Optimus | 13e7b180f0970addae77cafe128bd2a93be138a2 | [
"Apache-2.0"
] | null | null | null | optimus/io/oracle.py | XD-DENG/Optimus | 13e7b180f0970addae77cafe128bd2a93be138a2 | [
"Apache-2.0"
] | null | null | null | from enum import Enum
from singleton_decorator import singleton
from optimus.io.abstract_driver import AbstractDriver
from optimus.io.properties import DriverProperties
@singleton
class OracleDriver(AbstractDriver):
"""Oracle Database"""
def properties(self) -> Enum:
return DriverProperties.ORACLE
... | 37.342857 | 135 | 0.653405 | from enum import Enum
from singleton_decorator import singleton
from optimus.io.abstract_driver import AbstractDriver
from optimus.io.properties import DriverProperties
@singleton
class OracleDriver(AbstractDriver):
def properties(self) -> Enum:
return DriverProperties.ORACLE
def url(self, *args, ... | true | true |
08f48518955cb92973c4bfa007ad7057776a7d99 | 12,774 | py | Python | nova/cells/scheduler.py | wingwj/nova | dec78765ef2635aec85d3937d95e5fd04852f94c | [
"Apache-2.0"
] | null | null | null | nova/cells/scheduler.py | wingwj/nova | dec78765ef2635aec85d3937d95e5fd04852f94c | [
"Apache-2.0"
] | 1 | 2018-01-19T07:50:49.000Z | 2018-01-19T07:50:49.000Z | nova/cells/scheduler.py | wingwj/nova | dec78765ef2635aec85d3937d95e5fd04852f94c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 Rackspace Hosting
# 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 req... | 46.791209 | 79 | 0.600438 |
import copy
import time
from oslo.config import cfg
from nova.cells import filters
from nova.cells import weights
from nova import compute
from nova.compute import instance_actions
from nova.compute import utils as compute_utils
from nova.compute import vm_states
from nova import conductor
from nova.db import base
f... | true | true |
08f4851b324ecbedef3ccaecd8e179dc090dda3f | 664 | py | Python | 1stRound/Easy/401 Binary Watch/DFSCombination.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | 2 | 2020-04-24T18:36:52.000Z | 2020-04-25T00:15:57.000Z | 1stRound/Easy/401 Binary Watch/DFSCombination.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | null | null | null | 1stRound/Easy/401 Binary Watch/DFSCombination.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | null | null | null | from itertools import combinations
class Solution(object):
def readBinaryWatch(self, num):
"""
:type num: int
:rtype: List[str]
"""
res = []
self.dfs(num, 0, res)
return res
def dfs(self, num, hours, res):
if hours > num : return
f... | 30.181818 | 72 | 0.474398 | from itertools import combinations
class Solution(object):
def readBinaryWatch(self, num):
res = []
self.dfs(num, 0, res)
return res
def dfs(self, num, hours, res):
if hours > num : return
for hour in combinations([1, 2, 4, 8], hours):
hs = sum(hour)
... | true | true |
08f485c70f35be81b65420a05e1edc375b009041 | 8,902 | py | Python | python/tests/common.py | trueagi-io/hyperon-experimental | 50c2f136fb992880a2ecb104e279bbf9b31c53f1 | [
"MIT"
] | 6 | 2021-09-23T13:45:52.000Z | 2022-03-16T16:01:18.000Z | python/tests/common.py | trueagi-io/hyperon-experimental | 50c2f136fb992880a2ecb104e279bbf9b31c53f1 | [
"MIT"
] | 1 | 2022-03-25T10:46:20.000Z | 2022-03-25T10:59:49.000Z | python/tests/common.py | trueagi-io/hyperon-experimental | 50c2f136fb992880a2ecb104e279bbf9b31c53f1 | [
"MIT"
] | 1 | 2021-09-22T10:42:58.000Z | 2021-09-22T10:42:58.000Z | from hyperon import *
def match_op(space, pattern, templ_op):
space = space.get_object().value
# TODO: hack to make both quoted and unquoted expression work
if (templ_op.get_type() == AtomKind.EXPR and
templ_op.get_children()[0].get_type() == AtomKind.SYMBOL and
templ_op.get_children()[0].g... | 39.04386 | 82 | 0.605482 | from hyperon import *
def match_op(space, pattern, templ_op):
space = space.get_object().value
if (templ_op.get_type() == AtomKind.EXPR and
templ_op.get_children()[0].get_type() == AtomKind.SYMBOL and
templ_op.get_children()[0].get_name() == 'q'):
quoted = templ_op.get_children()[1:... | true | true |
08f488b386577fc15c5ae445ddb8cedc520ea70f | 3,136 | py | Python | BarrierZoneTrainer/BarrierZoneTrainer/BarrierZoneDefenseRandomized.py | MetaMain/BARZ | 458466e42ada076c4fb448098768b32356df0259 | [
"BSD-3-Clause"
] | 1 | 2022-03-23T23:32:41.000Z | 2022-03-23T23:32:41.000Z | BarrierZoneTrainer/BarrierZoneTrainer/BarrierZoneDefenseRandomized.py | MetaMain/BARZ | 458466e42ada076c4fb448098768b32356df0259 | [
"BSD-3-Clause"
] | null | null | null | BarrierZoneTrainer/BarrierZoneTrainer/BarrierZoneDefenseRandomized.py | MetaMain/BARZ | 458466e42ada076c4fb448098768b32356df0259 | [
"BSD-3-Clause"
] | null | null | null | #This is the randomized version of the BARZ defense
import numpy
import DataManagerPytorch as DMP
class BarrierZoneDefenseRandomized():
#Default constructor
def __init__(self , modelPlusList, classNum, modelsPerEval):
self.ModelPlusList=modelPlusList
self.ClassNum=classNum
se... | 46.117647 | 142 | 0.647321 | import numpy
import DataManagerPytorch as DMP
class BarrierZoneDefenseRandomized():
def __init__(self , modelPlusList, classNum, modelsPerEval):
self.ModelPlusList=modelPlusList
self.ClassNum=classNum
self.ModelNum=len(self.ModelPlusList)
self.Threshold=modelsPerEval
... | true | true |
08f48905666ee4e7a484fffc5778eb68895da4ef | 40,637 | py | Python | nemo/collections/nlp/models/machine_translation/mt_enc_dec_model.py | agemagician/NeMo | 5839aee402f314aa413b28e9042b1e1cac10a114 | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/models/machine_translation/mt_enc_dec_model.py | agemagician/NeMo | 5839aee402f314aa413b28e9042b1e1cac10a114 | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/models/machine_translation/mt_enc_dec_model.py | agemagician/NeMo | 5839aee402f314aa413b28e9042b1e1cac10a114 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. 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... | 48.783914 | 153 | 0.631567 |
import itertools
import json
import random
from multiprocessing import Value
from pathlib import Path
from typing import Dict, List, Optional, Union
import numpy as np
import torch
import torch.distributed as dist
import torch.utils.data as pt_data
from omegaconf import DictConfig, ListConfig, OmegaConf
from pytorch_... | true | true |
08f48907a908933f5256c4f098aa73e6185a3c0c | 1,813 | py | Python | Theory-guided_Deep_Learning/utils.py | SHMingLiu/Deep-Supervised-Learning-in-Metal-Forming | 42cb3f29bf64d6e9225541943f117099c37c88f6 | [
"MIT"
] | 5 | 2021-09-01T07:51:57.000Z | 2021-11-18T10:18:43.000Z | Theory-guided_Deep_Learning/utils.py | SHMingLiu/Deep-Supervised-Learning-in-Metal-Forming | 42cb3f29bf64d6e9225541943f117099c37c88f6 | [
"MIT"
] | null | null | null | Theory-guided_Deep_Learning/utils.py | SHMingLiu/Deep-Supervised-Learning-in-Metal-Forming | 42cb3f29bf64d6e9225541943f117099c37c88f6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 1 14:37:12 2020
@author: sl7516
"""
import numpy as np
import json
import os
RESULTS_DIR = 'results/'
def print_json(result):
# print result in a jsonable structure
print (json.dumps(
result,
default=None, sort_keys=F... | 27.469697 | 76 | 0.59294 |
import numpy as np
import json
import os
RESULTS_DIR = 'results/'
def print_json(result):
print (json.dumps(
result,
default=None, sort_keys=False,
indent=4, separators=(',',': ')
))
def save_json_result(model_name, result):
result_na... | true | true |
08f48971cb30947b476e37920383b1469d9279f0 | 4,141 | py | Python | pypy/module/cpyext/test/test_datetime.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | 1 | 2020-01-21T11:10:51.000Z | 2020-01-21T11:10:51.000Z | pypy/module/cpyext/test/test_datetime.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | pypy/module/cpyext/test/test_datetime.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase
from pypy.module.cpyext.test.test_api import BaseApiTest
import datetime
class TestDatetime(BaseApiTest):
def test_date(self, space, api):
w_date = api.PyDate_FromDate(2010, 06, 03)
assert space.unwrap(space.str(w_date)) ==... | 40.203883 | 78 | 0.609515 | from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase
from pypy.module.cpyext.test.test_api import BaseApiTest
import datetime
class TestDatetime(BaseApiTest):
def test_date(self, space, api):
w_date = api.PyDate_FromDate(2010, 06, 03)
assert space.unwrap(space.str(w_date)) ==... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.