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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4a74a5b3ae9815d30ff73f4c0fa8d735514d1e | 27,110 | py | Python | src/twisted/conch/test/keydata.py | seanicus64/twisted | c0f1394c7bfb04d97c725a353a1f678fa6a1c602 | [
"MIT",
"Unlicense"
] | 32 | 2019-11-14T07:49:33.000Z | 2022-02-16T00:49:22.000Z | src/twisted/conch/test/keydata.py | seanicus64/twisted | c0f1394c7bfb04d97c725a353a1f678fa6a1c602 | [
"MIT",
"Unlicense"
] | 9 | 2019-09-06T18:21:59.000Z | 2022-01-13T03:04:11.000Z | src/twisted/conch/test/keydata.py | seanicus64/twisted | c0f1394c7bfb04d97c725a353a1f678fa6a1c602 | [
"MIT",
"Unlicense"
] | 16 | 2019-06-25T13:26:43.000Z | 2022-03-07T07:29:12.000Z | # -*- test-case-name: twisted.conch.test.test_keys -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# pylint: disable=I0011,C0103,W9401,W9402
"""
Data used by test_keys as well as others.
"""
from __future__ import absolute_import, division
from twisted.python.compat import long, _b64deco... | 61.058559 | 92 | 0.819993 |
from __future__ import absolute_import, division
from twisted.python.compat import long, _b64decodebytes as decodebytes
RSAData = {
'n': long('269413617238113438198661010376758399219880277968382122687862697'
'296942471209955603071120391975773283844560230371884389952067978'
'7896... | true | true |
1c4a75959aba89da3bf8a9fad406f6e1008f3883 | 7,491 | py | Python | cmsplugin_filer_link2/models.py | tobifroe/djangocms-link2 | 75780b0259df5d403b4648522404cae9768f76d2 | [
"BSD-3-Clause"
] | null | null | null | cmsplugin_filer_link2/models.py | tobifroe/djangocms-link2 | 75780b0259df5d403b4648522404cae9768f76d2 | [
"BSD-3-Clause"
] | null | null | null | cmsplugin_filer_link2/models.py | tobifroe/djangocms-link2 | 75780b0259df5d403b4648522404cae9768f76d2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.urls.exceptions import NoReverseMatch
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import escape
from d... | 38.415385 | 119 | 0.611 |
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.urls.exceptions import NoReverseMatch
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import escape
from django.utils.safestring ... | true | true |
1c4a75e892d60a1d12ff20ec2dff431ecbc0002b | 257 | py | Python | lib/errata/decorators.py | adarshtri/art-dashboard-server | c6c61147d49aa43b6e2892ce07d8a115c1478b0c | [
"Apache-2.0"
] | 1 | 2020-09-21T06:48:47.000Z | 2020-09-21T06:48:47.000Z | lib/errata/decorators.py | adarshtri/art-dashboard-server | c6c61147d49aa43b6e2892ce07d8a115c1478b0c | [
"Apache-2.0"
] | 5 | 2021-02-05T19:43:08.000Z | 2021-06-04T23:23:29.000Z | lib/errata/decorators.py | adarshtri/art-dashboard-server | c6c61147d49aa43b6e2892ce07d8a115c1478b0c | [
"Apache-2.0"
] | 6 | 2021-02-06T07:21:37.000Z | 2021-06-07T12:40:37.000Z | from lib.errata.kerberos import handle_kinit
import functools
def update_keytab(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
handle_kinit()
func_ret = func(*args, **kwargs)
return func_ret
return wrapper
| 21.416667 | 44 | 0.673152 | from lib.errata.kerberos import handle_kinit
import functools
def update_keytab(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
handle_kinit()
func_ret = func(*args, **kwargs)
return func_ret
return wrapper
| true | true |
1c4a76055960b4b25afce3760c920e7649074f56 | 516 | py | Python | Evulation_Script.py | OpenVessel/RedTinSaintBernard-for-BraTS2021-challenge | dafe6f33ff6269869377d01a014ab1528b0f1c1d | [
"MIT"
] | null | null | null | Evulation_Script.py | OpenVessel/RedTinSaintBernard-for-BraTS2021-challenge | dafe6f33ff6269869377d01a014ab1528b0f1c1d | [
"MIT"
] | null | null | null | Evulation_Script.py | OpenVessel/RedTinSaintBernard-for-BraTS2021-challenge | dafe6f33ff6269869377d01a014ab1528b0f1c1d | [
"MIT"
] | null | null | null |
### How the output of the model will be evulated is with
## Dice score
##
#https://pypi.org/project/MedPy/0.4.0/
## https://loli.github.io/medpy/_modules/medpy/metric/binary.html
### HAUSDORFF DISTANCE
###https://en.wikipedia.org/wiki/Hausdorff_distance
## https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice... | 28.666667 | 87 | 0.753876 | true | true | |
1c4a763ee76b213d17c59a4865ede3a3b254073f | 1,805 | py | Python | delta/data/frontend/cepstrum_test.py | luffywalf/delta | 7eb4e3be578a680737616efff6858d280595ff48 | [
"Apache-2.0"
] | 1 | 2019-10-27T08:15:22.000Z | 2019-10-27T08:15:22.000Z | delta/data/frontend/cepstrum_test.py | luffywalf/delta | 7eb4e3be578a680737616efff6858d280595ff48 | [
"Apache-2.0"
] | null | null | null | delta/data/frontend/cepstrum_test.py | luffywalf/delta | 7eb4e3be578a680737616efff6858d280595ff48 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | 37.604167 | 82 | 0.677562 |
import tensorflow as tf
import os
from pathlib import Path
from delta.data.frontend.read_wav import ReadWav
from delta.data.frontend.cepstrum import Cepstrum
import numpy as np
class CepstrumTest(tf.test.TestCase):
def test_cepstrum(self):
wav_path = str(
Path(os.environ['MAIN_ROOT']).joi... | true | true |
1c4a77766df324feef1c4233c8317b9f927125b0 | 14,874 | py | Python | gmqtt/mqtt/handler.py | liamdiprose/gmqtt | 4fb92a9629fc57c885f5e07c46b951c4f45e9572 | [
"MIT"
] | null | null | null | gmqtt/mqtt/handler.py | liamdiprose/gmqtt | 4fb92a9629fc57c885f5e07c46b951c4f45e9572 | [
"MIT"
] | null | null | null | gmqtt/mqtt/handler.py | liamdiprose/gmqtt | 4fb92a9629fc57c885f5e07c46b951c4f45e9572 | [
"MIT"
] | null | null | null | import asyncio
import logging
import struct
import time
from asyncio import iscoroutinefunction
from collections import defaultdict
from copy import deepcopy
from functools import partial
from .utils import unpack_variable_byte_integer, IdGenerator, run_coroutine_or_function
from .property import Property
from .protoc... | 36.189781 | 122 | 0.646699 | import asyncio
import logging
import struct
import time
from asyncio import iscoroutinefunction
from collections import defaultdict
from copy import deepcopy
from functools import partial
from .utils import unpack_variable_byte_integer, IdGenerator, run_coroutine_or_function
from .property import Property
from .protoc... | true | true |
1c4a78d8ce31fc6b52765819f449138247bee001 | 1,552 | py | Python | examples/example1.py | lilydia/py-linkedin-jobs-scraper | a015739a7a25e8dd035f06ba629c6a48f376db43 | [
"MIT"
] | null | null | null | examples/example1.py | lilydia/py-linkedin-jobs-scraper | a015739a7a25e8dd035f06ba629c6a48f376db43 | [
"MIT"
] | null | null | null | examples/example1.py | lilydia/py-linkedin-jobs-scraper | a015739a7a25e8dd035f06ba629c6a48f376db43 | [
"MIT"
] | 1 | 2021-11-16T21:59:10.000Z | 2021-11-16T21:59:10.000Z | from linkedin_jobs_scraper import LinkedinScraper
from linkedin_jobs_scraper.events import Events, EventData
from linkedin_jobs_scraper.query import Query, QueryOptions, QueryFilters
from linkedin_jobs_scraper.filters import RelevanceFilters, TimeFilters, TypeFilters, ExperienceLevelFilters
def on_data(data: EventDat... | 28.740741 | 116 | 0.671392 | from linkedin_jobs_scraper import LinkedinScraper
from linkedin_jobs_scraper.events import Events, EventData
from linkedin_jobs_scraper.query import Query, QueryOptions, QueryFilters
from linkedin_jobs_scraper.filters import RelevanceFilters, TimeFilters, TypeFilters, ExperienceLevelFilters
def on_data(data: EventDat... | true | true |
1c4a78f4dcf40fc5ffc5474c684e0cddfad04df8 | 698 | py | Python | prime.py | CooperPair/end_to_end_encryption | 8eab4c76b0cb5bcba36442c08f9dbb336b476117 | [
"MIT"
] | 1 | 2019-01-26T16:20:09.000Z | 2019-01-26T16:20:09.000Z | prime.py | CooperPair/end_to_end_encryption | 8eab4c76b0cb5bcba36442c08f9dbb336b476117 | [
"MIT"
] | null | null | null | prime.py | CooperPair/end_to_end_encryption | 8eab4c76b0cb5bcba36442c08f9dbb336b476117 | [
"MIT"
] | null | null | null | import math
def isPrime(num):
# Return True if Number is prime else false
# isPrime is slower than primeSieve()
if num < 2:
return False
for i in range(2, int(math.sqrt(num))+1):
if num%i == 0:
return False
return True
def primeSieve():
sieve = [True]*sieveSize # list of Boolean True that is the length... | 20.529412 | 81 | 0.670487 | import math
def isPrime(num):
if num < 2:
return False
for i in range(2, int(math.sqrt(num))+1):
if num%i == 0:
return False
return True
def primeSieve():
sieve = [True]*sieveSize
sieve[0] = False
sieve[1] = False
for i in range(2, int(math.sqrt(sieveSize)) + 1):
pointer = i*2
while poin... | true | true |
1c4a79bd34e32dc0bc69909503c6fba71fdbe9ab | 13,311 | py | Python | scripts/run_fever_scoring.py | salesforce/DialFact | d400b250147e45c106b18e52254b1060f7c1575d | [
"BSD-3-Clause"
] | 10 | 2021-11-08T00:37:57.000Z | 2022-03-28T12:19:29.000Z | scripts/run_fever_scoring.py | salesforce/DialFact | d400b250147e45c106b18e52254b1060f7c1575d | [
"BSD-3-Clause"
] | 1 | 2022-01-24T18:37:17.000Z | 2022-01-24T18:37:17.000Z | scripts/run_fever_scoring.py | salesforce/DialFact | d400b250147e45c106b18e52254b1060f7c1575d | [
"BSD-3-Clause"
] | 1 | 2022-03-22T08:56:04.000Z | 2022-03-22T08:56:04.000Z | import argparse
import sys
import jsonlines
from tqdm import tqdm
import logging
import json
import torch
import torch.nn.functional as F
import jsonlines
import random
import os
import numpy as np
from scipy.special import softmax
# os.environ["NCCL_SHM_DISABLE"] = "1"
from tqdm import tqdm
from typing import List
fro... | 39.853293 | 212 | 0.631207 | import argparse
import sys
import jsonlines
from tqdm import tqdm
import logging
import json
import torch
import torch.nn.functional as F
import jsonlines
import random
import os
import numpy as np
from scipy.special import softmax
from tqdm import tqdm
from typing import List
from sklearn.metrics import f1_score, pre... | true | true |
1c4a7a0b653d94fb65060004a335ac768d0fbace | 5,776 | py | Python | sdk/yapily/models/account_statement.py | yapily/yapily-sdk-python | c09930c44e8795e270e2846a2c0fb783200df76a | [
"MIT"
] | 11 | 2018-05-18T14:38:49.000Z | 2021-09-08T13:24:37.000Z | sdk/yapily/models/account_statement.py | yapily/yapily-sdk-python | c09930c44e8795e270e2846a2c0fb783200df76a | [
"MIT"
] | 5 | 2019-10-23T15:06:33.000Z | 2021-08-03T21:18:50.000Z | sdk/yapily/models/account_statement.py | yapily/yapily-sdk-python | c09930c44e8795e270e2846a2c0fb783200df76a | [
"MIT"
] | 8 | 2019-04-27T00:02:18.000Z | 2021-11-21T02:54:12.000Z | # coding: utf-8
"""
Yapily API
To access endpoints that require authentication, use your application key and secret created in the Dashboard (https://dashboard.yapily.com) # noqa: E501
The version of the OpenAPI document: 1.154.0
Generated by: https://openapi-generator.tech
"""
import pprint
impor... | 29.025126 | 158 | 0.608899 |
import pprint
import re
import six
from yapily.configuration import Configuration
class AccountStatement(object):
openapi_types = {
'id': 'str',
'start_date_time': 'datetime',
'end_date_time': 'datetime',
'creation_date_time': 'datetime'
}
attribute_map = {
... | true | true |
1c4a7a49f884812045349d0f5b1b1b674809dc4f | 1,968 | py | Python | CuSVD/testcases/gen_testcase.py | praeclarumjj3/CuML | 1c812d3b07a11c3a69a284d9960058a874d97bfa | [
"MIT"
] | 2 | 2021-03-04T13:38:00.000Z | 2021-04-09T13:40:00.000Z | CuSVD/testcases/gen_testcase.py | praeclarumjj3/CuML | 1c812d3b07a11c3a69a284d9960058a874d97bfa | [
"MIT"
] | null | null | null | CuSVD/testcases/gen_testcase.py | praeclarumjj3/CuML | 1c812d3b07a11c3a69a284d9960058a874d97bfa | [
"MIT"
] | 2 | 2020-12-13T18:21:18.000Z | 2021-08-17T06:55:56.000Z | #!/usr/bin/python3
#########################################################################
# Generate M x N matrix of real numbers and store #
# the the matrix in file named 'testcase_<M>_<N>' #
# Parameters: #
# ... | 38.588235 | 73 | 0.399898 | true | true | |
1c4a7b6fc80a80c5c89ab92e7173ca90f412ed2c | 1,717 | py | Python | examples/clusteredparent/sync.py | rahulchheda/metac | 40b547db945dd1a45cb2d62205d1c59e278bd678 | [
"Apache-2.0"
] | 577 | 2018-03-22T01:31:59.000Z | 2022-02-16T15:19:12.000Z | examples/clusteredparent/sync.py | DalavanCloud/metacontroller | 98610b6e15cbe8b6ccd3bca0928dce0ce54c548d | [
"Apache-2.0"
] | 391 | 2020-05-19T09:33:07.000Z | 2022-03-31T17:27:18.000Z | examples/clusteredparent/sync.py | DalavanCloud/metacontroller | 98610b6e15cbe8b6ccd3bca0928dce0ce54c548d | [
"Apache-2.0"
] | 117 | 2018-03-22T01:40:47.000Z | 2022-03-25T08:57:53.000Z | #!/usr/bin/env python
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 37.326087 | 105 | 0.726849 |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import json
def new_rolebinding(name):
rolebinding = {}
rolebinding['apiVersion'] = 'rbac.authorization.k8s.io/v1'
rolebinding['kind'] = 'RoleBinding'
rolebinding['metadata'] = {}
rolebinding['metadata']['name'] = name
rolebindin... | true | true |
1c4a7b98fa5883d11c06bf2f920e1ba0096ba6ec | 5,226 | py | Python | services/backend/app/api/v1/endpoints/marks.py | moxxiq/online-diary | 5949cb5631d49622a31885519a880b17a0816988 | [
"MIT"
] | null | null | null | services/backend/app/api/v1/endpoints/marks.py | moxxiq/online-diary | 5949cb5631d49622a31885519a880b17a0816988 | [
"MIT"
] | null | null | null | services/backend/app/api/v1/endpoints/marks.py | moxxiq/online-diary | 5949cb5631d49622a31885519a880b17a0816988 | [
"MIT"
] | null | null | null | from fastapi import APIRouter, status, HTTPException, Path, Depends
import app.core.crud as crud
from app.core.authorization import get_current_user, get_current_user_with_scopes
from app.core.schemas.users import UserWithID
from app.core.schemas.marks import Mark, MarkDB, MarkContent
router = APIRouter()
@router.po... | 67.87013 | 178 | 0.726177 | from fastapi import APIRouter, status, HTTPException, Path, Depends
import app.core.crud as crud
from app.core.authorization import get_current_user, get_current_user_with_scopes
from app.core.schemas.users import UserWithID
from app.core.schemas.marks import Mark, MarkDB, MarkContent
router = APIRouter()
@router.po... | true | true |
1c4a7c6f7957c6d59fda330bbe04e8fea41006a6 | 1,933 | py | Python | plots/cv_over_a/qif/plot.py | ModelDBRepository/228604 | 8f641f73bcac2700b476663fe656fcad7d63470d | [
"BSD-3-Clause"
] | null | null | null | plots/cv_over_a/qif/plot.py | ModelDBRepository/228604 | 8f641f73bcac2700b476663fe656fcad7d63470d | [
"BSD-3-Clause"
] | null | null | null | plots/cv_over_a/qif/plot.py | ModelDBRepository/228604 | 8f641f73bcac2700b476663fe656fcad7d63470d | [
"BSD-3-Clause"
] | null | null | null | import analytics.shot_noise_driven.if_neuron as ana
import analytics.gaussian_white_noise_driven.if_neuron as gwnana
import pylab as pl
import numpy as np
import param_scan.io
import param_scan.parameter_sets
import param_scan.simulation_run
from param_scan.io import InDirectory
import os
from latex_param_values import... | 37.173077 | 189 | 0.682359 | import analytics.shot_noise_driven.if_neuron as ana
import analytics.gaussian_white_noise_driven.if_neuron as gwnana
import pylab as pl
import numpy as np
import param_scan.io
import param_scan.parameter_sets
import param_scan.simulation_run
from param_scan.io import InDirectory
import os
from latex_param_values import... | true | true |
1c4a7c8b617700a230076e999868d1a98b6e2fb1 | 312 | py | Python | desafios/Ex023.py | FelipeAlafy/Python | da2374e55e8aa84e4ca6d9c7bf8dafeb546a4742 | [
"MIT"
] | null | null | null | desafios/Ex023.py | FelipeAlafy/Python | da2374e55e8aa84e4ca6d9c7bf8dafeb546a4742 | [
"MIT"
] | null | null | null | desafios/Ex023.py | FelipeAlafy/Python | da2374e55e8aa84e4ca6d9c7bf8dafeb546a4742 | [
"MIT"
] | null | null | null | num = int(input("Digite um número entre 0 e 9999: "))
u = num // 1 % 10
d = num // 10 % 10
c = num // 100 % 10
m = num // 1000 % 10
print("\033[36munidade: {}\033[m".format(u))
print("\033[33mdezena: {}\033[m".format(d))
print("\033[32mcentena: {}\033[m".format(c))
print("\033[31mmilhar: {}\033[m".format(m))
| 31.2 | 53 | 0.589744 | num = int(input("Digite um número entre 0 e 9999: "))
u = num // 1 % 10
d = num // 10 % 10
c = num // 100 % 10
m = num // 1000 % 10
print("\033[36munidade: {}\033[m".format(u))
print("\033[33mdezena: {}\033[m".format(d))
print("\033[32mcentena: {}\033[m".format(c))
print("\033[31mmilhar: {}\033[m".format(m))
| true | true |
1c4a7c8d6ad4b05645b9c03988afe18bb514fbae | 59 | py | Python | packages/Python/modern_robotics/__init__.py | Nutellaman/ModernRobotics | 88c94eec1e0e4eedbd3ae32819664179a9a5a6ba | [
"MIT"
] | 1,126 | 2016-10-10T19:04:47.000Z | 2022-03-31T21:22:58.000Z | packages/Python/modern_robotics/__init__.py | Nutellaman/ModernRobotics | 88c94eec1e0e4eedbd3ae32819664179a9a5a6ba | [
"MIT"
] | 34 | 2017-10-11T04:52:38.000Z | 2022-03-17T18:23:05.000Z | packages/Python/modern_robotics/__init__.py | Nutellaman/ModernRobotics | 88c94eec1e0e4eedbd3ae32819664179a9a5a6ba | [
"MIT"
] | 631 | 2016-10-11T03:43:36.000Z | 2022-03-24T21:41:47.000Z | from .__version__ import __version__
from .core import *
| 11.8 | 36 | 0.779661 | from .__version__ import __version__
from .core import *
| true | true |
1c4a7cf006f6295e328795766e19f2fe14ead264 | 2,259 | py | Python | examples/brainsimulator_agent/components/visual_area_component.py | masayoshi-nakamura/CognitiveArchitectureLecture | 5e036b48e92f266062eb7be8a366e754dee24f2c | [
"Apache-2.0"
] | 4 | 2016-03-13T03:01:28.000Z | 2016-03-31T02:51:56.000Z | examples/brainsimulator_agent/components/visual_area_component.py | masayoshi-nakamura/CognitiveArchitectureLecture | 5e036b48e92f266062eb7be8a366e754dee24f2c | [
"Apache-2.0"
] | null | null | null | examples/brainsimulator_agent/components/visual_area_component.py | masayoshi-nakamura/CognitiveArchitectureLecture | 5e036b48e92f266062eb7be8a366e754dee24f2c | [
"Apache-2.0"
] | null | null | null |
import brica1
import numpy as np
import pygazebo.msg.poses_stamped_pb2
import pickle
class VisualAreaComponent(brica1.Component):
def __init__(self):
super(VisualAreaComponent, self).__init__()
self.last_position = np.array((0, 0))
def __position_to_area_id(self, pos2d):
x = pos2d[0]
... | 31.375 | 76 | 0.575476 |
import brica1
import numpy as np
import pygazebo.msg.poses_stamped_pb2
import pickle
class VisualAreaComponent(brica1.Component):
def __init__(self):
super(VisualAreaComponent, self).__init__()
self.last_position = np.array((0, 0))
def __position_to_area_id(self, pos2d):
x = pos2d[0]
... | true | true |
1c4a7d5d68e7e6f208af698969098f6dd360551f | 932 | py | Python | pycantonese/tests/test_yale.py | chaaklau/pycantonese | 94694fea2f3c3405d3b6bb6d504a56bb05a6496c | [
"MIT"
] | 124 | 2019-08-12T13:10:43.000Z | 2022-03-24T18:35:58.000Z | pycantonese/tests/test_yale.py | chaaklau/pycantonese | 94694fea2f3c3405d3b6bb6d504a56bb05a6496c | [
"MIT"
] | 13 | 2019-09-03T17:08:49.000Z | 2021-12-28T21:37:17.000Z | pycantonese/tests/test_yale.py | chaaklau/pycantonese | 94694fea2f3c3405d3b6bb6d504a56bb05a6496c | [
"MIT"
] | 15 | 2019-08-09T04:03:01.000Z | 2022-03-17T10:18:21.000Z | import pytest
from pycantonese import jyutping_to_yale
from pycantonese.jyutping.parse_jyutping import ONSETS, NUCLEI, CODAS
from pycantonese.jyutping.yale import (
ONSETS_YALE,
NUCLEI_YALE,
CODAS_YALE,
)
def test_correct_onset_set():
assert set(ONSETS_YALE.keys()) == ONSETS
def test_correct_nucleu... | 23.3 | 73 | 0.73176 | import pytest
from pycantonese import jyutping_to_yale
from pycantonese.jyutping.parse_jyutping import ONSETS, NUCLEI, CODAS
from pycantonese.jyutping.yale import (
ONSETS_YALE,
NUCLEI_YALE,
CODAS_YALE,
)
def test_correct_onset_set():
assert set(ONSETS_YALE.keys()) == ONSETS
def test_correct_nucleu... | true | true |
1c4a7d8f4b20f462196786fe00a5de5533884057 | 184 | py | Python | molsysmt/tools/openmm_Modeller/is_openmm_Modeller.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/tools/openmm_Modeller/is_openmm_Modeller.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/tools/openmm_Modeller/is_openmm_Modeller.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | _item_fullname_='openmm.Modeller'
def is_openmm_Modeller(item):
item_fullname = item.__class__.__module__+'.'+item.__class__.__name__
return _item_fullname_==item_fullname
| 20.444444 | 73 | 0.788043 | _item_fullname_='openmm.Modeller'
def is_openmm_Modeller(item):
item_fullname = item.__class__.__module__+'.'+item.__class__.__name__
return _item_fullname_==item_fullname
| true | true |
1c4a7e2fe78d848f06c3a08a7f2a2ea29679e094 | 1,158 | py | Python | setup.py | topshed/m8tricks | 51a55f0cdbb167252048101bc2aadf547a5730da | [
"MIT"
] | 10 | 2019-07-31T17:33:10.000Z | 2022-01-08T09:07:01.000Z | setup.py | topshed/m8tricks | 51a55f0cdbb167252048101bc2aadf547a5730da | [
"MIT"
] | 3 | 2019-08-18T19:25:20.000Z | 2022-01-07T12:19:23.000Z | setup.py | topshed/m8tricks | 51a55f0cdbb167252048101bc2aadf547a5730da | [
"MIT"
] | 1 | 2022-01-08T09:03:42.000Z | 2022-01-08T09:03:42.000Z | "Setup script for the m8tricks package"
import sys
from setuptools import setup, find_packages
if not sys.version_info >= (3, 5):
raise RuntimeError('This application requires Python 3.5 or later')
def main():
"Executes setup when this script is the top-level"
import m8tricks as app
from pathlib imp... | 28.95 | 71 | 0.598446 |
import sys
from setuptools import setup, find_packages
if not sys.version_info >= (3, 5):
raise RuntimeError('This application requires Python 3.5 or later')
def main():
import m8tricks as app
from pathlib import Path
with Path(__file__).with_name('project.rst').open() as project:
setup(
... | true | true |
1c4a805580426d4b5885f1258cc4efdfad25817c | 2,870 | py | Python | src/topology/general/nn_circuit.py | Dreamonic/shor-algorithm | 19a4d95f0f19809cd3fe1db4d834ff3a02fba68d | [
"MIT"
] | null | null | null | src/topology/general/nn_circuit.py | Dreamonic/shor-algorithm | 19a4d95f0f19809cd3fe1db4d834ff3a02fba68d | [
"MIT"
] | null | null | null | src/topology/general/nn_circuit.py | Dreamonic/shor-algorithm | 19a4d95f0f19809cd3fe1db4d834ff3a02fba68d | [
"MIT"
] | null | null | null | from math import ceil, sqrt
from projectq.ops import Swap
from src.topology.general.circuit import Circuit, LongDistanceAlgorithm, Statistics, Restrictions, Node
from src.topology.general.qubit import QubitHandler, QubitType
class GridSwap(LongDistanceAlgorithm):
def prepare(self, circuit, src, tgt, ... | 41 | 115 | 0.529965 | from math import ceil, sqrt
from projectq.ops import Swap
from src.topology.general.circuit import Circuit, LongDistanceAlgorithm, Statistics, Restrictions, Node
from src.topology.general.qubit import QubitHandler, QubitType
class GridSwap(LongDistanceAlgorithm):
def prepare(self, circuit, src, tgt, ... | true | true |
1c4a80ada0266eea6ace4af79ce1968081a0a12c | 5,578 | py | Python | reconbf/modules/test_nova.py | fallenpegasus/reconbf | bfd15bef549f011a3de885c3267d4f718223b798 | [
"Apache-2.0"
] | 45 | 2016-08-12T21:37:25.000Z | 2022-03-29T00:21:29.000Z | reconbf/modules/test_nova.py | fallenpegasus/reconbf | bfd15bef549f011a3de885c3267d4f718223b798 | [
"Apache-2.0"
] | 20 | 2016-08-11T07:42:28.000Z | 2016-09-09T13:33:47.000Z | reconbf/modules/test_nova.py | fallenpegasus/reconbf | bfd15bef549f011a3de885c3267d4f718223b798 | [
"Apache-2.0"
] | 6 | 2016-08-25T06:31:38.000Z | 2019-09-11T04:29:36.000Z | # Copyright 2016 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 34.645963 | 78 | 0.677483 |
from reconbf.lib import test_class
from reconbf.lib.result import GroupTestResult
from reconbf.lib.result import Result
from reconbf.lib.result import TestResult
from reconbf.lib import utils
import grp
import os
import pwd
def _conf_location():
return {'dir': '/etc/nova'}
def _conf_details():
... | true | true |
1c4a8104321bcc1796f75a2f5207296f38219830 | 674 | py | Python | 19th/sharing-taxi-fare/solution.py | WooJin1993/coding_test | ec9dc2dc768fe45700b4c0695b16535c0a824f6e | [
"MIT"
] | null | null | null | 19th/sharing-taxi-fare/solution.py | WooJin1993/coding_test | ec9dc2dc768fe45700b4c0695b16535c0a824f6e | [
"MIT"
] | null | null | null | 19th/sharing-taxi-fare/solution.py | WooJin1993/coding_test | ec9dc2dc768fe45700b4c0695b16535c0a824f6e | [
"MIT"
] | null | null | null | # 문제: https://programmers.co.kr/learn/courses/30/lessons/72413
# --- 풀이 ---
# INF = sys.maxsize 하는 경우, 효율성 테스트 1개 실패
# 계산 시간은 INF 크기에도 영향을 받는다.
from itertools import product
def solution(n, s, a, b, fares):
result = []
INF = 1e12
graph = [[INF] * (n+1) for _ in range(n + 1)]
for i in range(1, n ... | 25.923077 | 68 | 0.531157 |
from itertools import product
def solution(n, s, a, b, fares):
result = []
INF = 1e12
graph = [[INF] * (n+1) for _ in range(n + 1)]
for i in range(1, n + 1):
graph[i][i] = 0
for c, d, f in fares:
graph[c][d] = graph[d][c] = f
for k, i, j in product(range(1, ... | true | true |
1c4a8168020be394142ebda10e6e5df8bb4b44fb | 6,210 | py | Python | storm_analysis/diagnostics/spliner_2d/configure.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | null | null | null | storm_analysis/diagnostics/spliner_2d/configure.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | null | null | null | storm_analysis/diagnostics/spliner_2d/configure.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | null | null | null | #!/usr/bin/env python
"""
Configure folder for Spliner testing.
Hazen 09/17
"""
import argparse
import inspect
import numpy
import os
import storm_analysis
import storm_analysis.sa_library.parameters as parameters
import storm_analysis.sa_library.sa_h5py as saH5Py
import storm_analysis.simulator.background as backgr... | 35.689655 | 96 | 0.585829 |
import argparse
import inspect
import numpy
import os
import storm_analysis
import storm_analysis.sa_library.parameters as parameters
import storm_analysis.sa_library.sa_h5py as saH5Py
import storm_analysis.simulator.background as background
import storm_analysis.simulator.camera as camera
import storm_analysis.simu... | true | true |
1c4a82c3e3b8ab680786c7cb5945c0ac48353bc2 | 5,065 | py | Python | GUIMonkey/Steps.py | Setyadjih/GUIMonkey | b1299663ee84de688663c08040d3411c78fb7fe1 | [
"MIT"
] | null | null | null | GUIMonkey/Steps.py | Setyadjih/GUIMonkey | b1299663ee84de688663c08040d3411c78fb7fe1 | [
"MIT"
] | 7 | 2021-04-27T03:39:32.000Z | 2021-09-03T05:31:38.000Z | GUIMonkey/Steps.py | Setyadjih/GUIMonkey | b1299663ee84de688663c08040d3411c78fb7fe1 | [
"MIT"
] | null | null | null | import time
from abc import ABC, abstractmethod
import pyautogui
from lib.logger import get_logger
class StepBase(ABC):
"""Base class for steps. We mainly want the execute interface"""
@abstractmethod
def __init__(self, step_name: str = None, logger=None):
self.name = step_name if step_name els... | 31.855346 | 107 | 0.615597 | import time
from abc import ABC, abstractmethod
import pyautogui
from lib.logger import get_logger
class StepBase(ABC):
@abstractmethod
def __init__(self, step_name: str = None, logger=None):
self.name = step_name if step_name else self.__class__.__name__
self.data = dict()
self.fl... | true | true |
1c4a847fa05d25e7f265a374d27586576fb10671 | 255 | py | Python | aux/engine/actor/__init__.py | bischjer/auxiliary | e42d8a4af43c9bd4d816c03edc2465640635b46b | [
"BSD-3-Clause"
] | null | null | null | aux/engine/actor/__init__.py | bischjer/auxiliary | e42d8a4af43c9bd4d816c03edc2465640635b46b | [
"BSD-3-Clause"
] | null | null | null | aux/engine/actor/__init__.py | bischjer/auxiliary | e42d8a4af43c9bd4d816c03edc2465640635b46b | [
"BSD-3-Clause"
] | null | null | null | from aux.engine.actor.reactor import Reactor
from aux.engine.actor.proactor import Proactor
from aux.engine.actor.coactor import Coactor
__all__ = ['Reactor',
'Proactor',
'Coactor']
class NoActorFoundError(Exception):pass
| 23.181818 | 46 | 0.705882 | from aux.engine.actor.reactor import Reactor
from aux.engine.actor.proactor import Proactor
from aux.engine.actor.coactor import Coactor
__all__ = ['Reactor',
'Proactor',
'Coactor']
class NoActorFoundError(Exception):pass
| true | true |
1c4a849524c22465abea1613bfe918c2849cddd4 | 233 | py | Python | nni/retiarii/trainer/pytorch/__init__.py | qfyin/nni | 59a1ccf8eba68b94974e84fc3834f38d851faf89 | [
"MIT"
] | 3 | 2021-02-23T14:01:43.000Z | 2021-03-29T16:19:32.000Z | nni/retiarii/trainer/pytorch/__init__.py | qfyin/nni | 59a1ccf8eba68b94974e84fc3834f38d851faf89 | [
"MIT"
] | 1 | 2021-01-17T08:53:56.000Z | 2021-01-17T08:53:56.000Z | nni/retiarii/trainer/pytorch/__init__.py | qfyin/nni | 59a1ccf8eba68b94974e84fc3834f38d851faf89 | [
"MIT"
] | 1 | 2020-12-21T11:15:54.000Z | 2020-12-21T11:15:54.000Z | from .base import PyTorchImageClassificationTrainer, PyTorchMultiModelTrainer
from .darts import DartsTrainer
from .enas import EnasTrainer
from .proxyless import ProxylessTrainer
from .random import RandomTrainer, SinglePathTrainer
| 38.833333 | 77 | 0.875536 | from .base import PyTorchImageClassificationTrainer, PyTorchMultiModelTrainer
from .darts import DartsTrainer
from .enas import EnasTrainer
from .proxyless import ProxylessTrainer
from .random import RandomTrainer, SinglePathTrainer
| true | true |
1c4a84b409b74bb514cb2f6f68ddd6f1e2431fe6 | 5,524 | py | Python | build/lib/mpesa/api/mpesa_express.py | Arlus/python-mpesa | 4113d9a59211c05f4c6881965710c4f67a5157b2 | [
"MIT"
] | 26 | 2018-08-02T06:59:50.000Z | 2022-01-15T16:46:39.000Z | build/lib/mpesa/api/mpesa_express.py | Arlus/python-mpesa | 4113d9a59211c05f4c6881965710c4f67a5157b2 | [
"MIT"
] | 1 | 2019-08-17T08:52:23.000Z | 2019-08-17T08:52:23.000Z | build/lib/mpesa/api/mpesa_express.py | Arlus/python-mpesa | 4113d9a59211c05f4c6881965710c4f67a5157b2 | [
"MIT"
] | 38 | 2018-07-26T18:11:18.000Z | 2022-01-02T10:10:54.000Z | import base64
import requests
from .auth import MpesaBase
import datetime
class MpesaExpress(MpesaBase):
def __init__(self, env="sandbox", app_key=None, app_secret=None, sandbox_url=None, live_url=None):
MpesaBase.__init__(self, env, app_key, app_secret, sandbox_url, live_url)
self.authentication_... | 57.541667 | 238 | 0.509051 | import base64
import requests
from .auth import MpesaBase
import datetime
class MpesaExpress(MpesaBase):
def __init__(self, env="sandbox", app_key=None, app_secret=None, sandbox_url=None, live_url=None):
MpesaBase.__init__(self, env, app_key, app_secret, sandbox_url, live_url)
self.authentication_... | true | true |
1c4a8557b221c053d9b0aaf2d4788aa69102a5c8 | 1,269 | py | Python | yt_dlp/extractor/vidlox.py | mkg20001/yt-dlp | 9518a0a6bed040844d5fd6e29c25328e5949ce94 | [
"Unlicense"
] | 1 | 2021-08-24T17:03:03.000Z | 2021-08-24T17:03:03.000Z | yt_dlp/extractor/vidlox.py | mkg20001/yt-dlp | 9518a0a6bed040844d5fd6e29c25328e5949ce94 | [
"Unlicense"
] | null | null | null | yt_dlp/extractor/vidlox.py | mkg20001/yt-dlp | 9518a0a6bed040844d5fd6e29c25328e5949ce94 | [
"Unlicense"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class VIDLOXIE(InfoExtractor):
IE_NAME = 'vidlox'
_VALID_URL = r'https?://vidlox\.me/(embed-)?(?P<id>[a-z0-9]+).html'
_TEST = {
'url': 'https://vidlox.me/6wq8gciafziz.html',
'info_dict': {
... | 27.586957 | 71 | 0.547675 |
from __future__ import unicode_literals
from .common import InfoExtractor
class VIDLOXIE(InfoExtractor):
IE_NAME = 'vidlox'
_VALID_URL = r'https?://vidlox\.me/(embed-)?(?P<id>[a-z0-9]+).html'
_TEST = {
'url': 'https://vidlox.me/6wq8gciafziz.html',
'info_dict': {
'id': '6wq8gc... | true | true |
1c4a8748112916fe5593eae671d07b4837e59ab3 | 6,115 | py | Python | configs/libra_rcnn/libra_faster_rcnn_r101_fpn_1x.py | Lechatelia/own_mmdet | eac5db1d1bee8eafe0ed46fa4bb61ca8605b502f | [
"Apache-2.0"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | configs/libra_rcnn/libra_faster_rcnn_r101_fpn_1x.py | Lechatelia/own_mmdet | eac5db1d1bee8eafe0ed46fa4bb61ca8605b502f | [
"Apache-2.0"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | configs/libra_rcnn/libra_faster_rcnn_r101_fpn_1x.py | Lechatelia/own_mmdet | eac5db1d1bee8eafe0ed46fa4bb61ca8605b502f | [
"Apache-2.0"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | # model settings
model = dict(
type='FasterRCNN',
pretrained='torchvision://resnet101',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
style='py... | 31.358974 | 79 | 0.559935 |
model = dict(
type='FasterRCNN',
pretrained='torchvision://resnet101',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
style='pytorch'),
nec... | true | true |
1c4a87f8e649f8a5932c3165dddf9b3f0aeca3cc | 880 | py | Python | mi/dataset/driver/ctdmo_ghqr/sio/test/test_ctdmo_ghqr_sio_telemetered_driver.py | cdobs/mi-instrument | 99f9322a4afabc5dff9b0fad12166075efce838c | [
"BSD-2-Clause"
] | 1 | 2018-09-14T23:28:29.000Z | 2018-09-14T23:28:29.000Z | mi/dataset/driver/ctdmo_ghqr/sio/test/test_ctdmo_ghqr_sio_telemetered_driver.py | cdobs/mi-instrument | 99f9322a4afabc5dff9b0fad12166075efce838c | [
"BSD-2-Clause"
] | 33 | 2017-04-25T19:53:45.000Z | 2022-03-18T17:42:18.000Z | mi/dataset/driver/ctdmo_ghqr/sio/test/test_ctdmo_ghqr_sio_telemetered_driver.py | cdobs/mi-instrument | 99f9322a4afabc5dff9b0fad12166075efce838c | [
"BSD-2-Clause"
] | 31 | 2015-03-04T01:01:09.000Z | 2020-10-28T14:42:12.000Z | import os
import unittest
from mi.core.log import get_logger
from mi.dataset.dataset_driver import ParticleDataHandler
from mi.dataset.driver.ctdmo_ghqr.sio.ctdmo_ghqr_sio_telemetered_driver import parse
from mi.dataset.driver.ctdmo_ghqr.sio.resource import RESOURCE_PATH
__author__ = 'mworden'
log = get_logger()
cl... | 28.387097 | 84 | 0.761364 | import os
import unittest
from mi.core.log import get_logger
from mi.dataset.dataset_driver import ParticleDataHandler
from mi.dataset.driver.ctdmo_ghqr.sio.ctdmo_ghqr_sio_telemetered_driver import parse
from mi.dataset.driver.ctdmo_ghqr.sio.resource import RESOURCE_PATH
__author__ = 'mworden'
log = get_logger()
cl... | true | true |
1c4a898f084e68f38241c7b658081be92d7a651f | 949 | py | Python | examples/01/b.py | cjrh/aiosmartsock | a4ab5ffe5b673ada2a3002d7a9cb68ee1ea4a48f | [
"Apache-2.0"
] | 9 | 2019-03-25T23:25:08.000Z | 2022-01-17T00:49:26.000Z | examples/01/b.py | cjrh/aiomsg | 74b646675e3d7296f0334d3e17c1be0370c5d852 | [
"Apache-2.0"
] | 33 | 2019-04-13T02:31:07.000Z | 2022-03-21T19:12:14.000Z | examples/01/b.py | cjrh/aiosmartsock | a4ab5ffe5b673ada2a3002d7a9cb68ee1ea4a48f | [
"Apache-2.0"
] | 1 | 2021-04-26T09:07:36.000Z | 2021-04-26T09:07:36.000Z | import logging
import asyncio
import aiomsg
import random
from colorama import init, Fore, Style
init()
logging.basicConfig(level="DEBUG")
async def main():
s = aiomsg.Søcket()
await s.connect()
async def r():
while True:
print("waiting for response...")
msg = await s.rec... | 21.088889 | 70 | 0.591149 | import logging
import asyncio
import aiomsg
import random
from colorama import init, Fore, Style
init()
logging.basicConfig(level="DEBUG")
async def main():
s = aiomsg.Søcket()
await s.connect()
async def r():
while True:
print("waiting for response...")
msg = await s.rec... | true | true |
1c4a8a9465c9765af917e68961daf41b5e99fd15 | 1,270 | py | Python | backend/api/urls.py | ChristchurchCityWeightlifting/lifter-api | a82b79c75106e7f4f8ea4b4e3e12d727213445e3 | [
"MIT"
] | null | null | null | backend/api/urls.py | ChristchurchCityWeightlifting/lifter-api | a82b79c75106e7f4f8ea4b4e3e12d727213445e3 | [
"MIT"
] | 5 | 2022-03-07T08:30:47.000Z | 2022-03-22T09:15:52.000Z | backend/api/urls.py | ChristchurchCityWeightlifting/lifter-api | a82b79c75106e7f4f8ea4b4e3e12d727213445e3 | [
"MIT"
] | null | null | null | from django.urls import include, path
from rest_framework.routers import DefaultRouter
from rest_framework_nested.routers import NestedDefaultRouter
from api.views import AthleteViewSet, CompetitionViewSet, LiftViewSet, SessionViewSet
router = DefaultRouter(trailing_slash=False)
router.register(r"athletes", AthleteVi... | 36.285714 | 105 | 0.774803 | from django.urls import include, path
from rest_framework.routers import DefaultRouter
from rest_framework_nested.routers import NestedDefaultRouter
from api.views import AthleteViewSet, CompetitionViewSet, LiftViewSet, SessionViewSet
router = DefaultRouter(trailing_slash=False)
router.register(r"athletes", AthleteVi... | true | true |
1c4a8b7192fcfef250b74c73b64732c53563f6c6 | 1,585 | py | Python | kluctl/cli/seal_command_stubs.py | matzegebbe/kluctl | 1b092b921e7301a30c99792b026634e099fbf15d | [
"Apache-2.0"
] | 26 | 2021-08-18T11:18:46.000Z | 2022-03-16T09:28:43.000Z | kluctl/cli/seal_command_stubs.py | matzegebbe/kluctl | 1b092b921e7301a30c99792b026634e099fbf15d | [
"Apache-2.0"
] | 4 | 2021-09-07T09:55:29.000Z | 2022-03-03T09:05:01.000Z | kluctl/cli/seal_command_stubs.py | matzegebbe/kluctl | 1b092b921e7301a30c99792b026634e099fbf15d | [
"Apache-2.0"
] | 4 | 2021-09-04T11:52:33.000Z | 2022-03-16T09:18:20.000Z | import click
from click_option_group import optgroup
from kluctl.cli.main_cli_group import kluctl_project_args, cli_group
@cli_group.command("seal",
help="Seal secrets based on target's sealingConfig.\n\n"
"Loads all secrets from the specified secrets sets from the target's... | 54.655172 | 118 | 0.643533 | import click
from click_option_group import optgroup
from kluctl.cli.main_cli_group import kluctl_project_args, cli_group
@cli_group.command("seal",
help="Seal secrets based on target's sealingConfig.\n\n"
"Loads all secrets from the specified secrets sets from the target's... | true | true |
1c4a8c258378ad8f2a962e64c0b2b5d11bc73837 | 375 | py | Python | 2015/10/part2.py | timofurrer/aoc-2020 | 446b688a57601d9891f520e43b7f822c373a6ff4 | [
"MIT"
] | null | null | null | 2015/10/part2.py | timofurrer/aoc-2020 | 446b688a57601d9891f520e43b7f822c373a6ff4 | [
"MIT"
] | null | null | null | 2015/10/part2.py | timofurrer/aoc-2020 | 446b688a57601d9891f520e43b7f822c373a6ff4 | [
"MIT"
] | null | null | null | from pathlib import Path
with (Path(__file__).parent / "input.txt").open() as puzzle_input_file:
puzzle_input_raw = puzzle_input_file.read()
import itertools
number = puzzle_input_raw
def look_and_say(look):
return ''.join(str(len([1 for _ in v])) + k for k, v in itertools.groupby(look))
for _ in range(50)... | 23.4375 | 84 | 0.72 | from pathlib import Path
with (Path(__file__).parent / "input.txt").open() as puzzle_input_file:
puzzle_input_raw = puzzle_input_file.read()
import itertools
number = puzzle_input_raw
def look_and_say(look):
return ''.join(str(len([1 for _ in v])) + k for k, v in itertools.groupby(look))
for _ in range(50)... | true | true |
1c4a8d43ec29814bf33a1a684899d96c24b15fbe | 13,571 | py | Python | utils/visualize.py | vtekur/gnn_pathplanning | 150ca315c214134eda8f5c5b55ce71da9360bcce | [
"MIT"
] | null | null | null | utils/visualize.py | vtekur/gnn_pathplanning | 150ca315c214134eda8f5c5b55ce71da9360bcce | [
"MIT"
] | null | null | null | utils/visualize.py | vtekur/gnn_pathplanning | 150ca315c214134eda8f5c5b55ce71da9360bcce | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import yaml
import matplotlib
# matplotlib.use("Agg")
from matplotlib.patches import Circle, Rectangle, Arrow
from matplotlib.collections import PatchCollection
from matplotlib.patches import ConnectionPatch
from matplotlib.patches import FancyArrowPatch
import matplotlib.pyplot as plt
import nu... | 40.150888 | 181 | 0.603419 |
import yaml
import matplotlib
from matplotlib.patches import Circle, Rectangle, Arrow
from matplotlib.collections import PatchCollection
from matplotlib.patches import ConnectionPatch
from matplotlib.patches import FancyArrowPatch
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation
fr... | true | true |
1c4a8d92aa7936b2472071f2adda42a56ce328db | 88,007 | py | Python | src/testers/unicorn_test_aarch64.py | TehRick/Triton | 397e42edb2fb7c3fea12be22f70c44e8d0859d57 | [
"Apache-2.0"
] | null | null | null | src/testers/unicorn_test_aarch64.py | TehRick/Triton | 397e42edb2fb7c3fea12be22f70c44e8d0859d57 | [
"Apache-2.0"
] | null | null | null | src/testers/unicorn_test_aarch64.py | TehRick/Triton | 397e42edb2fb7c3fea12be22f70c44e8d0859d57 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
## -*- coding: utf-8 -*-
import sys
import pprint
from triton import *
from unicorn import *
from unicorn.arm64_const import *
ADDR = 0x100000
STACK = 0x200000
HEAP = 0x300000
SIZE = 5 * 1024 * 1024
CODE = [
("\x80\x46\x82\xd2", "movz x0, #0x1234"),
("\x80\... | 42.577165 | 114 | 0.508482 |
int
from triton import *
from unicorn import *
from unicorn.arm64_const import *
ADDR = 0x100000
STACK = 0x200000
HEAP = 0x300000
SIZE = 5 * 1024 * 1024
CODE = [
("\x80\x46\x82\xd2", "movz x0, #0x1234"),
("\x80\x46\xa2\xd2", "movz x0, #0x1234, lsl #16"),
("\x80\x46\xc2\xd2", ... | true | true |
1c4a8e4c20813902ae05d3230d53ca2da1867ab2 | 432 | py | Python | vendor/migrations/0006_vendor_sam_url.py | brethauer/mirage | 396f61206bf76f997c0535277af918058aa1b827 | [
"CC0-1.0"
] | null | null | null | vendor/migrations/0006_vendor_sam_url.py | brethauer/mirage | 396f61206bf76f997c0535277af918058aa1b827 | [
"CC0-1.0"
] | null | null | null | vendor/migrations/0006_vendor_sam_url.py | brethauer/mirage | 396f61206bf76f997c0535277af918058aa1b827 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('vendor', '0005_vendor_sam_exclusion'),
]
operations = [
migrations.AddField(
model_name='vendor',
na... | 20.571429 | 48 | 0.597222 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('vendor', '0005_vendor_sam_exclusion'),
]
operations = [
migrations.AddField(
model_name='vendor',
name='sam_url',
... | true | true |
1c4a8e8166224c62899fba51d3fc55b147695668 | 2,248 | py | Python | tests/unit/trace/test_status.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | null | null | null | tests/unit/trace/test_status.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | 1 | 2021-06-10T23:59:36.000Z | 2021-06-10T23:59:36.000Z | tests/unit/trace/test_status.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | 1 | 2019-09-01T06:00:13.000Z | 2019-09-01T06:00:13.000Z | # Copyright 2017, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 30.794521 | 74 | 0.656139 |
import unittest
from google.rpc import code_pb2
from opencensus.trace import status as status_module
class TestStatus(unittest.TestCase):
def test_constructor(self):
code = 100
message = 'test message'
status = status_module.Status(code=code, message=message)
self.... | true | true |
1c4a900d6a3357b0f159b0070ace473e54b8c9e3 | 81 | py | Python | CodeWars/7 Kyu/Coding 3min- Father and Son.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Coding 3min- Father and Son.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Coding 3min- Father and Son.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | def sc(s):
xs = set(s)
return ''.join(c for c in s if c.swapcase() in xs) | 27 | 54 | 0.555556 | def sc(s):
xs = set(s)
return ''.join(c for c in s if c.swapcase() in xs) | true | true |
1c4a91d777b5ea2a8f62b27d050a042816f1964a | 9,570 | py | Python | var/spack/repos/builtin/packages/mvapich2/package.py | NickRF/spack | edecdc3ace7cbf5df2dcc090da3d1827c4099ebc | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/mvapich2/package.py | NickRF/spack | edecdc3ace7cbf5df2dcc090da3d1827c4099ebc | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/mvapich2/package.py | NickRF/spack | edecdc3ace7cbf5df2dcc090da3d1827c4099ebc | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
from spack import *
class Mvapich2(AutotoolsPackage):
"""MVAPICH2 is an MPI implementation for Infiniban... | 35.054945 | 109 | 0.591536 |
import sys
from spack import *
class Mvapich2(AutotoolsPackage):
homepage = "http://mvapich.cse.ohio-state.edu/"
url = "http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.2.tar.gz"
list_url = "http://mvapich.cse.ohio-state.edu/downloads/"
version('2.3rc2', '6fcf22fe2a16023b462ef5... | true | true |
1c4a92c5094d36b0d5c48b0030aed8a13467ea5b | 371 | py | Python | arxiv/base/tests/test_factory.py | ibnesayeed/arxiv-base | 9f49302370272792a0afc78debd039d249844c6c | [
"MIT"
] | 23 | 2019-01-10T22:01:18.000Z | 2022-02-02T10:28:25.000Z | arxiv/base/tests/test_factory.py | ibnesayeed/arxiv-base | 9f49302370272792a0afc78debd039d249844c6c | [
"MIT"
] | 57 | 2018-12-17T16:45:38.000Z | 2021-12-14T14:20:58.000Z | arxiv/base/tests/test_factory.py | cul-it/arxiv-base-ui | a5beadf44c24f72e21313299bfafc1ffb9d28ac7 | [
"MIT"
] | 5 | 2019-01-10T22:01:28.000Z | 2021-11-05T12:25:31.000Z | from unittest import TestCase
from flask import Flask
from arxiv.base.factory import create_web_app
class TestBaseAppFactory(TestCase):
"""Tests for :mod:`arxiv.base.factory`."""
def test_create_web_app(self):
""":func:`.create_web_app` generates a :class:`.Flask` instance."""
app = create_w... | 26.5 | 75 | 0.703504 | from unittest import TestCase
from flask import Flask
from arxiv.base.factory import create_web_app
class TestBaseAppFactory(TestCase):
def test_create_web_app(self):
app = create_web_app()
self.assertIsInstance(app, Flask)
| true | true |
1c4a940d0cdd6c7b7b1ab2fcfcbb3402c6214e07 | 18,464 | py | Python | pypy3.9-v7.3.9-win64/Lib/sqlite3/test/userfunctions.py | LawrenceZ1A/MultipurposeProject | 54d5898301d01c33dd771b29e2e19e20d3875a21 | [
"Apache-2.0"
] | null | null | null | pypy3.9-v7.3.9-win64/Lib/sqlite3/test/userfunctions.py | LawrenceZ1A/MultipurposeProject | 54d5898301d01c33dd771b29e2e19e20d3875a21 | [
"Apache-2.0"
] | 1 | 2022-02-22T00:59:49.000Z | 2022-02-22T00:59:49.000Z | pypy3.9-v7.3.9-win64/Lib/sqlite3/test/userfunctions.py | LawrenceZ1A/MultipurposeProject | 54d5898301d01c33dd771b29e2e19e20d3875a21 | [
"Apache-2.0"
] | 1 | 2022-03-30T11:42:37.000Z | 2022-03-30T11:42:37.000Z | # pysqlite2/test/userfunctions.py: tests for user-defined functions and
# aggregates.
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the au... | 33.755027 | 102 | 0.620667 |
import unittest
import unittest.mock
import sqlite3 as sqlite
def func_returntext():
return "foo"
def func_returntextwithnull():
return "1\x002"
def func_returnunicode():
return "bar"
def func_returnint():
return 42
def func_returnfloat():
return 3.14
def func_returnnull():
... | true | true |
1c4a96188ff3db551b42c8a2d3e9be167f0e99f7 | 653 | py | Python | server/user/migrations/0006_auto_20201019_2248.py | MetLee/hackergame | 571b5407e0644169a2f9b3907a0a1d93138ba436 | [
"MIT"
] | 48 | 2018-09-30T11:07:52.000Z | 2021-12-07T03:32:59.000Z | server/user/migrations/0006_auto_20201019_2248.py | MetLee/hackergame | 571b5407e0644169a2f9b3907a0a1d93138ba436 | [
"MIT"
] | 100 | 2018-10-13T18:37:25.000Z | 2021-11-11T12:14:45.000Z | server/user/migrations/0006_auto_20201019_2248.py | MetLee/hackergame | 571b5407e0644169a2f9b3907a0a1d93138ba436 | [
"MIT"
] | 11 | 2018-10-08T14:59:33.000Z | 2022-03-02T03:21:09.000Z | # Generated by Django 3.1.2 on 2020-10-19 14:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('user', '0005_auto_20191011_1842'),
]
operations = [
migrations.AlterModelOptions(
name='user',
options={'default_permissions... | 36.277778 | 356 | 0.623277 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('user', '0005_auto_20191011_1842'),
]
operations = [
migrations.AlterModelOptions(
name='user',
options={'default_permissions': (), 'permissions': [('full', '管理个人信息'), ('vi... | true | true |
1c4a96d25b3a08d0d02147c25f00e9fdc0faa420 | 1,458 | py | Python | ca_qc_laval/people.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | null | null | null | ca_qc_laval/people.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | null | null | null | ca_qc_laval/people.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | null | null | null | # coding: utf-8
from utils import CSVScraper
class LavalPersonScraper(CSVScraper):
# https://www.donneesquebec.ca/recherche/fr/dataset/liste-des-elus
csv_url = 'https://www.donneesquebec.ca/recherche/dataset/8fe69713-fade-4751-a0b4-7e57a81886b1/resource/bb38e19e-26ab-495c-a0f7-ed6b3268b6e6/download/cusersapp.... | 41.657143 | 245 | 0.620027 |
from utils import CSVScraper
class LavalPersonScraper(CSVScraper):
csv_url = 'https://www.donneesquebec.ca/recherche/dataset/8fe69713-fade-4751-a0b4-7e57a81886b1/resource/bb38e19e-26ab-495c-a0f7-ed6b3268b6e6/download/cusersapp.netappdatalocaltemp288c1490-df30-472a-8170-dd06728f449alistedeselus2013-2017.csv'... | true | true |
1c4a970d54f96d0345653b8eb6c51e13009e1d1c | 414 | py | Python | migrations/versions/384da3b88896_new_contact_email.py | clld/waab | 9693da8887cf8498a47bc41250a2a048595f89f3 | [
"Apache-2.0"
] | 2 | 2015-05-11T13:29:04.000Z | 2017-12-23T04:15:02.000Z | migrations/versions/384da3b88896_new_contact_email.py | clld/waab | 9693da8887cf8498a47bc41250a2a048595f89f3 | [
"Apache-2.0"
] | null | null | null | migrations/versions/384da3b88896_new_contact_email.py | clld/waab | 9693da8887cf8498a47bc41250a2a048595f89f3 | [
"Apache-2.0"
] | 1 | 2015-12-06T22:03:18.000Z | 2015-12-06T22:03:18.000Z | """new contact email
Revision ID: 384da3b88896
Revises: 55912b4a9d56
Create Date: 2015-12-09 11:35:03.872107
"""
# revision identifiers, used by Alembic.
revision = '384da3b88896'
down_revision = '55912b4a9d56'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
... | 16.56 | 67 | 0.736715 |
revision = '384da3b88896'
down_revision = '55912b4a9d56'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("update dataset set contact = 'f.c.seifart@uva.nl'")
def downgrade():
pass
| true | true |
1c4a978548c2fd3c6dc15d9d6849941890ca2470 | 1,984 | py | Python | COS498_FinalPrj/extr_pdf.py | melkimble/COS498 | c09ab1ee61f46ebd7b8b9a645787e474df62c3e2 | [
"MIT"
] | null | null | null | COS498_FinalPrj/extr_pdf.py | melkimble/COS498 | c09ab1ee61f46ebd7b8b9a645787e474df62c3e2 | [
"MIT"
] | null | null | null | COS498_FinalPrj/extr_pdf.py | melkimble/COS498 | c09ab1ee61f46ebd7b8b9a645787e474df62c3e2 | [
"MIT"
] | null | null | null | '''
https://stackoverflow.com/questions/26494211/extracting-text-from-a-pdf-file-using-pdfminer-in-python
https://github.com/pdfminer/pdfminer.six
'''
import io
import os
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter
from pdfminer.layout import LAPa... | 32 | 152 | 0.634073 |
import io
import os
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
def convert_pdf_to_txt(path):
rsrcmgr = PDFResourceManager()
retstr = io.StringIO()
codec = 'utf... | true | true |
1c4a97869018cd998d4a5dc0c14d4c8520f52232 | 851 | py | Python | my_boilerplate_django_admin/core/helpers/string.py | diegoMasin/my-boilerplate-djangoadmin | ef84516957b4742a8459519ace15e37107691456 | [
"MIT"
] | null | null | null | my_boilerplate_django_admin/core/helpers/string.py | diegoMasin/my-boilerplate-djangoadmin | ef84516957b4742a8459519ace15e37107691456 | [
"MIT"
] | null | null | null | my_boilerplate_django_admin/core/helpers/string.py | diegoMasin/my-boilerplate-djangoadmin | ef84516957b4742a8459519ace15e37107691456 | [
"MIT"
] | null | null | null | def is_cpf(cpf):
# Obtém apenas os números do CPF, ignorando pontuações
numbers = [int(digit) for digit in cpf if digit.isdigit()]
# Verifica se o CPF possui 11 números:
if len(numbers) != 11:
return False
# Verifica se todos os números são repetidos
if len(list(dict.fromkeys(numbers))... | 32.730769 | 81 | 0.642773 | def is_cpf(cpf):
numbers = [int(digit) for digit in cpf if digit.isdigit()]
if len(numbers) != 11:
return False
if len(list(dict.fromkeys(numbers))) == 1:
return False
sum_of_products = sum(a * b for a, b in zip(numbers[0:9], range(10, 1, -1)))
expected_digit =... | true | true |
1c4a980951b00ae54b20a33ead879e7bc50123b1 | 1,172 | py | Python | opentech/settings/production.py | JakabGy/hypha | 32634080ba1cb369f07f27f6616041e4eca8dbf2 | [
"BSD-3-Clause"
] | null | null | null | opentech/settings/production.py | JakabGy/hypha | 32634080ba1cb369f07f27f6616041e4eca8dbf2 | [
"BSD-3-Clause"
] | null | null | null | opentech/settings/production.py | JakabGy/hypha | 32634080ba1cb369f07f27f6616041e4eca8dbf2 | [
"BSD-3-Clause"
] | null | null | null | import os
from .base import * # noqa
# Disable debug mode
DEBUG = False
# Configuration from environment variables
env = os.environ.copy()
# Alternatively, you can set these in a local.py file on the server
try:
from .local import * # noqa
except ImportError:
pass
# Mailgun configuration.
if 'MAILGUN_AP... | 27.904762 | 85 | 0.716724 | import os
from .base import *
DEBUG = False
env = os.environ.copy()
try:
from .local import *
except ImportError:
pass
if 'MAILGUN_API_KEY' in env:
EMAIL_BACKEND = 'anymail.backends.mailgun.EmailBackend'
ANYMAIL = {
"MAILGUN_API_KEY": env['MAILGUN_API_KEY'],
"MAILGUN_SENDER... | true | true |
1c4a9a3776b6c9427c9e3dbf1a0cdddedadfcf4c | 1,811 | py | Python | setup.py | mcanu/django-jstemplate | 9af1e22681a318d077f4908b5c92d901e163772f | [
"BSD-3-Clause"
] | 11 | 2015-04-02T00:24:05.000Z | 2020-08-13T01:57:57.000Z | setup.py | mcanu/django-jstemplate | 9af1e22681a318d077f4908b5c92d901e163772f | [
"BSD-3-Clause"
] | 7 | 2015-03-03T09:54:34.000Z | 2021-04-04T14:35:03.000Z | setup.py | mcanu/django-jstemplate | 9af1e22681a318d077f4908b5c92d901e163772f | [
"BSD-3-Clause"
] | 8 | 2015-01-01T18:56:32.000Z | 2019-05-07T18:23:04.000Z | from os.path import join, dirname, abspath
from setuptools import setup, find_packages
here = dirname(abspath(__file__))
long_description = (open(join(here, "README.rst")).read() + "\n\n" +
open(join(here, "CHANGES.rst")).read() + "\n\n" +
open(join(here, "TODO.rst")).read())
... | 34.169811 | 120 | 0.595803 | from os.path import join, dirname, abspath
from setuptools import setup, find_packages
here = dirname(abspath(__file__))
long_description = (open(join(here, "README.rst")).read() + "\n\n" +
open(join(here, "CHANGES.rst")).read() + "\n\n" +
open(join(here, "TODO.rst")).read())
... | true | true |
1c4a9b7da7a8569e9efe0ece18d83db13ce8a2ef | 16,231 | py | Python | models/resnet.py | zyyhhxx/convNet.pytorch | 85f65f80b6d75810077c54bd3a8c9094cc2a26f9 | [
"MIT"
] | 2 | 2020-07-02T14:21:01.000Z | 2021-01-04T01:52:09.000Z | models/resnet.py | zyyhhxx/convNet.pytorch | 85f65f80b6d75810077c54bd3a8c9094cc2a26f9 | [
"MIT"
] | null | null | null | models/resnet.py | zyyhhxx/convNet.pytorch | 85f65f80b6d75810077c54bd3a8c9094cc2a26f9 | [
"MIT"
] | 1 | 2019-10-02T07:19:26.000Z | 2019-10-02T07:19:26.000Z | import torch
import torch.nn as nn
import torchvision.transforms as transforms
import math
from .modules.se import SEBlock
from .modules.checkpoint import CheckpointModule
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from utils.mixup import MixUp
__all__ = ['resnet... | 38.462085 | 152 | 0.566385 | import torch
import torch.nn as nn
import torchvision.transforms as transforms
import math
from .modules.se import SEBlock
from .modules.checkpoint import CheckpointModule
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from utils.mixup import MixUp
__all__ = ['resnet... | true | true |
1c4a9d5d339e6b97fd46492825604da475aeac37 | 6,136 | py | Python | lib/lib/Cryptodome/SelfTest/Cipher/test_Blowfish.py | Zhangxi-Lam/alfred-google-keep | 9f8f891e103f33a7e749907fe5cbfcf779131c8e | [
"MIT"
] | 2,557 | 2016-07-19T22:20:45.000Z | 2022-01-25T10:53:35.000Z | lib/lib/Cryptodome/SelfTest/Cipher/test_Blowfish.py | Zhangxi-Lam/alfred-google-keep | 9f8f891e103f33a7e749907fe5cbfcf779131c8e | [
"MIT"
] | 1,360 | 2016-07-20T02:06:42.000Z | 2021-07-27T12:46:40.000Z | lib/lib/Cryptodome/SelfTest/Cipher/test_Blowfish.py | Zhangxi-Lam/alfred-google-keep | 9f8f891e103f33a7e749907fe5cbfcf779131c8e | [
"MIT"
] | 607 | 2016-07-20T03:34:04.000Z | 2022-01-05T14:57:09.000Z | # -*- coding: utf-8 -*-
#
# SelfTest/Cipher/test_Blowfish.py: Self-test for the Blowfish cipher
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that d... | 49.088 | 79 | 0.71105 |
import unittest
from Cryptodome.Util.py3compat import bchr
from Cryptodome.Cipher import Blowfish
test_data = [
('0000000000000000', '4ef997456198dd78', '0000000000000000'),
('ffffffffffffffff', '51866fd5b85ecb8a', 'ffffffffffffffff'),
('1000000000000001', '7d856f9a613063f2... | true | true |
1c4a9dab8a4dee81d5f84fa57fcef0380cf1a15a | 5,951 | py | Python | google/auth/crypt/_python_rsa.py | renovate-bot/google-auth-library-python | a4cf9b1bf461a3fb35432e42f4d8bc1a8ff7bc97 | [
"Apache-2.0"
] | 4 | 2021-10-20T12:39:09.000Z | 2022-02-26T15:02:08.000Z | google/auth/crypt/_python_rsa.py | renovate-bot/google-auth-library-python | a4cf9b1bf461a3fb35432e42f4d8bc1a8ff7bc97 | [
"Apache-2.0"
] | null | null | null | google/auth/crypt/_python_rsa.py | renovate-bot/google-auth-library-python | a4cf9b1bf461a3fb35432e42f4d8bc1a8ff7bc97 | [
"Apache-2.0"
] | 1 | 2021-10-20T13:47:10.000Z | 2021-10-20T13:47:10.000Z | # Copyright 2016 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.005714 | 84 | 0.65384 |
from __future__ import absolute_import
import io
from pyasn1.codec.der import decoder
from pyasn1_modules import pem
from pyasn1_modules.rfc2459 import Certificate
from pyasn1_modules.rfc5208 import PrivateKeyInfo
import rsa
from google.auth import _helpers
from google.auth.crypt import base
_POW2 = ... | true | true |
1c4a9db4d968f272c0318dc71a033cc4af40f6ef | 6,241 | py | Python | biotrees/shape/__init__.py | bielr/biotrees | dc588888cec557d9522fc6faaa560488a95c946d | [
"Apache-2.0"
] | null | null | null | biotrees/shape/__init__.py | bielr/biotrees | dc588888cec557d9522fc6faaa560488a95c946d | [
"Apache-2.0"
] | null | null | null | biotrees/shape/__init__.py | bielr/biotrees | dc588888cec557d9522fc6faaa560488a95c946d | [
"Apache-2.0"
] | null | null | null | from biotrees.util import iter_merge, skip_nth
"""
A `Shape` represents a topological tree. The data structure implemented here is of recursive type: a `Shape` can be
either a leaf or a list of `Shape` objects. Leaves are not distinguishable, but we know that they are leaves.
We choose a sorted shape to be the class r... | 28.239819 | 121 | 0.577792 | from biotrees.util import iter_merge, skip_nth
__all__ = ['Shape']
class Shape(object):
LEAF = None
CHERRY = None
def __init__(self, children=None):
assert children is None or len(children) > 0
self.children = children
def is_leaf(self):
return self.children is None
... | true | true |
1c4a9e04658f85d01a0faf1688239f940ae2016c | 552 | py | Python | scripts/subscribe_kinect.py | hubertbraszko/follow-marker | 2c168c2c9705fc2076712e20c62e05a439df6cf8 | [
"BSD-3-Clause"
] | null | null | null | scripts/subscribe_kinect.py | hubertbraszko/follow-marker | 2c168c2c9705fc2076712e20c62e05a439df6cf8 | [
"BSD-3-Clause"
] | null | null | null | scripts/subscribe_kinect.py | hubertbraszko/follow-marker | 2c168c2c9705fc2076712e20c62e05a439df6cf8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
import sys
import cv2
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
def process_image(msg):
bridge = CvBridge()
img = bridge.imgmsg_to_cv2(msg, "bgr8")
cv2.imshow("image",img)
cv2.waitKey(50)
if __name__ == '__main__... | 25.090909 | 78 | 0.706522 |
import rospy
from std_msgs.msg import String
import sys
import cv2
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
def process_image(msg):
bridge = CvBridge()
img = bridge.imgmsg_to_cv2(msg, "bgr8")
cv2.imshow("image",img)
cv2.waitKey(50)
if __name__ == '__main__':
while not rosp... | true | true |
1c4a9e3834a7eccc3c3b7c6fddcede09ac3c225d | 4,372 | py | Python | contrib/seeds/generate-seeds.py | pniwre/Sato_origin | 5accbe690dbd2cae305cc7120a4824243f89701c | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | pniwre/Sato_origin | 5accbe690dbd2cae305cc7120a4824243f89701c | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | pniwre/Sato_origin | 5accbe690dbd2cae305cc7120a4824243f89701c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.453237 | 98 | 0.579597 |
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.onion'):
vchAddr = b32decode(addr[0:... | true | true |
1c4a9e6deb4f7f104b05973b61354f9580522564 | 460 | py | Python | bin/rehex.py | CryptoDEX/sentinel | 88ac417f34c4f42670298abf3f252ab8652b7887 | [
"MIT"
] | null | null | null | bin/rehex.py | CryptoDEX/sentinel | 88ac417f34c4f42670298abf3f252ab8652b7887 | [
"MIT"
] | null | null | null | bin/rehex.py | CryptoDEX/sentinel | 88ac417f34c4f42670298abf3f252ab8652b7887 | [
"MIT"
] | null | null | null | import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import cryptodexlib
# ============================================================================
usage = "%s <hex>" % sys.argv[0]
... | 20.909091 | 84 | 0.591304 | import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import cryptodexlib
usage = "%s <hex>" % sys.argv[0]
obj = None
if len(sys.argv) < 2:
print(usage)
sys.exit(1)
else:
o... | true | true |
1c4a9e7ab48b06150d1646076a4a5a0117b6efcc | 2,186 | py | Python | utils/modify_ravdess.py | sahiljuneja/kaggle-ctds | caac226f2c5d33b6d324c5cf33a777758b9163d1 | [
"CC-BY-4.0"
] | null | null | null | utils/modify_ravdess.py | sahiljuneja/kaggle-ctds | caac226f2c5d33b6d324c5cf33a777758b9163d1 | [
"CC-BY-4.0"
] | null | null | null | utils/modify_ravdess.py | sahiljuneja/kaggle-ctds | caac226f2c5d33b6d324c5cf33a777758b9163d1 | [
"CC-BY-4.0"
] | null | null | null | import re
import os
import argparse
import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
def modify_data(input_path, save_path, dir_dict):
path = os.listdir(input_path)
for folders in path:
folders = os.path.sep.join([input_path, folders])
... | 31.681159 | 98 | 0.578225 | import re
import os
import argparse
import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
def modify_data(input_path, save_path, dir_dict):
path = os.listdir(input_path)
for folders in path:
folders = os.path.sep.join([input_path, folders])
... | true | true |
1c4aa08fdf2f3f6ab9a83890a7c17c9b27fbc3ac | 6,062 | py | Python | dyne/adjacency/coherence.py | akhambhati/dyne2 | d2f050b3d14ef429fc9c52821e87f1c9a52a521d | [
"BSD-3-Clause"
] | 7 | 2015-01-11T03:57:19.000Z | 2020-07-11T12:05:57.000Z | dyne/adjacency/coherence.py | akhambhati/dyne | d2f050b3d14ef429fc9c52821e87f1c9a52a521d | [
"BSD-3-Clause"
] | null | null | null | dyne/adjacency/coherence.py | akhambhati/dyne | d2f050b3d14ef429fc9c52821e87f1c9a52a521d | [
"BSD-3-Clause"
] | null | null | null | """
Coherence pipes for quantifying signal similarity (i.e. connectivity)
Created by: Ankit Khambhati
Change Log
----------
2016/03/06 - Implemented WelchCoh and MTCoh pipes
"""
from __future__ import division
import numpy as np
from mtspec import mt_coherence, mtspec
from scipy.signal import coherence
import matplo... | 32.591398 | 81 | 0.54421 |
from __future__ import division
import numpy as np
from mtspec import mt_coherence, mtspec
from scipy.signal import coherence
import matplotlib.pyplot as plt
from ..errors import check_type
from ..base import AdjacencyPipe
class WelchCoh(AdjacencyPipe):
def __init__(self, window, secperseg, pctoverlap, cf):
... | true | true |
1c4aa09a56123eb89175e65ef12cd083888a57e1 | 3,456 | py | Python | generated-libraries/python/netapp/iscsi/iscsi_security_entry_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | 2 | 2017-03-28T15:31:26.000Z | 2018-08-16T22:15:18.000Z | generated-libraries/python/netapp/iscsi/iscsi_security_entry_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | generated-libraries/python/netapp/iscsi/iscsi_security_entry_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | from netapp.netapp_object import NetAppObject
class IscsiSecurityEntryInfo(NetAppObject):
"""
Information about a single authentication entry.
"""
_user_name = None
@property
def user_name(self):
"""
Inbound CHAP user name, returned only if auth-type is CHAP.
"""
... | 30.052174 | 100 | 0.575521 | from netapp.netapp_object import NetAppObject
class IscsiSecurityEntryInfo(NetAppObject):
_user_name = None
@property
def user_name(self):
return self._user_name
@user_name.setter
def user_name(self, val):
if val != None:
self.validate('user_name', val)
self... | true | true |
1c4aa18bf302180255957ac3409b0d4e79760721 | 6,458 | py | Python | scripts/classification/PointNet/run_pointnet_classification.py | amiralansary/BrainSurfaceTK | 17e3ef5e1c5d6e1a75293fbe031977ec3fbe0fef | [
"MIT"
] | 7 | 2020-08-04T19:27:33.000Z | 2022-01-28T18:00:21.000Z | scripts/classification/PointNet/run_pointnet_classification.py | amiralansary/BrainSurfaceTK | 17e3ef5e1c5d6e1a75293fbe031977ec3fbe0fef | [
"MIT"
] | null | null | null | scripts/classification/PointNet/run_pointnet_classification.py | amiralansary/BrainSurfaceTK | 17e3ef5e1c5d6e1a75293fbe031977ec3fbe0fef | [
"MIT"
] | 3 | 2020-12-31T17:26:21.000Z | 2021-02-11T19:24:56.000Z | import os.path as osp
PATH_TO_ROOT = osp.join(osp.dirname(osp.realpath(__file__)), '..', '..')
import sys
sys.path.append(PATH_TO_ROOT)
import os
import time
import pickle
import csv
import torch
from torch.optim.lr_scheduler import StepLR
from torch.utils.tensorboard import SummaryWriter
from models.pointnet.src.... | 36.485876 | 114 | 0.562713 | import os.path as osp
PATH_TO_ROOT = osp.join(osp.dirname(osp.realpath(__file__)), '..', '..')
import sys
sys.path.append(PATH_TO_ROOT)
import os
import time
import pickle
import csv
import torch
from torch.optim.lr_scheduler import StepLR
from torch.utils.tensorboard import SummaryWriter
from models.pointnet.src.... | true | true |
1c4aa2032c5c511a7b7e429659929c7288dac84f | 360 | py | Python | exercises/ja/solution_03_16_02.py | YanaPalacheva/spacy-course | 59975f7348a601532303be91474d75d02d0540ef | [
"MIT"
] | 1 | 2021-12-30T06:40:11.000Z | 2021-12-30T06:40:11.000Z | exercises/ja/solution_03_16_02.py | YanaPalacheva/spacy-course | 59975f7348a601532303be91474d75d02d0540ef | [
"MIT"
] | null | null | null | exercises/ja/solution_03_16_02.py | YanaPalacheva/spacy-course | 59975f7348a601532303be91474d75d02d0540ef | [
"MIT"
] | 1 | 2020-06-08T13:26:06.000Z | 2020-06-08T13:26:06.000Z | import spacy
nlp = spacy.load("en_core_web_sm")
text = (
"Chick-fil-A is an American fast food restaurant chain headquartered in "
"the city of College Park, Georgia, specializing in chicken sandwiches."
)
# taggerとparserを無効化する
with nlp.disable_pipes("tagger", "parser"):
# テキストを処理する
doc = nlp(text)
... | 24 | 77 | 0.708333 | import spacy
nlp = spacy.load("en_core_web_sm")
text = (
"Chick-fil-A is an American fast food restaurant chain headquartered in "
"the city of College Park, Georgia, specializing in chicken sandwiches."
)
with nlp.disable_pipes("tagger", "parser"):
doc = nlp(text)
print(doc.ents)
| true | true |
1c4aa2704b6464d4b7b602bb5e3d69e965b711b1 | 3,835 | py | Python | src/python/Utils/MemoryCache.py | tslazarova/WMCore | a09e2aefe700fb9b0d12b9f7089b21bde5a5bd62 | [
"Apache-2.0"
] | 1 | 2015-02-05T13:43:46.000Z | 2015-02-05T13:43:46.000Z | src/python/Utils/MemoryCache.py | tslazarova/WMCore | a09e2aefe700fb9b0d12b9f7089b21bde5a5bd62 | [
"Apache-2.0"
] | null | null | null | src/python/Utils/MemoryCache.py | tslazarova/WMCore | a09e2aefe700fb9b0d12b9f7089b21bde5a5bd62 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple in-memory and non-thread safe cache.
Note that this module does not support home-made object types, since there is
an explicit data type check when adding a new item to the cache.
It raises a TypeError exception if the cache data type chagens;
or if the user tri... | 39.132653 | 114 | 0.642503 |
from __future__ import (print_function, division)
from builtins import object
from time import time
class MemoryCacheException(Exception):
def __init__(self, message):
super(MemoryCacheException, self).__init__(message)
class MemoryCache(object):
__slots__ = ["lastUpdate", "expiration", "_cache"... | true | true |
1c4aa339091f326094a1c407dad313c0bd77f65a | 52,647 | py | Python | ryu/services/protocols/bgp/bgpspeaker.py | starlingx-staging/stx-ryu | e73cdeab37d4890138f9c48bf41cf08974ab2146 | [
"Apache-2.0"
] | null | null | null | ryu/services/protocols/bgp/bgpspeaker.py | starlingx-staging/stx-ryu | e73cdeab37d4890138f9c48bf41cf08974ab2146 | [
"Apache-2.0"
] | null | null | null | ryu/services/protocols/bgp/bgpspeaker.py | starlingx-staging/stx-ryu | e73cdeab37d4890138f9c48bf41cf08974ab2146 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 38.428467 | 87 | 0.637757 |
import netaddr
from ryu.lib import hub
from ryu.lib.packet.bgp import (
BGPFlowSpecTrafficActionCommunity,
BGPFlowSpecVlanActionCommunity,
BGPFlowSpecTPIDActionCommunity,
)
from ryu.services.protocols.bgp.core_manager import CORE_MANAGER
from ryu.services.protocols.bgp.signals.emit import Bg... | true | true |
1c4aa49b54346a99f2e75e366d65a02354ae6854 | 24,529 | py | Python | neutron/agent/linux/ip_lib.py | insequent/neutron | 2b1c4f121e3e8ba1c5eb2ba6661bf6326e1507c5 | [
"Apache-2.0"
] | null | null | null | neutron/agent/linux/ip_lib.py | insequent/neutron | 2b1c4f121e3e8ba1c5eb2ba6661bf6326e1507c5 | [
"Apache-2.0"
] | null | null | null | neutron/agent/linux/ip_lib.py | insequent/neutron | 2b1c4f121e3e8ba1c5eb2ba6661bf6326e1507c5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# 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 requ... | 34.068056 | 79 | 0.555669 |
import eventlet
import netaddr
import os
from oslo_config import cfg
from oslo_log import log as logging
from neutron.agent.linux import utils
from neutron.common import exceptions
from neutron.i18n import _LE
LOG = logging.getLogger(__name__)
OPTS = [
cfg.BoolOpt('ip_lib_force_root',
... | true | true |
1c4aa4e22c898d243a62cb37a4da258b2d74fcfd | 1,829 | py | Python | imageRead/aluno/models.py | Sou-eu-Miguel/reply-card | d2b8716c02e593d627c6d88c7252c4abc897532b | [
"Apache-2.0"
] | 1 | 2018-12-12T21:36:10.000Z | 2018-12-12T21:36:10.000Z | imageRead/aluno/models.py | LucasLimakxy/reply-card | d2b8716c02e593d627c6d88c7252c4abc897532b | [
"Apache-2.0"
] | 6 | 2021-02-02T22:56:52.000Z | 2022-03-12T00:43:59.000Z | imageRead/aluno/models.py | Sou-eu-Miguel/reply-card | d2b8716c02e593d627c6d88c7252c4abc897532b | [
"Apache-2.0"
] | 1 | 2018-12-13T20:58:16.000Z | 2018-12-13T20:58:16.000Z | from decimal import Decimal
from django.core.validators import MinValueValidator
from django.db import models
from django.urls import reverse
from ..turma.models import Turma, Sessao
# Create your models here.
class Aluno(models.Model):
nome = models.CharField('Nome', max_length=60)
matricula = mod... | 38.104167 | 140 | 0.65883 | from decimal import Decimal
from django.core.validators import MinValueValidator
from django.db import models
from django.urls import reverse
from ..turma.models import Turma, Sessao
class Aluno(models.Model):
nome = models.CharField('Nome', max_length=60)
matricula = models.CharField('matricula',... | true | true |
1c4aa98aa4f83548da28cc3f7672a27cd6f68e46 | 137 | py | Python | buildscripts/condarecipe/run_test.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | null | null | null | buildscripts/condarecipe/run_test.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | null | null | null | buildscripts/condarecipe/run_test.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | null | null | null | import sys
import numba
if not numba.test():
print("Test failed")
sys.exit(1)
print('numba.__version__: %s' % numba.__version__)
| 19.571429 | 50 | 0.693431 | import sys
import numba
if not numba.test():
print("Test failed")
sys.exit(1)
print('numba.__version__: %s' % numba.__version__)
| true | true |
1c4aa9eedb3b1c6e2e7a3e567eb7ad686eaa3237 | 95 | py | Python | src/learndash/api_resources/__init__.py | MarkMacDon/learndash-python | a3fbfc45567a524b80c732d735f2ae101119f2e4 | [
"MIT"
] | null | null | null | src/learndash/api_resources/__init__.py | MarkMacDon/learndash-python | a3fbfc45567a524b80c732d735f2ae101119f2e4 | [
"MIT"
] | 1 | 2021-05-06T19:01:24.000Z | 2021-05-06T19:01:24.000Z | src/learndash/api_resources/__init__.py | MarkMacDon/learndash-python | a3fbfc45567a524b80c732d735f2ae101119f2e4 | [
"MIT"
] | 2 | 2021-05-05T22:45:04.000Z | 2021-07-24T08:47:02.000Z | from learndash.api_resources.course import Course
from learndash.api_resources.user import User | 47.5 | 49 | 0.884211 | from learndash.api_resources.course import Course
from learndash.api_resources.user import User | true | true |
1c4aab8843fa67ec04a2e6b2e8f6b2aacade81f0 | 1,013 | py | Python | test/test_allele_reads.py | carnivorouspeanut/isovar_comp | 74fcc12ef52d08eb4cfa85bdcda8903970babbda | [
"Apache-2.0"
] | null | null | null | test/test_allele_reads.py | carnivorouspeanut/isovar_comp | 74fcc12ef52d08eb4cfa85bdcda8903970babbda | [
"Apache-2.0"
] | null | null | null | test/test_allele_reads.py | carnivorouspeanut/isovar_comp | 74fcc12ef52d08eb4cfa85bdcda8903970babbda | [
"Apache-2.0"
] | null | null | null |
from isovar.allele_reads import AlleleRead
from isovar.locus_reads import LocusRead
from nose.tools import eq_
def make_read_at_locus(prefix, alt, suffix, base_quality=30, name="dummy"):
dummy_sequence = prefix + alt + suffix
return LocusRead(
name="dummy",
sequence=dummy_sequence,
ref... | 38.961538 | 77 | 0.740375 |
from isovar.allele_reads import AlleleRead
from isovar.locus_reads import LocusRead
from nose.tools import eq_
def make_read_at_locus(prefix, alt, suffix, base_quality=30, name="dummy"):
dummy_sequence = prefix + alt + suffix
return LocusRead(
name="dummy",
sequence=dummy_sequence,
ref... | true | true |
1c4aad7d61342eb43c7ab5a6792d71b925c81eb8 | 4,918 | py | Python | models/pointnet_cls_rot_transfer.py | OmidPoursaeed/Self_supervised_Learning_Point_Clouds | 4f684cc761347f329eb967823f80522a8a3aedc0 | [
"MIT"
] | 11 | 2020-12-16T16:27:36.000Z | 2021-12-01T04:07:56.000Z | models/pointnet_cls_rot_transfer.py | OmidPoursaeed/Self_supervised_Learning_Point_Clouds | 4f684cc761347f329eb967823f80522a8a3aedc0 | [
"MIT"
] | 2 | 2021-02-09T11:35:01.000Z | 2021-08-06T01:39:42.000Z | models/pointnet_cls_rot_transfer.py | OmidPoursaeed/Self_supervised_Learning_Point_Clouds | 4f684cc761347f329eb967823f80522a8a3aedc0 | [
"MIT"
] | 1 | 2021-08-05T14:07:51.000Z | 2021-08-05T14:07:51.000Z | import tensorflow as tf
import numpy as np
import math
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tf_util
from transform_nets import input_transform_net, feature_transform_net
def placeholder_inputs(bat... | 44.709091 | 135 | 0.614884 | import tensorflow as tf
import numpy as np
import math
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tf_util
from transform_nets import input_transform_net, feature_transform_net
def placeholder_inputs(bat... | true | true |
1c4aae5426137d7eb9f5b72856c25b9d57d53549 | 5,219 | py | Python | seaborn/algorithms.py | jwillis0720/seaborn | 0dc93d01c78370e91ebdf72c888719fbbc6d1085 | [
"BSD-3-Clause"
] | null | null | null | seaborn/algorithms.py | jwillis0720/seaborn | 0dc93d01c78370e91ebdf72c888719fbbc6d1085 | [
"BSD-3-Clause"
] | null | null | null | seaborn/algorithms.py | jwillis0720/seaborn | 0dc93d01c78370e91ebdf72c888719fbbc6d1085 | [
"BSD-3-Clause"
] | null | null | null | """Algorithms to support fitting routines in seaborn plotting functions."""
import numbers
import numpy as np
import warnings
from math import sqrt
def wls_confidence_interval(data, z=1.96):
"""Calculate the Wilson score confidence interval for a data set.
data : array of 1-dimensional data, 1's or 0's
z... | 34.335526 | 95 | 0.634796 | import numbers
import numpy as np
import warnings
from math import sqrt
def wls_confidence_interval(data, z=1.96):
n = len(data)
p = len([i for i in data if i]) / n
denominator = 1 + z ** 2 / n
centre_adjusted_probability = p + z * z / (2 * n)
adjusted_standard_deviation = sqrt((p * (1 - p)... | true | true |
1c4aaf705158fbe0e91ecb297f20bdbdacfd197c | 95 | py | Python | siga/prospeccao/apps.py | JenniferAmaral/DjangoSpike | 768237bb0f3cffe7bbdbcab38a8bae6faa78e495 | [
"Apache-2.0"
] | null | null | null | siga/prospeccao/apps.py | JenniferAmaral/DjangoSpike | 768237bb0f3cffe7bbdbcab38a8bae6faa78e495 | [
"Apache-2.0"
] | 2 | 2021-03-19T03:21:17.000Z | 2021-03-30T13:24:07.000Z | siga/prospeccao/apps.py | JenniferAmaral/DjangoSpike | 768237bb0f3cffe7bbdbcab38a8bae6faa78e495 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class ProspeccaoConfig(AppConfig):
name = 'prospeccao'
| 15.833333 | 34 | 0.768421 | from django.apps import AppConfig
class ProspeccaoConfig(AppConfig):
name = 'prospeccao'
| true | true |
1c4aaf84e496d0feb65c92950f3a798d787c4fe0 | 4,776 | py | Python | app/storage.py | JB-Tellez/flask-hello-world | 7fce8dea357a847c90bce095b2bfc43036903e4d | [
"MIT"
] | null | null | null | app/storage.py | JB-Tellez/flask-hello-world | 7fce8dea357a847c90bce095b2bfc43036903e4d | [
"MIT"
] | null | null | null | app/storage.py | JB-Tellez/flask-hello-world | 7fce8dea357a847c90bce095b2bfc43036903e4d | [
"MIT"
] | null | null | null | from flask import Flask, jsonify, request
from flask_cors import CORS
from os import environ
import requests
from datetime import datetime
def get_location():
query = request.args.get('data')
api_key = environ.get('GEOCODE_API_KEY')
URL = f'https://maps.googleapis.com/maps/api/geocode/json?address={query... | 24.618557 | 119 | 0.629606 | from flask import Flask, jsonify, request
from flask_cors import CORS
from os import environ
import requests
from datetime import datetime
def get_location():
query = request.args.get('data')
api_key = environ.get('GEOCODE_API_KEY')
URL = f'https://maps.googleapis.com/maps/api/geocode/json?address={query... | true | true |
1c4ab0a1b89ee3ce8f7c20af7b3a0cf0e50ea511 | 1,530 | py | Python | server/models/portfolio/risk.py | lluo5779/Robo-Adviser | 43aa4b73bfc96e55ed664328330a930975596124 | [
"MIT"
] | null | null | null | server/models/portfolio/risk.py | lluo5779/Robo-Adviser | 43aa4b73bfc96e55ed664328330a930975596124 | [
"MIT"
] | 3 | 2021-03-31T19:24:03.000Z | 2021-12-13T20:26:39.000Z | server/models/portfolio/risk.py | lluo5779/Robo-Adviser | 43aa4b73bfc96e55ed664328330a930975596124 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
def risk_prefs(horizon, aversion, cardinal, return_target, l, mu_bl1, mu_bl2, cov_bl1):
if horizon is None:
horizon = 10
alpha = 0.05
safe_target = float(((mu_bl1 + mu_bl2) / 2).mean())
# set the variances for the first period estimates
vars = pd.... | 28.333333 | 143 | 0.594118 | import numpy as np
import pandas as pd
def risk_prefs(horizon, aversion, cardinal, return_target, l, mu_bl1, mu_bl2, cov_bl1):
if horizon is None:
horizon = 10
alpha = 0.05
safe_target = float(((mu_bl1 + mu_bl2) / 2).mean())
vars = pd.DataFrame(np.diag(cov_bl1), index=cov_bl1.index)
... | true | true |
1c4ab187d643a0593fe5cdf9d597191769ebd87f | 2,243 | py | Python | scripts/recalc_afacts.py | EvictionLab/eviction-lab-etl | d94a7e52de8890c9371518b5020d1a6aa3a5fc2e | [
"MIT"
] | 9 | 2018-04-07T17:52:49.000Z | 2020-07-06T01:52:21.000Z | scripts/recalc_afacts.py | EvictionLab/eviction-lab-etl | d94a7e52de8890c9371518b5020d1a6aa3a5fc2e | [
"MIT"
] | 56 | 2017-09-11T21:19:13.000Z | 2020-01-06T18:57:23.000Z | scripts/recalc_afacts.py | EvictionLab/eviction-lab-etl | d94a7e52de8890c9371518b5020d1a6aa3a5fc2e | [
"MIT"
] | 1 | 2019-11-04T18:56:45.000Z | 2019-11-04T18:56:45.000Z | """
Recalculates allocation factors for a given geography level and geographic
correspondence file.
Arguments
----------
argv[1] : str
The geography level to create weights for (block-groups or tracts)
argv[2] : str
The file path to the geography correspondence file
generated from http://mcdc.missouri.edu... | 32.042857 | 89 | 0.628622 |
import sys
import pandas as pd
if __name__ == '__main__':
geocorr_df = pd.read_csv(
sys.argv[2],
dtype={
'county': 'object',
'tract': 'object',
'bg': 'object',
'block': 'object',
'pop2k': 'float64'
})
geocorr_d... | true | true |
1c4ab1e64362cf00e8647c93dc60b6ca75d9cbb0 | 4,371 | py | Python | ui/prefs.py | bfrobin446/openfrontier | bde74dc82be858cd0b0bc64ddfe76020d1179a9c | [
"MIT"
] | null | null | null | ui/prefs.py | bfrobin446/openfrontier | bde74dc82be858cd0b0bc64ddfe76020d1179a9c | [
"MIT"
] | null | null | null | ui/prefs.py | bfrobin446/openfrontier | bde74dc82be858cd0b0bc64ddfe76020d1179a9c | [
"MIT"
] | null | null | null | from PyQt4.QtCore import *
from PyQt4.QtGui import *
import itertools
from . import colors
from . import keys
from .colorbutton import ColorButton
class KeyPicker(QLineEdit):
keyChanged = pyqtSignal(Qt.Key)
def __init__(self, key=None, parent=None, flags=Qt.Widget, **kwargs):
... | 35.25 | 80 | 0.590254 | from PyQt4.QtCore import *
from PyQt4.QtGui import *
import itertools
from . import colors
from . import keys
from .colorbutton import ColorButton
class KeyPicker(QLineEdit):
keyChanged = pyqtSignal(Qt.Key)
def __init__(self, key=None, parent=None, flags=Qt.Widget, **kwargs):
... | true | true |
1c4ab1eafd7a0741e2d75a3e980b2a4775179a92 | 417 | py | Python | backend/tester1000_dev_23525/wsgi.py | crowdbotics-dev/tester1000-dev-23525 | 46c650bdac998a4df3ee19917a09571ec58c0c68 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/tester1000_dev_23525/wsgi.py | crowdbotics-dev/tester1000-dev-23525 | 46c650bdac998a4df3ee19917a09571ec58c0c68 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/tester1000_dev_23525/wsgi.py | crowdbotics-dev/tester1000-dev-23525 | 46c650bdac998a4df3ee19917a09571ec58c0c68 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for tester1000_dev_23525 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault(... | 24.529412 | 80 | 0.798561 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tester1000_dev_23525.settings')
application = get_wsgi_application()
| true | true |
1c4ab3589fb7396833431a0bdd7613a3be9d614a | 5,648 | py | Python | openstack/tests/unit/cloud/test_qos_rule_type.py | catalinpopc/openstacksdk | adaf758076b0c74cf4bb55e88fdee7072764f5f3 | [
"Apache-2.0"
] | null | null | null | openstack/tests/unit/cloud/test_qos_rule_type.py | catalinpopc/openstacksdk | adaf758076b0c74cf4bb55e88fdee7072764f5f3 | [
"Apache-2.0"
] | null | null | null | openstack/tests/unit/cloud/test_qos_rule_type.py | catalinpopc/openstacksdk | adaf758076b0c74cf4bb55e88fdee7072764f5f3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 OVH SAS
# 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 agreed ... | 37.653333 | 78 | 0.554887 |
from openstack.cloud import exc
from openstack.tests.unit import base
class TestQosRuleType(base.TestCase):
rule_type_name = "bandwidth_limit"
qos_extension = {
"updated": "2015-06-08T10:00:00-00:00",
"name": "Quality of Service",
"links": [],
"alias": "qos",
... | true | true |
1c4ab3b577beb0365924ba95af395d8155ef537a | 1,359 | py | Python | src/niweb/apps/userprofile/views.py | emjemj/ni | a78e6d97d1e4610aad7698c4f0f459221c680b4f | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2018-12-21T09:35:27.000Z | 2019-07-31T18:51:58.000Z | src/niweb/apps/userprofile/views.py | emjemj/ni | a78e6d97d1e4610aad7698c4f0f459221c680b4f | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2019-07-25T07:10:23.000Z | 2021-02-08T09:58:57.000Z | src/niweb/apps/userprofile/views.py | emjemj/ni | a78e6d97d1e4610aad7698c4f0f459221c680b4f | [
"BSD-2-Clause-FreeBSD"
] | 5 | 2019-02-06T12:00:26.000Z | 2021-11-19T14:48:06.000Z | from apps.userprofile.models import UserProfile
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.shortcuts import render, get_object_or_404
from actstream.models import actor_stream
@login_required
def list_userprofiles(requ... | 42.46875 | 101 | 0.743194 | from apps.userprofile.models import UserProfile
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.shortcuts import render, get_object_or_404
from actstream.models import actor_stream
@login_required
def list_userprofiles(requ... | true | true |
1c4ab45c50dc2c8013cb457044e00259c45ba137 | 1,102 | py | Python | app/__init__.py | Shindler7/libpraks | c7d09ef7c485d98e4c1d368ae4ebaf70ef77e410 | [
"BSD-3-Clause"
] | 2 | 2020-04-02T13:35:57.000Z | 2020-08-28T09:21:33.000Z | app/__init__.py | Shindler7/libpraks | c7d09ef7c485d98e4c1d368ae4ebaf70ef77e410 | [
"BSD-3-Clause"
] | 4 | 2020-04-12T17:37:25.000Z | 2022-01-13T02:49:04.000Z | app/__init__.py | Shindler7/libpraks | c7d09ef7c485d98e4c1d368ae4ebaf70ef77e410 | [
"BSD-3-Clause"
] | 4 | 2020-04-01T14:11:50.000Z | 2020-05-10T19:20:03.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import logging
from flask import Flask
from flask_images import Images
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy as SQLA
from flask_sslify import SSLify
from flask_wtf.csrf import CSRFProtect
from flask_c... | 20.407407 | 47 | 0.768603 |
import logging
from flask import Flask
from flask_images import Images
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy as SQLA
from flask_sslify import SSLify
from flask_wtf.csrf import CSRFProtect
from flask_cors import CORS
from config import Config
... | true | true |
1c4ab5d0b3ed0c4de6caa36c5588fd3dd0ac2b72 | 8,052 | py | Python | e2e/test_e2e.py | bentobox-dev/bento-box | 3e10c62f586c1251529e059b6af515d4d03c60e9 | [
"MIT"
] | 1 | 2021-01-02T02:50:15.000Z | 2021-01-02T02:50:15.000Z | e2e/test_e2e.py | joeltio/bento-box | 3e10c62f586c1251529e059b6af515d4d03c60e9 | [
"MIT"
] | 48 | 2020-10-21T07:42:30.000Z | 2021-02-15T19:34:55.000Z | e2e/test_e2e.py | joeltio/bento-box | 3e10c62f586c1251529e059b6af515d4d03c60e9 | [
"MIT"
] | null | null | null | #
# bento-box
# E2E Test
#
import pytest
from git import Repo
from math import cos, sin
from bento import types
from bento.sim import Simulation
from bento.utils import to_yaml_proto
from bento.graph.plotter import Plotter
from bento.spec.ecs import EntityDef, ComponentDef
from bento.example.specs import Velocity, Po... | 31.453125 | 88 | 0.638847 |
import pytest
from git import Repo
from math import cos, sin
from bento import types
from bento.sim import Simulation
from bento.utils import to_yaml_proto
from bento.graph.plotter import Plotter
from bento.spec.ecs import EntityDef, ComponentDef
from bento.example.specs import Velocity, Position
Meta = Compone... | true | true |
1c4ab5ee42184750c6098b8611c188c2f7b936ac | 7,817 | py | Python | lib/python/treadmill/cli/show.py | drienyov/treadmill | ce21537cd9a2fdb0567ac2aa3de1afcb2f6861de | [
"Apache-2.0"
] | 2 | 2017-10-31T18:48:20.000Z | 2018-03-04T20:35:20.000Z | lib/python/treadmill/cli/show.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | lib/python/treadmill/cli/show.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | """Manage Treadmill app manifest.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import click
from six.moves import urllib_parse
from treadmill import cli
from treadmill import restclient
from t... | 32.301653 | 77 | 0.63541 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import click
from six.moves import urllib_parse
from treadmill import cli
from treadmill import restclient
from treadmill import context
from treadmill... | true | true |
1c4ab644d7926e6cc00e6416eef269b9cd3f9640 | 7,055 | py | Python | docs/source/conf.py | dsjoerg/sc2reader | adeb6e3da80e57974b1a29b20e80a02411e693e2 | [
"MIT"
] | 2 | 2016-05-31T14:50:47.000Z | 2021-11-04T20:03:19.000Z | docs/source/conf.py | dsjoerg/sc2reader | adeb6e3da80e57974b1a29b20e80a02411e693e2 | [
"MIT"
] | null | null | null | docs/source/conf.py | dsjoerg/sc2reader | adeb6e3da80e57974b1a29b20e80a02411e693e2 | [
"MIT"
] | 2 | 2017-01-28T09:09:47.000Z | 2017-09-14T14:29:20.000Z | # -*- coding: utf-8 -*-
#
# sc2reader documentation build configuration file, created by
# sphinx-quickstart on Sun May 01 12:39:48 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | 32.511521 | 80 | 0.71949 |
import sys, os
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'sc2reader'
copyright = u'2011'
# |version| and |release|, also used in various other places throu... | true | true |
1c4ab7312d9e6256798662f4b5f774925bdfd988 | 563 | py | Python | HostsTool/gui/__init__.py | zte-lhg/chromium_org | 6174180179b3c6b71c2d93df68e734cadf6d8d49 | [
"Apache-2.0"
] | null | null | null | HostsTool/gui/__init__.py | zte-lhg/chromium_org | 6174180179b3c6b71c2d93df68e734cadf6d8d49 | [
"Apache-2.0"
] | null | null | null | HostsTool/gui/__init__.py | zte-lhg/chromium_org | 6174180179b3c6b71c2d93df68e734cadf6d8d49 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# __init__.py : Declare modules to be called in gui module.
#
# Copyleft (C) 2014 - huhamhire <me@huhamhire.com>
# =====================================================================
# Licensed under the GNU General Public License, version 3. You should
# have received... | 35.1875 | 71 | 0.53286 |
from hostsutil import HostsUtil
__all__ = ["HostsUtil"]
| true | true |
1c4ab74f30c876baed75a6ac1163521f349e3b56 | 3,383 | py | Python | train.py | haziq9978/PythonChatbot | 8eb77140b32a4c6770dab20d4e26be03504ac5ee | [
"MIT"
] | 2 | 2021-01-04T16:23:07.000Z | 2021-01-05T03:25:19.000Z | train.py | haziq9978/PythonChatbot | 8eb77140b32a4c6770dab20d4e26be03504ac5ee | [
"MIT"
] | null | null | null | train.py | haziq9978/PythonChatbot | 8eb77140b32a4c6770dab20d4e26be03504ac5ee | [
"MIT"
] | 1 | 2021-01-04T16:28:57.000Z | 2021-01-04T16:28:57.000Z | import numpy as np
import random
import json
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from nltk_utils import bag_of_words, tokenize, stem
from model import NeuralNet
with open('dataCombine.json', 'r') as f:
intents = json.load(f)
all_words = []
tags = []
xy = []
# loop... | 26.023077 | 74 | 0.657996 | import numpy as np
import random
import json
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from nltk_utils import bag_of_words, tokenize, stem
from model import NeuralNet
with open('dataCombine.json', 'r') as f:
intents = json.load(f)
all_words = []
tags = []
xy = []
for i... | true | true |
1c4ab7a54084ae0c5afba16f8fe6659ad81d8e17 | 3,924 | py | Python | tools/similarity.py | whxf/nlp_api | a63b67287e9a90381cac14bb1c5b723ccbeb14a3 | [
"MIT"
] | 13 | 2019-11-06T02:37:28.000Z | 2022-03-21T06:16:18.000Z | tools/similarity.py | whxf/nlp_api | a63b67287e9a90381cac14bb1c5b723ccbeb14a3 | [
"MIT"
] | null | null | null | tools/similarity.py | whxf/nlp_api | a63b67287e9a90381cac14bb1c5b723ccbeb14a3 | [
"MIT"
] | 4 | 2020-05-07T10:49:32.000Z | 2021-12-31T04:03:19.000Z | """
@author: Li Xi
@file: similarity.py
@time: 2019/10/30 15:37
@desc:
计算文本相似度:
1. WordMoverDistance 基于词移距离的文本相似度计算 【比较文档的相似度】
2. WordVectorSimilarity word-vector的句子相似度计算 【比较句子的相似度】
注意事项:
* 两种方法都需要输入句子分词之后的结果,类型需要时list
* 为提升效率/效果,可对分词结果进行处理,如去除停用词等
* 具体使用方法见文件的最下
* 可自定义加载词向量文件
"""
import os
import gensim
import numpy... | 28.230216 | 83 | 0.622579 | import os
import gensim
import numpy as np
from tools.segment import LtpSegment
class WordMoverDistance(object):
__vector_path = os.path.join("source", "sgns.renmin.word.bz2")
word2vec_model = gensim.models.KeyedVectors.load_word2vec_format(__vector_path)
word2vec_model.init_sims(replace=True)
de... | true | true |
1c4ab877b9f249b4301cd5d7ac6137a0a46850c9 | 1,339 | py | Python | tests/integration_tests/ring_managers_tests/test_horizontals_at_top_scanbeam.py | synapticarbors/wagyu | b98354611dceda8888f2951e9704f843a4e88c27 | [
"MIT"
] | 1 | 2021-01-20T05:49:13.000Z | 2021-01-20T05:49:13.000Z | tests/integration_tests/ring_managers_tests/test_horizontals_at_top_scanbeam.py | synapticarbors/wagyu | b98354611dceda8888f2951e9704f843a4e88c27 | [
"MIT"
] | 1 | 2020-11-20T18:21:24.000Z | 2020-11-20T18:21:37.000Z | tests/integration_tests/ring_managers_tests/test_horizontals_at_top_scanbeam.py | synapticarbors/wagyu | b98354611dceda8888f2951e9704f843a4e88c27 | [
"MIT"
] | 2 | 2020-11-20T18:17:31.000Z | 2021-01-20T14:58:22.000Z | from typing import Tuple
from hypothesis import given
from tests.integration_tests.utils import (
BoundPortedBoundsListsPair,
BoundPortedRingManagersPair,
are_bound_ported_bounds_lists_equal,
are_bound_ported_ring_managers_equal)
from tests.utils import equivalence
from wagyu.hints import Coordinate
f... | 36.189189 | 79 | 0.746826 | from typing import Tuple
from hypothesis import given
from tests.integration_tests.utils import (
BoundPortedBoundsListsPair,
BoundPortedRingManagersPair,
are_bound_ported_bounds_lists_equal,
are_bound_ported_ring_managers_equal)
from tests.utils import equivalence
from wagyu.hints import Coordinate
f... | true | true |
1c4ab8eaeea9b0696f105daca4407d3d104a98ea | 7,518 | py | Python | train_InfoGAN1.py | AnonymousExplorer/Conditional-GANs-Pytorch | 6c15ec67217156d6f041e34efe29ab62f9ef7c7d | [
"MIT"
] | 40 | 2018-12-11T02:14:19.000Z | 2022-03-19T06:16:26.000Z | train_InfoGAN1.py | AnonymousExplorer/Conditional-GANs-Pytorch | 6c15ec67217156d6f041e34efe29ab62f9ef7c7d | [
"MIT"
] | null | null | null | train_InfoGAN1.py | AnonymousExplorer/Conditional-GANs-Pytorch | 6c15ec67217156d6f041e34efe29ab62f9ef7c7d | [
"MIT"
] | 19 | 2019-03-21T19:11:14.000Z | 2022-01-17T05:54:13.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import json
import model
import numpy as np
import pylib
import PIL.Image as Image
import tensorboardX
import torch
import torchvision
import torchvision.datasets as dsets
import torchvision.tr... | 38.357143 | 134 | 0.600958 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import json
import model
import numpy as np
import pylib
import PIL.Image as Image
import tensorboardX
import torch
import torchvision
import torchvision.datasets as dsets
import torchvision.tr... | true | true |
1c4abab21c61cff4175293662effd5d6d19d1025 | 715 | py | Python | test.py | Yvictor/simdjson | 2e43ea714a75def3b55f0d6033acb36e31c6497b | [
"Apache-2.0"
] | null | null | null | test.py | Yvictor/simdjson | 2e43ea714a75def3b55f0d6033acb36e31c6497b | [
"Apache-2.0"
] | null | null | null | test.py | Yvictor/simdjson | 2e43ea714a75def3b55f0d6033acb36e31c6497b | [
"Apache-2.0"
] | null | null | null | import sjson
import json
import pytest
test_case = [
'{"a": 1}',
'{"a": 1.1}',
'{"a": null}',
'{"a": "string test"}',
'{"a": true}',
'{"a": false}',
'{"a": 1, "b": 2}',
'{"a": 1, "b": 2, "c": 3}',
'{"a": 1, "b": 2, "c": 3, "d": 1.1}',
'{"a": [1, 1.1], "b": 2}',
'{"a": [1, 1.... | 24.655172 | 62 | 0.418182 | import sjson
import json
import pytest
test_case = [
'{"a": 1}',
'{"a": 1.1}',
'{"a": null}',
'{"a": "string test"}',
'{"a": true}',
'{"a": false}',
'{"a": 1, "b": 2}',
'{"a": 1, "b": 2, "c": 3}',
'{"a": 1, "b": 2, "c": 3, "d": 1.1}',
'{"a": [1, 1.1], "b": 2}',
'{"a": [1, 1.... | true | true |
1c4abbc45219aa0b02fb8ac79f287143752f95fa | 2,004 | py | Python | netket/hilbert/random/particle.py | VolodyaCO/netket | 629e885212d981d7748d155310abca4a1f9d5481 | [
"Apache-2.0"
] | null | null | null | netket/hilbert/random/particle.py | VolodyaCO/netket | 629e885212d981d7748d155310abca4a1f9d5481 | [
"Apache-2.0"
] | 26 | 2021-08-06T15:27:57.000Z | 2022-03-30T16:55:18.000Z | netket/hilbert/random/particle.py | VolodyaCO/netket | 629e885212d981d7748d155310abca4a1f9d5481 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The NetKet 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 ... | 41.75 | 85 | 0.722056 |
import jax
from jax import numpy as jnp
from netket.hilbert import Particle
from netket.utils.dispatch import dispatch
@dispatch
def random_state(hilb: Particle, key, batches: int, *, dtype):
pbc = jnp.array(hilb.n_particles * hilb.pbc)
boundary = jnp.tile(pbc, (batches, 1))
Ls = jnp.array(... | true | true |
1c4abfe636b358eb142c79f641327426a2e082d1 | 1,273 | py | Python | pychron/furnace/firmware/__init__.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | pychron/furnace/firmware/__init__.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | pychron/furnace/firmware/__init__.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | # ===============================================================================
# Copyright 2016 Jake Ross
#
# 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... | 38.575758 | 81 | 0.533386 |
__version__ = "1.0"
PARAMETER_REGISTRY = {
"furnace_env_humidity": "001",
"furnace_env_temperature": "002",
"furnace_setpoint": "003",
"furnace_process_value": "004",
"feeder_position": "021",
"funnel_position": "031",
"switch_status": "041",
}
| true | true |
1c4ac00f27d955404c36f607e418e6eb54dace2d | 199 | py | Python | ui/mock_keyboard.py | amirhertz/SPAGHETTI | 660c4a565846090f73c3cadc3619255bca50d14f | [
"MIT"
] | 10 | 2022-02-03T06:19:13.000Z | 2022-03-29T12:32:19.000Z | ui/mock_keyboard.py | amirhertz/SPAGHETTI | 660c4a565846090f73c3cadc3619255bca50d14f | [
"MIT"
] | null | null | null | ui/mock_keyboard.py | amirhertz/SPAGHETTI | 660c4a565846090f73c3cadc3619255bca50d14f | [
"MIT"
] | null | null | null |
class Key:
ctrl_l = 'control_l'
class Controller:
@staticmethod
def press(key: str) -> str:
return key
@staticmethod
def release(key: str) -> str:
return key
| 13.266667 | 33 | 0.582915 |
class Key:
ctrl_l = 'control_l'
class Controller:
@staticmethod
def press(key: str) -> str:
return key
@staticmethod
def release(key: str) -> str:
return key
| true | true |
1c4ac0d7a55d4170cae7b7ec8b9808ffa64edcae | 910 | py | Python | dsvfile/Models/FactorySystem/InserterComponent.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | 2 | 2021-03-01T19:57:20.000Z | 2021-08-02T20:54:48.000Z | dsvfile/Models/FactorySystem/InserterComponent.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | null | null | null | dsvfile/Models/FactorySystem/InserterComponent.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | null | null | null | from ...Fields import Int16Field, FloatField, BoolField
from ...Fields.Enums import EInserterStage, EItem
from . import Model, Int32Field
class InserterComponent(Model):
version = Int32Field()
id = Int32Field()
entityId = Int32Field()
pcId = Int32Field()
stage = EInserterStage()
speed = Int32F... | 26 | 55 | 0.653846 | from ...Fields import Int16Field, FloatField, BoolField
from ...Fields.Enums import EInserterStage, EItem
from . import Model, Int32Field
class InserterComponent(Model):
version = Int32Field()
id = Int32Field()
entityId = Int32Field()
pcId = Int32Field()
stage = EInserterStage()
speed = Int32F... | true | true |
1c4ac1528db9a11fa760116b25f5da776d7843b1 | 7,422 | py | Python | ncappzoo/apps/object-detector/object-detector.py | yockgen/movidius | cc32f1951a4d00d2250bb0d2b9000c5f2435b41a | [
"MIT"
] | null | null | null | ncappzoo/apps/object-detector/object-detector.py | yockgen/movidius | cc32f1951a4d00d2250bb0d2b9000c5f2435b41a | [
"MIT"
] | null | null | null | ncappzoo/apps/object-detector/object-detector.py | yockgen/movidius | cc32f1951a4d00d2250bb0d2b9000c5f2435b41a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# ****************************************************************************
# Copyright(c) 2017 Intel Corporation.
# License: MIT See LICENSE file in root directory.
# ****************************************************************************
# How to run Single Shot Multibox Detectors (SSD)
... | 35.511962 | 97 | 0.551603 |
import os
import sys
import numpy as np
import ntpath
import argparse
import skimage.io
import skimage.transform
import mvnc.mvncapi as mvnc
from utils import visualize_output
from utils import deserialize_output
CONFIDANCE_THRESHOLD = 0.60
ARGS = None
def open_ncs_device():
... | true | true |
1c4ac1901b03408ddb92516d19c818932cbc8832 | 2,161 | py | Python | app/auth/forms.py | pointerboy/ModHub | 5b2bdf31bdf409c677e1009f879794f91e636a7b | [
"MIT"
] | null | null | null | app/auth/forms.py | pointerboy/ModHub | 5b2bdf31bdf409c677e1009f879794f91e636a7b | [
"MIT"
] | 1 | 2022-01-13T02:52:49.000Z | 2022-01-13T02:52:49.000Z | app/auth/forms.py | pointerboy/ModHub | 5b2bdf31bdf409c677e1009f879794f91e636a7b | [
"MIT"
] | null | null | null | from flask_babel import _, lazy_gettext as _l
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo, Length
from wtforms_validators import AlphaNumeric
from app.models import User
class L... | 43.22 | 143 | 0.672837 | from flask_babel import _, lazy_gettext as _l
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo, Length
from wtforms_validators import AlphaNumeric
from app.models import User
class L... | true | true |
1c4ac1e423458e0a0a187f8698a9e64231b6a196 | 3,067 | py | Python | tube/tests/test_tflAPI.py | adamgilman/tube-python | 3d94e79f7d367eed95ed68b53d0ab13a36cc3219 | [
"BSD-3-Clause"
] | 5 | 2017-01-26T00:06:08.000Z | 2020-06-03T16:07:09.000Z | tube/tests/test_tflAPI.py | adamgilman/tube-python | 3d94e79f7d367eed95ed68b53d0ab13a36cc3219 | [
"BSD-3-Clause"
] | null | null | null | tube/tests/test_tflAPI.py | adamgilman/tube-python | 3d94e79f7d367eed95ed68b53d0ab13a36cc3219 | [
"BSD-3-Clause"
] | 1 | 2021-11-22T16:23:14.000Z | 2021-11-22T16:23:14.000Z | import unittest
from tube.tflAPI import TFLapi
import vcr
my_vcr = vcr.VCR(
serializer = 'json',
cassette_library_dir = 'tube/tests/fixtures/cassettes',
record_mode = 'once',
match_on = ['uri', 'method'],
)
import logging
logging.basicConfig() # you need to initialize logging, otherwise you will not see anything... | 44.449275 | 109 | 0.750245 | import unittest
from tube.tflAPI import TFLapi
import vcr
my_vcr = vcr.VCR(
serializer = 'json',
cassette_library_dir = 'tube/tests/fixtures/cassettes',
record_mode = 'once',
match_on = ['uri', 'method'],
)
import logging
logging.basicConfig()
vcr_log = logging.getLogger("vcr")
vcr_log.setLevel(logging.ERROR)
... | true | true |
1c4ac264208d85dfc358c39ac2b842a93a43d268 | 2,008 | py | Python | nova/db/sqlalchemy/migrate_repo/versions/087_add_uuid_to_bw_usage_cache.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | null | null | null | nova/db/sqlalchemy/migrate_repo/versions/087_add_uuid_to_bw_usage_cache.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | 1 | 2020-07-24T14:14:13.000Z | 2020-07-24T14:14:13.000Z | nova/db/sqlalchemy/migrate_repo/versions/087_add_uuid_to_bw_usage_cache.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | 1 | 2020-07-24T10:40:59.000Z | 2020-07-24T10:40:59.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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
#
... | 34.033898 | 78 | 0.697709 |
from sqlalchemy import Boolean, Column, DateTime, BigInteger
from sqlalchemy import MetaData, Integer, String, Table
from nova import log as logging
LOG = logging.getLogger(__name__)
def upgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
bw_usage_cache = Table('b... | true | true |
1c4ac32fd1e2599ccd47b8d66ea9daef42b250e7 | 2,232 | py | Python | tests/test_weighting.py | DimitrisAlivas/StarQE | c17676e5f1e3f19c0c4c117a50abe2ce22ffef28 | [
"MIT"
] | 11 | 2021-06-17T15:01:36.000Z | 2022-02-04T16:48:27.000Z | tests/test_weighting.py | DimitrisAlivas/StarQE | c17676e5f1e3f19c0c4c117a50abe2ce22ffef28 | [
"MIT"
] | null | null | null | tests/test_weighting.py | DimitrisAlivas/StarQE | c17676e5f1e3f19c0c4c117a50abe2ce22ffef28 | [
"MIT"
] | 1 | 2022-03-28T03:55:33.000Z | 2022-03-28T03:55:33.000Z | """Tests for weighting."""
from typing import Any, MutableMapping
import torch
import unittest_templates
from mphrqe.layer.weighting import AttentionMessageWeighting, MessageWeighting, SymmetricMessageWeighting
class MessageWeightingTests(unittest_templates.GenericTestCase[MessageWeighting]):
"""Tests for messa... | 30.162162 | 114 | 0.68862 | from typing import Any, MutableMapping
import torch
import unittest_templates
from mphrqe.layer.weighting import AttentionMessageWeighting, MessageWeighting, SymmetricMessageWeighting
class MessageWeightingTests(unittest_templates.GenericTestCase[MessageWeighting]):
num_entities: int = 33
num_edges: int = ... | true | true |
1c4ac39c33fc74a087b76922f9853b80be409055 | 1,078 | py | Python | seedorf/sports/migrations/0003_add_sport_category_table_tennis.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | 3 | 2018-04-22T10:11:01.000Z | 2018-11-16T22:00:34.000Z | seedorf/sports/migrations/0003_add_sport_category_table_tennis.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | 87 | 2018-03-14T13:42:55.000Z | 2022-03-21T21:15:16.000Z | seedorf/sports/migrations/0003_add_sport_category_table_tennis.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2019-03-29 13:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("sports", "0002_auto_20180602_2110")]
operations = [
migrations.AlterField(
model_name="sport",
name="category",
field... | 31.705882 | 82 | 0.454545 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("sports", "0002_auto_20180602_2110")]
operations = [
migrations.AlterField(
model_name="sport",
name="category",
field=models.CharField(
choices=[
... | true | true |
1c4ac3f3a8c481f3e1541b4748ebe97e017ea4e8 | 1,239 | py | Python | BaseAdapter/EUAOSSHClient.py | leonevo/euao | ff7a2c9fa76c4eed297856ef82ac3d2baa8976c1 | [
"Apache-2.0"
] | 2 | 2015-01-16T07:36:19.000Z | 2017-03-10T06:11:55.000Z | BaseAdapter/EUAOSSHClient.py | leonevo/euao | ff7a2c9fa76c4eed297856ef82ac3d2baa8976c1 | [
"Apache-2.0"
] | null | null | null | BaseAdapter/EUAOSSHClient.py | leonevo/euao | ff7a2c9fa76c4eed297856ef82ac3d2baa8976c1 | [
"Apache-2.0"
] | null | null | null | import paramiko
class EUAOSSHClient(paramiko.SSHClient):
## overload the exec_command method
def exec_command(self, command, bufsize=-1, timeout=None):
chan = self._transport.open_session()
chan.settimeout(timeout)
chan.exec_command(command)
stdin = chan.makefile('wb', bu... | 72.882353 | 497 | 0.727199 | import paramiko
class EUAOSSHClient(paramiko.SSHClient):
bufsize=-1, timeout=None):
chan = self._transport.open_session()
chan.settimeout(timeout)
chan.exec_command(command)
stdin = chan.makefile('wb', bufsize)
stdout = chan.makefile('rb', bufsize)
stderr =... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.