hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76f53e8545c6fd2f177b442da531f6b3a9f5e3b | 803 | py | Python | src/dependenpy/__init__.py | Genida/dependenpy | f3e274cfde24f5a3cc1a200fceb4f2d94f41ca11 | [
"ISC"
] | 5 | 2017-10-15T05:32:04.000Z | 2019-09-02T17:45:22.000Z | src/dependenpy/__init__.py | Pawamoy/dependenpy | f3e274cfde24f5a3cc1a200fceb4f2d94f41ca11 | [
"ISC"
] | 18 | 2015-03-13T11:55:49.000Z | 2017-06-20T11:56:46.000Z | src/dependenpy/__init__.py | Genida/dependenpy | f3e274cfde24f5a3cc1a200fceb4f2d94f41ca11 | [
"ISC"
] | 1 | 2018-01-27T15:26:07.000Z | 2018-01-27T15:26:07.000Z | """
Dependenpy package.
Show the inter-dependencies between modules of Python packages.
With dependenpy you will be able to analyze the internal dependencies in
your Python code, i.e. which module needs which other module. You will then
be able to build a dependency matrix and use it for other purposes.
If you read ... | 38.238095 | 101 | 0.770859 |
from __future__ import annotations
from dependenpy.dsm import DSM, Dependency, Module, Package
from dependenpy.structures import Matrix, TreeMap
__all__: list[str] = ["DSM", "Dependency", "Matrix", "Module", "Package", "TreeMap"] __version__ = "3.3.0" | true | true |
f76f545b145feef93926e3359ce3369ccbb967a7 | 1,959 | py | Python | cfg_loader/fields.py | theatro/cfg-loader | 962160c632a8eca21db941e417629fb0273a0e5b | [
"BSD-3-Clause"
] | null | null | null | cfg_loader/fields.py | theatro/cfg-loader | 962160c632a8eca21db941e417629fb0273a0e5b | [
"BSD-3-Clause"
] | null | null | null | cfg_loader/fields.py | theatro/cfg-loader | 962160c632a8eca21db941e417629fb0273a0e5b | [
"BSD-3-Clause"
] | null | null | null | """
cfg_loader.fields
~~~~~~~~~~~~~~~~~
Implement marshmallow fields to validate against specific input data
:copyright: Copyright 2017 by ConsenSys France.
:license: BSD, see :ref:`license` for more details.
"""
import os
from marshmallow import validate, fields
class PathValidator(validate.V... | 28.391304 | 97 | 0.679428 |
import os
from marshmallow import validate, fields
class PathValidator(validate.Validator):
default_message = 'Path "{input}" does not exist'
def __init__(self, error=None):
self.error = error or self.default_message
def _format_error(self, value):
return self.error.format(input=value... | true | true |
f76f55d66e091b9448837f471c48a10853e44833 | 7,018 | py | Python | clinicadl/clinicadl/tools/tsv/tsv_utils.py | cristhiandcl/AD-DL | b7abb3fe619e736b269067033ba4aad1f03cf3b8 | [
"MIT"
] | null | null | null | clinicadl/clinicadl/tools/tsv/tsv_utils.py | cristhiandcl/AD-DL | b7abb3fe619e736b269067033ba4aad1f03cf3b8 | [
"MIT"
] | null | null | null | clinicadl/clinicadl/tools/tsv/tsv_utils.py | cristhiandcl/AD-DL | b7abb3fe619e736b269067033ba4aad1f03cf3b8 | [
"MIT"
] | null | null | null | # coding: utf8
from copy import copy
import numpy as np
import pandas as pd
from os import path
def neighbour_session(session, session_list, neighbour):
if session not in session_list:
temp_list = session_list + [session]
temp_list.sort()
else:
temp_list = copy(session_list)
t... | 34.571429 | 121 | 0.664007 |
from copy import copy
import numpy as np
import pandas as pd
from os import path
def neighbour_session(session, session_list, neighbour):
if session not in session_list:
temp_list = session_list + [session]
temp_list.sort()
else:
temp_list = copy(session_list)
temp_list.sort()... | true | true |
f76f5611d45bda50a7a43d1186d1cadf845e9bb9 | 242 | py | Python | accounts/utils.py | aniruddha2000/foodfeeda | 4dffbbe0310a1809c9743b3525e63bac8a8a0768 | [
"Apache-2.0"
] | null | null | null | accounts/utils.py | aniruddha2000/foodfeeda | 4dffbbe0310a1809c9743b3525e63bac8a8a0768 | [
"Apache-2.0"
] | null | null | null | accounts/utils.py | aniruddha2000/foodfeeda | 4dffbbe0310a1809c9743b3525e63bac8a8a0768 | [
"Apache-2.0"
] | 1 | 2022-03-17T12:47:40.000Z | 2022-03-17T12:47:40.000Z | from django.core.mail import EmailMessage
class Util:
@staticmethod
def send_email(data):
email = EmailMessage(
subject=data["email_subject"], body=data["email_body"], to=[data["to_email"]])
email.send()
| 24.2 | 90 | 0.644628 | from django.core.mail import EmailMessage
class Util:
@staticmethod
def send_email(data):
email = EmailMessage(
subject=data["email_subject"], body=data["email_body"], to=[data["to_email"]])
email.send()
| true | true |
f76f57454d391754080b635539bee1f1ac0c60cc | 129 | py | Python | Blob_Lib/assimp-5.2.3/assimp/scripts/StepImporter/extract_step_token.py | antholuo/Blob_Traffic | 5d6acf88044e9abc63c0ff356714179eaa4b75bf | [
"MIT"
] | null | null | null | Blob_Lib/assimp-5.2.3/assimp/scripts/StepImporter/extract_step_token.py | antholuo/Blob_Traffic | 5d6acf88044e9abc63c0ff356714179eaa4b75bf | [
"MIT"
] | null | null | null | Blob_Lib/assimp-5.2.3/assimp/scripts/StepImporter/extract_step_token.py | antholuo/Blob_Traffic | 5d6acf88044e9abc63c0ff356714179eaa4b75bf | [
"MIT"
] | null | null | null | version https://git-lfs.github.com/spec/v1
oid sha256:fd76abc8270fd3b6b9a8cfe3903a42e83db16aaddf5a96aebcc22bfe97555565
size 2382
| 32.25 | 75 | 0.883721 | version https://git-lfs.github.com/spec/v1
oid sha256:fd76abc8270fd3b6b9a8cfe3903a42e83db16aaddf5a96aebcc22bfe97555565
size 2382
| false | true |
f76f57df2ec48513964bd145f4d3fef97a05c159 | 775 | py | Python | test/source_article_test.py | waruiian21/Ipwk3 | 763db5c009629ddfa200d94b7e2d19dadec0623c | [
"MIT"
] | null | null | null | test/source_article_test.py | waruiian21/Ipwk3 | 763db5c009629ddfa200d94b7e2d19dadec0623c | [
"MIT"
] | null | null | null | test/source_article_test.py | waruiian21/Ipwk3 | 763db5c009629ddfa200d94b7e2d19dadec0623c | [
"MIT"
] | 1 | 2020-07-12T17:16:35.000Z | 2020-07-12T17:16:35.000Z | import unittest
from app.models import Source, Article
class SourceArticleTest(unittest.TestCase):
'''
Test Class to test the behaviour of the Source class
'''
def setUp(self):
'''
Set up method that will run before every Test
'''
self.new_source = Source('abc-news',... | 29.807692 | 135 | 0.665806 | import unittest
from app.models import Source, Article
class SourceArticleTest(unittest.TestCase):
def setUp(self):
self.new_source = Source('abc-news','Abc News','A world class news channel')
self.new_article = Article('dummy_article','john doe','https://s.image.com','2019-10-12T03:11:28Z',"http:... | true | true |
f76f58acef078f6b7a4011a388477a6e6e63fb14 | 7,118 | py | Python | kubernetes_asyncio/client/models/v1alpha1_pod_preset_spec.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1alpha1_pod_preset_spec.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1alpha1_pod_preset_spec.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.19.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... | 30.549356 | 142 | 0.612672 |
import pprint
import re
import six
from kubernetes_asyncio.client.configuration import Configuration
class V1alpha1PodPresetSpec(object):
openapi_types = {
'env': 'list[V1EnvVar]',
'env_from': 'list[V1EnvFromSource]',
'selector': 'V1LabelSelector',
'volume_mounts': 'list[V1V... | true | true |
f76f593638e4d192e57a197c316d7e8c25764bd1 | 124,825 | py | Python | tests/test_octodns_record.py | skyshe/octodns | 330914747c0aa8a785d8fcccce115a364a312a4d | [
"MIT"
] | null | null | null | tests/test_octodns_record.py | skyshe/octodns | 330914747c0aa8a785d8fcccce115a364a312a4d | [
"MIT"
] | 31 | 2020-06-01T10:00:03.000Z | 2021-07-01T06:32:19.000Z | tests/test_octodns_record.py | skyshe/octodns | 330914747c0aa8a785d8fcccce115a364a312a4d | [
"MIT"
] | null | null | null | #
#
#
from __future__ import absolute_import, division, print_function, \
unicode_literals
from six import text_type
from unittest import TestCase
from octodns.record import ARecord, AaaaRecord, AliasRecord, CaaRecord, \
CaaValue, CnameRecord, Create, Delete, GeoValue, MxRecord, MxValue, \
NaptrRecord, N... | 32.651059 | 79 | 0.405928 |
from __future__ import absolute_import, division, print_function, \
unicode_literals
from six import text_type
from unittest import TestCase
from octodns.record import ARecord, AaaaRecord, AliasRecord, CaaRecord, \
CaaValue, CnameRecord, Create, Delete, GeoValue, MxRecord, MxValue, \
NaptrRecord, NaptrVa... | true | true |
f76f5a5bc739fe505f494d7e5f637e1bb307b3e7 | 12,166 | py | Python | kombu/common.py | hudolejev/kombu | 1bd9ac8f9725a4e11520e424f927b4a43f42a4a5 | [
"BSD-3-Clause"
] | 2 | 2017-08-28T17:15:06.000Z | 2018-02-09T08:04:39.000Z | kombu/common.py | hudolejev/kombu | 1bd9ac8f9725a4e11520e424f927b4a43f42a4a5 | [
"BSD-3-Clause"
] | null | null | null | kombu/common.py | hudolejev/kombu | 1bd9ac8f9725a4e11520e424f927b4a43f42a4a5 | [
"BSD-3-Clause"
] | 1 | 2019-08-16T18:50:50.000Z | 2019-08-16T18:50:50.000Z | """
kombu.common
============
Common Utilities.
"""
from __future__ import absolute_import
import os
import socket
import threading
from collections import deque
from contextlib import contextmanager
from functools import partial
from itertools import count
from uuid import uuid4, uuid3, NAMESPACE_OID
from amqp im... | 30.039506 | 79 | 0.6265 | from __future__ import absolute_import
import os
import socket
import threading
from collections import deque
from contextlib import contextmanager
from functools import partial
from itertools import count
from uuid import uuid4, uuid3, NAMESPACE_OID
from amqp import RecoverableConnectionError
from .entity import E... | true | true |
f76f5a744b3e1a8c6f3cb19a3656d135bb951bed | 78 | py | Python | django/tests/template_backends/jinja2/template_backends/syntax_error2.html.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | django/tests/template_backends/jinja2/template_backends/syntax_error2.html.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | django/tests/template_backends/jinja2/template_backends/syntax_error2.html.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | X
X
X
X
X
X
X
X
X
XX
XX
XX
XX
XX
XX
BBBBB
X
X
X
X
X
X
X
X
X
XX
XX
XX
XX
XX
XX
| 2.4375 | 5 | 0.602564 | X
X
X
X
X
X
X
X
X
XX
XX
XX
XX
XX
XX
BBBBB
X
X
X
X
X
X
X
X
X
XX
XX
XX
XX
XX
XX
| true | true |
f76f5bc3188ed28dd3cb383b5ddca5598683c689 | 24,304 | py | Python | integration-tests/test/test_slash.py | Isaac-DeFrain/rchain | 3a6526edde815a86222e5043caa6c16ac699eb96 | [
"Apache-2.0"
] | 775 | 2017-03-23T08:59:29.000Z | 2022-03-28T20:45:39.000Z | integration-tests/test/test_slash.py | Isaac-DeFrain/rchain | 3a6526edde815a86222e5043caa6c16ac699eb96 | [
"Apache-2.0"
] | 2,913 | 2017-10-05T00:28:26.000Z | 2022-03-30T03:33:53.000Z | integration-tests/test/test_slash.py | Isaac-DeFrain/rchain | 3a6526edde815a86222e5043caa6c16ac699eb96 | [
"Apache-2.0"
] | 244 | 2017-05-06T15:52:47.000Z | 2022-03-25T03:12:59.000Z | import hashlib
import re
import sys
import time
from pathlib import Path
from random import Random
from typing import Generator, Tuple, Dict
from contextlib import contextmanager
import logging
import pytest
from docker.client import DockerClient
from rchain.crypto import PrivateKey, gen_block_hash_from_block
from rcha... | 55.488584 | 268 | 0.758065 | import hashlib
import re
import sys
import time
from pathlib import Path
from random import Random
from typing import Generator, Tuple, Dict
from contextlib import contextmanager
import logging
import pytest
from docker.client import DockerClient
from rchain.crypto import PrivateKey, gen_block_hash_from_block
from rcha... | true | true |
f76f5c135867b5505c09e2a29038cf8e04ef7554 | 707 | py | Python | python_code/hash_chapter1_impl.py | possnfiffer/inside_python_dict | 4a16f41062c98974618b25711d3e56bf71a71294 | [
"MIT"
] | 124 | 2018-12-24T21:17:34.000Z | 2022-02-17T06:32:22.000Z | python_code/hash_chapter1_impl.py | possnfiffer/inside_python_dict | 4a16f41062c98974618b25711d3e56bf71a71294 | [
"MIT"
] | 1 | 2021-06-18T21:21:38.000Z | 2021-07-05T00:32:59.000Z | python_code/hash_chapter1_impl.py | possnfiffer/inside_python_dict | 4a16f41062c98974618b25711d3e56bf71a71294 | [
"MIT"
] | 8 | 2018-12-25T11:59:56.000Z | 2020-07-10T16:49:14.000Z | def create_new(numbers):
n = len(numbers)
keys = [None for i in range(2 * n)]
for num in numbers:
idx = num % len(keys)
while keys[idx] is not None:
idx = (idx + 1) % len(keys)
keys[idx] = num
return keys
def create_new_broken(numbers):
n = len(numbers)
... | 18.128205 | 39 | 0.550212 | def create_new(numbers):
n = len(numbers)
keys = [None for i in range(2 * n)]
for num in numbers:
idx = num % len(keys)
while keys[idx] is not None:
idx = (idx + 1) % len(keys)
keys[idx] = num
return keys
def create_new_broken(numbers):
n = len(numbers)
... | true | true |
f76f5d9c23010fe0e54c8f0ffb5c557e5b81a024 | 736 | py | Python | run/s10-fetch.py | osmanbaskaya/wsid | b486fb907a85981aa0d0c30210df1d0c33fcbff2 | [
"MIT"
] | 1 | 2016-12-22T21:41:21.000Z | 2016-12-22T21:41:21.000Z | run/s10-fetch.py | osmanbaskaya/wsid | b486fb907a85981aa0d0c30210df1d0c33fcbff2 | [
"MIT"
] | 4 | 2015-06-20T14:09:35.000Z | 2015-06-26T18:29:26.000Z | run/s10-fetch.py | osmanbaskaya/wsid | b486fb907a85981aa0d0c30210df1d0c33fcbff2 | [
"MIT"
] | 1 | 2018-05-11T00:12:59.000Z | 2018-05-11T00:12:59.000Z | #! /usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Osman Baskaya"
import sys
from bs4 import BeautifulSoup
from itertools import izip
import re
import string
files = sys.argv[1:]
for filename in files:
print >> sys.stderr, "%s processing..." % filename
tags = BeautifulSoup(open(filename), 'xml').find_al... | 30.666667 | 86 | 0.631793 | __author__ = "Osman Baskaya"
import sys
from bs4 import BeautifulSoup
from itertools import izip
import re
import string
files = sys.argv[1:]
for filename in files:
print >> sys.stderr, "%s processing..." % filename
tags = BeautifulSoup(open(filename), 'xml').find_all("TargetSentence")
sentences = map(lam... | false | true |
f76f5e0f18c75ba74cc497ad491e2f8e20a37297 | 128 | py | Python | setup.py | swryan/pyCycleOld | fbab35b74d0e5487abe686ae0823ff52e75afb3b | [
"Apache-2.0"
] | null | null | null | setup.py | swryan/pyCycleOld | fbab35b74d0e5487abe686ae0823ff52e75afb3b | [
"Apache-2.0"
] | null | null | null | setup.py | swryan/pyCycleOld | fbab35b74d0e5487abe686ae0823ff52e75afb3b | [
"Apache-2.0"
] | null | null | null | from distutils.core import setup
setup(name='pycycle',
version='3.0.0',
packages=[
'pycycle',
],
)
| 14.222222 | 32 | 0.539063 | from distutils.core import setup
setup(name='pycycle',
version='3.0.0',
packages=[
'pycycle',
],
)
| true | true |
f76f5ee4e94f50649a89a6223dba4665ca0cf523 | 5,768 | py | Python | Testing Model Including Facial Keypoints.py | jeetbanik/Corona-Real-Time-Face-Mask-and-Keypoints-Detection | 3232f5d7b84fffcc61c2bb84d1b5109154bcc6bb | [
"MIT"
] | 3 | 2020-10-02T00:12:56.000Z | 2020-10-08T03:40:07.000Z | Testing Model Including Facial Keypoints.py | jeetbanik/Corona-Real-Time-Face-Mask-and-Keypoints-Detection | 3232f5d7b84fffcc61c2bb84d1b5109154bcc6bb | [
"MIT"
] | null | null | null | Testing Model Including Facial Keypoints.py | jeetbanik/Corona-Real-Time-Face-Mask-and-Keypoints-Detection | 3232f5d7b84fffcc61c2bb84d1b5109154bcc6bb | [
"MIT"
] | 2 | 2021-02-03T05:48:52.000Z | 2021-09-29T02:58:22.000Z | import numpy as np
from PIL import Image
import cv2
from model import Net
import torch
from torchvision import transforms
from mtcnn import MTCNN
def LoadModel(fpath):
'''
function to load saved model
'''
c = torch.load(fpath, map_location='cpu')
model = c['model']
model.load_state_dict(c['stat... | 46.144 | 126 | 0.575936 | import numpy as np
from PIL import Image
import cv2
from model import Net
import torch
from torchvision import transforms
from mtcnn import MTCNN
def LoadModel(fpath):
c = torch.load(fpath, map_location='cpu')
model = c['model']
model.load_state_dict(c['state_dict'])
for parameter in model.paramete... | true | true |
f76f5f04ffc7cd1e2df6eab4d2846736aed0f9eb | 9,492 | py | Python | tests/integration/widgets/test_datepicker.py | ivan-usov/bokeh | ec3295c4e6027864db4821b59d1a423bf4a1245f | [
"BSD-3-Clause"
] | null | null | null | tests/integration/widgets/test_datepicker.py | ivan-usov/bokeh | ec3295c4e6027864db4821b59d1a423bf4a1245f | [
"BSD-3-Clause"
] | null | null | null | tests/integration/widgets/test_datepicker.py | ivan-usov/bokeh | ec3295c4e6027864db4821b59d1a423bf4a1245f | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | 41.814978 | 144 | 0.605352 |
import pytest ; pytest
from datetime import date
from bokeh._testing.util.selenium import RECORD
from bokeh.layouts import column
from bokeh.models import (
Circle,
ColumnDataSource,
CustomAction,
CustomJS,
DatePicker,
Plot,
Range1d,
)
pytest_plugins = (
"bokeh._testing.plugins.pro... | true | true |
f76f6042ce6217c7713d4e9883b5e9de5541e42d | 42 | py | Python | k_thinning/full_knowledge/RL/__init__.py | varikakasandor/dissertation-balls-into-bins | fba69dd5ffd0b4984795c9a5ec119bf8c6f47d9e | [
"Apache-2.0"
] | null | null | null | k_thinning/full_knowledge/RL/__init__.py | varikakasandor/dissertation-balls-into-bins | fba69dd5ffd0b4984795c9a5ec119bf8c6f47d9e | [
"Apache-2.0"
] | null | null | null | k_thinning/full_knowledge/RL/__init__.py | varikakasandor/dissertation-balls-into-bins | fba69dd5ffd0b4984795c9a5ec119bf8c6f47d9e | [
"Apache-2.0"
] | null | null | null | from k_thinning.full_knowledge.RL import * | 42 | 42 | 0.857143 | from k_thinning.full_knowledge.RL import * | true | true |
f76f60746e1ba191f6600e3c22900a0d80c49b1b | 118 | py | Python | titan/api_pkg/itemtype/resources.py | mnieber/gen | 65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9 | [
"MIT"
] | null | null | null | titan/api_pkg/itemtype/resources.py | mnieber/gen | 65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9 | [
"MIT"
] | null | null | null | titan/api_pkg/itemtype/resources.py | mnieber/gen | 65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from moonleap import Resource
@dataclass
class ItemType(Resource):
name: str
| 13.111111 | 33 | 0.788136 | from dataclasses import dataclass
from moonleap import Resource
@dataclass
class ItemType(Resource):
name: str
| true | true |
f76f644cd0de6d617c49bd336e715d03e388bfed | 2,097 | py | Python | tests/test_upload.py | tbots/elisctl | 091d488b6f1fab653354d024e01f799fb423c66f | [
"MIT"
] | null | null | null | tests/test_upload.py | tbots/elisctl | 091d488b6f1fab653354d024e01f799fb423c66f | [
"MIT"
] | null | null | null | tests/test_upload.py | tbots/elisctl | 091d488b6f1fab653354d024e01f799fb423c66f | [
"MIT"
] | null | null | null | import json
import re
from functools import partial
from traceback import print_tb
from typing import List
import pytest
from elisctl.schema.upload import upload_command
from tests.conftest import TOKEN, match_uploaded_json, SCHEMAS_URL, QUEUES_URL
DATA = """\
1;abc
2;cde
3;fgh\
"""
SCHEMA_NAME = "schema.json"
schem... | 34.95 | 98 | 0.67382 | import json
import re
from functools import partial
from traceback import print_tb
from typing import List
import pytest
from elisctl.schema.upload import upload_command
from tests.conftest import TOKEN, match_uploaded_json, SCHEMAS_URL, QUEUES_URL
DATA = """\
1;abc
2;cde
3;fgh\
"""
SCHEMA_NAME = "schema.json"
schem... | true | true |
f76f65e63955c59f6aa71d397a16e6d1643ee1ce | 99,430 | py | Python | tests/core.py | KarthikKothareddy/AirFlow | faaf0b8b4467bcf5bff4a5b49086a9e02cb9c112 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/core.py | KarthikKothareddy/AirFlow | faaf0b8b4467bcf5bff4a5b49086a9e02cb9c112 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/core.py | KarthikKothareddy/AirFlow | faaf0b8b4467bcf5bff4a5b49086a9e02cb9c112 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | 39.708466 | 152 | 0.612411 |
from __future__ import print_function
import json
import unittest
import bleach
import doctest
import mock
import multiprocessing
import os
import re
import signal
import sqlalchemy
import tempfile
import warnings
from datetime import timedelta
from dateutil.relativedelta import relativedelta
from email.mime.applica... | true | true |
f76f6621cdab1282853f989f43d5fa854263868c | 4,247 | py | Python | edward2/tracers.py | miksu/edward2 | 973acdb23701f320ebaee8a56fc44d4414acfa4e | [
"Apache-2.0"
] | 1 | 2022-01-05T12:26:05.000Z | 2022-01-05T12:26:05.000Z | edward2/tracers.py | kthakore/edward2 | 6fd50d4b9351616c3cd8b5e9224d118ba48c935f | [
"Apache-2.0"
] | null | null | null | edward2/tracers.py | kthakore/edward2 | 6fd50d4b9351616c3cd8b5e9224d118ba48c935f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The Edward2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 32.419847 | 80 | 0.706381 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import contextlib
from edward2.trace import trace
from edward2.trace import traceable
@contextlib.contextmanager
def condition(**model_kwargs):
def _condition(f, *args, **kwargs):
n... | true | true |
f76f679c6197f3566fd5c784462c1e3cc1f5ad1c | 1,158 | py | Python | stschema/util/event_logger/__init__.py | erickvneri/st-schema-python | 0fb955d421244c3619f0f46bcf040c47e40c74d1 | [
"MIT"
] | null | null | null | stschema/util/event_logger/__init__.py | erickvneri/st-schema-python | 0fb955d421244c3619f0f46bcf040c47e40c74d1 | [
"MIT"
] | null | null | null | stschema/util/event_logger/__init__.py | erickvneri/st-schema-python | 0fb955d421244c3619f0f46bcf040c47e40c74d1 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2021 Erick Israel Vazquez Neri
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, m... | 50.347826 | 79 | 0.78152 | from .event_logger import EventLogger
| true | true |
f76f68d79bbe91e264523f72077db3f903a05ecf | 4,145 | py | Python | research/syntaxnet/dragnn/tools/conll_checkpoint_converter.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/syntaxnet/dragnn/tools/conll_checkpoint_converter.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/syntaxnet/dragnn/tools/conll_checkpoint_converter.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.855769 | 80 | 0.737515 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
from absl import flags
from dragnn.protos import spec_pb2
from dragnn.python import dragnn_model_saver_lib as saver_lib
from dragnn.python import spec_builder
from google.pr... | true | true |
f76f692faf67eb05d3f45a4c3153deea16254557 | 67 | py | Python | blousebrothers/partner/__init__.py | sladinji/blousebrothers | 461de3ba011c0aaed3f0014136c4497b6890d086 | [
"MIT"
] | 1 | 2022-01-27T11:58:10.000Z | 2022-01-27T11:58:10.000Z | blousebrothers/partner/__init__.py | sladinji/blousebrothers | 461de3ba011c0aaed3f0014136c4497b6890d086 | [
"MIT"
] | 5 | 2021-03-19T00:01:54.000Z | 2022-03-11T23:46:21.000Z | blousebrothers/partner/__init__.py | sladinji/blousebrothers | 461de3ba011c0aaed3f0014136c4497b6890d086 | [
"MIT"
] | null | null | null | default_app_config = 'blousebrothers.partner.config.PartnerConfig'
| 33.5 | 66 | 0.865672 | default_app_config = 'blousebrothers.partner.config.PartnerConfig'
| true | true |
f76f695c11c109d85727f745ed77197713d62667 | 9,664 | py | Python | backend/modules/classifiers/cifar10_cnn/__init__.py | fheyen/ClaVis | 528ca85dd05606d39761b5a00d755500cf1cd2f6 | [
"MIT"
] | 2 | 2021-01-11T20:09:32.000Z | 2021-05-14T14:52:48.000Z | backend/modules/classifiers/cifar10_cnn/__init__.py | fheyen/ClaVis | 528ca85dd05606d39761b5a00d755500cf1cd2f6 | [
"MIT"
] | null | null | null | backend/modules/classifiers/cifar10_cnn/__init__.py | fheyen/ClaVis | 528ca85dd05606d39761b5a00d755500cf1cd2f6 | [
"MIT"
] | null | null | null | import numpy
import keras
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras.callbacks import EarlyStopping
import os
from ...tools import check_argument as che... | 36.467925 | 98 | 0.5625 | import numpy
import keras
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras.callbacks import EarlyStopping
import os
from ...tools import check_argument as che... | true | true |
f76f6a172801d949b8a44d191f561ed49af1e47c | 2,908 | py | Python | reinforcement_learning/_rlib_example.py | jupiterbak/OPCUA2Vec | b80d6ebaa4fb62c2b2b3b5ac0510c714e93b2f99 | [
"MIT"
] | 1 | 2020-12-13T02:44:47.000Z | 2020-12-13T02:44:47.000Z | reinforcement_learning/_rlib_example.py | jupiterbak/OPCUA2Vec | b80d6ebaa4fb62c2b2b3b5ac0510c714e93b2f99 | [
"MIT"
] | 2 | 2021-08-25T16:07:57.000Z | 2022-02-10T01:59:38.000Z | reinforcement_learning/_rlib_example.py | jupiterbak/OPCUA2Vec | b80d6ebaa4fb62c2b2b3b5ac0510c714e93b2f99 | [
"MIT"
] | null | null | null | """Example of a custom gym environment and model. Run this for a demo.
This example shows:
- using a custom environment
- using a custom model
- using Tune for grid search
You can visualize experiment results in ~/ray_results using TensorBoard.
"""
import numpy as np
import gym
from ray.rllib.models import Model... | 32.674157 | 79 | 0.623796 |
import numpy as np
import gym
from ray.rllib.models import ModelCatalog
from ray.rllib.models.tf.tf_modelv2 import TFModelV2
from ray.rllib.models.tf.fcnet_v2 import FullyConnectedNetwork
from gym.spaces import Discrete, Box
import ray
from ray import tune
from ray.rllib.utils import try_import_tf
from ray.tune impor... | true | true |
f76f6a60fca1ab37cfa1bcdec09b368255b21807 | 13,396 | py | Python | yandex/cloud/vpc/v1/route_table_pb2.py | korsar182/python-sdk | 873bf2a9b136a8f2faae72e86fae1f5b5c3d896a | [
"MIT"
] | 36 | 2018-12-23T13:51:50.000Z | 2022-03-25T07:48:24.000Z | yandex/cloud/vpc/v1/route_table_pb2.py | korsar182/python-sdk | 873bf2a9b136a8f2faae72e86fae1f5b5c3d896a | [
"MIT"
] | 15 | 2019-02-28T04:55:09.000Z | 2022-03-06T23:17:24.000Z | yandex/cloud/vpc/v1/route_table_pb2.py | korsar182/python-sdk | 873bf2a9b136a8f2faae72e86fae1f5b5c3d896a | [
"MIT"
] | 18 | 2019-02-23T07:10:57.000Z | 2022-03-28T14:41:08.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: yandex/cloud/vpc/v1/route_table.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflec... | 45.720137 | 1,141 | 0.758211 | from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from google.protobuf import timestamp_pb2 as google_dot_prot... | true | true |
f76f6a760e6388333c0ab0e2cd590ca64773b997 | 924 | py | Python | tests/test_twizo.py | twizoapi/lib-api-python | 115d0f574518fbe03f74801d743972c7593bf30e | [
"MIT"
] | null | null | null | tests/test_twizo.py | twizoapi/lib-api-python | 115d0f574518fbe03f74801d743972c7593bf30e | [
"MIT"
] | null | null | null | tests/test_twizo.py | twizoapi/lib-api-python | 115d0f574518fbe03f74801d743972c7593bf30e | [
"MIT"
] | null | null | null | import unittest
from controllers import *
from twizo import Twizo
class TwizoTest(unittest.TestCase):
def test_init(self):
sut = Twizo("apikey", "apiHost")
self.assertEqual(type(sut.widget_session_controller), WidgetSessionController)
self.assertEqual(type(sut.number_lookup_controller), N... | 40.173913 | 86 | 0.760823 | import unittest
from controllers import *
from twizo import Twizo
class TwizoTest(unittest.TestCase):
def test_init(self):
sut = Twizo("apikey", "apiHost")
self.assertEqual(type(sut.widget_session_controller), WidgetSessionController)
self.assertEqual(type(sut.number_lookup_controller), N... | true | true |
f76f6addd9499f5d5813a913049a0b7c932cf31d | 8,193 | py | Python | themes/default/base16-zenburn.config.py | dgmulf/base16-qutebrowser | 3d71ea89adfb3ede9eee2f9764d4a59d26fe4f9b | [
"MIT"
] | null | null | null | themes/default/base16-zenburn.config.py | dgmulf/base16-qutebrowser | 3d71ea89adfb3ede9eee2f9764d4a59d26fe4f9b | [
"MIT"
] | null | null | null | themes/default/base16-zenburn.config.py | dgmulf/base16-qutebrowser | 3d71ea89adfb3ede9eee2f9764d4a59d26fe4f9b | [
"MIT"
] | null | null | null | # base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova
# Zenburn scheme by elnawe
base00 = "#383838"
base01 = "#404040"
base02 = "#606060"
base03 = "#6f6f6f"
base04 = "#808080"
base05 = "#dcdccc"
base06 = "#c0c0c0"
base07 = "#ffffff"
base08 = "#dca3a3"
base09 = "#df... | 29.260714 | 71 | 0.771512 |
base00 = "#383838"
base01 = "#404040"
base02 = "#606060"
base03 = "#6f6f6f"
base04 = "#808080"
base05 = "#dcdccc"
base06 = "#c0c0c0"
base07 = "#ffffff"
base08 = "#dca3a3"
base09 = "#dfaf8f"
base0A = "#e0cf9f"
base0B = "#5f7f5f"
base0C = "#93e0e3"
base0D = "#7cb8bb"
base0E = "#dc8cc3"
base0F = "#000000"
c.colors.comp... | true | true |
f76f6ba02064058515a56626b675c77fbd6d6339 | 166 | py | Python | adwords_client/adwords_api/shared_criterion_service.py | getninjas/adwords-client | 021473f9b2b9aa5d17ae53c364304ef5c2bf7547 | [
"Apache-2.0"
] | 8 | 2017-08-17T12:03:36.000Z | 2019-06-05T17:18:44.000Z | adwords_client/adwords_api/shared_criterion_service.py | getninjas/adwords-client | 021473f9b2b9aa5d17ae53c364304ef5c2bf7547 | [
"Apache-2.0"
] | 12 | 2017-07-13T17:17:53.000Z | 2021-02-08T20:11:57.000Z | adwords_client/adwords_api/shared_criterion_service.py | getninjas/adwords-client | 021473f9b2b9aa5d17ae53c364304ef5c2bf7547 | [
"Apache-2.0"
] | 4 | 2017-07-13T16:54:00.000Z | 2019-02-22T07:38:11.000Z | from . import common as cm
class SharedCriterionService(cm.BaseService):
def __init__(self, client):
super().__init__(client, 'SharedCriterionService')
| 23.714286 | 58 | 0.73494 | from . import common as cm
class SharedCriterionService(cm.BaseService):
def __init__(self, client):
super().__init__(client, 'SharedCriterionService')
| true | true |
f76f6d4236b7c1cdc56931ea4aaa80b925f776e7 | 530 | gyp | Python | binding.gyp | jangxx/node-win-desktop-duplication | 2ec541465b898493aa176eb13bd7e8f91f2c1e1f | [
"MIT"
] | 16 | 2019-10-11T16:13:39.000Z | 2021-08-03T12:26:49.000Z | binding.gyp | jangxx/node-win-desktop-duplication | 2ec541465b898493aa176eb13bd7e8f91f2c1e1f | [
"MIT"
] | 7 | 2020-01-04T17:19:24.000Z | 2021-01-16T18:06:37.000Z | binding.gyp | jangxx/node-win-desktop-duplication | 2ec541465b898493aa176eb13bd7e8f91f2c1e1f | [
"MIT"
] | 5 | 2020-01-04T02:01:15.000Z | 2021-09-16T18:44:04.000Z | {
"targets": [
{
"target_name": "desktopduplication",
"sources": [
"src/getframeasyncworker.cpp",
"src/desktopduplication.cpp"
],
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")"
],
"dependencies": [
"<!(node -p \"require('node-addon-api').gyp\")"
... | 18.928571 | 57 | 0.507547 | {
"targets": [
{
"target_name": "desktopduplication",
"sources": [
"src/getframeasyncworker.cpp",
"src/desktopduplication.cpp"
],
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")"
],
"dependencies": [
"<!(node -p \"require('node-addon-api').gyp\")"
... | true | true |
f76f6df1be5b533d937cc6d1c24608bc7a3a14d4 | 254 | py | Python | manage.py | CorradoTorino/WritingYourFirstDjangoApp | 46e0b939920dbbd331cdafc9b64bee24ab6c95fa | [
"Unlicense"
] | 1 | 2017-08-10T16:11:09.000Z | 2017-08-10T16:11:09.000Z | manage.py | CorradoTorino/WritingYourFirstDjangoApp | 46e0b939920dbbd331cdafc9b64bee24ab6c95fa | [
"Unlicense"
] | null | null | null | manage.py | CorradoTorino/WritingYourFirstDjangoApp | 46e0b939920dbbd331cdafc9b64bee24ab6c95fa | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MyFirstSite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23.090909 | 75 | 0.775591 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MyFirstSite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
f76f6e01953d47b84483c028159e5ba78b2950ec | 6,765 | py | Python | windows/mainwindow.py | FlashTek/data-viewer | f81bec33afae182decbb2b6f083b5551f965ec41 | [
"MIT"
] | 1 | 2018-12-19T19:30:36.000Z | 2018-12-19T19:30:36.000Z | windows/mainwindow.py | FlashTek/data-viewer | f81bec33afae182decbb2b6f083b5551f965ec41 | [
"MIT"
] | null | null | null | windows/mainwindow.py | FlashTek/data-viewer | f81bec33afae182decbb2b6f083b5551f965ec41 | [
"MIT"
] | null | null | null | # Copyright (c) 2018 Roland Zimmermann
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | 36.967213 | 120 | 0.662823 |
from PyQt5 import QtCore, QtGui, QtWidgets
from windows.ui.mainwindow import Ui_MainWindow
from core.adapters.adapter_registry import AdapterRegistry
from PyQt5.QtWidgets import QMessageBox
import h5py as h5
import sys
import os
from core.plugins import PluginRegistry
class MainWindow(QtWidgets.QMainWindow, Ui_MainWi... | true | true |
f76f6e01d7053e452133002568945ddb11917475 | 19,001 | py | Python | amazon.py | adnanshahz2018/amazon-spn | b12e04a8f23222e7f8a277133e6e6a44ca754da4 | [
"Apache-2.0"
] | null | null | null | amazon.py | adnanshahz2018/amazon-spn | b12e04a8f23222e7f8a277133e6e6a44ca754da4 | [
"Apache-2.0"
] | null | null | null | amazon.py | adnanshahz2018/amazon-spn | b12e04a8f23222e7f8a277133e6e6a44ca754da4 | [
"Apache-2.0"
] | null | null | null |
# python imports
import json
import xlsxwriter
import pandas as pd
from numpy import nan
import openpyxl as op
from time import sleep
from bs4 import BeautifulSoup
from selenium import webdriver
MAIN_PAGE = 'https://sellercentral.amazon.in/gspn/?ref=spn_rc&sellFrom=IN&sellIn=IN&ref_=sc_gspn_na_hp'
CATEGORY_LIST =... | 51.633152 | 185 | 0.586127 |
import json
import xlsxwriter
import pandas as pd
from numpy import nan
import openpyxl as op
from time import sleep
from bs4 import BeautifulSoup
from selenium import webdriver
MAIN_PAGE = 'https://sellercentral.amazon.in/gspn/?ref=spn_rc&sellFrom=IN&sellIn=IN&ref_=sc_gspn_na_hp'
CATEGORY_LIST = {
'Taxes' :... | true | true |
f76f6e154bfa2d9a36ec3b80dc6c63a4bd5c7e5c | 963 | py | Python | tests/integration/cartography/intel/kubernetes/test_namespaces.py | ramonpetgrave64/cartography | 031f282f096b9bc3b3dbad52653f25539f8bf76f | [
"Apache-2.0"
] | 2,322 | 2019-03-02T01:07:20.000Z | 2022-03-31T20:39:12.000Z | tests/integration/cartography/intel/kubernetes/test_namespaces.py | ramonpetgrave64/cartography | 031f282f096b9bc3b3dbad52653f25539f8bf76f | [
"Apache-2.0"
] | 462 | 2019-03-07T18:38:11.000Z | 2022-03-31T14:55:20.000Z | tests/integration/cartography/intel/kubernetes/test_namespaces.py | ramonpetgrave64/cartography | 031f282f096b9bc3b3dbad52653f25539f8bf76f | [
"Apache-2.0"
] | 246 | 2019-03-03T02:39:23.000Z | 2022-02-24T09:46:38.000Z | from cartography.intel.kubernetes.namespaces import load_namespaces
from tests.data.kubernetes.namespaces import GET_CLUSTER_DATA
from tests.data.kubernetes.namespaces import GET_NAMESPACES_DATA
TEST_UPDATE_TAG = 123456789
def test_load_namespaces(neo4j_session):
load_namespaces(
neo4j_session,
... | 27.514286 | 97 | 0.671859 | from cartography.intel.kubernetes.namespaces import load_namespaces
from tests.data.kubernetes.namespaces import GET_CLUSTER_DATA
from tests.data.kubernetes.namespaces import GET_NAMESPACES_DATA
TEST_UPDATE_TAG = 123456789
def test_load_namespaces(neo4j_session):
load_namespaces(
neo4j_session,
... | true | true |
f76f6e95e3fdcb1e127ea600757e8c067b2ad7ab | 7,174 | py | Python | app/main/views/feedback.py | alphagov/notify-admin-frontend | 70f2a6a97aefe2432d7a3b54dc1555c030dd3693 | [
"MIT"
] | null | null | null | app/main/views/feedback.py | alphagov/notify-admin-frontend | 70f2a6a97aefe2432d7a3b54dc1555c030dd3693 | [
"MIT"
] | null | null | null | app/main/views/feedback.py | alphagov/notify-admin-frontend | 70f2a6a97aefe2432d7a3b54dc1555c030dd3693 | [
"MIT"
] | null | null | null | from datetime import datetime
import pytz
from flask import redirect, render_template, request, session, url_for
from flask_login import current_user
from govuk_bank_holidays.bank_holidays import BankHolidays
from notifications_utils.clients.zendesk.zendesk_client import (
NotifySupportTicket,
)
from app import c... | 30.142857 | 94 | 0.66504 | from datetime import datetime
import pytz
from flask import redirect, render_template, request, session, url_for
from flask_login import current_user
from govuk_bank_holidays.bank_holidays import BankHolidays
from notifications_utils.clients.zendesk.zendesk_client import (
NotifySupportTicket,
)
from app import c... | true | true |
f76f6eaa97539df9ecd81e5febc527a4606b7f09 | 23,254 | py | Python | jam/admin/import_metadata.py | pubmania/jam-py | 33c930206702dba951fd42783a93127cd7fdc3ac | [
"BSD-3-Clause"
] | 384 | 2015-01-06T15:09:23.000Z | 2022-02-25T19:56:44.000Z | jam/admin/import_metadata.py | pubmania/jam-py | 33c930206702dba951fd42783a93127cd7fdc3ac | [
"BSD-3-Clause"
] | 222 | 2015-01-06T19:11:08.000Z | 2022-02-16T06:46:39.000Z | jam/admin/import_metadata.py | pubmania/jam-py | 33c930206702dba951fd42783a93127cd7fdc3ac | [
"BSD-3-Clause"
] | 86 | 2015-01-16T09:50:31.000Z | 2022-02-25T13:27:14.000Z | import sys
import os
import datetime
import time
import zipfile
import tempfile
import shutil
from distutils import dir_util
import json
import traceback
from werkzeug._compat import to_unicode
from ..common import consts, file_read, file_write, error_message
from ..db.db_modules import SQLITE, FIREBIRD, get_db_module... | 40.162349 | 133 | 0.518448 | import sys
import os
import datetime
import time
import zipfile
import tempfile
import shutil
from distutils import dir_util
import json
import traceback
from werkzeug._compat import to_unicode
from ..common import consts, file_read, file_write, error_message
from ..db.db_modules import SQLITE, FIREBIRD, get_db_module... | true | true |
f76f6ec6a6392db4ee194a3d942869e1e4d7a15b | 6,907 | py | Python | scripts/tf_to_torch.py | julien-c/enformer-pytorch | 0231e526223b0660330caa4fe283189fb7f790e6 | [
"MIT"
] | 96 | 2021-10-24T00:22:15.000Z | 2022-03-21T03:38:56.000Z | scripts/tf_to_torch.py | NielsRogge/enformer-pytorch | 15099609081a537ef1cc6e9148bba1b4a98d9b7a | [
"MIT"
] | 4 | 2022-02-21T15:55:22.000Z | 2022-02-24T16:05:40.000Z | scripts/tf_to_torch.py | NielsRogge/enformer-pytorch | 15099609081a537ef1cc6e9148bba1b4a98d9b7a | [
"MIT"
] | 20 | 2021-11-06T06:38:54.000Z | 2022-03-21T13:01:10.000Z | from einops import rearrange
def copy_bn(mod, vars, path):
bn_offset = vars[f'{path}offset:0']
bn_scale = vars[f'{path}scale:0']
ema_path = '/'.join(path.split('/')[:-3]) + '/'
bn_running_mean = vars[f'{ema_path}moving_mean/average:0']
bn_running_var = vars[f'{ema_path}moving_variance/average:0']
... | 51.162963 | 163 | 0.738381 | from einops import rearrange
def copy_bn(mod, vars, path):
bn_offset = vars[f'{path}offset:0']
bn_scale = vars[f'{path}scale:0']
ema_path = '/'.join(path.split('/')[:-3]) + '/'
bn_running_mean = vars[f'{ema_path}moving_mean/average:0']
bn_running_var = vars[f'{ema_path}moving_variance/average:0']
... | true | true |
f76f6ee658127b05d5ed609cafbb674148862109 | 6,562 | py | Python | roi/layers/nms.py | Tianxiaomo/ROI | 8422716605f846c6f4276051a9738cb6c162611d | [
"Apache-2.0"
] | 2 | 2020-04-03T08:34:11.000Z | 2021-05-31T07:15:19.000Z | roi/layers/nms.py | Tianxiaomo/ROI | 8422716605f846c6f4276051a9738cb6c162611d | [
"Apache-2.0"
] | null | null | null | roi/layers/nms.py | Tianxiaomo/ROI | 8422716605f846c6f4276051a9738cb6c162611d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch
from torchvision.ops import boxes as box_ops
from torchvision.ops import nms # BC-compat
def batched_nms(boxes, scores, idxs, iou_threshold):
"""
Same as torchvision.ops.boxes.batched_nms, but safer.
... | 44.639456 | 98 | 0.697501 |
import torch
from torchvision.ops import boxes as box_ops
from torchvision.ops import nms
def batched_nms(boxes, scores, idxs, iou_threshold):
assert boxes.shape[-1] == 4
if len(boxes) < 40000:
return box_ops.batched_nms(boxes, scores, idxs, iou_threshold)
result_mask = scores.new_zeros... | true | true |
f76f70053c192594478acb011bf525bbf6ef124e | 1,498 | py | Python | st2common/st2common/services/queries.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 2 | 2021-08-04T01:04:06.000Z | 2021-08-04T01:04:08.000Z | st2common/st2common/services/queries.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 1 | 2022-03-31T03:53:22.000Z | 2022-03-31T03:53:22.000Z | st2common/st2common/services/queries.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 1 | 2019-10-11T14:42:28.000Z | 2019-10-11T14:42:28.000Z | # Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 31.208333 | 93 | 0.769693 |
from __future__ import absolute_import
import logging
from st2common.models.db.executionstate import ActionExecutionStateDB
from st2common.persistence.executionstate import ActionExecutionState
LOG = logging.getLogger(__name__)
def setup_query(liveaction_id, runnertype_db, query_context):
if not getattr(runn... | true | true |
f76f703c75b1623b1fc05b48d75df7dd7b4466f5 | 11,025 | py | Python | io_scene_halo/file_ass/build_asset.py | AerialDave144/Halo-Asset-Blender-Development-Toolset | f1b0c0b22806ebabaf0126ad864896193c02307f | [
"MIT"
] | null | null | null | io_scene_halo/file_ass/build_asset.py | AerialDave144/Halo-Asset-Blender-Development-Toolset | f1b0c0b22806ebabaf0126ad864896193c02307f | [
"MIT"
] | null | null | null | io_scene_halo/file_ass/build_asset.py | AerialDave144/Halo-Asset-Blender-Development-Toolset | f1b0c0b22806ebabaf0126ad864896193c02307f | [
"MIT"
] | null | null | null | # ##### BEGIN MIT LICENSE BLOCK #####
#
# MIT License
#
# Copyright (c) 2022 Steven Garcia
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | 40.533088 | 204 | 0.520363 |
import os
import bpy
import socket
from getpass import getuser
from .process_scene import process_scene
from ..global_functions import global_functions
def build_asset(context, filepath, version, game_version, folder_structure, hidden_geo, exluded_collections, apply_modifiers, triangulate_faces, edge_split, clean_no... | true | true |
f76f7131247ded1e104d7fdf5cc1c93879800b48 | 118 | py | Python | tests/context.py | talesa/pytorch-flows | 28f68e7a3958b9be6578847f335a7d1487e5dafa | [
"MIT"
] | null | null | null | tests/context.py | talesa/pytorch-flows | 28f68e7a3958b9be6578847f335a7d1487e5dafa | [
"MIT"
] | null | null | null | tests/context.py | talesa/pytorch-flows | 28f68e7a3958b9be6578847f335a7d1487e5dafa | [
"MIT"
] | null | null | null | import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import flows
| 19.666667 | 82 | 0.728814 | import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import flows
| true | true |
f76f7147df1dc925dba9c46afb53413d1a465b14 | 1,283 | py | Python | models/backbones/backbone_selector.py | diceryas/torchcv-seg | 1ac79b5709708c56756dc035e635c28bec763218 | [
"Apache-2.0"
] | 1 | 2020-05-20T08:51:51.000Z | 2020-05-20T08:51:51.000Z | models/backbones/backbone_selector.py | diceryas/torchcv-seg | 1ac79b5709708c56756dc035e635c28bec763218 | [
"Apache-2.0"
] | null | null | null | models/backbones/backbone_selector.py | diceryas/torchcv-seg | 1ac79b5709708c56756dc035e635c28bec763218 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Donny You(youansheng@gmail.com)
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from models.backbones.resnet.resnet_backbone import ResNetBackbone
from models.backbones.mobilenet.mobilenet_backbone imp... | 29.837209 | 78 | 0.703819 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from models.backbones.resnet.resnet_backbone import ResNetBackbone
from models.backbones.mobilenet.mobilenet_backbone import MobileNetBackbone
from models.backbones.densenet.densenet_backbone import DenseNetB... | true | true |
f76f732af97628037b1a3dd47087933b21a1d393 | 4,705 | py | Python | tests/test_toml_loader.py | dmsimard/dynaconf | ec394ab07e3b522879c8be678c65ebeb05fc2b59 | [
"MIT"
] | null | null | null | tests/test_toml_loader.py | dmsimard/dynaconf | ec394ab07e3b522879c8be678c65ebeb05fc2b59 | [
"MIT"
] | null | null | null | tests/test_toml_loader.py | dmsimard/dynaconf | ec394ab07e3b522879c8be678c65ebeb05fc2b59 | [
"MIT"
] | null | null | null | import pytest
from dynaconf import LazySettings
from dynaconf.loaders.toml_loader import load
settings = LazySettings(
ENV_FOR_DYNACONF='PRODUCTION',
)
TOML = """
a = "a,b"
[default]
password = "@int 99999"
host = "server.com"
port = "@int 8080"
alist = [
"item1",
"item2",
"@int 23"
]
[default.service]
... | 27.676471 | 66 | 0.675452 | import pytest
from dynaconf import LazySettings
from dynaconf.loaders.toml_loader import load
settings = LazySettings(
ENV_FOR_DYNACONF='PRODUCTION',
)
TOML = """
a = "a,b"
[default]
password = "@int 99999"
host = "server.com"
port = "@int 8080"
alist = [
"item1",
"item2",
"@int 23"
]
[default.service]
... | true | true |
f76f73ae1cec76e8b6b67fc8bb2aacbf707859fa | 2,558 | py | Python | models/dcgan_conv.py | xmengxin/MFGR | ba807d0f52c0eb00d330eaa9bcef56c1343d2588 | [
"MIT"
] | 5 | 2021-09-02T08:43:47.000Z | 2022-01-12T17:13:43.000Z | models/dcgan_conv.py | xmengxin/MFGR | ba807d0f52c0eb00d330eaa9bcef56c1343d2588 | [
"MIT"
] | null | null | null | models/dcgan_conv.py | xmengxin/MFGR | ba807d0f52c0eb00d330eaa9bcef56c1343d2588 | [
"MIT"
] | 1 | 2022-01-19T06:26:18.000Z | 2022-01-19T06:26:18.000Z | import torch
import torch.nn as nn
# custom weights initialization called on netG and netD
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
nn.init.normal_(m.weight.data, 0.0, 0.02)
elif classname.find('BatchNorm') != -1:
nn.init.normal_(m.weight.data,... | 30.819277 | 118 | 0.587568 | import torch
import torch.nn as nn
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
nn.init.normal_(m.weight.data, 0.0, 0.02)
elif classname.find('BatchNorm') != -1:
nn.init.normal_(m.weight.data, 1.0, 0.02)
nn.init.constant_(m.bias.data, 0)
... | true | true |
f76f73db71618f83a909dd91b3b6d7600d69cb56 | 103 | py | Python | client/src/state/end/__init__.py | juan-nunez/Space_combat | e732ef932e89c404827ac0c96aebb4f0446cefdf | [
"MIT"
] | null | null | null | client/src/state/end/__init__.py | juan-nunez/Space_combat | e732ef932e89c404827ac0c96aebb4f0446cefdf | [
"MIT"
] | null | null | null | client/src/state/end/__init__.py | juan-nunez/Space_combat | e732ef932e89c404827ac0c96aebb4f0446cefdf | [
"MIT"
] | null | null | null | from end_view import EndView
from end_controller import EndController
from end_state import EndState | 34.333333 | 41 | 0.864078 | from end_view import EndView
from end_controller import EndController
from end_state import EndState | true | true |
f76f73fb499556e5ed2284e4b59d1f78f082f122 | 4,417 | py | Python | test/test-examples.py | jdavidberger/rikitiki | 95877037eb0b9d7f090042ddec49b3b85c5ed680 | [
"MIT"
] | null | null | null | test/test-examples.py | jdavidberger/rikitiki | 95877037eb0b9d7f090042ddec49b3b85c5ed680 | [
"MIT"
] | null | null | null | test/test-examples.py | jdavidberger/rikitiki | 95877037eb0b9d7f090042ddec49b3b85c5ed680 | [
"MIT"
] | null | null | null | #/usr/bin/python
import urllib.request
from time import sleep
import traceback
import subprocess
import http.client
test_points = {
"helloWorld": [ "/hw/hello",
"/hw/test",
"/hw/131"
],
"advanced": [ "/adv",
"/adv/post",
... | 33.210526 | 107 | 0.476341 | import urllib.request
from time import sleep
import traceback
import subprocess
import http.client
test_points = {
"helloWorld": [ "/hw/hello",
"/hw/test",
"/hw/131"
],
"advanced": [ "/adv",
"/adv/post",
"/adv/qs",... | true | true |
f76f74a168423e585714b8ca3556cbc538f0fae8 | 3,476 | py | Python | example/settings.py | geocam/geocamCoreWeb | 4fbe13e6e34904ba476db811934cf34fa631f720 | [
"NASA-1.3"
] | 1 | 2017-03-07T23:44:20.000Z | 2017-03-07T23:44:20.000Z | example/settings.py | geocam/geocamCoreWeb | 4fbe13e6e34904ba476db811934cf34fa631f720 | [
"NASA-1.3"
] | null | null | null | example/settings.py | geocam/geocamCoreWeb | 4fbe13e6e34904ba476db811934cf34fa631f720 | [
"NASA-1.3"
] | null | null | null | # __BEGIN_LICENSE__
# Copyright (C) 2008-2010 United States Government as represented by
# the Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# __END_LICENSE__
# Django settings for example project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
import os
import sys
APP = os.path.absp... | 33.104762 | 88 | 0.734465 |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
import os
import sys
APP = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PROJ_ROOT = os.path.abspath(os.path.dirname(__file__))
sys.path.append(APP)
ADMINS = (
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | true | true |
f76f74df90f87ec3bc3c42118c65311008848062 | 4,720 | py | Python | CxExtractor.py | chrislinan/cx-extractor-python | 56f19b1b7a340f730a9cfd28d2e11e65709f8852 | [
"MIT"
] | 416 | 2017-08-14T08:23:53.000Z | 2022-02-23T15:01:03.000Z | CxExtractor.py | wslm5227/cx-extractor-python | 56f19b1b7a340f730a9cfd28d2e11e65709f8852 | [
"MIT"
] | 9 | 2017-08-17T06:24:17.000Z | 2021-01-26T10:37:03.000Z | CxExtractor.py | wslm5227/cx-extractor-python | 56f19b1b7a340f730a9cfd28d2e11e65709f8852 | [
"MIT"
] | 118 | 2017-08-14T08:23:55.000Z | 2022-02-04T04:36:17.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import chardet
import asyncio
import requests
class CxExtractor:
"""cx-extractor implemented in Python"""
__text = []
__indexDistribution = []
def __init__(self, threshold=86, blocksWidth=3) -> None:
self.__blocksWidth = blocksWidth
... | 37.165354 | 138 | 0.488771 |
import re
import chardet
import asyncio
import requests
class CxExtractor:
__text = []
__indexDistribution = []
def __init__(self, threshold=86, blocksWidth=3) -> None:
self.__blocksWidth = blocksWidth
self.__threshold = threshold
async def getText(self, content: str) -> str:
... | true | true |
f76f753dd5d9e405864b22413fdc4dd6c6e3ed21 | 1,092 | py | Python | source/ivm/res/scripts/client/gui/mods/ivm/fixes.py | Arkhorse/IVM | 6cf8bb6e48d42fa41d21a85b1a20df7ed2aa8cbe | [
"MIT"
] | 2 | 2020-07-28T15:41:27.000Z | 2020-08-12T17:13:00.000Z | source/ivm/res/scripts/client/gui/mods/ivm/fixes.py | Arkhorse/IVM | 6cf8bb6e48d42fa41d21a85b1a20df7ed2aa8cbe | [
"MIT"
] | 1 | 2020-04-15T17:19:17.000Z | 2020-04-15T17:19:17.000Z | source/ivm/res/scripts/client/gui/mods/ivm/fixes.py | Arkhorse/IVM | 6cf8bb6e48d42fa41d21a85b1a20df7ed2aa8cbe | [
"MIT"
] | null | null | null | from .Core import CORE, overrideMethod
#####################################################################
# imports
import traceback
import base64
import constants
import debug_utils
from account_helpers.CustomFilesCache import CustomFilesCache
@overrideMethod(CustomFilesCache, '_CustomFilesCache__onReadLocalFile... | 34.125 | 74 | 0.639194 | from .Core import CORE, overrideMethod
import traceback
import base64
import constants
import debug_utils
from account_helpers.CustomFilesCache import CustomFilesCache
@overrideMethod(CustomFilesCache, '_CustomFilesCache__onReadLocalFile')
def _CustomFilesCache__onReadLocalFile(base, self, url, showImmediately):
... | true | true |
f76f763a0e94f9e4b2a36171561594cf034dc953 | 1,891 | py | Python | manage.py | grantmcconnaughey/django-field-history | 84cda9d5d49d5ea6220ab1c82878c37280490a6b | [
"BSD-3-Clause"
] | 346 | 2016-02-17T22:29:55.000Z | 2022-03-20T17:43:26.000Z | manage.py | grantmcconnaughey/django-field-history | 84cda9d5d49d5ea6220ab1c82878c37280490a6b | [
"BSD-3-Clause"
] | 36 | 2016-02-18T18:41:11.000Z | 2021-09-17T05:48:36.000Z | manage.py | grantmcconnaughey/django-field-history | 84cda9d5d49d5ea6220ab1c82878c37280490a6b | [
"BSD-3-Clause"
] | 42 | 2016-02-19T18:20:47.000Z | 2020-09-11T01:31:52.000Z | #!/usr/bin/env python
import os
import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "db.sqlite3"
}
},
... | 27.808824 | 85 | 0.558964 | import os
import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "db.sqlite3"
}
},
ROOT_URLCONF="tests... | true | true |
f76f7727d7191a955b5d7f96ec2892ed8cc40a8f | 2,777 | py | Python | importexport/models/models.py | ampafdv/ampadb | 25c804a5cb21afcbe4e222a3b48cca27ff2d9e19 | [
"MIT"
] | null | null | null | importexport/models/models.py | ampafdv/ampadb | 25c804a5cb21afcbe4e222a3b48cca27ff2d9e19 | [
"MIT"
] | 28 | 2016-10-21T16:04:56.000Z | 2018-11-10T20:55:40.000Z | importexport/models/models.py | ampafdv/ampadb | 25c804a5cb21afcbe4e222a3b48cca27ff2d9e19 | [
"MIT"
] | 2 | 2016-10-22T19:24:45.000Z | 2017-02-11T10:49:02.000Z | from datetime import timedelta
import uuid
from django.db import models, transaction
from django.db.models import Exists, OuterRef, Q
from django.utils import timezone
from contactboard.models import Classe, Alumne
class ImportData(models.Model):
class Meta:
unique_together = ('importacio', 'nom', 'cognom... | 36.539474 | 79 | 0.652143 | from datetime import timedelta
import uuid
from django.db import models, transaction
from django.db.models import Exists, OuterRef, Q
from django.utils import timezone
from contactboard.models import Classe, Alumne
class ImportData(models.Model):
class Meta:
unique_together = ('importacio', 'nom', 'cognom... | true | true |
f76f779bd6ce727822f531d1c6602fadb9572093 | 63,891 | py | Python | ross/api_report.py | hiagopinacio/ross | 1bc84061f23df455d9e37cb11b244ac795c836ad | [
"MIT"
] | null | null | null | ross/api_report.py | hiagopinacio/ross | 1bc84061f23df455d9e37cb11b244ac795c836ad | [
"MIT"
] | null | null | null | ross/api_report.py | hiagopinacio/ross | 1bc84061f23df455d9e37cb11b244ac795c836ad | [
"MIT"
] | null | null | null | # fmt: off
from copy import copy, deepcopy
import numpy as np
import pandas as pd
from plotly import express as px
from plotly import graph_objects as go
from plotly.subplots import make_subplots
from scipy.interpolate import interp1d
from scipy.signal import argrelextrema
from ross.bearing_seal_element import Bearin... | 34.148049 | 88 | 0.505016 | from copy import copy, deepcopy
import numpy as np
import pandas as pd
from plotly import express as px
from plotly import graph_objects as go
from plotly.subplots import make_subplots
from scipy.interpolate import interp1d
from scipy.signal import argrelextrema
from ross.bearing_seal_element import BearingElement, S... | true | true |
f76f78e10389ae1b7c5e36b9491556a017da1330 | 1,894 | py | Python | qiskit/opflow/evolutions/trotterizations/trotterization_base.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 1,599 | 2018-07-10T10:59:12.000Z | 2022-03-31T23:56:25.000Z | qiskit/opflow/evolutions/trotterizations/trotterization_base.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 5,244 | 2018-07-10T06:20:13.000Z | 2022-03-31T22:18:48.000Z | qiskit/opflow/evolutions/trotterizations/trotterization_base.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 1,409 | 2018-07-10T02:16:12.000Z | 2022-03-31T09:01:32.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 30.063492 | 94 | 0.684794 |
from abc import abstractmethod
from qiskit.opflow.evolutions.evolution_base import EvolutionBase
from qiskit.opflow.operator_base import OperatorBase
class TrotterizationBase(EvolutionBase):
def __init__(self, reps: int = 1) -> None:
self._reps = reps
@property
def reps(self) -> int:
... | true | true |
f76f78ea275ee20b7350d38d4f7a778632351a3d | 2,237 | py | Python | sdk/python/test/test_v1alpha1_resource_declaration.py | jmcshane/experimental | 3c47c7e87bcdadc6172941169f3f24fc3f159ae0 | [
"Apache-2.0"
] | null | null | null | sdk/python/test/test_v1alpha1_resource_declaration.py | jmcshane/experimental | 3c47c7e87bcdadc6172941169f3f24fc3f159ae0 | [
"Apache-2.0"
] | null | null | null | sdk/python/test/test_v1alpha1_resource_declaration.py | jmcshane/experimental | 3c47c7e87bcdadc6172941169f3f24fc3f159ae0 | [
"Apache-2.0"
] | 1 | 2020-07-30T15:55:45.000Z | 2020-07-30T15:55:45.000Z | # Copyright 2020 The Tekton 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 wr... | 30.643836 | 114 | 0.679481 |
from __future__ import absolute_import
import unittest
import datetime
import tekton_pipeline
from tekton_pipeline.models.v1alpha1_resource_declaration import V1alpha1ResourceDeclaration from tekton_pipeline.rest import ApiException
class TestV1alpha1ResourceDeclaration(unittest.TestCase):
def setUp(self):... | true | true |
f76f7a19123429576ac03973bf984c3365d1f50b | 5,317 | py | Python | AddNZBs.py | Tensai75/AddNZBs.py | 4cf564f4a61556fefa7e7ca8c0b0076dc5efb0dc | [
"MIT"
] | 1 | 2020-11-25T10:33:15.000Z | 2020-11-25T10:33:15.000Z | AddNZBs.py | Tensai75/AddNZBs.py | 4cf564f4a61556fefa7e7ca8c0b0076dc5efb0dc | [
"MIT"
] | 1 | 2020-04-17T09:10:52.000Z | 2020-04-17T09:21:00.000Z | AddNZBs.py | Tensai75/AddNZBs.py | 4cf564f4a61556fefa7e7ca8c0b0076dc5efb0dc | [
"MIT"
] | null | null | null | #!/usr/bin/python
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# Add downloaded NZB files to NZBGet
#
#
# If the current NZB download being processed by this script contains NZB
# files they will be pushe... | 39.679104 | 166 | 0.566861 |
import sys
import os
import re
import shutil
import base64
from urllib2 import quote
try:
from xmlrpclib import ServerProxy except ImportError:
from xmlrpc.client import ServerProxy
def addLocalFileToNZBGet(filename, path, category = '', nzbpassword = ''):
host = os.environ['NZBOP_CONTROLIP'];
port = os.e... | false | true |
f76f7b0b1831919eaa2f7973de701809167be655 | 3,354 | py | Python | sample/collect/service_imp/common/filters/template_tool.py | SelfDown/omnis-collect3 | 84f16ed108e4295719cf943b573aeb4ae3fe9c75 | [
"MIT"
] | null | null | null | sample/collect/service_imp/common/filters/template_tool.py | SelfDown/omnis-collect3 | 84f16ed108e4295719cf943b573aeb4ae3fe9c75 | [
"MIT"
] | null | null | null | sample/collect/service_imp/common/filters/template_tool.py | SelfDown/omnis-collect3 | 84f16ed108e4295719cf943b573aeb4ae3fe9c75 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@Time: 2021/7/16 13:58
@Author: zzhang zzhang@cenboomh.com
@File: template_tool.py
@desc:
"""
from jinja2 import Environment
from collect.collect_service import CollectService
# 全局变量缓存模板信息
_cache = {}
class TemplateTool(CollectService):
filter_config = {
"uuid": {
... | 34.57732 | 87 | 0.525939 |
from jinja2 import Environment
from collect.collect_service import CollectService
_cache = {}
class TemplateTool(CollectService):
filter_config = {
"uuid": {
"path": "collect.service_imp.common.filters.template_filters.uuid",
"class_name": "UUIDFilter",
"method": "fi... | true | true |
f76f7bdf14085a0e4d42d2a54dc28f2b4717a80f | 3,664 | py | Python | webservices/models.py | nbxorg/webservices | e66e426b6eb7c91228667f2813a4a8bf70d5571d | [
"BSD-3-Clause"
] | 14 | 2015-11-24T08:56:32.000Z | 2022-03-13T22:52:42.000Z | webservices/models.py | nbxorg/webservices | e66e426b6eb7c91228667f2813a4a8bf70d5571d | [
"BSD-3-Clause"
] | 2 | 2015-11-25T06:29:13.000Z | 2016-05-10T15:00:06.000Z | webservices/models.py | nbxorg/webservices | e66e426b6eb7c91228667f2813a4a8bf70d5571d | [
"BSD-3-Clause"
] | 4 | 2016-06-08T22:41:05.000Z | 2018-07-25T18:09:06.000Z | # -*- coding: utf-8 -*-
try:
# python 3
# noinspection PyCompatibility
from urllib.parse import urlparse, urlunparse, urljoin
except ImportError:
# python 2
# noinspection PyCompatibility
from urlparse import urlparse, urlunparse, urljoin
from itsdangerous import TimedSerializer, SignatureExpir... | 31.316239 | 72 | 0.643832 | try:
from urllib.parse import urlparse, urlunparse, urljoin
except ImportError:
from urlparse import urlparse, urlunparse, urljoin
from itsdangerous import TimedSerializer, SignatureExpired, BadSignature
from webservices.exceptions import BadRequest, WebserviceError
PUBLIC_KEY_HEADER = 'x-se... | true | true |
f76f7c7019e88af92c0a59d4cc83ca75c094d388 | 2,075 | py | Python | datasets/generate_trainval_splits.py | dimitymiller/cac-openset | b07dadbb8caa5d7430c403734f6543ff17e2ae11 | [
"BSD-3-Clause"
] | 31 | 2020-04-08T08:32:17.000Z | 2022-02-10T20:55:46.000Z | datasets/generate_trainval_splits.py | dimitymiller/cac-openset | b07dadbb8caa5d7430c403734f6543ff17e2ae11 | [
"BSD-3-Clause"
] | 8 | 2020-07-24T08:29:28.000Z | 2022-02-01T02:02:35.000Z | datasets/generate_trainval_splits.py | dimitymiller/cac-openset | b07dadbb8caa5d7430c403734f6543ff17e2ae11 | [
"BSD-3-Clause"
] | 13 | 2020-04-08T12:16:59.000Z | 2022-03-31T10:11:44.000Z | """
Randomly select train and validation subsets from training datasets.
80/20 split ratio used for all datasets except TinyImageNet, which will use 90/10.
Dimity Miller, 2020
"""
import json
import random
import torchvision
import numpy as np
random.seed(1000)
def save_trainval_split(dataset, train_idxs, val_id... | 32.421875 | 91 | 0.743614 |
import json
import random
import torchvision
import numpy as np
random.seed(1000)
def save_trainval_split(dataset, train_idxs, val_idxs):
print("Saving {} Train/Val split to {}/trainval_idxs.json".format(dataset, dataset))
file = open('{}/trainval_idxs.json'.format(dataset), 'w')
file.write(json.dumps({'Train': t... | true | true |
f76f7ecd70716d183df0f6ee57822c99887181d3 | 839 | py | Python | pyzo/pyzokernel/__init__.py | l33tlinuxh4x0r/pyzo | 1e5e1cea6345dc8f78ab93321a7f9a01f8101be0 | [
"BSD-2-Clause"
] | 235 | 2016-03-05T17:12:12.000Z | 2022-03-22T06:35:45.000Z | pyzo/pyzokernel/__init__.py | l33tlinuxh4x0r/pyzo | 1e5e1cea6345dc8f78ab93321a7f9a01f8101be0 | [
"BSD-2-Clause"
] | 423 | 2016-02-15T20:23:46.000Z | 2022-03-26T16:36:37.000Z | pyzo/pyzokernel/__init__.py | l33tlinuxh4x0r/pyzo | 1e5e1cea6345dc8f78ab93321a7f9a01f8101be0 | [
"BSD-2-Clause"
] | 115 | 2016-04-01T14:31:33.000Z | 2022-03-17T10:59:45.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2016, the Pyzo development team
#
# Pyzo is distributed under the terms of the 2-Clause BSD License.
# The full license can be found in 'license.txt'.
"""
The pyzokernel package contains the code for the Pyzo kernel process.
This kernel is designed to be relatively lightweight; ... | 31.074074 | 72 | 0.731824 |
def printDirect(msg):
import sys
sys._pyzoInterpreter.context._strm_out.send(msg)
| true | true |
f76f7fc4519dec2e3fe21ab991a2b22e8a40f607 | 14,631 | py | Python | drawSVG.py | amjltc295/2017ARSC-Final-Project | cb8c5933ed9a55bd1042735c0091a81226adadb0 | [
"MIT"
] | 16 | 2017-06-15T16:33:21.000Z | 2022-03-20T15:56:52.000Z | drawSVG.py | amjltc295/2017ARSC-Final-Project | cb8c5933ed9a55bd1042735c0091a81226adadb0 | [
"MIT"
] | 2 | 2019-01-04T02:41:32.000Z | 2021-08-11T02:59:56.000Z | drawSVG.py | amjltc295/2017ARSC-Final-Project | cb8c5933ed9a55bd1042735c0091a81226adadb0 | [
"MIT"
] | 4 | 2017-06-16T02:39:49.000Z | 2021-08-11T01:46:04.000Z | '''
File name: readCharacter.py
Author: Ya-Liang Chang b03901014@ntu.edu.tw
Date created: 5/26/2017
Date last modified: 5/26/2017
Python Version: 3.6
Path planning for 4 DOFs palletizing robot to write Chinese characters.
Read characters from graphics.txt (See https://github.com/skishore/m... | 37.806202 | 458 | 0.570638 | import json
import pygame
import os, sys
from xml.dom import minidom
from svg.path import parse_path
SVG_SCALE = 0.12
SVG_APPROX_STEP = 0.5
X_MAX = 630
X_MIN = 330
Y_MAX = 350
Y_MIN = -350
WIDTH = X_MAX - X_MIN
HEIGHT = Y_MAX - Y_MIN
PYGAME_LINE_WIDTH = 4
PYGAME_THIN_LINE_WIDTH = 2
PYGAME_THICK_LINE_WIDTH = 7
NOT_AD... | true | true |
f76f8018c57f8949a8e85eef6a6ee62fa4339469 | 775 | py | Python | setup.py | LeadTheSalt/one_home_sensor | 8bdea704ab81738cc3cedf02cdaa3042cab95360 | [
"MIT"
] | null | null | null | setup.py | LeadTheSalt/one_home_sensor | 8bdea704ab81738cc3cedf02cdaa3042cab95360 | [
"MIT"
] | null | null | null | setup.py | LeadTheSalt/one_home_sensor | 8bdea704ab81738cc3cedf02cdaa3042cab95360 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="one_home_sensor",
version='0.1.6',
author="LeadTheSalt",
author_email="leadthesalt.soc@gmail.com",
description="My home tempearture sensor for my RaspberryPi",
long_description=long_de... | 28.703704 | 64 | 0.651613 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="one_home_sensor",
version='0.1.6',
author="LeadTheSalt",
author_email="leadthesalt.soc@gmail.com",
description="My home tempearture sensor for my RaspberryPi",
long_description=long_de... | true | true |
f76f8061576357d416a48c88f8614a697bfeeef3 | 41,474 | py | Python | tensorflow_federated/python/core/impl/federated_context/intrinsics.py | RyanMarten/federated | 43169e4224b169ad58927b783c680f4ff52d743a | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/federated_context/intrinsics.py | RyanMarten/federated | 43169e4224b169ad58927b783c680f4ff52d743a | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/federated_context/intrinsics.py | RyanMarten/federated | 43169e4224b169ad58927b783c680f4ff52d743a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 44.357219 | 86 | 0.721946 |
import warnings
import tensorflow as tf
from tensorflow_federated.python.common_libs import py_typecheck
from tensorflow_federated.python.common_libs import structure
from tensorflow_federated.python.core.impl.compiler import building_block_factory
from tensorflow_federated.python.core.impl.compiler import building_... | true | true |
f76f80f46963b84211eceaa004b3a7aeb3a5d638 | 350 | py | Python | b2sdk/transferer/__init__.py | mbra/b2-sdk-python | 5325d55111a0043be85e79560c776e5a9db7cc31 | [
"MIT"
] | null | null | null | b2sdk/transferer/__init__.py | mbra/b2-sdk-python | 5325d55111a0043be85e79560c776e5a9db7cc31 | [
"MIT"
] | null | null | null | b2sdk/transferer/__init__.py | mbra/b2-sdk-python | 5325d55111a0043be85e79560c776e5a9db7cc31 | [
"MIT"
] | null | null | null | ######################################################################
#
# File: b2sdk/transferer/__init__.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
from .transferer import ... | 25 | 70 | 0.46 |
from .transferer import Transferer
assert Transferer
| true | true |
f76f8418cdd79a52d515eb017229a1e7ef5e3913 | 950 | py | Python | workalendar/europe/malta.py | elaav/workalendar | 61a120296b5992f6a3e86741a0773b42c1d1b4fa | [
"MIT"
] | null | null | null | workalendar/europe/malta.py | elaav/workalendar | 61a120296b5992f6a3e86741a0773b42c1d1b4fa | [
"MIT"
] | null | null | null | workalendar/europe/malta.py | elaav/workalendar | 61a120296b5992f6a3e86741a0773b42c1d1b4fa | [
"MIT"
] | null | null | null | from ..core import WesternCalendar, ChristianMixin
from ..registry_tools import iso_register
@iso_register('MT')
class Malta(WesternCalendar, ChristianMixin):
'Malta'
include_good_friday = True
include_assumption = True
include_immaculate_conception = True
include_christmas = True
FIXED_HOLI... | 35.185185 | 68 | 0.584211 | from ..core import WesternCalendar, ChristianMixin
from ..registry_tools import iso_register
@iso_register('MT')
class Malta(WesternCalendar, ChristianMixin):
include_good_friday = True
include_assumption = True
include_immaculate_conception = True
include_christmas = True
FIXED_HOLIDAYS = Weste... | true | true |
f76f842b4c0ef44f56b1f50217185f360137a262 | 2,206 | py | Python | LastEmpyRange.py | define4real/hello-world | cb69b25db6d644a1fbc88194609a67ac56287b4f | [
"MIT"
] | null | null | null | LastEmpyRange.py | define4real/hello-world | cb69b25db6d644a1fbc88194609a67ac56287b4f | [
"MIT"
] | null | null | null | LastEmpyRange.py | define4real/hello-world | cb69b25db6d644a1fbc88194609a67ac56287b4f | [
"MIT"
] | null | null | null | import win32com
from win32com.client import Dispatch, DispatchEx
from win32com.client import constants
#xlApp = win32com.client.Dispatch("Excel.Application")
xlApp = win32com.client.gencache.EnsureDispatch("Excel.Application")
file_path = "C:\\Users\\Administrator\\Desktop\\haha.xlsx"
xlApp.Visible = 0
xlApp.DisplayAl... | 27.234568 | 68 | 0.599728 | import win32com
from win32com.client import Dispatch, DispatchEx
from win32com.client import constants
xlApp = win32com.client.gencache.EnsureDispatch("Excel.Application")
file_path = "C:\\Users\\Administrator\\Desktop\\haha.xlsx"
xlApp.Visible = 0
xlApp.DisplayAlerts = 0
xlBook = xlApp.Workbooks.Open(file_path, False... | true | true |
f76f843a2667e51b1c41b2fed329592fb1c23108 | 25,012 | py | Python | pypython/cpython_bridge.py | pdmccormick/pyconca2019-fun-with-compilers | 2f1025cc0b7ec182fcedab678a121a7ab93fb448 | [
"BSD-3-Clause"
] | 3 | 2019-11-17T17:56:56.000Z | 2020-02-25T18:05:05.000Z | pypython/cpython_bridge.py | pdmccormick/pyconca2019-fun-with-compilers | 2f1025cc0b7ec182fcedab678a121a7ab93fb448 | [
"BSD-3-Clause"
] | null | null | null | pypython/cpython_bridge.py | pdmccormick/pyconca2019-fun-with-compilers | 2f1025cc0b7ec182fcedab678a121a7ab93fb448 | [
"BSD-3-Clause"
] | null | null | null | import ast as C
from .ast import *
class CPythonAstTransformer(NodeTransformer):
def transform(self, node: AST, *args, **kwargs) -> C.AST:
return self.visit(node, *args, **kwargs)
def visit_AnnAssign(self, node: AnnAssign, *args, **kwargs) -> C.AnnAssign:
target = self.visit(node.target, *arg... | 33.260638 | 100 | 0.52171 | import ast as C
from .ast import *
class CPythonAstTransformer(NodeTransformer):
def transform(self, node: AST, *args, **kwargs) -> C.AST:
return self.visit(node, *args, **kwargs)
def visit_AnnAssign(self, node: AnnAssign, *args, **kwargs) -> C.AnnAssign:
target = self.visit(node.target, *arg... | true | true |
f76f84f71936de3484db0179d3dcb8f20ed482d1 | 48,421 | py | Python | Lib/subprocess.py | w0xel/python2.7-mingw32 | a7978642b17cb05b3edd04116db0fe993637ef20 | [
"PSF-2.0"
] | 1 | 2019-02-22T05:19:40.000Z | 2019-02-22T05:19:40.000Z | Lib/subprocess.py | w0xel/python2.7-mingw32 | a7978642b17cb05b3edd04116db0fe993637ef20 | [
"PSF-2.0"
] | null | null | null | Lib/subprocess.py | w0xel/python2.7-mingw32 | a7978642b17cb05b3edd04116db0fe993637ef20 | [
"PSF-2.0"
] | 1 | 2020-11-04T07:54:34.000Z | 2020-11-04T07:54:34.000Z | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.
r"""Subprocesses with ... | 37.947492 | 128 | 0.516181 |
r"""Subprocesses with accessible I/O streams
This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes.
For a complete description of this module see the Python documentation.
Main API
========
call(...): Runs a command, waits for it to complete, then return... | false | true |
f76f857f6091c49f37984553222fcf885f49c21f | 364 | py | Python | 004-RollDice/004-RollDice.py | haruki-taka8/hello-python | c18419fd387240dde81e4df546a5e8a6d37d7164 | [
"Unlicense"
] | null | null | null | 004-RollDice/004-RollDice.py | haruki-taka8/hello-python | c18419fd387240dde81e4df546a5e8a6d37d7164 | [
"Unlicense"
] | null | null | null | 004-RollDice/004-RollDice.py | haruki-taka8/hello-python | c18419fd387240dde81e4df546a5e8a6d37d7164 | [
"Unlicense"
] | null | null | null | # 004-RollDice.py
# Roll a dice and output its die face
# New concept: os, file IO, print(end="")
from random import randint
import os
result = randint(0, 5)
diePath = os.path.join(os.path.dirname(__file__), "dieFace.txt")
with open(diePath) as die:
dieFile = die.readlines()
for i in range(result*7, ... | 26 | 65 | 0.664835 |
from random import randint
import os
result = randint(0, 5)
diePath = os.path.join(os.path.dirname(__file__), "dieFace.txt")
with open(diePath) as die:
dieFile = die.readlines()
for i in range(result*7, result*7+7):
print (dieFile[i], end="") | true | true |
f76f857fca1c1a01334f8a3d8cdc5e9879d1452d | 7,596 | py | Python | scripts/generate_flags_code.py | Rishav1/chainer-compiler | 425830054abcc2f8438593120214be3835d5cbcf | [
"MIT"
] | null | null | null | scripts/generate_flags_code.py | Rishav1/chainer-compiler | 425830054abcc2f8438593120214be3835d5cbcf | [
"MIT"
] | null | null | null | scripts/generate_flags_code.py | Rishav1/chainer-compiler | 425830054abcc2f8438593120214be3835d5cbcf | [
"MIT"
] | null | null | null | import argparse
FLAGS = {
'compiler_log': {
'type': 'bool',
'doc': 'Enables logging.'
},
'permissive': {
'type': 'bool',
'doc': 'The compiler will accept some kinds of invalid operations to support older ONNX, etc.'
},
'skip_inference': {
'type': 'bool',
... | 25.749153 | 113 | 0.535282 | import argparse
FLAGS = {
'compiler_log': {
'type': 'bool',
'doc': 'Enables logging.'
},
'permissive': {
'type': 'bool',
'doc': 'The compiler will accept some kinds of invalid operations to support older ONNX, etc.'
},
'skip_inference': {
'type': 'bool',
... | true | true |
f76f8611e09cd51e622ef51fef33bba1820891ae | 6,314 | py | Python | setup.py | njbradley/tcr-dist | 1f5509a7f7bac3cb7f6cae686eea425dfe523088 | [
"MIT"
] | 1 | 2021-05-02T05:26:05.000Z | 2021-05-02T05:26:05.000Z | setup.py | njbradley/tcr-dist | 1f5509a7f7bac3cb7f6cae686eea425dfe523088 | [
"MIT"
] | null | null | null | setup.py | njbradley/tcr-dist | 1f5509a7f7bac3cb7f6cae686eea425dfe523088 | [
"MIT"
] | null | null | null | ##
## Run this script in the main repository directory by typing
##
## python setup.py
##
## If you are getting errors, re-run the script saving the output
## and contact pbradley@fredhutch.org for help trouble-shooting.
##
##
from os import popen, system, chdir, mkdir
from os.path import exists, isdir, isfile
from sys... | 28.1875 | 129 | 0.64064 | from os import popen, system, chdir, mkdir
from os.path import exists, isdir, isfile
from sys import stderr,exit,platform
msg = """
This script will download a set of compatible BLAST executables, parameter and
database files used by the tcr-dist pipeline, and some TCR datasets for
testing and analysis. It should be r... | false | true |
f76f87d8a4520824c898a21b483752b25ff224a4 | 641 | py | Python | depthai_profiler.py | Pandinosaurus/depthai | a46ad95744d8175f1c87bf8cd92c7423a84b8607 | [
"MIT"
] | 2 | 2021-03-08T04:49:14.000Z | 2022-01-31T16:02:01.000Z | depthai_profiler.py | Pandinosaurus/depthai | a46ad95744d8175f1c87bf8cd92c7423a84b8607 | [
"MIT"
] | null | null | null | depthai_profiler.py | Pandinosaurus/depthai | a46ad95744d8175f1c87bf8cd92c7423a84b8607 | [
"MIT"
] | 1 | 2021-05-27T02:08:07.000Z | 2021-05-27T02:08:07.000Z | #!/usr/bin/env python3
#depthai function profiler
import subprocess
import sys
import numpy as np
#this is a debugging tool, that's why it's not added to requirements.txt
try:
import snakeviz
except ImportError:
raise ImportError('\033[1;5;31m snakeviz module not found, run: \033[0m python3 -m pip install sna... | 29.136364 | 110 | 0.700468 |
import subprocess
import sys
import numpy as np
try:
import snakeviz
except ImportError:
raise ImportError('\033[1;5;31m snakeviz module not found, run: \033[0m python3 -m pip install snakeviz ')
if __name__ == "__main__":
output_profile_file = 'depthai.prof'
cmd = ["python3", "-m", "cProfile", "-o",... | true | true |
f76f88b3060b01bc2a319344a353d6e2cc7feee7 | 10,375 | py | Python | tests/pytest/test_projects.py | cloudtruth/cloudtruth-cli | 685a4a3133af1adbc837821a5dd2c65edc415858 | [
"Apache-2.0"
] | null | null | null | tests/pytest/test_projects.py | cloudtruth/cloudtruth-cli | 685a4a3133af1adbc837821a5dd2c65edc415858 | [
"Apache-2.0"
] | 30 | 2021-03-19T22:32:32.000Z | 2022-02-11T23:55:40.000Z | tests/pytest/test_projects.py | cloudtruth/cloudtruth-cli | 685a4a3133af1adbc837821a5dd2c65edc415858 | [
"Apache-2.0"
] | 2 | 2022-02-11T18:44:28.000Z | 2022-02-25T18:26:14.000Z | import unittest
from testcase import TestCase
from testcase import find_by_prop
from testcase import TEST_PAGE_SIZE
class TestProjects(TestCase):
def test_project_basic(self):
# verify `proj_name` does not yet exist
base_cmd = self.get_cli_base_cmd()
cmd_env = self.get_cmd_env()
p... | 43.592437 | 113 | 0.647904 | import unittest
from testcase import TestCase
from testcase import find_by_prop
from testcase import TEST_PAGE_SIZE
class TestProjects(TestCase):
def test_project_basic(self):
base_cmd = self.get_cli_base_cmd()
cmd_env = self.get_cmd_env()
proj_name = self.make_name("test-proj-nam... | true | true |
f76f8901948fda0bc80a835922398c55b4d1c526 | 6,167 | py | Python | examples/paper/plot_error.py | IJSComplexMatter/cddm | f4d7521ad88271027c61743b2e8a2355a40cb117 | [
"MIT"
] | 4 | 2021-01-30T12:26:58.000Z | 2021-11-04T15:26:21.000Z | examples/paper/plot_error.py | IJSComplexMatter/cddm | f4d7521ad88271027c61743b2e8a2355a40cb117 | [
"MIT"
] | 2 | 2020-03-12T15:24:04.000Z | 2021-06-30T10:53:32.000Z | examples/paper/plot_error.py | IJSComplexMatter/cddm | f4d7521ad88271027c61743b2e8a2355a40cb117 | [
"MIT"
] | 4 | 2020-02-13T10:19:01.000Z | 2021-06-18T18:52:55.000Z | """Plots fig 3. and fig 4. from the paper.
You must first create data calling the following scripts:
$ python auto_correlate_random_error.py
$ python auto_correlate_standard_error.py
$ python auto_correlate_fast_error.py
$ python cross_correlate_error.py
"""
from cddm.sim import random_time_count
from cddm.mult... | 29.366667 | 146 | 0.640344 |
from cddm.sim import random_time_count
from cddm.multitau import ccorr_multi_count, acorr_multi_count,log_merge_count, multilevel, merge_multilevel
from cddm.norm import sigma_prime_weighted, weight_prime_from_g, sigma_weighted, weight_from_g
import matplotlib.pyplot as plt
import numpy as np
from examples.paper.con... | true | true |
f76f89cc5a0d373ba86d082de925ac59f622af5c | 12,552 | py | Python | latest version/server/info.py | Baigei-Gu/Arcaea-server | 26216bf84ad34918d66a6c9d4e1a860c4e553083 | [
"MIT"
] | null | null | null | latest version/server/info.py | Baigei-Gu/Arcaea-server | 26216bf84ad34918d66a6c9d4e1a860c4e553083 | [
"MIT"
] | null | null | null | latest version/server/info.py | Baigei-Gu/Arcaea-server | 26216bf84ad34918d66a6c9d4e1a860c4e553083 | [
"MIT"
] | null | null | null | import sqlite3
import server.arcworld
import server.arcpurchase
import time
def int2b(x):
# int与布尔值转换
if x is None or x == 0:
return False
else:
return True
def get_recent_score(c, user_id):
# 得到用户最近一次的成绩,返回列表
c.execute('''select * from user where user_id = :x''', {'x': user_id})... | 34.963788 | 795 | 0.428697 | import sqlite3
import server.arcworld
import server.arcpurchase
import time
def int2b(x):
if x is None or x == 0:
return False
else:
return True
def get_recent_score(c, user_id):
c.execute('''select * from user where user_id = :x''', {'x': user_id})
x = c.fetchone()
if x ... | true | true |
f76f8b09f19ca43ec56a2a141615188cbdbfea82 | 1,797 | py | Python | rlkit/torch/core.py | panpanyunshi/rlkit | e1f6c9e59ab2baab93d35385cdc43ab3632b2b65 | [
"MIT"
] | null | null | null | rlkit/torch/core.py | panpanyunshi/rlkit | e1f6c9e59ab2baab93d35385cdc43ab3632b2b65 | [
"MIT"
] | null | null | null | rlkit/torch/core.py | panpanyunshi/rlkit | e1f6c9e59ab2baab93d35385cdc43ab3632b2b65 | [
"MIT"
] | null | null | null | import numpy as np
import torch
from rlkit.torch import pytorch_util as ptu
def eval_np(module, *args, **kwargs):
"""
Eval this module with a numpy interface, 返回numpy类型变量
Same as a call to __call__ except all Variable input/outputs are
replaced with numpy equivalents.
Assumes the output is eith... | 24.958333 | 72 | 0.662771 | import numpy as np
import torch
from rlkit.torch import pytorch_util as ptu
def eval_np(module, *args, **kwargs):
torch_args = tuple(torch_ify(x) for x in args)
torch_kwargs = {k: torch_ify(v) for k, v in kwargs.items()}
outputs = module(*torch_args, **torch_kwargs)
if isinstance(outputs, tuple):
... | true | true |
f76f8bc6719fa2753fe6f5ad90e5fb3efe578d4c | 1,159 | py | Python | app/__init__.py | CC-lgm/wjssb | fab2b1edac7d93d26c0a6c555df604355fd1c884 | [
"MIT"
] | null | null | null | app/__init__.py | CC-lgm/wjssb | fab2b1edac7d93d26c0a6c555df604355fd1c884 | [
"MIT"
] | 1 | 2020-12-10T11:16:05.000Z | 2020-12-10T11:16:05.000Z | app/__init__.py | CC-lgm/wjssb | fab2b1edac7d93d26c0a6c555df604355fd1c884 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_mail import Mail
from flask_moment import Moment
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_pagedown import PageDown
from config import config
bootstrap = Bootstrap()
mail = Mail()
moment = Moment()
db... | 26.340909 | 63 | 0.767041 | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_mail import Mail
from flask_moment import Moment
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_pagedown import PageDown
from config import config
bootstrap = Bootstrap()
mail = Mail()
moment = Moment()
db... | true | true |
f76f8cd3557048cd73a17995ccf0bcc38e4fe79c | 7,811 | py | Python | anima/ui/widgets/task_timing.py | MehmetErer/anima | f92ae599b5a4c181fc8e131a9ccdde537e635303 | [
"MIT"
] | 101 | 2015-02-08T22:20:11.000Z | 2022-03-21T18:56:42.000Z | anima/ui/widgets/task_timing.py | MehmetErer/anima | f92ae599b5a4c181fc8e131a9ccdde537e635303 | [
"MIT"
] | 23 | 2016-11-30T08:33:21.000Z | 2021-01-26T12:11:12.000Z | anima/ui/widgets/task_timing.py | MehmetErer/anima | f92ae599b5a4c181fc8e131a9ccdde537e635303 | [
"MIT"
] | 27 | 2015-01-03T06:49:45.000Z | 2021-12-28T03:30:54.000Z | # -*- coding: utf-8 -*-
from anima.ui.lib import QtCore, QtWidgets
class TaskTimingInfoWidget(QtWidgets.QWidget):
"""Displays task timing details
"""
def __init__(self, task=None, parent=None, **kwargs):
self._task = None
self.parent = parent
super(TaskTimingInfoWidget, self).__... | 33.238298 | 71 | 0.576495 |
from anima.ui.lib import QtCore, QtWidgets
class TaskTimingInfoWidget(QtWidgets.QWidget):
def __init__(self, task=None, parent=None, **kwargs):
self._task = None
self.parent = parent
super(TaskTimingInfoWidget, self).__init__(parent=parent)
self.vertical_layout = None
... | true | true |
f76f8cdb315a843b768c9855c410d1cdc1b70781 | 15,909 | py | Python | src/OFS/DTMLMethod.py | dek4nice/Zope | ec4765fc0007c4e78aafcbeef510077444f8551a | [
"ZPL-2.1"
] | null | null | null | src/OFS/DTMLMethod.py | dek4nice/Zope | ec4765fc0007c4e78aafcbeef510077444f8551a | [
"ZPL-2.1"
] | null | null | null | src/OFS/DTMLMethod.py | dek4nice/Zope | ec4765fc0007c4e78aafcbeef510077444f8551a | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 33.422269 | 94 | 0.597963 | from AccessControl import getSecurityManager
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import change_proxy_roles
from AccessControl.Permissions import ftp_access
from AccessControl.Permissions import view as View from AccessControl.Permissions import view_management_screens
fr... | true | true |
f76f8cf7b39c8f1a79ae2bf8dd3cad1cfa2e92b8 | 28,558 | py | Python | scripts/modules/opbeans.py | Qard/apm-integration-testing | 1f882d1ac67165a76dcdca69261963640405ca69 | [
"Apache-2.0"
] | null | null | null | scripts/modules/opbeans.py | Qard/apm-integration-testing | 1f882d1ac67165a76dcdca69261963640405ca69 | [
"Apache-2.0"
] | null | null | null | scripts/modules/opbeans.py | Qard/apm-integration-testing | 1f882d1ac67165a76dcdca69261963640405ca69 | [
"Apache-2.0"
] | null | null | null | #
# Opbeans Services
#
from collections import OrderedDict
from .helpers import add_agent_environment, curl_healthcheck, wget_healthcheck
from .service import Service, DEFAULT_APM_SERVER_URL, DEFAULT_APM_JS_SERVER_URL
class OpbeansService(Service):
def __init__(self, **options):
super(OpbeansService, se... | 41.090647 | 137 | 0.597486 |
from collections import OrderedDict
from .helpers import add_agent_environment, curl_healthcheck, wget_healthcheck
from .service import Service, DEFAULT_APM_SERVER_URL, DEFAULT_APM_JS_SERVER_URL
class OpbeansService(Service):
def __init__(self, **options):
super(OpbeansService, self).__init__(**options)... | true | true |
f76f8e181e6635c86576107fa1d30d62af17c114 | 158 | py | Python | FictionTools/amitools/test/suite/vprintf.py | polluks/Puddle-BuildTools | c1762d53a33002b62d8cffe3db129505a387bec3 | [
"BSD-2-Clause"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | FictionTools/amitools/test/suite/vprintf.py | polluks/Puddle-BuildTools | c1762d53a33002b62d8cffe3db129505a387bec3 | [
"BSD-2-Clause"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | FictionTools/amitools/test/suite/vprintf.py | polluks/Puddle-BuildTools | c1762d53a33002b62d8cffe3db129505a387bec3 | [
"BSD-2-Clause"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z | import pytest
def vprintf_test(vamos):
if vamos.flavor == "agcc":
pytest.skip("vprintf not supported")
vamos.run_prog_check_data("vprintf")
| 19.75 | 44 | 0.689873 | import pytest
def vprintf_test(vamos):
if vamos.flavor == "agcc":
pytest.skip("vprintf not supported")
vamos.run_prog_check_data("vprintf")
| true | true |
f76f8f3b8f91794b322fc7012d1be65476857d06 | 6,267 | py | Python | gym/decision_transformer/models/decision_transformer.py | asaran/decision-transformer | f04280e3668a992c41b38bdfb6b6181d61b4dc52 | [
"MIT"
] | 1,063 | 2021-06-02T09:35:42.000Z | 2022-03-31T20:12:55.000Z | gym/decision_transformer/models/decision_transformer.py | Amadeus979/decision-transformer | f6f8bf283256d616d213ac5bd07cb7f3efb101b3 | [
"MIT"
] | 34 | 2021-06-04T18:34:29.000Z | 2022-03-31T22:25:19.000Z | gym/decision_transformer/models/decision_transformer.py | Amadeus979/decision-transformer | f6f8bf283256d616d213ac5bd07cb7f3efb101b3 | [
"MIT"
] | 186 | 2021-06-02T15:36:44.000Z | 2022-03-30T02:03:41.000Z | import numpy as np
import torch
import torch.nn as nn
import transformers
from decision_transformer.models.model import TrajectoryModel
from decision_transformer.models.trajectory_gpt2 import GPT2Model
class DecisionTransformer(TrajectoryModel):
"""
This model uses GPT to model (Return_1, state_1, action_1... | 44.446809 | 143 | 0.650231 | import numpy as np
import torch
import torch.nn as nn
import transformers
from decision_transformer.models.model import TrajectoryModel
from decision_transformer.models.trajectory_gpt2 import GPT2Model
class DecisionTransformer(TrajectoryModel):
def __init__(
self,
state_dim,
... | true | true |
f76f8f3c1eb7967db32e99858fe9dbda4bbddd06 | 27,810 | py | Python | model_gtt/run_pl_gtt.py | elwintay/clearml_test | c87985303e69490e83ec779d098570bc505f80ae | [
"MIT"
] | null | null | null | model_gtt/run_pl_gtt.py | elwintay/clearml_test | c87985303e69490e83ec779d098570bc505f80ae | [
"MIT"
] | null | null | null | model_gtt/run_pl_gtt.py | elwintay/clearml_test | c87985303e69490e83ec779d098570bc505f80ae | [
"MIT"
] | null | null | null | import argparse
import glob
import pandas as pd
import logging
import os
import json
from collections import OrderedDict
from eval import eval_tf
import numpy as np
import torch
from seqeval.metrics import f1_score, precision_score, recall_score, accuracy_score
from torch.nn import CrossEntropyLoss
from torch.utils.da... | 50.563636 | 181 | 0.545236 | import argparse
import glob
import pandas as pd
import logging
import os
import json
from collections import OrderedDict
from eval import eval_tf
import numpy as np
import torch
from seqeval.metrics import f1_score, precision_score, recall_score, accuracy_score
from torch.nn import CrossEntropyLoss
from torch.utils.da... | true | true |
f76f90dfa9d267f7eed4ee6e86293ee707fce8f1 | 6,613 | py | Python | virtual/lib/python3.6/site-packages/sqlalchemy/util/__init__.py | mag49/pitch | 5b065c28dfeeb4b57e5d0e81992bada16208daca | [
"Unlicense"
] | 2 | 2020-03-02T14:51:06.000Z | 2020-03-02T14:51:09.000Z | venv/Lib/site-packages/sqlalchemy/util/__init__.py | Gushono/Projeto-cenforce | 978e42c975477ef2e8f57a7379eed55bc13286aa | [
"Apache-2.0"
] | 10 | 2020-03-24T10:47:53.000Z | 2021-04-08T19:51:44.000Z | venv/Lib/site-packages/sqlalchemy/util/__init__.py | Gushono/Projeto-cenforce | 978e42c975477ef2e8f57a7379eed55bc13286aa | [
"Apache-2.0"
] | 2 | 2020-02-21T10:39:32.000Z | 2020-04-12T10:25:23.000Z | # util/__init__.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from collections import defaultdict # noqa
from contextlib import contextmanager ... | 43.222222 | 69 | 0.799032 |
from collections import defaultdict from contextlib import contextmanager from functools import partial from functools import update_wrapper
from ._collections import coerce_generator_arg from ._collections import collections_abc from ._collections import column_dict from ._collections import column_set from... | true | true |
f76f90fd3ed109a3a5610a317d7b7c256d93ba99 | 11,050 | py | Python | Development/models/DWT2.py | simonsimon006/tensorflow-wavelets | 21a095bf0048ae2488ca5ae4961d2cbfe94263a9 | [
"MIT"
] | null | null | null | Development/models/DWT2.py | simonsimon006/tensorflow-wavelets | 21a095bf0048ae2488ca5ae4961d2cbfe94263a9 | [
"MIT"
] | 1 | 2021-11-11T14:47:43.000Z | 2021-11-11T14:52:51.000Z | Development/models/DWT2.py | simonsimon006/tensorflow-wavelets | 21a095bf0048ae2488ca5ae4961d2cbfe94263a9 | [
"MIT"
] | 1 | 2021-11-11T12:18:21.000Z | 2021-11-11T12:18:21.000Z | import os
import cv2
import math
import pywt
import numpy as np
from utils import mse
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.datasets import mnist, cifar10
# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # for tensor flow warning
# os.environ['CUDA_VI... | 38.103448 | 115 | 0.594932 | import os
import cv2
import math
import pywt
import numpy as np
from utils import mse
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.datasets import mnist, cifar10
class DWT(layers.Layer):
def __init__(self, name='haar', **kwargs):
super(DWT... | true | true |
f76f9273e248f2a20d1d8fa88043f5da01fb8c0d | 4,509 | py | Python | intropyproject-classify-pet-images/classify_images.py | djarrin/udacity-use-pre-trained-image-classifier | afe4d2a273048d15b4b2fe37411fba725355d2b6 | [
"MIT"
] | null | null | null | intropyproject-classify-pet-images/classify_images.py | djarrin/udacity-use-pre-trained-image-classifier | afe4d2a273048d15b4b2fe37411fba725355d2b6 | [
"MIT"
] | null | null | null | intropyproject-classify-pet-images/classify_images.py | djarrin/udacity-use-pre-trained-image-classifier | afe4d2a273048d15b4b2fe37411fba725355d2b6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# */AIPND-revision/intropyproject-classify-pet-images/classify_images.py
#
# PROGRAMMER: David Jarrin
# DATE CREATED: 3/1/19
# REVISED DATE: 3/2/19
# PURPOSE: Create a function classify_images that uses the classifier function
# to create the classifier labels and... | 54.987805 | 90 | 0.696385 | # classifier label as the item at index 1 of the list and the comparison
# of the pet and classifier labels as the item at index 2 of the list.
#
##
# Imports classifier function for using CNN to classify images
from classifier import classifier
# TODO 3: Define classify_images function below, spec... | true | true |
f76f92d00f67f64a16465a35584839d94ab7f9d7 | 23,331 | py | Python | chainer_/chainercv2/models/seresnet_cifar.py | naviocean/imgclsmob | f2993d3ce73a2f7ddba05da3891defb08547d504 | [
"MIT"
] | 2,649 | 2018-08-03T14:18:00.000Z | 2022-03-31T08:08:17.000Z | chainer_/chainercv2/models/seresnet_cifar.py | naviocean/imgclsmob | f2993d3ce73a2f7ddba05da3891defb08547d504 | [
"MIT"
] | 95 | 2018-08-13T01:46:03.000Z | 2022-03-13T08:38:14.000Z | chainer_/chainercv2/models/seresnet_cifar.py | naviocean/imgclsmob | f2993d3ce73a2f7ddba05da3891defb08547d504 | [
"MIT"
] | 549 | 2018-08-06T08:09:22.000Z | 2022-03-31T08:08:21.000Z | """
SE-ResNet for CIFAR/SVHN, implemented in Chainer.
Original paper: 'Squeeze-and-Excitation Networks,' https://arxiv.org/abs/1709.01507.
"""
__all__ = ['CIFARSEResNet', 'seresnet20_cifar10', 'seresnet20_cifar100', 'seresnet20_svhn',
'seresnet56_cifar10', 'seresnet56_cifar100', 'seresnet56_svhn',
... | 37.389423 | 120 | 0.644122 |
__all__ = ['CIFARSEResNet', 'seresnet20_cifar10', 'seresnet20_cifar100', 'seresnet20_svhn',
'seresnet56_cifar10', 'seresnet56_cifar100', 'seresnet56_svhn',
'seresnet110_cifar10', 'seresnet110_cifar100', 'seresnet110_svhn',
'seresnet164bn_cifar10', 'seresnet164bn_cifar100', 'seresnet164... | true | true |
f76f93c528d42c49160caf3fe14b2ec23b61b766 | 79,094 | py | Python | platform/gsutil/gslib/boto_translation.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | 1 | 2019-01-14T17:38:35.000Z | 2019-01-14T17:38:35.000Z | platform/gsutil/gslib/boto_translation.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | 1 | 2019-05-07T06:22:16.000Z | 2019-05-07T07:03:24.000Z | platform/gsutil/gslib/boto_translation.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 44.63544 | 87 | 0.675424 | """XML/boto gsutil Cloud API implementation for GCS and Amazon S3."""
from __future__ import absolute_import
import base64
import binascii
import datetime
import errno
import httplib
import json
import multiprocessing
import os
import pickle
import random
import re
import socket
import tempfile
import textwrap
import... | false | true |
f76f942fe91e757fa75827b757b394980608372c | 184,535 | py | Python | tests/conftest.py | chetansurwade/great_expectations | f488d861f3c00c73a6181d6bd5788fb8895079d9 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | chetansurwade/great_expectations | f488d861f3c00c73a6181d6bd5788fb8895079d9 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | chetansurwade/great_expectations | f488d861f3c00c73a6181d6bd5788fb8895079d9 | [
"Apache-2.0"
] | null | null | null | import datetime
import locale
import logging
import os
import random
import shutil
import sys
import warnings
from typing import Dict, List, Optional
import numpy as np
import pandas as pd
import pytest
from freezegun import freeze_time
from ruamel.yaml import YAML
import great_expectations as ge
from great_expectati... | 43.409786 | 432 | 0.62813 | import datetime
import locale
import logging
import os
import random
import shutil
import sys
import warnings
from typing import Dict, List, Optional
import numpy as np
import pandas as pd
import pytest
from freezegun import freeze_time
from ruamel.yaml import YAML
import great_expectations as ge
from great_expectati... | true | true |
f76f94e138875362e724312f4c7f8ac15e79fc5a | 679 | py | Python | ucsmsdk/methodmeta/ConfigGetXmlFileStrMeta.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 78 | 2015-11-30T14:10:05.000Z | 2022-02-13T00:29:08.000Z | ucsmsdk/methodmeta/ConfigGetXmlFileStrMeta.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 113 | 2015-11-20T09:42:46.000Z | 2022-03-16T16:53:29.000Z | ucsmsdk/methodmeta/ConfigGetXmlFileStrMeta.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 86 | 2015-12-12T08:22:18.000Z | 2022-01-23T03:56:34.000Z | """This module contains the meta information of ConfigGetXmlFileStr ExternalMethod."""
from ..ucscoremeta import MethodMeta, MethodPropertyMeta
method_meta = MethodMeta("ConfigGetXmlFileStr", "configGetXmlFileStr", "Version142b")
prop_meta = {
"cookie": MethodPropertyMeta("Cookie", "cookie", "Xs:string", "Versio... | 37.722222 | 111 | 0.715758 |
from ..ucscoremeta import MethodMeta, MethodPropertyMeta
method_meta = MethodMeta("ConfigGetXmlFileStr", "configGetXmlFileStr", "Version142b")
prop_meta = {
"cookie": MethodPropertyMeta("Cookie", "cookie", "Xs:string", "Version142b", "InputOutput", False),
"in_file_path": MethodPropertyMeta("InFilePath", "in... | true | true |
f76f94f8e180c8fe1e7e46c991ee97c3ff852943 | 418 | py | Python | v07FiringSpaceship/display.py | ccurtis7/gamejam2022 | 13833f162447a5125e4f3a1e5934bfe58148cdd0 | [
"MIT"
] | null | null | null | v07FiringSpaceship/display.py | ccurtis7/gamejam2022 | 13833f162447a5125e4f3a1e5934bfe58148cdd0 | [
"MIT"
] | null | null | null | v07FiringSpaceship/display.py | ccurtis7/gamejam2022 | 13833f162447a5125e4f3a1e5934bfe58148cdd0 | [
"MIT"
] | null | null | null | # Display Module for Shmup
# Import Modules
import pygame
import consts
from os import path
# Load Background Graphics
background_img = pygame.image.load(path.join(consts.img_dir, 'background.png')).convert()
background = pygame.transform.scale(background_img, (consts.GAME_WIDTH, consts.GAME_HEIGHT))
background_rect ... | 29.857143 | 92 | 0.801435 |
import pygame
import consts
from os import path
background_img = pygame.image.load(path.join(consts.img_dir, 'background.png')).convert()
background = pygame.transform.scale(background_img, (consts.GAME_WIDTH, consts.GAME_HEIGHT))
background_rect = background.get_rect()
def draw_background(screen):
screen.blit(b... | true | true |
f76f952c53d1d835c977f249f4c902e436954bbc | 11,662 | py | Python | pandas/core/algorithms.py | drudd/pandas | 99922b9175c4ca6acb0f42dd17c01c507cbd94d6 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/core/algorithms.py | drudd/pandas | 99922b9175c4ca6acb0f42dd17c01c507cbd94d6 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/core/algorithms.py | drudd/pandas | 99922b9175c4ca6acb0f42dd17c01c507cbd94d6 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | """
Generic data algorithms. This module is experimental at the moment and not
intended for public consumption
"""
from __future__ import division
from warnings import warn
import numpy as np
import pandas.core.common as com
import pandas.algos as algos
import pandas.hashtable as htable
import pandas.compat as compat
... | 28.169082 | 92 | 0.633339 | from __future__ import division
from warnings import warn
import numpy as np
import pandas.core.common as com
import pandas.algos as algos
import pandas.hashtable as htable
import pandas.compat as compat
def match(to_match, values, na_sentinel=-1):
values = com._asarray_tuplesafe(values)
if issubclass(values.... | true | true |
f76f95779cb5f5ef947dffe812af03ff38cc7a98 | 15,750 | py | Python | src/datafinder/core/item/privileges/acl.py | schlauch/DataFinder | 958fda4f3064f9f6b2034da396a20ac9d9abd52f | [
"BSD-3-Clause"
] | 9 | 2016-05-25T06:12:52.000Z | 2021-04-30T07:22:48.000Z | src/datafinder/core/item/privileges/acl.py | schlauch/DataFinder | 958fda4f3064f9f6b2034da396a20ac9d9abd52f | [
"BSD-3-Clause"
] | 6 | 2016-03-29T13:38:18.000Z | 2017-01-18T15:57:42.000Z | src/datafinder/core/item/privileges/acl.py | schlauch/DataFinder | 958fda4f3064f9f6b2034da396a20ac9d9abd52f | [
"BSD-3-Clause"
] | 7 | 2016-06-15T12:01:22.000Z | 2022-03-05T08:50:25.000Z | # $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are
#met:
#
... | 40.803109 | 119 | 0.636762 |
from datafinder.core.item.privileges.ace import AccessControlListEntry
from datafinder.core.item.privileges import privilege
__version__ = "$Revision-Id$"
class AccessControlList(object):
_CONTENT_PRIVS = ([privilege.READ_PRIVILEGE], [privilege.WRITE_CONTENT,
... | true | true |
f76f96a8aba790c52ab961d511f16e1fc8654250 | 774 | py | Python | django_gotolong/ftwhl/migrations/0001_initial.py | ParikhKadam/gotolong | 839beb8aa37055a2078eaa289b8ae05b62e8905e | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 15 | 2019-12-06T16:19:45.000Z | 2021-08-20T13:22:22.000Z | django_gotolong/ftwhl/migrations/0001_initial.py | ParikhKadam/gotolong | 839beb8aa37055a2078eaa289b8ae05b62e8905e | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 14 | 2020-12-08T10:45:05.000Z | 2021-09-21T17:23:45.000Z | django_gotolong/ftwhl/migrations/0001_initial.py | ParikhKadam/gotolong | 839beb8aa37055a2078eaa289b8ae05b62e8905e | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 9 | 2020-01-01T03:04:29.000Z | 2021-04-18T08:42:30.000Z | # Generated by Django 3.1.5 on 2021-03-07 16:32
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Ftwhl',
fields=[
('ftwhl_ticker', models.Te... | 27.642857 | 86 | 0.549096 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Ftwhl',
fields=[
('ftwhl_ticker', models.TextField(primary_key=True, serialize=False)),
... | true | true |
f76f96d3287e694566c19329e8afed961689916d | 71 | py | Python | XtDac/BayesianBlocks/__init__.py | giacomov/XtDac | 60eb1f1d492c7ab3099731738c257955502194a6 | [
"BSD-3-Clause"
] | null | null | null | XtDac/BayesianBlocks/__init__.py | giacomov/XtDac | 60eb1f1d492c7ab3099731738c257955502194a6 | [
"BSD-3-Clause"
] | null | null | null | XtDac/BayesianBlocks/__init__.py | giacomov/XtDac | 60eb1f1d492c7ab3099731738c257955502194a6 | [
"BSD-3-Clause"
] | null | null | null | from BayesianBlocks import bayesian_blocks, bayesian_blocks_not_unique
| 35.5 | 70 | 0.915493 | from BayesianBlocks import bayesian_blocks, bayesian_blocks_not_unique
| true | true |
f76f9775ba329753cbe79f6581dcc0c2dc6fec5c | 901 | py | Python | src/ggrc/models/facility.py | HLD/ggrc-core | 9bdc0fc6ca9e252f4919db682d80e360d5581eb4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/models/facility.py | HLD/ggrc-core | 9bdc0fc6ca9e252f4919db682d80e360d5581eb4 | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | src/ggrc/models/facility.py | HLD/ggrc-core | 9bdc0fc6ca9e252f4919db682d80e360d5581eb4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-11T22:16:56.000Z | 2017-11-11T22:16:56.000Z | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc import db
from ggrc.access_control.roleable import Roleable
from ggrc.fulltext.mixin import Indexed
from ggrc.models.comment import Commentable
from .mixins import (BusinessObject, LastDeprecatedTi... | 36.04 | 78 | 0.751387 |
from ggrc import db
from ggrc.access_control.roleable import Roleable
from ggrc.fulltext.mixin import Indexed
from ggrc.models.comment import Commentable
from .mixins import (BusinessObject, LastDeprecatedTimeboxed,
CustomAttributable, TestPlanned)
from .object_document import PublicDocumentable
f... | true | true |
f76f9789d844b27510d71a02403a3d6a571102d4 | 10,574 | py | Python | tools/grit/grit/tool/resize.py | meego-tablet-ux/meego-app-browser | 0f4ef17bd4b399c9c990a2f6ca939099495c2b9c | [
"BSD-3-Clause"
] | 1 | 2015-10-12T09:14:22.000Z | 2015-10-12T09:14:22.000Z | tools/grit/grit/tool/resize.py | meego-tablet-ux/meego-app-browser | 0f4ef17bd4b399c9c990a2f6ca939099495c2b9c | [
"BSD-3-Clause"
] | null | null | null | tools/grit/grit/tool/resize.py | meego-tablet-ux/meego-app-browser | 0f4ef17bd4b399c9c990a2f6ca939099495c2b9c | [
"BSD-3-Clause"
] | 1 | 2020-11-04T07:22:28.000Z | 2020-11-04T07:22:28.000Z | #!/usr/bin/python2.4
# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''The 'grit resize' tool.
'''
import getopt
import os
import types
from grit.tool import interface
from grit.tool import bui... | 34.782895 | 81 | 0.681672 |
'''The 'grit resize' tool.
'''
import getopt
import os
import types
from grit.tool import interface
from grit.tool import build
from grit import grd_reader
from grit import pseudo
from grit import util
from grit.node import include
from grit.node import structure
from grit.node import message
from grit.format impo... | false | true |
f76f9833e52e5ab2a796f9e69f7df0333adba28f | 1,436 | py | Python | apps/usuarios/urls.py | LucasSantus/votacao | 8e81902a6dce9bb96ae704771770de9b30ea4ef5 | [
"MIT"
] | 2 | 2021-07-28T16:33:15.000Z | 2021-07-29T00:46:48.000Z | apps/usuarios/urls.py | LucasSantus/votacao | 8e81902a6dce9bb96ae704771770de9b30ea4ef5 | [
"MIT"
] | 18 | 2021-07-28T16:48:38.000Z | 2021-08-23T18:26:21.000Z | apps/usuarios/urls.py | LucasSantus/votation | 8e81902a6dce9bb96ae704771770de9b30ea4ef5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path
from .views import *
from django.contrib.auth import views as auth_views
urlpatterns = [
# PESSOA
path("pessoa/registrar/", registrar_pessoa, name="registrar_pessoa"),
path("pessoa/listar/", listar_pessoas, name="listar_pessoas"),
# Perfil
... | 49.517241 | 189 | 0.754178 | from django.contrib import admin
from django.urls import path
from .views import *
from django.contrib.auth import views as auth_views
urlpatterns = [
path("pessoa/registrar/", registrar_pessoa, name="registrar_pessoa"),
path("pessoa/listar/", listar_pessoas, name="listar_pessoas"),
path("usuario/... | true | true |
f76f993dee6661ab65ee3a7f5f947171781b292d | 677 | py | Python | salt/renderers/hjson.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | salt/renderers/hjson.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | salt/renderers/hjson.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | """
hjson renderer for Salt
See the hjson_ documentation for more information
.. _hjson: http://laktak.github.io/hjson/
"""
try:
import hjson
HAS_LIBS = True
except ImportError:
HAS_LIBS = False
def render(hjson_data, saltenv="base", sls="", **kws):
"""
Accepts HJSON as a string or as a file ... | 20.515152 | 79 | 0.645495 |
try:
import hjson
HAS_LIBS = True
except ImportError:
HAS_LIBS = False
def render(hjson_data, saltenv="base", sls="", **kws):
if not isinstance(hjson_data, str):
hjson_data = hjson_data.read()
if hjson_data.startswith("#!"):
hjson_data = hjson_data[(hjson_data.find("\n") + 1) :... | true | true |
f76f9994cdf0906665df27cbd7589035059b3d2c | 92 | py | Python | pyogpclient/__init__.py | JanHolger/pyogpclient | 9482b62bfc615b13a60d116fc1b44b482040ee72 | [
"Apache-2.0"
] | 1 | 2021-04-09T00:47:02.000Z | 2021-04-09T00:47:02.000Z | pyogpclient/__init__.py | JanHolger/pyogpclient | 9482b62bfc615b13a60d116fc1b44b482040ee72 | [
"Apache-2.0"
] | 1 | 2021-04-09T00:49:53.000Z | 2021-11-03T22:46:13.000Z | pyogpclient/__init__.py | JanHolger/pyogpclient | 9482b62bfc615b13a60d116fc1b44b482040ee72 | [
"Apache-2.0"
] | null | null | null | from pyogpclient.OGPClient import OGPClient
from pyogpclient.OGPClient import FULL_OGP_QUERY | 46 | 48 | 0.902174 | from pyogpclient.OGPClient import OGPClient
from pyogpclient.OGPClient import FULL_OGP_QUERY | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.