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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f20d6e7eea2e0ff365aa9be9a5e53d59f69fa4 | 1,031 | py | Python | python/test/test_external_metric_source.py | adriangonz/seldon-deploy-sdk | c5504838630a87053387cec57ec2e1e7251971e2 | [
"Apache-2.0"
] | 6 | 2021-02-18T14:37:54.000Z | 2022-01-13T13:27:43.000Z | python/test/test_external_metric_source.py | adriangonz/seldon-deploy-sdk | c5504838630a87053387cec57ec2e1e7251971e2 | [
"Apache-2.0"
] | 14 | 2021-01-04T16:32:03.000Z | 2021-12-13T17:53:59.000Z | python/test/test_external_metric_source.py | adriangonz/seldon-deploy-sdk | c5504838630a87053387cec57ec2e1e7251971e2 | [
"Apache-2.0"
] | 7 | 2021-03-17T09:05:55.000Z | 2022-01-05T10:39:56.000Z | # coding: utf-8
"""
Seldon Deploy API
API to interact and manage the lifecycle of your machine learning models deployed through Seldon Deploy. # noqa: E501
OpenAPI spec version: v1alpha1
Contact: hello@seldon.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future... | 25.146341 | 122 | 0.734239 |
from __future__ import absolute_import
import unittest
import seldon_deploy_sdk
from seldon_deploy_sdk.models.external_metric_source import ExternalMetricSource from seldon_deploy_sdk.rest import ApiException
class TestExternalMetricSource(unittest.TestCase):
def setUp(self):
pass
def tearDown... | true | true |
08f20e3bef42d4f9bd5ff6efd6a225d578075651 | 568 | py | Python | tunepy2/interfaces/abstract_validator.py | efortner/tunepy | 28ab7aa0b851d42cf2a81a5573fb24b261daba89 | [
"MIT"
] | null | null | null | tunepy2/interfaces/abstract_validator.py | efortner/tunepy | 28ab7aa0b851d42cf2a81a5573fb24b261daba89 | [
"MIT"
] | null | null | null | tunepy2/interfaces/abstract_validator.py | efortner/tunepy | 28ab7aa0b851d42cf2a81a5573fb24b261daba89 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from typing import Tuple
from tunepy2.interfaces import AbstractLearner
class AbstractValidator(ABC):
"""
The common interface tunepy2 expects from all validators.
"""
@abstractmethod
def validate(self, x, y, model: AbstractLearner) -> float:
"""
... | 24.695652 | 63 | 0.661972 | from abc import ABC, abstractmethod
from typing import Tuple
from tunepy2.interfaces import AbstractLearner
class AbstractValidator(ABC):
@abstractmethod
def validate(self, x, y, model: AbstractLearner) -> float:
pass
| true | true |
08f20eb2ccff5a0f815c755d9f7156827a8c0297 | 838 | py | Python | var/spack/repos/builtin/packages/libxrender/package.py | robertmaynard/spack | 35d81a9006a5fa32a012a40874ac6cbdefd4a259 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-09-19T10:20:43.000Z | 2021-09-19T10:20:43.000Z | var/spack/repos/builtin/packages/libxrender/package.py | robertmaynard/spack | 35d81a9006a5fa32a012a40874ac6cbdefd4a259 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-01-06T19:26:40.000Z | 2021-01-06T19:42:17.000Z | var/spack/repos/builtin/packages/libxrender/package.py | shintaro-iwasaki/spack | 47998b3f4733c1264760c4a9744b1669661354b9 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libxrender(AutotoolsPackage, XorgPackage):
"""libXrender - library for the Render Extensio... | 36.434783 | 96 | 0.742243 |
from spack import *
class Libxrender(AutotoolsPackage, XorgPackage):
homepage = "http://cgit.freedesktop.org/xorg/lib/libXrender"
xorg_mirror_path = "lib/libXrender-0.9.10.tar.gz"
version('0.9.10', sha256='770527cce42500790433df84ec3521e8bf095dfe5079454a92236494ab296adf')
version('0.9.9', sha256='... | true | true |
08f20f717ee3b2c7660e19759119c033dabf72ec | 839 | py | Python | slothql/utils/tests/laziness.py | IndioInc/slothql | 64a574013e249968746044555bd8779ac353b13f | [
"MIT"
] | 2 | 2018-02-09T19:12:00.000Z | 2018-04-13T01:50:15.000Z | slothql/utils/tests/laziness.py | IndioInc/slothql | 64a574013e249968746044555bd8779ac353b13f | [
"MIT"
] | 29 | 2018-02-02T01:07:07.000Z | 2018-05-28T23:04:28.000Z | slothql/utils/tests/laziness.py | IndioInc/slothql | 64a574013e249968746044555bd8779ac353b13f | [
"MIT"
] | null | null | null | import pytest
from ..laziness import LazyInitMixin
class Executed(Exception):
pass
class Class(LazyInitMixin):
def __init__(self, a='foo', b='bar'):
self.a = a
self.b = b
raise Executed
def test_lazy_init_getattr():
a = Class()
with pytest.raises(Executed):
hasattr... | 19.068182 | 95 | 0.623361 | import pytest
from ..laziness import LazyInitMixin
class Executed(Exception):
pass
class Class(LazyInitMixin):
def __init__(self, a='foo', b='bar'):
self.a = a
self.b = b
raise Executed
def test_lazy_init_getattr():
a = Class()
with pytest.raises(Executed):
hasattr... | true | true |
08f2110676d3b3ab3ce71760501da9b17f708459 | 2,715 | py | Python | nz_django/day3/look_up_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day3/look_up_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day3/look_up_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.http import HttpResponse
from .models import Article,Category
from django.utils.timezone import make_aware
# Create your views here.
def index(request):
# article = Article(title='有了金刚钻我们再揽瓷器活',content='金刚钻都是磨出来的,所以有人成为钢板君')
# category = Category(name='热门文章')
# category.save()
# category.art... | 33.9375 | 87 | 0.719337 | from django.http import HttpResponse
from .models import Article,Category
from django.utils.timezone import make_aware
def index(request):
article = Article.objects.filter(title__iexact='有了金刚钻我们再揽瓷器活')
print(article.query) print(article) return HttpResponse('成功')
def index1(requ... | true | true |
08f211f28e35315f563518676057998f24cb254d | 1,746 | py | Python | src/wikidocs/2_linear_regression/custom_dataset.py | 837477/PyTorch_study | 7641edb4d1fdb18bc87e16d4b0174d612b045b4c | [
"MIT"
] | 1 | 2021-11-25T14:12:07.000Z | 2021-11-25T14:12:07.000Z | src/wikidocs/2_linear_regression/custom_dataset.py | 837477/PyTorch_study | 7641edb4d1fdb18bc87e16d4b0174d612b045b4c | [
"MIT"
] | null | null | null | src/wikidocs/2_linear_regression/custom_dataset.py | 837477/PyTorch_study | 7641edb4d1fdb18bc87e16d4b0174d612b045b4c | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import TensorDataset # 텐서데이터셋
from torch.utils.data import DataLoader # 데이터로더
'''
파이토치는 데이터셋을 조금 더 쉽게 다룰 수 있도록 torch.utils.data.Dataset과 torch.utils.data.DataLoader를 제공한다.
이를 사용하면 미니 배치 학습, 데이터 셔플, 병렬 처리까지 간단하게 수행할 수 있다.
그런데 torch... | 31.178571 | 123 | 0.606529 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import TensorDataset from torch.utils.data import DataLoader
torch.manual_seed(1)
class CustomDataset(torch.utils.data.Dataset):
def __init__(self):
self.x_data = torch.FloatTensor([[73, 80, 75],
... | true | true |
08f212f3ca768195c376d2ef792b7d6b2361cf4b | 27,534 | py | Python | auctions/sale/sale_auctions.py | JewelBoyz/dfk | fdad56f1f22da35802a4a78d7438c92847ecd819 | [
"MIT"
] | 1 | 2021-11-28T06:19:07.000Z | 2021-11-28T06:19:07.000Z | auctions/sale/sale_auctions.py | JewelBoyz/dfk | fdad56f1f22da35802a4a78d7438c92847ecd819 | [
"MIT"
] | null | null | null | auctions/sale/sale_auctions.py | JewelBoyz/dfk | fdad56f1f22da35802a4a78d7438c92847ecd819 | [
"MIT"
] | null | null | null | import requests
from web3 import Web3
import urllib.parse
SALE_AUCTIONS_CONTRACT_ADDRESS = '0x13a65B9F8039E2c032Bc022171Dc05B30c3f2892'
ABI = """
[
{"inputs":[{"internalType":"address","name":"_heroCoreAddress","type":"address"},{"internalType":"address","name":"_geneScienceAddress","type":"addres... | 120.235808 | 5,016 | 0.606087 | import requests
from web3 import Web3
import urllib.parse
SALE_AUCTIONS_CONTRACT_ADDRESS = '0x13a65B9F8039E2c032Bc022171Dc05B30c3f2892'
ABI = """
[
{"inputs":[{"internalType":"address","name":"_heroCoreAddress","type":"address"},{"internalType":"address","name":"_geneScienceAddress","type":"addres... | true | true |
08f213046c434900d79508d9ae0075a36260fa00 | 793 | py | Python | spinup/examples/tf1/bench_pos_sac_sf_4.py | 20chase/spinningup | cf662b8bfaac5131a9641e026ec77530e7b11cec | [
"MIT"
] | 1 | 2020-04-29T09:33:13.000Z | 2020-04-29T09:33:13.000Z | spinup/examples/tf1/bench_pos_sac_sf_4.py | 20chase/spinningup | cf662b8bfaac5131a9641e026ec77530e7b11cec | [
"MIT"
] | null | null | null | spinup/examples/tf1/bench_pos_sac_sf_4.py | 20chase/spinningup | cf662b8bfaac5131a9641e026ec77530e7b11cec | [
"MIT"
] | null | null | null | from spinup.utils.run_utils import ExperimentGrid
from spinup import sac_tf1
import tensorflow as tf
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--cpu', type=int, default=8)
parser.add_argument('--num_runs', type=int, default=3)
args = parser.p... | 37.761905 | 66 | 0.638083 | from spinup.utils.run_utils import ExperimentGrid
from spinup import sac_tf1
import tensorflow as tf
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--cpu', type=int, default=8)
parser.add_argument('--num_runs', type=int, default=3)
args = parser.p... | true | true |
08f21310ee48a8d3d1929eed4755b29485b13cf5 | 3,450 | py | Python | test/test_lagom.py | dkorduban/lagom | 84d90902e70ed15a541406b7423a2d4ef74366e3 | [
"MIT"
] | null | null | null | test/test_lagom.py | dkorduban/lagom | 84d90902e70ed15a541406b7423a2d4ef74366e3 | [
"MIT"
] | null | null | null | test/test_lagom.py | dkorduban/lagom | 84d90902e70ed15a541406b7423a2d4ef74366e3 | [
"MIT"
] | null | null | null | import pytest
import numpy as np
import os
from lagom import Seeder
from lagom import Logger
from lagom import pickle_load
from lagom import pickle_dump
from lagom import yaml_load
from lagom import yaml_dump
class TestLagom(object):
def test_seeding(self):
seeder = Seeder(init_seed=0)
... | 31.944444 | 80 | 0.557391 | import pytest
import numpy as np
import os
from lagom import Seeder
from lagom import Logger
from lagom import pickle_load
from lagom import pickle_dump
from lagom import yaml_load
from lagom import yaml_dump
class TestLagom(object):
def test_seeding(self):
seeder = Seeder(init_seed=0)
... | true | true |
08f2140a39f4a2b844dcf808866e176a1d7fdb33 | 4,773 | py | Python | spikeextractors/extractors/hs2sortingextractor/hs2sortingextractor.py | zekearneodo/spikeextractors | d30aa85e69d0331fffdb58a03a2bb628f93b405e | [
"MIT"
] | 145 | 2018-12-06T23:12:54.000Z | 2022-02-10T22:57:35.000Z | spikeextractors/extractors/hs2sortingextractor/hs2sortingextractor.py | zekearneodo/spikeextractors | d30aa85e69d0331fffdb58a03a2bb628f93b405e | [
"MIT"
] | 396 | 2018-11-26T11:46:30.000Z | 2022-01-04T07:27:47.000Z | spikeextractors/extractors/hs2sortingextractor/hs2sortingextractor.py | zekearneodo/spikeextractors | d30aa85e69d0331fffdb58a03a2bb628f93b405e | [
"MIT"
] | 67 | 2018-11-19T12:38:01.000Z | 2021-09-25T03:18:22.000Z | from spikeextractors import SortingExtractor
import numpy as np
from pathlib import Path
from spikeextractors.extraction_tools import check_get_unit_spike_train
try:
import h5py
HAVE_HS2SX = True
except ImportError:
HAVE_HS2SX = False
class HS2SortingExtractor(SortingExtractor):
extractor_name = 'HS... | 43.390909 | 132 | 0.644668 | from spikeextractors import SortingExtractor
import numpy as np
from pathlib import Path
from spikeextractors.extraction_tools import check_get_unit_spike_train
try:
import h5py
HAVE_HS2SX = True
except ImportError:
HAVE_HS2SX = False
class HS2SortingExtractor(SortingExtractor):
extractor_name = 'HS... | true | true |
08f214498473c1ab2aa56888447494e5729935aa | 8,062 | py | Python | conpaas-services/contrib/libcloud/compute/drivers/slicehost.py | bopopescu/conpaas-1 | cea3c02f499a729464697de7cf98c2041febc0ab | [
"BSD-3-Clause"
] | 5 | 2016-02-24T14:44:03.000Z | 2020-11-29T19:18:40.000Z | conpaas-services/contrib/libcloud/compute/drivers/slicehost.py | bopopescu/conpaas-1 | cea3c02f499a729464697de7cf98c2041febc0ab | [
"BSD-3-Clause"
] | 25 | 2015-03-23T16:05:19.000Z | 2018-02-13T17:22:22.000Z | conpaas-services/contrib/libcloud/compute/drivers/slicehost.py | bopopescu/conpaas-1 | cea3c02f499a729464697de7cf98c2041febc0ab | [
"BSD-3-Clause"
] | 3 | 2018-09-14T16:54:14.000Z | 2020-07-26T03:14:56.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 34.161017 | 79 | 0.593773 | import base64
import socket
from xml.etree import ElementTree as ET
from xml.parsers.expat import ExpatError
from libcloud.utils.py3 import b
from libcloud.common.base import ConnectionKey, XmlResponse
from libcloud.compute.types import NodeState, Provider, InvalidCredsError
from libcloud.compute.base import NodeSiz... | true | true |
08f2144beb50d81d18c6928152ff4aba4bba52d7 | 28,608 | py | Python | py/thesis.py | rwenite/msa-thesis | 4b72d5571b91ef1ca5266c8e151fdc5e387d57ac | [
"Apache-2.0"
] | 2 | 2018-12-13T13:57:57.000Z | 2022-01-06T07:44:54.000Z | py/thesis.py | rwenite/msa-thesis | 4b72d5571b91ef1ca5266c8e151fdc5e387d57ac | [
"Apache-2.0"
] | null | null | null | py/thesis.py | rwenite/msa-thesis | 4b72d5571b91ef1ca5266c8e151fdc5e387d57ac | [
"Apache-2.0"
] | 1 | 2021-05-20T14:21:52.000Z | 2021-05-20T14:21:52.000Z | """
main.py
Richard Wen (rwenite@gmail.com)
===============================================================
A script for running random forests for pattern recognition
of spatial data.
Call python via console:
python thesis.py config.txt path\\to\\workspace_folder
=======================================... | 58.028398 | 243 | 0.62126 |
from configobj import ConfigObj
from jinja2 import Template
from joblib import Parallel, delayed
from modules import files, helpers, logs, workflow
from sklearn.grid_search import ParameterGrid
from sklearn.externals import joblib
import logging
import matplotlib.pyplot as plt
import os
import pandas as pd
import... | true | true |
08f215215be9fe822084424599148c8a7a3f8b45 | 48,727 | py | Python | tests/expressions_window/tests.py | takashi-wakabayashi/django | 8b040e3cbbb2e81420e777afc3ca48a1c8f4dd5a | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 1 | 2021-01-13T20:57:51.000Z | 2021-01-13T20:57:51.000Z | tests/expressions_window/tests.py | takashi-wakabayashi/django | 8b040e3cbbb2e81420e777afc3ca48a1c8f4dd5a | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 1 | 2015-07-13T14:43:18.000Z | 2015-07-13T14:43:18.000Z | tests/expressions_window/tests.py | takashi-wakabayashi/django | 8b040e3cbbb2e81420e777afc3ca48a1c8f4dd5a | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | null | null | null | import datetime
from decimal import Decimal
from unittest import mock, skipIf
from django.core.exceptions import FieldError
from django.db import NotSupportedError, connection
from django.db.models import (
Avg, BooleanField, Case, F, Func, IntegerField, Max, Min, OuterRef, Q,
RowRange, Subquery, Sum, Value, V... | 50.863257 | 118 | 0.565887 | import datetime
from decimal import Decimal
from unittest import mock, skipIf
from django.core.exceptions import FieldError
from django.db import NotSupportedError, connection
from django.db.models import (
Avg, BooleanField, Case, F, Func, IntegerField, Max, Min, OuterRef, Q,
RowRange, Subquery, Sum, Value, V... | true | true |
08f21530d0ecfc6058a00192a00a1404a117b9b7 | 1,845 | py | Python | changes/models/artifact.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | 1 | 2015-11-08T13:00:44.000Z | 2015-11-08T13:00:44.000Z | changes/models/artifact.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | changes/models/artifact.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import uuid
from datetime import datetime
from sqlalchemy import Column, String, DateTime, ForeignKey
from sqlalchemy.orm import relationship, backref
from sqlalchemy.schema import UniqueConstraint
from changes.config import db
from changes.db.types.filestorage import FileData,... | 36.176471 | 91 | 0.698645 | from __future__ import absolute_import
import uuid
from datetime import datetime
from sqlalchemy import Column, String, DateTime, ForeignKey
from sqlalchemy.orm import relationship, backref
from sqlalchemy.schema import UniqueConstraint
from changes.config import db
from changes.db.types.filestorage import FileData,... | true | true |
08f215472739ac1b05d06ad165fdf26116c44126 | 1,910 | py | Python | onnx/backend/test/loader/__init__.py | rajeevsrao/onnx | 355a4954ea4e5836a5e943589509951c44feb6b4 | [
"MIT"
] | 137 | 2020-04-28T12:28:32.000Z | 2022-03-18T10:48:25.000Z | onnx/backend/test/loader/__init__.py | rajeevsrao/onnx | 355a4954ea4e5836a5e943589509951c44feb6b4 | [
"MIT"
] | 24 | 2020-05-06T08:06:42.000Z | 2021-12-31T07:46:13.000Z | onnx/backend/test/loader/__init__.py | rajeevsrao/onnx | 355a4954ea4e5836a5e943589509951c44feb6b4 | [
"MIT"
] | 24 | 2020-05-06T11:43:22.000Z | 2022-03-18T10:50:35.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import os
from ..case.test_case import TestCase
from typing import List, Text, Optional
DATA_DIR = os.path.join(
os.path.dirname(os.path.realpath(os.pat... | 29.84375 | 74 | 0.572251 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import os
from ..case.test_case import TestCase
from typing import List, Text, Optional
DATA_DIR = os.path.join(
os.path.dirname(os.path.realpath(os.pat... | true | true |
08f215544ed5a44e708a06e8b25193888ca68c94 | 2,942 | py | Python | services/web/project/filters.py | brienen/GGM-API-generator | 8e6939db7a67f7f5c0db5bb0d046ff1d699d5c90 | [
"MIT"
] | 1 | 2022-03-30T18:43:42.000Z | 2022-03-30T18:43:42.000Z | services/web/project/filters.py | brienen/GGM-API-generator | 8e6939db7a67f7f5c0db5bb0d046ff1d699d5c90 | [
"MIT"
] | null | null | null | services/web/project/filters.py | brienen/GGM-API-generator | 8e6939db7a67f7f5c0db5bb0d046ff1d699d5c90 | [
"MIT"
] | null | null | null |
from graphene_sqlalchemy_filter import FilterableConnectionField, FilterSet
from project.models import school, startkwalificatie, uitschrijving, inschrijving, leerjaar, leerling, locatie, loopbaanstap, onderwijsloopbaan, onderwijsniveau, onderwijssoort, ouder_of_verzorger
class schoolFilter(FilterSet):
class Met... | 29.128713 | 452 | 0.556764 |
from graphene_sqlalchemy_filter import FilterableConnectionField, FilterSet
from project.models import school, startkwalificatie, uitschrijving, inschrijving, leerjaar, leerling, locatie, loopbaanstap, onderwijsloopbaan, onderwijsniveau, onderwijssoort, ouder_of_verzorger
class schoolFilter(FilterSet):
class Met... | true | true |
08f215a3bf979fde2e638a9ab0de680f225db804 | 428 | py | Python | numpy/random_fn.py | dnootana/Python | 2881bafe8bc378fa3cae50a747fcea1a55630c63 | [
"MIT"
] | 1 | 2021-02-19T11:00:11.000Z | 2021-02-19T11:00:11.000Z | numpy/random_fn.py | dnootana/Python | 2881bafe8bc378fa3cae50a747fcea1a55630c63 | [
"MIT"
] | null | null | null | numpy/random_fn.py | dnootana/Python | 2881bafe8bc378fa3cae50a747fcea1a55630c63 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.8
from numpy import random
a = random.randint(100)
print(a)
a = random.rand()
print(a)
a = random.randint(100, size=(5))
print(a)
a = random.randint(100, size=(3, 5))
print(a)
a = random.rand(5)
print(a)
a = random.rand(5,3)
print(a)
a = random.choice([1,2,3,4,5])
print(a)
a = random.ch... | 13.806452 | 59 | 0.628505 |
from numpy import random
a = random.randint(100)
print(a)
a = random.rand()
print(a)
a = random.randint(100, size=(5))
print(a)
a = random.randint(100, size=(3, 5))
print(a)
a = random.rand(5)
print(a)
a = random.rand(5,3)
print(a)
a = random.choice([1,2,3,4,5])
print(a)
a = random.choice(["dfasdf", "dsfas", ... | true | true |
08f215f426a885f7213084bd3515110fe59c65d5 | 8,034 | py | Python | volttron/platform/resmon.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | 1 | 2021-04-06T21:28:38.000Z | 2021-04-06T21:28:38.000Z | volttron/platform/resmon.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | null | null | null | volttron/platform/resmon.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2019, Battelle Memorial Institute.
#
# 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... | 37.367442 | 79 | 0.664177 |
from ast import literal_eval
import os
import re
from volttron.platform.aip import ExecutionEnvironment
__all__ = ['ResourceError', 'ExecutionEnvironment', 'ResourceMonitor']
__author__ = 'Brandon Carpenter <brandon.carpenter@pnnl.gov>'
__copyright__ = 'Copyright (c) 2016, Battelle Memorial Institute'
__license... | true | true |
08f217adcf1d32903e9ad3a857d9d99f88649d68 | 389 | py | Python | Fampay/Fampay/asgi.py | rushi04/Fampay-task | 857b6c78d4b747fe4a7291a250f96c1bb7a73217 | [
"MIT"
] | null | null | null | Fampay/Fampay/asgi.py | rushi04/Fampay-task | 857b6c78d4b747fe4a7291a250f96c1bb7a73217 | [
"MIT"
] | null | null | null | Fampay/Fampay/asgi.py | rushi04/Fampay-task | 857b6c78d4b747fe4a7291a250f96c1bb7a73217 | [
"MIT"
] | null | null | null | """
ASGI config for Fampay project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Fampay.settings')
application = get_asgi_application()
| true | true |
08f218deb067f7ef842f57afe0298a3e3d60e14d | 2,299 | py | Python | grr/core/grr_response_core/lib/parsers/firefox3_history.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 4,238 | 2015-01-01T15:34:50.000Z | 2022-03-31T08:18:05.000Z | grr/core/grr_response_core/lib/parsers/firefox3_history.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 787 | 2015-01-02T21:34:24.000Z | 2022-03-02T13:26:38.000Z | grr/core/grr_response_core/lib/parsers/firefox3_history.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 856 | 2015-01-02T02:50:11.000Z | 2022-03-31T11:11:53.000Z | #!/usr/bin/env python
"""Parser for Mozilla Firefox3 3 History files."""
from typing import IO
from typing import Iterator
from typing import Tuple
from urllib import parse as urlparse
from grr_response_core.lib import parsers
from grr_response_core.lib.rdfvalues import client as rdf_client
from grr_response_core.li... | 36.492063 | 92 | 0.717268 |
from typing import IO
from typing import Iterator
from typing import Tuple
from urllib import parse as urlparse
from grr_response_core.lib import parsers
from grr_response_core.lib.rdfvalues import client as rdf_client
from grr_response_core.lib.rdfvalues import paths as rdf_paths
from grr_response_core.lib.rdfvalue... | true | true |
08f21a4fc11521497d3726c6e4e4db295748ce52 | 4,815 | py | Python | ProgrammingAssignments/KNN/carl_cortright_P3/knn.py | ckcortright/CSCI4830MachineLearning | 5d1c6c7bfb05b54f7c000c940b1f6410054f10f0 | [
"MIT"
] | null | null | null | ProgrammingAssignments/KNN/carl_cortright_P3/knn.py | ckcortright/CSCI4830MachineLearning | 5d1c6c7bfb05b54f7c000c940b1f6410054f10f0 | [
"MIT"
] | null | null | null | ProgrammingAssignments/KNN/carl_cortright_P3/knn.py | ckcortright/CSCI4830MachineLearning | 5d1c6c7bfb05b54f7c000c940b1f6410054f10f0 | [
"MIT"
] | 2 | 2016-11-30T07:28:47.000Z | 2017-01-28T05:52:45.000Z | import argparse
from collections import Counter, defaultdict
import numpy
from numpy import median
from sklearn.neighbors import BallTree
class Numbers:
"""
Class to store MNIST data
"""
def __init__(self, location):
import gzip
import cPickle
# Load the dataset
f = ... | 30.66879 | 86 | 0.59107 | import argparse
from collections import Counter, defaultdict
import numpy
from numpy import median
from sklearn.neighbors import BallTree
class Numbers:
def __init__(self, location):
import gzip
import cPickle
f = gzip.open(location, 'rb')
train_set, valid_set, test_set ... | true | true |
08f21aeaee061e84866f27f8c049643ebde87b33 | 7,988 | py | Python | code/lambda_handlers.py | vvvlc/financial-functions | 1798a7dd1078a0341fa290396a3302d669dd53e2 | [
"MIT"
] | 1 | 2018-12-09T18:02:05.000Z | 2018-12-09T18:02:05.000Z | code/lambda_handlers.py | vvvlc/financial-functions | 1798a7dd1078a0341fa290396a3302d669dd53e2 | [
"MIT"
] | 1 | 2018-12-09T18:09:25.000Z | 2018-12-09T18:09:25.000Z | code/lambda_handlers.py | vvvlc/financial-functions | 1798a7dd1078a0341fa290396a3302d669dd53e2 | [
"MIT"
] | 1 | 2018-03-16T22:46:53.000Z | 2018-03-16T22:46:53.000Z | from __future__ import print_function
import sys
import log_helper
sys.path.append('lib')
import numpy
from jsonschema import validate
from jsonschema.exceptions import ValidationError
import validation_json_schemas as schemas
logger = log_helper.getLogger(__name__)
def __validate_arguments(function_name, arguments_... | 38.965854 | 140 | 0.692664 | from __future__ import print_function
import sys
import log_helper
sys.path.append('lib')
import numpy
from jsonschema import validate
from jsonschema.exceptions import ValidationError
import validation_json_schemas as schemas
logger = log_helper.getLogger(__name__)
def __validate_arguments(function_name, arguments_... | true | true |
08f21b56dd8fae4e14896cfbeae3e9d77a49bad9 | 23,856 | py | Python | django/bosscore/test/test_auth.py | jhuapl-boss/boss | c2e26d272bd7b8d54abdc2948193163537e31291 | [
"Apache-2.0"
] | 20 | 2016-05-16T21:08:13.000Z | 2021-11-16T11:50:19.000Z | django/bosscore/test/test_auth.py | jhuapl-boss/boss | c2e26d272bd7b8d54abdc2948193163537e31291 | [
"Apache-2.0"
] | 31 | 2016-10-28T17:51:11.000Z | 2022-02-10T08:07:31.000Z | django/bosscore/test/test_auth.py | jhuapl-boss/boss | c2e26d272bd7b8d54abdc2948193163537e31291 | [
"Apache-2.0"
] | 12 | 2016-10-28T17:47:01.000Z | 2021-05-18T23:47:06.000Z | # Copyright 2021 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... | 36.036254 | 125 | 0.646169 |
from rest_framework.test import APITestCase
from django.conf import settings
from .setup_db import SetupTestDB
version = settings.BOSS_VERSION
PUBLIC_COLLECTION = 'public_coll'
PRIVATE_COLLECTION = 'private_coll'
PUBLIC_EXPERIMENT = 'public_exp'
PRIVATE_EXPERIMENT = 'private_exp'
PUBLIC_CHANNEL = 'public_chan'
PRIVA... | true | true |
08f21ba6f126ffbf0f026fc1ae7b5999b38d0788 | 14,790 | py | Python | test/orm/test_deprecations.py | gujun4990/sqlalchemy | 057bae2295feb86529a04f09cd2f3d4c2c6d88a8 | [
"MIT"
] | 1 | 2018-04-02T18:41:52.000Z | 2018-04-02T18:41:52.000Z | test/orm/test_deprecations.py | gujun4990/sqlalchemy | 057bae2295feb86529a04f09cd2f3d4c2c6d88a8 | [
"MIT"
] | null | null | null | test/orm/test_deprecations.py | gujun4990/sqlalchemy | 057bae2295feb86529a04f09cd2f3d4c2c6d88a8 | [
"MIT"
] | 3 | 2017-09-26T13:59:24.000Z | 2020-12-04T17:51:54.000Z | """The collection of modern alternatives to deprecated & removed functionality.
Collects specimens of old ORM code and explicitly covers the recommended
modern (i.e. not deprecated) alternative to them. The tests snippets here can
be migrated directly to the wiki, docs, etc.
"""
from sqlalchemy import Integer, Strin... | 27.696629 | 79 | 0.586342 | from sqlalchemy import Integer, String, ForeignKey, func, text
from sqlalchemy.testing.schema import Table
from sqlalchemy.testing.schema import Column
from sqlalchemy.orm import mapper, relationship, create_session, sessionmaker
from sqlalchemy.testing import fixtures
class QueryAlternativesTest(fixtures.MappedTest)... | true | true |
08f21bf72d0723b8c7469e1ab477aeb0ab3c4664 | 255 | py | Python | bot_save_last_price_zaif.py | ysawa/zaif-trade-bot | 4e5e62d2d03fff773b018ff960e2d9a0587c9a6e | [
"MIT"
] | 1 | 2018-02-01T06:24:49.000Z | 2018-02-01T06:24:49.000Z | bot_save_last_price_zaif.py | ysawa/zaif-trade-bot | 4e5e62d2d03fff773b018ff960e2d9a0587c9a6e | [
"MIT"
] | 5 | 2020-03-24T15:26:43.000Z | 2021-04-30T20:34:03.000Z | bot_save_last_price_zaif.py | ysawa/coin-trader | 4e5e62d2d03fff773b018ff960e2d9a0587c9a6e | [
"MIT"
] | null | null | null | import os
from base.save_last_price import save_last_price
from zaif.api import ZaifApi
DIRECTORY = os.path.join("data", "last_price", "zaif")
def main():
api = ZaifApi()
save_last_price(api, DIRECTORY)
if __name__ == '__main__':
main()
| 15.9375 | 54 | 0.701961 | import os
from base.save_last_price import save_last_price
from zaif.api import ZaifApi
DIRECTORY = os.path.join("data", "last_price", "zaif")
def main():
api = ZaifApi()
save_last_price(api, DIRECTORY)
if __name__ == '__main__':
main()
| true | true |
08f21c0a59d1a5f64a7ebd9eab26fbb1020fcef7 | 534 | py | Python | src/env.py | cslotboom/Naturalize | f54beb0baa53f33a66e85660738eb4880419aa1e | [
"MIT"
] | null | null | null | src/env.py | cslotboom/Naturalize | f54beb0baa53f33a66e85660738eb4880419aa1e | [
"MIT"
] | null | null | null | src/env.py | cslotboom/Naturalize | f54beb0baa53f33a66e85660738eb4880419aa1e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Dec 20 18:43:11 2020
@author: Christian
"""
class defaultEnvironment:
"""
The environment stores conditions universal to all individuals.
For example, some problems may require comparing to data found in a file.
The environment could be used to re... | 21.36 | 77 | 0.623596 |
class defaultEnvironment:
def __init__(self):
pass | true | true |
08f21c12410912d635e3392174eaa6b284dd2a8a | 1,286 | py | Python | scripts/CopyToRun.py | Betterton-Lab/CyLaKS | 17d01e8742b8172b477dd99d254c2d0771f774d0 | [
"BSD-3-Clause"
] | null | null | null | scripts/CopyToRun.py | Betterton-Lab/CyLaKS | 17d01e8742b8172b477dd99d254c2d0771f774d0 | [
"BSD-3-Clause"
] | null | null | null | scripts/CopyToRun.py | Betterton-Lab/CyLaKS | 17d01e8742b8172b477dd99d254c2d0771f774d0 | [
"BSD-3-Clause"
] | 1 | 2021-03-10T16:11:14.000Z | 2021-03-10T16:11:14.000Z | import subprocess
import os
import argparse
# this script is supposed to be called from the base folder of AMSOS
# python3 ./scripts/CopyTuRun.py /path/to/run/folder
# (Shamelessly stolen from Wen Yan's AMSOS code)
def dir_path(string):
if os.path.isdir(string):
return string
else:
raise Not... | 29.906977 | 70 | 0.727838 | import subprocess
import os
import argparse
def dir_path(string):
if os.path.isdir(string):
return string
else:
raise NotADirectoryError(string)
parser = argparse.ArgumentParser()
parser.add_argument('path', type=dir_path)
args = parser.parse_args()
exePath = args.path
print('copy execut... | true | true |
08f21cf00d4dbfd3e696ad35c4073b61ec22846c | 1,103 | py | Python | main_example.py | RobertoNegro/unitn-lbdm-201920-corex | 16274527776eb83ca5bcfa160220f689e8b1bb88 | [
"MIT"
] | null | null | null | main_example.py | RobertoNegro/unitn-lbdm-201920-corex | 16274527776eb83ca5bcfa160220f689e8b1bb88 | [
"MIT"
] | null | null | null | main_example.py | RobertoNegro/unitn-lbdm-201920-corex | 16274527776eb83ca5bcfa160220f689e8b1bb88 | [
"MIT"
] | null | null | null | import linearcorex as lc
import numpy as np
print('\nInput Matrix\n==================')
# A A A A A iA C C A C
X = np.array([[0.01, 0.01, 0.01, 0.01, 0.01, 1.00, 1.00, 1.00, 0.01, 1.00],
[0.01, 0.01, 0.01, 0.01, 0.01, 1.00, 0.00, 0.00, 0.01, 0.00],
... | 31.514286 | 76 | 0.450589 | import linearcorex as lc
import numpy as np
print('\nInput Matrix\n==================')
X = np.array([[0.01, 0.01, 0.01, 0.01, 0.01, 1.00, 1.00, 1.00, 0.01, 1.00],
[0.01, 0.01, 0.01, 0.01, 0.01, 1.00, 0.00, 0.00, 0.01, 0.00],
[1.00, 1.00, 1.00, 1.00, 1.00, 0.01, 0.00, 0.00, 1.00, 0.00],
... | true | true |
08f21e2e61fdb4a41fa991f7bb4e1824ae05768e | 263 | py | Python | polyglot/exceptions/exceptions.py | pranavbaburaj/polyglot | 0a9b889bf02445f7b810e05587551ad0defc13b4 | [
"MIT"
] | 32 | 2021-03-09T03:54:51.000Z | 2021-09-07T15:22:31.000Z | polyglot/exceptions/exceptions.py | pranavbaburaj/polyglot | 0a9b889bf02445f7b810e05587551ad0defc13b4 | [
"MIT"
] | 3 | 2021-05-11T14:19:22.000Z | 2021-07-12T07:44:31.000Z | polyglot/exceptions/exceptions.py | pranavbaburaj/polyglot | 0a9b889bf02445f7b810e05587551ad0defc13b4 | [
"MIT"
] | 5 | 2021-04-12T18:44:23.000Z | 2021-05-29T04:26:07.000Z | from clint.textui import colored
class PolyglotFileNotFoundError(FileNotFoundError):
def __init__(self, message):
self.message = colored.red(message)
super().__init__(self.message)
def str(self):
return self.message
| 21.916667 | 52 | 0.669202 | from clint.textui import colored
class PolyglotFileNotFoundError(FileNotFoundError):
def __init__(self, message):
self.message = colored.red(message)
super().__init__(self.message)
def str(self):
return self.message
| true | true |
08f21e6629036b6e18476287a7ce1c65b72b6e5c | 2,863 | py | Python | filter.py | 11petr11/ScansSeparate | 97ee359c8e3d366b0df2b48acb38c3dba58eb550 | [
"MIT"
] | null | null | null | filter.py | 11petr11/ScansSeparate | 97ee359c8e3d366b0df2b48acb38c3dba58eb550 | [
"MIT"
] | null | null | null | filter.py | 11petr11/ScansSeparate | 97ee359c8e3d366b0df2b48acb38c3dba58eb550 | [
"MIT"
] | null | null | null | import asyncio, evdev
import asyncio
import time
lastN = 0
activeID = ""
def scanFilter(id,s):
n = time.time()
global lastN
global activeID
d = n - lastN
b = d > 0.2
if b:
activeID = id
if activeID == id:
print(id," : ",s, "diff: ", b)
lastN = n
@asyncio.coroutine
def print_events(device,... | 21.689394 | 71 | 0.642683 | import asyncio, evdev
import asyncio
import time
lastN = 0
activeID = ""
def scanFilter(id,s):
n = time.time()
global lastN
global activeID
d = n - lastN
b = d > 0.2
if b:
activeID = id
if activeID == id:
print(id," : ",s, "diff: ", b)
lastN = n
@asyncio.coroutine
def print_events(device,... | true | true |
08f21e9247eb6892eb79026bfc5e4794692d9e24 | 2,904 | py | Python | tests/test_plugin.py | FoundryAI/kedro-airflow | 06ce28c9108c7a624e081b0ba54001a91de7b381 | [
"Apache-2.0"
] | null | null | null | tests/test_plugin.py | FoundryAI/kedro-airflow | 06ce28c9108c7a624e081b0ba54001a91de7b381 | [
"Apache-2.0"
] | null | null | null | tests/test_plugin.py | FoundryAI/kedro-airflow | 06ce28c9108c7a624e081b0ba54001a91de7b381 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2019 QuantumBlack Visual Analytics Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# THE SOFTWARE IS PROVIDED "AS IS"... | 41.485714 | 85 | 0.734848 | import os
from pathlib import Path
from kedro_airflow.plugin import commands, import_line
def a_function(): pass
def test_import_line(mocker):
mocker.patch("kedro_airflow.plugin.get_project_context", return_value=a_function)
assert import_line("bob") == "from tests.test_plugin import a_function as bob... | true | true |
08f21f3c724e802374ccc001ab1f3d6fad8cc7bc | 2,912 | py | Python | pardakht/views.py | ARKhoshghalb/django-pardakht | f1cf024e471137d6fa00b3829398f4b2bb68b303 | [
"MIT"
] | 10 | 2018-04-03T07:37:52.000Z | 2019-07-19T21:22:16.000Z | pardakht/views.py | ARKhoshghalb/django-pardakht | f1cf024e471137d6fa00b3829398f4b2bb68b303 | [
"MIT"
] | 4 | 2018-05-26T08:28:41.000Z | 2019-10-26T01:30:00.000Z | pardakht/views.py | ARKhoshghalb/django-pardakht | f1cf024e471137d6fa00b3829398f4b2bb68b303 | [
"MIT"
] | 7 | 2018-04-24T03:14:58.000Z | 2019-12-15T19:12:16.000Z | import importlib
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import Http404
from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from pardakht import gateways
from pardakht.decorators import payment_exists, pay... | 35.512195 | 98 | 0.726305 | import importlib
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import Http404
from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from pardakht import gateways
from pardakht.decorators import payment_exists, pay... | true | true |
08f21ffe0bc0e793733d352927acc58c7d467915 | 8,779 | py | Python | rotors_gazebo/scripts/collaborative/MARL/critic_network.py | intelligent-control-lab/collaborative-aerial-transportation | ec5556d11dda80ab2b9c3bc894fb94c7f63b2dde | [
"MIT"
] | 1 | 2019-07-30T20:07:18.000Z | 2019-07-30T20:07:18.000Z | rotors_gazebo/scripts/collaborative/MARL/critic_network.py | intelligent-control-lab/collaborative-aerial-transportation | ec5556d11dda80ab2b9c3bc894fb94c7f63b2dde | [
"MIT"
] | null | null | null | rotors_gazebo/scripts/collaborative/MARL/critic_network.py | intelligent-control-lab/collaborative-aerial-transportation | ec5556d11dda80ab2b9c3bc894fb94c7f63b2dde | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import math
# target updating rate
TAU = .001
L2 = .0001
LEARNING_RATE = 1e-3
preLayer1Size = 256
preLayer2Size = 128
sufLayerSize = 128
SUMMARY_DIR ='/home/lucasyu/catkin_ws/src/collaborative_transportation/rotors_gazebo/scripts/collaborative/MARL/summaries/'
c... | 44.115578 | 124 | 0.62023 | import tensorflow as tf
import numpy as np
import math
TAU = .001
L2 = .0001
LEARNING_RATE = 1e-3
preLayer1Size = 256
preLayer2Size = 128
sufLayerSize = 128
SUMMARY_DIR ='/home/lucasyu/catkin_ws/src/collaborative_transportation/rotors_gazebo/scripts/collaborative/MARL/summaries/'
class CriticNetwork:
... | true | true |
08f2206ef1d1764a2d07b2756c4888695afd18ec | 1,718 | py | Python | virtual/lib/python3.6/site-packages/phonenumbers/data/region_DO.py | NicolletteOchola/NeighborhoodWatch | adf209ac94b891fad07bd8197cd57699ea3d30bb | [
"MIT"
] | 2 | 2019-12-06T15:40:14.000Z | 2020-07-29T21:30:35.000Z | venv/lib/python3.6/site-packages/phonenumbers/data/region_DO.py | jyoost/saleor | e7d0da1f6f653607580a9cd792acfc4917908649 | [
"CC-BY-4.0"
] | 4 | 2020-06-06T00:45:54.000Z | 2021-09-08T01:42:14.000Z | venv/lib/python3.6/site-packages/phonenumbers/data/region_DO.py | jyoost/saleor | e7d0da1f6f653607580a9cd792acfc4917908649 | [
"CC-BY-4.0"
] | null | null | null | """Auto-generated file, do not edit by hand. DO metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_DO = PhoneMetadata(id='DO', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='(?:[58]\\d\\d|900)\\d{7}', possible_lengt... | 107.375 | 496 | 0.692666 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_DO = PhoneMetadata(id='DO', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='(?:[58]\\d\\d|900)\\d{7}', possible_length=(10,), possible_length_local_only=(7,)),
fixed_line=Ph... | true | true |
08f220e84e2b6e05a383c7dd52c352881c47b0d5 | 1,725 | py | Python | atlas/modules/helpers/open_api_reader.py | swagger-atlas/atlas | 64a0a6e3107da9f7cf894880823badfa84e11f25 | [
"Apache-2.0"
] | 2 | 2019-04-25T10:22:53.000Z | 2020-10-09T06:57:02.000Z | atlas/modules/helpers/open_api_reader.py | swagger-atlas/atlas | 64a0a6e3107da9f7cf894880823badfa84e11f25 | [
"Apache-2.0"
] | 9 | 2019-04-11T17:27:57.000Z | 2021-05-08T13:12:10.000Z | atlas/modules/helpers/open_api_reader.py | swagger-atlas/atlas | 64a0a6e3107da9f7cf894880823badfa84e11f25 | [
"Apache-2.0"
] | 1 | 2019-04-18T22:18:37.000Z | 2019-04-18T22:18:37.000Z | from io import open
import json
import os
import six
import yaml
from atlas.modules import (
constants,
exceptions,
utils,
)
from atlas.conf import settings
class SpecsFile:
CONVERTER = {
constants.JSON: json.load,
constants.YAML: yaml.safe_load
}
def __init__(self, spec_fi... | 27.822581 | 112 | 0.668986 | from io import open
import json
import os
import six
import yaml
from atlas.modules import (
constants,
exceptions,
utils,
)
from atlas.conf import settings
class SpecsFile:
CONVERTER = {
constants.JSON: json.load,
constants.YAML: yaml.safe_load
}
def __init__(self, spec_fi... | true | true |
08f2220aa8d21bfe0af18c5e3b0d067d63e7dd62 | 5,528 | py | Python | tests/test_uploader.py | thewh1teagle/tus-py-client | 89601b84a2bd13ff6b8b79e77ac3795dc2476ec9 | [
"MIT"
] | 105 | 2017-03-27T09:07:56.000Z | 2022-03-10T01:50:48.000Z | tests/test_uploader.py | thewh1teagle/tus-py-client | 89601b84a2bd13ff6b8b79e77ac3795dc2476ec9 | [
"MIT"
] | 44 | 2017-04-12T20:49:27.000Z | 2022-03-23T18:01:32.000Z | tests/test_uploader.py | thewh1teagle/tus-py-client | 89601b84a2bd13ff6b8b79e77ac3795dc2476ec9 | [
"MIT"
] | 35 | 2017-04-12T16:57:27.000Z | 2022-03-22T09:10:05.000Z | import os
from base64 import b64encode
from unittest import mock
import responses
import pytest
from tusclient import exceptions
from tusclient.storage import filestorage
from tests import mixin
class UploaderTest(mixin.Mixin):
def mock_request(self, request_mock):
request_mock = request_mock.return_va... | 40.647059 | 100 | 0.672938 | import os
from base64 import b64encode
from unittest import mock
import responses
import pytest
from tusclient import exceptions
from tusclient.storage import filestorage
from tests import mixin
class UploaderTest(mixin.Mixin):
def mock_request(self, request_mock):
request_mock = request_mock.return_va... | true | true |
08f2222996f9e24c4acc3a021982ec3ca31cc461 | 1,460 | py | Python | docs/benchmarks.py | ionelmc/wrapt | 4abbac872ccf0c253374277ce7c72f188b8469b7 | [
"BSD-2-Clause"
] | null | null | null | docs/benchmarks.py | ionelmc/wrapt | 4abbac872ccf0c253374277ce7c72f188b8469b7 | [
"BSD-2-Clause"
] | 1 | 2016-03-03T08:21:23.000Z | 2016-03-03T08:21:23.000Z | docs/benchmarks.py | ionelmc/wrapt | 4abbac872ccf0c253374277ce7c72f188b8469b7 | [
"BSD-2-Clause"
] | null | null | null | import wrapt # https://pypi.python.org/pypi/wrapt
import decorator # https://pypi.python.org/pypi/decorator
def function1():
pass
def wrapper2(func):
def _wrapper2(*args, **kwargs):
return func(*args, **kwargs)
return _wrapper2
@wrapper2
def function2():
pass
@wrapt.decorator
def wrapper3(wr... | 15.208333 | 57 | 0.608219 | import wrapt import decorator
def function1():
pass
def wrapper2(func):
def _wrapper2(*args, **kwargs):
return func(*args, **kwargs)
return _wrapper2
@wrapper2
def function2():
pass
@wrapt.decorator
def wrapper3(wrapped, instance, args, kwargs):
return wrapped(*args, **kwargs)
@wrapper3... | true | true |
08f2224dd5202ab00b67edd222548da7354f4e90 | 1,922 | py | Python | krysztalki/workDir/tests/test matrices/test_matrices_like_m3_xxx.py | woblob/Crystal_Symmetry | be2984b4487d6075986ef60822a347d0b0e6b885 | [
"MIT"
] | null | null | null | krysztalki/workDir/tests/test matrices/test_matrices_like_m3_xxx.py | woblob/Crystal_Symmetry | be2984b4487d6075986ef60822a347d0b0e6b885 | [
"MIT"
] | null | null | null | krysztalki/workDir/tests/test matrices/test_matrices_like_m3_xxx.py | woblob/Crystal_Symmetry | be2984b4487d6075986ef60822a347d0b0e6b885 | [
"MIT"
] | null | null | null | import matrices_new_extended as mne
import numpy as np
import sympy as sp
from equality_check import Point
x, y, z = sp.symbols("x y z")
Point.base_point = np.array([x, y, z, 1])
class Test_Axis_m3_xxx:
def test_matrix_m3_xxx(self):
expected = Point([ -z, -x, -y, 1])
calculated = Point.calculate... | 34.321429 | 65 | 0.657128 | import matrices_new_extended as mne
import numpy as np
import sympy as sp
from equality_check import Point
x, y, z = sp.symbols("x y z")
Point.base_point = np.array([x, y, z, 1])
class Test_Axis_m3_xxx:
def test_matrix_m3_xxx(self):
expected = Point([ -z, -x, -y, 1])
calculated = Point.calculate... | true | true |
08f222f63b4a3cf4795f1c2d443505b6feba5c3b | 14,185 | py | Python | GPS_vis_env/Lib/site-packages/qtconsole/ansi_code_processor.py | morekeng/GPS-visualization-Python | c07fd3128e94b10699bf12b0418ec8ef476755da | [
"MIT"
] | 329 | 2015-05-09T21:16:56.000Z | 2022-03-29T15:01:26.000Z | GPS_vis_env/Lib/site-packages/qtconsole/ansi_code_processor.py | morekeng/GPS-visualization-Python | c07fd3128e94b10699bf12b0418ec8ef476755da | [
"MIT"
] | 444 | 2015-05-07T22:48:51.000Z | 2022-03-31T07:30:39.000Z | GPS_vis_env/Lib/site-packages/qtconsole/ansi_code_processor.py | morekeng/GPS-visualization-Python | c07fd3128e94b10699bf12b0418ec8ef476755da | [
"MIT"
] | 200 | 2015-05-08T23:25:26.000Z | 2022-03-29T18:36:25.000Z | """ Utilities for processing ANSI escape codes and special ASCII characters.
"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Standard library imports
from collections import namedtuple
import r... | 36.094148 | 84 | 0.524286 |
from collections import namedtuple
import re
from qtpy import QtGui
from qtconsole.styles import dark_style
EraseAction = namedtuple('EraseAction', ['action', 'area', 'erase_to'])
MoveAction = namedtuple('MoveAction', ['action', 'dir', 'unit', 'count'])
ScrollAction = namedtuple('ScrollAction', ['action', 'dir',... | true | true |
08f222ffcdd9078b69af34424d19dcd23fefdd17 | 1,310 | py | Python | examples/color_cycle.py | Frederic98/st7735_tft | b6d991b0e82f98937bd4cf4aa8a125101e91f8be | [
"MIT"
] | null | null | null | examples/color_cycle.py | Frederic98/st7735_tft | b6d991b0e82f98937bd4cf4aa8a125101e91f8be | [
"MIT"
] | null | null | null | examples/color_cycle.py | Frederic98/st7735_tft | b6d991b0e82f98937bd4cf4aa8a125101e91f8be | [
"MIT"
] | null | null | null | import os
import sys
from PIL import Image, ImageDraw
import time
import numpy as np
from st7735_tft import ST7735_TFT # To test higher speed library
# from ST7735 import ST7735 as ST7735_TFT # To test original Pimoroni library
disp = ST7735_TFT(
port=0,
cs=0,
dc=9,
backlight=19,
... | 27.87234 | 107 | 0.664122 | import os
import sys
from PIL import Image, ImageDraw
import time
import numpy as np
from st7735_tft import ST7735_TFT
disp = ST7735_TFT(
port=0,
cs=0,
dc=9,
backlight=19,
spi_speed_hz=4000000,
)
img = Image.new('RGB', (disp.width, disp.height), '#000000')
painter = ImageDraw.Dr... | true | true |
08f223485aff60bb3832d942f4debea209963c06 | 415 | py | Python | configs/vfnet/vfnet_r2_101_fpn_mstrain_2x_coco.py | yypurpose/mmdetection | ec6bfd96eae0af047c623f3d1ec31b0b3f1f4a6c | [
"Apache-2.0"
] | null | null | null | configs/vfnet/vfnet_r2_101_fpn_mstrain_2x_coco.py | yypurpose/mmdetection | ec6bfd96eae0af047c623f3d1ec31b0b3f1f4a6c | [
"Apache-2.0"
] | null | null | null | configs/vfnet/vfnet_r2_101_fpn_mstrain_2x_coco.py | yypurpose/mmdetection | ec6bfd96eae0af047c623f3d1ec31b0b3f1f4a6c | [
"Apache-2.0"
] | null | null | null | _base_ = './vfnet_r50_fpn_mstrain_2x_coco.py'
model = dict(
pretrained='open-mmlab://res2net101_v1d_26w_4s',
backbone=dict(
type='Res2Net',
depth=101,
scales=4,
base_width=26,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm... | 27.666667 | 54 | 0.568675 | _base_ = './vfnet_r50_fpn_mstrain_2x_coco.py'
model = dict(
pretrained='open-mmlab://res2net101_v1d_26w_4s',
backbone=dict(
type='Res2Net',
depth=101,
scales=4,
base_width=26,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm... | true | true |
08f2248de33aea693f613bd5bd07bd0eaf4e2802 | 1,805 | py | Python | src/reliapy/distributions/continuous/_erlang.py | reliapy/reliapy | 3efd48af5cc3bedbcbc5de64fb43e6c5625e3f6d | [
"BSD-3-Clause"
] | null | null | null | src/reliapy/distributions/continuous/_erlang.py | reliapy/reliapy | 3efd48af5cc3bedbcbc5de64fb43e6c5625e3f6d | [
"BSD-3-Clause"
] | null | null | null | src/reliapy/distributions/continuous/_erlang.py | reliapy/reliapy | 3efd48af5cc3bedbcbc5de64fb43e6c5625e3f6d | [
"BSD-3-Clause"
] | null | null | null | from reliapy.distributions.continuous import _Continuous
from scipy.stats import erlang as prob
class Erlang(_Continuous):
def __init__(self, a=None, loc=None, scale=None, random_state=None):
self.a = a
self.loc = loc
self.scale = scale
self.stats = prob.stats(a=self.a, loc=self.l... | 22.5625 | 109 | 0.491413 | from reliapy.distributions.continuous import _Continuous
from scipy.stats import erlang as prob
class Erlang(_Continuous):
def __init__(self, a=None, loc=None, scale=None, random_state=None):
self.a = a
self.loc = loc
self.scale = scale
self.stats = prob.stats(a=self.a, loc=self.l... | true | true |
08f224ae409133d239806f864fe992252e6e3e23 | 1,767 | py | Python | mksequence.py | knok/make-meidai-dialogue | f20536ac5433b596dd3e5a2a3a8347e4c24dfdca | [
"MIT",
"Unlicense"
] | 40 | 2016-11-10T10:36:17.000Z | 2021-11-15T12:34:32.000Z | mksequence.py | knok/make-meidai-dialogue | f20536ac5433b596dd3e5a2a3a8347e4c24dfdca | [
"MIT",
"Unlicense"
] | 1 | 2017-09-28T22:53:42.000Z | 2017-09-28T22:53:42.000Z | mksequence.py | knok/make-meidai-dialogue | f20536ac5433b596dd3e5a2a3a8347e4c24dfdca | [
"MIT",
"Unlicense"
] | 12 | 2017-01-16T08:54:59.000Z | 2022-01-26T20:51:12.000Z | # -*- coding: utf-8 -*-
import os, sys
try:
unicode
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
def copen(fname, mode):
return codecs.open(fname, mode, "utf-8")
except:
def copen(fname, mode):
return open(fname, mode, encoding='utf-8')
nuc_dir = "nucc"
def ma... | 26.373134 | 64 | 0.488964 |
import os, sys
try:
unicode
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
def copen(fname, mode):
return codecs.open(fname, mode, "utf-8")
except:
def copen(fname, mode):
return open(fname, mode, encoding='utf-8')
nuc_dir = "nucc"
def make_sequence_from_file(fn... | true | true |
08f225a0f13757cdde72914a4c137fa97f7c616f | 1,305 | py | Python | test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/__init__.py | fearthecowboy/autorest.python | a251e361218598b55b0621db2275aafcb7158a5c | [
"MIT"
] | null | null | null | test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/__init__.py | fearthecowboy/autorest.python | a251e361218598b55b0621db2275aafcb7158a5c | [
"MIT"
] | null | null | null | test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/__init__.py | fearthecowboy/autorest.python | a251e361218598b55b0621db2275aafcb7158a5c | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 42.096774 | 88 | 0.739464 |
from ._xms_client_request_id_operations import XMsClientRequestIdOperations
from ._subscription_in_credentials_operations import SubscriptionInCredentialsOperations
from ._subscription_in_method_operations import SubscriptionInMethodOperations
from ._api_version_default_operations import ApiVersionDefaultOperations
fr... | true | true |
08f2267664631112df74a0a89b0258d7681129f5 | 1,235 | py | Python | django/events/admin.py | bear-rsg/postsocialistbritain | 05c658e4835ab8b6cd6ac84fdf488022052bd73a | [
"MIT"
] | null | null | null | django/events/admin.py | bear-rsg/postsocialistbritain | 05c658e4835ab8b6cd6ac84fdf488022052bd73a | [
"MIT"
] | 3 | 2021-07-14T14:07:54.000Z | 2021-10-18T11:08:39.000Z | django/events/admin.py | bear-rsg/postsocialistbritain | 05c658e4835ab8b6cd6ac84fdf488022052bd73a | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
def publish_event(modeladmin, request, queryset):
"""
Sets all selected items in queryset to published
"""
queryset.update(admin_published=True)
publish_event.short_description = "Publish selected events (will appear on main site)"
def unpublis... | 27.444444 | 94 | 0.652632 | from django.contrib import admin
from . import models
def publish_event(modeladmin, request, queryset):
queryset.update(admin_published=True)
publish_event.short_description = "Publish selected events (will appear on main site)"
def unpublish_event(modeladmin, request, queryset):
queryset.update(admin_pub... | true | true |
08f226960d5ddfea6f5b7dd090f12509d5844632 | 10,633 | py | Python | n4ofunc/video.py | noaione/n4ofunc | 81a69de67284f9685d1f88cb34f7d3d2d0ce19c1 | [
"MIT"
] | 4 | 2018-05-28T05:05:01.000Z | 2020-03-24T15:01:24.000Z | n4ofunc/video.py | noaione/n4ofunc | 81a69de67284f9685d1f88cb34f7d3d2d0ce19c1 | [
"MIT"
] | null | null | null | n4ofunc/video.py | noaione/n4ofunc | 81a69de67284f9685d1f88cb34f7d3d2d0ce19c1 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020-present noaione
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, publis... | 34.862295 | 110 | 0.636321 |
from __future__ import annotations
from functools import partial
from pathlib import Path
from typing import Any, Dict, List, Literal, Optional, Union, cast
import vapoursynth as vs
from fvsfunc import Depth
from vsutil import is_image, split
from .utils import has_plugin_or_raise, is_extension
__all__ = (
"so... | true | true |
08f2273afa6bb74000a023c6dba76a24c5b06d7d | 4,337 | py | Python | FileCopyClient.py | lukecotton512/FileCopyClient-Python | 3e8b58b83ea009d7bb13bcd3f585a25544ec7569 | [
"BSD-3-Clause"
] | null | null | null | FileCopyClient.py | lukecotton512/FileCopyClient-Python | 3e8b58b83ea009d7bb13bcd3f585a25544ec7569 | [
"BSD-3-Clause"
] | null | null | null | FileCopyClient.py | lukecotton512/FileCopyClient-Python | 3e8b58b83ea009d7bb13bcd3f585a25544ec7569 | [
"BSD-3-Clause"
] | null | null | null | # FileCopyClient.py
# Luke Cotton
# Our client for FileCopy.
import sys;
import os;
import socket;
# Fills a string with extra null bytes to 512 bytes for sending.
def fillStringToBlock(stringToFill):
strLength = len(stringToFill)
strNumFill = 512 - strLength
for index in range(0, strNumFill):
stringToFill = s... | 29.705479 | 128 | 0.693336 |
import sys;
import os;
import socket;
def fillStringToBlock(stringToFill):
strLength = len(stringToFill)
strNumFill = 512 - strLength
for index in range(0, strNumFill):
stringToFill = stringToFill + "\0"
return stringToFill
def connToServer(serverName):
print("Attempting to connect to {}.".format(server... | true | true |
08f228246bf473e4af39138952b136fda3bf2e35 | 2,071 | py | Python | run_training.py | intflow/DTLN | 11c988e9470cd3317f453021caab37d4cf225066 | [
"MIT"
] | null | null | null | run_training.py | intflow/DTLN | 11c988e9470cd3317f453021caab37d4cf225066 | [
"MIT"
] | null | null | null | run_training.py | intflow/DTLN | 11c988e9470cd3317f453021caab37d4cf225066 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script to train the DTLN model in default settings. The folders for noisy and
clean files are expected to have the same number of files and the files to
have the same name. The training procedure always saves the best weights of
the model into the folder "./models_'r... | 34.516667 | 78 | 0.770642 |
from DTLN_model import DTLN_model
import os
os.environ["CUDA_VISIBLE_DEVICES"]='0,1,2,3,4,5,6,7'
os.environ['TF_DETERMINISTIC_OPS'] = '1'
path_to_train_mix = '/data/DNS-Challenge/training_set/train/noisy/'
path_to_train_speech = '/data/DNS-Challenge/training_set/train/clean/'
path_to_val_mix = '/data/DNS-Challen... | true | true |
08f228b9d4ac5d3df8bff8a4b4870d8b2f9ff4bc | 8,846 | py | Python | sdk/python/pulumi_azure_native/cdn/v20200901/afd_custom_domain.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/cdn/v20200901/afd_custom_domain.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/cdn/v20200901/afd_custom_domain.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 44.903553 | 360 | 0.664142 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['AFDCustomDomain']
class AFDCustomDomain(pulumi.CustomResource):
def __init__(__self__,... | true | true |
08f22905c28fe9eaafc956518e83ed92d8716934 | 384 | py | Python | 0008-String-to-Integer.py | Sax-Ted/Practicing-with-Leetcode | 51701e128d8233d2df7fcbce34eff1b1435133e6 | [
"MIT"
] | null | null | null | 0008-String-to-Integer.py | Sax-Ted/Practicing-with-Leetcode | 51701e128d8233d2df7fcbce34eff1b1435133e6 | [
"MIT"
] | null | null | null | 0008-String-to-Integer.py | Sax-Ted/Practicing-with-Leetcode | 51701e128d8233d2df7fcbce34eff1b1435133e6 | [
"MIT"
] | null | null | null | import re
class Solution:
def myAtoi(self, s: str) -> int:
numString = re.findall("^[\+\-]?\d+", s.strip())
if len(numString) == 0:
return 0
if int(numString[0]) > pow(2, 31) - 1:
return pow(2, 31) - 1
elif int(numString[0]) < pow(-2, 31):
return... | 27.428571 | 57 | 0.471354 | import re
class Solution:
def myAtoi(self, s: str) -> int:
numString = re.findall("^[\+\-]?\d+", s.strip())
if len(numString) == 0:
return 0
if int(numString[0]) > pow(2, 31) - 1:
return pow(2, 31) - 1
elif int(numString[0]) < pow(-2, 31):
return... | true | true |
08f22914f26df5181f905e9ed0a25afc8ada4471 | 533 | py | Python | lib/input_output/get_dummy_series_dc.py | mpmuc84/helper-scripts | 573353827d94f65efe763a93770ba75bcda90fff | [
"BSD-2-Clause"
] | 4 | 2018-10-11T09:48:39.000Z | 2019-11-12T06:17:17.000Z | lib/input_output/get_dummy_series_dc.py | mpmuc84/helper-scripts | 573353827d94f65efe763a93770ba75bcda90fff | [
"BSD-2-Clause"
] | 26 | 2017-11-10T15:46:03.000Z | 2021-08-13T12:02:27.000Z | lib/input_output/get_dummy_series_dc.py | mpmuc84/helper-scripts | 573353827d94f65efe763a93770ba75bcda90fff | [
"BSD-2-Clause"
] | 21 | 2017-10-12T11:47:37.000Z | 2021-05-05T13:07:59.000Z | import os
from input_output.read_file import read_file
def get_dummy_series_dc(series_id):
"""
Get an empty series dublin core catalog with the given id.
:param series_id: The series ID
:type series_id: str
:return: A dummy series dublin core catalog
:rtype: str
"""
dummy_series_dc ... | 25.380952 | 62 | 0.716698 | import os
from input_output.read_file import read_file
def get_dummy_series_dc(series_id):
dummy_series_dc = os.path.abspath("dummy_series_dc.xml")
content = read_file(dummy_series_dc)
content_first, content_second = content.split("*")
content = content_first + series_id + content_second
return ... | true | true |
08f22960c8a2538b80b875251eb5bdb2a037dd9e | 11,187 | py | Python | DIGDriver/region_model/trainers/gp_trainer.py | maxwellsh/DIGDriver | 1f8503c8c22861d6f9b601fd8c5a131e3dc31fc1 | [
"BSD-3-Clause"
] | 1 | 2021-08-07T00:05:48.000Z | 2021-08-07T00:05:48.000Z | DIGDriver/region_model/trainers/gp_trainer.py | maxwellsh/DIGDriver | 1f8503c8c22861d6f9b601fd8c5a131e3dc31fc1 | [
"BSD-3-Clause"
] | null | null | null | DIGDriver/region_model/trainers/gp_trainer.py | maxwellsh/DIGDriver | 1f8503c8c22861d6f9b601fd8c5a131e3dc31fc1 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import scipy
import torch
import gpytorch
from sklearn.preprocessing import StandardScaler
import warnings
warnings.filterwarnings("ignore", category=RuntimeWarning)
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[... | 42.536122 | 144 | 0.591848 | import numpy as np
import scipy
import torch
import gpytorch
from sklearn.preprocessing import StandardScaler
import warnings
warnings.filterwarnings("ignore", category=RuntimeWarning)
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[... | true | true |
08f229f851c2d4c7d514adc57fa92349f44a2dfc | 12,133 | py | Python | housing_price/housing_price.py | ftan84/housing-price | 72f51664fa03e4de9d812299ccbe729458bc4d6a | [
"MIT"
] | 1 | 2018-04-24T15:26:14.000Z | 2018-04-24T15:26:14.000Z | housing_price/housing_price.py | ftan84/housing-price | 72f51664fa03e4de9d812299ccbe729458bc4d6a | [
"MIT"
] | null | null | null | housing_price/housing_price.py | ftan84/housing-price | 72f51664fa03e4de9d812299ccbe729458bc4d6a | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
import sqlite3
import time
def db_init(dbfile):
"""Initializes SQLite database.
This function creates required tables.
Args:
file (str): Name of SQLite database.
Returns:
bool: True if successful, False otherwise.
"""
conn = sqli... | 38.887821 | 79 | 0.514217 | from bs4 import BeautifulSoup
import requests
import sqlite3
import time
def db_init(dbfile):
"""Initializes SQLite database.
This function creates required tables.
Args:
file (str): Name of SQLite database.
Returns:
bool: True if successful, False otherwise.
"""
conn = sqli... | false | true |
08f22afcd09083f4c24db4489c04134048120388 | 9,844 | py | Python | train.py | mstark5652/ocv | 15f94ce5d5c54ca6eb4bb7a8a7f596f4fef0c55a | [
"MIT"
] | null | null | null | train.py | mstark5652/ocv | 15f94ce5d5c54ca6eb4bb7a8a7f596f4fef0c55a | [
"MIT"
] | null | null | null | train.py | mstark5652/ocv | 15f94ce5d5c54ca6eb4bb7a8a7f596f4fef0c55a | [
"MIT"
] | null | null | null | #
# Created by mstark on January 19, 2019
#
# Copyright (c) 2019. Michael Stark. All Rights Reserved.
#
import sys
import os
import argparse
import math
import cv2
import numpy as np
from obj_loader import OBJ
WINDOW_SIZE = 2000
def extract_features(model_path):
""" """
img = cv2.imread(model_path, 0)
... | 31.857605 | 105 | 0.610727 |
import sys
import os
import argparse
import math
import cv2
import numpy as np
from obj_loader import OBJ
WINDOW_SIZE = 2000
def extract_features(model_path):
img = cv2.imread(model_path, 0)
orb = cv2.ORB_create()
kp = orb.detect(img, None)
kp, des = orb.compute(img, kp)
... | true | true |
08f22b3599d1c26fcd8bc8790c7626b6618de329 | 2,646 | py | Python | src/lektorium/jwt.py | sphericalpm/lektorium | 9b3b72c03495f269494a6a83bf102d79b1f5eeb3 | [
"MIT"
] | 18 | 2019-07-16T06:10:05.000Z | 2021-11-27T12:57:47.000Z | src/lektorium/jwt.py | sphericalpm/lektorium | 9b3b72c03495f269494a6a83bf102d79b1f5eeb3 | [
"MIT"
] | 34 | 2019-07-15T17:21:38.000Z | 2021-02-09T14:27:39.000Z | src/lektorium/jwt.py | sphericalpm/lektorium | 9b3b72c03495f269494a6a83bf102d79b1f5eeb3 | [
"MIT"
] | 6 | 2019-07-16T09:16:46.000Z | 2019-10-16T08:48:50.000Z | import aiohttp
from authlib.jose import JsonWebToken
from authlib.jose.errors import JoseError
from cached_property import cached_property
from graphql import GraphQLError
class JWTMiddleware:
def __init__(self, auth0_domain):
if not (auth0_domain and auth0_domain.endswith('.auth0.com')):
rais... | 33.075 | 75 | 0.600151 | import aiohttp
from authlib.jose import JsonWebToken
from authlib.jose.errors import JoseError
from cached_property import cached_property
from graphql import GraphQLError
class JWTMiddleware:
def __init__(self, auth0_domain):
if not (auth0_domain and auth0_domain.endswith('.auth0.com')):
rais... | true | true |
08f22b71b42db7d5f585cf42a402c658a72335be | 8,091 | py | Python | sunshine_conversations_client/model/android_all_of.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 4 | 2020-09-27T14:28:25.000Z | 2022-02-02T13:51:29.000Z | sunshine_conversations_client/model/android_all_of.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 3 | 2021-09-30T18:18:58.000Z | 2021-12-04T07:55:23.000Z | sunshine_conversations_client/model/android_all_of.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 5 | 2020-11-07T02:08:18.000Z | 2021-12-07T17:10:23.000Z | # coding: utf-8
"""
Sunshine Conversations API
The version of the OpenAPI document: 9.4.5
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from sunshine_conversations_client.configuration import Configuration
from sunshine_conversations_client.undefine... | 35.486842 | 452 | 0.634409 |
import pprint
import re
import six
from sunshine_conversations_client.configuration import Configuration
from sunshine_conversations_client.undefined import Undefined
class AndroidAllOf(object):
openapi_types = {
'type': 'str',
'server_key': 'str',
'sender_id': 'str',
'can_... | true | true |
08f22bb25632f5bb3ccfa3a3134c9f42cc05677d | 18,928 | py | Python | chwall/wallpaper.py | milouse/chwall | 963045658abd41c94e29850e9f416c8970e06c32 | [
"WTFPL"
] | 4 | 2019-11-02T12:22:48.000Z | 2022-01-07T11:40:40.000Z | chwall/wallpaper.py | milouse/chwall | 963045658abd41c94e29850e9f416c8970e06c32 | [
"WTFPL"
] | 1 | 2022-03-29T18:44:47.000Z | 2022-03-30T07:04:54.000Z | chwall/wallpaper.py | milouse/chwall | 963045658abd41c94e29850e9f416c8970e06c32 | [
"WTFPL"
] | null | null | null | import os
import time
import yaml
import random
import shutil
import hashlib
import requests
import subprocess
from PIL import Image, ImageFilter
from importlib import import_module
# chwall imports
from chwall.utils import BASE_CACHE_PATH, get_screen_config, get_wall_config, \
get_logger, is_... | 35.713208 | 79 | 0.60186 | import os
import time
import yaml
import random
import shutil
import hashlib
import requests
import subprocess
from PIL import Image, ImageFilter
from importlib import import_module
from chwall.utils import BASE_CACHE_PATH, get_screen_config, get_wall_config, \
get_logger, is_broken_picture
i... | true | true |
08f22bdd75c05a874132d815ac2a55856c6a86e8 | 6,690 | py | Python | bvh.py | OlafHaag/bvh-python | cab247413c0d30b65c95a18cb86aa42067783281 | [
"MIT"
] | null | null | null | bvh.py | OlafHaag/bvh-python | cab247413c0d30b65c95a18cb86aa42067783281 | [
"MIT"
] | null | null | null | bvh.py | OlafHaag/bvh-python | cab247413c0d30b65c95a18cb86aa42067783281 | [
"MIT"
] | null | null | null | import re
class BvhNode:
def __init__(self, value=[], parent=None):
self.value = value
self.children = []
self.parent = parent
if self.parent:
self.parent.add_child(self)
def add_child(self, item):
item.parent = self
self.children.append(item)
... | 31.261682 | 77 | 0.542302 | import re
class BvhNode:
def __init__(self, value=[], parent=None):
self.value = value
self.children = []
self.parent = parent
if self.parent:
self.parent.add_child(self)
def add_child(self, item):
item.parent = self
self.children.append(item)
... | true | true |
08f22e8f365fca5ec46366a27ca7909e5ed118a9 | 12,600 | py | Python | docs/conf.py | sunt05/salem | 22e64ef02a020a4f742971c6b0a09ac1dad56ee6 | [
"ECL-2.0",
"Apache-2.0"
] | 147 | 2015-09-17T13:41:55.000Z | 2022-03-23T17:08:29.000Z | docs/conf.py | sunt05/salem | 22e64ef02a020a4f742971c6b0a09ac1dad56ee6 | [
"ECL-2.0",
"Apache-2.0"
] | 113 | 2016-03-12T09:06:56.000Z | 2022-03-29T12:50:29.000Z | docs/conf.py | sunt05/salem | 22e64ef02a020a4f742971c6b0a09ac1dad56ee6 | [
"ECL-2.0",
"Apache-2.0"
] | 39 | 2016-11-29T16:42:11.000Z | 2021-12-13T13:52:58.000Z | # -*- coding: utf-8 -*-
#
# salem documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 21 10:03:33 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | 30.958231 | 79 | 0.708492 |
import os
import sys
print("python exec:", sys.executable)
print("sys.path:", sys.path)
print("python version:", sys.version)
try:
import numpy
print("numpy: %s, %s" % (numpy.__version__, numpy.__file__))
except ImportError:
print("no numpy")
try:
import scipy
print("scipy: %s, %s" % (scipy.__vers... | true | true |
08f22ef9a8530993c56acb779894cb07bb3bbf69 | 2,661 | py | Python | cysystemd/daemon.py | sbarthelemy/cysystemd | c0d5f3b919c4876360f15ad1179f113731b8a301 | [
"Apache-2.0"
] | 62 | 2018-09-09T17:42:54.000Z | 2022-03-04T07:10:43.000Z | cysystemd/daemon.py | snu-development/cysystemd | 7990aeb9cfbb56d5fbe1e878ec59ae5d1b44d52b | [
"Apache-2.0"
] | 28 | 2018-09-06T19:14:11.000Z | 2021-11-10T15:06:25.000Z | cysystemd/daemon.py | snu-development/cysystemd | 7990aeb9cfbb56d5fbe1e878ec59ae5d1b44d52b | [
"Apache-2.0"
] | 20 | 2019-02-25T08:39:46.000Z | 2022-02-28T13:22:07.000Z | import logging
from collections import namedtuple
from typing import Union
from enum import Enum, unique
from ._daemon import sd_notify
log = logging.getLogger("cysystemd.daemon")
NotificationValue = namedtuple(
"NotificationValue", ("name", "constant", "type")
)
@unique
class Notification(Enum):
READY = N... | 32.45122 | 77 | 0.685081 | import logging
from collections import namedtuple
from typing import Union
from enum import Enum, unique
from ._daemon import sd_notify
log = logging.getLogger("cysystemd.daemon")
NotificationValue = namedtuple(
"NotificationValue", ("name", "constant", "type")
)
@unique
class Notification(Enum):
READY = N... | true | true |
08f22f3eb060b10ffda2a83542aa3aba5b4ebd97 | 173 | py | Python | pathmatcher-cli.py | lrq3000/pathmatcher | 8baee07542f99e8bfa6fcb65c1e3008c080f037b | [
"MIT"
] | 1 | 2021-01-06T11:53:07.000Z | 2021-01-06T11:53:07.000Z | pathmatcher-cli.py | lrq3000/pathmatcher | 8baee07542f99e8bfa6fcb65c1e3008c080f037b | [
"MIT"
] | null | null | null | pathmatcher-cli.py | lrq3000/pathmatcher | 8baee07542f99e8bfa6fcb65c1e3008c080f037b | [
"MIT"
] | null | null | null | # CLI interface to launch pathmatcher directly, mostly useful to build a pyInstaller binary
from pathmatcher import pathmatcher
if __name__ == '__main__':
pathmatcher()
| 34.6 | 91 | 0.791908 | from pathmatcher import pathmatcher
if __name__ == '__main__':
pathmatcher()
| true | true |
08f22fa470255d3789ca3b8f3e0e2b4b3ff56af7 | 5,129 | py | Python | CloudflareAPI/core/network.py | nikhiljohn10/cloudflare-api | 841ecd0c6545dafe72c975536e040ef054c05d22 | [
"MIT"
] | null | null | null | CloudflareAPI/core/network.py | nikhiljohn10/cloudflare-api | 841ecd0c6545dafe72c975536e040ef054c05d22 | [
"MIT"
] | null | null | null | CloudflareAPI/core/network.py | nikhiljohn10/cloudflare-api | 841ecd0c6545dafe72c975536e040ef054c05d22 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import requests
from requests.models import Response
from typing import Any, Dict, Optional, Union
from ..exceptions import CFError, APIError
class Request:
API_ROOT = "https://api.cloudflare.com/client/v4"
def __init__(self, token: str, path: str = "") -> None:
... | 32.878205 | 86 | 0.48138 |
import requests
from requests.models import Response
from typing import Any, Dict, Optional, Union
from ..exceptions import CFError, APIError
class Request:
API_ROOT = "https://api.cloudflare.com/client/v4"
def __init__(self, token: str, path: str = "") -> None:
if not token:
... | true | true |
08f23165bf4ce7bf8c857bae515b59c9bced162d | 2,128 | py | Python | Code/CNN Python Code/bigdata.py | vbinwang/Prediction-of-Keypoints-Positions-on-Face-Images | a5f55b398e045a94d7803b24697ff5d9686ba691 | [
"MIT"
] | 1 | 2021-12-28T12:28:52.000Z | 2021-12-28T12:28:52.000Z | Code/CNN Python Code/bigdata.py | vbinwang/Prediction-of-Keypoints-Positions-on-Face-Images | a5f55b398e045a94d7803b24697ff5d9686ba691 | [
"MIT"
] | null | null | null | Code/CNN Python Code/bigdata.py | vbinwang/Prediction-of-Keypoints-Positions-on-Face-Images | a5f55b398e045a94d7803b24697ff5d9686ba691 | [
"MIT"
] | null | null | null | import argparse
import code
import os
import argcomplete
import numpy as np
import pandas as pd
import sklearn.ensemble
import sklearn.linear_model
def get_immediate_subdirectories(a_dir):
return [name for name in os.listdir(a_dir)
if os.path.isdir(os.path.join(a_dir, name))]
def main():
parser = argparse.Argum... | 29.555556 | 108 | 0.711936 | import argparse
import code
import os
import argcomplete
import numpy as np
import pandas as pd
import sklearn.ensemble
import sklearn.linear_model
def get_immediate_subdirectories(a_dir):
return [name for name in os.listdir(a_dir)
if os.path.isdir(os.path.join(a_dir, name))]
def main():
parser = argparse.Argum... | false | true |
08f23174abd752079b5d6446d7bb28eb095167b6 | 1,084 | py | Python | setup.py | sliatecinos/CPF_CNPJ | 1bb82962590e545cb233bc811c587a66c3a2ad4c | [
"MIT"
] | null | null | null | setup.py | sliatecinos/CPF_CNPJ | 1bb82962590e545cb233bc811c587a66c3a2ad4c | [
"MIT"
] | null | null | null | setup.py | sliatecinos/CPF_CNPJ | 1bb82962590e545cb233bc811c587a66c3a2ad4c | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Education',
'Operating System :: Microsoft :: Windows :: Windows 10',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3'
]
with open('README.rst') as _readme_fil... | 30.971429 | 92 | 0.677122 | from setuptools import setup, find_packages
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Education',
'Operating System :: Microsoft :: Windows :: Windows 10',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3'
]
with open('README.rst') as _readme_fil... | true | true |
08f231abe69000f0cd31120e54063ba323f50416 | 7,875 | py | Python | tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryBase.py | Sohei-Suzuki-Nexty/sdl_core | 68f082169e0a40fccd9eb0db3c83911c28870f07 | [
"BSD-3-Clause"
] | 249 | 2015-01-15T16:50:53.000Z | 2022-03-24T13:23:34.000Z | tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryBase.py | Sohei-Suzuki-Nexty/sdl_core | 68f082169e0a40fccd9eb0db3c83911c28870f07 | [
"BSD-3-Clause"
] | 2,917 | 2015-01-12T16:17:49.000Z | 2022-03-31T11:57:47.000Z | tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryBase.py | Sohei-Suzuki-Nexty/sdl_core | 68f082169e0a40fccd9eb0db3c83911c28870f07 | [
"BSD-3-Clause"
] | 306 | 2015-01-12T09:23:20.000Z | 2022-01-28T18:06:30.000Z | """Test for SmartFactory generator base.
Verifies common helper functions and produced source code.
"""
import collections
import unittest
from pathlib import Path
import sys
sys.path.append(Path(__file__).absolute().parents[3].as_posix())
sys.path.append(Path(__file__).absolute().parents[4].joinpath('rpc_spec/Inte... | 26.694915 | 101 | 0.547429 | import collections
import unittest
from pathlib import Path
import sys
sys.path.append(Path(__file__).absolute().parents[3].as_posix())
sys.path.append(Path(__file__).absolute().parents[4].joinpath('rpc_spec/InterfaceParser').as_posix())
try:
from generator.generators import SmartFactoryBase
from model.enum i... | true | true |
08f232951ae16dd701609115a1a1b0372fe633de | 44,818 | py | Python | homeassistant/helpers/config_validation.py | ZMan88/core | cc6228f5c943347f3e11b0859f26ba298d23d479 | [
"Apache-2.0"
] | 2 | 2018-01-14T07:08:52.000Z | 2018-06-01T17:43:35.000Z | homeassistant/helpers/config_validation.py | ZMan88/core | cc6228f5c943347f3e11b0859f26ba298d23d479 | [
"Apache-2.0"
] | 83 | 2020-07-31T21:32:45.000Z | 2022-03-31T10:00:54.000Z | homeassistant/helpers/config_validation.py | ZMan88/core | cc6228f5c943347f3e11b0859f26ba298d23d479 | [
"Apache-2.0"
] | 4 | 2020-10-29T22:56:04.000Z | 2020-12-12T21:51:40.000Z | """Helpers for config validation using voluptuous."""
from __future__ import annotations
from collections.abc import Callable, Hashable
import contextlib
from datetime import (
date as date_sys,
datetime as datetime_sys,
time as time_sys,
timedelta,
)
from enum import Enum
import inspect
import logging... | 28.294192 | 106 | 0.623433 | from __future__ import annotations
from collections.abc import Callable, Hashable
import contextlib
from datetime import (
date as date_sys,
datetime as datetime_sys,
time as time_sys,
timedelta,
)
from enum import Enum
import inspect
import logging
from numbers import Number
import os
import re
from s... | true | true |
08f233ca9030818ff7aedac1903d85536309474a | 58,214 | py | Python | nextcord/abc.py | hlieberman/nextcord | d25755e2623c52a944f8ddb8f5b90b6a683fc164 | [
"MIT"
] | 1 | 2022-03-14T19:52:31.000Z | 2022-03-14T19:52:31.000Z | nextcord/abc.py | hlieberman/nextcord | d25755e2623c52a944f8ddb8f5b90b6a683fc164 | [
"MIT"
] | null | null | null | nextcord/abc.py | hlieberman/nextcord | d25755e2623c52a944f8ddb8f5b90b6a683fc164 | [
"MIT"
] | 2 | 2022-01-24T01:58:04.000Z | 2022-03-09T11:42:40.000Z | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | 34.20329 | 154 | 0.594685 |
from __future__ import annotations
import copy
import asyncio
from typing import (
Any,
Callable,
Dict,
List,
Optional,
TYPE_CHECKING,
Protocol,
Sequence,
Tuple,
TypeVar,
Union,
overload,
runtime_checkable,
)
from .iterators import HistoryIterator
from .context_man... | true | true |
08f23611002c8b19a488e97b6b3667dbdf0384ff | 128 | py | Python | web/transiq/owner/apps.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | null | null | null | web/transiq/owner/apps.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | 14 | 2020-06-05T23:06:45.000Z | 2022-03-12T00:00:18.000Z | web/transiq/owner/apps.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class OwnerConfig(AppConfig):
name = 'vehicle'
| 16 | 39 | 0.789063 | from __future__ import unicode_literals
from django.apps import AppConfig
class OwnerConfig(AppConfig):
name = 'vehicle'
| true | true |
08f2361b2e6c114a897c42848ddfa55efad36065 | 13,532 | py | Python | PythonCode/Routing/AirSimPythonClient/GPS/GPSCoordinate.py | NUIG-ROCSAFE/CBRNeVirtualEnvironment | 440149886d7ecca6c774fc4148cf0a0718657ea8 | [
"MIT"
] | 3 | 2018-10-05T09:58:17.000Z | 2019-03-14T07:21:59.000Z | PythonCode/Routing/AirSimPythonClient/GPS/GPSCoordinate.py | NUIG-ROCSAFE/CBRNeVirtualEnvironment | 440149886d7ecca6c774fc4148cf0a0718657ea8 | [
"MIT"
] | 13 | 2018-09-13T16:07:03.000Z | 2018-12-17T17:38:35.000Z | PythonCode/Routing/AirSimPythonClient/GPS/GPSCoordinate.py | NUIG-ROCSAFE/CBRNeVirtualEnvironment | 440149886d7ecca6c774fc4148cf0a0718657ea8 | [
"MIT"
] | 1 | 2018-10-09T00:37:52.000Z | 2018-10-09T00:37:52.000Z | import math
from collections import namedtuple
#theses are just structs
WGS84Ellipsoid = namedtuple("WGS84Ellipsoid", "WGSa WGSb WGSf")
WebMercator = namedtuple("WebMercator", "m1 m2 m3 m4 p1 p2 p3")
#This is outdated! Update with reference to java
class GPSCoordinate:
#m1 = 111132.92;
#m2 = -559.82;
#m3 =... | 41.382263 | 183 | 0.605823 | import math
from collections import namedtuple
WGS84Ellipsoid = namedtuple("WGS84Ellipsoid", "WGSa WGSb WGSf")
WebMercator = namedtuple("WebMercator", "m1 m2 m3 m4 p1 p2 p3")
class GPSCoordinate:
TwoPi = 2.0 * math.pi;
Ellipsoid = WGS84Ellipsoid(63... | true | true |
08f2370ef5eafa04fb810ecc12e19b03e5822e36 | 909 | py | Python | exersizes/wrangler.py | KitN/ThinkPython2 | 70df29d014198c5725fc01a6c619787b487a1fdb | [
"MIT"
] | null | null | null | exersizes/wrangler.py | KitN/ThinkPython2 | 70df29d014198c5725fc01a6c619787b487a1fdb | [
"MIT"
] | null | null | null | exersizes/wrangler.py | KitN/ThinkPython2 | 70df29d014198c5725fc01a6c619787b487a1fdb | [
"MIT"
] | null | null | null | # Write a file to read text, split it around whitespace, and strip punctuation.
# Make everything lowercase
import re
def snip_paper(filepath):
"""Takes a text file and turns it into a list of lowercase words with no
punctuation"""
import string
punct = [ord(x) for x in string.punctuation]
cleanerd... | 29.322581 | 79 | 0.653465 | import re
def snip_paper(filepath):
import string
punct = [ord(x) for x in string.punctuation]
cleanerdict = dict()
cd = cleanerdict.fromkeys(punct, None)
with open(filepath) as reader:
rawstring = reader.read()
fragments = rawstring.split()
cleanones = []
for word i... | true | true |
08f2373adde703c28e2f29647b1c3238eda2b60b | 2,113 | py | Python | train_v4.py | zebin-dm/caps | 3334bf18d22d9127cdbd46c9acdabeb856f629a9 | [
"MIT"
] | null | null | null | train_v4.py | zebin-dm/caps | 3334bf18d22d9127cdbd46c9acdabeb856f629a9 | [
"MIT"
] | null | null | null | train_v4.py | zebin-dm/caps | 3334bf18d22d9127cdbd46c9acdabeb856f629a9 | [
"MIT"
] | null | null | null | import os
import config
from tensorboardX import SummaryWriter
from CAPS.caps_model_v3 import CAPSModel
from dataloader.megadepth_v3 import MegaDepthLoader
from utils.draw_utils import cycle
from loguru import logger
def train_megadepth(args):
# save a copy for the current args in out_folder
print("args.outdi... | 31.537313 | 96 | 0.661145 | import os
import config
from tensorboardX import SummaryWriter
from CAPS.caps_model_v3 import CAPSModel
from dataloader.megadepth_v3 import MegaDepthLoader
from utils.draw_utils import cycle
from loguru import logger
def train_megadepth(args):
print("args.outdir: {}".format(args.outdir))
print("args.exp_n... | true | true |
08f238047e67620639c11f643149eecf225b26e8 | 1,485 | py | Python | 02 - VggNet/train.py | MuhammedAshraf2020/Paper2Code | 1dc16610e84248b2543831dccc557ffdd5b81d8d | [
"Apache-2.0"
] | 6 | 2021-11-23T15:15:53.000Z | 2022-03-27T01:06:25.000Z | 02 - VggNet/train.py | MuhammedAshraf2020/Paper-Code | 1dc16610e84248b2543831dccc557ffdd5b81d8d | [
"Apache-2.0"
] | null | null | null | 02 - VggNet/train.py | MuhammedAshraf2020/Paper-Code | 1dc16610e84248b2543831dccc557ffdd5b81d8d | [
"Apache-2.0"
] | 4 | 2021-11-04T00:24:06.000Z | 2022-02-15T22:54:43.000Z |
import argparse
from models import Model as vgg
import pytorch_lightning as pl
from torchsummary import summary
from data_loader import dataLoader
from pytorch_lightning.loggers import WandbLogger
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.callbacks.early_stopping import Ear... | 41.25 | 121 | 0.714478 |
import argparse
from models import Model as vgg
import pytorch_lightning as pl
from torchsummary import summary
from data_loader import dataLoader
from pytorch_lightning.loggers import WandbLogger
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.callbacks.early_stopping import Ear... | true | true |
08f239da4b81c1972fdca654f18db546ca1846e4 | 3,881 | py | Python | src/lib/mine/throw_out_your_templates/section_3.py | rdw20170120/workstation | ed19aa930a83885c2a8cb58eb0bb5afe58f95df3 | [
"MIT"
] | null | null | null | src/lib/mine/throw_out_your_templates/section_3.py | rdw20170120/workstation | ed19aa930a83885c2a8cb58eb0bb5afe58f95df3 | [
"MIT"
] | 2 | 2021-04-06T18:07:32.000Z | 2021-06-02T01:50:40.000Z | src/lib/mine/throw_out_your_templates/section_3.py | rdw20170120/workstation | ed19aa930a83885c2a8cb58eb0bb5afe58f95df3 | [
"MIT"
] | null | null | null | #!/usr/bin/env false
"""3: VisitorMap"""
# Internal packages (absolute references, distributed with Python)
# External packages (absolute references, NOT distributed with Python)
# Library modules (absolute references, NOT packaged, in project)
from utility import my_assert as is_
# Project modules (relative refer... | 33.456897 | 72 | 0.64133 | from utility import my_assert as is_
class VisitorMap(dict):
def __init__(self, map_or_seq=(), parent_map=None):
super(VisitorMap, self).__init__(map_or_seq)
self.parent_map = parent_map
def get_visitor(self, obj, use_default=True):
py_type = type(obj)
result = self.get(py_t... | true | true |
08f23aa2231424887f3c935dbb8368a2aa46cc63 | 18,031 | py | Python | tensorflow/contrib/learn/python/learn/estimators/run_config.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 52 | 2018-11-12T06:39:35.000Z | 2022-03-08T05:31:27.000Z | tensorflow/contrib/learn/python/learn/estimators/run_config.py | shekharpalit/tensorflow | 6aa83398ab03bfae822f36772757097bcb98b6ed | [
"Apache-2.0"
] | 30 | 2016-10-04T15:38:08.000Z | 2020-07-16T12:09:33.000Z | tensorflow/contrib/learn/python/learn/estimators/run_config.py | shekharpalit/tensorflow | 6aa83398ab03bfae822f36772757097bcb98b6ed | [
"Apache-2.0"
] | 36 | 2017-07-27T21:12:40.000Z | 2022-02-03T16:45:56.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.254132 | 93 | 0.700959 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import json
import os
import six
from tensorflow.contrib.framework.python.framework import experimental
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.estimator imp... | true | true |
08f23aa647ff791399b64cd728f545b9d2b29e4b | 5,364 | py | Python | purity_fb/purity_fb_1dot8/models/file_system_response.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 5 | 2017-09-08T20:47:22.000Z | 2021-06-29T02:11:05.000Z | purity_fb/purity_fb_1dot8/models/file_system_response.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 16 | 2017-11-27T20:57:48.000Z | 2021-11-23T18:46:43.000Z | purity_fb/purity_fb_1dot8/models/file_system_response.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 22 | 2017-10-13T15:33:05.000Z | 2021-11-08T19:56:21.000Z | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.8 Python SDK
Pure Storage FlashBlade REST 1.8 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.8
Contact: i... | 29.96648 | 204 | 0.599366 |
import pprint
import re
import six
class FileSystemResponse(object):
__test__ = False
swagger_types = {
'pagination_info': 'PaginationInfo',
'total': 'FileSystem',
'items': 'list[FileSystem]'
}
attribute_map = {
'pagination_info': 'pagination_info',
... | true | true |
08f23ac888e96d858da366e21a407e4ba716932e | 10,140 | py | Python | GearBot/Cogs/Emoji.py | blastoise186/GearBot | 42b91246a9ba6742fd4ca5a3951a9769675138e2 | [
"MIT"
] | 1 | 2021-09-24T22:55:35.000Z | 2021-09-24T22:55:35.000Z | GearBot/Cogs/Emoji.py | Aimarekin/GearBot | 6e1c51c61b9248309836371d5b80c413c5519a86 | [
"MIT"
] | 106 | 2020-07-26T14:06:59.000Z | 2022-03-18T13:34:02.000Z | GearBot/Cogs/Emoji.py | blastoise186/GearBot | 42b91246a9ba6742fd4ca5a3951a9769675138e2 | [
"MIT"
] | null | null | null | import asyncio
import discord
from discord import HTTPException, InvalidArgument, Embed, Role, Emoji
from discord.ext import commands
from discord.ext.commands import Greedy
from Cogs.BaseCog import BaseCog
from Util import Permissioncheckers, MessageUtils, Translator, Pages, Utils
from Util.Converters import EmojiNa... | 46.513761 | 193 | 0.609172 | import asyncio
import discord
from discord import HTTPException, InvalidArgument, Embed, Role, Emoji
from discord.ext import commands
from discord.ext.commands import Greedy
from Cogs.BaseCog import BaseCog
from Util import Permissioncheckers, MessageUtils, Translator, Pages, Utils
from Util.Converters import EmojiNa... | true | true |
08f23b6755e2325aefca6f6d3eb0e75b3f9097c5 | 1,136 | py | Python | scripts/postw90_in_writer.py | Compiler-max/MEPinterp | e1b8ba0ec4a4c61d61f6555608fb26aeaaf64d71 | [
"MIT"
] | 2 | 2019-05-07T04:53:45.000Z | 2019-08-16T20:52:07.000Z | scripts/postw90_in_writer.py | cMax347/MEPinterp | e1b8ba0ec4a4c61d61f6555608fb26aeaaf64d71 | [
"MIT"
] | null | null | null | scripts/postw90_in_writer.py | cMax347/MEPinterp | e1b8ba0ec4a4c61d61f6555608fb26aeaaf64d71 | [
"MIT"
] | null | null | null | import datetime
class postw90_job:
def __init__(self, w90_dir, seedname, val_bands, mp_grid, hw=0.0,eFermi=0.0, Tkelvin=0.0,eta_smearing=0.0 ):
self.w90_dir = w90_dir
self.seedname = seedname
self.val_bands = val_bands
self.mp_grid = mp_grid
self.hw = hw
self.eFermi = eFermi
self.Tkelvin = Tkelvin... | 23.183673 | 135 | 0.650528 | import datetime
class postw90_job:
def __init__(self, w90_dir, seedname, val_bands, mp_grid, hw=0.0,eFermi=0.0, Tkelvin=0.0,eta_smearing=0.0 ):
self.w90_dir = w90_dir
self.seedname = seedname
self.val_bands = val_bands
self.mp_grid = mp_grid
self.hw = hw
self.eFermi = eFermi
self.Tkelvin = Tkelvin... | true | true |
08f23b8ca73c04e1b5f31ce7f64fbf8e14c42c62 | 1,110 | py | Python | tests/helpers/test_run_on_container.py | ryan-rs/pytest-rpc | 35fc48093797f823b42ca57b3872770c55295b02 | [
"Apache-2.0"
] | null | null | null | tests/helpers/test_run_on_container.py | ryan-rs/pytest-rpc | 35fc48093797f823b42ca57b3872770c55295b02 | [
"Apache-2.0"
] | 18 | 2018-03-02T16:42:28.000Z | 2019-01-29T16:32:00.000Z | tests/helpers/test_run_on_container.py | ryan-rs/pytest-rpc | 35fc48093797f823b42ca57b3872770c55295b02 | [
"Apache-2.0"
] | 3 | 2018-03-01T19:02:20.000Z | 2019-03-06T19:07:10.000Z | # -*- coding: utf-8 -*-
import pytest_rpc.helpers
import testinfra.backend.base
import testinfra.host
"""Test cases for the 'run_on_container' helper function."""
def test_expected_constructed_run_command(mocker):
"""Verify run_on_container helper calls `testinfra.host.Host.run` with the
expected command and... | 34.6875 | 78 | 0.718919 | import pytest_rpc.helpers
import testinfra.backend.base
import testinfra.host
def test_expected_constructed_run_command(mocker):
fake_backend = mocker.Mock(spec=testinfra.backend.base.BaseBackend)
myhost = testinfra.host.Host(fake_backend)
command_result = mocker.Mock(spec=testinfra.backend.base.Command... | true | true |
08f23c6a7ae2c69adaf2c91098f60cf6f66f1228 | 14,932 | py | Python | oneflow/python/test/modules/test_maxpool.py | BBuf/oneflow | 3abfe71617bc04c069b34a68780acbb8bbd959a7 | [
"Apache-2.0"
] | 1 | 2021-02-22T00:43:08.000Z | 2021-02-22T00:43:08.000Z | oneflow/python/test/modules/test_maxpool.py | BBuf/oneflow | 3abfe71617bc04c069b34a68780acbb8bbd959a7 | [
"Apache-2.0"
] | null | null | null | oneflow/python/test/modules/test_maxpool.py | BBuf/oneflow | 3abfe71617bc04c069b34a68780acbb8bbd959a7 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 37.423559 | 88 | 0.624766 | import unittest
from collections import OrderedDict
import numpy as np
import math
import oneflow.experimental as flow
from test_util import GenArgList
def _nd_tuple_to_dhw(nd_tuple, dim, prefix=1, dhw_offset=0):
assert dim <= 3
assert dim == len(nd_tuple) - dhw_offset
nd_tuple = list(nd_tuple)
dhw_... | true | true |
08f23c7f23ee4833051e923c137e581596103895 | 1,754 | py | Python | pid.py | mfbsouza/PID-Rocket | 2b08bc1317ad35df34ee64136717e045fb7312a0 | [
"MIT"
] | null | null | null | pid.py | mfbsouza/PID-Rocket | 2b08bc1317ad35df34ee64136717e045fb7312a0 | [
"MIT"
] | null | null | null | pid.py | mfbsouza/PID-Rocket | 2b08bc1317ad35df34ee64136717e045fb7312a0 | [
"MIT"
] | null | null | null | class PID:
def __init__(self, kp, ki, kd, setpoint, out_min_value, out_max_value) -> None:
# initial values
self.Kp = kp
self.Ki = ki
self.Kd = kd
self.setpoint = setpoint
self.out_min_value = out_min_value
self.out_max_value = out_max_value
# compute variables
self.i_error = 0
self.output = 0
... | 23.702703 | 80 | 0.709806 | class PID:
def __init__(self, kp, ki, kd, setpoint, out_min_value, out_max_value) -> None:
self.Kp = kp
self.Ki = ki
self.Kd = kd
self.setpoint = setpoint
self.out_min_value = out_min_value
self.out_max_value = out_max_value
self.i_error = 0
self.output = 0
self.prev_time = 0
self.prev_error... | true | true |
08f23d8cff213a8c0ffbe72e520d45052c625b5d | 6,058 | py | Python | development/binary_amino_model_GSS.py | mriglobal/vorpal | 5dd590863e1831df2020d7a70ccdea7807cb88d1 | [
"MIT"
] | 3 | 2021-08-28T06:51:31.000Z | 2022-02-28T21:59:54.000Z | development/binary_amino_model_GSS.py | mriglobal/vorpal | 5dd590863e1831df2020d7a70ccdea7807cb88d1 | [
"MIT"
] | null | null | null | development/binary_amino_model_GSS.py | mriglobal/vorpal | 5dd590863e1831df2020d7a70ccdea7807cb88d1 | [
"MIT"
] | null | null | null | import os
import pandas as pd
import numpy as np
from Bio import SeqIO
from skbio import Protein
import joblib
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import Binarizer
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import GroupShuffleSplit
from sklea... | 39.083871 | 180 | 0.698745 | import os
import pandas as pd
import numpy as np
from Bio import SeqIO
from skbio import Protein
import joblib
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import Binarizer
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import GroupShuffleSplit
from sklea... | true | true |
08f23def2a9dbb11f65eed05b9094ba6d89ac31f | 6,720 | py | Python | lib/full/MakeHTMLdir.py | OGalOz/rbts_mts_visualize_pool | 2b3a9fe8cbe8573438eef1c30127aa7e432d56a2 | [
"MIT"
] | null | null | null | lib/full/MakeHTMLdir.py | OGalOz/rbts_mts_visualize_pool | 2b3a9fe8cbe8573438eef1c30127aa7e432d56a2 | [
"MIT"
] | null | null | null | lib/full/MakeHTMLdir.py | OGalOz/rbts_mts_visualize_pool | 2b3a9fe8cbe8573438eef1c30127aa7e432d56a2 | [
"MIT"
] | null | null | null | #!python3
import os
import sys
import logging
import json
import random
import string
import copy
import shutil
import subprocess
#from HTMLReport import CreateHTMLdir
from full.GeneTableGenomePoolFileToScfPosBC import GeneTable_Barcodes_To_BarcodeGenes
from full.ScfPosBC_To_BarChartData import ScfPosBC_Info_To_Scaffo... | 29.090909 | 123 | 0.614881 |
import os
import sys
import logging
import json
import random
import string
import copy
import shutil
import subprocess
from full.GeneTableGenomePoolFileToScfPosBC import GeneTable_Barcodes_To_BarcodeGenes
from full.ScfPosBC_To_BarChartData import ScfPosBC_Info_To_Scaffolds
from full.ScfPosBC_to_MhtnData import PosScf... | true | true |
08f23e721b687d5f7487d1c2286548f9610b74fd | 81 | py | Python | python/two-fer/two_fer.py | parkerbxyz/exercism | 2648a2654f067b0f44450ac0663ac49ee270565d | [
"MIT"
] | null | null | null | python/two-fer/two_fer.py | parkerbxyz/exercism | 2648a2654f067b0f44450ac0663ac49ee270565d | [
"MIT"
] | null | null | null | python/two-fer/two_fer.py | parkerbxyz/exercism | 2648a2654f067b0f44450ac0663ac49ee270565d | [
"MIT"
] | null | null | null | def two_fer(name: str = 'you') -> str:
return f"One for {name}, one for me."
| 27 | 41 | 0.592593 | def two_fer(name: str = 'you') -> str:
return f"One for {name}, one for me."
| true | true |
08f24012fb57f7ad5f16788453cdb8d641a78522 | 4,438 | py | Python | PyRTF/object/picture.py | korylprince/PyRTF3 | 54f9235ecbf0f3922531d667bd8779c1d7bedef5 | [
"MIT"
] | null | null | null | PyRTF/object/picture.py | korylprince/PyRTF3 | 54f9235ecbf0f3922531d667bd8779c1d7bedef5 | [
"MIT"
] | null | null | null | PyRTF/object/picture.py | korylprince/PyRTF3 | 54f9235ecbf0f3922531d667bd8779c1d7bedef5 | [
"MIT"
] | null | null | null | from binascii import hexlify
from PyRTF.document.base import RawCode
def _get_jpg_dimensions(fin):
"""
converted from: http://dev.w3.org/cvsweb/Amaya/libjpeg/rdjpgcom.c?rev=1.2
"""
M_SOF0 = b'\xC0' # /* Start Of Frame N */
M_SOF1 = b'\xC1' # /* N indicates which compression process */
... | 31.928058 | 96 | 0.563091 | from binascii import hexlify
from PyRTF.document.base import RawCode
def _get_jpg_dimensions(fin):
M_SOF0 = b'\xC0' M_SOF1 = b'\xC1' M_SOF2 = b'\xC2' M_SOF3 = b'\xC3' M_SOF5 = b'\xC5' M_SOF6 = b'\xC6' M_SOF7 = b'\xC7' M_SOF9 = b'\xC9' M_SOF10 = b'\xCA' M_SOF11 = b'\xC... | true | true |
08f241d57aaec2c04ed55d69f14938f1aba3e631 | 9,672 | py | Python | markdown/html4.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | markdown/html4.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | markdown/html4.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # markdown/html4.py
#
# Add html4 serialization to older versions of Elementree
# Taken from ElementTree 1.3 preview with slight modifications
#
# Copyright (c) 1999-2007 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
# --------------------------------------------------... | 35.170909 | 70 | 0.556038 |
import markdown
ElementTree = markdown.etree.ElementTree
QName = markdown.etree.QName
Comment = markdown.etree.Comment
PI = markdown.etree.PI
ProcessingInstruction = markdown.etree.ProcessingInstruction
HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr",
"img", "input", "isindex", "li... | true | true |
08f242fc61240a4118e4125b13adecb635bd0e32 | 984 | py | Python | mysite/mysite/urls.py | Pywww/search-wystech | 7ee32fc57867a92013407253700bab8904031440 | [
"Apache-2.0"
] | null | null | null | mysite/mysite/urls.py | Pywww/search-wystech | 7ee32fc57867a92013407253700bab8904031440 | [
"Apache-2.0"
] | null | null | null | mysite/mysite/urls.py | Pywww/search-wystech | 7ee32fc57867a92013407253700bab8904031440 | [
"Apache-2.0"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 37.846154 | 81 | 0.703252 | from django.contrib import admin
from django.urls import path, include
from django.views.generic import RedirectView
urlpatterns = [
path('admin/', admin.site.urls),
path('user/', include('apps.user.urls')),
path('search/',include('apps.search.urls')),
]
| true | true |
08f244c5362b6035ec06a19fd1cc0756533b4153 | 19,533 | py | Python | mlbox/preprocessing/reader.py | vl123456/MLBox | f5c528784742721449802d951c49637611a5b01c | [
"BSD-3-Clause"
] | null | null | null | mlbox/preprocessing/reader.py | vl123456/MLBox | f5c528784742721449802d951c49637611a5b01c | [
"BSD-3-Clause"
] | null | null | null | mlbox/preprocessing/reader.py | vl123456/MLBox | f5c528784742721449802d951c49637611a5b01c | [
"BSD-3-Clause"
] | 1 | 2020-11-23T10:16:34.000Z | 2020-11-23T10:16:34.000Z | # coding: utf-8
# Author: Axel ARONIO DE ROMBLAY <axelderomblay@gmail.com>
# License: BSD 3 clause
import sys
import pickle
import os
import time
import warnings
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from joblib import Parallel, delayed
def convert_list(serie):
"""... | 32.994932 | 147 | 0.467517 | import sys
import pickle
import os
import time
import warnings
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from joblib import Parallel, delayed
def convert_list(serie):
import numpy
import pandas
if (serie.apply(lambda x: type(x) == list).sum() > 0):
s... | true | true |
08f2451538c4ead021c1bdb5bf098006deb88cf7 | 9,045 | py | Python | cogs/timer.py | ChattyRS/RuneClock | 3f3177b873feb695a565cbfd760f3f3bbf235a38 | [
"MIT"
] | 13 | 2020-06-30T00:15:18.000Z | 2022-03-12T04:28:33.000Z | cogs/timer.py | ChattyRS/RuneClock | 3f3177b873feb695a565cbfd760f3f3bbf235a38 | [
"MIT"
] | 1 | 2020-04-30T23:09:38.000Z | 2020-05-04T12:46:14.000Z | cogs/timer.py | ChattyRS/RuneClock | 3f3177b873feb695a565cbfd760f3f3bbf235a38 | [
"MIT"
] | 4 | 2021-04-06T08:46:11.000Z | 2022-03-12T04:28:39.000Z | import asyncio
import discord
from discord.ext import commands
import os
import sys
sys.path.append('../')
from main import config_load, addCommand, User
from datetime import datetime, timedelta
import html
import re
from utils import timeDiffToString
import pytz
from utils import countries, is_int
from utils import is... | 34.132075 | 114 | 0.519735 | import asyncio
import discord
from discord.ext import commands
import os
import sys
sys.path.append('../')
from main import config_load, addCommand, User
from datetime import datetime, timedelta
import html
import re
from utils import timeDiffToString
import pytz
from utils import countries, is_int
from utils import is... | true | true |
08f2459dfb1d3e9bf5e162442cc10bcbf3429306 | 10,613 | py | Python | dax/tests/component_test_xnatutils.py | MASILab/dax_bids | 88e77e0ed57c13fd4c918ebad8c098cee76d2235 | [
"MIT"
] | null | null | null | dax/tests/component_test_xnatutils.py | MASILab/dax_bids | 88e77e0ed57c13fd4c918ebad8c098cee76d2235 | [
"MIT"
] | 1 | 2020-06-20T20:37:16.000Z | 2020-06-21T14:50:53.000Z | dax/tests/component_test_xnatutils.py | MASILab/dax_bids | 88e77e0ed57c13fd4c918ebad8c098cee76d2235 | [
"MIT"
] | null | null | null |
from unittest import TestCase
import StringIO
import json
import yaml
import xml.etree.cElementTree as xmlet
from dax import XnatUtils
from dax.tests import unit_test_common_processor_yamls as yamls
from dax.tests import common_session_tools as session_tools
from dax.yaml_doc import YamlDoc
from dax import AutoProc... | 36.34589 | 118 | 0.570527 |
from unittest import TestCase
import StringIO
import json
import yaml
import xml.etree.cElementTree as xmlet
from dax import XnatUtils
from dax.tests import unit_test_common_processor_yamls as yamls
from dax.tests import common_session_tools as session_tools
from dax.yaml_doc import YamlDoc
from dax import AutoProc... | false | true |
08f245c537d267549e2bd8cac5cecd5856c9d36a | 26,897 | py | Python | tools/wptrunner/wptrunner/tests/test_update.py | Johanna-hub/wpt | 7176f30f78dcfc600e627b8e5786ede4b79300ad | [
"BSD-3-Clause"
] | 1 | 2020-05-05T14:21:04.000Z | 2020-05-05T14:21:04.000Z | tools/wptrunner/wptrunner/tests/test_update.py | Johanna-hub/wpt | 7176f30f78dcfc600e627b8e5786ede4b79300ad | [
"BSD-3-Clause"
] | 14 | 2019-03-18T20:11:48.000Z | 2019-04-23T22:41:46.000Z | tools/wptrunner/wptrunner/tests/test_update.py | Johanna-hub/wpt | 7176f30f78dcfc600e627b8e5786ede4b79300ad | [
"BSD-3-Clause"
] | 1 | 2019-12-09T02:16:54.000Z | 2019-12-09T02:16:54.000Z | import json
import mock
import os
import sys
from io import BytesIO
from .. import metadata, manifestupdate
from ..update import WPTUpdate
from ..update.base import StepRunner, Step
from mozlog import structuredlog, handlers, formatters
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, ... | 36.946429 | 103 | 0.466855 | import json
import mock
import os
import sys
from io import BytesIO
from .. import metadata, manifestupdate
from ..update import WPTUpdate
from ..update.base import StepRunner, Step
from mozlog import structuredlog, handlers, formatters
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, ... | true | true |
08f246a9e8c9a367b98fb3bd631f3c99fc8a639b | 9,583 | py | Python | doc/source/conf.py | tyzhnenko/rally | 1d9c1e82f33686c80e49edd041fcd8d0253afdb1 | [
"Apache-2.0"
] | 263 | 2015-04-26T16:05:34.000Z | 2022-02-28T11:17:07.000Z | doc/source/conf.py | tyzhnenko/rally | 1d9c1e82f33686c80e49edd041fcd8d0253afdb1 | [
"Apache-2.0"
] | 19 | 2015-04-23T11:53:10.000Z | 2019-02-20T11:23:09.000Z | doc/source/conf.py | tyzhnenko/rally | 1d9c1e82f33686c80e49edd041fcd8d0253afdb1 | [
"Apache-2.0"
] | 287 | 2015-04-23T11:28:03.000Z | 2021-09-16T13:05:53.000Z | # 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
# distributed un... | 31.943333 | 79 | 0.703329 |
import datetime as dt
import os
import subprocess
import sys
import rally.common.version
sys.path.insert(0, os.path.abspath("../../"))
sys.path.insert(0, os.path.abspath("../"))
sys.path.insert(0, os.path.abspath("./"))
on_rtd = os.environ.get("READTHEDOCS") == "True"
extensions = [
"sphinx.ext.autodoc",
... | true | true |
08f246bd21b4b37ceef020383f4c3c64c1f34c5f | 7,413 | py | Python | src/ralph_scrooge/report/report_services_usages.py | ar4s/ralph_pricing | 40127e9450edc91ba0be725d63bf691dde16a137 | [
"Apache-2.0"
] | null | null | null | src/ralph_scrooge/report/report_services_usages.py | ar4s/ralph_pricing | 40127e9450edc91ba0be725d63bf691dde16a137 | [
"Apache-2.0"
] | null | null | null | src/ralph_scrooge/report/report_services_usages.py | ar4s/ralph_pricing | 40127e9450edc91ba0be725d63bf691dde16a137 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from dateutil import rrule
from decimal import Decimal as D
from django.utils.translation import ugettext_lazy as _
from ralph_s... | 32.513158 | 78 | 0.54971 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from dateutil import rrule
from decimal import Decimal as D
from django.utils.translation import ugettext_lazy as _
from ralph_scrooge.plugins import pl... | true | true |
08f247fe8714559d252d90f3a38fde6c557ba1ee | 22,302 | py | Python | test/functional/importmulti.py | shamimiceewu025/gleeold | 6223511aa5eaaba3afab48c945b5e76782b5bb1a | [
"MIT"
] | null | null | null | test/functional/importmulti.py | shamimiceewu025/gleeold | 6223511aa5eaaba3afab48c945b5e76782b5bb1a | [
"MIT"
] | null | null | null | test/functional/importmulti.py | shamimiceewu025/gleeold | 6223511aa5eaaba3afab48c945b5e76782b5bb1a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the importmulti RPC."""
from test_framework.test_framework import GleecBTCTestFramework
from test_... | 48.064655 | 137 | 0.631692 | from test_framework.test_framework import GleecBTCTestFramework
from test_framework.util import *
class ImportMultiTest (GleecBTCTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.setup_clean_chain = True
def setup_network(self):
self.setup_nodes()
def run_test (se... | true | true |
08f24831ed2b274c4db867f8f2b2c3842b1bd3e6 | 9,980 | py | Python | models/official/detection/modeling/base_model.py | aman2930/tpu | 1724c0ee08523ecb4e10872026afd2d8391137c1 | [
"Apache-2.0"
] | 4 | 2020-01-23T16:17:37.000Z | 2022-01-18T22:02:22.000Z | models/official/detection/modeling/base_model.py | aman2930/tpu | 1724c0ee08523ecb4e10872026afd2d8391137c1 | [
"Apache-2.0"
] | null | null | null | models/official/detection/modeling/base_model.py | aman2930/tpu | 1724c0ee08523ecb4e10872026afd2d8391137c1 | [
"Apache-2.0"
] | 1 | 2020-02-16T12:09:49.000Z | 2020-02-16T12:09:49.000Z | # Lint as: python2, python3
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 36.423358 | 80 | 0.716032 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import functools
import re
import six
from six.moves import zip
import tensorflow.compat.v1 as tf
import tensorflow.compat.v2 as tf2
from modeling import learning_rates
from utils import benchmark_... | true | true |
08f248c368b232d78ba9907ea02b06729ba1c1b4 | 8,152 | py | Python | python/dgl/dataloading/neighbor.py | lfchener/dgl | 77f4287a4118db64c46f4f413a426e1419a09d53 | [
"Apache-2.0"
] | 9,516 | 2018-12-08T22:11:31.000Z | 2022-03-31T13:04:33.000Z | python/dgl/dataloading/neighbor.py | lfchener/dgl | 77f4287a4118db64c46f4f413a426e1419a09d53 | [
"Apache-2.0"
] | 2,494 | 2018-12-08T22:43:00.000Z | 2022-03-31T21:16:27.000Z | python/dgl/dataloading/neighbor.py | lfchener/dgl | 77f4287a4118db64c46f4f413a426e1419a09d53 | [
"Apache-2.0"
] | 2,529 | 2018-12-08T22:56:14.000Z | 2022-03-31T13:07:41.000Z | """Data loading components for neighbor sampling"""
from .dataloader import BlockSampler
from .. import sampling, distributed
from .. import ndarray as nd
from .. import backend as F
from ..base import ETYPE
class NeighborSamplingMixin(object):
"""Mixin object containing common optimizing routines that caches fano... | 43.132275 | 98 | 0.657507 | from .dataloader import BlockSampler
from .. import sampling, distributed
from .. import ndarray as nd
from .. import backend as F
from ..base import ETYPE
class NeighborSamplingMixin(object):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) self.fanout_arrays = []
... | true | true |
08f2490cd2212ee8ab246766597462be1db0bae0 | 140,929 | py | Python | tests/hwsim/test_ap_eap.py | NS-K/hostapd | aa2b12562b6e70fe48c7ce4abebf094206a9332a | [
"Unlicense"
] | 4 | 2015-06-18T05:25:10.000Z | 2019-07-09T13:57:28.000Z | tests/hwsim/test_ap_eap.py | NS-K/hostapd | aa2b12562b6e70fe48c7ce4abebf094206a9332a | [
"Unlicense"
] | null | null | null | tests/hwsim/test_ap_eap.py | NS-K/hostapd | aa2b12562b6e70fe48c7ce4abebf094206a9332a | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# WPA2-Enterprise tests
# Copyright (c) 2013-2015, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import base64
import binascii
import time
import subprocess
import logging
logger = logging.getLogger()
import os
i... | 47.611149 | 148 | 0.63334 |
import base64
import binascii
import time
import subprocess
import logging
logger = logging.getLogger()
import os
import hwsim_utils
import hostapd
from utils import HwsimSkip, alloc_fail
from wpasupplicant import WpaSupplicant
from test_ap_psk import check_mib, find_wpas_process, read_process_memory, verify_not_pres... | false | true |
08f24a7142da782b8cba482543171d70df2f30e7 | 3,306 | py | Python | _examples/django1.9/mysite/settings.py | drewbrew/django-slow-tests | 2c5673ca5b6eb093a908e4e28143d889a1893113 | [
"MIT"
] | 177 | 2015-06-28T11:59:58.000Z | 2021-12-31T17:44:18.000Z | _examples/django1.9/mysite/settings.py | drewbrew/django-slow-tests | 2c5673ca5b6eb093a908e4e28143d889a1893113 | [
"MIT"
] | 22 | 2015-06-29T21:12:22.000Z | 2021-05-14T20:39:42.000Z | _examples/django1.9/mysite/settings.py | BillSchumacher/django-slow-tests | 2c5673ca5b6eb093a908e4e28143d889a1893113 | [
"MIT"
] | 32 | 2015-06-28T16:28:34.000Z | 2022-02-03T19:24:40.000Z | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# Bu... | 26.031496 | 91 | 0.705082 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'vtg32vxrtz!dkcpmxm6h9-^q!7v6b5-q09fqznov!4sm5+^rp&'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
... | true | true |
08f24abc0eb26893cec53459a89c05f707eb21cc | 539 | py | Python | tests/test_lake.py | StanfordAHA/Lake | 34df001db107e1a0824b7fdb05b9f2145bf49a3e | [
"BSD-3-Clause"
] | null | null | null | tests/test_lake.py | StanfordAHA/Lake | 34df001db107e1a0824b7fdb05b9f2145bf49a3e | [
"BSD-3-Clause"
] | null | null | null | tests/test_lake.py | StanfordAHA/Lake | 34df001db107e1a0824b7fdb05b9f2145bf49a3e | [
"BSD-3-Clause"
] | null | null | null | from lake.utils.test_infra import lake_test_app_args, gen_test_lake
import pytest
# add more tests with this function by adding args
@pytest.mark.skip
# @pytest.mark.parametrize("args", [lake_test_app_args("separate")])
def test_lake(args):
gen_test_lake(config_path=args[0],
stream_path=args[1],... | 28.368421 | 68 | 0.688312 | from lake.utils.test_infra import lake_test_app_args, gen_test_lake
import pytest
@pytest.mark.skip
def test_lake(args):
gen_test_lake(config_path=args[0],
stream_path=args[1],
in_file_name=args[2],
out_file_name=args[3])
if __name__ == "__main__":
c... | true | true |
08f24c23499a0f0d6c4cb3c4b9057456e1a227f2 | 986 | py | Python | app/models/remote_scoreboard.py | Jiubei0408/jiudge-backend | c743274d76fdfe2be8b16b5bcf5a68c64fbc4272 | [
"Apache-2.0"
] | null | null | null | app/models/remote_scoreboard.py | Jiubei0408/jiudge-backend | c743274d76fdfe2be8b16b5bcf5a68c64fbc4272 | [
"Apache-2.0"
] | 1 | 2021-08-02T09:49:15.000Z | 2021-08-02T09:57:27.000Z | app/models/remote_scoreboard.py | Jiubei0408/jiudge-backend | c743274d76fdfe2be8b16b5bcf5a68c64fbc4272 | [
"Apache-2.0"
] | null | null | null | import datetime
from sqlalchemy import Column, Integer, DateTime, ForeignKey, UnicodeText, Boolean
from app.models.base import Base, db
from app.models.remote_contest import RemoteContest
class RemoteScoreboard(Base):
__tablename__ = 'remote_scoreboard'
fields = ['id', 'remote_contest_id', 'scoreboard_json'... | 32.866667 | 84 | 0.710953 | import datetime
from sqlalchemy import Column, Integer, DateTime, ForeignKey, UnicodeText, Boolean
from app.models.base import Base, db
from app.models.remote_contest import RemoteContest
class RemoteScoreboard(Base):
__tablename__ = 'remote_scoreboard'
fields = ['id', 'remote_contest_id', 'scoreboard_json'... | true | true |
08f24d4aea2e1e9e68c0cf91a019b32299fbeb98 | 3,655 | py | Python | french_law/python/main.py | ammkrn/catala | c9c070ffe2b3cc14a4b135ad94b87d51c2d37563 | [
"Apache-2.0"
] | null | null | null | french_law/python/main.py | ammkrn/catala | c9c070ffe2b3cc14a4b135ad94b87d51c2d37563 | [
"Apache-2.0"
] | null | null | null | french_law/python/main.py | ammkrn/catala | c9c070ffe2b3cc14a4b135ad94b87d51c2d37563 | [
"Apache-2.0"
] | null | null | null | #!python3
from datetime import date
from src.allocations_familiales import PriseEnCharge_Code, Collectivite_Code
from src.api import allocations_familiales, Enfant
from src.catala import LogEvent, LogEventCode, reset_log, retrieve_log
import timeit
import argparse
from typing import List, Any
from termcolor import col... | 41.067416 | 204 | 0.625718 |
from datetime import date
from src.allocations_familiales import PriseEnCharge_Code, Collectivite_Code
from src.api import allocations_familiales, Enfant
from src.catala import LogEvent, LogEventCode, reset_log, retrieve_log
import timeit
import argparse
from typing import List, Any
from termcolor import colored
def... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.