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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2d8428b2a25dbbb25160c16277f654c9cffd62 | 10,641 | py | Python | oidc_provider/lib/endpoints/token.py | senzil/django-oidc-provider | b2144ea31f3178d7346809cd45341831830d9e3e | [
"MIT"
] | null | null | null | oidc_provider/lib/endpoints/token.py | senzil/django-oidc-provider | b2144ea31f3178d7346809cd45341831830d9e3e | [
"MIT"
] | 1 | 2021-06-15T11:54:09.000Z | 2021-06-15T11:58:47.000Z | oidc_provider/lib/endpoints/token.py | senzil/senzil-django-oidc-provider | b2144ea31f3178d7346809cd45341831830d9e3e | [
"MIT"
] | null | null | null | import inspect
from base64 import urlsafe_b64encode
import hashlib
import logging
from django.contrib.auth import authenticate
from django.http import JsonResponse
from oidc_provider.lib.errors import (
TokenError,
UserAuthError,
)
from oidc_provider.lib.utils.oauth2 import extract_client_auth
from oidc_provi... | 34.215434 | 97 | 0.575228 | import inspect
from base64 import urlsafe_b64encode
import hashlib
import logging
from django.contrib.auth import authenticate
from django.http import JsonResponse
from oidc_provider.lib.errors import (
TokenError,
UserAuthError,
)
from oidc_provider.lib.utils.oauth2 import extract_client_auth
from oidc_provi... | true | true |
1c2d84546cc93c9b22053ab15edd6dcb7459cd86 | 4,274 | py | Python | dsgn/utils/torch_utils.py | joshliu11/DSGN | ac693e748ff3a7372b1292c2b7b3796854072030 | [
"MIT"
] | 166 | 2020-04-20T09:30:54.000Z | 2021-05-16T07:42:15.000Z | dsgn/utils/torch_utils.py | joshliu11/DSGN | ac693e748ff3a7372b1292c2b7b3796854072030 | [
"MIT"
] | 15 | 2020-05-12T23:58:01.000Z | 2021-05-05T12:03:51.000Z | dsgn/utils/torch_utils.py | joshliu11/DSGN | ac693e748ff3a7372b1292c2b7b3796854072030 | [
"MIT"
] | 35 | 2020-04-27T13:11:42.000Z | 2021-05-16T07:45:02.000Z | import numpy as np
import torch
def project_image_to_rect(uv_depth, P):
# uv_depth (3, N)
c_u = P[0,2]
c_v = P[1,2]
f_u = P[0,0]
f_v = P[1,1]
b_x = P[0,3]/(-f_u) # relative
b_y = P[1,3]/(-f_v)
# use camera coordinate
n = uv_depth.shape[1]
x = ((uv_depth[0]-c_u)*uv_depth[2])/... | 36.529915 | 98 | 0.606458 | import numpy as np
import torch
def project_image_to_rect(uv_depth, P):
c_u = P[0,2]
c_v = P[1,2]
f_u = P[0,0]
f_v = P[1,1]
b_x = P[0,3]/(-f_u)
b_y = P[1,3]/(-f_v)
n = uv_depth.shape[1]
x = ((uv_depth[0]-c_u)*uv_depth[2])/f_u + b_x
y = ((uv_depth[1]-c_v)*uv_depth[2])/f... | true | true |
1c2d84c0446e87ba738145f6ff8987981568c650 | 73 | py | Python | launcher.py | heffer-dev/proxy-client | df51852c7847771ee84637028280743acdd133a4 | [
"MIT"
] | null | null | null | launcher.py | heffer-dev/proxy-client | df51852c7847771ee84637028280743acdd133a4 | [
"MIT"
] | null | null | null | launcher.py | heffer-dev/proxy-client | df51852c7847771ee84637028280743acdd133a4 | [
"MIT"
] | null | null | null | from lib.bot import bot
VERSION = "0.1.1"
bot.run(VERSION)
| 8.111111 | 25 | 0.575342 | from lib.bot import bot
VERSION = "0.1.1"
bot.run(VERSION)
| true | true |
1c2d84c8511a592ba1dd911ec6bd397892a05851 | 521 | py | Python | myGym/envs/__init__.py | gabinsane/myGym | a41c6b11a47eaf19d0c69e67aeb48cf7a999d45a | [
"MIT"
] | 1 | 2021-04-23T20:52:39.000Z | 2021-04-23T20:52:39.000Z | myGym/envs/__init__.py | gabinsane/myGym | a41c6b11a47eaf19d0c69e67aeb48cf7a999d45a | [
"MIT"
] | null | null | null | myGym/envs/__init__.py | gabinsane/myGym | a41c6b11a47eaf19d0c69e67aeb48cf7a999d45a | [
"MIT"
] | 1 | 2021-01-22T16:46:48.000Z | 2021-01-22T16:46:48.000Z | from gym.envs.registration import register
register(
id="CrowWorkspaceEnv-v0",
entry_point="myGym.envs.crow_workspace_env:CrowWorkspaceEnv",
max_episode_steps=8192,
)
register(
id="Gym-v0",
entry_point="myGym.envs.gym_env:GymEnv",
max_episode_steps=8192,
)
register(
id="HackEnv-v0",
e... | 19.296296 | 65 | 0.727447 | from gym.envs.registration import register
register(
id="CrowWorkspaceEnv-v0",
entry_point="myGym.envs.crow_workspace_env:CrowWorkspaceEnv",
max_episode_steps=8192,
)
register(
id="Gym-v0",
entry_point="myGym.envs.gym_env:GymEnv",
max_episode_steps=8192,
)
register(
id="HackEnv-v0",
e... | true | true |
1c2d86f9ab621946794bc71ef7bd912fedb02281 | 1,606 | py | Python | kolibri/content/utils/annotation.py | rtibbles/kolibri | 7efdf0497738c793f281013f9913f8ecc1a55f10 | [
"MIT"
] | null | null | null | kolibri/content/utils/annotation.py | rtibbles/kolibri | 7efdf0497738c793f281013f9913f8ecc1a55f10 | [
"MIT"
] | 7 | 2016-06-23T16:01:02.000Z | 2018-12-01T22:15:13.000Z | kolibri/content/utils/annotation.py | rtibbles/kolibri | 7efdf0497738c793f281013f9913f8ecc1a55f10 | [
"MIT"
] | 1 | 2021-06-01T23:15:26.000Z | 2021-06-01T23:15:26.000Z | from kolibri.utils.time import local_now
from django.conf import settings
from ..content_db_router import using_content_database
from ..models import ChannelMetadata, ChannelMetadataCache
from .channels import get_channel_ids_for_content_database_dir
def update_channel_metadata_cache():
"""
After a channel i... | 45.885714 | 110 | 0.755293 | from kolibri.utils.time import local_now
from django.conf import settings
from ..content_db_router import using_content_database
from ..models import ChannelMetadata, ChannelMetadataCache
from .channels import get_channel_ids_for_content_database_dir
def update_channel_metadata_cache():
db_names = get_channel_id... | true | true |
1c2d87445e38339928f3b6ae5fffb73af6f03885 | 7,049 | py | Python | jack/readers/knowledge_base_population/models.py | mitchelljeff/hack1 | 990d873cbcd40d2978f44560016d18a76800908e | [
"MIT"
] | 1 | 2018-10-23T12:07:31.000Z | 2018-10-23T12:07:31.000Z | jack/readers/knowledge_base_population/models.py | mitchelljeff/hack1 | 990d873cbcd40d2978f44560016d18a76800908e | [
"MIT"
] | null | null | null | jack/readers/knowledge_base_population/models.py | mitchelljeff/hack1 | 990d873cbcd40d2978f44560016d18a76800908e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from jack.core import *
from jack.core.data_structures import *
from jack.readers.knowledge_base_population.shared import KBPPorts
from jack.util.map import numpify
class KnowledgeGraphEmbeddingInputModule(OnlineInputModule[List[List[int]]]):
def __init__(self, shared_resources):
s... | 42.721212 | 107 | 0.643496 |
from jack.core import *
from jack.core.data_structures import *
from jack.readers.knowledge_base_population.shared import KBPPorts
from jack.util.map import numpify
class KnowledgeGraphEmbeddingInputModule(OnlineInputModule[List[List[int]]]):
def __init__(self, shared_resources):
self.shared_resources = ... | true | true |
1c2d8797181f7057d1804ac8c677cac32af39435 | 13,762 | py | Python | ckine/figures/figureC12.py | meyer-lab/type-I-ckine-model | fb2db21f1c476d79467e2bf22e1fdc2cdd6c47a3 | [
"MIT"
] | null | null | null | ckine/figures/figureC12.py | meyer-lab/type-I-ckine-model | fb2db21f1c476d79467e2bf22e1fdc2cdd6c47a3 | [
"MIT"
] | 6 | 2021-02-01T23:47:16.000Z | 2021-04-28T19:56:17.000Z | ckine/figures/figureC12.py | meyer-lab/gc-valent | bc0451610655633483a98ab450d20ef631479d2b | [
"MIT"
] | null | null | null | import os
import matplotlib.lines as mlines
import pandas as pds
import numpy as np
from .figureCommon import subplotLabel, getSetup
from ..flow import importF
from ..PCA import sampleT
from ..flow import gating, count_data
from ..FCimports import compMatrix, applyMatrix
path_here = os.path.dirname(os.path.dirname(__... | 50.782288 | 197 | 0.516204 | import os
import matplotlib.lines as mlines
import pandas as pds
import numpy as np
from .figureCommon import subplotLabel, getSetup
from ..flow import importF
from ..PCA import sampleT
from ..flow import gating, count_data
from ..FCimports import compMatrix, applyMatrix
path_here = os.path.dirname(os.path.dirname(__... | true | true |
1c2d8aaadbe5c799d88a5d38cc7f826a82cd8a94 | 526 | py | Python | app/convertfile/uploading/migrations/0002_auto_20200108_1333.py | web-user/django-convert-video-file-docker-nginx | 40bd6a67c2d21d91d408d6112fa1756635300e60 | [
"MIT"
] | null | null | null | app/convertfile/uploading/migrations/0002_auto_20200108_1333.py | web-user/django-convert-video-file-docker-nginx | 40bd6a67c2d21d91d408d6112fa1756635300e60 | [
"MIT"
] | 3 | 2021-04-08T21:59:25.000Z | 2021-06-09T19:19:25.000Z | app/convertfile/uploading/migrations/0002_auto_20200108_1333.py | web-user/django-convert-video-file-docker-nginx | 40bd6a67c2d21d91d408d6112fa1756635300e60 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.9 on 2020-01-08 13:33
import convertfile.utils
from django.db import migrations, models
import uploading.models
class Migration(migrations.Migration):
dependencies = [
('uploading', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name... | 25.047619 | 149 | 0.6673 |
import convertfile.utils
from django.db import migrations, models
import uploading.models
class Migration(migrations.Migration):
dependencies = [
('uploading', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='mediafile',
name='file',
... | true | true |
1c2d8bf92c003205fd371162a11dfe4408f8d590 | 19,624 | py | Python | tests/algorithms/profile_model/ellipsoid/test_parameterisation.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | 1 | 2021-12-10T17:28:16.000Z | 2021-12-10T17:28:16.000Z | tests/algorithms/profile_model/ellipsoid/test_parameterisation.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | null | null | null | tests/algorithms/profile_model/ellipsoid/test_parameterisation.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | 1 | 2021-12-07T12:39:04.000Z | 2021-12-07T12:39:04.000Z | from __future__ import annotations
from collections import namedtuple
from copy import copy
from random import randint, uniform
import numpy as np
import pytest
from scitbx import matrix
from dials.algorithms.profile_model.ellipsoid.parameterisation import (
Angular2MosaicityParameterisation,
Angular4Mosaic... | 32.490066 | 88 | 0.623522 | from __future__ import annotations
from collections import namedtuple
from copy import copy
from random import randint, uniform
import numpy as np
import pytest
from scitbx import matrix
from dials.algorithms.profile_model.ellipsoid.parameterisation import (
Angular2MosaicityParameterisation,
Angular4Mosaic... | true | true |
1c2d8c2c711bf8ea9496e06fa1fe208338b90f0a | 15,600 | py | Python | pipelines.py | ufal/augpt | fa8a57961ed1d8fe6099978c489c0b0f8956d64e | [
"MIT"
] | 11 | 2021-02-05T15:37:59.000Z | 2022-03-24T14:33:08.000Z | pipelines.py | ufal/augpt | fa8a57961ed1d8fe6099978c489c0b0f8956d64e | [
"MIT"
] | 6 | 2021-03-14T10:55:09.000Z | 2021-07-22T09:42:14.000Z | pipelines.py | ufal/augpt | fa8a57961ed1d8fe6099978c489c0b0f8956d64e | [
"MIT"
] | 1 | 2021-02-28T22:22:33.000Z | 2021-02-28T22:22:33.000Z | from typing import Union, List, Optional
import logging
import uuid
from uuid import UUID
import transformers
from functools import partial
from collections import OrderedDict
from model import ModelPredictor
from data import BeliefParser
from utils import AutoDatabase, AutoLexicalizer
logger = logging.getLogger()
... | 44.827586 | 124 | 0.633462 | from typing import Union, List, Optional
import logging
import uuid
from uuid import UUID
import transformers
from functools import partial
from collections import OrderedDict
from model import ModelPredictor
from data import BeliefParser
from utils import AutoDatabase, AutoLexicalizer
logger = logging.getLogger()
... | true | true |
1c2d8cafbefd1b3e84db79cf567a91cb465e6fb1 | 40,871 | py | Python | tensorflow/python/keras/layers/core.py | plopresti/tensorflow | 8b0c84d30d957596cbb3bcac9245e114c3f0b65b | [
"Apache-2.0"
] | 1 | 2019-07-15T08:40:24.000Z | 2019-07-15T08:40:24.000Z | tensorflow/python/keras/layers/core.py | plopresti/tensorflow | 8b0c84d30d957596cbb3bcac9245e114c3f0b65b | [
"Apache-2.0"
] | 3 | 2020-10-14T00:35:40.000Z | 2022-02-09T22:35:09.000Z | tensorflow/python/keras/layers/core.py | plopresti/tensorflow | 8b0c84d30d957596cbb3bcac9245e114c3f0b65b | [
"Apache-2.0"
] | 1 | 2020-01-19T16:33:55.000Z | 2020-01-19T16:33:55.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.524576 | 102 | 0.695921 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import sys
import types as python_types
import warnings
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.... | true | true |
1c2d8d266dac0a3c8e36d4ce58d4dcef2d05bb2b | 315 | py | Python | mongomail/models/users.py | terrabitz/MongoMail | 8c7321540fde534e29451c603d22dcad4d2b77c5 | [
"MIT"
] | null | null | null | mongomail/models/users.py | terrabitz/MongoMail | 8c7321540fde534e29451c603d22dcad4d2b77c5 | [
"MIT"
] | 7 | 2017-07-03T15:31:10.000Z | 2017-07-03T19:07:18.000Z | mongomail/models/users.py | terrabitz/MongoMail | 8c7321540fde534e29451c603d22dcad4d2b77c5 | [
"MIT"
] | null | null | null | import random
import string
from mongoengine import Document
from mongoengine.fields import StringField
KEY_SIZE = 32
class ApiKey(Document):
key = StringField(required=True, unique=True,
default=''.join([random.choice(string.ascii_letters + string.digits) for _ in range(KEY_SIZE)]))
| 24.230769 | 118 | 0.726984 | import random
import string
from mongoengine import Document
from mongoengine.fields import StringField
KEY_SIZE = 32
class ApiKey(Document):
key = StringField(required=True, unique=True,
default=''.join([random.choice(string.ascii_letters + string.digits) for _ in range(KEY_SIZE)]))
| true | true |
1c2d8d5796b88137cbd413287b8438e672ac6586 | 3,444 | py | Python | tests/test_dipdup/test_dipdup.py | spruceid/dipdup-py | adc904196cfd66563938feec0f0afcc5f3df03e3 | [
"MIT"
] | null | null | null | tests/test_dipdup/test_dipdup.py | spruceid/dipdup-py | adc904196cfd66563938feec0f0afcc5f3df03e3 | [
"MIT"
] | null | null | null | tests/test_dipdup/test_dipdup.py | spruceid/dipdup-py | adc904196cfd66563938feec0f0afcc5f3df03e3 | [
"MIT"
] | null | null | null | from contextlib import AsyncExitStack
from datetime import datetime
from os.path import dirname, join
from unittest import IsolatedAsyncioTestCase
from pytz import UTC
from dipdup.config import DipDupConfig
from dipdup.context import pending_indexes
from dipdup.dipdup import IndexDispatcher
from dipdup.enums import I... | 34.787879 | 90 | 0.64547 | from contextlib import AsyncExitStack
from datetime import datetime
from os.path import dirname, join
from unittest import IsolatedAsyncioTestCase
from pytz import UTC
from dipdup.config import DipDupConfig
from dipdup.context import pending_indexes
from dipdup.dipdup import IndexDispatcher
from dipdup.enums import I... | true | true |
1c2d8d90a17121995310552a973682f2ec38ce4f | 2,745 | py | Python | tests/test_pyglotaran_alias.py | glotaran/pyglotaran-alias | e8e490a50e70551bf84bdfba0c4aa55c8ac8406b | [
"Apache-2.0"
] | 2 | 2021-03-02T09:23:56.000Z | 2021-11-09T11:40:43.000Z | tests/test_pyglotaran_alias.py | glotaran/pyglotaran-alias | e8e490a50e70551bf84bdfba0c4aa55c8ac8406b | [
"Apache-2.0"
] | 11 | 2020-10-04T00:14:04.000Z | 2021-06-18T20:45:44.000Z | tests/test_pyglotaran_alias.py | glotaran/pyglotaran-alias | e8e490a50e70551bf84bdfba0c4aa55c8ac8406b | [
"Apache-2.0"
] | 2 | 2020-10-03T23:51:48.000Z | 2020-10-18T16:26:36.000Z | import re
import subprocess
import sys
import pytest
from _pytest.monkeypatch import MonkeyPatch
def test_exception_if_glotaran_is_missing(monkeypatch: MonkeyPatch):
"""Raise Exception if glotaran isn't installed."""
monkeypatch.setitem(sys.modules, "glotaran", None)
with pytest.raises(ImportError, mat... | 29.836957 | 97 | 0.695811 | import re
import subprocess
import sys
import pytest
from _pytest.monkeypatch import MonkeyPatch
def test_exception_if_glotaran_is_missing(monkeypatch: MonkeyPatch):
monkeypatch.setitem(sys.modules, "glotaran", None)
with pytest.raises(ImportError, match=r"you need to install pyglotaran"):
import p... | true | true |
1c2d8dc766507b416a2c61e4bba7204773b5038c | 7,431 | py | Python | main/hongmeng.py | Andimeo/EverydayWechat | 7b36443528442bc90c1b0bb3b1c5f88a6cbf008b | [
"MIT"
] | 23 | 2019-08-14T01:10:16.000Z | 2019-08-16T10:17:19.000Z | main/hongmeng.py | Pengjie-Li/EverydayWechat | 86648b9b9e8f9e51216bd6f4d630abdd3bf7c2f1 | [
"MIT"
] | null | null | null | main/hongmeng.py | Pengjie-Li/EverydayWechat | 86648b9b9e8f9e51216bd6f4d630abdd3bf7c2f1 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
每天定时给多个女友发给微信暖心话
核心代码。
"""
import os
import time
import json
from apscheduler.schedulers.blocking import BlockingScheduler
import itchat
import random
from itchat.content import *
from main.common import (
get_yaml
)
from main.utils import (
get_bot_info,
get_weather_info,
get_dictum... | 29.141176 | 106 | 0.610416 |
import os
import time
import json
from apscheduler.schedulers.blocking import BlockingScheduler
import itchat
import random
from itchat.content import *
from main.common import (
get_yaml
)
from main.utils import (
get_bot_info,
get_weather_info,
get_dictum_info,
get_diff_time,
get_xzw_info
)
... | true | true |
1c2d8e21bdd4291f28b80f1f1997faa97056ec80 | 7,095 | py | Python | experiments/lpgta/processing.py | Kermaidy/pygama | d75f3d8d79f78c29f50171e24010a0644684f591 | [
"Apache-2.0"
] | null | null | null | experiments/lpgta/processing.py | Kermaidy/pygama | d75f3d8d79f78c29f50171e24010a0644684f591 | [
"Apache-2.0"
] | null | null | null | experiments/lpgta/processing.py | Kermaidy/pygama | d75f3d8d79f78c29f50171e24010a0644684f591 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os
import json
import numpy as np
import argparse
import pandas as pd
from pprint import pprint
from collections import OrderedDict
from pygama import DataGroup
from pygama.io.daq_to_raw import daq_to_raw
from pygama.io.raw_to_dsp import raw_to_dsp
from pygama.io.ch_group import *
def m... | 33.785714 | 100 | 0.596617 |
import os
import json
import numpy as np
import argparse
import pandas as pd
from pprint import pprint
from collections import OrderedDict
from pygama import DataGroup
from pygama.io.daq_to_raw import daq_to_raw
from pygama.io.raw_to_dsp import raw_to_dsp
from pygama.io.ch_group import *
def main():
doc="""
... | false | true |
1c2d8e4a5a4f9d4d1449c4145d4add75077b4a01 | 2,022 | py | Python | setup.py | techalchemy/tablib | 6b80db8fa806980d342bdf11bc1cd31973371cf3 | [
"MIT"
] | null | null | null | setup.py | techalchemy/tablib | 6b80db8fa806980d342bdf11bc1cd31973371cf3 | [
"MIT"
] | null | null | null | setup.py | techalchemy/tablib | 6b80db8fa806980d342bdf11bc1cd31973371cf3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system("python setup.py sdist upload")
sys.exit()
if sys.argv[-1] == 'speedups':
try:
__imp... | 23.241379 | 78 | 0.577151 |
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system("python setup.py sdist upload")
sys.exit()
if sys.argv[-1] == 'speedups':
try:
__import__('pip')
except ImportError:
... | true | true |
1c2d8ecc146adf9ed998328f8ab9413613b7009c | 998 | py | Python | eyey/config.py | dincamihai/eyey | 146c75a1c8b4f3da6ced57b4fee43ba3315052e0 | [
"Apache-2.0"
] | null | null | null | eyey/config.py | dincamihai/eyey | 146c75a1c8b4f3da6ced57b4fee43ba3315052e0 | [
"Apache-2.0"
] | null | null | null | eyey/config.py | dincamihai/eyey | 146c75a1c8b4f3da6ced57b4fee43ba3315052e0 | [
"Apache-2.0"
] | null | null | null | import imaplib
from credentials import USER, PASSWORD, SERVER
EVAL_INTERVAL = 60
SUBJECT_FEATURES = 10
BODY_FEATURES = 100
BUGZILLA_HEADERS = [
"X-Bugzilla-Reason", # QAcontact
"X-Bugzilla-Type", # changed
"X-Bugzilla-Watch-Reason", # None
"X-Bugzilla-Classification", # SUSE Manager
"X-Bugzill... | 26.263158 | 68 | 0.663327 | import imaplib
from credentials import USER, PASSWORD, SERVER
EVAL_INTERVAL = 60
SUBJECT_FEATURES = 10
BODY_FEATURES = 100
BUGZILLA_HEADERS = [
"X-Bugzilla-Reason",
"X-Bugzilla-Type",
"X-Bugzilla-Watch-Reason",
"X-Bugzilla-Classification",
"X-Bugzilla-Product",
"X-Bugzilla-Component",... | true | true |
1c2d8f41bb0f80e0baf9bb69b37515c206cf19d0 | 7,278 | py | Python | detection/demo_retinanet.py | ravising-h/Grad-CAM.pytorch | e0a1ae3870ea189f9b4cd8782eb77bfb5293c31b | [
"Apache-2.0"
] | null | null | null | detection/demo_retinanet.py | ravising-h/Grad-CAM.pytorch | e0a1ae3870ea189f9b4cd8782eb77bfb5293c31b | [
"Apache-2.0"
] | null | null | null | detection/demo_retinanet.py | ravising-h/Grad-CAM.pytorch | e0a1ae3870ea189f9b4cd8782eb77bfb5293c31b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@File : demo_retinanet.py
@Time : 2020/5/16 下午9:59
@Author : yizuotian
@Description :
"""
import argparse
import multiprocessing as mp
import os
from tqdm import tqdm
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import ImageGrid
import cv2
import detectron2.da... | 34.822967 | 220 | 0.657461 |
import argparse
import multiprocessing as mp
import os
from tqdm import tqdm
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import ImageGrid
import cv2
import detectron2.data.transforms as T
import numpy as np
import torch
from detectron2.checkpoint import DetectionCheckpointer
from detectron2.config i... | true | true |
1c2d907b28e0ff50cdb573cfd9b6d1c8390a419d | 12,853 | py | Python | tasks/data_utils.py | lcylcy/GLM_copa | dbb28be27cd48905986ab5db6e29620eff05984c | [
"MIT"
] | null | null | null | tasks/data_utils.py | lcylcy/GLM_copa | dbb28be27cd48905986ab5db6e29620eff05984c | [
"MIT"
] | null | null | null | tasks/data_utils.py | lcylcy/GLM_copa | dbb28be27cd48905986ab5db6e29620eff05984c | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 37.363372 | 117 | 0.617755 |
import copy
import json
import pickle
import re
from typing import Dict, List, Optional
import numpy as np
import torch
import torch.utils.data
from torch.utils.data.dataloader import default_collate
import mpu
def clean_text(text):
text = text.replace("\n", " ")
text = re.sub(r'\s+', ' ', ... | true | true |
1c2d90f87f40141af385751a4193713ac88ba775 | 3,529 | py | Python | bindings/python/ensmallen/datasets/string/henriciellamarina.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/henriciellamarina.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/henriciellamarina.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Henriciella marina.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein ass... | 32.675926 | 223 | 0.675829 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def HenriciellaMarina(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/string"... | true | true |
1c2d91349c242b43ed1148546b45cf09e118f038 | 4,998 | py | Python | src/exceptionite/Handler.py | MasoniteFramework/exceptions | ce15da5e9f763c563e9d687771fb0599b875b83f | [
"MIT"
] | 6 | 2019-12-13T05:22:49.000Z | 2020-01-02T20:50:24.000Z | src/exceptionite/Handler.py | MasoniteFramework/exceptions | ce15da5e9f763c563e9d687771fb0599b875b83f | [
"MIT"
] | 7 | 2019-12-12T18:02:20.000Z | 2020-01-04T19:49:49.000Z | src/exceptionite/Handler.py | MasoniteFramework/exceptions | ce15da5e9f763c563e9d687771fb0599b875b83f | [
"MIT"
] | 3 | 2020-08-11T22:07:46.000Z | 2022-02-21T05:22:59.000Z | import sys
import traceback
from dotty_dict import dotty
from typing import Type, TYPE_CHECKING
from typing_extensions import Protocol
if TYPE_CHECKING:
class Renderer(Protocol):
handler: "Handler"
def __init__(self, handler: "Handler") -> None:
...
def render(self) -> str:
... | 33.543624 | 98 | 0.605242 | import sys
import traceback
from dotty_dict import dotty
from typing import Type, TYPE_CHECKING
from typing_extensions import Protocol
if TYPE_CHECKING:
class Renderer(Protocol):
handler: "Handler"
def __init__(self, handler: "Handler") -> None:
...
def render(self) -> str:
... | true | true |
1c2d9225dd44601ceefd958f0a2cc9bc2ed2ac90 | 3,114 | py | Python | conductor/conductor/solver/request/generic_objective.py | onap/optf-has | dd06e2675aedd7ae6344f2f51e70bbd468f36ce5 | [
"Apache-2.0"
] | 4 | 2019-02-14T19:18:09.000Z | 2019-10-21T17:17:59.000Z | conductor/conductor/solver/request/generic_objective.py | onap/optf-has | dd06e2675aedd7ae6344f2f51e70bbd468f36ce5 | [
"Apache-2.0"
] | null | null | null | conductor/conductor/solver/request/generic_objective.py | onap/optf-has | dd06e2675aedd7ae6344f2f51e70bbd468f36ce5 | [
"Apache-2.0"
] | 4 | 2019-05-09T07:05:54.000Z | 2020-11-20T05:56:47.000Z | #
# -------------------------------------------------------------------------
# Copyright (C) 2020 Wipro 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.... | 39.417722 | 98 | 0.618818 |
from conductor.solver.request import functions
from conductor.solver.utils.utils import OPERATOR_FUNCTIONS
GOALS = {'minimize': 'min',
'maximize': 'max'}
def get_method_class(function_name):
module_name = getattr(functions, function_name)
return getattr(module_name, dir(module_nam... | true | true |
1c2d9283d382e048364a6ebcb1d9c183da7ec7f7 | 218 | py | Python | examples/use_as_module_minimal.py | DougBarry/m365-endpoint-api-digester | d1ed1f4223a040cae021aef2e769929682e1aa34 | [
"MIT"
] | null | null | null | examples/use_as_module_minimal.py | DougBarry/m365-endpoint-api-digester | d1ed1f4223a040cae021aef2e769929682e1aa34 | [
"MIT"
] | 1 | 2021-05-07T17:04:21.000Z | 2021-05-07T17:04:21.000Z | examples/use_as_module_minimal.py | DougBarry/m365-endpoint-api-digester | d1ed1f4223a040cae021aef2e769929682e1aa34 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Part of m365-endpoint-api-digester
# Use as module example minimal
import pprint
from m365digester.M365Digester import M365Digester
app = M365Digester()
app.main()
pprint.pprint(app.rule_list)
| 24.222222 | 50 | 0.798165 |
import pprint
from m365digester.M365Digester import M365Digester
app = M365Digester()
app.main()
pprint.pprint(app.rule_list)
| true | true |
1c2d93f0de31e8fd4ad1ab51951960e6ac32247b | 81 | py | Python | src/twisted/test/reflect_helper_VE.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | 4,612 | 2015-01-01T12:57:23.000Z | 2022-03-30T01:08:23.000Z | src/twisted/test/reflect_helper_VE.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | 1,243 | 2015-01-23T17:23:59.000Z | 2022-03-28T13:46:17.000Z | src/twisted/test/reflect_helper_VE.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | 1,236 | 2015-01-13T14:41:26.000Z | 2022-03-17T07:12:36.000Z | # Helper for a test_reflect test
raise ValueError("Stuff is broken and things")
| 20.25 | 46 | 0.777778 |
raise ValueError("Stuff is broken and things")
| true | true |
1c2d94414b183f0621b1473a1c8116496d480455 | 3,500 | py | Python | .leetcode/11.container-with-most-water.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/11.container-with-most-water.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/11.container-with-most-water.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | # @lc app=leetcode id=11 lang=python3
#
# [11] Container With Most Water
#
# https://leetcode.com/problems/container-with-most-water/description/
#
# algorithms
# Medium (52.91%)
# Likes: 9053
# Dislikes: 697
# Total Accepted: 914.4K
# Total Submissions: 1.7M
# Testcase Example: '[1,8,6,2,5,4,8,3,7]'
#
# Given n... | 21.604938 | 123 | 0.545429 |
from imports import *
class Solution:
def maxArea(self, height: List[int]) -> int:
leftMax = 0
rightMax = len(height) - 1
waterMax = min(height[leftMax],
height[rightMax]) * (rightMax ... | true | true |
1c2d944ee87236b6114fda1638c31b1d60f9fe3b | 297 | py | Python | nivlink/__init__.py | szorowi1/NivLink | c5c03f36975a10445e586499fa516e2e38feae2b | [
"MIT"
] | 6 | 2018-08-15T16:58:13.000Z | 2021-12-06T04:38:40.000Z | nivlink/__init__.py | nivlab/NivLink | c5c03f36975a10445e586499fa516e2e38feae2b | [
"MIT"
] | 13 | 2018-08-13T21:33:58.000Z | 2019-07-04T03:51:12.000Z | nivlink/__init__.py | szorowi1/NivLink | c5c03f36975a10445e586499fa516e2e38feae2b | [
"MIT"
] | 2 | 2018-08-17T19:12:59.000Z | 2018-08-31T14:07:37.000Z | """Niv Lab software for preprocessing eyelink eyetracking data."""
__version__ = '0.2.5'
from .raw import (Raw)
from .epochs import (Epochs)
from .gaze import (align_to_aoi, compute_fixations)
from .screen import (Screen)
from . import projects
from .viz import (plot_raw_blinks, plot_heatmaps)
| 27 | 66 | 0.767677 |
__version__ = '0.2.5'
from .raw import (Raw)
from .epochs import (Epochs)
from .gaze import (align_to_aoi, compute_fixations)
from .screen import (Screen)
from . import projects
from .viz import (plot_raw_blinks, plot_heatmaps)
| true | true |
1c2d9620e834b3766a8631177e2f4224cbb3cef4 | 540 | py | Python | dataio/resources/test/zz_cleanup.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 1 | 2020-12-24T22:00:01.000Z | 2020-12-24T22:00:01.000Z | dataio/resources/test/zz_cleanup.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | null | null | null | dataio/resources/test/zz_cleanup.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 3 | 2020-07-17T09:20:29.000Z | 2021-03-30T16:44:18.000Z | #!/usr/bin/env python
import os, sys
from glob import glob
for fname in (["alpha.i3", "alphabet.i3", "catted.i3.gz", "evens.i3",
"filtered.i3", "ints.i3", "foo.i3", "noinfo.i3", "test.i3", "tmp2.i3",
"tmp.i3", "withnulls.i3", "orphanarium.i3", "pass1.i3", "one_event.i3",
"hasmutineer.i3.gz", "split.gcd.i... | 36 | 77 | 0.581481 |
import os, sys
from glob import glob
for fname in (["alpha.i3", "alphabet.i3", "catted.i3.gz", "evens.i3",
"filtered.i3", "ints.i3", "foo.i3", "noinfo.i3", "test.i3", "tmp2.i3",
"tmp.i3", "withnulls.i3", "orphanarium.i3", "pass1.i3", "one_event.i3",
"hasmutineer.i3.gz", "split.gcd.i3", "testmultiD.*.i3"... | true | true |
1c2d9812282a94f2c8a881d4aa241ad48e343bf8 | 54 | py | Python | codeplayer-compiler-microservice/test.py | saurass/codeplayer | f6d1309fa56f3ec3a699bf359de9ae58bba89462 | [
"MIT"
] | 14 | 2020-07-06T16:56:49.000Z | 2020-09-16T17:25:19.000Z | codeplayer-compiler-microservice/test.py | saurass/codeplayer | f6d1309fa56f3ec3a699bf359de9ae58bba89462 | [
"MIT"
] | null | null | null | codeplayer-compiler-microservice/test.py | saurass/codeplayer | f6d1309fa56f3ec3a699bf359de9ae58bba89462 | [
"MIT"
] | 2 | 2020-07-10T05:23:46.000Z | 2020-07-26T21:20:30.000Z | from worker import Worker
work = Worker()
work.boot() | 13.5 | 25 | 0.740741 | from worker import Worker
work = Worker()
work.boot() | true | true |
1c2d9813c30395a2d4f25e2b7bc28366ada8f869 | 866 | py | Python | src/chat_engine/messages.py | asyncee/django-channels-chat | fe53f48067f98bcb2cc7ebf0d837e66d6b7b388a | [
"MIT"
] | 70 | 2016-04-15T20:57:17.000Z | 2020-12-21T19:51:32.000Z | src/chat_engine/messages.py | asyncee/django-channels-chat | fe53f48067f98bcb2cc7ebf0d837e66d6b7b388a | [
"MIT"
] | 2 | 2017-08-03T10:49:30.000Z | 2017-11-15T18:13:08.000Z | src/chat_engine/messages.py | asyncee/django-channels-chat | fe53f48067f98bcb2cc7ebf0d837e66d6b7b388a | [
"MIT"
] | 19 | 2016-10-05T17:15:19.000Z | 2020-09-25T13:07:59.000Z | import json
class Message(dict):
def __init__(self, text=None, username=None, **kwargs):
defaults = {'type': 'message'}
if text:
defaults['text'] = text
if username:
defaults['user'] = username
defaults.update(kwargs)
self['text'] = json.dumps(defaul... | 22.789474 | 59 | 0.591224 | import json
class Message(dict):
def __init__(self, text=None, username=None, **kwargs):
defaults = {'type': 'message'}
if text:
defaults['text'] = text
if username:
defaults['user'] = username
defaults.update(kwargs)
self['text'] = json.dumps(defaul... | true | true |
1c2d98bfe8a8f52475a1a0ad8a10d0e29bc6ba96 | 120 | py | Python | src/csbuilder/errors/scheme.py | huykingsofm/csbuilder | c6ba6f0dd3fd2a0d03c7492de20a7107cb1b9191 | [
"MIT"
] | null | null | null | src/csbuilder/errors/scheme.py | huykingsofm/csbuilder | c6ba6f0dd3fd2a0d03c7492de20a7107cb1b9191 | [
"MIT"
] | null | null | null | src/csbuilder/errors/scheme.py | huykingsofm/csbuilder | c6ba6f0dd3fd2a0d03c7492de20a7107cb1b9191 | [
"MIT"
] | null | null | null | from csbuilder.errors import CSError
class SchemeError(CSError):
"The exception is raised by failures in scheme."
| 20 | 52 | 0.775 | from csbuilder.errors import CSError
class SchemeError(CSError):
| true | true |
1c2d993573b8814f52b948b6d6fd38ede1bf99c4 | 1,014 | py | Python | tests/conftest.py | AABur/python-project-lvl2 | 5be0fe2ceb56afc7877ff12680fcb29f4b98ce8f | [
"MIT"
] | 2 | 2020-10-03T18:41:00.000Z | 2021-09-20T10:07:28.000Z | tests/conftest.py | AABur/python-project-lvl2 | 5be0fe2ceb56afc7877ff12680fcb29f4b98ce8f | [
"MIT"
] | 15 | 2021-01-14T08:18:42.000Z | 2021-06-25T15:49:09.000Z | tests/conftest.py | AABur/python-project-lvl2 | 5be0fe2ceb56afc7877ff12680fcb29f4b98ce8f | [
"MIT"
] | 7 | 2020-11-22T11:21:24.000Z | 2021-12-11T15:38:20.000Z | # -*- coding:utf-8 -*-
import pytest
@pytest.fixture()
def simple_before_path():
return 'tests/fixtures/simple/before.yaml'
@pytest.fixture()
def simple_after_path():
return 'tests/fixtures/simple/after.yaml'
@pytest.fixture()
def complex_before_path():
return 'tests/fixtures/complex/before.json'
@... | 18.777778 | 54 | 0.747535 |
import pytest
@pytest.fixture()
def simple_before_path():
return 'tests/fixtures/simple/before.yaml'
@pytest.fixture()
def simple_after_path():
return 'tests/fixtures/simple/after.yaml'
@pytest.fixture()
def complex_before_path():
return 'tests/fixtures/complex/before.json'
@pytest.fixture()
def c... | true | true |
1c2d9958ab68ed176a35f00797cb9012c552081c | 3,186 | py | Python | predict_class_sklearn.py | sayan2207/Class-Predictor | 191d98ca4d10d75fef24a4b6b78022c57679d4bc | [
"MIT"
] | 2 | 2021-11-22T03:38:49.000Z | 2021-11-22T03:38:54.000Z | predict_class_sklearn.py | sayan2207/Class-Predictor | 191d98ca4d10d75fef24a4b6b78022c57679d4bc | [
"MIT"
] | null | null | null | predict_class_sklearn.py | sayan2207/Class-Predictor | 191d98ca4d10d75fef24a4b6b78022c57679d4bc | [
"MIT"
] | null | null | null | import numpy as np
import random
import scipy.stats as ss
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap as lcm
from sklearn.neighbors import KNeighborsClassifier as knc
from time import strftime as stime
import os
def synthetic_plot(limits=(-5,5,-5,5), unit=0.1, no_of_points=20, no_of_cl... | 30.634615 | 120 | 0.616133 | import numpy as np
import random
import scipy.stats as ss
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap as lcm
from sklearn.neighbors import KNeighborsClassifier as knc
from time import strftime as stime
import os
def synthetic_plot(limits=(-5,5,-5,5), unit=0.1, no_of_points=20, no_of_cl... | true | true |
1c2d9aac1cb93c456e03168d1fdf9752271e65c0 | 3,624 | py | Python | schedule/calendars/models.py | Tomatosoup97/schedule | 2e7d9b0f49c3d96aed58812cf29866f11ab0fdba | [
"0BSD"
] | null | null | null | schedule/calendars/models.py | Tomatosoup97/schedule | 2e7d9b0f49c3d96aed58812cf29866f11ab0fdba | [
"0BSD"
] | null | null | null | schedule/calendars/models.py | Tomatosoup97/schedule | 2e7d9b0f49c3d96aed58812cf29866f11ab0fdba | [
"0BSD"
] | null | null | null | from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.db import models
from slugify import slugify
from users.models import ClientProfile, HostProfile
from core.models import TimeStampedModel
class Meeting(TimeStampedModel):
... | 29.950413 | 79 | 0.628035 | from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.db import models
from slugify import slugify
from users.models import ClientProfile, HostProfile
from core.models import TimeStampedModel
class Meeting(TimeStampedModel):
... | true | true |
1c2d9ab8b133938e8e0dd83bf95decfa58103b9c | 1,473 | py | Python | mockdown/__init__.py | anandology/mockdown | e37b27c841c8076aad7534fb5e5c480e63645fcf | [
"BSD-3-Clause"
] | 4 | 2015-09-15T21:27:27.000Z | 2021-08-17T09:46:14.000Z | mockdown/__init__.py | anandology/mockdown | e37b27c841c8076aad7534fb5e5c480e63645fcf | [
"BSD-3-Clause"
] | 3 | 2015-09-21T06:38:58.000Z | 2015-09-23T10:25:14.000Z | mockdown/__init__.py | anandology/mockdown | e37b27c841c8076aad7534fb5e5c480e63645fcf | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Mockdown
~~~~~~~~
Tool to simplify creating HTML mockups.
"""
from flask import Blueprint, render_template, abort, redirect, url_for
import yaml
import pathlib
from .mockdown import Mockdown
mockdown_app = Blueprint("mockdown", __name__,
template_folder="t... | 28.326923 | 100 | 0.648337 |
from flask import Blueprint, render_template, abort, redirect, url_for
import yaml
import pathlib
from .mockdown import Mockdown
mockdown_app = Blueprint("mockdown", __name__,
template_folder="templates")
_mockdown = Mockdown(root=".")
def mockdown_url_for(endpoint, **kwargs):
if endpoi... | true | true |
1c2d9b171f83136cf0cedeeb9ad7303c8580d9b0 | 25,328 | py | Python | dragg/reformat.py | apigott/dra | c2f24d9ef6d9d8cb78c5a058574cec8e132afd4f | [
"MIT"
] | 2 | 2021-12-02T09:34:01.000Z | 2021-12-26T07:51:31.000Z | dragg/reformat.py | wuyou33/dragg | c2f24d9ef6d9d8cb78c5a058574cec8e132afd4f | [
"MIT"
] | 7 | 2020-05-09T15:50:10.000Z | 2020-11-12T15:58:56.000Z | dragg/reformat.py | wuyou33/dragg | c2f24d9ef6d9d8cb78c5a058574cec8e132afd4f | [
"MIT"
] | 3 | 2021-03-29T16:00:00.000Z | 2021-12-02T09:33:57.000Z | import os
import sys
import json
import toml
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
import itertools as it
import random
import plotly.graph_objects as go
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.io as pio
import plotly
from prettytabl... | 49.662745 | 297 | 0.562618 | import os
import sys
import json
import toml
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
import itertools as it
import random
import plotly.graph_objects as go
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.io as pio
import plotly
from prettytabl... | true | true |
1c2d9dc8a49a6ca4002890c9e0ada41524f390da | 4,229 | py | Python | tests/tests_coord.py | macph/easement-curve | e1657682db3bc5b8d59a1fb06816732b784d8314 | [
"MIT"
] | 1 | 2019-05-31T03:24:40.000Z | 2019-05-31T03:24:40.000Z | tests/tests_coord.py | macph/easement-curve | e1657682db3bc5b8d59a1fb06816732b784d8314 | [
"MIT"
] | null | null | null | tests/tests_coord.py | macph/easement-curve | e1657682db3bc5b8d59a1fb06816732b784d8314 | [
"MIT"
] | null | null | null | # MIT License, copyright Ewan Macpherson, 2016; see LICENCE in root directory
# Test script for the TrackCoord class
import math
import os
import sys
import unittest
sys.path.insert(0, os.path.abspath('..'))
import ec.coord
class CoordGeneralTests(unittest.TestCase):
def test_position(self):
tc = ec.co... | 36.456897 | 88 | 0.653819 |
import math
import os
import sys
import unittest
sys.path.insert(0, os.path.abspath('..'))
import ec.coord
class CoordGeneralTests(unittest.TestCase):
def test_position(self):
tc = ec.coord.TrackCoord(5, 5, 0, ec.coord.Q.NONE, curvature=0)
self.assertEqual((tc.pos_x, tc.pos_z), (5, 5))
d... | true | true |
1c2d9ea947e157fe845432f224f613ebae49404c | 6,518 | py | Python | tests/h/services/feature_test.py | julien-cheng/h | 36c8ec044725720cf36f0986cdf025395aca8929 | [
"BSD-2-Clause"
] | 2 | 2019-08-04T07:22:11.000Z | 2020-07-17T05:01:41.000Z | tests/h/services/feature_test.py | fuelpress/i.fuel.press | af7b25895d813af0fef656dcf483afe852a99d76 | [
"BSD-2-Clause"
] | null | null | null | tests/h/services/feature_test.py | fuelpress/i.fuel.press | af7b25895d813af0fef656dcf483afe852a99d76 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import mock
import pytest
from h import models
from h.services.feature import (
FeatureRequestProperty,
FeatureService,
UnknownFeatureError,
feature_service_factory,
)
class TestFeatureRequestProperty(object):
def test_single_featu... | 33.425641 | 87 | 0.683645 |
from __future__ import unicode_literals
import mock
import pytest
from h import models
from h.services.feature import (
FeatureRequestProperty,
FeatureService,
UnknownFeatureError,
feature_service_factory,
)
class TestFeatureRequestProperty(object):
def test_single_feature_fetch(self, pyramid_... | true | true |
1c2d9ef17af99fb74c0778340b827b7ed380f649 | 1,155 | py | Python | Languages/Python/mcm.py | bluey-crypto/Hacktoberfest | c826d5faf1d1c860dbffe665e6a7cf1e35ba76ba | [
"MIT"
] | 1 | 2020-10-03T03:17:03.000Z | 2020-10-03T03:17:03.000Z | Languages/Python/mcm.py | bluey-crypto/Hacktoberfest | c826d5faf1d1c860dbffe665e6a7cf1e35ba76ba | [
"MIT"
] | 1 | 2020-10-01T18:03:45.000Z | 2020-10-01T18:03:45.000Z | Languages/Python/mcm.py | bluey-crypto/Hacktoberfest | c826d5faf1d1c860dbffe665e6a7cf1e35ba76ba | [
"MIT"
] | 4 | 2020-10-07T14:58:50.000Z | 2020-10-24T10:13:17.000Z | # Dynamic Programming Python implementation of Matrix
# Chain Multiplication. See the Cormen book for details
# of the following algorithm
import sys
# Matrix Ai has dimension p[i-1] x p[i] for i = 1..n
def MatrixChainOrder(p, n):
# For simplicity of the program, one extra row and one
# extra column are allocated in... | 27.5 | 60 | 0.630303 |
import sys
def MatrixChainOrder(p, n):
m = [[0 for x in range(n)] for x in range(n)]
for i in range(1, n):
m[i][i] = 0
for L in range(2, n):
for i in range(1, n-L + 1):
j = i + L-1
m[i][j] = sys.maxint
for k in range(i, j):
q = m[i][k] + m[k + 1][j] + p[i-1]*p[k]*p[j]
... | true | true |
1c2d9ef1f3d3556468e9fbc47d7384fea9f3c2a0 | 1,313 | py | Python | backend/battles/migrations/0004_battleteam.py | gabrielaleal/pokebattle | 3259204eb34f27a5e79f2bbff57994f435b624c1 | [
"MIT"
] | 1 | 2020-03-02T18:15:29.000Z | 2020-03-02T18:15:29.000Z | backend/battles/migrations/0004_battleteam.py | gabrielaleal/pokebattle | 3259204eb34f27a5e79f2bbff57994f435b624c1 | [
"MIT"
] | 12 | 2020-03-18T21:50:29.000Z | 2022-02-19T00:30:14.000Z | backend/battles/migrations/0004_battleteam.py | gabrielaleal/pokebattle | 3259204eb34f27a5e79f2bbff57994f435b624c1 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.10 on 2020-02-28 14:20
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('pokemon', '0001_initial... | 45.275862 | 143 | 0.66032 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('pokemon', '0001_initial'),
('battles', '0003_auto_20200228_1258... | true | true |
1c2d9f9ad36e481653364b261c99e4779f4cc65c | 2,570 | py | Python | entropica_qaoa/tests/test_vqe.py | NunoEdgarGFlowHub/entropica_qaoa | bc9496320dbeadeac1302bda056e9d7b67607e30 | [
"Apache-2.0"
] | null | null | null | entropica_qaoa/tests/test_vqe.py | NunoEdgarGFlowHub/entropica_qaoa | bc9496320dbeadeac1302bda056e9d7b67607e30 | [
"Apache-2.0"
] | null | null | null | entropica_qaoa/tests/test_vqe.py | NunoEdgarGFlowHub/entropica_qaoa | bc9496320dbeadeac1302bda056e9d7b67607e30 | [
"Apache-2.0"
] | null | null | null | """
Test that all the components of vqe play nicely together
"""
import numpy as np
import pytest
from scipy.optimize import minimize
from pyquil.paulis import PauliSum, PauliTerm
from pyquil.api import WavefunctionSimulator, local_qvm, get_qc
from pyquil.quil import Program
from pyquil.gates import RX, CNOT
from en... | 36.714286 | 82 | 0.585603 |
import numpy as np
import pytest
from scipy.optimize import minimize
from pyquil.paulis import PauliSum, PauliTerm
from pyquil.api import WavefunctionSimulator, local_qvm, get_qc
from pyquil.quil import Program
from pyquil.gates import RX, CNOT
from entropica_qaoa.vqe.cost_function import (PrepareAndMeasureOnWFSim,
... | true | true |
1c2da042495ddcdc035511151cc4ab40f8ed1660 | 2,894 | py | Python | shooter_game.py | maria-2302/Proekt | eec5a094afb7ce6aceaf319fdbeda8112026b277 | [
"CC0-1.0"
] | null | null | null | shooter_game.py | maria-2302/Proekt | eec5a094afb7ce6aceaf319fdbeda8112026b277 | [
"CC0-1.0"
] | null | null | null | shooter_game.py | maria-2302/Proekt | eec5a094afb7ce6aceaf319fdbeda8112026b277 | [
"CC0-1.0"
] | null | null | null | #Создай собственный Шутер!
from pygame import *
okno = display.set_mode((800,600))
bkgd = transform.scale(image.load('galaxy.jpg'),(800,600))
gm = True
mixer.init()
mixer.music.load('space.ogg')
mixer.music.play()
class sprit(sprite.Sprite):
def __init__(self, imimage, x, y, sspeed):
super().__init__()
... | 27.561905 | 67 | 0.568072 |
from pygame import *
okno = display.set_mode((800,600))
bkgd = transform.scale(image.load('galaxy.jpg'),(800,600))
gm = True
mixer.init()
mixer.music.load('space.ogg')
mixer.music.play()
class sprit(sprite.Sprite):
def __init__(self, imimage, x, y, sspeed):
super().__init__()
self.image = transfor... | true | true |
1c2da145767d95072bb35ea3a50f1a47c19e0f34 | 361 | py | Python | src/game/game.py | Palaszczuk/clase-23 | b5565585f5e3ee177162f4df081f89d2ad31f044 | [
"MIT"
] | null | null | null | src/game/game.py | Palaszczuk/clase-23 | b5565585f5e3ee177162f4df081f89d2ad31f044 | [
"MIT"
] | null | null | null | src/game/game.py | Palaszczuk/clase-23 | b5565585f5e3ee177162f4df081f89d2ad31f044 | [
"MIT"
] | null | null | null |
class Game:
player1 = None
player2 = None
def __init__(self) -> None:
"""
Solo el constructor
"""
pass
def __str__(self) -> str:
return f"Esto es el objeto Game"
def start(self) -> bool:
pass
def end(self) -> bool:
pass
... | 15.695652 | 40 | 0.476454 |
class Game:
player1 = None
player2 = None
def __init__(self) -> None:
pass
def __str__(self) -> str:
return f"Esto es el objeto Game"
def start(self) -> bool:
pass
def end(self) -> bool:
pass
def update(self) -> bool:
pass | true | true |
1c2da1d891b041dc595bc2ace632ef69d4988ab8 | 233 | py | Python | Python/lib/settings.py | MatteoEsposito/ProgettoInItinereI-IngegneriaDegliAlgoritmi- | 75da3bb8b3a4189503d67b1b03cc50c14871f9e7 | [
"MIT"
] | null | null | null | Python/lib/settings.py | MatteoEsposito/ProgettoInItinereI-IngegneriaDegliAlgoritmi- | 75da3bb8b3a4189503d67b1b03cc50c14871f9e7 | [
"MIT"
] | null | null | null | Python/lib/settings.py | MatteoEsposito/ProgettoInItinereI-IngegneriaDegliAlgoritmi- | 75da3bb8b3a4189503d67b1b03cc50c14871f9e7 | [
"MIT"
] | null | null | null | # coding=utf-8
# settings.py
# Autore: Matteo Esposito
# Versione di Python: 2.6.9
# Variabili Globali per impostare la verbosità dell'algoritmo e facilitarne il DEBUG ed/o il TESTING ed/o il PROFILING
DEBUG = False
RELEASE = False
| 25.888889 | 118 | 0.763948 |
DEBUG = False
RELEASE = False
| true | true |
1c2da2abb77d52abeb662a7d3bf4cb9b5ce2ade6 | 192 | py | Python | pywick/models/classification/resnext_features/__init__.py | achaiah/pywick | 9d663faf0c1660a9b8359a6472c164f658dfc8cb | [
"MIT"
] | 408 | 2019-05-16T16:12:41.000Z | 2022-03-26T17:27:12.000Z | pywick/models/classification/resnext_features/__init__.py | ashishpatel26/pywick | 1afffd1c21c2b188836d3599e802146182757bb5 | [
"MIT"
] | 13 | 2019-05-17T05:47:06.000Z | 2021-06-21T19:02:30.000Z | pywick/models/classification/resnext_features/__init__.py | ashishpatel26/pywick | 1afffd1c21c2b188836d3599e802146182757bb5 | [
"MIT"
] | 42 | 2019-05-16T19:57:12.000Z | 2022-03-06T15:23:18.000Z | from .resnext101_32x4d_features import resnext101_32x4d_features
from .resnext101_64x4d_features import resnext101_64x4d_features
from .resnext50_32x4d_features import resnext50_32x4d_features | 64 | 64 | 0.927083 | from .resnext101_32x4d_features import resnext101_32x4d_features
from .resnext101_64x4d_features import resnext101_64x4d_features
from .resnext50_32x4d_features import resnext50_32x4d_features | true | true |
1c2da358466cdf6059f3a2649c3e957e2b02ec7a | 1,606 | py | Python | tests/asyncio/test_lifespan.py | justin0mcateer/hypercorn | c6df3becf73df7be03451d53f5685aaadd4bbd80 | [
"MIT"
] | null | null | null | tests/asyncio/test_lifespan.py | justin0mcateer/hypercorn | c6df3becf73df7be03451d53f5685aaadd4bbd80 | [
"MIT"
] | null | null | null | tests/asyncio/test_lifespan.py | justin0mcateer/hypercorn | c6df3becf73df7be03451d53f5685aaadd4bbd80 | [
"MIT"
] | null | null | null | import asyncio
from time import sleep
from typing import Callable
import pytest
from hypercorn.asyncio.lifespan import Lifespan
from hypercorn.config import Config
from hypercorn.utils import LifespanFailure, LifespanTimeout
from ..helpers import lifespan_failure, SlowLifespanFramework
async def no_lifespan_app(sco... | 34.170213 | 91 | 0.764633 | import asyncio
from time import sleep
from typing import Callable
import pytest
from hypercorn.asyncio.lifespan import Lifespan
from hypercorn.config import Config
from hypercorn.utils import LifespanFailure, LifespanTimeout
from ..helpers import lifespan_failure, SlowLifespanFramework
async def no_lifespan_app(sco... | true | true |
1c2da3c94d476fb4dd3196ed021713a45ff4e451 | 41,099 | py | Python | Instrument_Turi_Project/venv/lib/python3.6/site-packages/mxnet/symbol/gen_contrib.py | fozoglu/instrument-recognition | 8cc14a481c2736c4ba55f48f00794684271d82cd | [
"MIT"
] | null | null | null | Instrument_Turi_Project/venv/lib/python3.6/site-packages/mxnet/symbol/gen_contrib.py | fozoglu/instrument-recognition | 8cc14a481c2736c4ba55f48f00794684271d82cd | [
"MIT"
] | null | null | null | Instrument_Turi_Project/venv/lib/python3.6/site-packages/mxnet/symbol/gen_contrib.py | fozoglu/instrument-recognition | 8cc14a481c2736c4ba55f48f00794684271d82cd | [
"MIT"
] | null | null | null | # File content is auto-generated. Do not modify.
# pylint: skip-file
from ._internal import SymbolBase
from ..base import _Null
def CTCLoss(data=None, label=None, data_lengths=None, label_lengths=None, use_data_lengths=_Null, use_label_lengths=_Null, blank_label=_Null, name=None, attr=None, out=None, **kwargs):
r"... | 41.016966 | 416 | 0.649918 |
from ._internal import SymbolBase
from ..base import _Null
def CTCLoss(data=None, label=None, data_lengths=None, label_lengths=None, use_data_lengths=_Null, use_label_lengths=_Null, blank_label=_Null, name=None, attr=None, out=None, **kwargs):
return (0,)
def DeformableConvolution(data=None, offset=None, weight... | true | true |
1c2da3d5a61506ac017ea383f4339adbfb9d62c8 | 7,507 | py | Python | biomine/variant/vepvariant.py | AdamDS/urlAPIs | 90ca3d4a1320651cffe7d00c97ecf5d307bbeba9 | [
"MIT"
] | 1 | 2019-08-07T03:56:59.000Z | 2019-08-07T03:56:59.000Z | biomine/variant/vepvariant.py | AdamDS/urlAPIs | 90ca3d4a1320651cffe7d00c97ecf5d307bbeba9 | [
"MIT"
] | 4 | 2017-01-19T00:04:50.000Z | 2019-06-21T09:20:15.000Z | biomine/variant/vepvariant.py | AdamDS/urlAPIs | 90ca3d4a1320651cffe7d00c97ecf5d307bbeba9 | [
"MIT"
] | 8 | 2016-06-08T22:52:46.000Z | 2019-09-13T22:07:25.000Z | from biomine.variant.mafvariant import mafvariant
from biomine.variant.vepconsequencevariant import vepconsequencevariant
#{
# "allele_string": "G/A",
# "assembly_name": "GRCh37",
# "colocated_variants": [
# {
# "allele_string": "G/A",
# "end": 140534527,
# "id": "COSM1312758",
# "phenotype_or_disease": 1,
# ... | 30.893004 | 107 | 0.676569 | from biomine.variant.mafvariant import mafvariant
from biomine.variant.vepconsequencevariant import vepconsequencevariant
class vepvariant(mafvariant):
def __init__(self , **kwargs):
super(vepvariant,self).__init__(**kwargs)... | false | true |
1c2da447b7adf5eb8f5afb463937b0be2ed115d1 | 190 | py | Python | indonesian_dot/agents/agent.py | Ra-Ni/Indonesian-Dot-Solver | 2baf507d23816b686f046f89d4c833728b25f2dc | [
"MIT"
] | null | null | null | indonesian_dot/agents/agent.py | Ra-Ni/Indonesian-Dot-Solver | 2baf507d23816b686f046f89d4c833728b25f2dc | [
"MIT"
] | null | null | null | indonesian_dot/agents/agent.py | Ra-Ni/Indonesian-Dot-Solver | 2baf507d23816b686f046f89d4c833728b25f2dc | [
"MIT"
] | 1 | 2020-03-18T15:23:24.000Z | 2020-03-18T15:23:24.000Z | class Agent:
def g(self, n) -> int:
raise NotImplementedError
def h(self, n) -> int:
raise NotImplementedError
def __str__(self) -> str:
return 'agent'
| 19 | 33 | 0.578947 | class Agent:
def g(self, n) -> int:
raise NotImplementedError
def h(self, n) -> int:
raise NotImplementedError
def __str__(self) -> str:
return 'agent'
| true | true |
1c2da47e791d320267d90c36afc0ffe1389121c7 | 4,938 | py | Python | pred/queries/predictionqueryparts.py | Duke-GCB/PredictionsDB | 066278425890288d9e430a46096a347453301b08 | [
"MIT"
] | null | null | null | pred/queries/predictionqueryparts.py | Duke-GCB/PredictionsDB | 066278425890288d9e430a46096a347453301b08 | [
"MIT"
] | 57 | 2016-09-16T15:23:49.000Z | 2021-09-07T15:20:22.000Z | pred/queries/predictionqueryparts.py | Duke-GCB/PredictionsDB | 066278425890288d9e430a46096a347453301b08 | [
"MIT"
] | 1 | 2016-09-09T20:03:48.000Z | 2016-09-09T20:03:48.000Z | from pred.queries.querybuilder import QueryPart
RANGE_OPERATOR = '@>' # contains range - excludes predictions not completely inside gene TSS range
def _query_part(sql):
return QueryPart(sql, [])
def set_search_path(schema):
return QueryPart("SET search_path TO %s,public;", [schema])
def custom_range_lis... | 27.131868 | 128 | 0.724382 | from pred.queries.querybuilder import QueryPart
RANGE_OPERATOR = '@>'
def _query_part(sql):
return QueryPart(sql, [])
def set_search_path(schema):
return QueryPart("SET search_path TO %s,public;", [schema])
def custom_range_list_query(list_id, model_name):
return QueryPart("""select '' as name,
'ra... | true | true |
1c2da523ab460b74b6fcc0dbaccbcf22925a498c | 232 | py | Python | tests/utils/http_utils.py | Sinkler/python-sdk-v2 | a1ad7cc9900f8adf967ca4dec0bb05d8eddc2999 | [
"MIT"
] | null | null | null | tests/utils/http_utils.py | Sinkler/python-sdk-v2 | a1ad7cc9900f8adf967ca4dec0bb05d8eddc2999 | [
"MIT"
] | null | null | null | tests/utils/http_utils.py | Sinkler/python-sdk-v2 | a1ad7cc9900f8adf967ca4dec0bb05d8eddc2999 | [
"MIT"
] | null | null | null | # coding: utf-8
import urllib3
from config import create_logger
logger = create_logger(__name__)
http = urllib3.PoolManager()
def do_get(url):
r = http.request('GET', url)
logger.info("%s %s", r.status, r._request_url)
| 16.571429 | 50 | 0.702586 |
import urllib3
from config import create_logger
logger = create_logger(__name__)
http = urllib3.PoolManager()
def do_get(url):
r = http.request('GET', url)
logger.info("%s %s", r.status, r._request_url)
| true | true |
1c2da67d0017c87f2d96b8ad92b048f1617fe228 | 6,814 | py | Python | kubernetes/client/models/v1_replication_controller_list.py | fooka03/python | 073cf4d89e532f92b57e8955b4efc3d5d5eb80cf | [
"Apache-2.0"
] | 2 | 2020-07-02T05:47:41.000Z | 2020-07-02T05:50:34.000Z | kubernetes/client/models/v1_replication_controller_list.py | fooka03/python | 073cf4d89e532f92b57e8955b4efc3d5d5eb80cf | [
"Apache-2.0"
] | 1 | 2021-03-25T23:44:49.000Z | 2021-03-25T23:44:49.000Z | k8sdeployment/k8sstat/python/kubernetes/client/models/v1_replication_controller_list.py | JeffYFHuang/gpuaccounting | afa934350ebbd0634beb60b9df4a147426ea0006 | [
"MIT"
] | 1 | 2021-10-13T17:45:37.000Z | 2021-10-13T17:45:37.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.6
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1Replicat... | 34.414141 | 295 | 0.632962 |
import pprint
import re
import six
class V1ReplicationControllerList(object):
openapi_types = {
'api_version': 'str',
'items': 'list[V1ReplicationController]',
'kind': 'str',
'metadata': 'V1ListMeta'
}
attribute_map = {
'api_version': 'apiVersion',
... | true | true |
1c2da6f171cae7cb1045a0bd7c00a1fd34426c95 | 5,120 | py | Python | agents/DQN.py | manjavacas/drl-building | 6aaa117c0d02b0349af227939460adf31d8d40d9 | [
"MIT"
] | 4 | 2021-03-22T20:04:38.000Z | 2022-02-21T11:44:32.000Z | agents/DQN.py | manjavacas/drl-building | 6aaa117c0d02b0349af227939460adf31d8d40d9 | [
"MIT"
] | null | null | null | agents/DQN.py | manjavacas/drl-building | 6aaa117c0d02b0349af227939460adf31d8d40d9 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import gym
import energym
import argparse
import uuid
import mlflow
import numpy as np
from energym.utils.callbacks import LoggerCallback, LoggerEvalCallback
from energym.utils.wrappers import NormalizeObservation, LoggerWrapper
from stable_baselines3 import DQN
from stable_baselines3.common.call... | 41.290323 | 118 | 0.67793 |
import gym
import energym
import argparse
import uuid
import mlflow
import numpy as np
from energym.utils.callbacks import LoggerCallback, LoggerEvalCallback
from energym.utils.wrappers import NormalizeObservation, LoggerWrapper
from stable_baselines3 import DQN
from stable_baselines3.common.callbacks import EvalC... | true | true |
1c2da91a4fcfe9df61ac196a1e59085d8e4a082e | 549 | py | Python | main.py | ivicel/steamkit-python | 0a3f250e432cf890965db5e7245841aa512bca22 | [
"Apache-2.0"
] | 5 | 2018-11-16T08:59:41.000Z | 2021-04-03T05:32:18.000Z | main.py | ivicel/steamkit-python | 0a3f250e432cf890965db5e7245841aa512bca22 | [
"Apache-2.0"
] | null | null | null | main.py | ivicel/steamkit-python | 0a3f250e432cf890965db5e7245841aa512bca22 | [
"Apache-2.0"
] | null | null | null |
import logging
from steam import SteamClient
from steam.base.msg.emsg import EMsg
logging.basicConfig(format="[%(levelname)s] %(asctime)s: %(name)s: %(message)s",
level=logging.DEBUG)
client = SteamClient()
@client.on(EMsg.ClientAccountInfo)
async def account_info(msg):
print(msg.body)
... | 18.931034 | 80 | 0.653916 |
import logging
from steam import SteamClient
from steam.base.msg.emsg import EMsg
logging.basicConfig(format="[%(levelname)s] %(asctime)s: %(name)s: %(message)s",
level=logging.DEBUG)
client = SteamClient()
@client.on(EMsg.ClientAccountInfo)
async def account_info(msg):
print(msg.body)
... | true | true |
1c2da93f0a175cd6cc180de3072f3bbc7b671a6f | 67,781 | py | Python | tests/components/cast/test_media_player.py | gregsheremeta/core | 8e39ba387d0fcbd8462fff76da4d64890bc4ec57 | [
"Apache-2.0"
] | null | null | null | tests/components/cast/test_media_player.py | gregsheremeta/core | 8e39ba387d0fcbd8462fff76da4d64890bc4ec57 | [
"Apache-2.0"
] | 4 | 2022-03-02T07:18:01.000Z | 2022-03-31T07:09:30.000Z | tests/components/cast/test_media_player.py | gregsheremeta/core | 8e39ba387d0fcbd8462fff76da4d64890bc4ec57 | [
"Apache-2.0"
] | null | null | null | """The tests for the Cast Media player platform."""
# pylint: disable=protected-access
from __future__ import annotations
import json
from unittest.mock import ANY, AsyncMock, MagicMock, Mock, patch
from uuid import UUID
import attr
import pychromecast
from pychromecast.const import CAST_TYPE_CHROMECAST, CAST_TYPE_GR... | 35.065184 | 118 | 0.695682 |
from __future__ import annotations
import json
from unittest.mock import ANY, AsyncMock, MagicMock, Mock, patch
from uuid import UUID
import attr
import pychromecast
from pychromecast.const import CAST_TYPE_CHROMECAST, CAST_TYPE_GROUP
import pytest
import yarl
from homeassistant.components import media_player, tts
... | true | true |
1c2dab50d42e019542081e038e89f7d1b6d275fd | 1,912 | py | Python | tests/conftest.py | jannikluhn/tlbc-monitor | 9d54d40bfed48db5542fd6714946ea27684a918e | [
"MIT"
] | null | null | null | tests/conftest.py | jannikluhn/tlbc-monitor | 9d54d40bfed48db5542fd6714946ea27684a918e | [
"MIT"
] | 61 | 2019-04-08T20:13:47.000Z | 2020-07-16T09:18:48.000Z | tests/conftest.py | jannikluhn/tlbc-monitor | 9d54d40bfed48db5542fd6714946ea27684a918e | [
"MIT"
] | 3 | 2019-02-22T14:15:27.000Z | 2019-10-23T04:20:47.000Z | import math
import pytest
from eth_tester import EthereumTester
from eth_keys import keys
from web3 import EthereumTesterProvider, Web3
from eth_utils import int_to_big_endian, to_checksum_address
from sqlalchemy import create_engine
from monitor.db import BlockDB
from monitor.validators import PrimaryOracle, Ep... | 22.494118 | 86 | 0.736402 | import math
import pytest
from eth_tester import EthereumTester
from eth_keys import keys
from web3 import EthereumTesterProvider, Web3
from eth_utils import int_to_big_endian, to_checksum_address
from sqlalchemy import create_engine
from monitor.db import BlockDB
from monitor.validators import PrimaryOracle, Ep... | true | true |
1c2dac728e9bb035d33003ba95e387686a62fb5b | 17,495 | py | Python | neutron/tests/unit/_test_extension_portbindings.py | sajuptpm/notification_neutron | 45933f63c9eff0d2931a7209b040ff2dc69835c5 | [
"Apache-2.0"
] | 5 | 2015-10-20T07:56:53.000Z | 2017-12-31T22:39:15.000Z | neutron/tests/unit/_test_extension_portbindings.py | sajuptpm/notification_neutron | 45933f63c9eff0d2931a7209b040ff2dc69835c5 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/_test_extension_portbindings.py | sajuptpm/notification_neutron | 45933f63c9eff0d2931a7209b040ff2dc69835c5 | [
"Apache-2.0"
] | 3 | 2015-05-08T22:36:28.000Z | 2015-10-24T21:25:35.000Z | # Copyright 2013 NEC Corporation
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 46.405836 | 78 | 0.582338 |
import contextlib
import httplib
from oslo_config import cfg
from webob import exc
from neutron import context
from neutron.extensions import portbindings
from neutron import manager
from neutron.tests.unit.db import test_db_base_plugin_v2
class PortBindingsTestCase(test_db_base_plugin_v2.NeutronDbPl... | true | true |
1c2dade172981cc31aa1caf156e345e1669c48d6 | 1,533 | py | Python | simulation/utils/machine_learning/data/rosbag_to_video.py | KITcar-Team/kitcar-gazebo-simulation | 8a9438b5a24c288721ae0302889fe55e26046310 | [
"MIT"
] | 13 | 2020-06-30T17:18:28.000Z | 2021-07-20T16:55:35.000Z | simulation/utils/machine_learning/data/rosbag_to_video.py | KITcar-Team/kitcar-gazebo-simulation | 8a9438b5a24c288721ae0302889fe55e26046310 | [
"MIT"
] | 1 | 2020-11-10T20:15:42.000Z | 2020-12-25T18:27:56.000Z | simulation/utils/machine_learning/data/rosbag_to_video.py | KITcar-Team/kitcar-gazebo-simulation | 8a9438b5a24c288721ae0302889fe55e26046310 | [
"MIT"
] | 3 | 2020-07-20T09:09:08.000Z | 2021-07-20T17:00:37.000Z | import argparse
import os
import shutil
from simulation.utils.machine_learning.data.images_to_video import images_to_video
from simulation.utils.machine_learning.data.rosbag_to_images import rosbag_to_images
def rosbag_to_video(rosbag_dir: str, output_dir: str, image_topic: str):
os.makedirs(output_dir, exist_ok... | 32.617021 | 91 | 0.64775 | import argparse
import os
import shutil
from simulation.utils.machine_learning.data.images_to_video import images_to_video
from simulation.utils.machine_learning.data.rosbag_to_images import rosbag_to_images
def rosbag_to_video(rosbag_dir: str, output_dir: str, image_topic: str):
os.makedirs(output_dir, exist_ok... | true | true |
1c2dae3786cbef4c0e87da202d359b38ed6a331b | 242 | py | Python | application/templatetags/makeurl.py | amarlearning/Footstep | 557beda097834a031fa2f114bad5de261c7daf95 | [
"MIT"
] | null | null | null | application/templatetags/makeurl.py | amarlearning/Footstep | 557beda097834a031fa2f114bad5de261c7daf95 | [
"MIT"
] | 2 | 2017-05-12T14:38:01.000Z | 2017-05-18T13:25:35.000Z | application/templatetags/makeurl.py | amarlearning/Footstep | 557beda097834a031fa2f114bad5de261c7daf95 | [
"MIT"
] | null | null | null | from django import template
register = template.Library()
@register.filter
def makeurl(value, args):
string = value.replace("api.","")
string = string.replace("repos/", "")
string = string + '/tree/' +str(args)
return string | 24.2 | 41 | 0.661157 | from django import template
register = template.Library()
@register.filter
def makeurl(value, args):
string = value.replace("api.","")
string = string.replace("repos/", "")
string = string + '/tree/' +str(args)
return string | true | true |
1c2daed7c883679b17d14291ec3c2b8b92f0c669 | 20,263 | py | Python | sympy/functions/special/zeta_functions.py | ianmasc/sympy | f089bdc70cfa1e2aa6ecfdb6d568f37bd937bd5e | [
"BSD-3-Clause"
] | 603 | 2020-12-23T13:49:32.000Z | 2022-03-31T23:38:03.000Z | sympy/functions/special/zeta_functions.py | ianmasc/sympy | f089bdc70cfa1e2aa6ecfdb6d568f37bd937bd5e | [
"BSD-3-Clause"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | sympy/functions/special/zeta_functions.py | ianmasc/sympy | f089bdc70cfa1e2aa6ecfdb6d568f37bd937bd5e | [
"BSD-3-Clause"
] | 35 | 2021-03-26T03:12:04.000Z | 2022-03-23T10:15:10.000Z | """ Riemann zeta and related function. """
from sympy.core import Function, S, sympify, pi, I
from sympy.core.function import ArgumentIndexError
from sympy.functions.combinatorial.numbers import bernoulli, factorial, harmonic
from sympy.functions.elementary.exponential import log, exp_polar
from sympy.functions.elemen... | 29.452035 | 85 | 0.520061 |
from sympy.core import Function, S, sympify, pi, I
from sympy.core.function import ArgumentIndexError
from sympy.functions.combinatorial.numbers import bernoulli, factorial, harmonic
from sympy.functions.elementary.exponential import log, exp_polar
from sympy.functions.elementary.miscellaneous import sqrt
| true | true |
1c2daff473a571d5bdb482be512b46226cd28954 | 13,338 | py | Python | assemblyline/common/backupmanager.py | spelcha/assemblyline-base | 835446128664084c6a45ad2734a636669eca5ad1 | [
"MIT"
] | 39 | 2020-05-06T02:10:25.000Z | 2022-02-22T00:33:52.000Z | assemblyline/common/backupmanager.py | spelcha/assemblyline-base | 835446128664084c6a45ad2734a636669eca5ad1 | [
"MIT"
] | 186 | 2020-04-17T10:38:47.000Z | 2022-03-30T13:20:52.000Z | assemblyline/common/backupmanager.py | spelcha/assemblyline-base | 835446128664084c6a45ad2734a636669eca5ad1 | [
"MIT"
] | 22 | 2020-04-22T16:00:38.000Z | 2022-02-09T03:06:55.000Z | from __future__ import annotations
import json
import os
import random
import time
import threading
import logging
from typing import Any
from multiprocessing import Process
from assemblyline.common import forge
from assemblyline.common.uid import get_random_id
from assemblyline.odm.models.error import ERROR_TYPES
fr... | 36.442623 | 111 | 0.523992 | from __future__ import annotations
import json
import os
import random
import time
import threading
import logging
from typing import Any
from multiprocessing import Process
from assemblyline.common import forge
from assemblyline.common.uid import get_random_id
from assemblyline.odm.models.error import ERROR_TYPES
fr... | true | true |
1c2db06313afeebd3e8c41976a6c2e579de5ebdd | 10,035 | py | Python | tools_webrtc/libs/generate_licenses.py | wyshen2020/webrtc | b93e2240f1653b82e24553e092bbab84337774af | [
"BSD-3-Clause"
] | 2 | 2022-03-10T01:47:56.000Z | 2022-03-31T12:51:46.000Z | tools_webrtc/libs/generate_licenses.py | wyshen2020/webrtc | b93e2240f1653b82e24553e092bbab84337774af | [
"BSD-3-Clause"
] | null | null | null | tools_webrtc/libs/generate_licenses.py | wyshen2020/webrtc | b93e2240f1653b82e24553e092bbab84337774af | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env vpython3
# Copyright 2016 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. A... | 37.58427 | 80 | 0.692875 |
import sys
import argparse
import json
import logging
import os
import re
import subprocess
from html import escape
LIB_TO_LICENSES_DICT = {
'abseil-cpp': ['third_party/abseil-cpp/LICENSE'],
'android_ndk': ['third_party/android_ndk/NOTICE'],
'android_sdk': ['third_party/android_sdk/LICENSE'],
... | true | true |
1c2db11e6425644ddfb4ca0850b6f9cd5ad986e3 | 6,991 | py | Python | A_pathfinding.py | Drake0306/a-_pathfinding | 46cbfbc44b3e563f9bdc2ec2d4c7742beed6c416 | [
"MIT"
] | null | null | null | A_pathfinding.py | Drake0306/a-_pathfinding | 46cbfbc44b3e563f9bdc2ec2d4c7742beed6c416 | [
"MIT"
] | null | null | null | A_pathfinding.py | Drake0306/a-_pathfinding | 46cbfbc44b3e563f9bdc2ec2d4c7742beed6c416 | [
"MIT"
] | null | null | null | import math
import pygame
from queue import PriorityQueue
WIDTH = 800
WIN = pygame.display.set_mode((WIDTH,WIDTH))
pygame.display.set_caption('A* Path Finding Algoritham')
RED = (255,0,0)
GREEN = (0,225,0)
BLUE = (0,225,0)
YELLOW = (225,225,0)
WHITE = (225,225,225)
BLACK = (0,0,0)
PURPLE = (128,0,128)
... | 26.481061 | 101 | 0.51223 | import math
import pygame
from queue import PriorityQueue
WIDTH = 800
WIN = pygame.display.set_mode((WIDTH,WIDTH))
pygame.display.set_caption('A* Path Finding Algoritham')
RED = (255,0,0)
GREEN = (0,225,0)
BLUE = (0,225,0)
YELLOW = (225,225,0)
WHITE = (225,225,225)
BLACK = (0,0,0)
PURPLE = (128,0,128)
... | true | true |
1c2db146a81095258082a5e01445b3cddf1eab20 | 8,037 | py | Python | users/models.py | moshthepitt/probsc | 9b8cab206bb1c41238e36bd77f5e0573df4d8e2d | [
"MIT"
] | null | null | null | users/models.py | moshthepitt/probsc | 9b8cab206bb1c41238e36bd77f5e0573df4d8e2d | [
"MIT"
] | null | null | null | users/models.py | moshthepitt/probsc | 9b8cab206bb1c41238e36bd77f5e0573df4d8e2d | [
"MIT"
] | null | null | null | from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from django.urls import reverse
from django_extensions.db.models import TimeStampedModel
from mptt.models import MPTTModel, TreeForeignKey
... | 33.911392 | 79 | 0.630459 | from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from django.urls import reverse
from django_extensions.db.models import TimeStampedModel
from mptt.models import MPTTModel, TreeForeignKey
... | true | true |
1c2db15793a6bd45d52b1845770cbdfdfae549a1 | 5,001 | py | Python | cinder/tests/unit/api/contrib/test_volume_tenant_attribute.py | potsmaster/cinder | 275c2acdfb4282b0ec0314c9875b759958c093f8 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/api/contrib/test_volume_tenant_attribute.py | potsmaster/cinder | 275c2acdfb4282b0ec0314c9875b759958c093f8 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/api/contrib/test_volume_tenant_attribute.py | potsmaster/cinder | 275c2acdfb4282b0ec0314c9875b759958c093f8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.23913 | 77 | 0.641072 |
import json
import uuid
from lxml import etree
from oslo_utils import timeutils
import webob
from cinder import context
from cinder import test
from cinder.tests.unit.api import fakes
from cinder import volume
PROJECT_ID = '88fd1da4-f464-4a87-9ce5-26f2f40743b9'
def fake_volume_get(*args, **kwargs):
... | true | true |
1c2db1f67a2d09b7d486f3f1ad5c389b9885d986 | 878 | py | Python | mmtfPyspark/tests/datasets/test_polymerSequenceExtractor.py | sbliven/mmtf-pyspark | 3d444178bdc0d5128aafdb1326fec12b5d7634b5 | [
"Apache-2.0"
] | 59 | 2018-01-28T06:50:56.000Z | 2022-02-10T06:07:12.000Z | mmtfPyspark/tests/datasets/test_polymerSequenceExtractor.py | sbliven/mmtf-pyspark | 3d444178bdc0d5128aafdb1326fec12b5d7634b5 | [
"Apache-2.0"
] | 101 | 2018-02-01T20:51:10.000Z | 2022-01-24T00:50:29.000Z | mmtfPyspark/tests/datasets/test_polymerSequenceExtractor.py | sbliven/mmtf-pyspark | 3d444178bdc0d5128aafdb1326fec12b5d7634b5 | [
"Apache-2.0"
] | 29 | 2018-01-29T10:09:51.000Z | 2022-01-23T18:53:28.000Z | #!/usr/bin/env python
import unittest
from pyspark.sql import SparkSession
from mmtfPyspark.io.mmtfReader import download_mmtf_files
from mmtfPyspark.datasets import polymerSequenceExtractor
from mmtfPyspark.mappers import StructureToPolymerChains
class PolymerSequenceExtractorTest(unittest.TestCase):
def setUp... | 25.823529 | 75 | 0.666287 |
import unittest
from pyspark.sql import SparkSession
from mmtfPyspark.io.mmtfReader import download_mmtf_files
from mmtfPyspark.datasets import polymerSequenceExtractor
from mmtfPyspark.mappers import StructureToPolymerChains
class PolymerSequenceExtractorTest(unittest.TestCase):
def setUp(self):
self.... | true | true |
1c2db35a10b0968fdc22b3acdada71c16fa39a8d | 4,729 | py | Python | api.py | Salva5297/WidocoServer | 75e0170c2a644c4fbc3e1f673bd1c3ddc0d8fb73 | [
"Apache-2.0"
] | null | null | null | api.py | Salva5297/WidocoServer | 75e0170c2a644c4fbc3e1f673bd1c3ddc0d8fb73 | [
"Apache-2.0"
] | null | null | null | api.py | Salva5297/WidocoServer | 75e0170c2a644c4fbc3e1f673bd1c3ddc0d8fb73 | [
"Apache-2.0"
] | null | null | null | import os
from flask import Flask, render_template, request, send_file
from flask_restful import Api, Resource, reqparse
import tempfile
from werkzeug.utils import secure_filename
import zipfile
import json
app = Flask(__name__)
api = Api(app)
def zipdir(dirPath=None, zipFilePath=None, includeDirInZip=False):
if... | 31.317881 | 84 | 0.58469 | import os
from flask import Flask, render_template, request, send_file
from flask_restful import Api, Resource, reqparse
import tempfile
from werkzeug.utils import secure_filename
import zipfile
import json
app = Flask(__name__)
api = Api(app)
def zipdir(dirPath=None, zipFilePath=None, includeDirInZip=False):
if... | true | true |
1c2db3eb24f12d0a3f3016c599035d65b14f6ae1 | 51,413 | py | Python | mmtbx/cablam/cablam_training.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | mmtbx/cablam/cablam_training.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | mmtbx/cablam/cablam_training.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
# (jEdit options) :folding=explicit:collapseFolds=1:
#This module contains the training/exploration components of cablam
#It can be run stand-alone with many commandline options
#It is intended for use in determining contours, motif fingerprints, etc for
... | 41.562652 | 259 | 0.629549 | from __future__ import absolute_import, division, print_function
import os, sys
from iotbx import pdb
from mmtbx.cablam import cablam_res
# geometric and probe measures and can look forward and backward in sequence
from mmtbx.cablam import cablam_math #contains geometric measure calcu... | true | true |
1c2db4051f1a13e119f743784e73c0796eecc5d3 | 15,892 | py | Python | kolibri/core/auth/api.py | khangmach/kolibri | f4b89b8262effe68a407edc032a735d5a1b0b71b | [
"MIT"
] | null | null | null | kolibri/core/auth/api.py | khangmach/kolibri | f4b89b8262effe68a407edc032a735d5a1b0b71b | [
"MIT"
] | null | null | null | kolibri/core/auth/api.py | khangmach/kolibri | f4b89b8262effe68a407edc032a735d5a1b0b71b | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import time
from django.contrib.auth import authenticate
from django.contrib.auth import get_user
from django.contrib.auth import login
from django.contrib.auth import logout
from django.contrib.auth i... | 36.87239 | 102 | 0.67921 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import time
from django.contrib.auth import authenticate
from django.contrib.auth import get_user
from django.contrib.auth import login
from django.contrib.auth import logout
from django.contrib.auth i... | true | true |
1c2db46600b0b2fa6fff8480c70ee198eb0e8b1a | 237 | py | Python | bits_wilp/sumOfDigits.py | deepak5998/Py | 5ae3bd9e8dcf3104a8ca7512911a1607f6c9ae20 | [
"MIT"
] | 726 | 2019-06-04T04:46:06.000Z | 2022-03-31T17:54:00.000Z | bits_wilp/sumOfDigits.py | Ishajj/Python-Interview-Problems-for-Practice | 12ece68be497757e2aad8a07c29399856de782da | [
"MIT"
] | 12 | 2019-06-05T14:21:35.000Z | 2021-04-17T05:11:01.000Z | bits_wilp/sumOfDigits.py | Ishajj/Python-Interview-Problems-for-Practice | 12ece68be497757e2aad8a07c29399856de782da | [
"MIT"
] | 118 | 2019-06-04T10:25:12.000Z | 2022-02-04T22:31:12.000Z | def sumOfDigits(n):
sum = 0
while n > 0:
rem = n % 10
sum = sum + rem
n = n // 10
return sum
print("Please enter a number: ")
num = int(input())
sod = sumOfDigits(num)
print("The sum of digits for", num, "is", sod)
| 18.230769 | 46 | 0.56962 | def sumOfDigits(n):
sum = 0
while n > 0:
rem = n % 10
sum = sum + rem
n = n // 10
return sum
print("Please enter a number: ")
num = int(input())
sod = sumOfDigits(num)
print("The sum of digits for", num, "is", sod)
| true | true |
1c2db4c46ce12cac94c3d473662f4b32112e937b | 305 | py | Python | src/core/factory/mysql/customer_factory.py | lucassaporetti/car-rental | 6e37032df3a399b78ed3d7998a2cb31a2a84d033 | [
"MIT"
] | 1 | 2021-02-11T18:45:12.000Z | 2021-02-11T18:45:12.000Z | src/core/factory/mysql/customer_factory.py | lucassaporetti/car-rental | 6e37032df3a399b78ed3d7998a2cb31a2a84d033 | [
"MIT"
] | null | null | null | src/core/factory/mysql/customer_factory.py | lucassaporetti/car-rental | 6e37032df3a399b78ed3d7998a2cb31a2a84d033 | [
"MIT"
] | null | null | null |
from core.config.app_configs import AppConfigs
from src.core.factory.mysql.mysql_factory import MySqlFactory
class CustomerFactory(MySqlFactory):
sql_template_file = "sql/mysql/ddl/customer_templates.properties"
def __init__(self):
super().__init__(CustomerFactory.sql_template_file)
| 25.416667 | 69 | 0.796721 |
from core.config.app_configs import AppConfigs
from src.core.factory.mysql.mysql_factory import MySqlFactory
class CustomerFactory(MySqlFactory):
sql_template_file = "sql/mysql/ddl/customer_templates.properties"
def __init__(self):
super().__init__(CustomerFactory.sql_template_file)
| true | true |
1c2db5343cc59db58bf404f7bd56fa843789dea3 | 22,945 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_11_01/operations/_virtual_network_peerings_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_11_01/operations/_virtual_network_peerings_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_11_01/operations/_virtual_network_peerings_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 51.911765 | 250 | 0.67993 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
1c2db539dea968d76fd87b98ec5526bd68909b9e | 48,324 | py | Python | catkin_ws/simulation/rviz_tools_py-master/src/rviz_tools_py/rviz_tools.py | fontysrobotics/Blackboard_based_distributed_fleet_manager | a6b44738fe67f4948a69f8d45da58d981c6724e0 | [
"BSD-3-Clause"
] | null | null | null | catkin_ws/simulation/rviz_tools_py-master/src/rviz_tools_py/rviz_tools.py | fontysrobotics/Blackboard_based_distributed_fleet_manager | a6b44738fe67f4948a69f8d45da58d981c6724e0 | [
"BSD-3-Clause"
] | null | null | null | catkin_ws/simulation/rviz_tools_py-master/src/rviz_tools_py/rviz_tools.py | fontysrobotics/Blackboard_based_distributed_fleet_manager | a6b44738fe67f4948a69f8d45da58d981c6724e0 | [
"BSD-3-Clause"
] | 2 | 2018-09-04T06:44:21.000Z | 2018-10-15T02:30:50.000Z | #!/usr/bin/env python
# Copyright (c) 2015, Carnegie Mellon University
# All rights reserved.
# Authors: David Butterworth <dbworth@cmu.edu>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of sour... | 34.890975 | 131 | 0.601813 |
import numpy
import random
import roslib
import rospy
import tf
from std_msgs.msg import Header, ColorRGBA
from geometry_msgs.msg import Transform
from geometry_msgs.msg import Pose
from geometry_msgs.msg import Point, Point32
from geometry_msgs.msg import Vector3
from geometry_msgs.... | true | true |
1c2db61108d3ddcf50a9cebbf14fa96f71e52ba6 | 20,697 | py | Python | vendor/github.com/elastic/beats/libbeat/tests/system/beat/beat.py | opheelia/Blockchainbeat | cf2b2ab5778bbc88bb0346ce7624a3dda4438f74 | [
"Apache-2.0"
] | null | null | null | vendor/github.com/elastic/beats/libbeat/tests/system/beat/beat.py | opheelia/Blockchainbeat | cf2b2ab5778bbc88bb0346ce7624a3dda4438f74 | [
"Apache-2.0"
] | null | null | null | vendor/github.com/elastic/beats/libbeat/tests/system/beat/beat.py | opheelia/Blockchainbeat | cf2b2ab5778bbc88bb0346ce7624a3dda4438f74 | [
"Apache-2.0"
] | 1 | 2019-08-23T11:02:35.000Z | 2019-08-23T11:02:35.000Z | import subprocess
import jinja2
import unittest
import os
import shutil
import json
import signal
import sys
import time
import yaml
import hashlib
import re
from datetime import datetime, timedelta
from .compose import ComposeMixin
BEAT_REQUIRED_FIELDS = ["@timestamp",
"beat.name", "beat.ho... | 32.90461 | 110 | 0.54119 | import subprocess
import jinja2
import unittest
import os
import shutil
import json
import signal
import sys
import time
import yaml
import hashlib
import re
from datetime import datetime, timedelta
from .compose import ComposeMixin
BEAT_REQUIRED_FIELDS = ["@timestamp",
"beat.name", "beat.ho... | true | true |
1c2db69ea1868e18381c8304ddbb18cbc4d74acc | 3,381 | py | Python | ldaptor/protocols/ldap/proxy.py | tv42/ldaptor | 3f227602c8c021b9e943136a2dc8d7db44a11e50 | [
"MIT"
] | 1 | 2015-11-25T04:01:26.000Z | 2015-11-25T04:01:26.000Z | ldaptor/protocols/ldap/proxy.py | tv42/ldaptor | 3f227602c8c021b9e943136a2dc8d7db44a11e50 | [
"MIT"
] | null | null | null | ldaptor/protocols/ldap/proxy.py | tv42/ldaptor | 3f227602c8c021b9e943136a2dc8d7db44a11e50 | [
"MIT"
] | 2 | 2019-11-06T02:14:10.000Z | 2022-01-10T08:34:11.000Z | """LDAP protocol proxy server"""
from twisted.internet import reactor, defer
from ldaptor.protocols.ldap import ldapserver, ldapconnector, ldapclient
from ldaptor.protocols import pureldap
class Proxy(ldapserver.BaseLDAPServer):
protocol = ldapclient.LDAPClient
client = None
waitingConnect = []
unbou... | 30.736364 | 81 | 0.630287 |
from twisted.internet import reactor, defer
from ldaptor.protocols.ldap import ldapserver, ldapconnector, ldapclient
from ldaptor.protocols import pureldap
class Proxy(ldapserver.BaseLDAPServer):
protocol = ldapclient.LDAPClient
client = None
waitingConnect = []
unbound = False
def __init__(self... | true | true |
1c2db776e42abd808e2f2cbd7dd5ca11a3103424 | 7,930 | py | Python | nailgun/nailgun/db/sqlalchemy/fixman.py | Axam/nsx-web | 4f60d71c05e08740cbdf19b6c9bb0c4cb1e29ad5 | [
"Apache-2.0"
] | 1 | 2021-04-06T16:13:35.000Z | 2021-04-06T16:13:35.000Z | nailgun/nailgun/db/sqlalchemy/fixman.py | Axam/nsx-web | 4f60d71c05e08740cbdf19b6c9bb0c4cb1e29ad5 | [
"Apache-2.0"
] | null | null | null | nailgun/nailgun/db/sqlalchemy/fixman.py | Axam/nsx-web | 4f60d71c05e08740cbdf19b6c9bb0c4cb1e29ad5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 34.181034 | 79 | 0.533291 |
from datetime import datetime
import itertools
import jinja2
import os.path
import Queue
import StringIO
import sys
import yaml
from sqlalchemy import orm
import sqlalchemy.types
from nailgun.db import db
from nailgun.db.sqlalchemy import models
from nailgun.logger import logger
from nailgun import ob... | true | true |
1c2db84513bb862f7de4e8448a426a3edf339f82 | 9,217 | py | Python | community-content/tf_keras_text_classification_distributed_single_worker_gpus_with_gcloud_local_run_and_vertex_sdk/trainer/task.py | lclc19/vertex-ai-samples | 1844df54a6fc3d7afff1110a6758afaf13181b19 | [
"Apache-2.0"
] | null | null | null | community-content/tf_keras_text_classification_distributed_single_worker_gpus_with_gcloud_local_run_and_vertex_sdk/trainer/task.py | lclc19/vertex-ai-samples | 1844df54a6fc3d7afff1110a6758afaf13181b19 | [
"Apache-2.0"
] | null | null | null | community-content/tf_keras_text_classification_distributed_single_worker_gpus_with_gcloud_local_run_and_vertex_sdk/trainer/task.py | lclc19/vertex-ai-samples | 1844df54a6fc3d7afff1110a6758afaf13181b19 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.565068 | 100 | 0.726701 |
import argparse
import os
import tensorflow as tf
from tensorflow.keras import layers, losses
from tensorflow.keras.layers.experimental.preprocessing import TextVectorization
import distribution_utils
import utils
VOCAB_SIZE = 10000
MAX_SEQUENCE_LENGTH = 250
def parse_args():
parser = argparse.Arg... | true | true |
1c2db91ba45746a7d95ab225a22bd3eb8692c5dc | 2,592 | py | Python | Prediction based on convolutional neural network/code/reference/mnist_train.py | Asurada2015/Test | 14d92c9cb88d293340d76b20d31ca937052addb6 | [
"Apache-2.0"
] | null | null | null | Prediction based on convolutional neural network/code/reference/mnist_train.py | Asurada2015/Test | 14d92c9cb88d293340d76b20d31ca937052addb6 | [
"Apache-2.0"
] | null | null | null | Prediction based on convolutional neural network/code/reference/mnist_train.py | Asurada2015/Test | 14d92c9cb88d293340d76b20d31ca937052addb6 | [
"Apache-2.0"
] | 1 | 2018-11-16T03:46:14.000Z | 2018-11-16T03:46:14.000Z | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import mnist_inference
import os
# 配置神经网络参数
BATCH_SIZE = 100 # 批处理数据大小
LEARNING_RATE_BASE = 0.8 # 基础学习率
LEARNING_RATE_DECAY = 0.99 # 学习率衰减速度
REGULARIZATION_RATE = 0.0001 # 正则化项
TRAINING_STEPS = 30000 # 训练次数
MOVING_AVERAGE_DECAY = 0... | 40.5 | 116 | 0.710648 | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import mnist_inference
import os
BATCH_SIZE = 100
LEARNING_RATE_BASE = 0.8
LEARNING_RATE_DECAY = 0.99
REGULARIZATION_RATE = 0.0001
TRAINING_STEPS = 30000
MOVING_AVERAGE_DECAY = 0.99
MODEL_SAVE_PATH = "MNIST_model/"
MODEL_NA... | true | true |
1c2db9e2ec179c8bdde9e3dc44d50955fbe6c743 | 15,111 | py | Python | lib/jnpr/healthbot/swagger/models/rule_schema.py | minefuto/healthbot-py-client | bb81452c974456af44299aebf32a73abeda8a943 | [
"Apache-2.0"
] | null | null | null | lib/jnpr/healthbot/swagger/models/rule_schema.py | minefuto/healthbot-py-client | bb81452c974456af44299aebf32a73abeda8a943 | [
"Apache-2.0"
] | null | null | null | lib/jnpr/healthbot/swagger/models/rule_schema.py | minefuto/healthbot-py-client | bb81452c974456af44299aebf32a73abeda8a943 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Healthbot APIs
API interface for Healthbot application # noqa: E501
OpenAPI spec version: 1.0.0
Contact: healthbot-hackers@juniper.net
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RuleSchema(o... | 31.679245 | 276 | 0.610615 |
import pprint
import re
import six
class RuleSchema(object):
swagger_types = {
'description': 'str',
'field': 'list[RuleSchemaField]',
'function': 'list[RuleSchemaFunction]',
'keys': 'list[str]',
'network_rule': 'list[ERRORUNKNOWN]',
'rule_frequency': 'str',... | true | true |
1c2dbabee38b958cf582568343d598c8386b4440 | 286 | py | Python | src/betterproto/compile/naming.py | DK99/python-betterproto | d213abca03c90d0690e5e4d23894d51751478098 | [
"MIT"
] | 708 | 2019-10-11T06:23:40.000Z | 2022-03-31T09:39:08.000Z | src/betterproto/compile/naming.py | DK99/python-betterproto | d213abca03c90d0690e5e4d23894d51751478098 | [
"MIT"
] | 302 | 2019-11-11T22:09:21.000Z | 2022-03-29T11:21:04.000Z | src/betterproto/compile/naming.py | DK99/python-betterproto | d213abca03c90d0690e5e4d23894d51751478098 | [
"MIT"
] | 122 | 2019-12-04T16:22:53.000Z | 2022-03-20T09:31:10.000Z | from betterproto import casing
def pythonize_class_name(name: str) -> str:
return casing.pascal_case(name)
def pythonize_field_name(name: str) -> str:
return casing.safe_snake_case(name)
def pythonize_method_name(name: str) -> str:
return casing.safe_snake_case(name)
| 20.428571 | 44 | 0.755245 | from betterproto import casing
def pythonize_class_name(name: str) -> str:
return casing.pascal_case(name)
def pythonize_field_name(name: str) -> str:
return casing.safe_snake_case(name)
def pythonize_method_name(name: str) -> str:
return casing.safe_snake_case(name)
| true | true |
1c2dbac173571edf8c02d33825652024a416aa0a | 3,568 | py | Python | huaweicloud-sdk-elb/huaweicloudsdkelb/v3/model/show_member_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-elb/huaweicloudsdkelb/v3/model/show_member_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-elb/huaweicloudsdkelb/v3/model/show_member_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowMemberRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key ... | 25.485714 | 79 | 0.549888 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowMemberRequest:
sensitive_list = []
openapi_types = {
'member_id': 'str',
'pool_id': 'str'
}
attribute_map = {
'member_id': 'member_id',
'pool_id': 'pool_i... | true | true |
1c2dbb45650af032de5cca54d07f7432cdd8c925 | 60,536 | py | Python | tests/test_xpath1_parser.py | linw1995/elementpath | 3a1105a51295a0dc4410a0ac1231ca8700a54db1 | [
"MIT"
] | null | null | null | tests/test_xpath1_parser.py | linw1995/elementpath | 3a1105a51295a0dc4410a0ac1231ca8700a54db1 | [
"MIT"
] | null | null | null | tests/test_xpath1_parser.py | linw1995/elementpath | 3a1105a51295a0dc4410a0ac1231ca8700a54db1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c), 2018-2019, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/lice... | 50.029752 | 115 | 0.573989 |
import unittest
import sys
import io
import math
import pickle
from decimal import Decimal
from collections import namedtuple
from xml.etree import ElementTree
try:
import lxml.etree as lxml_etree
except ImportError:
lxml_etree = None
from elementpath import *
from elementpath.namespaces... | true | true |
1c2dbcfe1ac7e8d9f58c1afcd5a420bf678d47d8 | 22,118 | py | Python | src/virtual-wan/azext_vwan/vendored_sdks/v2021_03_01/v2021_03_01/operations/_virtual_hub_ip_configuration_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2021_03_01/v2021_03_01/operations/_virtual_hub_ip_configuration_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2021_03_01/v2021_03_01/operations/_virtual_hub_ip_configuration_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.040724 | 223 | 0.668008 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
1c2dbcfec9ff34a834ed87b4ac2e2111e2ff2a7a | 2,348 | py | Python | app/modules/core/tests/fixtures.py | nickmoreton/nhsx-website | 2397d1308376c02b75323d30e6bc916af0daac9d | [
"MIT"
] | null | null | null | app/modules/core/tests/fixtures.py | nickmoreton/nhsx-website | 2397d1308376c02b75323d30e6bc916af0daac9d | [
"MIT"
] | null | null | null | app/modules/core/tests/fixtures.py | nickmoreton/nhsx-website | 2397d1308376c02b75323d30e6bc916af0daac9d | [
"MIT"
] | null | null | null | # 3rd party
import json
from typing import List
import pytest
from wagtail.core.models import Page
from modules.core.models import SectionPage, ArticlePage
from .blocks import RICHTEXT_BLOCK, PROMO, SMALL_PROMO
pytestmark = pytest.mark.django_db
def _create_section_page(title: str, parent: Page) -> SectionPage:
... | 26.382022 | 78 | 0.691227 |
import json
from typing import List
import pytest
from wagtail.core.models import Page
from modules.core.models import SectionPage, ArticlePage
from .blocks import RICHTEXT_BLOCK, PROMO, SMALL_PROMO
pytestmark = pytest.mark.django_db
def _create_section_page(title: str, parent: Page) -> SectionPage:
p = Sectio... | true | true |
1c2dbe4a08bd41bf72da14d26c0d265c7ca59c69 | 231 | py | Python | 11799/horror_dash.py | sc458/uHunt-solutions | 37464e1db98c897995eab79caa6c70f379ad877a | [
"MIT"
] | null | null | null | 11799/horror_dash.py | sc458/uHunt-solutions | 37464e1db98c897995eab79caa6c70f379ad877a | [
"MIT"
] | null | null | null | 11799/horror_dash.py | sc458/uHunt-solutions | 37464e1db98c897995eab79caa6c70f379ad877a | [
"MIT"
] | null | null | null |
num = int(input())
for i in range(0,num):
arr = input()
arr = arr.split(' ')
ints = []
for j in range(0,len(arr)):
ints.append(int(arr[j]))
print('Case ' + str(i+1) + ': ' + str(max(ints)))
| 10.5 | 51 | 0.467532 |
num = int(input())
for i in range(0,num):
arr = input()
arr = arr.split(' ')
ints = []
for j in range(0,len(arr)):
ints.append(int(arr[j]))
print('Case ' + str(i+1) + ': ' + str(max(ints)))
| true | true |
1c2dbed81b714154b35521eda4ccf58ad3c299db | 496 | py | Python | python/5.py | dpetker/project-euler | d232367d5f21821871c53d6ecc43c8d6af801d2c | [
"MIT"
] | null | null | null | python/5.py | dpetker/project-euler | d232367d5f21821871c53d6ecc43c8d6af801d2c | [
"MIT"
] | null | null | null | python/5.py | dpetker/project-euler | d232367d5f21821871c53d6ecc43c8d6af801d2c | [
"MIT"
] | null | null | null | # Soultion for Project Euler Problem #5 - https://projecteuler.net/problem=5
# (c) 2016 dpetker
# Start with this as the problem states its the smallest value evenly divisible
# by 1-10
test_val = 2520
def test_divisors(n):
for i in range(1, 21):
if n % i != 0:
return False
return True
while True:
t... | 23.619048 | 120 | 0.705645 | (n):
for i in range(1, 21):
if n % i != 0:
return False
return True
while True:
test_val += 20
if test_divisors(test_val):
break
print('The smallest positive number that is evenly divisible by all of the numbers from 1 to 20 is {}'.format(test_val))
| true | true |
1c2dbf0093f5b08eb9f80e323c62cbac7485263c | 875 | py | Python | tx_parse_xml/acl__prop_to_title.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | tx_parse_xml/acl__prop_to_title.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | tx_parse_xml/acl__prop_to_title.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from pathlib import Path
from bs4 import BeautifulSoup
FILE_NAME_ACL = Path(r'C:\<...>\ads\<...>\src\<...>.xml')
FILE_NAME_ACL_LOCALE = FILE_NAME_ACL.parent.parent / 'locale' / 'en' / ('mlb' + FILE_NAME_ACL.name)
root_acl = BeautifulSoup(open(F... | 25.735294 | 99 | 0.659429 |
__author__ = 'ipetrash'
from pathlib import Path
from bs4 import BeautifulSoup
FILE_NAME_ACL = Path(r'C:\<...>\ads\<...>\src\<...>.xml')
FILE_NAME_ACL_LOCALE = FILE_NAME_ACL.parent.parent / 'locale' / 'en' / ('mlb' + FILE_NAME_ACL.name)
root_acl = BeautifulSoup(open(FILE_NAME_ACL, 'rb'), 'html.parser')
root_acl_... | true | true |
1c2dbf26a88b8fd1f7357b6ade26d3238a810da4 | 51,362 | py | Python | detect_trucks/TruckDetector.py | hfisser/s2_trucks | 323e73edb82e314e6695e8cf8d89c2de22f54b04 | [
"MIT"
] | 4 | 2021-06-17T07:44:16.000Z | 2021-10-15T22:32:12.000Z | detect_trucks/TruckDetector.py | hfisser/s2_trucks | 323e73edb82e314e6695e8cf8d89c2de22f54b04 | [
"MIT"
] | null | null | null | detect_trucks/TruckDetector.py | hfisser/s2_trucks | 323e73edb82e314e6695e8cf8d89c2de22f54b04 | [
"MIT"
] | null | null | null | ####################################################
# Author: Henrik Fisser, 2020
####################################################
from array_utils.plot import plot_img
import os, warnings
import pandas as pd
import numpy as np
import geopandas as gpd
import xarray as xr
from shapely.geometry import box
from sci... | 52.517382 | 134 | 0.580663 | (metadata, dict):
raise TypeError("'metadata' must be a dictionary")
self.crs = metadata["crs"]
try:
self.lat, self.lon = metadata["lat"], metadata["lon"]
except KeyError:
try:
self.lat, self.lon = lat_from_meta(metadata), lon_from_meta(metadat... | true | true |
1c2dbf27ffce954a671517058c5126dc69927784 | 668 | py | Python | __main__.py | cmgoffena13/Obelisk-Mint | 2715bcc214c8d72a6b15bd549c5fcd1caee65c9a | [
"MIT"
] | 1 | 2022-02-18T18:05:46.000Z | 2022-02-18T18:05:46.000Z | __main__.py | cmgoffena13/Obelisk-Mint | 2715bcc214c8d72a6b15bd549c5fcd1caee65c9a | [
"MIT"
] | null | null | null | __main__.py | cmgoffena13/Obelisk-Mint | 2715bcc214c8d72a6b15bd549c5fcd1caee65c9a | [
"MIT"
] | null | null | null | # Runs entire Obelisk ETL process
from Obelisk.mint.mint_extract import Mint_API
import os
file_path = os.path.abspath(os.path.dirname(__file__))
full_load = False
if __name__ == '__main__':
os.system(f"{file_path}\\venv\\Scripts\\activate")
print('Starting Obelisk ETL')
print('Starting Obel... | 26.72 | 55 | 0.693114 |
from Obelisk.mint.mint_extract import Mint_API
import os
file_path = os.path.abspath(os.path.dirname(__file__))
full_load = False
if __name__ == '__main__':
os.system(f"{file_path}\\venv\\Scripts\\activate")
print('Starting Obelisk ETL')
print('Starting Obelisk Extracts')
Mint = Mint_AP... | true | true |
1c2dbf6bdda6a28c5754429390f06bef5c7536aa | 394 | py | Python | 1_Basic/3_Operators/5_identity.py | hauntarl/real-python | 6ffb535648bf5c79c90e2ed7def842078bc7807f | [
"MIT"
] | 2 | 2020-12-15T18:11:00.000Z | 2021-03-01T11:43:16.000Z | 1_Basic/3_Operators/5_identity.py | hauntarl/real_python | 6ffb535648bf5c79c90e2ed7def842078bc7807f | [
"MIT"
] | null | null | null | 1_Basic/3_Operators/5_identity.py | hauntarl/real_python | 6ffb535648bf5c79c90e2ed7def842078bc7807f | [
"MIT"
] | null | null | null | # Python provides two operators, is and is not,
# that determine whether the given operands have the
# same identity i.e. refer to the same object.
# This is not the same thing as equality, which means
# the two operands refer to objects that contain the
# same data but are not necessarily the same object.
x = 1001
y =... | 35.818182 | 53 | 0.692893 |
x = 1001
y = 1000
print('x == y + 1 ?', x == y + 1)
print('x is y + 1 ?', x is y + 1)
| true | true |
1c2dbfb659d1a96969b90a2470a0bb0aa4f4c5cc | 1,669 | py | Python | MNIST_NN_VS_SVM/plots.py | ahmednader10/Machine_Learning | fab0c7cd773b5e001b56c5349550085e34661e4d | [
"MIT"
] | null | null | null | MNIST_NN_VS_SVM/plots.py | ahmednader10/Machine_Learning | fab0c7cd773b5e001b56c5349550085e34661e4d | [
"MIT"
] | null | null | null | MNIST_NN_VS_SVM/plots.py | ahmednader10/Machine_Learning | fab0c7cd773b5e001b56c5349550085e34661e4d | [
"MIT"
] | null | null | null | import pandas as pd
import sklearn
from sklearn.neural_network import MLPClassifier, MLPRegressor
from sklearn.model_selection import train_test_split
from sklearn.svm import LinearSVC, SVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn import prep... | 37.931818 | 77 | 0.729778 | import pandas as pd
import sklearn
from sklearn.neural_network import MLPClassifier, MLPRegressor
from sklearn.model_selection import train_test_split
from sklearn.svm import LinearSVC, SVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn import prep... | true | true |
1c2dc2471b76dea8ec3d401a10cdefe4721804b6 | 795 | py | Python | employee/forms.py | FahadulShadhin/crudapp | cd82596a6261e15388c737e8399c3d20bb9c372a | [
"MIT"
] | null | null | null | employee/forms.py | FahadulShadhin/crudapp | cd82596a6261e15388c737e8399c3d20bb9c372a | [
"MIT"
] | 1 | 2022-01-03T06:37:17.000Z | 2022-01-03T13:09:11.000Z | employee/forms.py | FahadulShadhin/crudapp | cd82596a6261e15388c737e8399c3d20bb9c372a | [
"MIT"
] | 1 | 2022-03-23T17:02:22.000Z | 2022-03-23T17:02:22.000Z | from django import forms
from django.forms import ModelForm
from .models import Employee
class EmployeeForm(ModelForm):
class Meta:
model = Employee
fields = ('emp_name', 'emp_email', 'emp_contact', 'emp_role', 'emp_salary', 'image')
widgets = {
'emp_name': forms.TextI... | 46.764706 | 106 | 0.61761 | from django import forms
from django.forms import ModelForm
from .models import Employee
class EmployeeForm(ModelForm):
class Meta:
model = Employee
fields = ('emp_name', 'emp_email', 'emp_contact', 'emp_role', 'emp_salary', 'image')
widgets = {
'emp_name': forms.TextI... | true | true |
1c2dc38c10e4fa3324ca5f1d9f5ae10cfed1dc0b | 33,710 | py | Python | cartridge/shop/models.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | cartridge/shop/models.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | cartridge/shop/models.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null |
from __future__ import division, unicode_literals
from future.builtins import str, super
from future.utils import with_metaclass
from decimal import Decimal
from functools import reduce
from operator import iand, ior
from django.core.urlresolvers import reverse
from django.db import models, connection
from django.db... | 39.061414 | 79 | 0.625037 |
from __future__ import division, unicode_literals
from future.builtins import str, super
from future.utils import with_metaclass
from decimal import Decimal
from functools import reduce
from operator import iand, ior
from django.core.urlresolvers import reverse
from django.db import models, connection
from django.db... | true | true |
1c2dc5337abd79b8f0b9228777e2f687113e494c | 3,068 | py | Python | TheDigger_src/lib/dns_handler.py | Jistrokz/TheDigger | d2831b0b8fdf75595c4049d885abb3e6a79b9a30 | [
"MIT"
] | 5 | 2021-06-20T16:49:06.000Z | 2022-03-03T07:21:42.000Z | TheDigger_src/lib/dns_handler.py | Jistrokz/TheDigger | d2831b0b8fdf75595c4049d885abb3e6a79b9a30 | [
"MIT"
] | null | null | null | TheDigger_src/lib/dns_handler.py | Jistrokz/TheDigger | d2831b0b8fdf75595c4049d885abb3e6a79b9a30 | [
"MIT"
] | null | null | null | from dns import resolver
from asyncio.subprocess import PIPE, create_subprocess_exec
from requests.exceptions import ConnectionError
from TheDigger_src.utils.help_utils import HelpUtilities
from TheDigger_src.utils.exceptions import TheDiggerException
from TheDigger_src.utils.logger import Logger
from TheDigger_src.uti... | 39.844156 | 118 | 0.610821 | from dns import resolver
from asyncio.subprocess import PIPE, create_subprocess_exec
from requests.exceptions import ConnectionError
from TheDigger_src.utils.help_utils import HelpUtilities
from TheDigger_src.utils.exceptions import TheDiggerException
from TheDigger_src.utils.logger import Logger
from TheDigger_src.uti... | true | true |
1c2dc589b65e5e2a15c250e688b9e52057911300 | 760 | py | Python | dali/python/nvidia/dali/__init__.py | SamanthaFeidFischer/DALI | 1c57da0a4ea210dad4219db2b217d04c319c308e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | dali/python/nvidia/dali/__init__.py | SamanthaFeidFischer/DALI | 1c57da0a4ea210dad4219db2b217d04c319c308e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | dali/python/nvidia/dali/__init__.py | SamanthaFeidFischer/DALI | 1c57da0a4ea210dad4219db2b217d04c319c308e | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-07-03T00:34:07.000Z | 2020-07-03T00:34:07.000Z | # Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 34.545455 | 74 | 0.767105 |
from __future__ import absolute_import
from . import ops
from . import pipeline
from . import tensor
from . import tfrecord
from . import types
| true | true |
1c2dc60dba7987b05d5eb2937f05b5bc2b7d68dd | 400 | py | Python | src/beanmachine/ppl/compiler/hint.py | rodrigodesalvobraz/beanmachine-1 | 1c0d5ffeb505167f581e518809ea1320861bdf18 | [
"MIT"
] | 1 | 2021-12-22T13:19:14.000Z | 2021-12-22T13:19:14.000Z | src/beanmachine/ppl/compiler/hint.py | rodrigodesalvobraz/beanmachine-1 | 1c0d5ffeb505167f581e518809ea1320861bdf18 | [
"MIT"
] | null | null | null | src/beanmachine/ppl/compiler/hint.py | rodrigodesalvobraz/beanmachine-1 | 1c0d5ffeb505167f581e518809ea1320861bdf18 | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Operations that are intended as hints to the Beanstalk compiler"""
import math
import torch
def math_log1mexp(x):
return math.log... | 21.052632 | 69 | 0.72 |
import math
import torch
def math_log1mexp(x):
return math.log(1.0 - math.exp(x))
def log1mexp(x):
return torch.log(1.0 - torch.exp(x))
| true | true |
1c2dc82c5a5b3819257130d67fab3879c58e5685 | 10,090 | py | Python | integrations/test_lightning.py | gagan3012/metrics | 5a2388ccaa97cc3608b1fa28879f77436434a6d6 | [
"Apache-2.0"
] | 1 | 2021-09-14T23:34:48.000Z | 2021-09-14T23:34:48.000Z | integrations/test_lightning.py | gagan3012/metrics | 5a2388ccaa97cc3608b1fa28879f77436434a6d6 | [
"Apache-2.0"
] | 1 | 2021-10-16T05:02:56.000Z | 2021-12-15T07:02:17.000Z | integrations/test_lightning.py | gagan3012/metrics | 5a2388ccaa97cc3608b1fa28879f77436434a6d6 | [
"Apache-2.0"
] | 2 | 2021-10-16T05:02:43.000Z | 2022-02-10T16:01:52.000Z | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 31.433022 | 102 | 0.603865 |
from unittest import mock
import pytest
import torch
from pytorch_lightning import LightningModule, Trainer
from torch import tensor
from torch.utils.data import DataLoader
from integrations.lightning.boring_model import BoringModel, RandomDataset
from tests.helpers import _LIGHTNING_GREATER_EQUAL_1_3
fr... | true | true |
1c2dc85f5648ba0a8dd851c547d3b60121d6c46a | 897 | py | Python | flask/api/models/Event.py | mktung/tvgs-crm | be992a19b46f7d7eeaf90c9c9105a3630ff20292 | [
"MIT"
] | 1 | 2019-10-18T00:49:27.000Z | 2019-10-18T00:49:27.000Z | flask/api/models/Event.py | mktung/tvgs-crm | be992a19b46f7d7eeaf90c9c9105a3630ff20292 | [
"MIT"
] | null | null | null | flask/api/models/Event.py | mktung/tvgs-crm | be992a19b46f7d7eeaf90c9c9105a3630ff20292 | [
"MIT"
] | null | null | null | from api.core import Mixin
from .base import db
class Event(Mixin, db.Model):
"""Person Table."""
__tablename__ = "event"
id = db.Column(db.Integer, unique=True, primary_key=True)
title = db.Column(db.String, nullable=False)
date = db.Column(db.DATE, nullable=True)
name_of_volunteer = db.Co... | 29.9 | 98 | 0.656633 | from api.core import Mixin
from .base import db
class Event(Mixin, db.Model):
__tablename__ = "event"
id = db.Column(db.Integer, unique=True, primary_key=True)
title = db.Column(db.String, nullable=False)
date = db.Column(db.DATE, nullable=True)
name_of_volunteer = db.Column(db.String, nullable... | true | true |
1c2dc8c1fbbbba6ba513d82076b677947a48c85e | 7,325 | py | Python | ci/test-suite/universal.py | tundranerd/FEBio | fb0ca6d04af51f005d933029df232058a30f1f8f | [
"MIT"
] | null | null | null | ci/test-suite/universal.py | tundranerd/FEBio | fb0ca6d04af51f005d933029df232058a30f1f8f | [
"MIT"
] | null | null | null | ci/test-suite/universal.py | tundranerd/FEBio | fb0ca6d04af51f005d933029df232058a30f1f8f | [
"MIT"
] | null | null | null | REMOTE_RELEASE_DIR = "/root/update2/FEBioStudio/"
REMOTE_DEV_DIR = "/root/update2/FEBioStudioDev/"
exemptTests = ['ri02', 'hi01']
longTests = ['sh24', 'fl37', 'fl36']
dataField = {'bp04': '2.5',
'bi24': '1',
'bp05': '0.1',
'bp07': '2',
'bp08': '2',
'bp09': '2',
'bp10':... | 21.800595 | 49 | 0.275495 | REMOTE_RELEASE_DIR = "/root/update2/FEBioStudio/"
REMOTE_DEV_DIR = "/root/update2/FEBioStudioDev/"
exemptTests = ['ri02', 'hi01']
longTests = ['sh24', 'fl37', 'fl36']
dataField = {'bp04': '2.5',
'bi24': '1',
'bp05': '0.1',
'bp07': '2',
'bp08': '2',
'bp09': '2',
'bp10':... | true | true |
1c2dc95ab3a9dc14f9cb1d3e4fdf13d597524b8d | 7,093 | py | Python | mux_python/models/real_time_breakdown_value.py | moaazsidat/mux-python | 3f03b9dd0761fa1a0cd5bdbeac85ccf4f326508c | [
"MIT"
] | 36 | 2019-02-28T21:18:39.000Z | 2022-03-04T19:58:45.000Z | mux_python/models/real_time_breakdown_value.py | moaazsidat/mux-python | 3f03b9dd0761fa1a0cd5bdbeac85ccf4f326508c | [
"MIT"
] | 7 | 2019-04-01T14:48:34.000Z | 2022-03-04T16:31:34.000Z | mux_python/models/real_time_breakdown_value.py | moaazsidat/mux-python | 3f03b9dd0761fa1a0cd5bdbeac85ccf4f326508c | [
"MIT"
] | 9 | 2019-11-29T03:57:58.000Z | 2022-03-02T17:29:25.000Z | # coding: utf-8
"""
Mux API
Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501
The version of the OpenAPI document: v1
Contact: devex@mux.com
Gener... | 30.311966 | 204 | 0.621176 |
import inspect
import pprint
import re
import six
from mux_python.configuration import Configuration
class RealTimeBreakdownValue(object):
openapi_types = {
'value': 'str',
'negative_impact': 'int',
'metric_value': 'float',
'display_value': 'str',
'concurrent_viewer... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.